/* JCCA Platform demo: theme, shell and shared components */

/* ---------- Tokens ---------- */
:root {
  --lime: #C4FF0E;
  --on-lime: #0A0A0A;
  --green: #22C55E;
  --amber: #F59E0B;
  --red: #EF4444;
  --blue: #3B82F6;
  --radius: 14px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  --font-display: "Saira Condensed", "Arial Narrow", "Roboto Condensed", Impact, sans-serif;
  --ease: cubic-bezier(.32,.72,0,1);
  --spring: cubic-bezier(.22,1,.36,1);
  --spring-dur: 587ms;
  --bounce: cubic-bezier(.34,1.56,.64,1);
  --sbw: 252px;
  --tb-h: 56px;
  --tabs-h: 72px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);

  /* dark (default) */
  --bg: #0A0A0A;
  --panel: #141414;
  --panel-2: #1C1C1C;
  --line: #262626;
  --text: #F5F5F5;
  --muted: #9A9A9A;
  --accent: #C4FF0E;
  --on-accent: #0A0A0A;
  --accent-text: #C4FF0E;
  --lime-soft: rgba(196,255,14,.12);
  --lime-line: rgba(196,255,14,.35);
  --hover: rgba(255,255,255,.05);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,.5), 0 24px 60px rgba(0,0,0,.55);
  --scrim: rgba(0,0,0,.6);
  color-scheme: dark;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --spring: linear(0, 0.0941 5.6%, 0.2736 11.1%, 0.4548 16.7%, 0.6076 22.2%, 0.7255 27.8%, 0.8119 33.3%, 0.8732 38.9%, 0.9156 44.4%, 0.9444 50%, 0.9636 55.6%, 0.9764 61.1%, 0.9848 66.7%, 0.9902 72.2%, 0.9938 77.8%, 0.996 83.3%, 0.9975 88.9%, 0.9984 94.4%, 1 100%);
    --bounce: linear(0, 0.0833 5.6%, 0.2603 11.1%, 0.4566 16.7%, 0.6331 22.2%, 0.7737 27.8%, 0.8759 33.3%, 0.9442 38.9%, 0.9858 44.4%, 1.0081 50%, 1.0178 55.6%, 1.0199 61.1%, 1.018 66.7%, 1.0143 72.2%, 1.0104 77.8%, 1.007 83.3%, 1.0043 88.9%, 1.0023 94.4%, 1 100%);
  }
}
html[data-theme="light"] {
  --bg: #F4F5F0;
  --panel: #FFFFFF;
  --panel-2: #F0F1EC;
  --line: #E2E4DC;
  --text: #0A0A0A;
  --muted: #5F6157;
  --accent: #0A0A0A;
  --on-accent: #C4FF0E;
  --accent-text: #0A0A0A;
  --lime-soft: rgba(196,255,14,.38);
  --lime-line: #0A0A0A;
  --hover: rgba(10,10,10,.045);
  --shadow: 0 1px 2px rgba(16,20,10,.06), 0 8px 24px rgba(16,20,10,.07);
  --shadow-lg: 0 2px 6px rgba(16,20,10,.08), 0 24px 60px rgba(16,20,10,.16);
  --scrim: rgba(10,10,10,.42);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    --bg: #F4F5F0; --panel: #FFFFFF; --panel-2: #F0F1EC; --line: #E2E4DC; --text: #0A0A0A; --muted: #5F6157;
    --accent: #0A0A0A; --on-accent: #C4FF0E; --accent-text: #0A0A0A; --lime-soft: rgba(196,255,14,.38); --lime-line: #0A0A0A;
    --hover: rgba(10,10,10,.045); --scrim: rgba(10,10,10,.42); color-scheme: light;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1.05; }
p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
.num, .kpi-value, .disp { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 650; }
.red { color: var(--red); }
.green { color: var(--green); }
.amber { color: var(--amber); }
.accent-text { color: var(--accent-text); }
.nowrap { white-space: nowrap; }
.ell { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Brand mark ---------- */
.mark { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--lime); flex: none; }
.mark svg { width: 100%; height: 100%; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.wordmark b { font: 800 19px/1 var(--font-display); letter-spacing: .04em; color: var(--text); }
.wordmark small { font: 700 9.5px/1.2 var(--font-display); letter-spacing: .14em; color: var(--muted); margin-top: 3px; white-space: nowrap; }

/* ---------- App shell (desktop) ---------- */
.app { position: relative; display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); height: 100vh; height: 100dvh; overflow: hidden; transition: grid-template-columns var(--spring-dur) var(--spring); }
.app.sb-off { grid-template-columns: 0 minmax(0, 1fr); }
.sb { position: relative; z-index: 20; min-width: 0; }
.sb-pn {
  position: absolute; left: 0; top: 0; bottom: 0; width: var(--sbw);
  display: flex; flex-direction: column; padding: 16px 12px 12px;
  background: var(--panel); box-shadow: inset -1px 0 var(--line);
  transition: transform var(--spring-dur) var(--spring), box-shadow .3s ease, border-radius .3s ease;
}
.app.sb-off .sb-pn { transform: translateX(-104%); box-shadow: none; border-radius: 0 18px 18px 0; }
.app.sb-off.peek .sb-pn { transform: none; box-shadow: var(--shadow-lg), inset -1px 0 var(--line); }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 2px 4px 16px; }
.sb-brand .wordmark { flex: 1; }
.sb-hide { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); }
.sb-hide:hover { background: var(--hover); color: var(--text); }
.sb-nav { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 2px; }
.sb-lbl { margin: 14px 10px 6px; font: 700 11px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.sb-lbl:first-child { margin-top: 2px; }
.it {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 42px; padding: 0 8px;
  border-radius: 12px; color: var(--muted); font-size: 14.5px; font-weight: 550; text-align: left; white-space: nowrap;
  transition: background-color .25s ease, color .25s ease, transform 90ms ease-out;
  animation: it-in 480ms var(--spring) both; animation-delay: calc(var(--i, 0) * 28ms);
}
.it:hover:not(.on) { background: var(--hover); color: var(--text); }
.it:active { transform: scale(.98); }
.it.on { background: var(--panel-2); color: var(--text); font-weight: 650; box-shadow: 0 0 0 1px var(--line); }
.nb { font-style: normal; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: #0A0A0A; font: 800 12px/1 var(--font-display); letter-spacing: .02em; }
.it .nb { margin-left: auto; }
.nb.inl { min-width: 18px; height: 18px; font-size: 11px; vertical-align: 1px; }
.tile {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted); box-shadow: 0 0 0 1px var(--line);
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
}
.tile svg { width: 16px; height: 16px; }
.it.on .tile { background: var(--accent); color: var(--on-accent); box-shadow: none; }
@keyframes it-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* icon animations when an item turns on */
.it.on.an-draw .tile svg * { animation: ai-draw .85s var(--ease) both; }
.it.on.an-grow .tile svg > * { transform-box: fill-box; transform-origin: 50% 100%; animation: ai-grow .65s var(--bounce) both; }
.it.on.an-grow .tile svg > *:nth-child(2) { animation-delay: .08s; }
.it.on.an-grow .tile svg > *:nth-child(3) { animation-delay: .16s; }
.it.on.an-ring .tile svg { transform-origin: 50% 15%; animation: ai-ring .95s var(--ease); }
.it.on.an-pop .tile svg { animation: ai-pop .7s var(--bounce) both; }
.it.on.an-dip .tile svg { animation: ai-dip .7s var(--ease); }
.it.on.an-spin .tile svg { animation: ai-spin .8s var(--bounce) both; }
@keyframes ai-draw { from { stroke-dasharray: 1; stroke-dashoffset: 1; } to { stroke-dasharray: 1; stroke-dashoffset: 0; } }
@keyframes ai-grow { from { transform: scaleY(.1); } to { transform: scaleY(1); } }
@keyframes ai-ring { 0%,100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 32% { transform: rotate(-14deg); } 48% { transform: rotate(9deg); } 64% { transform: rotate(-5deg); } 80% { transform: rotate(2deg); } }
@keyframes ai-pop { 0% { transform: scale(1); } 45% { transform: scale(1.3) rotate(-8deg); } 100% { transform: scale(1); } }
@keyframes ai-dip { 0% { transform: none; } 30% { transform: translateY(3px); } 60% { transform: translateY(-1px); } 100% { transform: none; } }
@keyframes ai-spin { from { transform: rotate(0); } to { transform: rotate(90deg); } }

.sb-foot { padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px; border-radius: 12px; text-align: left; }
.me:hover { background: var(--hover); }
.me p { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me b { font-size: 14px; font-weight: 650; }
.me small { font-size: 12px; color: var(--muted); }
.sb-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 14px; z-index: 19; display: none; }
.app.sb-off:not(.peek) .sb-edge { display: block; }
.sb-fb {
  position: absolute; left: 14px; top: 16px; z-index: 18; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  opacity: 0; transform: scale(.6) translateX(-10px); pointer-events: none;
  transition: opacity .2s ease, transform var(--spring-dur) var(--spring);
}
.app.sb-off:not(.peek) .sb-fb { opacity: 1; transform: none; pointer-events: auto; }

.main { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 26px 32px 40px; scrollbar-width: thin; transition: padding-left var(--spring-dur) var(--spring); }
.app.sb-off .view { padding-left: 72px; }
.view.ld-mode { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.view-in > * { animation: v-in 520ms var(--spring) both; }
.view-in > *:nth-child(2) { animation-delay: 40ms; }
.view-in > *:nth-child(3) { animation-delay: 80ms; }
.view-in > *:nth-child(n+4) { animation-delay: 110ms; }
@keyframes v-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tb, .tabs { display: none; }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head > div:first-child { flex: 1 1 260px; min-width: 0; }
.page-head h1 { font-size: 34px; font-weight: 800; letter-spacing: .02em; }
.page-head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.page-head .row { flex-wrap: wrap; }

/* ---------- Components ---------- */
.card { background: var(--panel); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); padding: 18px; min-width: 0; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; min-width: 0; }
.card-h h3 { font-size: 17px; letter-spacing: .04em; flex: 1; min-width: 0; }
.card-h .muted { font-size: 13px; }
.grid { display: grid; gap: 14px; }
.grid-2 { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack { display: grid; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.kpi { background: var(--panel); border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.kpi-value { font-size: 34px; line-height: 1; letter-spacing: .01em; }
.kpi-delta { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.kpi-delta.up { color: var(--green); }
.kpi-delta.down { color: var(--red); }
.kpi.hl { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.kpi.hl .kpi-label, .kpi.hl .kpi-delta { color: inherit; opacity: .8; }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--panel-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.badge::before { content: none; }
.b-green { background: rgba(34,197,94,.14); color: #16A34A; box-shadow: none; }
.b-amber { background: rgba(245,158,11,.16); color: #B45309; box-shadow: none; }
.b-red { background: rgba(239,68,68,.14); color: #DC2626; box-shadow: none; }
.b-blue { background: rgba(59,130,246,.14); color: #2563EB; box-shadow: none; }
.b-grey { background: var(--panel-2); color: var(--muted); }
.b-lime { background: var(--accent); color: var(--on-accent); box-shadow: none; }
html:not([data-theme="light"]) .b-green { color: #4ADE80; }
html:not([data-theme="light"]) .b-amber { color: #FBBF24; }
html:not([data-theme="light"]) .b-red { color: #F87171; }
html:not([data-theme="light"]) .b-blue { color: #60A5FA; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 44px; padding: 0 16px; border-radius: 12px;
  font-size: 14.5px; font-weight: 650; white-space: nowrap; background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 90ms ease-out, background-color .2s ease, opacity .2s ease; user-select: none;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: scale(.96); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.btn-primary:hover { background: var(--accent); filter: brightness(1.06); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: rgba(239,68,68,.12); color: var(--red); box-shadow: none; }
.btn-green { background: rgba(34,197,94,.14); color: #16A34A; box-shadow: none; }
html:not([data-theme="light"]) .btn-green { color: #4ADE80; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--text); }
.icon-btn:hover { background: var(--hover); }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background-color .25s ease, color .25s ease; }
.seg button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 0 0 1px var(--line); }
.seg.seg-accent button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 0; outline: 0;
  background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px;
  transition: box-shadow .2s ease, background-color .2s ease;
}
textarea.input { min-height: 84px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus { box-shadow: inset 0 0 0 1.5px var(--accent), 0 0 0 4px var(--lime-soft); background-color: var(--panel); }
.input::placeholder { color: var(--muted); }
.input.bad { box-shadow: inset 0 0 0 1.5px var(--red); }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 12px; top: 50%; margin-top: -8px; color: var(--muted); pointer-events: none; }
.search .input { padding-left: 38px; }

.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); background: var(--panel); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table td.n, .table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.table tbody tr { transition: background-color .2s ease; }
.table tbody tr:hover { background: var(--hover); }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--line); }

.progress { position: relative; height: 8px; border-radius: 999px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.progress > .bar { height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 900ms var(--ease); }
.progress > .bar.green { background: var(--green); }
.progress > .bar.amber { background: var(--amber); }
.progress > .bar.red { background: var(--red); }
html:not([data-theme="light"]) .progress > .bar:not(.green):not(.amber):not(.red) { box-shadow: 0 0 12px rgba(196,255,14,.35); }

.list { display: flex; flex-direction: column; gap: 2px; }
.li { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 12px; border-radius: 12px; text-align: left; transition: background-color .2s ease, transform 90ms ease-out; }
button.li:hover, a.li:hover { background: var(--hover); }
button.li:active { transform: scale(.99); }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 650; font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.li-sub { font-size: 13px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.li-end { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 13px; color: var(--muted); }
.list.divided .li { border-radius: 0; border-bottom: 1px solid var(--line); }
.list.divided .li:last-child { border-bottom: 0; }

.avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--panel-2); color: var(--text); font: 800 14px/1 var(--font-display); letter-spacing: .04em; box-shadow: inset 0 0 0 1px var(--line); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 60px; height: 60px; font-size: 22px; }
.avatar.lime { background: var(--accent); color: var(--on-accent); box-shadow: none; }

.empty { display: grid; place-items: center; gap: 8px; padding: 36px 16px; text-align: center; color: var(--muted); font-size: 14px; border-radius: var(--radius); border: 1.5px dashed var(--line); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; white-space: nowrap; background: var(--panel); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s ease, color .2s ease; }
.chip b { font-family: var(--font-display); font-weight: 800; font-size: 14px; }
.chip.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); font-size: 13.5px; color: var(--muted); }
.note svg { margin-top: 1px; color: var(--accent-text); }
.note.warn { background: rgba(245,158,11,.12); color: var(--text); }
.note.warn svg { color: var(--amber); }
.note.bad { background: rgba(239,68,68,.12); color: var(--text); }
.note.bad svg { color: var(--red); }
.note.ok { background: rgba(34,197,94,.12); color: var(--text); }
.note.ok svg { color: var(--green); }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
.kv > div { padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; padding-right: 12px; }
.kv dt, .kv .k { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv dd, .kv .v { margin: 2px 0 0; font-size: 14.5px; font-weight: 550; overflow-wrap: anywhere; }

/* ---------- Banner (grayscale construction photo feel) ---------- */
.banner {
  position: relative; overflow: hidden; border-radius: 18px; padding: 22px; color: #F5F5F5; isolation: isolate;
  background:
    radial-gradient(120% 90% at 85% 0%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(180deg, rgba(10,10,10,.15), rgba(10,10,10,.85)),
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(255,255,255,.07) 46px 50px),
    repeating-linear-gradient(0deg, transparent 0 38px, rgba(255,255,255,.06) 38px 41px),
    repeating-linear-gradient(135deg, transparent 0 120px, rgba(255,255,255,.05) 120px 124px),
    linear-gradient(115deg, #2A2A2A 0%, #4A4A48 38%, #1F1F1F 70%, #333 100%);
}
.banner::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(0,0,0,.35), transparent 60%); }
.banner .eyebrow { font: 700 12px/1 var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: rgba(245,245,245,.7); }
.banner h2 { margin-top: 8px; font-size: 34px; color: var(--lime); letter-spacing: .02em; }
.banner p { margin-top: 6px; color: rgba(245,245,245,.78); font-size: 14px; }
.banner .muted { color: rgba(245,245,245,.65); }

/* ---------- Ring ---------- */
.ring { position: relative; width: 132px; height: 132px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: var(--panel-2); }
.ring .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease); }
.ring .lbl { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }
.ring .lbl b { font: 800 34px/1 var(--font-display); }
.ring .lbl small { font-size: 12px; color: var(--muted); }

/* ---------- List / detail (three-pane) ---------- */
.ld { flex: 1; min-height: 0; display: grid; grid-template-columns: 360px minmax(0, 1fr); margin: 0 -32px; border-top: 1px solid var(--line); transition: margin var(--spring-dur) var(--spring); }
.app.sb-off .ld { margin-left: -72px; }
.ld-list { min-width: 0; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--panel); }
.ld-head { flex: none; padding: 14px 14px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.ld-rows { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.ld-count { font-size: 12.5px; color: var(--muted); padding: 4px 6px 8px; }
.ld-sel { position: absolute; left: 8px; right: 8px; top: 0; height: 0; border-radius: 13px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line), inset 3px 0 0 var(--accent); opacity: 0; pointer-events: none; transition: transform var(--spring-dur) var(--spring), height var(--spring-dur) var(--spring), opacity .2s ease; }
.ld-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 12px; margin-bottom: 2px; border-radius: 13px; text-align: left; transition: background-color .2s ease, transform 90ms ease-out; animation: v-in 480ms var(--spring) both; animation-delay: calc(min(var(--i, 0), 12) * 30ms); }
.ld-row:hover:not(.on) { background: var(--hover); }
.ld-row:active { transform: scale(.99); }
.ld-detail { position: relative; min-width: 0; min-height: 0; overflow-y: auto; background: var(--bg); scrollbar-width: thin; }
.ld-pane { padding: 26px 32px 48px; max-width: 980px; }
.ld-pane.go { animation: tri-slide 560ms var(--spring) both; }
@keyframes tri-slide { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }

/* ---------- Layers: sheet, push screen, toast, push banner ---------- */
.layer { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
.layer > * { pointer-events: auto; }
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; transition: opacity .3s ease; z-index: 8200; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; z-index: 8201; left: 50%; top: 50%; width: min(560px, calc(100vw - 32px)); max-height: min(86vh, 760px);
  display: flex; flex-direction: column; background: var(--panel); border-radius: 20px; box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
  opacity: 0; transform: translate(-50%, -46%) scale(.96); transition: opacity .25s ease, transform var(--spring-dur) var(--spring);
}
.sheet.on { opacity: 1; transform: translate(-50%, -50%); }
.sheet-h { flex: none; display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px 20px; }
.sheet-h h3 { flex: 1; font-size: 22px; min-width: 0; }
.sheet-grab { display: none; }
.sheet-b { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 20px 22px; overscroll-behavior: contain; }

.screen {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; background: var(--bg);
  transform: translateX(100%); will-change: transform;
}
.screen-edge { position: absolute; left: 0; top: 0; bottom: 0; width: 26px; z-index: 5; touch-action: none; }
.screen-dim { position: fixed; inset: 0; z-index: 89; background: #000; opacity: 0; pointer-events: none; }
.screen-h { flex: none; display: flex; align-items: center; gap: 4px; padding: calc(var(--sat) + 6px) 8px 6px; min-height: calc(var(--tb-h) + var(--sat)); background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--line); }
.screen-h .back { display: inline-flex; align-items: center; gap: 2px; height: 44px; padding: 0 10px 0 4px; border-radius: 12px; color: var(--accent-text); font-weight: 600; font-size: 16px; }
.screen-h h2 { flex: 1; min-width: 0; text-align: center; font-size: 19px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 60px; }
.screen-b { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px calc(var(--sab) + 32px); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.app.under { transition: transform var(--spring-dur) var(--spring); }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 9000; display: flex; align-items: center; gap: 9px; max-width: calc(100vw - 32px);
  padding: 11px 16px 11px 12px; border-radius: 999px; background: var(--text); color: var(--bg); font-size: 14px; font-weight: 650; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: transform var(--spring-dur) var(--spring), opacity .25s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--lime); color: #0A0A0A; flex: none; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pushn {
  position: fixed; z-index: 9100; left: 50%; top: calc(var(--sat) + 10px); width: min(400px, calc(100vw - 20px)); transform: translate(-50%, -140%);
  display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border-radius: 22px; cursor: pointer;
  background: rgba(40,40,40,.78); color: #F5F5F5; -webkit-backdrop-filter: saturate(1.8) blur(24px); backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: 0 10px 40px rgba(0,0,0,.35); transition: transform 640ms var(--spring);
}
html[data-theme="light"] .pushn { background: rgba(246,246,242,.86); color: #0A0A0A; }
.pushn.on { transform: translate(-50%, 0); }
.pushn .mark { width: 38px; height: 38px; border-radius: 9px; }
.pushn div { flex: 1; min-width: 0; }
.pushn .ph { display: flex; justify-content: space-between; font-size: 12.5px; opacity: .7; font-weight: 600; letter-spacing: .02em; }
.pushn b { display: block; margin-top: 1px; font-size: 14.5px; font-weight: 700; }
.pushn p { font-size: 14px; line-height: 1.35; opacity: .92; }

/* ---------- Splash ---------- */
.splash { position: fixed; inset: 0; z-index: 9500; display: grid; place-items: center; background: #0A0A0A; transition: opacity .45s ease, visibility .45s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-in { display: grid; justify-items: center; gap: 18px; animation: sp-in 700ms var(--spring) both; }
.splash .mark { width: 96px; height: 96px; border-radius: 18px; box-shadow: 0 0 60px rgba(196,255,14,.25); }
.splash h1 { color: var(--lime); font-size: 44px; letter-spacing: .06em; text-align: center; }
.splash small { display: block; margin-top: 6px; font: 700 13px/1 var(--font-display); letter-spacing: .3em; color: var(--lime); text-align: center; }
.splash .sp-bar { width: 120px; height: 3px; border-radius: 2px; background: #262626; overflow: hidden; }
.splash .sp-bar i { display: block; height: 100%; width: 40%; background: var(--lime); animation: sp-bar 900ms var(--ease) infinite; }
@keyframes sp-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes sp-bar { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- Role picker / theme ---------- */
.role-list { display: grid; gap: 6px; }
.role-opt { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 12px; border-radius: 14px; text-align: left; box-shadow: inset 0 0 0 1px var(--line); transition: background-color .2s ease; }
.role-opt:hover { background: var(--hover); }
.role-opt.on { box-shadow: inset 0 0 0 2px var(--accent); }
.role-opt p { flex: 1; display: flex; flex-direction: column; }
.role-opt small { color: var(--muted); font-size: 13px; }
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.more-it { display: grid; justify-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; background: var(--panel-2); font-size: 13px; font-weight: 600; text-align: center; transition: transform 90ms ease-out; }
.more-it:active { transform: scale(.96); }
.more-it .tile { width: 40px; height: 40px; border-radius: 12px; }
.more-it .tile svg { width: 20px; height: 20px; }
.more-it.on .tile { background: var(--accent); color: var(--on-accent); }
.sec-lbl { margin: 18px 0 8px; font: 700 12px/1 var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* install hint */
.install { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--sab) + 10px); display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 12px; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line); font-size: 13.5px; animation: v-in 600ms var(--spring) both; }
.install p { flex: 1; min-width: 0; }
.install b { display: block; font-size: 14px; }
.install .mark { width: 34px; height: 34px; }

/* ---------- Mobile (<1024px) ---------- */
@media (max-width: 1023px) {
  body { overflow-y: auto; }
  .app { display: block; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .sb, .sb-fb, .sb-edge { display: none !important; }
  .tb {
    display: flex; align-items: center; gap: 8px; position: fixed; z-index: 50; left: 0; right: 0; top: 0;
    padding: var(--sat) calc(10px + var(--sar)) 0 calc(14px + var(--sal)); height: calc(var(--tb-h) + var(--sat));
    background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
    border-bottom: 1px solid transparent; transition: border-color .2s ease;
  }
  .tb.line { border-bottom-color: var(--line); }
  .tb .mark { width: 30px; height: 30px; border-radius: 7px; }
  .tb::after { content: ""; flex: 1; }
  .tb h1.tb-title { position: absolute; left: 96px; right: 96px; bottom: 0; height: var(--tb-h); display: grid; place-items: center; font: 600 16px/1.2 var(--font); text-transform: none; letter-spacing: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
  .tb .tb-theme, .tb .tb-av { order: 2; }
  .page-head h1 { font-size: 30px; will-change: transform, opacity; }
  html { scroll-snap-type: y proximity; }
  .view > .page-head:first-child { scroll-snap-align: start; scroll-margin-top: calc(var(--tb-h) + var(--sat) + 16px); }
  .view > .page-head:first-child + * { scroll-snap-align: start; scroll-margin-top: calc(var(--tb-h) + var(--sat) + 8px); }

  /* swipe actions */
  .sw { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 420ms var(--ease); }
  .sw.gone { grid-template-rows: 0fr; }
  .sw-in { position: relative; overflow: hidden; min-height: 0; }
  .sw-in > .sw-fg { position: relative; z-index: 2; background: var(--panel); touch-action: pan-y; will-change: transform; }
  .sw-a { position: absolute; top: 0; bottom: 0; width: 48px; display: grid; place-items: center; align-content: center; gap: 3px; background: var(--c); color: var(--t); font-size: 10.5px; font-weight: 700; z-index: 0; }
  .sw-a svg { width: 18px; height: 18px; }
  .sw-l { left: 0; justify-items: center; }
  .sw-rs { position: absolute; top: 0; bottom: 0; display: flex; z-index: 0; }
  .sw-rs .sw-a { position: relative; }
  .sw-full { position: absolute; inset: 0; z-index: 1; display: flex; justify-content: flex-end; background: var(--c); transform: translateX(calc(100% - 48px)); transition: transform 360ms ease; }
  .sw-full .sw-a { position: relative; height: 100%; }
  .sw.armed .sw-full { transform: translateX(0); }
  .sw:not(.armed) .sw-full { pointer-events: auto; }
  .tb .avatar { width: 34px; height: 34px; font-size: 12.5px; }
  .tb-av { display: grid; place-items: center; width: 44px; height: 44px; }
  .main { overflow: visible; display: block; }
  .view, .app.sb-off .view { overflow: visible; padding: calc(var(--tb-h) + var(--sat) + 16px) calc(16px + var(--sar)) calc(var(--tabs-h) + var(--sab) + 28px) calc(16px + var(--sal)); }
  .view.ld-mode { display: block; overflow: visible; padding-bottom: calc(var(--tabs-h) + var(--sab) + 28px); }

  .page-head { margin-bottom: 16px; }
  .page-head h1 { font-size: 28px; }
  .page-head.mhide-title h1 { display: none; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid-3.keep, .grid-2.keep { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid, .stack { gap: 12px; }
  .card { padding: 16px; }
  .kpi-value { font-size: 30px; }
  .banner h2 { font-size: 28px; }

  .ld { display: block; margin: 0; border: 0; }
  .ld-list { border: 0; background: transparent; display: block; }
  .ld-head { padding: 0 0 10px; border: 0; }
  .ld-rows { overflow: visible; padding: 0; border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
  .ld-row { border-radius: 0; margin: 0; min-height: 66px; border-bottom: 1px solid var(--line); padding: 10px 14px; }
  .ld-row:last-child { border-bottom: 0; }
  .ld-row::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-top: 2px solid var(--muted); transform: rotate(45deg); flex: none; margin-left: 2px; opacity: .6; }
  .ld-sel, .ld-detail { display: none !important; }
  .ld-count { padding: 0 2px 8px; }
  .ld-pane { padding: 0; }

  .sheet {
    left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: calc(100dvh - var(--sat) - 24px); border-radius: 22px 22px 0 0;
    transform: translateY(100%); opacity: 1; padding-bottom: var(--sab);
  }
  .sheet.on { transform: none; }
  .sheet-grab { display: block; width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
  .sheet-h { padding: 8px 10px 8px 18px; }
  .sheet-b { padding: 4px 16px 22px; }
  .toast { bottom: calc(var(--tabs-h) + var(--sab) + 14px); }
  .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }

  .table.stack thead { display: none; }
  .table.stack, .table.stack tbody, .table.stack tr, .table.stack td, .table.stack tfoot { display: block; width: 100%; }
  .table.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border: 0; text-align: right; }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; flex: none; max-width: 55%; }
  .table.stack td.first { font-weight: 700; font-size: 15px; text-align: left; }
  .table.stack td.first::before { display: none; }
  .table.stack tbody tr:hover { background: none; }
  .table-wrap.stack-wrap { overflow: visible; }
}
@media (min-width: 1024px) {
  .install { display: none; }
  .m-only { display: none !important; }
}
@media (max-width: 1023px) { .d-only { display: none !important; } }
@media (max-width: 380px) {
  .grid-4 .kpi-value { font-size: 26px; }
  .seg button { padding: 0 11px; }
}

/* ---------- Gaffer (AI): inline ghost-text suggestions ---------- */
.as-wrap { position: relative; display: block; min-width: 0; }
.as-wrap > .input { position: relative; z-index: 0; }
.as-ghost { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; color: transparent; white-space: pre-wrap; overflow-wrap: break-word; word-wrap: break-word; }
.as-ghost .as-sug { color: var(--muted); opacity: .75; }
.as-ghost .as-sug i { font-style: normal; animation: as-word .28s ease both; }
.as-wrap.single .as-ghost { white-space: pre; }
.as-wrap.flash > .input { animation: as-flash .8s ease; }
@keyframes as-word { from { opacity: 0; filter: blur(2px); } to { opacity: 1; filter: none; } }
@keyframes as-flash { 0% { box-shadow: inset 0 0 0 2px var(--lime), 0 0 0 6px rgba(196,255,14,.35); } 100% { box-shadow: inset 0 0 0 1px var(--line); } }
.as-pill {
  position: absolute; z-index: 30; right: 0; top: calc(100% + 8px); display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 6px 6px 6px 12px; border-radius: 999px; background: #141414; color: #F5F5F5; box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px #262626;
  font-size: 12.5px; font-weight: 600; opacity: 0; transform: translateY(-6px) scale(.97); pointer-events: none;
  transition: opacity .2s ease, transform var(--spring-dur) var(--spring); max-width: calc(100vw - 24px);
}
.as-pill.on { opacity: 1; transform: none; pointer-events: auto; }
.as-pill .as-name { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.as-pill .as-name .gf-tile svg { width: 12px; height: 12px; color: #0A0A0A; }
.gf-tile { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; background: var(--lime); color: #0A0A0A; flex: none; font-style: normal; }
.gf-tile svg { width: 12px; height: 12px; }
.gf-ai { display: inline-grid; place-items: center; height: 16px; padding: 0 5px; border-radius: 5px; background: var(--lime); color: #0A0A0A; font: 800 10px/1 var(--font); letter-spacing: .05em; vertical-align: 1px; margin-left: 4px; }
.gf-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.gf-tag .gf-tile { width: 18px; height: 18px; border-radius: 5px; }
.as-pill button { height: 30px; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: #F5F5F5; white-space: nowrap; }
.as-pill button:hover { background: rgba(255,255,255,.08); }
.as-pill kbd { font: 700 10.5px/1 var(--font); padding: 3px 5px; border-radius: 5px; background: rgba(255,255,255,.12); margin-right: 5px; }
.as-pill .as-ok { background: var(--lime); color: #0A0A0A; }
.as-pill .as-ok:hover { background: var(--lime); filter: brightness(1.05); }
.as-pill .as-ok kbd { background: rgba(0,0,0,.12); }
.as-tones { position: relative; display: inline-flex; padding: 2px; border-radius: 999px; background: rgba(255,255,255,.08); }
.as-tones .as-glide { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 999px; background: rgba(255,255,255,.16); transition: transform var(--spring-dur) var(--spring), width var(--spring-dur) var(--spring); }
.as-tones button { position: relative; z-index: 1; height: 26px; padding: 0 10px; color: rgba(245,245,245,.7); }
.as-tones button.on { color: #F5F5F5; }
.as-tones button:hover { background: none; }
.as-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 600; }
.as-label .gf-tile svg { width: 12px; height: 12px; color: #0A0A0A; }
@media (max-width: 1023px) {
  .as-pill { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(var(--tabs-h) + var(--sab) + 10px); border-radius: 18px; padding: 8px; justify-content: space-between; z-index: 8500; }
  .as-pill.in-screen { bottom: calc(var(--sab) + 12px); }
  .as-pill .as-name { padding-left: 4px; }
  .as-pill .as-ok { height: 44px; padding: 0 18px; font-size: 15px; flex: 1 1 auto; border-radius: 12px; }
  .as-pill .as-no { height: 44px; border-radius: 12px; }
  .as-pill kbd { display: none; }
  .as-tones { order: -1; flex: 1 1 100%; justify-content: center; }
  .as-tones button { height: 32px; flex: 1; }
}

/* =========================================================
   Sales views (prefix s-)
   ========================================================= */
.s-tabs { margin-bottom: 18px; }
.s-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; }
.s-target { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.s-target div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); min-width: 0; }
.s-target small { display: block; font-size: 12px; color: rgba(245,245,245,.7); }
.s-target b { display: block; margin-top: 4px; font: 800 30px/1 var(--font-display); color: #F5F5F5; }
.s-target div.hl { background: var(--lime); box-shadow: none; }
.s-target div.hl small, .s-target div.hl b { color: #0A0A0A; }
.s-goal { display: flex; align-items: center; gap: 18px; }
.s-goal-t h3 { font-size: 20px; }
.s-goal-t p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.s-goal-t .row { margin-top: 10px; flex-wrap: wrap; }

.s-funnel { display: grid; gap: 6px; }
.s-fstep { display: grid; grid-template-columns: 128px minmax(0, 1fr) 64px; align-items: center; gap: 12px; }
.s-fstep span:first-child { font-size: 13.5px; font-weight: 600; }
.s-fbar { height: 30px; border-radius: 8px; background: var(--panel-2); overflow: hidden; }
.s-fbar i { display: block; height: 100%; min-width: 4px; border-radius: 8px; background: var(--accent); transform-origin: 0 50%; animation: s-grow 900ms var(--ease) both; }
.s-fstep:nth-child(n+3) .s-fbar i { opacity: .92; }
.s-fstep b { font: 800 22px/1 var(--font-display); text-align: right; }
.s-fconv { grid-column: 2; font-size: 12px; color: var(--muted); padding-left: 4px; display: flex; align-items: center; gap: 6px; }
.s-fconv::before { content: ""; width: 1.5px; height: 12px; background: var(--line); }
@keyframes s-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.s-conv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.s-convc { padding: 14px; border-radius: 12px; background: var(--panel-2); min-width: 0; }
.s-convc h4 { font-size: 15px; letter-spacing: .06em; }
.s-convrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.s-convrow b { font: 800 26px/1 var(--font-display); }
.s-convrow .arr { color: var(--muted); font-size: 12px; text-align: center; }
.s-convrow > div { text-align: center; min-width: 0; }
.s-convrow small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.s-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.s-chart .ax { stroke: var(--line); }
.s-chart .tl { stroke: var(--accent-text); stroke-dasharray: 4 4; stroke-width: 1.5; }
.s-chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.s-chart .b-ig { fill: var(--accent); }
.s-chart .b-li { fill: var(--muted); }
.s-chart .b-fut { fill: none; stroke: var(--line); stroke-dasharray: 3 3; }
.s-chart rect.bar { transform-box: fill-box; transform-origin: 50% 100%; animation: ai-grow .8s var(--bounce) both; }
.s-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.s-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

.s-health { display: grid; gap: 8px; }
.s-health button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: 12px; background: var(--panel-2); text-align: left; min-height: 56px; }
.s-health button:hover { background: var(--hover); }
.s-health b { font: 800 26px/1 var(--font-display); min-width: 34px; text-align: center; }
.s-health p { flex: 1; min-width: 0; }
.s-health small { display: block; color: var(--muted); font-size: 12.5px; }

/* daily targets */
.s-tg { display: grid; gap: 14px; }
.s-tg-row { display: grid; gap: 7px; }
.s-tg-row .row { justify-content: space-between; }
.s-tg-row b { font: 800 20px/1 var(--font-display); }

/* call list */
.s-call { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; border-radius: 14px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.s-call + .s-call { margin-top: 10px; }
.s-call .t { font: 800 22px/1 var(--font-display); }
.s-call .t small { display: block; font: 600 11px/1.2 var(--font); color: var(--muted); margin-top: 4px; }
.s-call h4 { font: 700 16px/1.25 var(--font); text-transform: none; letter-spacing: 0; }
.s-call .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.s-call .pain { margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.s-call .pain b { color: var(--text); font-weight: 600; }
.s-call .acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.s-call .acts .btn { padding: 0 8px; }
.s-call.done { opacity: .7; }
.s-call.flash { animation: s-flash 1.2s ease; }
@keyframes s-flash { 0% { box-shadow: inset 0 0 0 2px var(--accent); } 100% { box-shadow: inset 0 0 0 1px var(--line); } }

/* pipeline board */
.s-board-wrap { margin: 0 -32px; padding: 0 32px 8px; overflow-x: auto; scrollbar-width: thin; transition: margin var(--spring-dur) var(--spring), padding var(--spring-dur) var(--spring); }
.app.sb-off .s-board-wrap { margin-left: -72px; padding-left: 72px; }
.s-board { display: grid; grid-auto-flow: column; grid-auto-columns: 264px; gap: 12px; align-items: start; width: max-content; padding-bottom: 6px; }
.s-col { display: flex; flex-direction: column; min-width: 0; padding: 10px; border-radius: 18px; background: var(--panel); box-shadow: inset 0 0 0 1.5px var(--line); transition: background-color .2s ease, box-shadow .25s ease; }
.s-col.over { background: var(--lime-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.s-ch { display: flex; align-items: center; gap: 8px; padding: 4px 4px 0; }
.s-ch i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.s-ch b { font: 800 15px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .05em; flex: 1; min-width: 0; }
.s-ch .cn { padding: 3px 8px; border-radius: 999px; background: var(--panel-2); font: 800 12px/1.2 var(--font-display); color: var(--muted); }
.s-ct { display: inline-block; align-self: flex-start; margin: 4px 4px 10px; font: 800 22px/1.2 var(--font-display); font-variant-numeric: tabular-nums; }
.s-ct.bump { animation: s-pop 460ms var(--ease); }
@keyframes s-pop { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
.s-col.won .s-ct { color: var(--green); }
.s-col.won .s-ch i { background: var(--green); }
.s-col.lost .s-ch i { background: var(--red); }
.s-cb { display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.s-cb:empty::after { content: "Drop a lead here"; display: grid; place-items: center; height: 76px; border-radius: 12px; border: 1.5px dashed var(--line); font-size: 12.5px; color: var(--muted); }
.s-deal {
  position: relative; padding: 11px 12px; border-radius: 13px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: pan-y;
  transition: transform 520ms var(--bounce), box-shadow .2s ease;
}
.s-deal:hover { box-shadow: inset 0 0 0 1px var(--muted); }
.s-deal.lift { z-index: 30; cursor: grabbing; transition: box-shadow .2s ease; box-shadow: inset 0 0 0 1.5px var(--accent), 0 18px 36px rgba(0,0,0,.35); }
.s-deal b { display: block; font-size: 14px; font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-deal .nm { font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-deal .v { margin-top: 8px; font: 800 19px/1 var(--font-display); }
.s-deal .ft { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.s-deal .mv { margin-left: auto; height: 32px; padding: 0 10px; border-radius: 9px; background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-size: 12.5px; font-weight: 650; color: var(--text); }
.s-boardsplit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.s-drawer { position: fixed; z-index: 70; top: 0; right: 0; bottom: 0; width: min(560px, 46vw); background: var(--bg); box-shadow: var(--shadow-lg), -1px 0 0 var(--line); transform: translateX(104%); transition: transform var(--spring-dur) var(--spring); display: flex; flex-direction: column; }
.s-drawer.on { transform: none; }
.s-drawer-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.s-drawer-h b { flex: 1; font: 800 18px/1 var(--font-display); text-transform: uppercase; letter-spacing: .04em; }
.s-drawer-b { flex: 1; overflow-y: auto; padding: 22px 24px 40px; }
.s-totals { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.s-totals b { font: 800 20px/1 var(--font-display); color: var(--text); margin-right: 4px; }

/* lead detail */
.s-dh { display: flex; align-items: flex-start; gap: 14px; }
.s-dh h2 { font-size: 30px; line-height: 1.05; }
.s-dh p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.s-dh .row { margin-top: 8px; flex-wrap: wrap; gap: 6px; }
.s-trk { position: relative; margin: 22px 0 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.s-trk::-webkit-scrollbar { display: none; }
.s-trk-in { position: relative; min-width: 620px; }
.s-trk .line { position: absolute; left: 6.25%; right: 6.25%; top: 11px; height: 3px; border-radius: 2px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.s-trk .fill { display: block; height: 100%; border-radius: inherit; background: var(--accent); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; transition: transform 780ms var(--ease); }
.s-trk.lost .fill { background: var(--red); }
.s-nodes { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); }
.s-nd { display: flex; flex-direction: column; align-items: center; gap: 7px; font-size: 11.5px; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.2; padding: 0 2px; transition: color .3s ease; }
.s-nd i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); color: var(--on-accent); transition: background-color .35s ease, box-shadow .35s ease; }
.s-nd i svg { width: 12px; height: 12px; opacity: 0; transform: scale(.5); transition: opacity .25s ease, transform .45s var(--bounce); }
.s-nd.done i { background: var(--accent); box-shadow: none; }
.s-nd.done i svg { opacity: 1; transform: none; }
.s-nd.now i { background: var(--bg); box-shadow: inset 0 0 0 6px var(--accent), 0 0 0 4px var(--lime-soft); }
.s-nd.done, .s-nd.now { color: var(--text); }
.s-trk.lost .s-nd.now i { box-shadow: inset 0 0 0 6px var(--red); }
.s-dgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 16px; }
.s-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.s-fields .full { grid-column: 1 / -1; }
.s-ro { min-height: 44px; display: flex; align-items: center; padding: 0 12px; border-radius: 12px; background: var(--panel-2); font-size: 15px; font-weight: 550; gap: 8px; overflow-wrap: anywhere; }
.s-ro svg { color: var(--muted); }
.s-offer { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.s-offer button { padding: 14px; border-radius: 14px; text-align: left; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s ease, background-color .2s ease, transform 90ms ease-out; }
.s-offer button:active { transform: scale(.98); }
.s-offer button.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--panel); }
.s-offer small { display: block; color: var(--muted); font-size: 12.5px; }
.s-offer b { display: block; margin-top: 4px; font: 800 26px/1 var(--font-display); }
.s-total { display: flex; align-items: baseline; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.s-total b { font: 800 30px/1 var(--font-display); }
.s-gate { margin-top: 12px; }
.s-gate ul { margin: 6px 0 0; padding-left: 18px; }
.s-tl { display: grid; gap: 0; margin-top: 12px; }
.s-tl-it { position: relative; padding: 0 0 14px 22px; }
.s-tl-it::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--lime-soft); }
.s-tl-it::after { content: ""; position: absolute; left: 8.5px; top: 18px; bottom: 0; width: 1px; background: var(--line); }
.s-tl-it:last-child::after { display: none; }
.s-tl-it p { font-size: 14px; }
.s-tl-it small { color: var(--muted); font-size: 12px; }
.s-tl-it.new { animation: v-in 520ms var(--spring) both; }
.s-addnote { display: flex; gap: 8px; }
.s-dup { margin-top: 12px; }

/* calendar */
.s-cal { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 16px; align-items: start; }
.s-link { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.s-link code { flex: 1; min-width: 0; font: 600 12.5px/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-week { position: relative; display: grid; grid-template-columns: 52px repeat(6, minmax(0, 1fr)); border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.s-wh { padding: 10px 6px; text-align: center; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); font-size: 12px; color: var(--muted); font-weight: 600; }
.s-wh b { display: block; font: 800 22px/1 var(--font-display); color: var(--text); margin-top: 2px; }
.s-wh.today b { display: inline-grid; place-items: center; min-width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); }
.s-wh:first-child { border-left: 0; }
.s-times { position: relative; }
.s-times span { position: absolute; right: 6px; font-size: 11px; color: var(--muted); transform: translateY(-50%); }
.s-day { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(180deg, transparent 0 calc(var(--hh) - 1px), var(--line) calc(var(--hh) - 1px) var(--hh)); }
.s-day.fri::after { content: "No quali calls"; position: absolute; left: 4px; right: 4px; bottom: 8px; text-align: center; font-size: 11px; color: var(--muted); }
.s-day.sat { background-color: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.s-ev { position: absolute; left: 4px; right: 4px; display: flex; flex-direction: column; gap: 1px; padding: 5px 7px; border-radius: 9px; overflow: hidden; text-align: left; font-size: 12px; transition: opacity .25s ease, transform var(--spring-dur) var(--spring), box-shadow .25s ease; }
.s-ev b { font-weight: 700; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.s-ev small { font-size: 10.5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; opacity: .8; }
.s-ev.quali { background: var(--lime-soft); box-shadow: inset 0 0 0 1px var(--lime-line); color: var(--text); }
html:not([data-theme="light"]) .s-ev.quali { color: var(--lime); }
.s-ev.closing { background: var(--accent); color: var(--on-accent); }
.s-ev.dim { opacity: .18; }
.s-ev:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.s-ev.land { animation: s-land 640ms var(--bounce) both, s-halo 2.4s ease-out; }
@keyframes s-land { 0% { opacity: 0; transform: scale(.8) translateY(-14px); } 100% { opacity: 1; transform: none; } }
@keyframes s-halo { 0% { box-shadow: 0 0 0 0 rgba(196,255,14,.7); } 100% { box-shadow: 0 0 0 14px rgba(196,255,14,0); } }
.s-nowl { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; pointer-events: none; }
.s-nowl::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.s-daylist .s-call { grid-template-columns: 64px minmax(0, 1fr); }
.s-legend2 { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.s-legend2 i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -2px; }

/* reports */
.s-report { white-space: pre-wrap; font: 500 14px/1.55 var(--font); padding: 16px; border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); overflow-wrap: anywhere; }
.s-report .wa-b { font-weight: 750; }
.s-wk { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.s-hbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 40px; gap: 10px; align-items: center; font-size: 13.5px; }
.s-hbar + .s-hbar { margin-top: 8px; }
.s-hbar .progress { height: 12px; }
.s-hbar b { text-align: right; font: 800 18px/1 var(--font-display); }

/* audit */
.s-audit-it { display: grid; grid-template-columns: 140px 120px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; align-items: center; }
.s-audit-it:last-child { border-bottom: 0; }
.s-audit-it time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }

@media (max-width: 1023px) {
  .s-hero { grid-template-columns: minmax(0, 1fr); }
  .s-target { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .s-target b { font-size: 26px; }
  .s-fstep { grid-template-columns: 104px minmax(0, 1fr) 52px; gap: 8px; }
  .s-fstep span:first-child { font-size: 12.5px; }
  .s-conv { grid-template-columns: minmax(0, 1fr); }
  .s-board-wrap, .app.sb-off .s-board-wrap { margin: 0 -16px; padding: 0 16px 8px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .s-board { grid-auto-columns: calc(100vw - 56px); }
  .s-col { scroll-snap-align: start; }
  .s-deal { cursor: pointer; }
  .s-dgrid { grid-template-columns: minmax(0, 1fr); }
  .s-dh h2 { font-size: 26px; }
  .s-cal { grid-template-columns: minmax(0, 1fr); }
  .s-wk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-audit-it { grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; }
  .s-audit-it .who { grid-column: 2; grid-row: 1; text-align: right; }
  .s-audit-it .what { grid-column: 1 / -1; }
  .s-hbar { grid-template-columns: 92px minmax(0, 1fr) 34px; }
}
@media (max-width: 380px) {
  .s-fields { grid-template-columns: minmax(0, 1fr); }
  .s-offer b { font-size: 22px; }
}

/* ---------- "Today" rings (week strip + concentric rings) ---------- */
:root { --r1: #C4FF0E; --r2: #7EDC3A; --r3: #E8FFA8; }
html[data-theme="light"] { --r1: #5E8000; --r2: #1F9D4A; --r3: #9DB817; }
.s-wkstrip { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.s-wkglide { position: absolute; top: 4px; bottom: 4px; left: 0; border-radius: 11px; background: var(--accent); transition: transform var(--spring-dur) var(--spring), width var(--spring-dur) var(--spring); }
.s-wkstrip button { position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px; min-height: 54px; padding: 6px 0 8px; border-radius: 11px; color: var(--muted); transition: color .25s ease; }
.s-wkstrip button small { font-size: 11px; font-weight: 600; }
.s-wkstrip button b { font: 800 19px/1 var(--font-display); color: var(--text); transition: color .25s ease; }
.s-wkstrip button i { width: 5px; height: 5px; border-radius: 50%; background: transparent; margin-top: 3px; }
.s-wkstrip button i.hit { background: var(--r2); }
.s-wkstrip button.on, .s-wkstrip button.on b { color: var(--on-accent); }
.s-wkstrip button.on i.hit { background: var(--on-accent); }
.s-rwrap { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 16px; }
.s-rsvg { width: 168px; height: 168px; transform: rotate(-90deg); display: block; }
.s-rsvg circle { fill: none; stroke-width: 13; stroke-linecap: round; }
.s-rsvg .trk { opacity: .16; }
.s-rsvg .val { transition: stroke-dashoffset 1.1s var(--ease); }
.s-rsvg .r1 { stroke: var(--r1); } .s-rsvg .r2 { stroke: var(--r2); } .s-rsvg .r3 { stroke: var(--r3); }
.s-rleg { display: grid; gap: 12px; min-width: 0; }
.s-rleg > div { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 8px; }
.s-rleg i { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.s-rleg .r1 i { background: var(--r1); } .s-rleg .r2 i { background: var(--r2); } .s-rleg .r3 i { background: var(--r3); }
.s-rleg span { font-size: 13px; color: var(--muted); font-weight: 600; min-width: 0; }
.s-rleg b { font: 800 30px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.s-rleg small { font-size: 13px; color: var(--muted); }
@media (max-width: 420px) {
  .s-rwrap { grid-template-columns: 132px minmax(0, 1fr); gap: 12px; }
  .s-rsvg { width: 132px; height: 132px; }
  .s-rleg > div { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .s-rleg span { grid-column: 2 / -1; font-size: 12px; }
  .s-rleg b { grid-column: 2; font-size: 26px; }
  .s-rleg small { grid-column: 3; }
}

/* ---------- Mobile floating tab bar ---------- */
.tabs-fade, .tb-scrim, .role-pop, .me-hint { display: none; }
@keyframes tb-door { 0% { transform: scaleX(1); } 25%, 60% { transform: scaleX(.18); } 100% { transform: scaleX(1); } }
@keyframes tb-ring { 0% { transform: rotate(0); } 12% { transform: rotate(-20deg); } 28% { transform: rotate(16deg); } 44% { transform: rotate(-11deg); } 60% { transform: rotate(7deg); } 76% { transform: rotate(-3deg); } 100% { transform: rotate(0); } }
@keyframes tb-beat { 0% { transform: scale(1); } 15% { transform: scale(1.4); } 32% { transform: scale(1); } 48% { transform: scale(1.28); } 70%, 100% { transform: scale(1); } }
@keyframes tb-nod { 0%, 100% { transform: translateY(0); } 22% { transform: translateY(1.6px); } 44% { transform: translateY(-.6px); } 66% { transform: translateY(1.6px); } }
@keyframes tb-bounce { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-3px); } 65% { transform: translateY(1px); } }
@keyframes tb-flip { 0% { transform: scaleY(1); } 40% { transform: scaleY(.55); } 100% { transform: scaleY(1); } }
@keyframes me-pulse { 0% { transform: scale(1); } 40% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes v-enter { from { opacity: 0; transform: translateX(var(--vx, 0)); } to { opacity: 1; transform: none; } }
@keyframes hint-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }

@media (max-width: 1023px) {
  .view.v-out { opacity: 0; transform: translateX(var(--vx, 0)); transition: opacity .13s ease-in, transform .13s ease-in; }
  .view.v-enter { animation: v-enter 350ms var(--spring) both; animation-delay: .02s; }

  .tabs {
    display: block; position: fixed; z-index: 60; left: calc(8px + var(--sal)); right: calc(8px + var(--sar)); bottom: calc(var(--sab) + 10px);
    height: 62px; padding: 0 8px; border-radius: 31px; background: var(--panel); border: 1px solid var(--line);
    box-shadow: 0 14px 40px rgba(0,0,0,.30), 0 3px 10px rgba(0,0,0,.14); font-size: 14px;
    transition: transform .5s var(--ease); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  }
  html[data-theme="light"] .tabs { box-shadow: 0 14px 40px rgba(16,20,10,.16), 0 3px 10px rgba(16,20,10,.08); }
  .tabs.hid { transform: translateY(7em); }
  .tabs-row { display: grid; grid-template-columns: auto auto 4.4em auto auto; justify-content: space-between; align-items: center; height: 100%; }
  .tab-gap { width: 4.4em; }
  .tab {
    position: relative; display: inline-flex; align-items: center; height: 44px; min-width: 44px; padding: 0 10px; border-radius: 22px;
    color: var(--muted); transition: background-color .3s ease, color .3s ease, transform .2s ease; touch-action: manipulation; -webkit-touch-callout: none;
  }
  .tab.on { background: var(--lime); color: #0A0A0A; padding: 0 14px 0 12px; }
  .tab-ic { position: relative; display: grid; place-items: center; width: 24px; height: 24px; flex: none; }
  .tab-ic svg { width: 24px; height: 24px; overflow: visible; }
  .tab-lw { display: grid; grid-template-columns: 0fr; transition: grid-template-columns var(--spring-dur) var(--spring); }
  .tab-lw > span { min-width: 0; overflow: hidden; white-space: nowrap; font-weight: 600; font-size: 14px; padding-left: 0; transition: padding-left var(--spring-dur) var(--spring); }
  .tab.on .tab-lw { grid-template-columns: 1fr; }
  .tab.on .tab-lw > span { padding-left: 6px; }

  /* icon micro animations (once, when the tab turns on) */
  .tab .ai * { transform-box: fill-box; }
  .tab.on .ai-door .dr { transform-origin: 0 100%; animation: tb-door 1.1s var(--ease); }
  .tab.on .ai-bell { transform-origin: 50% 8%; animation: tb-ring 1s ease-out; }
  .tab .ai-beat .fl { fill: currentColor; fill-opacity: 0; transition: fill-opacity .3s ease; }
  .tab.on .ai-beat .fl { fill-opacity: .9; }
  .tab.on .ai-beat { animation: tb-beat .9s ease; }
  .tab.on .ai-bars > *, .tab.on .ai-kanban > * { transform-origin: 50% 100%; animation: ai-grow .65s var(--bounce) both; }
  .tab.on .ai-bars > *:nth-child(2), .tab.on .ai-kanban > *:nth-child(2) { animation-delay: .08s; }
  .tab.on .ai-bars > *:nth-child(3), .tab.on .ai-kanban > *:nth-child(3) { animation-delay: .16s; }
  .tab.on .ai-cal .rg { animation: tb-bounce .6s var(--bounce); }
  .tab.on .ai-cal .rg:last-of-type { animation-delay: .08s; }
  .tab.on .ai-cal .pg { transform-origin: 50% 0; animation: tb-flip .7s var(--ease); }
  .tab.on .ai-tick .tk { stroke-dasharray: 1; animation: ai-draw .7s var(--ease) both; }
  .tab.on .ai-pop { animation: ai-pop .7s var(--bounce); }

  /* count badge with odometer */
  .bd {
    position: absolute; top: -.55em; right: -.7em; z-index: 2; display: grid; place-items: center; min-width: 1.8em; height: 1.8em; padding: 0 .45em;
    border-radius: .9em; background: #FF3B30; color: #fff; font: 700 11px/1.8em var(--font); box-shadow: 0 0 0 .22em var(--panel);
    transform: scale(0); transition: transform .2s ease-in; pointer-events: none;
  }
  .bd.in { transform: scale(1); transition: transform 594ms var(--bounce); }
  .bd .nm { display: block; height: 1.8em; overflow: hidden; }
  .bd .cl { display: flex; flex-direction: column; transition: transform .45s var(--ease); }
  .bd .cl i { display: block; height: 1.8em; line-height: 1.8em; font-style: normal; text-align: center; }
  .bd .cl.roll { transform: translateY(-1.8em); }
  .bd.dot { min-width: 0; width: .85em; height: .85em; padding: 0; top: -.15em; right: -.15em; }
  .tab.on .bd { box-shadow: 0 0 0 .22em var(--lime); }

  /* Me tab */
  .tab-me { padding: 0 6px; }
  .tab-me .tab-ic { width: 1.9em; height: 1.9em; }
  .me-av { display: grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; background: var(--panel-2); color: var(--text); font: 800 12px/1 var(--font-display); letter-spacing: .03em; box-shadow: 0 0 0 .15em var(--panel), 0 0 0 .3em var(--line); transition: background-color .25s ease, color .25s ease; }
  .tab-me.open .me-av { background: var(--lime); color: #0A0A0A; }
  .tab-me.hold { transform: scale(.9); }
  .tab-me .hp { position: absolute; left: 22%; right: 22%; bottom: .45em; height: .22em; border-radius: 2px; background: var(--lime); transform: scaleX(0); transform-origin: left; }
  .tab-me.hold .hp { transform: scaleX(1); transition: transform 450ms linear; }
  .tab-me.pulse .me-av { animation: me-pulse .5s var(--bounce); }

  /* centre + and its fan */
  .fab {
    position: absolute; left: 50%; top: -1.5em; z-index: 3; width: 3.8em; height: 3.8em; margin-left: -1.9em; border-radius: 50%;
    display: grid; place-items: center; background: var(--lime); color: #0A0A0A;
    box-shadow: 0 .6em 1.2em rgba(196,255,14,.32), 0 0 0 .45em var(--panel); transition: transform .15s ease;
  }
  .fab:active { transform: scale(.94); }
  .fab svg { width: 1.9em; height: 1.9em; transition: transform 594ms var(--bounce); }
  .tabs.open .fab svg { transform: rotate(135deg); }
  .fab-acts { position: absolute; left: 50%; top: -1.5em; width: 0; height: 0; z-index: 2; }
  .fa {
    position: absolute; left: -1.85em; top: .4em; width: 3.7em; height: 3.7em; border-radius: 50%; display: grid; place-items: center;
    background: var(--panel); color: var(--accent-text); box-shadow: var(--shadow), 0 0 0 1px var(--line);
    opacity: 0; transform: scale(.3); pointer-events: none; transition: transform 594ms var(--bounce), opacity .2s ease;
  }
  .fa svg { width: 1.5em; height: 1.5em; }
  .fa small { position: absolute; top: calc(100% + .35em); left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 999px; background: var(--panel); color: var(--text); box-shadow: 0 0 0 1px var(--line); font-size: 12px; font-weight: 650; }
  .tabs.open .fa { opacity: 1; pointer-events: auto; }
  .tabs.open .fa.a1 { transform: translate(-5.2em, -3em); }
  .tabs.open .fa.a2 { transform: translate(0, -6em); transition-delay: .04s; }
  .tabs.open .fa.a3 { transform: translate(5.2em, -3em); transition-delay: .08s; }

  .tabs-fade { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 49; height: calc(var(--sab) + 104px); pointer-events: none; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 92%, transparent) 62%); }
  .tb-scrim { display: block; position: fixed; inset: 0; z-index: 58; background: rgba(0,0,0,.6); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .tb-scrim.pop-scrim { transition-duration: .25s; }
  html[data-theme="light"] .tb-scrim { background: rgba(255,255,255,.72); }
  html[data-theme="light"] .tb-scrim.pop-scrim { background: rgba(255,255,255,.7); }
  .tb-scrim.on { opacity: 1; pointer-events: auto; }

  /* long-press role popover */
  .role-pop {
    display: block; position: fixed; z-index: 61; right: calc(10px + var(--sar)); bottom: calc(var(--sab) + 82px); width: 12.2em; font-size: 15px;
    padding: .4em; border-radius: 1.4em; background: var(--panel); box-shadow: var(--shadow-lg), 0 0 0 1px var(--line);
    transform-origin: 86% 100%; transform: scale(.5); opacity: 0; pointer-events: none; transition: transform 594ms var(--bounce), opacity .2s ease;
  }
  .role-pop.on { transform: none; opacity: 1; pointer-events: auto; }
  .rp-row { display: flex; align-items: center; gap: .6em; width: 100%; min-height: 46px; padding: .35em .4em; border-radius: 1em; text-align: left; }
  .rp-row:hover, .rp-row:focus-visible { background: var(--hover); }
  .rp-av { flex: none; display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; background: var(--panel-2); color: var(--text); font: 800 13px/1 var(--font-display); box-shadow: inset 0 0 0 1px var(--line); }
  .rp-row[aria-checked="true"] .rp-av { background: var(--lime); color: #0A0A0A; box-shadow: none; }
  .rp-row p { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .rp-row b { font-size: 14px; font-weight: 600; }
  .rp-row small { font-size: 12px; color: var(--muted); }
  .rp-tick { flex: none; display: grid; place-items: center; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--lime); color: #0A0A0A; transform: scale(.5); opacity: 0; transition: transform 594ms var(--bounce), opacity .2s ease; }
  .rp-row[aria-checked="true"] .rp-tick { transform: none; opacity: 1; }
  .rp-foot { margin-top: .3em; padding: .6em .6em .35em; border-top: 1px solid var(--line); font: 700 12px/1 var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }

  .me-hint { display: block; position: fixed; z-index: 62; right: calc(14px + var(--sar)); bottom: calc(var(--sab) + 84px); padding: 8px 12px; border-radius: 12px; background: var(--lime); color: #0A0A0A; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-lg); animation: hint-in .5s var(--bounce) both; transition: opacity .3s ease; }
  .me-hint::after { content: ""; position: absolute; right: 18px; bottom: -6px; width: 12px; height: 12px; background: var(--lime); transform: rotate(45deg); border-radius: 2px; }
  .me-hint.out { opacity: 0; }
}
@media (min-width: 1024px) { .tabs-fade, .tb-scrim, .role-pop, .me-hint { display: none !important; } }



/* ===== Hero card motion (weekly closes banner) ===== */
.hero-anim { animation: heroGrid 14s linear infinite; }
@keyframes heroGrid {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to   { background-position: 0 0, 0 0, 100px 0, 0 82px, 248px 248px, 0 0; }
}
.hero-anim::before {
  content: ""; position: absolute; inset: -20% -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(196,255,14,.13) 50%, transparent 58%);
  animation: heroSheen 5.5s cubic-bezier(.32,.72,0,1) infinite 1.2s; transform: translateX(-70%);
}
@keyframes heroSheen { 0% { transform: translateX(-70%); } 55%, 100% { transform: translateX(70%); } }
.hero-anim > .eyebrow, .hero-anim > h2, .hero-anim > p, .hero-anim .s-target > div, .hero-anim .hero-prog {
  animation: heroIn .7s cubic-bezier(.22,1,.36,1) both;
}
.hero-anim > h2 { animation-delay: .08s; }
.hero-anim > p { animation-delay: .16s; }
.hero-anim .s-target > div:nth-child(1) { animation-delay: .24s; }
.hero-anim .s-target > div:nth-child(2) { animation-delay: .31s; }
.hero-anim .s-target > div:nth-child(3) { animation-delay: .38s; }
.hero-anim .s-target > div:nth-child(4) { animation-delay: .45s; }
.hero-anim .hero-prog { animation-delay: .55s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.hero-anim .hero-num { display: inline-block; min-width: 1.1ch; font: inherit; color: inherit; animation: heroPop .9s cubic-bezier(.34,1.56,.64,1) .2s both; }
@keyframes heroPop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-anim .eyebrow { display: inline-flex; align-items: center; gap: 8px; }
.hero-live { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.hero-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lime); animation: heroPing 1.8s ease-out infinite; }
@keyframes heroPing { 0% { opacity: .55; transform: scale(1); } 80%, 100% { opacity: 0; transform: scale(2.8); } }
.hero-anim .s-target > div { transition: transform .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, background-color .3s ease; }
.hero-anim .s-target > div:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(196,255,14,.45), 0 10px 24px rgba(0,0,0,.35); }
.hero-anim .s-target > div.hl { animation: heroIn .7s cubic-bezier(.22,1,.36,1) .38s both, heroGlow 2.6s ease-out 1.2s infinite; }
@keyframes heroGlow { 0% { box-shadow: 0 0 0 0 rgba(196,255,14,.55); } 70%, 100% { box-shadow: 0 0 0 12px rgba(196,255,14,0); } }
.hero-prog { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 12.5px; color: rgba(245,245,245,.75); }
.hero-bar { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.hero-bar i {
  display: block; height: 100%; width: var(--p); border-radius: inherit; transform-origin: 0 50%;
  background: repeating-linear-gradient(115deg, var(--lime) 0 10px, #A8E000 10px 20px); background-size: 200% 100%;
  animation: heroFill 1.3s cubic-bezier(.22,1,.36,1) .7s both, heroStripe 1.6s linear infinite;
}
@keyframes heroFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes heroStripe { to { background-position: -40px 0; } }
@media (max-width: 1023px) { .hero-prog { font-size: 12px; } }
@media (prefers-reduced-motion: reduce) {
  .hero-anim, .hero-anim::before, .hero-anim *, .hero-live::after { animation: none !important; }
}

/* ---------- Snackbar with Undo (replaces the simple one) ---------- */
.snack {
  position: fixed; z-index: 9050; left: 10px; right: 10px; bottom: calc(var(--tabs-h) + var(--sab) + 10px);
  display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 6px 6px 16px; border-radius: 12px; overflow: hidden;
  background: #0A0A0A; color: #F5F5F5; font-size: 14px; font-weight: 600; box-shadow: 0 12px 30px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(190%); transition: transform 560ms cubic-bezier(.32,.72,0,1), opacity .3s ease; touch-action: pan-y; max-width: none;
}
html[data-theme="dark"] .snack { background: #1C1C1C; box-shadow: 0 12px 30px rgba(0,0,0,.5), 0 0 0 1px #2E2E2E; }
.snack.on { opacity: 1; transform: none; }
.snack .snack-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snack .snack-b { flex: none; height: 36px; padding: 0 12px; border-radius: 9px; color: var(--lime); font-weight: 800; }
.snack .snack-b:hover { background: rgba(255,255,255,.08); }
.snack-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--lime); transform-origin: left; animation: snack-bar linear forwards; }
@keyframes snack-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (min-width: 1024px) { .snack { left: calc(50% - 220px); right: auto; width: 440px; bottom: 28px; } }

/* ---------- Action sheet ---------- */
html.ash-open, html.ash-open body { background: #0A0A0A; }
.ash-frame { position: fixed; inset: 0; z-index: 8290; pointer-events: none; border-radius: 22px; box-shadow: 0 0 0 200vmax #0A0A0A; transform: scale(1); transform-origin: 50% 60%; opacity: 0; transition: transform 620ms cubic-bezier(.32,.72,0,1), opacity .2s ease; }
.ash-frame.on { transform: scale(.92); opacity: 1; }
.ash-scrim { position: fixed; inset: 0; z-index: 8300; background: rgba(0,0,0,.35); opacity: 0; transition: opacity 420ms ease; }
.ash-scrim.on { opacity: 1; }
.ash { position: fixed; z-index: 8310; left: 8px; right: 8px; bottom: calc(14px + var(--sab)); display: grid; gap: 8px; transform: translateY(112%); transition: transform 620ms cubic-bezier(.32,.72,0,1); }
.ash.on { transform: none; }
.ash-card, .ash-cancel { border-radius: 14px; background: color-mix(in srgb, var(--panel) 96%, transparent); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); overflow: hidden; }
.ash-card { max-height: calc(100dvh - 140px); overflow-y: auto; }
.ash-h { display: grid; gap: 2px; padding: 12px 16px; text-align: center; border-bottom: 1px solid var(--line); }
.ash-h b { font-size: 13px; font-weight: 600; color: var(--muted); }
.ash-h small { font-size: 12.5px; color: var(--muted); }
.ash-b { position: relative; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; padding: 0 16px; font-size: 17px; font-weight: 500; color: var(--accent-text); }
.ash-b + .ash-b { border-top: 1px solid var(--line); }
.ash-b:active { background: var(--hover); }
.ash-b.danger { color: #FF3B30; }
.ash-b.checked { font-weight: 700; }
.ash-ic { position: absolute; left: 16px; display: grid; place-items: center; }
.ash-ic svg { width: 20px; height: 20px; }
.ash-tick { position: absolute; right: 16px; display: grid; place-items: center; }
.ash-tick svg { width: 18px; height: 18px; }
.ash-cancel { width: 100%; height: 56px; font-size: 17px; font-weight: 750; color: var(--text); }

/* ---------- Pull to refresh ---------- */
.ptr { position: relative; height: 0; z-index: 1; pointer-events: none; }
.ptr-bars { position: absolute; left: 50%; top: 4px; display: flex; gap: 4px; transform: translateX(-50%); opacity: 0; transition: opacity .15s ease; }
.ptr-on .ptr-bars, .ptr.loading .ptr-bars { opacity: 1; }
.ptr-bars i { display: block; width: 3px; height: 18px; border-radius: 2px; background: var(--lime); opacity: .25; transform: scaleY(.3); }
html[data-theme="light"] .ptr-bars i { background: #5E8000; }
.ptr.loading .ptr-bars i { animation: ptr-wave 760ms ease-in-out infinite alternate; }
.ptr.loading .ptr-bars i:nth-child(2) { animation-delay: 90ms; }
.ptr.loading .ptr-bars i:nth-child(3) { animation-delay: 180ms; }
.ptr.loading .ptr-bars i:nth-child(4) { animation-delay: 270ms; }
.ptr.loading .ptr-bars i:nth-child(5) { animation-delay: 360ms; }
@keyframes ptr-wave { from { transform: scaleY(.35); opacity: .6; } to { transform: scaleY(1); opacity: 1; } }
.ptr-on > :not(.page-head):not(.ptr) { transform: translateY(var(--pull, 0)); }
.sw.land { animation: land-rows 520ms cubic-bezier(.32,.72,0,1) both; }
.sw.land .sw-fg, .s-deal.land, .ld-row.land { animation: land-tint 1.6s ease both; }
.sw.land .sw-fg > *, .s-deal.land > * { animation: land-fade .4s ease .14s both; }
.s-deal.land { animation: land-tint 1.6s ease both, land-h 520ms cubic-bezier(.32,.72,0,1) both; overflow: hidden; }
@keyframes land-rows { from { grid-template-rows: 0fr; } to { grid-template-rows: 1fr; } }
@keyframes land-h { from { max-height: 0; padding-top: 0; padding-bottom: 0; } to { max-height: 200px; } }
@keyframes land-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes land-tint { 0%, 40% { background-color: var(--lime-soft); } 100% { background-color: var(--panel); } }
.new-chip { display: inline-grid; place-items: center; height: 18px; padding: 0 6px; border-radius: 6px; background: var(--lime); color: #0A0A0A; font: 800 10.5px/1 var(--font); letter-spacing: .04em; vertical-align: 2px; margin-left: 4px; }

/* ---------- Wheel time picker ---------- */
.tp-read { font: 800 28px/1.1 var(--font-display); text-align: center; letter-spacing: .02em; margin: 2px 0 14px; }
.tp-wheel { position: relative; display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 4px; height: 170px; border-radius: 16px; background: var(--panel-2); overflow: hidden; }
.tp-band { position: absolute; left: 6px; right: 6px; top: 68px; height: 34px; border-radius: 10px; background: rgba(196,255,14,.12); pointer-events: none; }
html[data-theme="light"] .tp-band { background: #0A0A0A; }
.tp-col { position: relative; height: 170px; overflow-y: auto; scroll-snap-type: y mandatory; perspective: 190px; touch-action: pan-y; scrollbar-width: none; overscroll-behavior: contain; -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); }
.tp-col::-webkit-scrollbar { display: none; }
.tp-col:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.tp-pad { height: 68px; }
.tp-it { height: 34px; display: grid; place-items: center; scroll-snap-align: center; font: 600 17px/1 var(--font); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; transform-origin: 50% 50%; }
.tp-it.sel { color: var(--lime); font-weight: 750; }
html[data-theme="light"] .tp-it.sel { color: var(--lime); }
.tp-it.off { text-decoration: line-through; color: var(--muted); }
.tp-note { margin-top: 10px; font-size: 13px; color: var(--muted); text-align: center; }
.btn-lime { background: var(--lime); color: #0A0A0A; box-shadow: none; }
.btn-lime:hover { background: var(--lime); filter: brightness(1.05); }

/* ---------- Slide to confirm ---------- */
.slc { position: relative; height: 56px; border-radius: 28px; background: rgba(196,255,14,.15); overflow: hidden; user-select: none; -webkit-user-select: none; }
html[data-theme="light"] .slc { background: #EEF6D0; }
.slc-fill { position: absolute; inset: 0; background: var(--lime); border-radius: 28px; transition: background-color .35s ease; }
.slc.ok .slc-fill { background: #22C55E; }
.slc-lbl { position: absolute; left: 60px; right: 12px; top: 0; bottom: 0; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: transparent;
  background: linear-gradient(90deg, var(--muted) 0%, var(--muted) 40%, var(--text) 50%, var(--muted) 60%, var(--muted) 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; animation: slc-shine 2.6s linear infinite; pointer-events: none; }
@keyframes slc-shine { from { background-position: 110% 0; } to { background-position: -110% 0; } }
.slc-done { position: absolute; left: 18px; top: 0; bottom: 0; display: flex; align-items: center; font-weight: 800; color: #0A0A0A; opacity: 0; transition: opacity .3s ease .15s; pointer-events: none; max-width: calc(100% - 80px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slc.ok .slc-done { opacity: 1; }
.slc-knob { position: absolute; left: 3px; top: 4px; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: #0A0A0A; box-shadow: 0 2px 8px rgba(0,0,0,.25); touch-action: none; display: grid; place-items: center; z-index: 2; }
.slc-knob span { grid-area: 1 / 1; display: grid; place-items: center; transition: opacity .25s ease, transform 594ms var(--bounce); }
.slc-knob svg { width: 22px; height: 22px; }
.slc-tick { opacity: 0; transform: scale(.4); color: #16A34A; }
.slc.ok .slc-arrow { opacity: 0; transform: scale(.4); }
.slc.ok .slc-tick { opacity: 1; transform: none; }
.won-card { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: var(--panel-2); margin-bottom: 14px; }
.won-card .row b { font-size: 16px; }
.won-amt { font: 800 44px/1 var(--font-display); }
.won-rows { display: grid; gap: 6px; font-size: 14px; }
.won-rows div { display: flex; justify-content: space-between; gap: 10px; }
.won-rows span:first-child { color: var(--muted); }
.won-pill { position: relative; display: inline-grid; height: 24px; min-width: 74px; }
.won-pill span { grid-area: 1 / 1; display: grid; place-items: center; padding: 0 10px; border-radius: 999px; font-size: 12.5px; font-weight: 750; transition: opacity .35s ease, transform .5s var(--bounce); }
.won-pill .p1 { background: rgba(245,158,11,.16); color: #B45309; }
html[data-theme="dark"] .won-pill .p1 { color: #FBBF24; }
.won-pill .p2 { background: #22C55E; color: #0A0A0A; opacity: 0; transform: scale(.7); }
.won-card.ok .won-pill .p1 { opacity: 0; transform: scale(.7); }
.won-card.ok .won-pill .p2 { opacity: 1; transform: none; }

/* ---------- Live activity island ---------- */
.isl { display: none; }
@media (max-width: 1023px) {
  .isl {
    display: block; position: fixed; z-index: 8150; top: calc(var(--sat) + 6px); left: 10px; right: 10px; height: 96px; border-radius: 28px;
    background: #0A0A0A; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); cursor: pointer; -webkit-tap-highlight-color: transparent;
    clip-path: inset(0 calc((100% - 110px) / 2) calc(100% - 34px) calc((100% - 110px) / 2) round 17px);
    transition: clip-path 640ms var(--bounce), transform 600ms var(--bounce), opacity .3s ease; transform: scale(.6); transform-origin: 50% 17px; opacity: 0; pointer-events: none;
  }
  .isl.in { transform: none; opacity: 1; pointer-events: auto; }
  .isl.open { clip-path: inset(0 0 0 0 round 28px); }
  .isl:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--lime); }
  .isl-c { position: absolute; left: 50%; top: 0; width: 110px; height: 34px; margin-left: -55px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; transition: opacity 120ms ease; }
  .isl.open .isl-c { opacity: 0; }
  .isl-ci { display: grid; place-items: center; color: #fff; }
  .isl-ci svg { width: 15px; height: 15px; }
  .isl-cv { font: 800 14px/1 var(--font-display); color: var(--lime); letter-spacing: .03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .isl-x { position: absolute; inset: 0; padding: 14px 16px 12px; display: grid; gap: 10px; align-content: start; opacity: 0; transform: scale(.94); transition: opacity 120ms ease, transform 300ms ease; }
  .isl.open .isl-x { opacity: 1; transform: none; transition: opacity 300ms ease 160ms, transform 600ms var(--bounce) 120ms; }
  .isl-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
  .isl-tile { flex: none; width: 34px; height: 34px; border-radius: 9px; background: var(--lime); color: #0A0A0A; display: grid; place-items: center; }
  .isl-tile svg { width: 18px; height: 18px; }
  .isl-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .isl-tt b { font-size: 14.5px; font-weight: 600; color: #fff; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .isl-tt small { font-size: 12.5px; color: rgba(255,255,255,.6); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .isl-v { flex: none; font: 800 26px/1 var(--font-display); color: var(--lime); font-variant-numeric: tabular-nums; }
  .isl-row { display: flex; align-items: center; gap: 10px; }
  .isl-prog { position: relative; flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.22); }
  .isl-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--lime); }
  .isl-dot { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #0A0A0A; }
  .isl-acts { display: flex; gap: 6px; flex: none; }
  .isl-acts span { height: 26px; padding: 0 10px; border-radius: 999px; background: var(--lime); color: #0A0A0A; font-size: 12px; font-weight: 750; display: inline-grid; place-items: center; white-space: nowrap; }
  .isl-rec { width: 9px; height: 9px; border-radius: 50%; background: #FF3B30; animation: isl-blink 1.2s ease-in-out infinite; }
  @keyframes isl-blink { 50% { opacity: .35; } }
  .isl-spin { display: flex; gap: 2px; align-items: center; height: 14px; }
  .isl-spin i { width: 2.5px; height: 12px; border-radius: 2px; background: var(--lime); animation: ptr-wave 700ms ease-in-out infinite alternate; }
  .isl-spin i:nth-child(2) { animation-delay: 90ms; } .isl-spin i:nth-child(3) { animation-delay: 180ms; }
}

/* ---------- Segmented control with sliding thumb ---------- */
.seg.sg { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 2px; gap: 0; border-radius: 9px; background: var(--panel-2); touch-action: none; overflow: hidden; }
.seg.sg > button { position: relative; z-index: 1; border-radius: 7px; background: transparent !important; box-shadow: none !important; padding: 0 12px; }
.seg.sg > button.on { color: var(--text); }
.sg-thumb { position: absolute; left: 2px; top: 2px; bottom: 2px; border-radius: 7px; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 3px 8px rgba(0,0,0,.08); pointer-events: none; }
html[data-theme="dark"] .sg-thumb { background: var(--lime); }
html[data-theme="dark"] .seg.sg > button.on { color: #0A0A0A; }

/* ---------- Long-press reorder ---------- */
.ro-row { position: absolute !important; left: 0; right: 0; transition: transform 420ms cubic-bezier(.22,1,.36,1); touch-action: pan-y; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.ro-row.drag { transition: none; z-index: 20; }
.ro-row.lift { background: var(--panel) !important; box-shadow: 0 12px 28px rgba(0,0,0,.22), inset 0 0 0 1.5px var(--lime); border-radius: 12px; animation: ro-lift 420ms var(--bounce) both; }
@keyframes ro-lift { from { scale: 1; } to { scale: 1.04; } }
.ro-row.lift:not(.drag) { animation: none; scale: 1; }
.ro-grip { display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; margin-left: 6px; flex: none; opacity: .5; }
.ro-grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); }

/* ---------- Carousel ---------- */
.car-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; touch-action: pan-x pan-y; scrollbar-width: none; overscroll-behavior-x: contain; }
.car-track::-webkit-scrollbar { display: none; }
.car-track > * { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; }
.car-dots { display: flex; justify-content: center; margin-top: 10px; }
.car-dot { width: 26px; height: 22px; display: grid; place-items: center; margin: 0 -2px; }
.car-dot i { display: block; width: 18px; height: 6px; border-radius: 3px; background: var(--lime); }
html[data-theme="light"] .car-dot i { background: #0A0A0A; }
.dash-car .car-track > section { padding: 0 2px; }


/* ===== Calendar readability fix (17/11) ===== */
.s-wh.today b { display: grid; margin: 4px auto 0; width: 36px; }
.s-ev { padding: 6px 8px 6px 11px; gap: 2px; font-size: 12.5px; z-index: 2; }
.s-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: currentColor; }
.s-ev b { font-size: 13px; line-height: 1.2; }
.s-ev small { font-size: 11px; opacity: 1; font-weight: 600; }
/* qualification calls: solid dark card, white name, lime time + lime edge */
.s-ev.quali, html:not([data-theme="light"]) .s-ev.quali { background: #1F2A06; box-shadow: inset 0 0 0 1px rgba(196,255,14,.55); color: var(--lime); }
.s-ev.quali b, html:not([data-theme="light"]) .s-ev.quali b { color: #FFFFFF; }
html[data-theme="light"] .s-ev.quali { background: #0A0A0A; color: var(--lime); box-shadow: none; }
html[data-theme="light"] .s-ev.quali b { color: #FFFFFF; }
/* closing calls with Jake: solid lime, black text */
.s-ev.closing { background: var(--lime); color: #0A0A0A; box-shadow: 0 2px 10px rgba(196,255,14,.25); }
.s-ev.closing::before { background: #0A0A0A; opacity: .5; }
.s-ev.closing b, .s-ev.closing small { color: #0A0A0A; }
/* filtered-out callers: faded but still readable */
.s-ev.dim { opacity: .35; filter: grayscale(.6); }
.s-ev.dim:hover { opacity: .8; }

/* ===== Chip rows: never look cut off (17/11) ===== */
.chips[data-buckets] { flex-wrap: wrap; overflow: visible; }
.chips[data-buckets] .chip { white-space: nowrap; }
@media (max-width: 1023px) {
  /* on phones chip rows scroll sideways: fade the edge so it reads as "swipe for more" */
  .chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 24px; }
  .chips[data-buckets] { flex-wrap: nowrap; overflow-x: auto; }
}

/* ===== Fix 17/11: list + detail pages stuck (no scroll) when the list sits inside a wrapper (Members) ===== */
@media (min-width: 1024px) {
  .view.ld-mode { overflow-y: auto; }
  /* every wrapper between the view and the list/detail grid passes the height down */
  .view.ld-mode *:has(.ld) { display: flex; flex-direction: column; flex: 1 0 auto; min-height: 0; }
  .view.ld-mode *:has(.ld) > :not(.ld):not(:has(.ld)) { flex: none; }
  /* the panes always get a usable height and scroll on their own */
  .view.ld-mode .ld { flex: 1 0 auto; min-height: max(460px, calc(100dvh - 140px)); height: calc(100dvh - 140px); }
  .ld-list, .ld-detail { min-height: 0; }
  .ld-rows, .ld-detail { overflow-y: auto; overscroll-behavior: contain; }
}
/* Joe's mark is a near-square tile with small rounded corners (logo file 17/11) */
.mark { border-radius: 6px; }
.splash .mark { border-radius: 12px; }

/* QA 17/11: charts never balloon on wide screens */
.s-chart svg { display: block; width: 100%; height: auto; max-height: 300px; margin: 0 auto; }

/* QA 17/11: one scrollbar only on desktop. The page itself never scrolls; only the content pane does. */
@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden !important; }
  .app { height: 100vh; height: 100dvh; }
}
.sr { position: fixed !important; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* QA 17/11: phone tab bar = left group | + | right group, so the expanding label never slides under the + */
@media (max-width: 1023px) {
  .tabs-row { display: grid !important; grid-template-columns: minmax(0, 1fr) 4.4em minmax(0, 1fr) !important; justify-content: stretch !important; }
  .tabs-grp { display: flex; align-items: center; justify-content: space-evenly; min-width: 0; height: 100%; }
  .tabs-grp .tab { flex: none; }
  .tabs-grp .tab-lw > span { display: block; max-width: 70px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
}
/* hero mark on phones: smaller, to the right, behind the cards, so the headline stays readable */
@media (max-width: 1023px) {
  .hero-sun { left: auto !important; right: 4%; transform: none !important; top: auto !important; bottom: 34%; width: 34% !important; opacity: .45; animation: none !important; }
}
/* QA 17/11: swipe actions stay hidden until the row actually moves (no coloured slivers at the row edges) */
.sw:not(.moving) .sw-l, .sw:not(.moving) .sw-full, .sw:not(.moving) .sw-rs { visibility: hidden; }
/* QA 17/11: the live island owns the top-centre spot; hide the small bar title while it is showing */
@media (max-width: 1023px) { body:has(.isl.in) .tb-title { opacity: 0 !important; visibility: hidden; } }

/* QA 17/11: light mode selected segment = black thumb, lime label (brand, high contrast) */
html[data-theme="light"] .sg-thumb { background: #0A0A0A !important; box-shadow: 0 2px 8px rgba(0,0,0,.18) !important; }
html[data-theme="light"] .sg > button.on { color: #C4FF0E !important; }
/* Inbox tab: a message drops into the tray when selected */
.tab.on .ai-tray .lt { animation: tb-drop .9s cubic-bezier(.34,1.56,.64,1); }
.tab.on .ai-tray { animation: tb-tray .9s ease-out; transform-origin: 50% 100%; }
@keyframes tb-drop { 0% { transform: translateY(-7px); opacity: 0; } 45% { transform: translateY(4px); opacity: 1; } 70% { transform: translateY(1px); } 100% { transform: none; } }
@keyframes tb-tray { 0%, 40% { transform: none; } 55% { transform: scaleY(.88); } 80% { transform: scaleY(1.04); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .tab.on .ai-tray, .tab.on .ai-tray .lt { animation: none; } }

/* iPhone fix 17/11: the page itself can never pan sideways */
@media (max-width: 1023px) {
  html, body { overflow-x: hidden; max-width: 100%; overscroll-behavior-x: none; }
  .app { overflow-x: clip; max-width: 100vw; }
}

/* Phones: no fake Dynamic Island. Live activity shows as a card at the top of the page (+ real notification). */
@media (max-width: 1023px) { .isl { display: none !important; } }
.live-card { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 16px; background: #0A0A0A; color: #F5F5F5; box-shadow: 0 10px 24px -12px rgba(0,0,0,.45); animation: lc-in .5s cubic-bezier(.22,1,.36,1) both; }
.live-card .lc-tile { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 11px; background: #C4FF0E; color: #0A0A0A; }
.live-card .lc-tile svg { width: 20px; height: 20px; }
.live-card .lc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.live-card .lc-t b { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card .lc-t small { font-size: 12.5px; color: rgba(245,245,245,.65); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card .lc-v { font: 800 20px/1 var(--font-display); color: #C4FF0E; }
.live-card .lc-acts { display: flex; gap: 8px; width: 100%; }
.live-card .lc-acts button { flex: 1; height: 40px; border-radius: 11px; background: rgba(255,255,255,.1); color: #F5F5F5; font-weight: 650; font-size: 13.5px; }
.live-card .lc-acts button:first-child { background: #C4FF0E; color: #0A0A0A; }
@keyframes lc-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .live-card { animation: none; } }
/* any touch phone/tablet: never the fake island */
@media (hover: none) and (pointer: coarse) { .isl { display: none !important; } }

/* iPhone 17/11: inputs under 16px make iOS auto-zoom, and the zoom sticks in the installed app (page looked too big / cut off).
   16px on every field = no auto-zoom on any phone. */
@media (max-width: 1023px) {
  input, select, textarea, [contenteditable="true"], [contenteditable="plaintext-only"] { font-size: 16px !important; }
}
