/* Content Autopilot: layout and components. Values come from tokens.css only. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--t-md)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1 { font: 700 var(--t-3xl)/1.05 var(--font-display); letter-spacing: -.005em; }
h2 { font: 700 var(--t-xl)/1.1 var(--font-display); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
h1:focus, h1:focus-visible, main:focus { outline: none; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: var(--s-2); top: -60px; z-index: 50; background: var(--ink); color: #fff; padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); }
.skip:focus { top: var(--s-2); }
.muted { color: var(--ink-3); }
.ic { width: 22px; height: 22px; flex: none; }
.unnamed { color: var(--ink-3); font-style: normal; }

/* ---------- shell: phone first ---------- */
.top {
  position: sticky; top: 0; z-index: 10; background: rgba(255, 255, 255, .97);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: calc(var(--s-2) + env(safe-area-inset-top)) var(--s-4) var(--s-2); border-bottom: 1px solid var(--line);
  min-height: 56px;
}
.brand { display: flex; align-items: center; gap: var(--s-2); text-decoration: none; min-height: 44px; }
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.brand span { font: 700 var(--t-lg)/1 var(--font-display); }
.demo { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; line-height: 20px; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; box-shadow: var(--shadow-bar); padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: var(--tabbar); text-decoration: none; color: var(--ink-3); font-size: var(--t-sm); font-weight: 500;
}
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--gold); }
.tabs a:hover { color: var(--ink); }
.tabs .badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--gold); color: var(--ink); font: 700 14px/20px var(--font-body); text-align: center;
}
main { display: block; padding: var(--s-6) var(--s-4) calc(var(--tabbar) + var(--s-12) + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.lede { color: var(--ink-2); margin-top: var(--s-2); max-width: 36em; }
.sec-head { display: flex; align-items: baseline; gap: var(--s-2); margin: var(--s-8) 0 var(--s-3); }
.count { font: 700 var(--t-xl)/1 var(--font-display); color: var(--ink-3); }
.empty { color: var(--ink-2); background: var(--surface); border-radius: var(--r-md); padding: var(--s-4); }
.empty.sm { font-size: var(--t-sm); padding: var(--s-3); grid-column: 1 / -1; }
.note { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); color: var(--ink-2); }
.foot { margin-top: var(--s-10); text-align: center; }
.link { background: none; border: 0; padding: var(--s-2); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.link:hover { color: var(--ink); }
.back { display: inline-flex; align-items: center; gap: var(--s-1); margin: calc(var(--s-2) * -1) 0 var(--s-3) calc(var(--s-2) * -1); padding: var(--s-2); min-height: 44px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.back:hover { color: var(--ink); }
.back .ic { width: 20px; height: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: var(--tap); padding: 0 var(--s-5); border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 600; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s;
}
.btn .ic { width: 20px; height: 20px; }
.btn-main { background: var(--ink); color: #fff; }
.btn-main:hover { background: #000; }
.btn-ghost { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink-3); }
.btn-quiet { background: var(--surface); color: var(--ink); }
.btn-quiet:hover { background: var(--surface-2); }
.btn.sm { min-height: 44px; padding: 0 var(--s-4); font-size: var(--t-sm); }
.btn.wide { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: #fff; }
.iconbtn:hover:not(:disabled) { border-color: var(--ink-3); }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn .ic { width: 20px; height: 20px; }

.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Clips (staff) ---------- */
.drop h1 { font-size: var(--t-4xl); line-height: .95; }
.upload {
  position: relative; display: flex; align-items: center; gap: var(--s-4); margin-top: var(--s-6);
  min-height: 112px; padding: var(--s-5); border-radius: var(--r-lg); background: var(--ink); color: #fff; cursor: pointer;
  transition: background-color .15s;
}
.upload:hover { background: #000; }
.upload:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.upload-ic { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--ink); flex: none; }
.upload-ic .ic { width: 30px; height: 30px; stroke-width: 2.2; }
.upload-txt { display: flex; flex-direction: column; }
.upload-txt b { font: 700 var(--t-3xl)/1 var(--font-display); }
.upload-txt span { color: rgba(255, 255, 255, .78); margin-top: var(--s-1); }

.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 88px; }
.rows li > .row { border-bottom: 0; }
.rows li { border-bottom: 1px solid var(--line); }
.rows li.row { border-bottom: 1px solid var(--line); }
a.row:hover .row-main b { text-decoration: underline; text-underline-offset: 3px; }
.thumb { width: 45px; height: 80px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface); flex: none; }
.thumb-empty { display: grid; place-items: center; color: var(--ink-3); }
.row-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-main b { font: 700 var(--t-xl)/1.1 var(--font-display); }
.row-main small { color: var(--ink-3); font-size: var(--t-sm); }
.st { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-2); font-size: var(--t-sm); margin: 2px 0; }
.st-busy { color: var(--ink); }
.st-err { color: var(--danger); }
.chev { color: var(--ink-3); width: 20px; height: 20px; }

/* ---------- sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.scrim { position: absolute; inset: 0; background: rgba(28, 26, 24, .42); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; background: #fff;
  border-radius: var(--r-lg) var(--r-lg) 0 0; box-shadow: var(--shadow-sheet);
  padding: var(--s-6) var(--s-4) calc(var(--s-6) + env(safe-area-inset-bottom)); transform: translateY(16px); opacity: 0;
  transition: transform .22s var(--ease), opacity .18s;
}
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-x { position: absolute; top: var(--s-3); right: var(--s-3); border: 0; }
.sheet h2 { font-size: var(--t-2xl); padding-right: 48px; }
.sheet-sub { color: var(--ink-2); margin-top: var(--s-1); }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-5) 0; }
.chip { min-height: 44px; padding: 0 var(--s-4); border-radius: var(--r-md); border: 1px solid var(--line-2); background: #fff; font-weight: 500; }
.chip:hover { border-color: var(--ink); background: var(--surface); }
.other label { display: block; font-weight: 600; font-size: var(--t-sm); margin-bottom: var(--s-1); }
.inline { display: flex; gap: var(--s-2); }
.inline input { flex: 1; min-width: 0; }
input:not([type]), input[type="text"], select, textarea {
  min-height: var(--tap); border: 1px solid var(--line-2); border-radius: var(--r-md); padding: var(--s-3); background: #fff; width: 100%;
}
input:not([type]):hover, select:hover, textarea:hover { border-color: var(--ink-3); }
.sheet > .btn.wide { margin-top: var(--s-4); }
.ent-sheet { display: flex; gap: var(--s-4); align-items: flex-start; }
.ent-sheet p { color: var(--ink-2); margin: var(--s-2) 0; }
.es-thumb { width: 72px; height: 128px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.sheet-acts { display: grid; gap: var(--s-2); margin-top: var(--s-5); }

/* ---------- Ready list ---------- */
.preps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
.prep { display: flex; gap: var(--s-4); align-items: center; padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; transition: border-color .15s; }
.prep:hover { border-color: var(--ink-3); }
.prep-cover { width: 63px; height: 112px; border-radius: var(--r-sm); object-fit: cover; flex: none; background: var(--surface); }
.prep-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.prep-main b { font: 700 var(--t-xl)/1.1 var(--font-display); }
.prep-line, .prep-cap { font-size: var(--t-sm); color: var(--ink-2); }
.prep-cap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prep-cap::before { content: "Text: "; color: var(--ink-3); }
.prep-when { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); font-size: var(--t-sm); font-weight: 600; margin-top: var(--s-1); }
.marks { display: inline-flex; gap: 6px; }
.mark { display: inline-grid; place-items: center; color: var(--ink); }
.mark .ic { width: 17px; height: 17px; }
.mark.off { color: var(--line-2); }

/* ---------- One clip ---------- */
.clip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); }
.clip-head .btn { flex: none; margin-top: 2px; }
.clip-status { color: var(--ink-2); margin-top: var(--s-2); }
.clip-grid { display: grid; gap: var(--s-6); margin-top: var(--s-5); }
.stage {
  position: relative; width: min(100%, 300px); margin: 0 auto; aspect-ratio: 9 / 16; border-radius: var(--r-lg); overflow: hidden; background: var(--ink);
}
.stage video { width: 100%; height: 100%; object-fit: cover; }
.stage.broken::after { content: "This phone can't play this video."; position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-4); text-align: center; color: #fff; background: var(--ink); }
.stage-missing { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--s-6); text-align: center; color: #fff; }
.burn {
  position: absolute; left: 8%; right: 8%; top: 13%; margin: 0; text-align: center;
  font: 700 clamp(22px, 7.5cqw, 30px)/1.05 var(--font-display); color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .55), 0 0 14px rgba(0, 0, 0, .35); overflow-wrap: anywhere; pointer-events: none;
}
.stage, .m-media { container-type: inline-size; }
.playbtn {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 64px; height: 64px; border-radius: 50%; border: 0;
  display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink); transition: opacity .2s;
}
.playbtn .ic { width: 28px; height: 28px; }
.playbtn.on { opacity: 0; }
.stage:hover .playbtn.on, .playbtn.on:focus-visible { opacity: 1; }
.timecode { position: absolute; left: var(--s-3); bottom: var(--s-3); font-size: var(--t-xs); font-weight: 600; color: #fff; background: rgba(0, 0, 0, .5); padding: 2px 8px; border-radius: var(--r-xs); font-variant-numeric: tabular-nums; }

.blk + .blk { margin-top: var(--s-6); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.blk-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.blk-head .muted { font-size: var(--t-sm); }

/* trim: a filmstrip with two handles */
.trim { position: relative; height: 72px; --a: 0%; --b: 100%; touch-action: none; }
.strip { position: absolute; inset: 4px 0; display: flex; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.strip > * { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.strip > span { background: var(--surface-2); border-right: 1px solid var(--surface); }
.win {
  position: absolute; top: 0; bottom: 0; left: var(--a); width: calc(var(--b) - var(--a)); pointer-events: none;
  border: 3px solid var(--gold); border-left-width: 12px; border-right-width: 12px; border-radius: var(--r-sm);
  box-shadow: 0 0 0 999px rgba(255, 255, 255, .62);
}
.trim { overflow: hidden; border-radius: var(--r-sm); }
.trim input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.trim input[type="range"]::-webkit-slider-runnable-track { background: none; height: 100%; }
.trim input[type="range"]::-moz-range-track { background: none; height: 100%; }
.trim input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; pointer-events: auto; width: 36px; height: 72px; background: transparent; border: 0; cursor: ew-resize; }
.trim input[type="range"]::-moz-range-thumb { pointer-events: auto; width: 36px; height: 72px; background: transparent; border: 0; cursor: ew-resize; }
.trim input[type="range"]:focus-visible { outline: none; }
.trim:has(input:focus-visible) .win { outline: 3px solid var(--focus); outline-offset: 2px; }
.trim-times { display: flex; justify-content: space-between; margin-top: var(--s-2); font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.trim-times b { color: var(--ink); }

/* covers */
.covers { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s-2); }
.cv-skel { aspect-ratio: 9 / 16; border-radius: var(--r-sm); background: var(--surface); }
.cv { position: relative; padding: 0; border: 0; border-radius: var(--r-sm); background: var(--surface); overflow: hidden; aspect-ratio: 9 / 16; min-height: 44px; }
.cv img { width: 100%; height: 100%; object-fit: cover; }
.cv::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.cv[aria-checked="true"]::after { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 0 5px #fff; }
.cv:hover:not([aria-checked="true"])::after { box-shadow: inset 0 0 0 2px var(--ink-3); }
.cv-t { position: absolute; left: 0; right: 0; bottom: 0; font-size: 12px; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); padding: 10px 4px 3px; font-variant-numeric: tabular-nums; }
.covers:has(.cv:nth-child(7)) { grid-template-columns: repeat(7, minmax(0, 1fr)); }

/* overlay text options */
.opts { display: grid; gap: var(--s-2); }
.opt { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); padding: var(--s-2) var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s; }
.opt:hover { border-color: var(--ink-3); }
.opt:has(input:checked) { border-color: var(--ink); background: var(--surface); }
.opt input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex: none; }
.opt > span { font-weight: 500; flex: 1; min-width: 0; }
.ov-input { border: 0 !important; background: transparent !important; padding: 0 !important; min-height: 32px !important; }
.ov-input:focus { outline: none; }
.opt:has(.ov-input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* segmented platform control */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface); border-radius: var(--r-md); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; font-weight: 500; font-size: var(--t-sm); color: var(--ink-2); padding: 0 4px; }
.seg button .ic { width: 18px; height: 18px; }
.seg button:hover { color: var(--ink); }
.seg button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(28, 26, 24, .14); }
.seg button.is-off { text-decoration: line-through; text-decoration-color: var(--ink-3); }
textarea { display: block; margin-top: var(--s-3); resize: vertical; line-height: 1.5; min-height: 168px; }
.cap-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-2); flex-wrap: wrap; }
.tog { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; cursor: pointer; font-weight: 500; }
.tog input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.select { position: relative; }
.select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border: solid var(--ink-2); border-width: 0 2px 2px 0; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; font-weight: 500; cursor: pointer; }
.hint { font-size: var(--t-sm); color: var(--ink-3); margin-top: var(--s-2); }

.actionbar {
  position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 5; display: flex; gap: var(--s-2);
  margin: var(--s-8) calc(var(--s-4) * -1) 0; padding: var(--s-3) var(--s-4); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
.actionbar .btn { flex: 1; }
.actionbar .btn-main { flex: 1.6; }

/* ---------- Approve ---------- */
.appr-when-sm { margin-top: var(--s-1); color: var(--ink-2); }
.appr-when-sm b { color: var(--ink); font-weight: 600; }
.appr-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.appr { margin-top: var(--s-3); transition: transform .22s var(--ease), opacity .2s; }
.appr.leaving { transform: translateX(-24px); opacity: 0; }
.mock-wrap { margin-top: var(--s-3); }
.appr-side { margin-top: var(--s-5); }
.appr-when { display: flex; flex-direction: column; }
.appr-when .muted { font-size: var(--t-sm); }
.appr-when b { font: 700 var(--t-2xl)/1.1 var(--font-display); }
.facts { margin: var(--s-4) 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { display: grid; grid-template-columns: 64px 1fr; gap: var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.appr-actions {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); z-index: 15;
  display: grid; grid-template-columns: 1fr 1fr 1.7fr; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line);
}
.appr { padding-bottom: 72px; }
.appr-actions .btn { padding: 0 var(--s-3); }
.done { margin-top: var(--s-6); padding: var(--s-6) 0; border-top: 1px solid var(--line); }
.done-big { font: 700 var(--t-3xl)/1.05 var(--font-display); }
.done p:not(.done-big) { color: var(--ink-2); margin-top: var(--s-2); }
.done-actions { display: flex; gap: var(--s-2); margin-top: var(--s-5); flex-wrap: wrap; }

/* feed mocks */
.m { position: relative; max-width: 400px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; font-size: var(--t-sm); }
.m header { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); }
.m header span { display: flex; flex-direction: column; line-height: 1.25; flex: 1; min-width: 0; }
.m header b { font-weight: 600; }
.m header small { color: var(--ink-3); font-size: 12px; }
.m header .ic { color: var(--ink-2); }
.av { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.m-media { position: relative; background: var(--ink); overflow: hidden; }
.m-media img, .m-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.m-media .burn { top: 10%; font-size: clamp(22px, 8cqw, 34px); }
.m-play { position: absolute; right: var(--s-3); bottom: var(--s-3); width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .92); color: var(--ink); }
.m-play .ic { width: 22px; height: 22px; }
.m-bar { display: flex; align-items: center; gap: var(--s-4); padding: var(--s-2) var(--s-3); }
.m-bar .ic { width: 24px; height: 24px; }
.m-bar .sp { flex: 1; }
.m-cap { padding: 0 var(--s-3) var(--s-3); white-space: pre-line; overflow-wrap: anywhere; }
.m-fb .m-cap { padding-top: 0; }
.tagx { color: #2b4f8a; }
.fb-bar { justify-content: space-around; border-top: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.fb-bar span { display: inline-flex; align-items: center; gap: 6px; }
.fb-bar .ic { width: 20px; height: 20px; }
.m-tt { background: #000; border: 0; color: #fff; max-width: 340px; }
.m-tt .m-media { border-radius: 0; }
.m-tt .m-media::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); pointer-events: none; }
.m-tt .m-play { right: auto; left: 50%; bottom: auto; top: 50%; translate: -50% -50%; }
.tt-rail { position: absolute; right: 10px; bottom: 96px; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tt-rail .av { border: 2px solid #fff; }
.tt-rail .ic { width: 30px; height: 30px; stroke-width: 1.6; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
.tt-cap { position: absolute; left: 12px; right: 64px; bottom: 14px; z-index: 2; }
.tt-cap p { margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
.m-tt .tagx { color: #fff; font-weight: 600; }
.m-off { max-width: 400px; margin: 0 auto var(--s-2); font-size: var(--t-sm); color: var(--ink-2); background: var(--surface); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); }
.m-ig .m-cap { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; padding-top: 0; }

/* ---------- Queue ---------- */
.bank { background: var(--surface); border-radius: var(--r-lg); padding: var(--s-5) var(--s-4) var(--s-4); }
.bank-n { display: flex; align-items: baseline; gap: var(--s-2); }
.bank-n b { font: 700 88px/.85 var(--font-display); font-variant-numeric: tabular-nums; }
.bank-n span { font: 700 var(--t-2xl)/1 var(--font-display); }
.bank-sub { margin-top: var(--s-3); color: var(--ink-2); }
.bank-sub a { color: var(--gold-ink); font-weight: 600; text-underline-offset: 3px; }
.switch {
  display: flex; align-items: center; gap: var(--s-4); width: 100%; margin-top: var(--s-4); padding: var(--s-3) var(--s-4);
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-md); text-align: left; min-height: 64px; transition: border-color .15s;
}
.switch:hover { border-color: var(--ink-3); }
.sw-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.sw-txt b { font-weight: 600; }
.sw-txt span { color: var(--ink-2); font-size: var(--t-sm); }
.sw { position: relative; width: 52px; height: 32px; border-radius: 16px; background: var(--line-2); flex: none; transition: background-color .18s; }
.sw span { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
.switch[aria-checked="true"] .sw { background: var(--ink); }
.switch[aria-checked="true"] .sw span { transform: translateX(20px); background: var(--gold); }
.switch[aria-checked="true"] { border-color: var(--ink); }

.week { margin-top: var(--s-8); }
.week-nav { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); }
.week-nav h2 { flex: 1; text-align: center; font-size: var(--t-xl); }
.week-nav h2 .muted { font-family: var(--font-body); font-weight: 500; font-size: var(--t-sm); display: block; margin-top: 2px; }
.days { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.day { display: grid; grid-template-columns: 52px 1fr; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.day-h { display: flex; flex-direction: column; line-height: 1.1; padding-top: 2px; }
.day-h b { font: 700 var(--t-lg)/1 var(--font-display); }
.day-h span { font: 700 var(--t-2xl)/1.1 var(--font-display); color: var(--ink-3); }
.day.is-today .day-h b { color: var(--gold-ink); }
.day.is-today .day-h span { color: var(--ink); }
.day-none { color: var(--ink-3); font-size: var(--t-sm); align-self: center; }
.day.is-free { padding: var(--s-2) 0; }
.day.is-free .day-h { flex-direction: row; gap: 6px; align-items: baseline; }
.day.is-free .day-h span { font-size: var(--t-lg); }
.ents { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ent-btn { display: flex; gap: var(--s-3); align-items: center; width: 100%; padding: var(--s-2); border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; text-align: left; transition: border-color .15s; }
.ent-btn:hover { border-color: var(--ink-3); }
.ent-thumb { width: 40px; height: 71px; border-radius: var(--r-xs); object-fit: cover; flex: none; background: var(--surface); }
.ent-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 1px; }
.ent-time { font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ent-dish { font: 700 var(--t-lg)/1.1 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-st { display: flex; align-items: center; gap: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.ent-st .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.ent-st.is-posted { color: var(--ink); font-weight: 600; }
.ent-st.is-wait { color: var(--gold-ink); font-weight: 600; }
.ent-body .marks { margin-top: 3px; }
.ent-posted .ent-btn { background: var(--surface); border-color: transparent; }
.ent-ready .ent-btn { border-style: dashed; border-color: var(--line-2); }
.ent-open { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-2) var(--s-3); border: 1px dashed var(--line-2); border-radius: var(--r-md); min-height: 56px; }
.ent-open .ent-time { width: 52px; flex: none; }
.ent-open .ent-dish { font-family: var(--font-body); font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); }
.ent-open.is-past { border-style: solid; border-color: var(--line); }
.day.is-past:not(.is-today) .ent-btn { opacity: .92; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: var(--s-4); right: var(--s-4); bottom: calc(var(--tabbar) + var(--s-3) + env(safe-area-inset-bottom)); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); max-width: 480px; margin: 0 auto;
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4); min-height: 52px; border-radius: var(--r-md); background: var(--ink); color: #fff; box-shadow: var(--shadow-float);
  transform: translateY(8px); opacity: 0; transition: transform .2s var(--ease), opacity .2s;
}
.toast.show { transform: none; opacity: 1; }
.toast .link { color: var(--gold); font-weight: 600; }

/* ---------- 320 px ---------- */
@media (max-width: 359px) {
  main { padding-left: var(--s-3); padding-right: var(--s-3); }
  .drop h1 { font-size: 46px; }
  .upload { gap: var(--s-3); padding: var(--s-4); }
  .upload-ic { width: 52px; height: 52px; }
  .seg button { gap: 4px; }
  .seg button .ic { display: none; }
  .covers { gap: 4px; }
  .actionbar { margin-left: calc(var(--s-3) * -1); margin-right: calc(var(--s-3) * -1); padding-left: var(--s-3); padding-right: var(--s-3); }
  .appr-actions { padding-left: var(--s-3); padding-right: var(--s-3); }
  .bank-n b { font-size: 72px; }
}

/* ---------- tablet and desktop: side rail ---------- */
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
  .top {
    position: sticky; top: 0; height: 100vh; flex-direction: column; align-items: stretch; justify-content: flex-start;
    border-bottom: 0; border-right: 1px solid var(--line); padding: var(--s-6) var(--s-4); gap: var(--s-2);
  }
  .brand span { font-size: var(--t-xl); }
  .demo { align-self: flex-start; margin: 0 0 var(--s-6) 40px; }
  .tabs { position: static; display: flex; flex-direction: column; box-shadow: none; padding: 0; gap: 2px; background: none; }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-3); border-radius: var(--r-md); font-size: var(--t-md); }
  .tabs a:hover { background: var(--surface); }
  .tabs a[aria-current="page"] { background: var(--surface); }
  .tabs a[aria-current="page"]::after { display: none; }
  .tabs .badge { position: static; margin-left: auto; }
  main { max-width: 1040px; margin: 0; padding: var(--s-10) var(--s-10) var(--s-12); width: 100%; }
  .drop, .waiting, .foot { max-width: 640px; }
  .toast { bottom: var(--s-6); left: calc(240px + var(--s-6)); right: auto; }
  .actionbar { bottom: 0; margin: var(--s-8) 0 0; padding: var(--s-4) 0; justify-content: flex-end; }
  .actionbar .btn, .actionbar .btn-main { flex: none; min-width: 160px; }
  .clip-grid { grid-template-columns: 320px 1fr; gap: var(--s-10); align-items: start; }
  .stage-col { position: sticky; top: var(--s-10); }
  .stage { width: 100%; }
  .preps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .appr { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 340px); gap: var(--s-10); align-items: start; }
  .appr-side { position: sticky; top: var(--s-10); margin-top: 60px; }
  .appr-actions { position: static; margin: var(--s-6) 0 0; padding: 0; border: 0; background: none; }
  .appr { padding-bottom: 0; }
  .appr-when-sm { display: none; }
  .bank { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--s-8); align-items: end; padding: var(--s-6); }
  .bank-sub { margin: 0 0 6px; }
  .switch { grid-column: 1 / -1; max-width: 560px; }
  .days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-2); border: 0; }
  .day, .day.is-free { display: flex; flex-direction: column; gap: var(--s-2); padding: 0; border-bottom: 0; min-height: 260px; }
  .day-h { padding: var(--s-2) var(--s-2) var(--s-2); border-radius: var(--r-sm); }
  .day.is-today .day-h { background: var(--gold-soft); }
  .day.is-free .day-h { flex-direction: column; gap: 0; }
  .day.is-free .day-h span { font-size: var(--t-2xl); }
  .day-none { align-self: auto; }
  .ent-btn { flex-direction: column; align-items: stretch; padding: 6px; }
  .ent-thumb { width: 100%; height: auto; aspect-ratio: 9 / 16; border-radius: var(--r-sm); }
  .ent-body { padding: 0 2px 2px; }
  .ent-dish { white-space: normal; }
  .ent-open { flex-direction: column; align-items: flex-start; min-height: 140px; justify-content: center; gap: var(--s-1); }
  .ent-open .ent-body { gap: 4px; }
}
@media (min-width: 1280px) {
  main { padding-left: var(--s-12); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .spin { animation: spin 1.6s linear infinite !important; animation-iteration-count: infinite !important; animation-duration: 1.6s !important; }
}

body:has(.appr-actions) .toast { bottom: calc(var(--tabbar) + 72px + var(--s-2) + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body:has(.appr-actions) .toast { bottom: var(--s-6); } }
@media (min-width: 900px) {
  .ent-st { display: block; }
  .ent-st .ic { display: inline-block; vertical-align: -3px; margin-right: 3px; }
}
