/* Expel Plan forms (frontend-2): iOS grouped-list building blocks used by the video sheet, Ideas and Settings.
   Fills and hairlines only, never outlines. Uses ONLY the tokens in tokens.css. Every container that uses these
   classes carries `.fx`, which also sets which fill a group sits on (page groups vs. groups inside a sheet). */

.fx {
  --f-group: var(--card);            /* a grouped list sitting on the page */
  --f-pill: var(--fill);             /* in-group buttons and tracks */
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
.fx *, .fx *::before, .fx *::after { box-sizing: border-box; }
:where(.fx) button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  text-align: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
:where(.fx) input, :where(.fx) textarea { font: inherit; font-size: 16px; color: inherit; background: none; border: 0; outline: 0; margin: 0; padding: 0;
  border-radius: 0; -webkit-appearance: none; appearance: none; caret-color: var(--accent); }   /* never below 16: iOS zooms on focus */
.fx ::placeholder { color: var(--text-3); opacity: 1; }
.fx :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.fx input:focus-visible, .fx textarea:focus-visible { outline: 0; }
.fx svg { display: block; flex: none; }

/* ------------------------------------------------------------------ page titles (Ideas, Settings) */
.fx-sub { color: var(--text-2); font-size: var(--fs-sub); margin: 4px 0 16px; }
.fx-sect { margin: 30px 0 0; }
.fx-sect:first-of-type { margin-top: 18px; }

/* ------------------------------------------------------------------ groups and rows */
.f-head { font-size: var(--fs-foot); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--text-2);
  margin: 0 0 7px 16px; display: flex; align-items: center; gap: 8px; }
.f-head .f-head-act { margin-left: auto; margin-right: 6px; color: var(--accent); text-transform: none; letter-spacing: 0;
  font-size: var(--fs-sub); font-weight: 600; }
.f-foot { color: var(--text-2); font-size: var(--fs-foot); line-height: 1.35; margin: 7px 16px 0; }
.f-group { background: var(--f-group); border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
.f-group + .f-group, .f-group + .f-foot + .f-group { margin-top: 20px; }

.f-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; width: 100%; }
.f-row + .f-row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.f-row.tall { padding-top: 10px; padding-bottom: 10px; align-items: flex-start; }
.f-row.tap { cursor: pointer; }
.f-row.tap:active, .f-row.pressed { background: var(--press); }
.f-row:has(> input:focus), .f-row:has(> .f-in:focus) { background: var(--press); }
.f-lab { flex: none; max-width: 48%; }
.f-val { flex: 1; min-width: 0; text-align: right; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.f-val.ink { color: var(--text); }
.f-val.fit { flex: none; max-width: 45%; }
.f-val .f-dot { margin-right: 0; }
.f-chev { color: var(--text-3); width: 8px; height: 14px; }
.f-ud { color: var(--text-3); width: 10px; height: 16px; }
.f-in { flex: 1; min-width: 0; width: 100%; text-align: right; min-height: 44px; }
.f-in.left { text-align: left; }
.f-in[readonly] { color: var(--text-2); }
.f-ico { color: var(--text-2); width: 22px; height: 22px; }
.f-sub { display: block; color: var(--text-2); font-size: var(--fs-foot); line-height: 1.3; }
.f-main { flex: 1; min-width: 0; }
.f-main > .f-t { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-main > .f-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.f-row.act { color: var(--accent); font-weight: 500; justify-content: flex-start; }
.f-row.danger, .f-row.danger .f-lab { color: var(--red); }
.f-row[aria-disabled="true"], .f-row.off { opacity: .45; pointer-events: none; }

/* multi-line text block inside a group: small caps label, then the text */
.f-block { position: relative; display: block; padding: 11px 16px 12px; }
.f-block + .f-block::before, .f-row + .f-block::before, .f-block + .f-row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.f-block:focus-within { background: var(--press); }
.f-cap { display: flex; align-items: center; gap: 8px; font-size: var(--fs-foot); font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; color: var(--text-2); margin: 0 0 4px; }
.f-cap .tag { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--text-3); }
.f-ta { display: block; width: 100%; min-height: 24px; resize: none; line-height: 1.35; overflow: hidden; }
.f-ta.big { min-height: 46px; }
.f-ro-text { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); line-height: 1.35; }
.f-ro-text.dim { color: var(--text-2); }

/* status dot (8 px) */
.f-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--st-0)); flex: none; display: inline-block; }
.f-dot.lg { width: 12px; height: 12px; }
.f-swatch { display: block; width: 26px; height: 26px; border-radius: 50%; background: var(--sw, var(--accent)); flex: none; }
.f-bar { width: 3px; align-self: stretch; border-radius: 2px; background: var(--sw, var(--accent)); flex: none; margin: 10px 0; }

/* iOS switch */
.f-sw { position: relative; width: 51px; height: 31px; border-radius: 999px; background: var(--fill-2); flex: none;
  transition: background var(--t-med) var(--ease-out); }
.f-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,.28); transition: transform var(--t-med) var(--ease-out); }
.f-sw[aria-checked="true"] { background: var(--green); }
.f-sw[aria-checked="true"]::after { transform: translateX(20px); }
.f-sw:active::after { width: 31px; }
.f-sw[aria-checked="true"]:active::after { transform: translateX(16px); }
.f-sw[disabled] { opacity: .45; }

/* buttons: fills, no rings */
.f-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--f-pill); font-weight: 600; font-size: var(--fs-sub); white-space: nowrap; transition: transform var(--t-fast) var(--ease-out); }
.f-btn:active { transform: scale(.97); }
.f-btn.pri { background: var(--accent); color: var(--accent-ink); }
.f-btn.danger { color: var(--red); }
.f-btn.sm { min-height: 34px; padding: 0 14px; }
.f-btn[disabled] { opacity: .45; pointer-events: none; }
.f-tbtn { color: var(--accent); font-weight: 500; }
.f-tbtn[disabled] { opacity: .4; pointer-events: none; }
.f-round { position: relative; width: 32px; height: 32px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--text-2); flex: none; }
.f-round::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; }          /* 44 pt tap target, 32 px look */
.f-round:active { background: var(--fill-2); }
.f-icobtn { position: relative; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); flex: none; margin-right: -8px; }
.f-icobtn::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.f-icobtn:active { background: var(--press); }
/* small text actions inside a row (Change / Remove) */
.f-minibtn { position: relative; flex: none; min-height: 44px; padding: 0 6px; color: var(--text-2); font-size: var(--fs-sub); font-weight: 500; }
.f-minibtn.danger { color: var(--red); }
.f-minibtn:active { opacity: .55; }
/* warning text (Needs Thumbnail): the token comes from tokens.css; light mode falls back to a dark orange that reads on white */
.f-warn { color: var(--warn-text, var(--orange)); }
@media (prefers-color-scheme: light) { .f-warn { color: var(--warn-text, #C93400); } }
/* marker name drawn in its colour, darkened in light mode so yellow still reads */
.f-mk { color: var(--m, inherit); }
@media (prefers-color-scheme: light) { .f-mk { color: color-mix(in srgb, var(--m, #000) 55%, #000); } }
/* a note under a row (a rejected YouTube link, ...) */
.f-note { padding: 0 16px 12px; font-size: var(--fs-foot); line-height: 1.35; color: var(--text-2); }
.f-note.err { color: var(--red); }
@media (prefers-color-scheme: light) { .f-note.err { color: color-mix(in srgb, var(--red) 78%, #000); } }
.f-yt .f-in { text-align: right; }
.f-yt::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.f-ytlink { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--accent); text-decoration: none; font-weight: 500; }
.f-ytlink > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-ytlink .f-ico { color: var(--accent); width: 16px; height: 16px; }

/* ------------------------------------------------------------------ popover menu (status, marker, sponsor, ...) */
.f-pop { position: fixed; z-index: var(--z-menu); min-width: 200px; max-width: min(340px, calc(100vw - 24px)); max-height: min(64vh, 520px);
  overflow-y: auto; overscroll-behavior: contain; border-radius: 20px; padding: 6px 0;
  background: color-mix(in srgb, var(--card-3) 92%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
  box-shadow: var(--shadow-pop); opacity: 0; transform: scale(.94); transform-origin: var(--ox, 100%) var(--oy, 0%);
  transition: opacity 140ms var(--ease-out), transform 160ms var(--ease-out); }
@media (prefers-color-scheme: light) { .f-pop { background: color-mix(in srgb, #fff 86%, transparent); } }
@media (prefers-reduced-transparency: reduce) { .f-pop { background: var(--card-2); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.f-pop.on { opacity: 1; transform: none; }
.f-pop-i { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 16px; font-size: var(--fs-body); }
.f-pop-i + .f-pop-i::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); opacity: .7; }
.f-pop-i:active { background: var(--press); }
.f-pop-i .f-pop-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-pop-i .f-pop-d { display: block; font-size: var(--fs-foot); color: var(--text-2); white-space: normal; }
.f-pop-i .f-tick { color: var(--accent); width: 18px; height: 18px; opacity: 0; }
.f-pop-i[aria-checked="true"] .f-tick { opacity: 1; }
.f-pop-i.danger { color: var(--red); }
.f-pop-add { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 16px; min-height: 46px; position: relative; }
.f-pop-add::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); opacity: .7; }
.f-pop-add input { flex: 1; min-width: 0; min-height: 34px; }
.f-pop-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; padding: 14px 16px 10px; }
.f-pop-grid button { width: 100%; aspect-ratio: 1; border-radius: 50%; background: var(--sw); display: grid; place-items: center; color: #fff;
  transition: transform var(--t-fast) var(--ease-out); }
.f-pop-grid button:active { transform: scale(.9); }
.f-pop-grid button svg { width: 16px; height: 16px; opacity: 0; }
.f-pop-grid button[aria-checked="true"] svg { opacity: 1; }
.f-pop-custom { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; min-height: 44px; position: relative; color: var(--accent); }
.f-pop-custom::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); opacity: .7; }
.f-pop-custom input[type="color"] { width: 44px; height: 28px; padding: 0; border-radius: 8px; background: none; cursor: pointer; }
.f-pop-custom input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.f-pop-custom input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }

/* ------------------------------------------------------------------ video sheet: links editor, history */
.f-link { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 6px 4px 6px 16px; position: relative; }
.f-link + .f-link::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.f-link .f-main { display: flex; flex-direction: column; justify-content: center; }
.f-link .f-in { min-height: 26px; text-align: left; font-weight: 500; }
.f-link a { color: var(--text-2); font-size: var(--fs-foot); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; display: block; }
.f-hist { padding: 12px 16px; position: relative; }
.f-hist + .f-hist::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.f-hist .h-f { font-weight: 600; font-size: var(--fs-sub); }
.f-hist .h-v { margin-top: 2px; overflow-wrap: anywhere; line-height: 1.3; white-space: pre-wrap; }
.f-hist .h-v s { color: var(--text-2); text-decoration-thickness: 1px; }
.f-hist .h-w { margin-top: 3px; color: var(--text-2); font-size: var(--fs-foot); }
.f-empty { text-align: center; color: var(--text-2); padding: 34px 24px; font-size: var(--fs-sub); line-height: 1.4; }
.f-offline { text-align: center; color: var(--text-2); padding: 56px 24px; font-size: var(--fs-sub); line-height: 1.4; }
.f-offline .f-btn { margin-top: 14px; color: var(--text); }

/* ------------------------------------------------------------------ Ideas */
.id-add { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 8px 0 16px; background: var(--f-group); border-radius: 999px; box-shadow: var(--shadow-card); }
.id-add input { flex: 1; min-width: 0; min-height: 50px; }
.id-add .id-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink);
  opacity: .35; transition: opacity var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.id-add.has .id-go { opacity: 1; }
.id-add .id-go:active { transform: scale(.92); }
.id-list { margin-top: 20px; }
.id-seg { margin: 4px 0 14px; max-width: 360px; }
.id-item { position: relative; overflow: hidden; touch-action: pan-y; }
.id-item + .id-item::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); z-index: 2; }
.id-front { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 6px 10px 16px;
  background: var(--f-group); will-change: transform; width: 100%; }
.id-front:active { background: color-mix(in srgb, var(--f-group), var(--text) 6%); }
.id-front .f-main { padding-right: 4px; }
.id-front .f-t { font-weight: 500; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.id-acts { position: absolute; inset: 0 0 0 auto; display: flex; z-index: 0; visibility: hidden; }
.id-item.sw .id-acts { visibility: visible; }
.id-acts button { width: 84px; color: #fff; font-size: var(--fs-sub); font-weight: 600; display: grid; place-items: center; align-content: center; gap: 3px; }
.id-acts .sched { background: var(--accent); }
.id-acts .del { background: var(--red); }
.id-item.leaving { transition: height 240ms var(--ease-out), opacity 200ms var(--ease-out); overflow: hidden; opacity: 0; }

/* ------------------------------------------------------------------ Settings */
.st-person .f-t, .st-key .f-t { font-weight: 500; }
.st-swatch-btn { padding: 8px; margin: -8px; border-radius: 50%; }
.st-name { width: 100%; min-height: 26px; font-weight: 500; text-align: left; }
.st-desc { width: 100%; min-height: 22px; text-align: left; color: var(--text-2); font-size: 16px; }   /* 16: iOS zooms smaller inputs on focus */
.st-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700; font-size: 34px; letter-spacing: .14em;
  text-align: center; padding: 18px 8px 8px; user-select: all; -webkit-user-select: all; }
.st-count { text-align: center; color: var(--text-2); font-size: var(--fs-foot); padding-bottom: 16px; }
.st-state { display: flex; align-items: center; gap: 8px; }
.st-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; background: var(--fill); font-size: var(--fs-foot); font-weight: 600; color: var(--text-2); }
.st-pill.ok { color: var(--green); background: color-mix(in srgb, var(--green) 16%, transparent); }
.st-pill.warn { color: var(--warn-text, var(--orange)); background: color-mix(in srgb, var(--orange) 16%, transparent); }
@media (prefers-color-scheme: light) { .st-pill.warn { color: var(--warn-text, #C93400); } }
.st-btnrow { display: flex; gap: 10px; padding: 10px 16px 14px; flex-wrap: wrap; }
.st-keybox { margin: 10px 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fill); font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }

/* ------------------------------------------------------------------ pair screen */
.pr-wrap { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: calc(var(--safe-t) + 24px) calc(var(--safe-r) + 24px) calc(var(--safe-b) + 24px) calc(var(--safe-l) + 24px); }
.pr-wrap.in-app { min-height: 78dvh; padding: 8px 8px 24px; }
.pr-card { width: min(380px, 100%); }
.pr-mark { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 22px; display: block; }
.pr-title { font-size: var(--fs-title); font-weight: 700; letter-spacing: .01em; margin: 0 0 8px; }
.pr-sub { color: var(--text-2); font-size: var(--fs-sub); line-height: 1.4; margin: 0 0 26px; }
.pr-code { display: block; width: 100%; min-height: 64px; text-align: center; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-weight: 700;
  font-size: 30px; letter-spacing: .22em; text-transform: uppercase; background: var(--card); border-radius: var(--radius-card); padding: 0 8px 0 calc(8px + .22em); }
.pr-card .f-btn { width: 100%; margin-top: 14px; min-height: 52px; font-size: 17px; }
.pr-err { color: var(--red); font-size: var(--fs-sub); margin: 14px 4px 0; min-height: 20px; line-height: 1.35; }
.pr-ok { color: var(--green); }
.pr-fine { color: var(--text-2); font-size: var(--fs-foot); margin: 22px 8px 0; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .f-pop { transform: none; transition: opacity 120ms linear; }
  .f-sw, .f-sw::after, .f-btn { transition: none; }
}
@media (hover: hover) {
  .f-row.tap:hover { background: var(--press); }
  .f-pop-i:hover { background: var(--press); }
}

.fx [hidden] { display: none !important; }
.f-pop-scrim { position: fixed; inset: 0; z-index: var(--z-menu); background: transparent; touch-action: none; }
.f-row.ro { pointer-events: none; }
.f-row.ro .f-ud, .f-row.ro .f-chev { display: none; }
.f-row.tap.act .f-ico { color: var(--accent); }
.f-row.two { padding-top: 9px; padding-bottom: 9px; }
.f-row .seg { flex: 1; max-width: 250px; margin-left: auto; }
.f-row .seg button { padding: 0 10px; }
.id-seg { margin: 4px 0 14px; max-width: 360px; }
.id-seg button { font-size: 15px; }
