/* Florir V2 components. Prefix .f-. Tokens: tokens.css. Which component to use when: the table in DESIGN.md.
   Every component in both themes and all states: library.html. Only tokens here, never theme colors. */

/* ---------- Host and navigation variant ---------- */
.f-host {
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-align: left;
}
.f-host *, .f-host *::before, .f-host *::after { box-sizing: border-box; }
.f-host :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Resets sit in :where() so any component class wins over them. */
:where(.f-host) :where(h1, h2, h3, p, ul, ol, figure, blockquote) { margin: 0; }
:where(.f-host) :where(a) { color: inherit; text-decoration: none; }
:where(.f-host) :where(button) { font: inherit; color: inherit; cursor: pointer; }
[data-nav="steg"] .only-faner, [data-nav="faner"] .only-steg { display: none !important; }
.f-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- Icons (icons.svg, Lucide) ---------- */
.f-icon {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: var(--icon-stroke, 1.75);
  stroke-linecap: round; stroke-linejoin: round;
}
.f-icon--sm { width: 20px; height: 20px; }
.f-icon--xs { width: 16px; height: 16px; }
.f-icon--fill { fill: currentColor; }

/* ---------- Device, phone frame, status bar, home indicator ---------- */
.f-device { display: inline-block; padding: 10px; border-radius: 57px; background: var(--bezel); vertical-align: top; }
.f-phone {
  position: relative; width: 390px; height: 844px; overflow: hidden;
  border-radius: var(--r-display); background: var(--bg); isolation: isolate;
}
.f-island {
  position: absolute; top: 11px; left: 50%; z-index: 6;
  width: 126px; height: 37px; margin-left: -63px; border-radius: 20px; background: #000;
}
.f-status {
  position: absolute; inset: 0 0 auto; z-index: 5; height: var(--status-h);
  display: flex; align-items: center; justify-content: space-between; padding: 4px 28px 0 50px;
  background: var(--bg); color: var(--ink);
  font: 600 17px/1 -apple-system, BlinkMacSystemFont, system-ui, sans-serif; font-variant-numeric: tabular-nums;
}
.f-status svg { display: block; fill: currentColor; }
.f-status__icons { display: flex; align-items: center; gap: 6px; }
.f-screen {
  position: absolute; inset: var(--status-h) 0 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 0 var(--gutter) calc(var(--home-h) + var(--sp-6));
  scrollbar-width: none;
}
.f-screen::-webkit-scrollbar { display: none; }
[data-nav="faner"] .f-screen { padding-bottom: calc(var(--home-h) + 62px + var(--sp-6)); }
.f-homebar {
  position: absolute; bottom: 8px; left: 50%; z-index: 6;
  width: 134px; height: 5px; margin-left: -67px; border-radius: 3px; background: var(--ink);
}
/* A screen shown without the phone frame, for components in the library. */
.f-canvas { box-sizing: border-box; width: 390px; padding: var(--sp-5) var(--gutter); background: var(--bg); border-radius: var(--r-card); }

/* ---------- Navigation: top of Hjem, back button, floating tab bar ---------- */
.f-top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; }
.f-navbar { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin: 0 -8px; }
.f-back {
  display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 8px 0 2px;
  color: var(--heading); font-size: var(--fs-body);
}
.f-iconbtn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--heading);
}
.f-avatar {
  width: var(--tap); height: var(--tap); display: grid; place-items: center; border-radius: 50%;
  background: var(--inset-bg); color: var(--heading); font: var(--fw-strong) var(--fs-sub)/1 var(--font-text);
  box-shadow: inset 0 0 0 1px var(--card-edge);
}
.f-tabbar {
  position: absolute; left: 16px; right: 16px; bottom: 21px; z-index: 4; height: 62px;
  display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 8px 24px rgb(0 0 0 / 10%);   /* it floats */
}
.f-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: var(--r-pill); color: var(--muted);
  font: var(--fw-strong) var(--fs-cap)/1.1 var(--font-text);
}
.f-tab[aria-current="page"] { color: var(--heading); background: var(--track); }

/* ---------- Mark: the wordmark with the logo (FlorirTegning.logo, design/img/logo.svg) ---------- */
.f-mark {
  display: inline-flex; align-items: center; gap: 7px; padding: var(--mark-pad);
  border: 1px solid var(--mark-edge); border-radius: var(--r-pill); color: var(--mark-ink);
  font: var(--mark-weight) var(--mark-size)/1.2 var(--mark-font);
  letter-spacing: var(--mark-tracking); text-transform: var(--mark-case);
}
.f-flower { width: 14px; height: 24px; flex: none; overflow: visible; color: var(--flower); }   /* 436 × 740, one colour */
.f-mark--large { --mark-size: 28px; gap: 12px; }
.f-mark--large .f-flower { width: 24px; height: 41px; }

/* ---------- Text ---------- */
.f-large {
  margin: var(--sp-1) 0 var(--sp-1); color: var(--heading); text-wrap: balance;
  font: var(--fw-display) var(--fs-large)/41px var(--font-display); letter-spacing: var(--tracking-display);
}
.f-title {
  color: var(--heading); text-wrap: balance;
  font: var(--fw-display) var(--fs-title)/34px var(--font-display); letter-spacing: var(--tracking-display);
}
.f-h2 { color: var(--heading); text-wrap: balance; font: var(--fw-display) var(--fs-h2)/28px var(--font-display); letter-spacing: var(--tracking-display); }
.f-h3 { color: var(--heading); font: var(--fw-display) var(--fs-h3)/25px var(--font-display); letter-spacing: var(--tracking-display); }
.f-lead { color: var(--muted); }
.f-muted { color: var(--muted); }
.f-date { color: var(--muted); font-size: var(--fs-sub); font-weight: var(--fw-strong); }
.f-foot { color: var(--faint); font-size: var(--fs-foot); line-height: 18px; }
.f-center { text-align: center; }
.f-label {
  color: var(--label-color); font: var(--label-weight) var(--label-size)/1.3 var(--font-text);
  text-transform: var(--label-case); letter-spacing: var(--label-tracking);
}
.f-credit { color: var(--faint); font-size: var(--fs-foot); line-height: 18px; }

/* ---------- Layout inside a screen ---------- */
.f-stack { display: grid; gap: var(--sp-3); }
.f-section { display: grid; gap: var(--sp-2); margin-top: var(--sp-7); }
.f-section[hidden] { display: none; }
.f-section > .f-label, .f-sechead { padding: 0 var(--sp-1); }
.f-sechead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.f-intro { display: grid; gap: var(--sp-1); margin: var(--sp-2) 0 var(--sp-5); }

/* ---------- Buttons: pills ---------- */
.f-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 22px; border: 0; border-radius: var(--r-pill);   /* 44 pt, decided in duel 3 */
  font: var(--fw-strong) var(--fs-body)/1.2 var(--font-text); text-align: center;
  transition: transform var(--dur) var(--ease);
}
.f-btn:active { transform: scale(.98); }
/* Pressed: the finger gets an answer at once, also on what is not a button. iOS needs a touchstart listener for :active (main.js). */
:is(.f-row, .f-tab, .f-tile, .f-iconbtn, .f-back, .f-link, .f-seg button, .f-day):active { opacity: .6; }
.f-btn--primary { background: var(--action-bg); color: var(--action-ink); }
.f-btn--secondary { background: var(--inset-bg); color: var(--heading); box-shadow: inset 0 0 0 1px var(--hairline); }
.f-btn--quiet { background: none; color: var(--heading); min-height: var(--tap); padding: 0 12px; }
.f-btn--small { min-height: var(--tap); padding: 0 16px; font-size: var(--fs-sub); }
.f-btn--block { width: 100%; }
.f-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.f-pager { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-6); }

/* ---------- Cards ---------- */
.f-card {
  display: grid; gap: var(--sp-3); padding: var(--sp-5);
  background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: var(--r-card);
}

/* ---------- Next step: the one thing Hjem asks for ---------- */
.f-next {
  display: grid; gap: var(--sp-3); padding: var(--sp-5);
  background: var(--next-bg); color: var(--next-ink); border-radius: var(--r-card);
  --progress: var(--next-progress); --track: var(--next-track);
}
.f-next .f-label { color: var(--next-muted); }
.f-next p { color: var(--next-muted); }
.f-next__title {
  color: var(--next-ink); text-wrap: balance;
  font: var(--fw-display) 26px/31px var(--font-display); letter-spacing: var(--tracking-display);
}
.f-next .f-btn--primary { background: var(--next-action-bg); color: var(--next-action-ink); margin-top: var(--sp-1); }

/* ---------- Progress inside a module (never per day, never a streak) ---------- */
.f-progress { display: flex; gap: 4px; }
.f-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--track); }
.f-progress i.on { background: var(--progress); }
.f-progressrow { display: flex; align-items: center; gap: var(--sp-3); }
.f-progressrow .f-progress { flex: 1; }

/* ---------- Lists and rows (one row style per section) ---------- */
.f-list {
  list-style: none; padding: 0 var(--sp-4);
  background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: var(--r-card);
}
.f-list > li + li { border-top: 1px solid var(--hairline); }
.f-row { display: flex; align-items: center; gap: var(--sp-3); min-height: 64px; padding: var(--sp-3) 0; }
.f-row__icon {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--inset-bg); color: var(--heading);
}
.f-row__thumb { width: 56px; height: 56px; flex: none; border-radius: var(--r-tile); object-fit: cover; }
.f-row__body { flex: 1; min-width: 0; display: grid; gap: 1px; }
.f-row__kicker { color: var(--muted); font-size: var(--fs-foot); font-weight: var(--fw-strong); line-height: 18px; }
.f-row__title { font-weight: var(--fw-strong); line-height: 22px; }
.f-row__meta { color: var(--muted); font-size: var(--fs-sub); line-height: 20px; }
.f-row__chev { color: var(--faint); }
.f-row--empty .f-row__title { font-weight: 400; color: var(--muted); }

/* ---------- The parts of Florir (navigation A: the quiet way in from Hjem) ---------- */
.f-parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.f-part {
  display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 80px; padding: var(--sp-2) 2px;
  border-radius: var(--r-tile); background: var(--card-bg); border: 1px solid var(--card-edge);
  color: var(--heading); font: var(--fw-strong) var(--fs-foot)/1.2 var(--font-text);
}

/* ---------- Segmented control (Se, Lytt, Les and the tabs inside a part) ---------- */
.f-seg {
  display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline);
}
.f-seg button {
  flex: 1; min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: var(--r-pill); background: none; color: var(--muted);
  font: var(--fw-strong) var(--fs-sub)/1 var(--font-text);
}
.f-seg button[aria-pressed="true"] { background: var(--selected-bg); color: var(--selected-ink); }

/* ---------- Tags ---------- */
.f-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.f-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: var(--r-tag);
  background: var(--inset-bg); color: var(--muted); font-size: var(--fs-foot); font-weight: var(--fw-strong); line-height: 18px;
}

/* ---------- Media ---------- */
.f-media { position: relative; overflow: hidden; border-radius: var(--r-media); background: var(--surface-2); }
.f-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.f-media--video { aspect-ratio: 4 / 5; }
.f-media--video img { object-position: 50% 30%; }
.f-media--wide { aspect-ratio: 4 / 3; }
.f-media--art { width: 216px; aspect-ratio: 1; margin: var(--sp-2) auto 0; }
.f-play {
  position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--media-scrim); color: var(--on-media);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.f-play .f-icon { width: 28px; height: 28px; fill: currentColor; margin-left: 3px; }

/* ---------- Clip: one clip in three formats ---------- */
.f-clip { display: grid; gap: var(--sp-4); margin-top: var(--sp-5); }
.f-clip [data-panel] { display: none; }
.f-clip[data-format="se"] [data-panel="se"],
.f-clip[data-format="lytt"] [data-panel="lytt"],
.f-clip[data-format="les"] [data-panel="les"] { display: grid; gap: var(--sp-3); }
.f-scrub { position: relative; height: 4px; margin: var(--sp-4) 0 0; border-radius: 2px; background: var(--track); }
.f-scrub > i { position: absolute; inset: 0 auto 0 0; width: var(--at, 30%); border-radius: inherit; background: var(--progress); }
.f-scrub > b {
  position: absolute; top: 50%; left: var(--at, 30%); width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border-radius: 50%; background: var(--progress);
}
.f-times { display: flex; justify-content: space-between; color: var(--faint); font-size: var(--fs-foot); font-variant-numeric: tabular-nums; }
.f-transport { display: flex; align-items: center; justify-content: center; gap: var(--sp-7); }
.f-bigplay {
  width: 72px; height: 72px; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--action-bg); color: var(--action-ink);
}
.f-bigplay .f-icon { width: 30px; height: 30px; fill: currentColor; margin-left: 3px; }
.f-read { max-width: 65ch; }
.f-read p + p { margin-top: var(--sp-3); }

/* ---------- Recipe: hero, ingredients, steps ---------- */
.f-hero { overflow: hidden; background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: var(--r-card); }
.f-hero .f-media { border-radius: 0; }
.f-hero__body { display: grid; gap: var(--sp-2); justify-items: start; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.f-ingr li { display: grid; grid-template-columns: 76px 1fr; gap: var(--sp-3); padding: 11px 0; }
.f-ingr li > span { color: var(--muted); font-variant-numeric: tabular-nums; }
.f-steps { list-style: none; padding: 0; display: grid; gap: var(--sp-4); counter-reset: step; }
.f-steps li { display: grid; grid-template-columns: 32px 1fr; gap: var(--sp-3); counter-increment: step; }
.f-steps li::before {
  content: counter(step); width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  background: var(--inset-bg); color: var(--heading); font: var(--fw-strong) var(--fs-sub)/1 var(--font-text);
  box-shadow: inset 0 0 0 1px var(--hairline);
}

/* ---------- Plan: week, meals, shopping list, Oda ---------- */
.f-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.f-day {
  display: grid; justify-items: center; gap: 4px; min-height: 62px; padding: 9px 0; border: 0;
  border-radius: var(--r-pill); background: none; color: var(--muted); font: var(--fw-strong) var(--fs-foot)/1 var(--font-text);
}
.f-day b { color: var(--ink); font: var(--fw-strong) var(--fs-body)/1 var(--font-text); }
.f-day[aria-pressed="true"] { background: var(--selected-bg); color: var(--selected-ink); }
.f-day[aria-pressed="true"] b { color: inherit; }
.f-group { padding: var(--sp-3) 0 var(--sp-1); color: var(--muted); font-size: var(--fs-foot); font-weight: var(--fw-strong); }
.f-shop { gap: 0; padding: var(--sp-2) var(--sp-4) var(--sp-3); }
.f-check { display: flex; align-items: center; gap: var(--sp-3); min-height: 48px; cursor: pointer; }
.f-check input {
  appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0;
  display: grid; place-items: center; border: 1.5px solid var(--muted); border-radius: 50%; background: none;
}
.f-check input:checked { background: var(--action-bg); border-color: var(--action-bg); }
.f-check input:checked::after {
  content: ""; width: 6px; height: 11px; border: solid var(--action-ink); border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.f-check input:checked ~ span { color: var(--faint); text-decoration: line-through; }
.f-check small { margin-left: auto; color: var(--faint); font-size: var(--fs-sub); }

/* ---------- Reflection: question, diary, lookback, help ---------- */
.f-prompt__q { color: var(--heading); text-wrap: balance; font: var(--fw-display) var(--fs-h2)/28px var(--font-display); letter-spacing: var(--tracking-display); }
.f-textarea {
  display: block; width: 100%; min-height: 112px; padding: 12px 14px; resize: vertical;
  border: 1px solid var(--faint); border-radius: var(--r-tile); background: var(--inset-bg); color: var(--ink);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-text);
}
.f-textarea::placeholder { color: var(--faint); opacity: 1; }
.f-entry { display: grid; gap: 2px; padding: var(--sp-3) 0; }
.f-entry time { color: var(--faint); font-size: var(--fs-foot); font-weight: var(--fw-strong); }
.f-quote blockquote {
  color: var(--heading); text-wrap: balance;
  font: var(--quote-style) var(--fw-display) var(--fs-h3)/28px var(--font-display);
}
.f-theme { grid-template-columns: 72px 1fr; align-items: center; }
.f-theme img { width: 72px; height: 88px; border-radius: var(--r-tile); object-fit: cover; }
.f-theme__body { display: grid; gap: 4px; }

/* ---------- Duel 2: the day as a path (Hjem B) ---------- */
.f-path { list-style: none; padding: 0; display: grid; }
.f-path__step { position: relative; display: grid; grid-template-columns: 40px 1fr; align-items: start; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.f-path__step::before {   /* the line between the steps, decoration only */
  content: ""; position: absolute; left: 19.5px; top: 44px; bottom: 4px; width: 1px; background: var(--track);
}
.f-path__step:last-child::before { display: none; }
.f-path__dot {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: var(--card-bg); color: var(--heading); box-shadow: inset 0 0 0 1px var(--card-edge);
}
.f-path__link { display: flex; align-items: center; gap: var(--sp-3); min-height: 40px; }

/* ---------- Duel 2: the clip with a board (Klipp B delt, C tavle) ---------- */
.f-stage { position: relative; display: grid; gap: var(--sp-3); }
.f-video {   /* placeholder until Maria is filmed in landscape */
  position: relative; margin: 0 calc(-1 * var(--gutter)); aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2);
}
.f-video img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; }
.f-video__ph {
  position: absolute; left: var(--sp-3); bottom: var(--sp-3); padding: 4px 10px; border-radius: var(--r-tag);
  background: var(--bg); color: var(--ink); font-size: var(--fs-foot); font-weight: var(--fw-strong); line-height: 18px;
}
.f-board {
  display: grid; grid-template-columns: 148px 1fr; align-items: center; gap: var(--sp-4);
  margin: 0; padding: var(--sp-4) var(--sp-5); background: var(--card-bg); border: 1px solid var(--card-edge); border-radius: var(--r-card);
}
.f-art { display: block; width: 100%; height: auto; overflow: visible; }
.f-art * { fill: none; stroke: var(--ink); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.f-art .f-art__hl, .f-art .f-art__hl * { fill: var(--next-bg); stroke: none; opacity: 0; transition: opacity var(--dur) var(--ease); }
.f-art .f-art__hl.is-now, .f-art .f-art__hl.is-now * { opacity: 1; }
.f-art .f-art__pt.is-now * { stroke: var(--next-ink); }
.f-art__pt, .f-board__pt { transition: opacity var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.f-art__pt.is-next, .f-board__pt.is-next { opacity: 0; }
.f-board__pts { list-style: none; padding: 0; display: grid; gap: 6px; font-weight: 300; line-height: 22px; }
.f-board__pt { justify-self: start; margin-left: -8px; padding: 2px 8px; border-radius: var(--r-tag); }
.f-board__pt.is-now { background: var(--next-bg); color: var(--next-ink); font-weight: var(--fw-strong); }
.f-sub { min-height: 48px; color: var(--ink); font-size: var(--fs-callout); line-height: 24px; text-align: center; text-wrap: balance; }
.f-player { display: flex; align-items: center; gap: var(--sp-3); }
.f-player .f-scrub { flex: 1; margin: 0; }
.f-player__play {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--action-bg); color: var(--action-ink);
}
.f-player__play .f-icon { fill: currentColor; }
.f-player__time { color: var(--faint); font-size: var(--fs-foot); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Tavle: the board is the main surface, Maria is a round picture in picture. Tap her for the landscape video. */
.f-clip[data-layout="tavle"] .f-board { grid-template-columns: 1fr; gap: var(--sp-5); min-height: 400px; align-content: center; padding: var(--sp-6); }
.f-clip[data-layout="tavle"] .f-art { max-width: 240px; justify-self: center; }
.f-clip[data-layout="tavle"] .f-board__pts { font-size: var(--fs-h3); line-height: 28px; gap: var(--sp-2); }
.f-clip[data-layout="tavle"] .f-video {
  position: absolute; top: var(--sp-4); right: var(--sp-4); z-index: 1; width: 72px; margin: 0;
  aspect-ratio: 1; border-radius: 50%; box-shadow: 0 0 0 3px var(--bg);
}
.f-clip[data-layout="tavle"] .f-video__ph { display: none; }
.f-clip[data-layout="tavle"] .f-sub { min-height: 24px; }
.f-pip { position: absolute; inset: 0; border: 0; border-radius: 50%; background: none; color: var(--on-media); padding: 0; }
.f-pip .f-icon { display: none; }
.f-clip[data-origin="tavle"][data-layout="delt"] .f-pip {
  inset: var(--sp-2) var(--sp-2) auto auto; width: var(--tap); height: var(--tap); display: grid; place-items: center;
  background: var(--media-scrim);
}
.f-clip[data-origin="tavle"][data-layout="delt"] .f-pip .f-icon { display: block; }

/* ---------- Duel 2: recipe tiles (Mat B) and disclosure (Oppskrift B, Plan B) ---------- */
.f-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3) var(--sp-2); }
.f-tile { display: grid; gap: 4px; align-content: start; }
.f-tile img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-tile); margin-bottom: 4px; }
.f-tile__title {   /* two lines in every tile, so the line under starts at the same height (duel 4, M4) */
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 2lh;
  font-size: var(--fs-sub); font-weight: var(--fw-strong); line-height: 20px; overflow-wrap: anywhere; hyphens: auto;
}
.f-tile__meta { color: var(--muted); font-size: var(--fs-foot); line-height: 18px; }
.f-disclose > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 52px; padding: 0 var(--sp-1);
  list-style: none; cursor: pointer; font-weight: var(--fw-strong);
}
.f-disclose > summary::-webkit-details-marker { display: none; }
.f-disclose > summary > .f-icon { color: var(--faint); transition: transform var(--dur) var(--ease); }
.f-disclose[open] > summary > .f-icon { transform: rotate(180deg); }
.f-shop .f-disclose > summary { padding: 0; }

/* ---------- Duel 3: the stamp in the next step (H1) ---------- */
/* Large, cropped by the card edge, tone in tone. Behind the text, so the text keeps AA against --next-stamp. */
.f-next { position: relative; overflow: hidden; isolation: isolate; }
.f-next__stamp {
  position: absolute; top: -14px; right: -18px; z-index: -1; width: 112px; height: 112px;
  display: grid; place-items: center; color: var(--next-stamp); transform: rotate(-8deg); pointer-events: none;
}
.f-next__stamp .f-icon { width: 112px; height: 112px; stroke-width: 1.5; }
.f-next__stamp .f-flower { width: 72px; height: 122px; color: inherit; }

/* ---------- Duel 3: the clip in full screen (K1) ---------- */
/* One system with three shapes: stående video, delt (landscape video over the board) and sirkel (the board, Maria
   in a circle). data-glide is the shape Play glides to. Over video the buttons get a flat shade the contrast check
   can measure; over the board they are light. */
.f-phone > .f-screen--full { inset: 0; padding: 0; overflow: hidden; }
.f-phone > .f-screen--bare { padding-bottom: calc(var(--home-h) + var(--sp-4)); }
.f-phone:has(.f-film:is([data-shape="staende"], [data-shape="delt"])) .f-status { background: var(--media-shade); color: var(--on-media); }
.f-phone:has(.f-film[data-shape="staende"]) .f-homebar { background: var(--on-media); }
.f-film { position: absolute; inset: 0; --glide: calc(var(--dur) * 3); background: var(--bg); }
.f-film__video {
  position: absolute; z-index: 1; top: 0; left: 0; width: 100%; height: 100%; margin: 0; overflow: hidden;
  border-radius: 0; background: var(--surface-2);
  transition: top var(--glide) var(--ease), left var(--glide) var(--ease), width var(--glide) var(--ease),
    height var(--glide) var(--ease), border-radius var(--glide) var(--ease);
}
.f-film__video img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transition: opacity var(--dur) var(--ease); }
.f-film__video .f-video__ph { display: none; bottom: auto; top: calc(var(--status-h) + 64px); }
.f-film[data-shape="delt"] .f-film__video { height: 266px; }   /* status bar + 16:9 */
.f-film[data-shape="delt"] .f-video__ph { display: block; }
.f-film[data-shape="sirkel"] .f-film__video { z-index: 3; top: 108px; left: calc(100% - 104px); width: 88px; height: 88px; border-radius: 44px; box-shadow: 0 0 0 3px var(--bg); }
.f-film[data-shape="sirkel"] .f-film__video img { object-position: 50% 20%; }
.f-film[data-lytt="true"] .f-film__video img { opacity: .3; }
.f-film__board {
  position: absolute; z-index: 2; left: 0; right: 0; top: 100%; bottom: 0; visibility: hidden;
  display: grid; align-content: center; padding: var(--sp-4) var(--gutter) 196px; background: var(--bg);
  transition: top var(--glide) var(--ease), visibility 0s var(--glide);
}
.f-film:not([data-shape="staende"]) .f-film__board { visibility: visible; transition: top var(--glide) var(--ease); }
.f-film[data-shape="delt"] .f-film__board { top: 266px; }
.f-film[data-shape="sirkel"] .f-film__board { top: var(--status-h); padding-top: 72px; }
.f-film[data-ui="a"] .f-film__board { padding-right: 84px; }
.f-film[data-ui="b"] .f-film__board { padding-bottom: 252px; }
.f-film .f-board { grid-template-columns: 1fr; gap: var(--sp-4); }
.f-film .f-art { max-width: 160px; justify-self: center; }
.f-film[data-shape="sirkel"] .f-art { max-width: 220px; }
.f-film[data-shape="sirkel"] .f-board__pts { font-size: var(--fs-h3); line-height: 28px; gap: var(--sp-2); }
.f-film__top, .f-film__side, .f-film__bottom {
  position: absolute; z-index: 4; --ui-bg: var(--card-bg); --ui-ink: var(--heading); --ui-band: transparent;
}
.f-film[data-shape="staende"] :is(.f-film__top, .f-film__side, .f-film__bottom),
.f-film[data-shape="delt"] .f-film__top {
  --ui-bg: var(--media-shade); --ui-ink: var(--on-media); --ui-band: var(--media-shade);
  --progress: var(--on-media); --track: var(--on-media-track); --focus: var(--on-media);
}
.f-film__top { top: var(--status-h); left: 0; right: 0; display: flex; align-items: center; gap: var(--sp-2); min-height: 60px; padding: var(--sp-2) var(--sp-3); }
.f-film__btn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--ui-bg); color: var(--ui-ink);
}
.f-film__count {
  display: flex; align-items: center; gap: var(--sp-2); min-height: 32px; padding: 0 12px; border-radius: var(--r-tag);
  background: var(--ui-bg); color: var(--ui-ink); font-size: var(--fs-foot); font-weight: var(--fw-strong);
}
.f-film__count .f-progress { width: 64px; }
.f-film__side { right: var(--sp-3); bottom: 196px; display: grid; gap: var(--sp-2); }
.f-film__act {
  width: 56px; min-height: 56px; display: grid; place-items: center; align-content: center; gap: 2px; padding: 6px 0;
  border: 0; border-radius: var(--r-pill); background: var(--ui-bg); color: var(--ui-ink);
  font: var(--fw-strong) var(--fs-cap)/1.1 var(--font-text);
}
:is(.f-film__act, .f-film__btn)[aria-pressed="true"], .f-film__act[aria-expanded="true"] { box-shadow: inset 0 0 0 2px currentColor; }
.f-film [data-press="lagret"][aria-pressed="true"] .f-icon { fill: currentColor; }
.f-film__bottom { left: 0; right: 0; bottom: 0; display: grid; gap: var(--sp-3); padding: 0 var(--sp-3) calc(var(--home-h) + var(--sp-2)); }
.f-film__cap { display: grid; gap: 2px; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-tile); background: var(--ui-band); color: var(--ui-ink); }
.f-film[data-ui="a"] .f-film__cap { margin-right: 72px; }
.f-film[data-tekst="false"] .f-film__cap { visibility: hidden; }
.f-film__kicker { font-size: var(--fs-foot); font-weight: var(--fw-strong); line-height: 18px; }
.f-film__sub { line-height: 24px; text-wrap: pretty; }
.f-film .f-player { min-height: var(--tap); padding-right: var(--sp-4); border-radius: var(--r-pill); background: var(--ui-band); color: var(--ui-ink); }
.f-film .f-player__time { color: var(--ui-ink); }
/* B: a quiet band on top (back and title) and one at the bottom (caption, time, the buttons). */
.f-film__bar { background: var(--ui-band); }
.f-film__bar .f-film__btn { background: none; }
.f-film__title { flex: 1; min-width: 0; display: grid; gap: 6px; color: var(--ui-ink); }
.f-film__title p { overflow: hidden; font-size: var(--fs-sub); font-weight: var(--fw-strong); line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.f-film__title .f-progress { width: 96px; }
.f-film[data-ui="b"] .f-film__bottom { gap: var(--sp-2); padding-top: var(--sp-3); }
.f-film[data-ui="b"] .f-film__cap, .f-film[data-ui="b"] .f-player { padding: 0 var(--sp-1); background: none; }
.f-film__row { display: flex; align-items: center; justify-content: space-between; }
.f-film__row .f-player__play { width: 56px; height: 56px; }
/* Les: the text of the clip in a sheet from the bottom. It floats, so it has a shadow. */
.f-film__sheet {
  position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; max-height: 70%; overflow-y: auto;
  display: grid; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5) calc(var(--home-h) + var(--sp-4));
  border-radius: var(--r-card) var(--r-card) 0 0; background: var(--surface); color: var(--ink);
  box-shadow: 0 -8px 24px rgb(0 0 0 / 16%);
}
.f-film__sheet[hidden] { display: none; }
.f-film__sheet .f-sechead { align-items: center; margin-right: -12px; }

/* ---------- Duel 3: steps and ingredients you can tick off while you cook (O1, O2) ---------- */
/* A tick is a tool for the cook: it is never counted, and it is gone when you leave the recipe. */
.f-method { list-style: none; padding: 0; display: grid; gap: var(--sp-3); }
.f-method__step { display: grid; grid-template-columns: var(--tap) 1fr; align-items: start; gap: var(--sp-3); }
.f-method__num {
  width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; border-radius: 50%;
  background: var(--card-bg); color: var(--heading); box-shadow: inset 0 0 0 1px var(--card-edge);
  font: var(--fw-strong) var(--fs-sub)/1 var(--font-text);
}
.f-method__num .f-icon { display: none; }
.f-method__num[aria-pressed="true"] { background: var(--action-bg); color: var(--action-ink); box-shadow: none; }
.f-method__num[aria-pressed="true"] span { display: none; }
.f-method__num[aria-pressed="true"] .f-icon { display: block; }
.f-method__body { min-width: 0; display: grid; gap: var(--sp-2); }
.f-method__text { padding: 10px 0; }
button.f-method__text {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); width: 100%;
  border: 0; background: none; text-align: left; line-height: var(--lh-body);
}
button.f-method__text .f-icon { margin-top: 2px; color: var(--faint); transition: transform var(--dur) var(--ease); }
button.f-method__text[aria-expanded="true"] .f-icon { transform: rotate(180deg); }
.f-method__step:has(.f-method__num[aria-pressed="true"]) .f-method__text { color: var(--muted); }
.f-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); padding-bottom: var(--sp-2); }
.f-chips[hidden] { display: none; }
.f-ing {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: var(--card-bg); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--card-edge); font-size: var(--fs-sub); line-height: 20px;
}
.f-ing::after { content: ""; position: absolute; inset: -4px 0; }   /* 44 pt to tap, 36 to see */
.f-ing b { font-weight: var(--fw-strong); }
.f-ing .f-icon { display: none; margin-left: -4px; }
.f-ing[aria-pressed="true"] { background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--track); }
.f-ing[aria-pressed="true"] .f-icon { display: block; }
.f-check--ing { display: grid; grid-template-columns: 24px 72px 1fr; }
.f-check__amt { color: var(--muted); font-variant-numeric: tabular-nums; }   /* left, decided in duel 3 */
.f-check--ing input:checked ~ span { color: var(--muted); text-decoration: none; }
.f-check--keep { padding: var(--sp-2) 0; }
.f-check--keep input:checked ~ span { color: inherit; text-decoration: none; }

/* ---------- Duel 3: one day or the whole week (P1), and the line to Notater ---------- */
[data-view="dag"] .only-uke, [data-view="uke"] .only-dag { display: none; }
.f-sechead .f-seg button { min-height: 38px; padding: 0 14px; }
.f-week--all { grid-template-columns: repeat(8, 1fr); gap: 2px; margin: 0 -8px; }
.f-link {   /* Markus asked for a line with an underline here, so this one is not a pill */
  display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-1);
  border: 0; background: none; color: var(--heading); font-weight: var(--fw-strong);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}

/* ---------- Duel 3: onboarding (N1) ---------- */
.f-onboard { display: flex; flex-direction: column; gap: var(--sp-5); min-height: 100%; padding-top: var(--sp-3); }
.f-onboard__foot { display: grid; gap: var(--sp-2); margin-top: auto; padding-top: var(--sp-4); }
.f-field { display: grid; gap: var(--sp-2); }
.f-input {
  display: block; width: 100%; min-height: 52px; padding: 0 14px;
  border: 1px solid var(--faint); border-radius: var(--r-tile); background: var(--inset-bg); color: var(--ink);
  font: 400 var(--fs-body)/1.2 var(--font-text);
}
.f-input::placeholder { color: var(--faint); opacity: 1; }
.f-input[aria-invalid="true"] { border-color: var(--error); }   /* a field that cannot be used as it is; the line under says why */

/* ---------- Duel 3: modules in Læring (N2) and the end of a module (N4) ---------- */
.f-tiles--two { grid-template-columns: 1fr 1fr; gap: var(--sp-4) var(--sp-3); }
.f-tile__art {   /* placeholder until the module has a picture */
  position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; margin-bottom: 4px;
  border-radius: var(--r-tile); background: var(--card-bg); color: var(--heading); box-shadow: inset 0 0 0 1px var(--card-edge);
}
.f-tile__art .f-icon { width: 40px; height: 40px; }
.f-tile__art .f-tag { position: absolute; left: var(--sp-2); bottom: var(--sp-2); }
.f-tiles--two .f-tile__title { font-size: var(--fs-body); line-height: 22px; }
.f-tiles--two .f-tile__meta { font-size: var(--fs-sub); line-height: 20px; }
.f-row__num { font: var(--fw-strong) var(--fs-sub)/1 var(--font-text); }
.f-done { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-7) var(--sp-3) var(--sp-2); text-align: center; }
.f-done .f-flower { width: 28px; height: 48px; margin-bottom: var(--sp-3); }
.f-done .f-ill-motif, .f-state .f-ill-motif { margin-bottom: var(--sp-3); }
.f-done .f-muted { max-width: 32ch; }
/* ---------- Videoview: the clip fills the phone, the controls float in glass (V2 video) ----------
   Stående, delt and tavle are baked into the 9:16 video; the app draws only this. Safe zones in the video, 1080 × 1920
   filled on 390 × 844: top 0–250 px, the rail from x 865 and y 760–1160, the time line in the bottom edge, and the
   captions, when on, from y 1640. */
.f-phone--media .f-status { background: none; }
.f-reel { position: absolute; inset: 0; overflow: hidden; background: var(--bg); }
.f-reel__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.f-reel__tap { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.f-reel__glass {
  background: var(--glass); border: 1px solid var(--glass-edge); color: var(--ink);
  -webkit-backdrop-filter: blur(20px) saturate(1.6); backdrop-filter: blur(20px) saturate(1.6);
}
.f-reel__top { position: absolute; top: calc(var(--status-h) + 4px); left: 12px; right: 12px; z-index: 2; display: flex; gap: var(--sp-2); }
.f-reel__btn {
  width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; padding: 0;
  border-radius: 50%; cursor: pointer;
}
.f-reel__title { min-height: var(--tap); display: grid; align-content: center; padding: 0 var(--sp-4); border-radius: var(--r-pill); line-height: 1.2; }
.f-reel__title b { font-size: var(--fs-sub); font-weight: var(--fw-strong); }
.f-reel__title span { font-size: var(--fs-foot); }
.f-reel__rail { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 48px; display: grid; padding: 4px 0; border-radius: var(--r-pill); }
.f-reel__act {
  min-height: 56px; display: grid; justify-items: center; align-content: center; gap: 3px; padding: 0;
  border: 0; border-radius: var(--r-pill); background: none; color: inherit; cursor: pointer;
  font: var(--fw-strong) var(--fs-cap)/1 var(--font-text);
}
.f-reel__act[aria-pressed="true"] .f-icon { fill: currentColor; }
.f-reel__cc { margin-left: auto; }
.f-reel:not([data-format="se"]) .f-reel__cc { display: none; }
/* Like Reels: only a thin time line in the bottom edge. The captions are off until you turn them on, and then small. */
.f-reel__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 3px; margin: 0; border-radius: 0; background: var(--glass); cursor: pointer; }
.f-reel__bar::after { content: ""; position: absolute; inset: -24px 0 0; }   /* a tap target above the thin line */
.f-reel__bar > i { border-radius: 0; }
.f-reel__bar > b { display: none; }
.f-reel[data-state="pause"] .f-reel__bar { height: 4px; }
.f-reel[data-state="pause"] .f-reel__bar > b { display: block; top: auto; bottom: 0; width: 10px; height: 10px; margin: 0 0 0 -5px; }
.f-reel__time {
  position: absolute; right: 12px; bottom: 12px; display: none; padding: 2px var(--sp-2); border-radius: var(--r-pill);
  font-size: var(--fs-foot); font-variant-numeric: tabular-nums;
}
.f-reel[data-state="pause"] .f-reel__time { display: block; }
.f-reel__cap {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--home-h) + 4px);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-tile); text-wrap: balance;
}
.f-reel__chap { display: block; font-size: var(--fs-cap); font-weight: var(--fw-strong); }
.f-reel__cap p { font-size: var(--fs-sub); line-height: 20px; }
.f-reel[data-cc="av"] .f-reel__cap { display: none; }
.f-reel__big {
  position: absolute; left: 50%; top: 45%; width: 72px; height: 72px; margin: -36px 0 0 -36px;
  display: none; place-items: center; border-radius: 50%; pointer-events: none;
}
.f-reel__big .f-icon { width: 30px; height: 30px; margin-left: 3px; }
.f-reel[data-state="pause"] .f-reel__big { display: grid; }
.f-reel__card {
  position: absolute; left: 50%; top: 45%; width: min(280px, calc(100% - 112px)); transform: translate(-50%, -50%); z-index: 1;
  display: none; justify-items: center; gap: var(--sp-3); padding: var(--sp-6); border-radius: var(--r-card); text-align: center;
}
.f-reel__card .f-btn { width: 100%; }
.f-reel[data-state="laster"] [data-card="laster"], .f-reel[data-state="slutt"] [data-card="slutt"],
.f-reel[data-state="feil"] [data-card="feil"] { display: grid; }
.f-reel:is([data-state="slutt"], [data-state="feil"]) :is(.f-reel__rail, .f-reel__cap, .f-reel__bar) { display: none; }
.f-reel__panel {
  position: absolute; inset: 0; z-index: 1; display: none; overflow-y: auto; background: var(--bg);
  padding: calc(var(--status-h) + 4px + var(--tap) + var(--sp-4)) var(--gutter) calc(var(--home-h) + var(--sp-6));
}
.f-reel__panel > * + * { margin-top: var(--sp-4); }
.f-reel[data-format="lytt"] [data-panel="lytt"], .f-reel[data-format="les"] [data-panel="les"] { display: block; }
.f-reel__panel .f-h2 { min-height: 84px; }
.f-reel__read h3 { margin-top: var(--sp-5); font-size: var(--fs-foot); font-weight: var(--fw-strong); color: var(--muted); }
.f-reel__read p { margin-top: var(--sp-1); }
.f-reel__read span { border-radius: 4px; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.f-reel__read span.is-now { background: var(--next-bg); color: var(--next-ink); }

/* ---------- Tegninger: the drawing kit (tegning.js). Twain-strek, the same in the app, the library and the videos ---------- */
.f-ill { display: block; overflow: visible; }
.f-ill__line { fill: none; stroke: var(--ill-line); stroke-width: var(--icon-stroke); stroke-linecap: round; stroke-linejoin: round; }
.f-ill__line--bold { stroke-width: calc(var(--icon-stroke) * 2); }
.f-ill__disc { fill: var(--ill-tone); }
.f-ill__now { fill: var(--ill-now); opacity: 0; transition: opacity var(--dur) var(--ease); }
.f-ill__fill { fill: var(--ill-paper); }
.f-ill__dots { fill: var(--ill-line); }
.f-ill__label { color: var(--ink); font: 400 var(--fs-body)/24px var(--font-text); white-space: nowrap; }
/* Motif: a drawing in its disc. The line is 1.75 pt at any size. A wide label overflows both sides evenly. */
.f-ill-motif { display: inline-grid; grid-template-columns: calc(var(--s) * 1px); justify-items: center; gap: var(--sp-2); margin: 0; vertical-align: top; }
.f-ill-motif > svg { display: block; width: calc(var(--s) * 1px); height: calc(var(--s) * 1px); overflow: visible; }
.f-ill-motif .f-ill__line { stroke-width: calc(var(--icon-stroke) * 48 / var(--s)); }
.f-ill-motif[data-state="nå"] .f-ill__now { opacity: 1; }
.f-ill-motif[data-state="dempet"] .f-ill__line { stroke: var(--ill-past); }
.f-ill-motif[data-state="dempet"] .f-ill__dots { fill: var(--ill-past); }
.f-ill-motif[data-state="dempet"] .f-ill__label { color: var(--muted); }
[data-state="tegnes"] .f-ill__line [pathLength] { stroke-dasharray: 1; stroke-dashoffset: .45; }
[data-state="tegnes"] :is(.f-ill__fill, .f-ill__dots) { opacity: 0; }
/* Flyt */
.f-ill-flow { display: flex; justify-content: center; align-items: flex-start; gap: var(--sp-2); }
.f-ill-arrow { flex: none; width: 28px; height: 16px; margin-top: calc(var(--s) * .5px - 8px); overflow: visible; }
/* Grunnmur */
.f-ill-wall { width: 240px; max-width: 100%; height: auto; }
.f-ill__bricks rect { fill: var(--ill-tone); stroke: var(--ill-line); stroke-width: var(--icon-stroke); }
.f-ill__ghosts rect { fill: none; stroke: var(--ill-past); stroke-width: var(--icon-stroke); stroke-dasharray: 4 6; stroke-linecap: round; }
.f-ill-wall[data-state="mur"] .f-ill__ghosts { opacity: 0; }
/* Oversikt */
.f-ill-overview { width: 320px; max-width: 100%; height: auto; overflow: visible; }   /* rows leave past the edge */
.f-ill-overview[data-state="detaljer"] .f-ill__line { opacity: 0; }
/* Variasjon */
.f-ill-ring { position: relative; width: calc(var(--d) * 1px); height: calc(var(--d) * 1px); margin-inline: auto; }
.f-ill-ring__spokes { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.f-ill-ring__at { position: absolute; }
.f-ill-ring__turn { position: absolute; inset: 0; }
.f-ill-ring__at > .f-ill-motif { display: grid; }
.f-ill-ring[data-state="variasjon"] :is(.f-ill-ring__center, .f-ill-ring__spokes) { opacity: 0; }
/* Ruta: the tract in the body. Tubes and the paper under them take their width from the markup (stroke-width). */
.f-ill-route { position: relative; width: 292px; height: 316px; }
.f-ill-route > svg { position: absolute; left: 0; top: 0; width: 196px; height: 316px; overflow: visible; }
.f-ill-route__body { fill: var(--ill-tone); }
.f-ill-route__leads { fill: none; stroke: var(--ill-past); stroke-width: 1; stroke-linecap: round; }
.f-ill-route__tube { fill: none; stroke: var(--ill-paper); stroke-linecap: round; stroke-linejoin: round; }
.f-ill-route__shape { fill: var(--ill-paper); stroke: var(--ill-paper); stroke-width: 3; }
.f-ill-route .f-ill__now { stroke: var(--ill-now); fill: none; }
.f-ill-route .f-ill-route__shape.f-ill__now { fill: var(--ill-now); }
.f-ill-route__organ[data-state="nå"] .f-ill__now { opacity: 1; }
.f-ill-route__organ[data-state="dempet"] .f-ill__line { stroke: var(--ill-past); }
.f-ill-route__food { fill: none; stroke: none; }
.f-ill-route__label { position: absolute; left: 200px; }
.f-ill-route__label[data-state="dempet"] { color: var(--muted); }
/* Kvern: dots in, the stone, dots out, centred on the stone */
.f-ill-mill { display: flex; justify-content: center; align-items: flex-start; gap: var(--sp-3); }
.f-ill-mill > svg { flex: none; overflow: visible; }
.f-ill-mill[data-state="inn"] .f-ill-mill__out circle, .f-ill-mill[data-state="ut"] .f-ill-mill__in circle { opacity: 0; }
/* Saks: the scissors over the chain, the label under it */
.f-ill-cut { position: relative; display: grid; justify-items: center; gap: var(--sp-2); width: calc(var(--w) * 1px); margin: 0; padding-top: 52px; }
.f-ill-cut > svg { display: block; width: 100%; height: 40px; overflow: visible; }
.f-ill-cut__saks { position: absolute; top: 0; }
.f-ill-cut[data-state="klippet"] .f-ill__line { opacity: 0; }
/* Signal and Metthet */
.f-ill-signal { overflow: visible; }
.f-ill-gauge { display: grid; justify-items: center; gap: var(--sp-2); margin: 0; }
.f-ill-gauge__ring { position: relative; display: grid; place-items: center; width: calc(var(--d) * 1px); height: calc(var(--d) * 1px); }
.f-ill-gauge__ring > svg { position: absolute; inset: 0; overflow: visible; }
.f-ill-gauge__track, .f-ill-gauge__fill { fill: none; stroke-width: calc(var(--icon-stroke) * 2); }
.f-ill-gauge__track { stroke: var(--ill-tone); }
.f-ill-gauge__fill { stroke: var(--ill-line); stroke-linecap: round; }
/* Magesekken: Ruta's stomach up close. The svg is in Ruta's units, so lines are thinned by k to keep the kit's stroke. */
.f-ill-stomach { position: relative; width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); margin: 0; }
.f-ill-stomach > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.f-ill-stomach .f-ill__line { stroke-width: calc(var(--icon-stroke) / var(--k)); }
.f-ill-stomach .f-ill-route__leads { stroke-width: calc(1 / var(--k)); }
.f-ill-stomach .f-ill-route__shape { stroke-width: calc(3 / var(--k)); }
.f-ill-stomach__wave { fill: var(--ill-tone); }
.f-ill-stomach__way { fill: none; stroke: none; }
.f-ill-stomach > .f-ill__label { position: absolute; }
/* pH */
.f-ill-ph { position: relative; width: calc(var(--w) * 1px); height: 78px; margin: 0; }
.f-ill-ph > svg { position: absolute; left: 0; top: 28px; width: 100%; height: 24px; overflow: visible; }
.f-ill-ph > .f-ill__label { position: absolute; top: 0; transform: translateX(-50%); }
.f-ill-ph[data-state="nå"] .f-ill__now { opacity: 1; }
.f-ill-ph__axis { fill: none; stroke: var(--ill-past); stroke-width: 1; }
.f-ill-ph__n { position: absolute; top: 58px; transform: translateX(-50%); color: var(--muted); font: 400 var(--fs-foot)/18px var(--font-text); }
/* Hjelperne: liver, gall bladder and pancreas round the small intestine, in Ruta's units like Magesekken. */
.f-ill-helpers { position: relative; width: calc(var(--w) * 1px); height: calc(var(--h) * 1px); margin: 0; }
.f-ill-helpers > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.f-ill-helpers .f-ill__line { stroke-width: calc(var(--icon-stroke) / var(--k)); }
.f-ill-helpers .f-ill-route__shape { stroke-width: calc(3 / var(--k)); }
.f-ill-helpers .f-ill__now { stroke: var(--ill-now); fill: none; }
.f-ill-helpers .f-ill-route__shape.f-ill__now { fill: var(--ill-now); }
.f-ill-helpers [data-state="nå"] > .f-ill__now, .f-ill-helpers [data-state="nå"] > .f-ill-route__shape.f-ill__now { opacity: 1; }
.f-ill-helpers [data-state="dempet"] .f-ill__line { stroke: var(--ill-past); }
.f-ill-helpers__way { fill: none; stroke: none; }
.f-ill-helpers > .f-ill__label { position: absolute; }
/* Nedbrytning: a row per nutrient, the name over the whole molecule and the pieces' name over the pieces. */
.f-ill-breakdown { display: grid; gap: 14px; width: 280px; margin: 0; }
.f-ill-breakdown__row { display: grid; grid-template-columns: auto auto; justify-content: space-between; row-gap: 4px; }
.f-ill-breakdown__row > svg { grid-column: 1 / -1; width: 280px; height: 36px; overflow: visible; }
.f-ill-breakdown[data-state="hel"] .f-ill-breakdown__to { opacity: 0; }
.f-ill-breakdown[data-state="delt"] .f-ill-breakdown__bonds { opacity: 0; }
/* Tarmtotter */
.f-ill-villi { position: relative; width: calc(var(--w) * 1px + 120px); height: 256px; margin: 0; }
.f-ill-villi > svg { position: absolute; left: 0; top: 0; width: calc(var(--w) * 1px); height: 256px; overflow: visible; }
.f-ill-villi__tissue { fill: var(--ill-tone); }
.f-ill-villi__cap, .f-ill-villi__lac { fill: none; stroke: var(--ill-line); stroke-width: 1; stroke-linecap: round; }
.f-ill-villi__lac { stroke-dasharray: 2 3; }
.f-ill-villi .f-ill__now { stroke: var(--ill-now); fill: none; }
.f-ill-villi__vessel[data-state="nå"] .f-ill__now { opacity: 1; }
.f-ill-villi__way { fill: none; stroke: none; }
.f-ill-villi > .f-ill__label { position: absolute; }
/* Draw again: add .f-ill-play to a container. Still under reduced motion. */
@keyframes f-ill-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.f-ill-play .f-ill__line [pathLength] { stroke-dasharray: 1; animation: f-ill-draw var(--ill-draw) var(--ease) both; }
@keyframes f-ill-turn { from { transform: rotate(-6deg); } to { transform: rotate(4deg); } }
.f-ill-play .f-ill-ring__turn { animation: f-ill-turn 5.5s linear both; }
@keyframes f-ill-grind { to { transform: rotate(360deg); } }
.f-ill-play [data-motif="kvern"] .f-ill__line { transform-origin: 24px 24px; animation: f-ill-grind 6s linear both; }
@media (prefers-reduced-motion: reduce) { .f-ill-play :is(.f-ill__line [pathLength], .f-ill-ring__turn, [data-motif="kvern"] .f-ill__line) { animation: none; } }

/* ---------- Duel 4–8: the prototype. Moved here from the .f4- to .f8- classes on the duel pages ---------- */
/* A big title with one button beside it (Mat: the search). */
.f-titlebar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.f-iconbtn--soft { background: var(--card-bg); }
/* A smaller circle that still takes 44 pt to tap (the copy button in Hjelp). */
.f-iconbtn--small { position: relative; width: 32px; height: 32px; }
.f-iconbtn--small::after { content: ""; position: absolute; inset: -6px; }
/* The search field, with the glass inside. */
.f-search { position: relative; display: block; }
.f-search[hidden] { display: none; }
.f-search .f-icon { position: absolute; left: 14px; top: 50%; margin-top: -10px; color: var(--muted); pointer-events: none; }
.f-search .f-input { padding-left: 44px; }
.f-search .f-input::-webkit-search-cancel-button { -webkit-appearance: none; }
/* Filters in one quiet row that scrolls (Mat, M4 A): 36 pt to see, 44 to tap. */
.f-filters { display: flex; gap: var(--sp-2); overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter); scrollbar-width: none; }
.f-filters::-webkit-scrollbar { display: none; }
.f-filter {
  position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
  border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--hairline);
  font: var(--fw-strong) var(--fs-sub)/1 var(--font-text);
}
.f-filter::after { content: ""; position: absolute; inset: -4px 0; }
.f-filter[aria-pressed="true"] { background: var(--selected-bg); color: var(--selected-ink); box-shadow: none; }
/* Minus, the number, plus (portions). */
.f-stepper { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--hairline); }
.f-stepper button {
  position: relative; width: 36px; height: 36px; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--heading);
}
.f-stepper button::after { content: ""; position: absolute; inset: -4px; }
.f-stepper button:disabled { color: var(--faint); cursor: default; }
.f-stepper output { min-width: 9ch; text-align: center; font-size: var(--fs-sub); font-weight: var(--fw-strong); font-variant-numeric: tabular-nums; }
/* The ingredients as a light list without a card, the amount in bold before the food (O4 A). */
.f-ings { list-style: none; padding: 0; }
.f-ings > li + li { border-top: 1px solid var(--hairline); }
.f-ings__item { display: grid; grid-template-columns: 20px 1fr; align-items: center; gap: var(--sp-3); min-height: 48px; padding: 10px var(--sp-1); cursor: pointer; }
.f-ings__item input {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; display: grid; place-items: center;
  border: 1.5px solid var(--muted); border-radius: 50%; background: none;
}
.f-ings__item input:checked { background: var(--action-bg); border-color: var(--action-bg); }
.f-ings__item input:checked::after { content: ""; width: 5px; height: 9px; border: solid var(--action-ink); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.f-ings__item b { color: var(--heading); font-weight: var(--fw-strong); }
.f-ings__item small { display: block; color: var(--muted); font-size: var(--fs-sub); line-height: 20px; }
.f-ings__item input:checked + span, .f-ings__item input:checked + span b { color: var(--muted); }
/* The step mode: one step at a time, over the whole screen (OT4 B). */
.f-cook { display: flex; flex-direction: column; gap: var(--sp-5); min-height: calc(100dvh - 120px); padding-top: var(--sp-2); }
.f-cook__step { color: var(--heading); font: var(--fw-display) 28px/34px var(--font-display); letter-spacing: var(--tracking-display); text-wrap: pretty; }
.f-cook__foot { margin-top: auto; display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--sp-2); }
.f-cook__foot .f-btn:disabled { opacity: .45; }
/* A picture, a title and a line, in a shelf that scrolls (Læring, Meg) or a grid of two (Lagret). */
.f-shelf {
  list-style: none; display: flex; gap: var(--sp-3); overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 4px;
  scroll-snap-type: x mandatory; scroll-padding: 0 var(--gutter); scrollbar-width: none;
}
.f-shelf::-webkit-scrollbar { display: none; }
.f-shelf > li { flex: none; width: 116px; scroll-snap-align: start; }
.f-shelf--wide > li { width: 140px; }
.f-covers { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-3); }
.f-cover { position: relative; display: grid; gap: 2px; align-content: start; color: inherit; }
.f-cover > img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-tile); margin-bottom: 6px; }
.f-cover__art { display: grid; place-items: center; aspect-ratio: 4 / 5; margin-bottom: 6px; border-radius: var(--r-tile); background: var(--card-bg); }
.f-cover__bar { display: block; height: 4px; margin: -2px 0 6px; overflow: hidden; border-radius: 2px; background: var(--track); }
.f-cover__bar i { display: block; height: 100%; background: var(--progress); }
.f-cover > .f-tag { position: absolute; top: 8px; left: 8px; }
.f-cover__title { font-weight: var(--fw-strong); line-height: 22px; overflow-wrap: anywhere; hyphens: auto; }
.f-cover__meta { color: var(--muted); font-size: var(--fs-sub); line-height: 20px; }
.f-shelf .f-cover__title { font-size: var(--fs-sub); line-height: 20px; }
.f-shelf .f-cover__meta { font-size: var(--fs-foot); line-height: 18px; }
/* The modules that come, as small cards in two columns (L4 B). Not links. */
.f-soon { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.f-soon > li { display: grid; gap: 4px; align-content: start; padding: var(--sp-4); border-radius: var(--r-tile); background: var(--card-bg); }
.f-soon .f-tag { justify-self: start; margin-bottom: 4px; }
/* The week's theme at the top of Hjem (HJ8 A), under the date. */
.f-date:has(+ .f-weektheme) { padding: 0 var(--sp-1); }
.f-weektheme { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); }
.f-weektheme .f-media { aspect-ratio: 16 / 9; margin-bottom: var(--sp-2); }
.f-weektheme > :is(.f-label, .f-h2, .f-muted) { padding: 0 var(--sp-1); }
.f-weektheme + .f-next { margin-top: var(--sp-5); }
/* The icon for the step, in a circle in the corner of the next step (HJ8 A). */
.f-next__corner {
  position: absolute; top: var(--sp-4); right: var(--sp-4); width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; background: var(--card-bg); color: var(--heading);
}
.f-next:has(.f-next__corner) > .f-label { min-height: 40px; display: flex; align-items: center; padding-right: 48px; margin-top: calc(var(--sp-4) - var(--sp-5)); }
.f-next + .f-list { margin-top: var(--sp-3); }
/* The theme as a quiet row with its picture (Meg, R4 A), or as a card (the note, NO8). */
.f-themeline {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3); min-height: 64px;
  margin-top: var(--sp-3); padding: var(--sp-2) var(--sp-1); color: inherit;
}
.f-themeline > img { width: 44px; height: 52px; border-radius: 10px; object-fit: cover; }
.f-themeline > span { display: grid; gap: 1px; }
.f-themeline > .f-icon { color: var(--faint); }
.f-themeline--card { padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-2); border-radius: var(--r-tile); background: var(--card-bg); }
/* The day's question with room to answer (R4 A), and the answer on paper without an edge. */
.f-ask { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }
.f-ask > :is(.f-label, .f-h2, .f-h3, .f-foot) { padding: 0 var(--sp-1); }
.f-paper {
  display: block; width: 100%; min-height: 132px; padding: var(--sp-4); resize: vertical;
  border: 0; border-radius: var(--r-tile); background: var(--card-bg); color: var(--ink);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-text);
}
.f-paper::placeholder { color: var(--muted); opacity: 1; }
.f-card .f-paper { min-height: 150px; background: var(--inset-bg); }
/* The writing sheet over the whole screen (SK6 A): the question, a tip at a time behind the bulb, and the sheet. */
.f-write { display: flex; flex-direction: column; gap: var(--sp-4); min-height: calc(100dvh - 120px); }
.f-write__q { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: var(--sp-2) -8px -6px 0; }
.f-write .f-h3 { padding-right: var(--sp-2); }
.f-bulb[aria-expanded="true"] { background: var(--next-bg); color: var(--next-ink); }
.f-tip { color: var(--muted); font-size: var(--fs-sub); line-height: 20px; }
.f-tip .f-link { position: relative; min-height: 0; padding: 0; font-size: inherit; }
.f-tip .f-link::after { content: ""; position: absolute; inset: -12px -8px; }
.f-sheet {
  flex: 1; display: block; width: 100%; min-height: 300px; padding: 0; border: 0; background: none; resize: none; color: var(--ink);
  font: 400 var(--fs-body)/var(--lh-body) var(--font-text);
}
.f-sheet::placeholder { color: var(--muted); opacity: 1; }
.f-sheet:focus-visible { outline: 0; }
/* The note: weeks as circles you scroll (NO8), one note, and the words large. */
.f-weekpick {
  list-style: none; display: flex; gap: 8px; margin: var(--sp-2) calc(var(--gutter) * -1) 0; padding: 2px var(--gutter) 4px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none;
}
.f-weekpick::-webkit-scrollbar { display: none; }
.f-weekpick li { scroll-snap-align: end; }
.f-weekpick button {
  width: 44px; height: 54px; display: grid; justify-items: center; align-content: start; gap: 4px; padding: 0; border: 0; background: none;
  color: var(--heading); font: var(--fw-strong) var(--fs-sub)/1 var(--font-text); font-variant-numeric: tabular-nums;
}
.f-weekpick b { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--hairline); font-weight: inherit; }
.f-weekpick [aria-pressed="true"] b { background: var(--selected-bg); color: var(--selected-ink); box-shadow: none; }
.f-weekpick i { width: 5px; height: 5px; border-radius: 50%; }
.f-weekpick [data-has] i { background: var(--heading); }
.f-weekhead { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-2); padding: 0 var(--sp-1); }
.f-note { display: grid; gap: var(--sp-2); margin-top: var(--sp-3); padding: 0 var(--sp-1); }
.f-note__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin: -6px -8px -6px 0; }
.f-note__words { color: var(--heading); font: var(--fw-display) 22px/30px var(--font-display); letter-spacing: var(--tracking-display); white-space: pre-wrap; overflow-wrap: anywhere; }
/* Profile: the name, settings that fold out to their choices (PR5 B). */
.f-me { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.f-me > span:nth-child(2) { flex: 1; min-width: 0; display: grid; gap: 1px; }
.f-me .f-avatar { width: 56px; height: 56px; font-size: var(--fs-body); }
.f-set > summary { display: flex; align-items: center; gap: var(--sp-3); min-height: 56px; padding: 0 var(--sp-1); list-style: none; cursor: pointer; }
.f-set > summary::-webkit-details-marker { display: none; }
.f-set > summary > span:first-child { flex: 1; font-weight: var(--fw-strong); }
.f-set > summary .f-icon { color: var(--faint); transition: transform var(--dur) var(--ease); }
.f-set[open] > summary .f-icon { transform: rotate(180deg); }
.f-set__val { color: var(--muted); font-size: var(--fs-sub); }
.f-set > div { display: grid; gap: var(--sp-2); padding: 0 var(--sp-1) var(--sp-4); }
/* A phone number to read, with a small copy button after it (Hjelp, HJ5 C). */
.f-number { display: flex; align-items: center; gap: var(--sp-1); }
.f-number b { color: var(--heading); font: var(--fw-display) 26px/32px var(--font-display); letter-spacing: var(--tracking-display); font-variant-numeric: tabular-nums; }
/* One thing said plainly (Personvern, PV6 C), and a text that reads like an article (Ukens tema, TE6 A). */
.f-say { margin-top: var(--sp-2); padding: 0 var(--sp-1); color: var(--heading); font: var(--fw-display) 24px/32px var(--font-display); letter-spacing: var(--tracking-display); }
.f-article { margin-top: var(--sp-4); padding: 0 var(--sp-1); }
.f-article h2, .f-article h3 { margin-top: var(--sp-5); }
.f-article :is(h2, h3) + p { margin-top: var(--sp-2); }
.f-article__lead { color: var(--ink); font-size: var(--fs-h3); line-height: 28px; }
.f-media--bleed { margin: 0 calc(-1 * var(--gutter)) var(--sp-4); aspect-ratio: 16 / 9; border-radius: 0; }
.f-media--bleed img { object-position: 50% 40%; }
.f-textlink { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* Welcome with the ring of food that turns slowly back and forth (VE6 C). Still under reduced motion. */
.f-onboard--ring { gap: var(--sp-4); }
.f-onboard--ring .f-ill-ring { margin-top: var(--sp-2); }
.f-onboard--ring .f-ill-ring__turn { animation: f-ill-turn 5.5s ease-in-out infinite alternate; }
/* The week strip in the plan, a dot for each meal (P4 B), and the days to pick in a sheet (PL7 C). */
.f-dots { display: flex; gap: 3px; height: 5px; }
.f-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.f-week--pick .f-day, .f-week--pick .f-day[aria-pressed="true"] { min-height: 0; padding: 4px 0; gap: 6px; background: none; color: var(--muted); }
.f-week--pick .f-day b { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.f-week--pick .f-day[aria-pressed="true"] b { background: var(--selected-bg); color: var(--selected-ink); }
.f-week--pick .f-day:disabled { opacity: .45; cursor: default; }
.f-week--pick .f-day::after { content: ""; width: 5px; height: 5px; border-radius: 50%; }
.f-week--pick .f-day[data-taken]::after { background: var(--heading); }
.f-seg--bare { padding: 0; background: none; box-shadow: none; }
.f-choice { display: grid; gap: 2px; }
.f-choice b { color: var(--heading); font-weight: var(--fw-strong); }
.f-choice span { color: var(--muted); font-size: var(--fs-sub); }
/* Listen, Read and Save in a row at the bottom of the clip, over the time line (KL6 C), instead of the rail. */
.f-reel__acts {
  position: absolute; z-index: 1; left: 50%; bottom: calc(var(--home-h) + 8px); transform: translateX(-50%);
  display: flex; padding: 0 var(--sp-2); border-radius: var(--r-pill);
}
.f-reel__acts .f-reel__act { width: 64px; min-height: 52px; }
.f-reel:has(.f-reel__acts) .f-reel__cap { bottom: calc(var(--home-h) + 72px); }
.f-reel:is([data-state="slutt"], [data-state="feil"]) .f-reel__acts { display: none; }
/* The landing (LA8 B): the logo grows on butter, sways once, and the butter shrinks into the next step on Hjem.
   1.9 s, only on a cold start, and a tap skips it. The app adds .is-play and clips __bg to the card from JS. */
.f-splash {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; align-content: center; gap: var(--sp-5);
  color: var(--next-ink); cursor: pointer;
}
.f-splash__bg { position: absolute; inset: 0; z-index: -1; background: var(--next-bg); }
.f-splash__logo { width: 92px; height: 156px; overflow: visible; }
.f-splash__word { font: var(--mark-weight) 30px/1 var(--mark-font); letter-spacing: var(--mark-tracking); text-transform: var(--mark-case); }
.f-splash__logo :is(.lf, .bp, .bc, .pe, .ce) { transform-box: view-box; }
.f-splash__logo .lf-r { transform-origin: 217.5px 599px; }
.f-splash__logo .lf-l { transform-origin: 189.5px 560px; }
.f-splash__logo :is(.bp, .bc) { transform-origin: 362px 333px; }
.f-splash__logo :is(.pe, .ce) { transform-origin: 173px 179.5px; }
.f-splash.is-wait > :not(.f-splash__bg) { opacity: 0; }   /* the butter shows until the first page is drawn */
.f-splash.is-play { animation: f-splash-hold 1900ms linear both; }
.f-splash.is-play .f-splash__logo { transform-origin: 45.5% 100%; animation: f-splash-sway 900ms ease-in-out 600ms both, f-splash-out 180ms linear 1240ms both; }
.f-splash.is-play .f-splash__logo :is(.st, .br) { stroke-dasharray: 1 2; }
.f-splash.is-play .f-splash__logo .st { animation: f-splash-draw 400ms cubic-bezier(.4, 0, .2, 1) 40ms both; }
.f-splash.is-play .f-splash__logo .lf-r { animation: f-splash-fold-r 520ms cubic-bezier(.34, 1.56, .64, 1) 180ms both; }
.f-splash.is-play .f-splash__logo .lf-l { animation: f-splash-fold-l 520ms cubic-bezier(.34, 1.56, .64, 1) 230ms both; }
.f-splash.is-play .f-splash__logo .br { animation: f-splash-draw 260ms cubic-bezier(.4, 0, .2, 1) 280ms both; }
.f-splash.is-play .f-splash__logo .bc { animation: f-splash-pop 380ms cubic-bezier(.34, 1.56, .64, 1) 460ms both; }
.f-splash.is-play .f-splash__logo .ce { animation: f-splash-pop 420ms cubic-bezier(.34, 1.56, .64, 1) 360ms both; }
.f-splash.is-play .f-splash__logo :is(.pe, .bp) { animation: f-splash-unfold 560ms cubic-bezier(.34, 1.4, .64, 1) calc(440ms + var(--i) * 35ms) both; }
.f-splash.is-play .f-splash__logo .bp { animation-delay: calc(520ms + var(--i) * 35ms); }
.f-splash.is-play .f-splash__word { animation: f-splash-rise 360ms var(--ease) 900ms both, f-splash-out 180ms linear 1240ms both; }
.f-splash.is-play .f-splash__bg { animation: f-splash-out 150ms linear 1750ms both; }
@keyframes f-splash-hold { 0%, 99% { visibility: visible; } 100% { visibility: hidden; } }
@keyframes f-splash-draw { from { stroke-dashoffset: 1.05; } to { stroke-dashoffset: 0; } }
@keyframes f-splash-pop { from { transform: scale(0); } }
@keyframes f-splash-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes f-splash-out { to { opacity: 0; } }
@keyframes f-splash-sway { 35% { transform: rotate(-3deg); } 70% { transform: rotate(1.5deg); } }
@keyframes f-splash-fold-r { from { opacity: 0; transform: rotate(-75deg) scale(.5); } }
@keyframes f-splash-fold-l { from { opacity: 0; transform: rotate(75deg) scale(.5); } }
@keyframes f-splash-unfold {
  from { transform: rotate(var(--a)) scale(.1, .45) rotate(calc(var(--a) * -1)); }
  to { transform: rotate(var(--a)) scale(1) rotate(calc(var(--a) * -1)); }
}

/* ---------- States: loading, empty, error ---------- */
.f-skel { display: block; height: 14px; border-radius: 7px; background: var(--track); animation: f-pulse 1.4s ease-in-out infinite; }
.f-skel--title { height: 18px; width: 60%; }
.f-skel--thumb { width: 56px; height: 56px; border-radius: var(--r-tile); flex: none; }
@keyframes f-pulse { 50% { opacity: .45; } }
.f-state { display: grid; justify-items: center; gap: var(--sp-2); padding: var(--sp-6) var(--sp-4); text-align: center; }
.f-state .f-icon { width: 28px; height: 28px; color: var(--muted); }
.f-state--error .f-icon { color: var(--error); }
.f-state__title { font-weight: var(--fw-strong); }
.f-state p { color: var(--muted); max-width: 30ch; }

@media (prefers-reduced-motion: reduce) {
  .f-host *, .f-host *::before, .f-host *::after { animation: none !important; transition: none !important; }
  .f-art__pt.is-next, .f-board__pt.is-next { opacity: 1; }   /* the board shows every point, still */
}

/* ---------- Lagre en oppskrift (LO1 B, design/lagre-oppskrift.md) ---------- */
/* A recipe's picture when it has no photo: its drawing on the paper tone, where the photo would be. Never an empty box. */
.f-pic { display: grid; place-items: center; overflow: hidden; background: var(--inset-bg); }
.f-pic.f-row__thumb { border-radius: var(--r-tile); }
.f-tile > .f-pic, .f-cover > .f-pic { width: 100%; aspect-ratio: 1; border-radius: var(--r-tile); margin-bottom: 4px; }
.f-cover > .f-pic { margin-bottom: 6px; }
.f-media > .f-pic { width: 100%; height: 100%; background: none; }
/* The recipe as it will look, with each line changed where it stands: tap a line to write in it, Enter to finish. */
.f-lines { list-style: none; padding: 0; }
.f-lines > li + li { border-top: 1px solid var(--hairline); }
.f-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0 var(--sp-2); }
.f-line__text {
  flex: 1; min-width: 0; min-height: 48px; padding: 12px var(--sp-1); border: 0; border-radius: var(--r-tile);
  background: none; color: inherit; text-align: left; font: inherit; line-height: var(--lh-body); cursor: text;
}
.f-line__text b { color: var(--heading); font-weight: var(--fw-strong); }
.f-line__text small { color: var(--muted); font-size: inherit; }
.f-line__ph { color: var(--faint); }
.f-line__add { display: flex; align-items: center; gap: var(--sp-2); color: var(--heading); font-weight: var(--fw-strong); cursor: pointer; }
.f-line__num {
  width: 28px; height: 28px; margin-top: 10px; flex: none; display: grid; place-items: center; border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--card-edge); color: var(--heading); font: var(--fw-strong) var(--fs-foot)/1 var(--font-text);
}
.f-line__x { margin-top: 8px; flex: none; color: var(--muted); }
.f-line__input {
  flex: 1; min-width: 0; min-height: 48px; margin: 4px 0; padding: 8px var(--sp-2); resize: none; overflow: hidden;
  border: 1px solid var(--faint); border-radius: var(--r-tile); background: var(--inset-bg); color: var(--ink);
  font: inherit; line-height: var(--lh-body);
}
.f-line__input::placeholder { color: var(--faint); opacity: 1; }
.f-line__hint { flex-basis: 100%; padding: 0 var(--sp-2) var(--sp-2); }
.f-line > .f-gap { flex-basis: 100%; }
.f-line--tittel { margin-top: var(--sp-3); }
.f-line--tittel > .f-title { flex: 1; min-width: 0; margin: 0; }
.f-line--tittel .f-line__text { padding: 4px var(--sp-1); }
.f-line--tittel .f-line__input { font: var(--fw-display) var(--fs-title)/34px var(--font-display); letter-spacing: var(--tracking-display); }
/* A question where the recipe has a gap, asked in place (Hvor mye mozzarella?). Every answer is one tap, and none is required. */
.f-gap { display: grid; gap: var(--sp-2); margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-3) var(--sp-1); border-radius: var(--r-tile); background: var(--inset-bg); }
.f-gap__q { position: relative; padding-left: 16px; color: var(--heading); font-size: var(--fs-sub); font-weight: var(--fw-strong); line-height: 20px; }
.f-gap__q::before { content: ""; position: absolute; left: 0; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--next-bg); box-shadow: 0 0 0 1px var(--card-edge); }
.f-gap__said { color: var(--muted); font-weight: 400; }
.f-gap .f-chips { padding-bottom: var(--sp-2); }
/* The one action of a long form, kept in reach at the bottom of the screen. */
.f-dock {
  position: sticky; bottom: 0; z-index: 2; display: grid; gap: var(--sp-2); margin-top: var(--sp-5);
  padding: var(--sp-3) 0 max(var(--sp-3), env(safe-area-inset-bottom, 0px));
  background: var(--bg); box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); border-top: 1px solid var(--hairline);
}
.f-dock > .f-foot { text-align: center; }
@media (min-width: 1024px) { .f-dock { grid-template-columns: 1fr auto; align-items: center; } .f-dock > .f-foot { text-align: right; } .f-dock > .f-btn { width: auto; grid-column: 2; } }
