:root {
  --bg-n: #F6F5F2; --surface-n: #FFFFFF; --raised-n: #F0EEE9; --line-n: #E4E1DA;
  --ink: #141416; --dim: #6B6A66; --faint: #9C9A94;
  --accent: #FF5A36; --accent-ink: #FFFFFF;
  --good: #1F9D62; --warn: #C98410; --bad: #D9434F;
  --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, monospace;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg-n: #0C0C0E; --surface-n: #141417; --raised-n: #1B1B1F; --line-n: #26262B;
    --ink: #F3F2EF; --dim: #A09E99; --faint: #6E6C68;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg-n: #0C0C0E; --surface-n: #141417; --raised-n: #1B1B1F; --line-n: #26262B;
  --ink: #F3F2EF; --dim: #A09E99; --faint: #6E6C68;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}

/* Mastcall's own skin is the "native" one. When the screen is about one product, the app takes on
   that product's accent, display font and a faint tint of its colour, then lets go when you leave. */
:root {
  --bg: var(--bg-n); --surface: var(--surface-n); --raised: var(--raised-n); --line: var(--line-n);
  --display: var(--font);
}
html[data-product] {
  --accent: var(--p-accent); --accent-ink: var(--p-on);
  --bg: color-mix(in srgb, var(--bg-n) 93%, var(--p-accent));
  --surface: color-mix(in srgb, var(--surface-n) 96%, var(--p-accent));
  --raised: color-mix(in srgb, var(--raised-n) 90%, var(--p-accent));
  --line: color-mix(in srgb, var(--line-n) 82%, var(--p-accent));
  --display: var(--p-font), var(--font);
}
body, .side, .card, .item, .day, .lane, .pcard, .stat, .chip, .btn, #sheet .panel, .tabbar {
  transition: background-color .45s ease, border-color .45s ease, color .3s ease;
}
h1, #sheet .ph h2 { font-family: var(--display); }
html[data-serif] h1 { font-weight: 400; font-size: 32px; letter-spacing: -0.01em; }
.station-band { height: 3px; background: var(--accent); position: fixed; top: 0; left: 0; right: 0; z-index: 30; transform-origin: left; transition: background-color .45s ease; }
html:not([data-product]) .station-band { display: none; }
.brand .now { font: 500 11px var(--mono); color: var(--accent); margin-left: auto; letter-spacing: .02em; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Mast call */
.poll { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.station { display: flex; align-items: center; gap: 9px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; min-width: 0; }
.station:hover { border-color: var(--faint); }
.station .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.station .n { font-weight: 560; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call { font: 600 11px var(--mono); letter-spacing: .06em; padding: 2px 7px; border-radius: 6px; flex: none; }
.call.go { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.call.standby { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.call.hold { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.pollhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pollhead .verdict { font: 600 12px var(--mono); letter-spacing: .06em; }
.qr { background: #fff; padding: 14px; border-radius: 14px; width: 220px; height: 220px; display: grid; place-items: center; margin: 0 auto; }
.qr svg, .qr img { width: 100%; height: 100%; }
.paircode { font: 600 26px var(--mono); letter-spacing: .18em; text-align: center; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; overscroll-behavior-y: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 17px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); }
.mono { font-family: var(--mono); font-size: 12px; }
.dim { color: var(--dim); } .faint { color: var(--faint); }
.boot { display: grid; place-items: center; height: 100dvh; font-weight: 700; font-size: 22px; letter-spacing: -0.03em; color: var(--faint); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100dvh; padding: 18px 12px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 750; font-size: 18px; letter-spacing: -0.03em; }
.brand i { width: 22px; height: 22px; border-radius: 7px; background: var(--accent); display: inline-block; position: relative; }
.brand i::after { content: ''; position: absolute; inset: 6px 5px 6px 9px; border-radius: 2px; background: var(--bg); }
.nav { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; color: var(--dim); font-weight: 500; }
.nav:hover { background: var(--raised); color: var(--ink); }
.nav.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.nav .count { margin-left: auto; font: 500 11px var(--mono); background: var(--accent); color: var(--accent-ink); border-radius: 20px; padding: 1px 7px; }
.nav svg { width: 18px; height: 18px; flex: none; }
.side .grow { flex: 1; }
.main { padding: 28px 32px 60px; max-width: 1240px; width: 100%; min-width: 0; }
.tabbar { display: none; }

@media (max-width: 820px) {
  .shell { display: block; }
  .side { display: none; }
  .main { padding: 18px 16px calc(var(--tabbar) + 28px + env(safe-area-inset-bottom)); }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--faint); font-size: 11px; font-weight: 500; position: relative; }
  .tabbar a.on { color: var(--ink); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .dot { position: absolute; top: 9px; left: calc(50% + 7px); width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
  h1 { font-size: 24px; }
}

/* ---------- building blocks ---------- */
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.head .sub { color: var(--dim); font-size: 14px; width: 100%; margin-top: -8px; }
.head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 8px 13px; font-weight: 550; font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.accent { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--dim); }
.btn.ghost:hover { color: var(--ink); background: var(--raised); }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: progress; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.section { margin-top: 26px; }
.section > h3 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.empty { color: var(--faint); padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 2px 9px; border-radius: 20px; background: var(--raised); color: var(--dim); white-space: nowrap; }
.pill .sw { width: 8px; height: 8px; border-radius: 3px; }
.status { font: 500 11px var(--mono); padding: 2px 7px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; background: var(--raised); color: var(--dim); }
.status.ready, .status.scheduled { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.status.posted { background: transparent; color: var(--faint); text-decoration: line-through; }
.status.draft { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.status.late { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin-bottom: 14px; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 5px 11px; font-size: 13px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .sw { width: 8px; height: 8px; border-radius: 3px; }

/* list items */
.item { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-decoration: none; min-width: 0; }
.item:hover { border-color: var(--faint); }
.item .bar { width: 4px; align-self: stretch; border-radius: 4px; flex: none; }
.item .body { flex: 1; min-width: 0; }
.item .t { font-weight: 560; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .m { color: var(--dim); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 3px; }
.item .when { font: 500 12px var(--mono); color: var(--dim); flex: none; text-align: right; min-width: 44px; }
.check { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--faint); flex: none; display: grid; place-items: center; background: transparent; cursor: pointer; padding: 0; margin-top: 1px; }
.check.on { background: var(--good); border-color: var(--good); color: #fff; }
.check svg { width: 14px; height: 14px; }
.done .t { text-decoration: line-through; color: var(--faint); }

/* brief */
.brief { background: var(--ink); color: var(--bg); border-radius: 18px; padding: 18px 20px; }
.brief .focus { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.brief pre { white-space: pre-wrap; font: 13px/1.55 var(--font); margin: 12px 0 0; opacity: .78; }
.brief .meta { font: 500 11px var(--mono); opacity: .55; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .06em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; }
.stat b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.stat span { color: var(--dim); font-size: 13px; }
.stat.hot b { color: var(--bad); }
@media (max-width: 560px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* calendar */
.calbar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.calbar .label { font-weight: 650; font-size: 16px; min-width: 150px; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; min-height: 180px; padding: 8px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day .dh { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--dim); padding: 0 2px 4px; }
.day .dh b { font-size: 18px; color: var(--ink); font-weight: 650; }
.day .add { opacity: 0; border: 0; background: none; color: var(--dim); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 4px; }
.day:hover .add { opacity: 1; }
.ev { border-radius: 8px; padding: 5px 7px; font-size: 12px; line-height: 1.3; cursor: pointer; background: var(--raised); border-left: 3px solid var(--c); text-decoration: none; display: block; overflow: hidden; }
.ev .k { font: 500 10px var(--mono); color: var(--dim); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .x { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev.task { background: transparent; border: 1px dashed var(--line); border-left: 3px solid var(--c); }
.ev.posted { opacity: .45; }
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.month .day { min-height: 96px; padding: 5px; gap: 3px; }
.month .ev { padding: 2px 5px; font-size: 11px; }
.month .ev .k { display: none; }
.month .ev .x { -webkit-line-clamp: 1; }
.month .day.out { opacity: .4; }
.month .dow { font: 500 11px var(--mono); color: var(--faint); text-align: center; padding: 4px 0; }
.agenda .dayhead { font-weight: 650; margin: 18px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.agenda .dayhead.today { color: var(--accent); }
@media (max-width: 820px) { .week, .month-wrap { display: none; } }
@media (min-width: 821px) { .agenda { display: none; } }

/* board */
.board { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: var(--raised); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.lane > h3 { padding: 2px 4px 4px; display: flex; justify-content: space-between; }
.lane .item { padding: 10px 12px; }
@media (max-width: 820px) { .board { grid-template-columns: repeat(5, 82vw); scroll-snap-type: x mandatory; } .lane { scroll-snap-align: start; } }

/* products */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; text-decoration: none; display: flex; flex-direction: column; gap: 8px; position: relative; overflow: hidden; }
.pcard:hover { border-color: var(--faint); }
.logo { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 16px; flex: none; }
.pcard .pitch { color: var(--dim); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .nums { display: flex; gap: 14px; font-size: 12px; color: var(--dim); margin-top: auto; }
.pcard .nums b { color: var(--ink); font-weight: 650; }
.pcard .synced { font-size: 11px; color: var(--faint); }
.card.where { display: flex; flex-direction: column; gap: 6px; }
.subs { display: flex; flex-wrap: wrap; gap: 6px; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; color: var(--dim); }
input.i, select.i, textarea.i { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 11px; font-size: 15px; color: var(--ink); width: 100%; min-width: 0; }
textarea.i { resize: vertical; min-height: 120px; line-height: 1.5; }
input.i:focus, select.i:focus, textarea.i:focus { outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: -1px; border-color: transparent; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fgrid .full { grid-column: 1 / -1; }
@media (max-width: 560px) { .fgrid { grid-template-columns: 1fr; } }
.counter { font: 500 11px var(--mono); color: var(--faint); text-align: right; }
.counter.over { color: var(--bad); }

/* sheet (modal on desktop, bottom sheet on phone) */
#sheet { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.42); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 16px; overflow-y: auto; }
#sheet .panel { background: var(--bg); border-radius: 20px; width: 100%; max-width: 920px; padding: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
#sheet .panel.narrow { max-width: 520px; }
#sheet .ph { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
#sheet .ph h2 { flex: 1; }
@media (max-width: 820px) {
  #sheet { padding: 0; align-items: flex-end; }
  #sheet .panel { border-radius: 20px 20px 0 0; max-height: 94dvh; overflow-y: auto; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
}
.editor { display: grid; grid-template-columns: 1fr 340px; gap: 20px; }
@media (max-width: 820px) { .editor { grid-template-columns: 1fr; } }
.studio canvas { width: 100%; height: auto; border-radius: 12px; display: block; background: var(--raised); }
.studio .opts { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }

/* feed */
.fitem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.fitem .av { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--raised); color: var(--dim); }
.fitem .av.agent { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.fitem .av.hook { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.fitem .av.alert { background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); }
.fitem pre { white-space: pre-wrap; font: 13px/1.5 var(--font); color: var(--dim); margin: 6px 0 0; }
.fitem.new .ft::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 7px; vertical-align: 2px; }
.fitem .ft { font-weight: 560; }
.fitem .fm { font-size: 12px; color: var(--faint); margin-top: 2px; }

/* login */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 26px; display: flex; flex-direction: column; gap: 14px; }

#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 18px + env(safe-area-inset-bottom)); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 550; z-index: 60; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
@media (min-width: 821px) { #toast { bottom: 24px; } }
.codebox { font: 12px/1.5 var(--mono); background: var(--raised); border-radius: 10px; padding: 10px 12px; word-break: break-all; user-select: all; }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: s .7s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

/* ---------- v3: ambient product layers ----------
   Off unless a screen is about one product. Low contrast by design; motion stops under prefers-reduced-motion. */
.shell { position: relative; z-index: 1; }
.ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity .6s ease; overflow: hidden; }
.ambient b { display: none; }
html[data-ambient] .ambient { opacity: 1; }
html[data-ambient] .side { background: color-mix(in srgb, var(--bg) 82%, transparent); }

/* Lagna: faint drifting stars */
html[data-ambient=stars] { --star: color-mix(in srgb, var(--ink) 30%, transparent); }
html[data-ambient=stars] .ambient::before, html[data-ambient=stars] .ambient::after {
  content: ''; position: absolute; inset: -40%;
  background-image: radial-gradient(1.2px 1.2px at 12% 18%, var(--star) 50%, transparent 52%), radial-gradient(1px 1px at 63% 42%, var(--star) 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 38% 77%, var(--star) 50%, transparent 52%), radial-gradient(1px 1px at 86% 12%, var(--star) 50%, transparent 52%),
    radial-gradient(.8px .8px at 24% 56%, var(--star) 50%, transparent 52%), radial-gradient(1.1px 1.1px at 74% 88%, var(--star) 50%, transparent 52%);
  background-size: 360px 360px; animation: drift 160s linear infinite; opacity: .7;
}
html[data-ambient=stars] .ambient::after { background-size: 220px 220px; animation-duration: 240s; animation-direction: reverse; opacity: .4; }
@keyframes drift { to { transform: translate3d(-360px, -180px, 0); } }

/* AstroMatch: soft pastel light */
html[data-ambient=pastel] .ambient {
  background: radial-gradient(55vw 45vh at 8% 0%, color-mix(in srgb, #F7AFC4 26%, transparent), transparent 70%),
    radial-gradient(50vw 50vh at 100% 18%, color-mix(in srgb, #C8B4F5 22%, transparent), transparent 70%),
    radial-gradient(60vw 55vh at 45% 110%, color-mix(in srgb, #FFD6AE 24%, transparent), transparent 70%);
  animation: breathe 22s ease-in-out infinite alternate;
}
@keyframes breathe { to { filter: hue-rotate(-18deg); transform: scale(1.06); } }

/* Mazdoor: Hindi + English type, chrome yellow */
html[data-ambient=devanagari] { --display: 'Tiro Devanagari Hindi', var(--p-font), var(--font); }
html[data-ambient=devanagari] h1 { font-weight: 400; width: fit-content; line-height: 1.15; background: linear-gradient(transparent 58%, color-mix(in srgb, var(--accent) 42%, transparent) 58% 86%, transparent 86%); padding: 0 3px; }
html[data-ambient=devanagari] h3, html[data-ambient=devanagari] .head .sub { font-family: 'Mukta', var(--font); }
html[data-ambient=devanagari] .ambient b { display: block; position: absolute; right: -2vw; bottom: -4vh; font: 400 min(22vw, 260px)/1 'Tiro Devanagari Hindi', serif; color: color-mix(in srgb, var(--accent) 8%, transparent); white-space: nowrap; }

/* Unicam: viewfinder corners, scanlines, one slow sweep */
html[data-ambient=scanline] { --vf: color-mix(in srgb, var(--accent) 60%, transparent); }
html[data-ambient=scanline] .ambient { background: repeating-linear-gradient(to bottom, color-mix(in srgb, var(--ink) 3.5%, transparent) 0 1px, transparent 1px 4px); }
html[data-ambient=scanline] .ambient::before { content: ''; position: absolute; inset: 14px;
  background: linear-gradient(var(--vf), var(--vf)) left top / 26px 2px no-repeat, linear-gradient(var(--vf), var(--vf)) left top / 2px 26px no-repeat,
    linear-gradient(var(--vf), var(--vf)) right top / 26px 2px no-repeat, linear-gradient(var(--vf), var(--vf)) right top / 2px 26px no-repeat,
    linear-gradient(var(--vf), var(--vf)) left bottom / 26px 2px no-repeat, linear-gradient(var(--vf), var(--vf)) left bottom / 2px 26px no-repeat,
    linear-gradient(var(--vf), var(--vf)) right bottom / 26px 2px no-repeat, linear-gradient(var(--vf), var(--vf)) right bottom / 2px 26px no-repeat; }
html[data-ambient=scanline] .ambient::after { content: ''; position: absolute; left: 0; right: 0; height: 90px; top: -90px;
  background: linear-gradient(transparent, color-mix(in srgb, var(--accent) 7%, transparent), transparent); animation: sweep 9s linear infinite; }
@keyframes sweep { to { transform: translateY(calc(100vh + 90px)); } }

/* Modkit apps: a precise grid in the app's accent */
html[data-ambient=grid] { --gl: color-mix(in srgb, var(--accent) 11%, transparent); --gs: color-mix(in srgb, var(--accent) 5%, transparent); }
html[data-ambient=grid] .ambient { background-image: linear-gradient(var(--gl) 1px, transparent 1px), linear-gradient(90deg, var(--gl) 1px, transparent 1px),
    linear-gradient(var(--gs) 1px, transparent 1px), linear-gradient(90deg, var(--gs) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 24px 24px, 24px 24px; background-position: -1px -1px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 100% 0%, #000 10%, transparent 80%); mask-image: radial-gradient(ellipse 90% 80% at 100% 0%, #000 10%, transparent 80%); }

@media (prefers-reduced-motion: reduce) {
  .ambient, .ambient::before, .ambient::after, .station, .listen .pulse { animation: none !important; }
  .ambient::after { display: none; }
}

/* ---------- v3: navigation ---------- */
a.brand { text-decoration: none; color: inherit; border-radius: 10px; }
a.brand:hover i { transform: rotate(-8deg); }
.brand i { transition: transform .2s ease; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); margin: -6px 0 14px; flex-wrap: wrap; }
.crumbs a { display: inline-flex; align-items: center; gap: 7px; text-decoration: none; color: var(--dim); padding: 4px 8px 4px 4px; margin-left: -4px; border-radius: 8px; font-weight: 600; }
.crumbs a:hover { color: var(--ink); background: var(--raised); }
.crumbs a i { width: 16px; height: 16px; border-radius: 5px; background: var(--accent); position: relative; display: inline-block; }
.crumbs a i::after { content: ''; position: absolute; inset: 4px 4px 4px 7px; border-radius: 1.5px; background: var(--bg); }
.crumbs b { color: var(--ink); font-weight: 600; }
@media (max-width: 820px) { .crumbs { position: sticky; top: 0; z-index: 5; margin: -18px -16px 14px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); font-size: 14px; } }

/* ---------- v3: launch control ---------- */
.pollhead { flex-wrap: wrap; }
.pollhead .verdict.go { color: var(--good); } .pollhead .verdict.hold { color: var(--bad); } .pollhead .verdict.standby { color: var(--warn); }
.pollhead .verdict.go::before, .pollhead .verdict.hold::before, .pollhead .verdict.standby::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); }
.pollhead .roll { margin-left: auto; font: 500 11px var(--mono); color: var(--faint); letter-spacing: .05em; }
.station { animation: report .35s ease both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes report { from { opacity: 0; transform: translateY(4px); } }
.station .tm, .tminus b { font: 600 11px var(--mono); letter-spacing: .04em; color: var(--dim); flex: none; }
.station .tm.late, .tminus.late b { color: var(--bad); }
.tminus { display: inline-flex; align-items: baseline; gap: 10px; padding: 7px 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 13px; max-width: 100%; }
.tminus b { font-size: 15px; color: var(--accent); }
.tminus span:not(.faint) { font-weight: 560; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- v3: voice, tasks, runs, suggestions ---------- */
.fab { position: fixed; right: 22px; bottom: 22px; z-index: 25; width: 54px; height: 54px; border-radius: 18px; border: 0; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 38%, rgba(0,0,0,.2)); transition: transform .15s ease, background-color .45s ease; }
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: scale(.94); }
.fab svg { width: 24px; height: 24px; }
@media (max-width: 820px) { .fab { right: 16px; bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); width: 52px; height: 52px; } }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.icon { padding: 6px; }
.listen { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--raised); min-height: 48px; }
.listen .pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--faint); flex: none; }
.listen.on .pulse { background: var(--bad); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 18%, transparent); } }
.item .nn { flex: none; width: 26px; height: 26px; border: 0; background: transparent; color: var(--faint); border-radius: 8px; display: grid; place-items: center; cursor: pointer; padding: 0; opacity: .55; }
.item .nn svg { width: 13px; height: 13px; }
.item:hover .nn, .item .nn:focus-visible { opacity: 1; }
.item .nn:hover { background: var(--raised); color: var(--ink); }
@media (hover: none) { .item .nn { opacity: .8; } }
a.status { text-decoration: none; }
.runbox { margin-top: 6px; padding: 12px 14px; border: 1px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); border-radius: 12px; }
.runbox b { display: inline-flex; align-items: center; gap: 6px; }
.suggest-banner { text-decoration: none; gap: 10px; border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.suggest-banner b { font-size: 20px; }
.item.suggest pre { white-space: pre-wrap; font: 12px/1.5 var(--font); color: var(--dim); margin: 6px 0 0; max-height: 90px; overflow: hidden; }
@media (max-width: 560px) { .item.suggest { flex-direction: column; } .item.suggest > .row { align-self: flex-end !important; } }
details > summary { cursor: pointer; }
@media (max-width: 820px) { .main { padding-bottom: calc(var(--tabbar) + 92px + env(safe-area-inset-bottom)); } }
.tminus .faint { white-space: nowrap; }
