/* ---------- tokens: graphite neutrals, one blue accent, hairline borders, flat surfaces ---------- */
:root {
  --bg: #f7f8fa; --bg-2: #ffffff; --bg-3: #eef0f4;
  --ink: #0f1217; --ink-2: #4b5563; --ink-3: #8a93a3;
  --line: #e3e6eb; --line-2: #d2d7df;
  --accent: #2563eb; --accent-2: #1d4ed8; --accent-soft: #e8efff; --accent-ink: #ffffff;
  --ok: #15803d; --bad: #dc2626;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(15,18,23,.05);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs: clamp(16px, .9vw + 12px, 18px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116; --bg-2: #151920; --bg-3: #1b2029;
    --ink: #e8ebf0; --ink-2: #a3acba; --ink-3: #6b7484;
    --line: #232935; --line-2: #2e3645;
    --accent: #5b9cff; --accent-2: #7cb0ff; --accent-soft: #15213a; --accent-ink: #0b1220;
    --ok: #34d399; --bad: #f87171;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.5 var(--sans); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; }
body { margin: 0; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
.display { font-family: var(--display); font-weight: 650; letter-spacing: -.022em; line-height: 1.1; }
h1.display { font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.6rem); margin: 0 0 .45em; }
h2 { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 .8rem; font-weight: 600; }
.muted { color: var(--ink-2); } .small { font-size: .85rem; } .break { overflow-wrap: anywhere; }
.right { text-align: right; } .inline { display: inline; }
code { font-family: var(--mono); font-size: .86em; background: var(--bg-3); border: 1px solid var(--line); padding: .08em .4em; border-radius: 5px; }

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 1.2rem clamp(16px, 3vw, 32px) 4rem; }
.wrap.narrow { max-width: 720px; }
.center-page { display: grid; place-items: center; min-height: 80dvh; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem clamp(16px, 3vw, 32px); padding-top: calc(.7rem + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 650; letter-spacing: -.02em; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .5rem; }
.brand .mark { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); font-size: 0; display: inline-block; }
header nav { display: flex; gap: 1.1rem; align-items: center; color: var(--ink-2); font-size: .93rem; }
header nav a:hover { color: var(--ink); }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4em; padding: .55em 1em; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--bg-2); cursor: pointer; font-weight: 500; font-size: .95rem; line-height: 1.1; min-height: 42px; transition: background .12s, border-color .12s, transform .08s; -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--ink-3); } .btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; } .btn.primary:hover { background: var(--accent-2); }
.btn.small { min-height: 34px; padding: .4em .8em; font-size: .88rem; }
.btn.ghost { background: transparent; border-color: var(--line); } .btn.ghost:hover { background: var(--bg-3); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .6; cursor: default; }
input[type=text], input[type=search], input[type=url], input[type=password], input[type=number], input:not([type]), select, textarea { width: 100%; padding: .65em .85em; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); min-height: 42px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { line-height: 1.45; resize: vertical; } .mono { font-family: var(--mono); font-size: .88rem; }
.form label { display: block; margin: 0 0 .9rem; font-weight: 500; font-size: .95rem; }
.form label input, .form label select, .form label textarea { margin-top: .3rem; font-weight: 400; }
.form .row3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 .9rem; } .form legend { font-weight: 500; margin-bottom: .3rem; font-size: .95rem; }
.radio { display: inline-flex; align-items: center; gap: .4em; margin-right: .8em; font-weight: 400 !important; }
.radio input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .5rem 0; }
.row.between { justify-content: space-between; } .row.between h1 { margin: 0; }
.row input:not([type=hidden]) { flex: 1 1 160px; width: auto; }
.card { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1rem, 2.5vw, 1.5rem); box-shadow: var(--shadow); margin-bottom: 1rem; }
.error { color: var(--bad); white-space: pre-wrap; }
.notice { background: var(--accent-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: .65em 1em; border-radius: var(--radius-sm); }
.hint { color: var(--ink-3); font-size: .9rem; } .hint a { text-decoration: underline; }
.pill { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; padding: .25em .65em; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-2); }
.pill.done { color: var(--ok); } .pill.failed { color: var(--bad); } .pill.running, .pill.queued { color: var(--accent); }
.steps-list { padding-left: 1.3rem; margin: .5rem 0 1rem; } .steps-list li { margin: .45rem 0; } .steps-list ul { padding-left: 1.1rem; margin: .3rem 0; } .steps-list ul li { margin: .25rem 0; }

/* ---------- dashboard ---------- */
.search input { font-size: 1.05rem; padding: .8em 1.1em; border-radius: var(--radius); }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding: .9rem 0 .3rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * clamp(16px, 3vw, 32px)); padding-inline: clamp(16px, 3vw, 32px); }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: .4em .85em; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: .88rem; white-space: nowrap; color: var(--ink-2); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); font-weight: 500; }
.chip.clear { color: var(--ink-3); border-style: dashed; }
.chip .n { color: var(--ink-3); font-size: .8em; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 1rem; margin-top: 1.2rem; }
.recipe-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.recipe-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.recipe-card .thumb { aspect-ratio: 4/3; background: var(--bg-3); position: relative; }
.recipe-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-card .badge { position: absolute; right: .55rem; bottom: .55rem; background: rgba(10,12,16,.6); color: #fff; font-size: .62rem; padding: .3em .55em; border-radius: 4px; backdrop-filter: blur(6px); }
.recipe-card h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.012em; font-size: 1.02rem; line-height: 1.25; margin: .8rem .9rem .2rem; }
.recipe-card .meta { margin: 0 .9rem .85rem; color: var(--ink-3); font-size: .8rem; display: flex; gap: .55em; flex-wrap: wrap; }
.recipe-card .meta span + span::before { content: "·"; margin-right: .55em; }
.empty { text-align: center; padding: 4rem 1rem; color: var(--ink-2); } .empty .btn { margin-top: 1rem; }

/* ---------- recipe page ---------- */
main.recipe { max-width: 1100px; margin: 0 auto; padding: 0 0 5rem; }
.hero { margin: 0; aspect-ratio: 16/9; max-height: 52dvh; overflow: hidden; background: var(--bg-3); }
.hero img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .hero { border-radius: var(--radius); margin: 1rem clamp(16px, 3vw, 32px) 0; aspect-ratio: 21/9; } }
.recipe-head { padding: 1.4rem clamp(16px, 3vw, 32px) .5rem; }
.summary { font-size: 1.08rem; color: var(--ink-2); max-width: 65ch; margin: 0 0 1rem; }
.facts { list-style: none; padding: 0; margin: 0 0 .8rem; display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; font-size: .98rem; color: var(--ink-2); }
.facts b { color: var(--ink); font-size: 1.12em; font-weight: 600; } .facts small { color: var(--ink-3); }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.tag { font-size: .76rem; padding: .28em .65em; border-radius: 5px; background: var(--bg-3); border: 1px solid var(--line); color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; }
.qr-pop { margin-top: .9rem; display: inline-flex; gap: 1rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); max-width: 520px; }
.qr-pop img { width: 160px; height: 160px; padding: 8px; background: #fff; border-radius: 6px; color: #000; }
.qr-pop p { margin: 0; }
.columns { display: grid; gap: 2rem; padding: 1rem clamp(16px, 3vw, 32px); }
@media (min-width: 900px) { .columns { grid-template-columns: minmax(280px, 1fr) 2fr; gap: 3rem; } .ingredients { position: sticky; top: 4.6rem; align-self: start; max-height: calc(100dvh - 5.6rem); overflow: auto; scrollbar-width: none; } .ingredients::-webkit-scrollbar { display: none; } }
.columns h2 { margin-top: .5rem; }
.ingredients h3 { font-family: var(--display); font-size: .98rem; font-weight: 600; margin: 1.1rem 0 .2rem; color: var(--ink-2); }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { border-bottom: 1px solid var(--line); }
.checklist label { display: flex; gap: .8rem; align-items: flex-start; padding: .62rem 0; cursor: pointer; font-size: 1.08rem; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
.checklist input { position: absolute; opacity: 0; width: 0; height: 0; }
.checklist .box { flex: 0 0 24px; height: 24px; border: 1.5px solid var(--line-2); border-radius: 6px; margin-top: .18em; position: relative; transition: background .12s, border-color .12s; background: var(--bg-2); }
.checklist input:checked + .box { background: var(--accent); border-color: var(--accent); }
.checklist input:checked + .box::after { content: ""; position: absolute; left: 7.5px; top: 3px; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.checklist input:checked ~ .txt { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--ink-3); }
.checklist b { font-weight: 600; } .checklist .note { color: var(--ink-2); } .opt { color: var(--ink-3); font-size: .85em; font-style: normal; }
.equipment { color: var(--ink-2); margin-top: 1rem; font-size: .95rem; }
.steps { list-style: none; padding: 0; margin: 0; }
.steps .step { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.steps .step p { margin: 0; font-size: 1.18rem; line-height: 1.5; }
.steps .num { flex: 0 0 2rem; height: 2rem; border-radius: 6px; background: var(--bg-3); border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--mono); font-weight: 600; font-size: .9rem; margin-top: .15rem; color: var(--ink-2); }
.steps .step.done { opacity: .45; } .steps .step.done .num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.steps .heading { font-family: var(--display); font-size: 1.05rem; font-weight: 600; color: var(--ink-2); padding: 1.4rem 0 .2rem; }
.tips, .notes { margin-top: 2rem; }
.tips ul { padding-left: 1.2rem; margin: 0; } .tips li { margin: .4rem 0; color: var(--ink-2); font-size: 1rem; }
.video { margin: 1.5rem clamp(16px, 3vw, 32px) 0; }
.video video { width: 100%; max-height: 70dvh; border-radius: var(--radius); background: #000; border: 1px solid var(--line); }
.pairings { padding: 1.5rem clamp(16px, 3vw, 32px) 0; }
.pair-row { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .4rem; }
.pair { flex: 0 0 240px; display: flex; gap: .7rem; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: .5rem; }
.pair img { width: 60px; height: 60px; object-fit: cover; border-radius: 6px; } .pair span { display: flex; flex-direction: column; font-size: .9rem; line-height: 1.25; } .pair small { color: var(--ink-3); }
footer.source { padding: 2rem clamp(16px, 3vw, 32px); color: var(--ink-3); font-size: .88rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin: 1.5rem clamp(16px, 3vw, 32px) 0; padding-inline: 0; }
footer.source a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- jobs ---------- */
.job .status { font-size: 1.1rem; margin: .2rem 0 1rem; }
.progress { height: 4px; border-radius: 2px; background: var(--bg-3); overflow: hidden; margin-bottom: 1rem; }
.progress .bar { height: 100%; width: 40%; background: var(--accent); border-radius: 2px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.joblist { list-style: none; padding: 0; margin: 0; }
.token code { display: inline-block; padding: .5em .8em; margin: .3rem 0; }
.toast { position: fixed; left: 50%; bottom: calc(1.5rem + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: .65em 1.1em; border-radius: var(--radius-sm); font-size: .92rem; z-index: 10; }

/* ---------- small screens ---------- */
.btn .short { display: none; }
@media (max-width: 520px) {
  header.top { gap: .6rem; padding-left: 14px; padding-right: 14px; }
  .brand { white-space: nowrap; }
  header nav { gap: .7rem; font-size: .9rem; }
  header nav .btn { white-space: nowrap; padding: .45em .8em; }
  .btn .full { display: none; } .btn .short { display: inline; }
  .actions .btn { flex: 1 1 auto; }
  .qr-pop { flex-direction: column; align-items: flex-start; }
}
.live-empty { padding: 2.5rem 1rem; }
[hidden] { display: none !important; }

.source-images { padding: 1.5rem clamp(16px, 3vw, 32px) 0; }
.scan-row { display: flex; gap: .7rem; overflow-x: auto; padding-bottom: .4rem; }
.scan-row img { height: 220px; width: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-3); }
input[type=file] { padding: .55em .7em; border: 1px dashed var(--line-2); border-radius: var(--radius-sm); background: var(--bg-2); width: 100%; min-height: 42px; }

/* ---------- color system: six hues, tinted chips ---------- */
:root { --c0: #2563eb; --c1: #0d9488; --c2: #b45309; --c3: #be123c; --c4: #6d28d9; --c5: #4d7c0f; }
@media (prefers-color-scheme: dark) { :root { --c0: #6aa6ff; --c1: #34d1bd; --c2: #fbbf24; --c3: #fb7185; --c4: #b69cff; --c5: #a3e635; } }
.c0 { --pc: var(--c0); } .c1 { --pc: var(--c1); } .c2 { --pc: var(--c2); } .c3 { --pc: var(--c3); } .c4 { --pc: var(--c4); } .c5 { --pc: var(--c5); }
.chip-h { display: inline-flex; align-items: center; gap: .5em; padding: .38em .85em .38em .7em; border-radius: 999px; background: color-mix(in srgb, var(--pc) 15%, transparent); border: 1px solid color-mix(in srgb, var(--pc) 38%, transparent); color: var(--pc); font: 600 .84rem/1 var(--sans); letter-spacing: .01em; margin: 0; }
.chip-h::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: var(--pc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 25%, transparent); }
.ingredients h3.chip-h { margin: 1.2rem 0 .45rem; font-family: var(--sans); font-size: .84rem; }
.steps .heading { padding: 1.6rem 0 .5rem; }
.steps .step .num { background: color-mix(in srgb, var(--pc, var(--ink-3)) 14%, transparent); border-color: color-mix(in srgb, var(--pc, var(--ink-3)) 35%, transparent); color: var(--pc, var(--ink-2)); }
.steps .step.done .num { background: var(--pc, var(--accent)); border-color: var(--pc, var(--accent)); color: var(--bg); }
.checklist input:checked + .box { background: var(--accent); border-color: var(--accent); }
.rule { height: 3px; width: 72px; border-radius: 2px; margin: .2rem 0 1rem; background: linear-gradient(90deg, var(--c0), var(--c1) 35%, var(--c2) 70%, var(--c3)); }
.tag.t-meal { color: var(--c0); background: color-mix(in srgb, var(--c0) 13%, transparent); border-color: color-mix(in srgb, var(--c0) 30%, transparent); }
.tag.t-dish { color: var(--c4); background: color-mix(in srgb, var(--c4) 13%, transparent); border-color: color-mix(in srgb, var(--c4) 30%, transparent); }
.tag.t-protein { color: var(--c3); background: color-mix(in srgb, var(--c3) 13%, transparent); border-color: color-mix(in srgb, var(--c3) 30%, transparent); }
.tag.t-diet { color: var(--c5); background: color-mix(in srgb, var(--c5) 13%, transparent); border-color: color-mix(in srgb, var(--c5) 30%, transparent); }
.tag { font-weight: 500; }
.facts b { color: var(--accent); }
.group-title .dot { width: 10px; height: 10px; border-radius: 3px; background: var(--ink-3); display: inline-block; margin-right: .2rem; align-self: center; }
.g-breakfast .dot { background: var(--c2); } .g-lunch .dot { background: var(--c5); } .g-dinner .dot { background: var(--c0); } .g-dessert .dot { background: var(--c3); } .g-other .dot { background: var(--c4); }
.recipe-card h3 { letter-spacing: -.01em; }

/* ---------- amounts in steps ---------- */
.method-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 0 0 .2rem; position: sticky; top: calc(3.45rem + env(safe-area-inset-top)); z-index: 4; padding: .55rem 0 .5rem; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; }
.method-head.stuck { border-bottom-color: var(--line); }
.method-head h2 { margin: 0; }
.steps .step .plain { display: none; }
body.amounts-off .steps .step .plain { display: inline; }
body.amounts-off .steps .step .rich { display: none; }
.amt { color: var(--ink-2); font-weight: 600; font-size: .92em; font-variant-numeric: tabular-nums; background: color-mix(in srgb, var(--pc, var(--accent)) 10%, transparent); border-radius: 4px; padding: 0 .3em; }
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .85rem; color: var(--ink-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: 0 0 auto; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- stars ---------- */
.btn.star .ico { color: var(--ink-3); font-size: 1.05em; line-height: 1; transition: color .15s, transform .15s; }
.btn.star.on { border-color: color-mix(in srgb, var(--c2) 50%, transparent); background: color-mix(in srgb, var(--c2) 12%, transparent); color: var(--c2); }
.btn.star.on .ico { color: var(--c2); transform: scale(1.15); }
.card-wrap { position: relative; }
.card-wrap .recipe-card { height: 100%; }
.card-star { position: absolute; top: .55rem; right: .55rem; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.15rem; line-height: 1; display: grid; place-items: center; color: rgba(255,255,255,.55); background: rgba(10,12,16,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .15s, color .15s, transform .15s; }
.card-wrap:hover .card-star, .card-star.on, .card-star:focus-visible { opacity: 1; }
.card-star:hover { color: #fff; transform: scale(1.08); }
.card-star.on { color: var(--c2); background: rgba(10,12,16,.6); text-shadow: 0 0 10px color-mix(in srgb, var(--c2) 60%, transparent); }
@media (hover: none) { .card-star { opacity: 1; } }
span.card-star { pointer-events: none; }
.g-starred .dot { background: var(--c2); }
.chip.on[href*="starred"] { color: var(--c2); background: color-mix(in srgb, var(--c2) 14%, transparent); border-color: color-mix(in srgb, var(--c2) 45%, transparent); }
/* a touch bolder chips */
.chip-h { font-size: .9rem; padding: .42em .95em .42em .75em; }
.ingredients h3.chip-h { font-size: .9rem; }

/* ---------- banner button + media dialog ---------- */
.hero-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--bg-3); cursor: pointer; position: relative; text-align: left; -webkit-tap-highlight-color: transparent; }
.hero-btn img { width: 100%; height: 100%; object-fit: cover; }
.media-pill { position: absolute; right: .9rem; bottom: .9rem; display: inline-flex; align-items: center; gap: .4em; padding: .45em .85em; border-radius: 999px; background: rgba(10,12,16,.62); color: #fff; font-size: .85rem; font-weight: 500; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); pointer-events: none; transition: background .15s; }
.hero-btn:hover .media-pill, .video-tile:hover .media-pill { background: var(--accent); }
.media-dialog { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 96dvh; overflow: visible; }
.media-dialog::backdrop { background: rgba(5,7,10,.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.media-dialog video, .media-dialog img { display: block; max-width: 96vw; max-height: 92dvh; border-radius: var(--radius); background: #000; }
.media-dialog img { object-fit: contain; }
.media-stage { display: flex; align-items: center; gap: .9rem; }
.media-stage video { max-width: min(96vw - 2 * (56px + .9rem), 1100px); }
.skip { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; display: grid; place-items: center; line-height: 1; padding: 0; transition: background .12s, transform .08s; }
.skip:hover { background: rgba(255,255,255,.28); } .skip:active { transform: scale(.94); }
.skip .arr { font-size: 1.35rem; margin-bottom: -.15rem; } .skip .n { font-size: .68rem; font-weight: 600; letter-spacing: .02em; }
@media (max-width: 640px) {
  .media-stage { flex-direction: column; gap: .6rem; }
  .media-stage video { max-width: 96vw; max-height: 72dvh; order: 0; }
  .skip { order: 1; } .skip + video + .skip { order: 1; }
  .media-stage { flex-wrap: wrap; justify-content: center; }
  .media-stage video { flex-basis: 100%; }
}
.dialog-close { position: fixed; top: calc(.8rem + env(safe-area-inset-top)); right: .9rem; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; z-index: 2; }
.dialog-close:hover { background: rgba(255,255,255,.28); }
.video-tile { position: relative; display: block; width: 100%; max-width: 420px; aspect-ratio: 4/3; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-3); cursor: pointer; }
.video-tile img { width: 100%; height: 100%; object-fit: cover; }
.video-tile .media-pill { right: auto; bottom: auto; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 1rem; padding: .6em 1.1em; }

.group { margin-top: 1.6rem; }
.group-title { font-family: var(--display); font-size: 1.15rem; font-weight: 650; letter-spacing: -.015em; text-transform: none; color: var(--ink); margin: 0 0 .2rem; display: flex; align-items: baseline; gap: .5rem; }
.group-title .n { color: var(--ink-3); font-size: .85rem; font-weight: 500; }
.group .grid { margin-top: .6rem; }
