/* Edit Bay: clean light and bold. White canvas, hairline borders instead of shadows, heavy display type,
   one coral accent for signals and black for primary actions. Stage colors stay semantic. */
:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --subtle: #F6F6F7;
  --column: #F4F4F5;
  --fill: #EFEFF1;
  --fill-2: #F5F5F6;
  --line: #E7E7EA;
  --line-strong: #D6D6DB;
  --ink: #0C0C10;
  --ink-2: #63636E;
  --ink-3: #A3A3AD;
  --accent: #FF5533;
  --accent-ink: #FFFFFF;
  --accent-soft: #FFF0EB;
  --primary: #0C0C10;
  --primary-ink: #FFFFFF;
  --gray: #8B8B97;
  --blue: #2E6BFF;
  --orange: #F59300;
  --purple: #9A4DFF;
  --green: #14A963;
  --red: #E5352B;
  --scrim: rgba(12, 12, 16, .32);
  --shadow-pop: 0 24px 64px rgba(12, 12, 16, .14), 0 0 0 1px rgba(12, 12, 16, .06);
  --shadow-lift: 0 18px 40px rgba(12, 12, 16, .16), 0 0 0 1px rgba(12, 12, 16, .06);
  --radius: 16px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Consolas, monospace;
  --gutter-l: max(24px, env(safe-area-inset-left, 0px));
  --gutter-r: max(24px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
mark { background: #FFE2D9; color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Top bar: frosted white; hairline appears once content scrolls under ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; padding-top: env(safe-area-inset-top, 0px);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 transparent; transition: box-shadow .2s;
}
.nav.scrolled { box-shadow: 0 1px 0 var(--line); }
.nav-inner {
  max-width: 1200px; margin: 0 auto; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.nav-title { font-weight: 800; font-size: 1.125rem; letter-spacing: -.03em; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s; }
.nav.scrolled .nav-title { opacity: 1; transform: none; }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  color: var(--ink); border: 1px solid var(--line); background: var(--surface);
  transition: transform .1s ease-out, background .15s, border-color .15s;
}
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.icon-btn:hover { border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); background: var(--subtle); }
.btn-primary, .btn-secondary {
  height: 40px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; gap: 8px;
  font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; white-space: nowrap;
  transition: transform .1s ease-out, background .15s, border-color .15s, opacity .15s;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary svg { stroke-width: 2.4; width: 17px; height: 17px; }
.btn-primary:hover { opacity: .88; }
.btn-secondary { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.btn-secondary svg { color: var(--accent); stroke-width: 2.2; width: 18px; height: 18px; }
.btn-secondary:hover { border-color: var(--line-strong); }
.btn-primary:active, .btn-secondary:active { transform: scale(.96); }
@media (max-width: 640px) {
  .btn-secondary .lbl { display: none; }
  .btn-secondary { width: 40px; padding: 0; justify-content: center; }
  .btn-primary .lbl { font-size: 0; }
  .btn-primary .lbl::after { content: "New"; font-size: .9375rem; }
}

/* ---------- Menu popover: grows from its trigger ---------- */
.menu {
  position: fixed; z-index: 30; min-width: 250px; padding: 6px;
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-pop);
  transform-origin: top right; opacity: 0; transform: scale(.94);
  transition: opacity .16s ease, transform .26s cubic-bezier(.2, .9, .3, 1);
}
.menu.open { opacity: 1; transform: none; }
.menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 9px; font-size: .9375rem; font-weight: 500; text-align: left; }
.menu button:hover, .menu button:active { background: var(--subtle); }
.menu svg { color: var(--ink-2); }
.menu .destructive, .menu .destructive svg { color: var(--red); }

/* ---------- Page ---------- */
.page { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 8px calc(env(safe-area-inset-bottom, 0px) + 96px); }
.hero { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-top: 12px; }
.large-title { margin: 0; font-size: clamp(2.75rem, 7vw, 4.25rem); font-weight: 800; line-height: 1; letter-spacing: -.05em; }
.today { margin: 0; color: var(--ink-2); font-size: 1rem; font-weight: 500; font-family: var(--mono); letter-spacing: -.02em; }

/* Summary: four bold figures, each in a bordered tile */
.summary { margin-top: 32px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 18px 20px 20px; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric .k { display: block; font-size: .875rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metric .v { display: block; margin-top: 10px; font-size: 2.75rem; font-weight: 800; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.metric { display: flex; flex-direction: column-reverse; justify-content: flex-end; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, background-color .15s, transform .2s cubic-bezier(.2,.8,.2,1); }
.metric:hover { border-color: #C9C9CF; background: #FAFAFB; }
.metric:active { transform: scale(.98); }
.metric:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.metric.win .v { color: var(--green, #14A963); }
@media (prefers-reduced-motion: reduce) { .metric:active { transform: none; } }
@media (max-width: 720px) { .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric .v { font-size: 2.25rem; } }

/* ---------- Toolbar ---------- */
.toolbar { margin-top: 28px; display: flex; align-items: center; gap: 10px; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink-3); cursor: text;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(12, 12, 16, .06); }
.search svg { width: 18px; height: 18px; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 1rem; }
.search input::placeholder { color: var(--ink-3); }
.search kbd { font: 500 .75rem var(--mono); color: var(--ink-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }
@media (hover: none) { .search kbd { display: none; } }
.segmented { position: relative; flex: none; width: 400px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 13px; background: var(--fill); }
.seg-thumb { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 9px; background: var(--primary); transition: transform .34s cubic-bezier(.3, 1, .4, 1); }
.segmented button {
  position: relative; z-index: 1; height: 38px; font-size: .9375rem; font-weight: 600; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 6px; transition: color .2s;
}
.segmented button[aria-selected="true"] { color: var(--primary-ink); }
.segmented .n { font: 500 .8125rem var(--mono); opacity: .6; font-variant-numeric: tabular-nums; }
.layout-toggle { flex: none; display: flex; padding: 4px; border-radius: 13px; background: var(--fill); }
.layout-toggle button { width: 44px; height: 38px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); transition: background .2s, color .2s, transform .1s ease-out; }
.layout-toggle button:active { transform: scale(.92); }
.layout-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(12, 12, 16, .12); }
.layout-toggle svg { width: 20px; height: 20px; }
@media (max-width: 900px) { .toolbar { flex-wrap: wrap; } .search { flex-basis: 100%; } .segmented { flex: 1 1 0; width: auto; min-width: 0; } }
@media (max-width: 480px) { .segmented .n { display: none; } .layout-toggle button { width: 40px; } }

/* Capsule filters */
.capsules { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 20px calc(-1 * var(--gutter-r)) 0 0; padding-right: var(--gutter-r); }
.capsules::-webkit-scrollbar { display: none; }
.capsules:empty { display: none; }
.capsule {
  flex: none; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--surface);
  font-size: .875rem; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 7px;
  transition: transform .1s ease-out, background .15s, color .15s, border-color .15s;
}
.capsule:hover { border-color: var(--line-strong); }
.capsule:active { transform: scale(.95); }
.capsule .n { font: 500 .8125rem var(--mono); color: var(--ink-3); }
.capsule[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.capsule[aria-pressed="true"] .n { color: inherit; opacity: .6; }

.note {
  margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-radius: var(--radius); background: var(--subtle); font-size: .9375rem; color: var(--ink-2);
}
.note button { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* ---------- Lists ---------- */
.section-head { margin: 36px 4px 12px; display: flex; align-items: baseline; gap: 10px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.03em; }
.section-head span:last-child { font: 500 .875rem var(--mono); color: var(--ink-3); letter-spacing: -.02em; }
.section-head.alert span:first-child { color: var(--accent); }
.list { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.row { position: relative; display: flex; align-items: center; gap: 18px; width: 100%; min-height: 78px; padding: 14px 20px; text-align: left; transition: background .12s; }
.row + .row { border-top: 1px solid var(--line); }
@media (hover: hover) { .row:hover { background: var(--subtle); } }
.row:active { background: var(--fill); transition: none; }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prio { color: var(--accent); font-weight: 800; margin-right: 5px; }
.row-sub { font-size: .9375rem; color: var(--ink-2); line-height: 1.4; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-trail { text-align: right; flex: none; }
.row-trail .d { font: 500 1rem var(--mono); letter-spacing: -.02em; }
.row-trail .r { font-size: .8125rem; color: var(--ink-2); font-weight: 500; }
.row-trail.soon .r { color: var(--orange); }
.row-trail.over .d, .row-trail.over .r { color: var(--accent); }
.chev { width: 16px; height: 16px; color: var(--ink-3); stroke-width: 2.2; }

/* Stage ring */
.ring { width: 34px; height: 34px; flex: none; position: relative; }
.ring svg { width: 34px; height: 34px; transform: rotate(-90deg); stroke-linecap: round; }
.ring .track { stroke: var(--fill); stroke-width: 3.5; }
.ring .prog { stroke: var(--c); stroke-width: 3.5; transition: stroke-dashoffset .5s cubic-bezier(.3, 1, .4, 1); }
.ring.done-ring { background: var(--green); border-radius: 50%; display: grid; place-items: center; color: #fff; }
.ring.done-ring svg { width: 17px; height: 17px; transform: none; stroke-width: 2.8; }
[data-stage="brief"] { --c: var(--gray); }
[data-stage="edit"] { --c: var(--blue); }
[data-stage="review"] { --c: var(--orange); }
[data-stage="revise"] { --c: var(--purple); }
[data-stage="delivered"] { --c: var(--green); }
.stage-name { color: var(--c); font-weight: 700; font-size: .8125rem; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--c) 12%, transparent); letter-spacing: 0; }

/* Files */
.tile { width: 36px; height: 36px; border-radius: 10px; flex: none; display: grid; place-items: center; font-size: .8125rem; font-weight: 800; color: #fff; background: var(--t, var(--gray)); letter-spacing: -.02em; }
.file-actions { display: flex; gap: 6px; flex: none; }
.pill-btn {
  height: 34px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: .875rem; font-weight: 600; display: inline-flex; align-items: center; text-decoration: none;
  transition: transform .1s ease-out, border-color .15s;
}
.pill-btn:hover { border-color: var(--line-strong); }
.pill-btn:active { transform: scale(.95); }

.empty { text-align: center; padding: 64px 24px; color: var(--ink-2); border: 1px dashed var(--line-strong); border-radius: var(--radius); margin-top: 24px; }
.empty h2 { margin: 0 0 8px; font-size: 1.625rem; font-weight: 800; letter-spacing: -.035em; color: var(--ink); text-wrap: balance; }
.empty p { margin: 0 auto; max-width: 38ch; }
.empty .text-btn { margin-top: 16px; }

/* ---------- Board ---------- */
.board { margin-top: 24px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; align-items: start; }
.col { min-width: 0; background: var(--column); border-radius: 18px; padding: 8px; transition: background .2s, box-shadow .2s; }
.col.drop { background: color-mix(in srgb, var(--c) 9%, var(--column)); box-shadow: inset 0 0 0 2px var(--c); }
.col-head { display: flex; align-items: center; gap: 9px; padding: 10px 10px 12px; font-size: .9375rem; font-weight: 700; letter-spacing: -.015em; }
.col-head .dot { width: 9px; height: 9px; border-radius: 3px; background: var(--c); flex: none; }
.col-head .n { margin-left: auto; font: 500 .8125rem var(--mono); color: var(--ink-3); }
.col-cards { display: flex; flex-direction: column; gap: 8px; min-height: 64px; }
.col-empty { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 20px 12px; text-align: center; color: var(--ink-3); font-size: .875rem; }
.col-more { display: block; width: 100%; padding: 10px; margin-top: 4px; color: var(--ink); font-size: .875rem; font-weight: 600; text-align: center; border-radius: 10px; }
.col-more:hover { background: var(--fill); }
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 14px 14px 12px;
  cursor: grab; user-select: none; -webkit-user-select: none; transition: transform .12s ease-out, border-color .15s, opacity .2s;
}
@media (hover: hover) { .card:hover { border-color: var(--line-strong); } }
.card:active { transform: scale(.98); }
.card.placeholder { opacity: .3; }
.card.landing { opacity: 0; transition: none; }
.card.ghost { position: fixed; left: 0; top: 0; margin: 0; z-index: 70; pointer-events: none; cursor: grabbing; box-shadow: var(--shadow-lift); border-color: transparent; transition: none; will-change: transform; opacity: 1; }
html.dragging, html.dragging * { cursor: grabbing !important; user-select: none !important; }
.card-title { font-size: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.card-client { margin-top: 3px; font-size: .875rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-prog { height: 4px; border-radius: 2px; background: var(--fill); margin-top: 12px; overflow: hidden; }
.card-prog i { display: block; height: 100%; border-radius: 2px; background: var(--c); }
.card-foot { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: .8125rem; color: var(--ink-2); }
.card-foot .mi { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.card-foot .mi svg { width: 14px; height: 14px; }
.card-foot .ver { margin-left: auto; font-family: var(--mono); letter-spacing: -.02em; }
.due-chip { padding: 3px 8px; border-radius: 7px; background: var(--fill-2); border: 1px solid var(--line); font-weight: 600; white-space: nowrap; color: var(--ink); }
.due-chip.soon { color: #B86E00; background: #FFF4E0; border-color: #FFE2B0; }
.due-chip.over { color: var(--accent); background: var(--accent-soft); border-color: #FFD3C6; }
@media (max-width: 1100px) {
  .board {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(260px, 42%);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-left: var(--gutter-l);
    margin-left: calc(-1 * var(--gutter-l)); margin-right: calc(-1 * var(--gutter-r));
    padding: 0 var(--gutter-r) 10px var(--gutter-l); scrollbar-width: none;
  }
  .board::-webkit-scrollbar { display: none; }
  .col { scroll-snap-align: start; }
}
@media (max-width: 600px) { .board { grid-auto-columns: 84%; } }

/* ---------- Sheets: right panel on wide screens, bottom sheet on phones ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: var(--scrim); opacity: 0; pointer-events: none; }
.scrim.on { pointer-events: auto; }
.sheet {
  position: fixed; z-index: 41; background: var(--surface); display: flex; flex-direction: column;
  box-shadow: var(--shadow-pop); will-change: transform; visibility: hidden;
  top: 14px; right: 14px; bottom: 14px; width: min(560px, calc(100% - 28px)); border-radius: 22px;
}
.sheet.shown { visibility: visible; }
@media (max-width: 759px) {
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: calc(100% - env(safe-area-inset-top, 0px) - 40px); border-radius: 20px 20px 0 0; }
}
.sheet-head {
  position: relative; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 24px 12px; touch-action: none; user-select: none; cursor: grab;
}
.sheet-head:active { cursor: grabbing; }
.sheet-title { font-weight: 700; font-size: 1rem; letter-spacing: -.02em; }
.grabber { position: absolute; top: 7px; left: 50%; width: 38px; height: 5px; margin-left: -19px; border-radius: 3px; background: var(--line-strong); }
@media (min-width: 760px) { .grabber { display: none; } }
.text-btn { color: var(--ink); font-size: 1rem; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; padding: 6px 4px; transition: opacity .1s; }
.text-btn:active { opacity: .45; }
.text-btn.strong { font-weight: 700; color: var(--accent); }
.text-btn:disabled { opacity: .35; cursor: default; }
.text-btn.destructive { color: var(--red); }
.text-btn svg { width: 22px; height: 22px; }
.save-state { font: 500 .8125rem var(--mono); color: var(--ink-3); letter-spacing: -.02em; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 24px calc(env(safe-area-inset-bottom, 0px) + 32px); }

.f-title, .f-client { width: 100%; border: 0; background: none; outline: none; padding: 0; }
.f-title { font-size: 2.25rem; font-weight: 800; letter-spacing: -.045em; line-height: 1.1; }
.f-client { margin-top: 6px; font-size: 1.125rem; color: var(--ink-2); font-weight: 500; }
.f-title::placeholder, .f-client::placeholder { color: var(--ink-3); }

.stage-picker { margin-top: 24px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.stage-picker button { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 0; text-align: left; }
.stage-picker .bar { height: 6px; border-radius: 3px; background: var(--fill); transition: background .25s, transform .1s; }
.stage-picker button.on .bar { background: var(--c); }
.stage-picker .lbl { font-size: .75rem; font-weight: 500; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-picker button[aria-checked="true"] .lbl { color: var(--ink); font-weight: 700; }
.stage-picker button:active .bar { transform: scaleY(1.6); }
.primary-btn { margin-top: 20px; width: 100%; height: 52px; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font-size: 1rem; font-weight: 700; transition: transform .1s ease-out, opacity .15s; }
.primary-btn:active { transform: scale(.98); opacity: .85; }
.primary-btn.quiet { background: var(--subtle); color: var(--ink-2); }

.group-label { margin: 30px 2px 10px; font-size: .9375rem; font-weight: 700; letter-spacing: -.015em; color: var(--ink); }
.group-label span { font: 500 .8125rem var(--mono); color: var(--ink-3); margin-left: 4px; }
.group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.cell { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; padding: 8px 16px; }
.cell::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line); }
.group > .cell:first-child::before,
.group > div:first-child > .cell:first-child::before,
.group > div:first-child:empty + .cell::before { content: none; }
.cell.muted { color: var(--ink-3); font-size: .9375rem; }
.cell > span:first-child { flex: none; font-weight: 500; }
.cell input, .cell select {
  flex: 1; min-width: 0; text-align: right; border: 0; background: none; outline: none; color: var(--ink-2);
  font-size: 1rem; padding: 6px 0; appearance: none; -webkit-appearance: none;
}
.cell select { cursor: pointer; text-align-last: right; }
.cell input::placeholder { color: var(--ink-3); }
.cell input:focus, .cell select:focus { color: var(--ink); }
.cell input[type="date"] { color: var(--ink); font-family: var(--mono); font-size: .9375rem; }
.cell input[type="date"]::-webkit-calendar-picker-indicator { opacity: .45; cursor: pointer; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; }
.stepper button { width: 38px; height: 32px; font-size: 1.125rem; color: var(--ink); transition: background .1s; }
.stepper button:active { background: var(--fill); }
.stepper button:first-child { border-radius: 9px 0 0 9px; }
.stepper button:last-child { border-radius: 0 9px 9px 0; }
.stepper output { min-width: 38px; text-align: center; font: 500 .9375rem var(--mono); color: var(--ink); }

/* Switch */
.cell input.switch {
  flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--fill); position: relative; cursor: pointer;
  transition: background .2s; padding: 0;
}
.cell input.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .28s cubic-bezier(.3, 1.3, .5, 1);
}
.cell input.switch:checked { background: var(--accent); }
.cell input.switch:checked::after { transform: translateX(18px); }
.cell:has(.switch) > span:first-child { flex: 1; min-width: 0; }

.link-cell { justify-content: flex-start; padding-block: 10px; }
.link-cell .row-main { flex: 1; min-width: 0; }
.link-cell .row-title { font-size: .9375rem; }
.link-cell .row-sub { font-size: .8125rem; font-family: var(--mono); letter-spacing: -.02em; }
.icon-ghost { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: background .1s, color .1s; text-decoration: none; }
.icon-ghost:hover { background: var(--subtle); color: var(--ink); }
.icon-ghost svg { width: 18px; height: 18px; }
.icon-ghost.minus { color: var(--ink-3); }
.icon-ghost.minus:hover { color: var(--red); background: #FDECEB; }
.add-link { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; }
.add-link input { text-align: left; color: var(--ink); font-size: .9375rem; }
@media (max-width: 420px) { .add-link { grid-template-columns: minmax(0, 1fr) auto; } .add-link #l-label { grid-row: 2; } }
.add-task { justify-content: flex-start; }
.add-task input { text-align: left; color: var(--ink); }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; color: #fff; transition: background .18s, border-color .18s, transform .1s ease-out; }
.check svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .25s cubic-bezier(.3, 1.5, .5, 1); }
.check.on { background: var(--ink); border-color: var(--ink); }
.check.on svg { opacity: 1; transform: none; }
.check.add { border-style: dashed; color: var(--ink-3); }
.check.add svg { opacity: 1; transform: none; stroke-width: 2.2; }
button.check:active { transform: scale(.85); }
.task-cell { justify-content: flex-start; }
.task-cell .t { flex: 1; min-width: 0; transition: color .2s; }
.task-cell.done .t { color: var(--ink-3); text-decoration: line-through; }
.task-cell .icon-ghost { opacity: 0; transition: opacity .15s; }
.task-cell:hover .icon-ghost, .task-cell:focus-within .icon-ghost { opacity: 1; }
@media (hover: none) { .task-cell .icon-ghost { opacity: 1; } }
#f-notes, #fioText { display: block; width: 100%; border: 0; background: none; outline: none; resize: vertical; padding: 14px 16px; line-height: 1.55; min-height: 110px; }
#fioText { font: .875rem/1.6 var(--mono); letter-spacing: -.02em; min-height: 160px; }
#f-notes::placeholder, #fioText::placeholder { color: var(--ink-3); }
.meta { margin: 24px 0 0; font: 500 .8125rem var(--mono); color: var(--ink-3); text-align: center; letter-spacing: -.02em; }

/* Frame.io importer */
.hint { margin: 4px 0 12px; color: var(--ink-2); font-size: .9375rem; }
.example {
  margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--subtle);
  font: .8125rem/1.7 var(--mono); color: var(--ink-2); letter-spacing: -.02em; white-space: pre-wrap; overflow-wrap: anywhere;
}
.badge { flex: none; font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 7px; white-space: nowrap; max-width: 46%; overflow: hidden; text-overflow: ellipsis; }
.badge.new { color: var(--green); background: #E6F7EE; }
.badge.attach { color: var(--blue); background: #E9F0FF; }
.badge.skip { color: var(--ink-2); background: var(--fill); }
.badge.err { color: var(--red); background: #FDECEB; }
.placeholder-name { color: var(--ink-3); font-style: italic; font-weight: 500; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); z-index: 60;
  display: flex; align-items: center; gap: 16px; max-width: calc(100% - 32px);
  padding: 12px 12px 12px 18px; border-radius: 14px; background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 14px 40px rgba(12, 12, 16, .25); font-size: .9375rem; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px) scale(.96); pointer-events: none;
  transition: opacity .2s ease, transform .35s cubic-bezier(.3, 1, .4, 1);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--accent); font-weight: 700; padding: 2px 6px; }

/* ---------- Accessibility preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
  .menu, .toast { transition: opacity .15s !important; }
}
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --line: #BDBDC4; --ink-2: #3A3A42; } }
