/* Focus Ledger — design tokens follow the Puysh UI kit (surface layers, hairline borders, accent glow). */
:root, :root.dark {
  --bg: #0a0a0c; --bg-subtle: #0e0e11; --surface: #141417; --surface-2: #1b1b1f; --surface-3: #25252a;
  --border: rgba(255,255,255,.075); --border-strong: rgba(255,255,255,.14);
  --text: #f5f5f7; --muted: #a1a1a8; --faint: #66666e;
  --accent: #4fe08a; --accent-fill: #3fd27b; --accent-fill-hover: #5ade90; --accent-strong: #3fd27b;
  --accent-soft: rgba(63,210,123,.13); --accent-text: #6be79f; --on-accent: #03140a;
  --success: #4fe08a; --warning: #ffb547; --warning-soft: rgba(255,181,71,.13); --danger: #ff5c5c; --danger-soft: rgba(255,92,92,.12);
  --info: #6aa2ff; --scrim: rgba(0,0,0,.6);
  --sheen: inset 0 1px 0 rgba(255,255,255,.045);
  --shadow-lg: 0 24px 60px -12px rgba(0,0,0,.65);
  --cell-empty: rgba(255,255,255,.025);
  color-scheme: dark;
}
:root.light {
  --bg: #f5f5f7; --bg-subtle: #fbfbfd; --surface: #ffffff; --surface-2: #f2f2f5; --surface-3: #e7e7ec;
  --border: rgba(0,0,0,.08); --border-strong: rgba(0,0,0,.15);
  --text: #1d1d1f; --muted: #6e6e73; --faint: #a1a1a6;
  --accent: #1fbf62; --accent-fill: #1aae58; --accent-fill-hover: #17a050; --accent-strong: #1aae58;
  --accent-soft: rgba(26,174,88,.11); --accent-text: #0f8a42; --on-accent: #ffffff;
  --success: #12a150; --warning: #c77800; --warning-soft: rgba(199,120,0,.1); --danger: #e5343a; --danger-soft: rgba(229,52,58,.09);
  --info: #2f6fe0; --scrim: rgba(0,0,0,.35);
  --sheen: 0 1px 2px rgba(0,0,0,.04);
  --shadow-lg: 0 24px 60px -16px rgba(0,0,0,.25);
  --cell-empty: rgba(0,0,0,.018);
  color-scheme: light;
}
:root {
  --r-card: 18px; --r-sheet: 22px; --r-input: 11px; --side: 236px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 15px; height: 15px; }
.tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .xs { font-size: 11.5px; }
.green, .up { color: var(--success); } .red, .down { color: var(--danger); } .amber { color: var(--warning); }
.row { display: flex; gap: 8px; align-items: center; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 750; letter-spacing: -.02em; }

/* ---------- form controls ---------- */
input, select, textarea {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-input);
  padding: 0 11px; height: 38px; width: 100%; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { padding: 9px 11px; height: auto; min-height: 60px; resize: vertical; line-height: 1.4; }
input:focus, select:focus, textarea:focus { border-color: var(--accent-strong); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input.bare { background: transparent; border-color: transparent; padding: 0 4px; height: 34px; }
input.bare:hover { background: var(--surface-2); }
input.bare:focus { background: var(--surface-2); }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; }
.check {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; padding: 0; flex: none; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface); display: grid; place-items: center;
}
.check:checked { background: var(--accent-fill); border-color: var(--accent-fill); }
.check:checked::after { content: ""; width: 10px; height: 5px; border: 2px solid var(--on-accent); border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check:focus { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- buttons ---------- */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; cursor: pointer;
  height: 36px; padding: 0 13px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  transition: background-color .15s, border-color .15s, box-shadow .15s, opacity .15s, transform .05s;
  user-select: none; -webkit-user-select: none;
}
button:hover { background: var(--surface-3); border-color: var(--border-strong); }
button:active { transform: scale(.97); }
button:disabled { opacity: .4; pointer-events: none; }
button.primary { background: var(--accent-fill); color: var(--on-accent); border-color: transparent; box-shadow: 0 0 0 1px var(--accent-fill), 0 8px 22px -10px var(--accent); }
button.primary:hover { background: var(--accent-fill-hover); }
button.ghost { background: transparent; border-color: transparent; }
button.ghost:hover { background: var(--surface-2); }
button.danger { color: var(--danger); }
button.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
button.icon { width: 36px; padding: 0; }
button.icon.sm { width: 30px; }
button.on { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }

/* segmented pill (tabs / range / energy) */
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { height: 30px; border-radius: 999px; background: transparent; border: 0; color: var(--muted); padding: 0 12px; font-weight: 600; }
.seg button:hover { color: var(--text); background: transparent; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 1px var(--border); }
.seg.fill { display: flex; } .seg.fill button { flex: 1; padding: 0 6px; }

/* pills / chips */
.pill { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.pill.accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.pill.warn { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.live .dot { box-shadow: 0 0 0 0 currentColor; animation: ping 1.8s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 currentColor; } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }
button.pill { height: 26px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; padding: 0 12px; border-radius: 999px; font-weight: 550; font-size: 13px; background: var(--surface-2); }
.chip .sw { width: 9px; height: 9px; border-radius: 50%; }
.chip.on { background: var(--surface); border-color: var(--text); box-shadow: 0 0 0 1px var(--text) inset; }
.chip kbd { font: 600 10px ui-monospace, monospace; color: var(--faint); }

/* ---------- shell: sidebar (desktop) / top bar + tab bar (mobile) ---------- */
.side { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 40; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  padding-top: env(safe-area-inset-top); background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; letter-spacing: -.02em; font-size: 15px; }
.mark { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-fill); display: grid; place-items: center; box-shadow: 0 0 18px -4px var(--accent); }
.mark svg { width: 15px; height: 15px; stroke: var(--on-accent); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.savest { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.savest::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.savest.saving::before { background: var(--warning); animation: blink 1s infinite; }
.savest.offline::before { background: var(--danger); }
.savest.offline { color: var(--danger); }
@keyframes blink { 50% { opacity: .3; } }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.tabbar a { position: relative; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--faint); }
.tabbar a.on { color: var(--text); }
.tabbar a.on svg { stroke: var(--accent-text); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; width: 28px; height: 2px; border-radius: 2px; background: var(--accent-strong); box-shadow: 0 0 12px var(--accent); }
main.page { max-width: 1320px; margin: 0 auto; padding: 14px 14px calc(150px + env(safe-area-inset-bottom)); }

@media (min-width: 1024px) {
  .topbar, .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 30; padding: 18px 14px;
    background: color-mix(in srgb, var(--bg-subtle) 85%, transparent); backdrop-filter: blur(20px); border-right: 1px solid var(--border);
  }
  .side .brand { padding: 0 8px 18px; }
  .side .sec { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
  .side nav a { position: relative; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 10px; color: var(--muted); font-weight: 560; }
  .side nav a:hover { background: var(--surface-2); color: var(--text); }
  .side nav a.on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
  .side nav a.on svg { stroke: var(--accent-text); }
  .side nav a.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-strong); box-shadow: 0 0 12px var(--accent); }
  .side nav kbd { margin-left: auto; font: 600 10px ui-monospace, monospace; color: var(--faint); }
  .side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
  .progress-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; box-shadow: var(--sheen); }
  body { padding-left: var(--side); }
  main.page { padding: 22px 28px 60px; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; box-shadow: var(--sheen); min-width: 0; }
.card + .card, .stack > * + * { margin-top: 12px; }
.ch { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; min-height: 24px; }
.ch h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ch h2 .ico { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.ch h2 .ico svg { width: 14px; height: 14px; }
.ch .end { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); margin: 12px 0 6px; }
.lbl:first-child { margin-top: 0; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 12px -14px; }
details.card > summary { list-style: none; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary .ch { margin-bottom: 0; }
details.card[open] > summary .ch { margin-bottom: 10px; }
details.card > summary .chev { transition: transform .2s; color: var(--faint); }
details.card[open] > summary .chev { transform: rotate(90deg); }
.bar { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent-strong); transition: width .5s; }
.bar.warn > i { background: var(--warning); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-radius: 14px; margin-bottom: 12px;
  background: linear-gradient(135deg, var(--accent-soft), transparent 80%); border: 1px solid color-mix(in srgb, var(--accent-strong) 30%, transparent); font-size: 13.5px; }
.banner svg { color: var(--accent-text); margin-top: 1px; }

/* ---------- page header ---------- */
.phead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.phead .sub { color: var(--muted); font-size: 13px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
@media (min-width: 640px) { .kpis { grid-template-columns: repeat(6, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; box-shadow: var(--sheen); min-width: 0; }
.kpi .k { font-size: 11.5px; color: var(--muted); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-size: 20px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; display: flex; align-items: baseline; gap: 5px; }
.kpi .v small { font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi .d { font-size: 11.5px; font-weight: 650; margin-top: 1px; font-variant-numeric: tabular-nums; }
.kpi svg.spark { width: 100%; height: 22px; margin-top: 4px; display: block; }

/* ---------- today ---------- */
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 1100px) { .today-grid { grid-template-columns: minmax(0, 1.3fr) minmax(340px, 1fr); } }
.datehead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.datehead .dtitle { position: relative; display: flex; flex-direction: column; padding: 0 6px; cursor: pointer; }
.datehead .dtitle b { font-size: 20px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.datehead .dtitle span { font-size: 12px; color: var(--muted); }
.datehead .dtitle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; height: auto; }
.datehead .end { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.split { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.split i { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }

.sod { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 640px) { .sod { grid-template-columns: auto 1fr; align-items: center; } }
.switch { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); border: 0; padding: 0; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch.on { background: var(--accent-fill); }
.switch.on::after { transform: translateX(18px); }
.switch:hover { background: var(--surface-3); } .switch.on:hover { background: var(--accent-fill); }
.goals .g { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border); padding: 2px 0; }
.goals .g:last-child { border-bottom: 0; }
.goals .g .n { width: 18px; color: var(--faint); font-weight: 700; font-size: 12px; text-align: center; }
.goals .g.done input.bare { text-decoration: line-through; color: var(--muted); }

.tracker { display: grid; grid-template-columns: 26px repeat(4, minmax(0, 1fr)); gap: 3px; user-select: none; -webkit-user-select: none; }
.tracker .hr { font-size: 11px; color: var(--faint); font-weight: 600; display: flex; align-items: center; font-variant-numeric: tabular-nums; }
.tracker .hr.cur { color: var(--accent-text); }
.cell {
  position: relative; height: 44px; border-radius: 9px; padding: 4px 6px 4px 8px; cursor: pointer; overflow: hidden;
  background: var(--cell-empty); border: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center;
  font-size: 11px; line-height: 1.2; transition: transform .08s, border-color .15s; -webkit-touch-callout: none;
}
.cell:hover { border-color: var(--border-strong); }
.cell:active { transform: scale(.97); }
.cell .tm { color: var(--faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.cell .lb { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cell .ty { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; }
.cell .fd { position: absolute; top: 5px; right: 5px; display: flex; gap: 1.5px; }
.cell .fd i { width: 3.5px; height: 3.5px; border-radius: 50%; background: currentColor; opacity: .25; }
.cell .fd i.f { opacity: 1; }
.cell.filled { border-color: transparent; }
.cell.filled::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--pc); }
.cell.missed { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.cell.missed .tm { color: color-mix(in srgb, var(--danger) 70%, var(--faint)); }
.cell.now { border: 1.5px solid var(--accent-strong); animation: pulse 2s ease-in-out infinite; }
.cell.cursor { box-shadow: 0 0 0 2px var(--text); }
.cell.sel { box-shadow: 0 0 0 2px var(--warning); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px var(--accent-soft); } }
@media (min-width: 1024px) { .cell { height: 40px; } }
.selbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 8px; border-radius: 12px; background: var(--warning-soft); color: var(--text); font-size: 13px; }

.tgrid { display: grid; grid-template-columns: 58px 1fr 1fr; gap: 6px; align-items: center; }
.tgrid .hd { font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); text-align: center; }
.tgrid .rl { font-size: 12.5px; font-weight: 650; }
.tbox { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 6px; }
.tbox .sc { text-align: center; font-size: 12px; color: var(--muted); margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.tbox .sc b { color: var(--text); font-size: 14px; }
.tbox .bt { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.tbox button { height: 32px; padding: 0; font-size: 12.5px; background: var(--surface); }
.tbox button.w { color: var(--success); } .tbox button.l { color: var(--danger); }
.pace { display: grid; grid-template-columns: 82px 1fr auto; gap: 4px 10px; align-items: center; font-size: 12.5px; margin-top: 10px; }
.pace .nm { color: var(--muted); }
.pace .val { font-variant-numeric: tabular-nums; text-align: right; }
.pace .meta { grid-column: 2 / 4; font-size: 11.5px; color: var(--faint); margin-top: -3px; }
.ru { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
@media (min-width: 520px) and (max-width: 1099px) { .ru { grid-template-columns: repeat(3, 1fr); } }
.ru button { height: auto; padding: 7px 9px; flex-direction: column; align-items: stretch; gap: 3px; text-align: left; border-radius: 11px; font-weight: 500; }
.ru .t { display: flex; justify-content: space-between; font-size: 12px; gap: 4px; }
.ru .t b { font-weight: 650; }
.ru .t .tab { color: var(--muted); }
.ru .bar { height: 3px; }
.devs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
@media (min-width: 520px) { .devs { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .devs { grid-template-columns: repeat(2, 1fr); } }
.devs button { height: auto; padding: 8px 10px; flex-direction: column; align-items: flex-start; gap: 0; border-radius: 12px; }
.devs .k { font-size: 11px; color: var(--muted); font-weight: 550; }
.devs .v { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; display: flex; width: 100%; align-items: center; }
.devs .v span { margin-left: auto; font-size: 15px; color: var(--accent-text); }
.scores { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.scores button { padding: 0; height: 34px; }
.energy { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.energy button { height: 32px; padding: 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 5px 10px; font-size: 12.5px; }
.kv > :nth-child(odd) { color: var(--muted); }
.kv > :nth-child(even) { font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--faint); font-weight: 650; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }

/* focus buttons in sheet */
.focus5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.focus5 button { height: 44px; font-size: 16px; flex-direction: column; gap: 1px; }
.focus5 button small { font-size: 9.5px; font-weight: 600; color: var(--faint); }
.focus5 button.on small { color: inherit; }

/* ---------- sheet / modal ---------- */
.backdrop { position: fixed; inset: 0; background: var(--scrim); z-index: 70; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; backdrop-filter: blur(2px); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  background: var(--surface); border: 1px solid var(--border); border-bottom: 0; border-radius: var(--r-sheet) var(--r-sheet) 0 0; width: 100%;
  max-width: 580px; max-height: 92dvh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: up .22s cubic-bezier(.2,.8,.2,1);
}
.sheet::before { content: ""; width: 36px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
.sheet .sh { display: flex; align-items: center; gap: 8px; padding: 10px 18px 4px; }
.sheet .sh h2 { font-size: 17px; font-weight: 750; }
.sheet .sb { padding: 6px 18px 14px; overflow-y: auto; }
.sheet .sf { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-sheet) var(--r-sheet); }
.sheet .sf .primary { flex: 1; height: 42px; }
@media (min-width: 720px) {
  .backdrop { align-items: center; }
  .sheet { border-radius: var(--r-sheet); border-bottom: 1px solid var(--border); animation: pop .18s cubic-bezier(.2,.8,.2,1); }
  .sheet::before { display: none; }
  .sheet .sh { padding-top: 16px; }
}
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }

/* floating actions */
.fabs { position: fixed; right: 14px; bottom: calc(70px + env(safe-area-inset-bottom)); display: flex; gap: 8px; z-index: 35; }
.fab { height: 46px; border-radius: 999px; padding: 0 16px; box-shadow: var(--shadow-lg); background: var(--surface); }
.fab.primary { box-shadow: 0 0 0 1px var(--accent-fill), 0 10px 30px -8px var(--accent); }
.desk { display: none !important; }
@media (min-width: 1024px) { .fabs { display: none; } .desk { display: inline-flex !important; } }

/* login */
#login { position: fixed; inset: 0; z-index: 100; background: radial-gradient(1200px 600px at 50% -10%, var(--accent-soft), transparent 60%), var(--bg); display: grid; place-items: center; padding: 20px; }
#login form { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: var(--shadow-lg); }
#login .mark { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 16px; }
#login .mark svg { width: 24px; height: 24px; }
#login input[type=password] { height: 44px; margin-top: 18px; }
#login .err { color: var(--danger); min-height: 18px; font-size: 12.5px; margin: 8px 0; }
#login button.primary { width: 100%; height: 44px; }

.toast { position: fixed; left: 50%; bottom: calc(130px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 10px 14px; border-radius: 14px; font-size: 13.5px; font-weight: 550; max-width: 90vw; animation: up .2s; }
@media (min-width: 1024px) { .toast { left: auto; right: 26px; transform: none; bottom: 80px; } }

/* ---------- vision ---------- */
.vgrid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 720px) { .vgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px) { .vgrid { grid-template-columns: repeat(3, 1fr); } }
.vcard { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.vcard + .vcard { margin-top: 0; }
.vcard::after { content: ""; position: absolute; top: -60px; right: -60px; width: 140px; height: 140px; border-radius: 50%; background: var(--pc); opacity: .09; filter: blur(30px); pointer-events: none; }
.vcard .vh { display: flex; align-items: center; gap: 10px; }
.vcard .av { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #fff; background: var(--pc); flex: none; }
.vcard h3 { font-size: 14.5px; font-weight: 700; }
.vcard .model { font-size: 12px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.vcard .stats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.vcard .cp { display: flex; gap: 9px; align-items: center; padding: 5px 0; font-size: 13px; cursor: pointer; }
.vcard .cp.done > span:first-of-type { text-decoration: line-through; color: var(--muted); }
.vcard .ctr { display: grid; grid-template-columns: 1fr auto; gap: 6px 8px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.vcard .ctr .bar { grid-column: 1 / -1; height: 4px; }
.stepper { display: inline-flex; align-items: center; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 2px; }
.stepper button { height: 26px; width: 26px; padding: 0; background: transparent; border: 0; border-radius: 7px; }
.stepper b { min-width: 52px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.plist .pr { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.plist .pr:last-child { border-bottom: 0; }
.plist .pr .av { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-weight: 800; font-size: 12px; }
.plist .pr .m { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.edit-list .row { margin-bottom: 6px; }

/* dump */
.dump-layout { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: start; }
@media (min-width: 1100px) { .dump-layout { grid-template-columns: 360px minmax(0, 1fr); } .dump-layout > :first-child { position: sticky; top: 22px; } }
.dump-item { display: grid; grid-template-columns: 4px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.dump-item:last-child { border-bottom: 0; }
.dump-item .tagbar { border-radius: 4px; background: var(--tc); }
.dump-item .txt { font-size: 13.5px; }
.dump-item.done .txt, .dump-item.dropped .txt { text-decoration: line-through; color: var(--muted); }
.dump-item .meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--faint); }
.dump-item .acts { margin-left: auto; display: flex; gap: 4px; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
@media (min-width: 720px) { .filters { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.filters select, .filters input { height: 34px; font-size: 13px; }

/* ---------- insights ---------- */
.igrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 900px) { .igrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .igrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.igrid .card + .card { margin-top: 0; }
.igrid .wide { grid-column: 1 / -1; }
.chartbox { position: relative; height: 210px; }
.chartbox.sm { height: 160px; }
.heat { display: grid; grid-template-columns: 24px repeat(7, 1fr); gap: 2px; font-size: 10px; }
.heat div { border-radius: 4px; text-align: center; height: 15px; line-height: 15px; font-variant-numeric: tabular-nums; }
.heat .h { color: var(--faint); background: none; font-weight: 600; }
.boxes37 { display: grid; grid-template-columns: repeat(auto-fill, minmax(22px, 1fr)); gap: 3px; }
.boxes37 div { aspect-ratio: 1; border-radius: 5px; background: var(--surface-3); display: grid; place-items: center; font-size: 9.5px; font-weight: 650; color: var(--faint); }
.boxes37 .done { background: var(--accent-fill); color: var(--on-accent); }
.boxes37 .cur { box-shadow: 0 0 0 1.5px var(--warning) inset; color: var(--warning); }
.wow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
@media (min-width: 640px) { .wow { grid-template-columns: repeat(5, 1fr); } }
.wow > div { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.wow .k { font-size: 11.5px; color: var(--muted); }
.wow .v { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: baseline; }
.wow .v span { font-size: 11.5px; font-weight: 650; }
.wow .p { font-size: 11px; color: var(--faint); }
.scroll-x { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
