/* Team KPI — visual system.
   Concept: a calm scoreboard on a soft green canvas. One deep-green block (the highlighted card and the active nav pill)
   carries the weight; everything else is white and quiet. Status colours (ok / warning / bad) are separate from the brand green.
   No inline styles (CSP): percentages use the classes in pct.css. */

@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 500 800; font-display: swap; src: url(/fonts/bricolage-latin.woff2) format('woff2'); }
@font-face { font-family: 'Figtree'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/figtree-latin.woff2) format('woff2'); }

:root {
  --canvas: #dde5e0;
  --frame: #f3f6f4;
  --surface: #ffffff;
  --surface-2: #edf2ef;
  --line: #e1e8e4;
  --ink: #0f1f19;
  --ink-2: #4f5f58;
  --ink-3: #75847d;
  --brand: #0f5240;
  --brand-ink: #ffffff;
  --brand-soft: #e0f0e8;
  --brand-text: #0f5240;
  --hl-from: #167257;
  --hl-to: #0a3a2d;
  --mint: #a6e8c6;
  --bar-done: #0f5240;
  --bar-target: #d5ded9;
  --ring-a: #0f5240;
  --ring-b: #7cc9a3;
  --gold: #e9b536;
  --gold-soft: #fbf0cf;
  --gold-ink: #6b4b00;
  --ok: #0b6a3b; --ok-bg: #c9f2d9;
  --warn: #85500a; --warn-bg: #fdecc4;
  --bad: #b3261e; --bad-bg: #ffd9d4;
  --d-1: #0f5240; --d-2: #35a97b; --d-3: #b7d84b; --d-4: #2f8fb0; --d-5: #8a6bd1; --d-6: #e08a3c; --d-7: #d4688c; --d-8: #6b7f78;
  --shadow: 0 1px 2px rgba(15, 31, 25, 0.04), 0 10px 30px -18px rgba(15, 31, 25, 0.18);
  --shadow-pop: 0 10px 24px -8px rgba(15, 82, 64, 0.55);
  --r: 24px;
  --r-sm: 14px;
  --f-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --f-body: 'Figtree', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #060d0a;
    --frame: #0b1410;
    --surface: #121d18;
    --surface-2: #1a2822;
    --line: #213229;
    --ink: #e9f2ed;
    --ink-2: #a5b6ae;
    --ink-3: #82938b;
    --brand: #1f8a66;
    --brand-ink: #ffffff;
    --brand-soft: #14352a;
    --brand-text: #6fd6a8;
    --hl-from: #1b7a5c;
    --hl-to: #0c3a2c;
    --bar-done: #3fbf8a;
    --bar-target: #2a3b33;
    --ring-a: #3fbf8a;
    --ring-b: #2c6b53;
    --gold-soft: #3a2d0a;
    --gold-ink: #f1c04c;
    --ok: #6fe0a3; --ok-bg: #123a27;
    --warn: #f0b44c; --warn-bg: #3a2a0a;
    --bad: #ff9a90; --bad-bg: #411813;
    --d-1: #3fbf8a; --d-2: #6fd6a8; --d-3: #c9e56a; --d-4: #5db5d4; --d-5: #b39df0; --d-6: #f0a462; --d-7: #ec8fb0; --d-8: #94a69e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-pop: 0 10px 24px -8px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 1rem/1.5 var(--f-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 650; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); }
h2 { font-size: 1.1rem; }
p { margin: 0; }
a { color: var(--brand-text); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.grow { min-width: 0; }
.lead { margin-bottom: 16px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ---------- frame, sidebar, header ---------- */
.frame { min-height: 100vh; min-height: 100dvh; background: var(--frame); }
.col { min-width: 0; }
.side { display: none; }
.page {
  display: grid; gap: 20px; align-content: start;
  padding-block: 18px 120px;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.topline .sub { color: var(--ink-3); font-size: 0.9rem; margin-top: 4px; }
.top-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.profile { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 4px; border-radius: 999px; }
.profile:hover { background: var(--surface); }
.pinfo { display: none; line-height: 1.2; }
.pinfo b { display: block; font-weight: 650; font-size: 0.92rem; }
.pinfo small { color: var(--ink-3); font-size: 0.8rem; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); display: grid; place-items: center; font: 650 0.85rem/1 var(--f-display); flex: none; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 1.2rem/1 var(--f-display); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--brand); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 19px; height: 19px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-around; align-items: center;
  padding: 8px max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 6px 4px; font-size: 0.72rem; font-weight: 600; color: var(--ink-3); text-decoration: none; border-radius: 12px; min-height: 48px; }
.tab[aria-current='page'] { color: var(--brand-text); }
.tab.fab { flex: none; }
.tab.fab .fab-btn { width: 54px; height: 54px; margin-top: -26px; border-radius: 18px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; box-shadow: var(--shadow-pop); border: 4px solid var(--frame); }
.tab.fab .icon { width: 24px; height: 24px; }

@media (min-width: 900px) {
  body { padding: 24px; }
  .frame {
    max-width: 1500px; margin: 0 auto; border-radius: 36px; padding: 20px; min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px);
    display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 24px; box-shadow: 0 30px 80px -40px rgba(15, 31, 25, 0.35);
  }
  .tabbar { display: none; }
  .side {
    display: flex; flex-direction: column; gap: 6px; position: sticky; top: 20px; align-self: start;
    height: calc(100vh - 88px); height: calc(100dvh - 88px); padding: 22px 16px 16px; background: var(--surface); border-radius: 28px; box-shadow: var(--shadow);
  }
  .side .brand { padding: 0 8px 14px; }
  .navlabel { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); padding: 14px 12px 6px; }
  .nav { display: grid; gap: 4px; }
  .nav a, .nav button {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: 14px; border: 0; background: none; cursor: pointer;
    color: var(--ink-2); text-decoration: none; font: 600 0.95rem var(--f-body); text-align: left;
  }
  .nav a:hover, .nav button:hover { background: var(--surface-2); color: var(--ink); }
  .nav a[aria-current='page'] { background: var(--brand); color: var(--brand-ink); box-shadow: var(--shadow-pop); }
  .promo { margin-top: auto; border-radius: 22px; padding: 18px; color: #fff; background: linear-gradient(160deg, var(--hl-from), var(--hl-to)); display: grid; gap: 10px; }
  .promo .eyebrow { color: rgba(255, 255, 255, 0.7); }
  .promo b { font: 700 1.9rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
  .promo b small { font: 500 0.9rem var(--f-body); opacity: 0.75; }
  .promo p { font-size: 0.86rem; color: rgba(255, 255, 255, 0.78); }
  .promo .meter { background: rgba(255, 255, 255, 0.2); height: 8px; }
  .promo .meter i { background: var(--mint); }
  .promo .btn { background: #fff; color: #0a3a2d; }
  .page { padding: 8px 8px 8px 0; gap: 22px; }
  .pinfo { display: block; }
}

/* ---------- basics ---------- */
.card { background: var(--surface); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow); min-width: 0; container-type: inline-size; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.card-head p { color: var(--ink-3); font-size: 0.86rem; margin-top: 4px; }
.eyebrow { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px; border: 0; cursor: pointer;
  font: 650 0.98rem/1 var(--f-body); text-decoration: none; background: var(--brand); color: var(--brand-ink); transition: transform 0.12s ease, filter 0.12s ease;
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--surface-2); filter: none; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: 0.88rem; border-radius: 11px; }
.btn.block { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; }
.iconbtn:hover { background: var(--surface-2); color: var(--ink); }
.iconbtn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand-text); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.danger { color: var(--bad); }
form.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 650; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.brand { background: var(--brand-soft); color: var(--brand-text); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); flex: none; }
.dot.c1 { background: var(--d-1); } .dot.c2 { background: var(--d-2); } .dot.c3 { background: var(--d-3); } .dot.c4 { background: var(--d-4); }
.dot.c5 { background: var(--d-5); } .dot.c6 { background: var(--d-6); } .dot.c7 { background: var(--d-7); } .dot.c8 { background: var(--d-8); }

.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-sm); background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.flash.err { background: var(--bad-bg); color: var(--bad); }

/* ---------- forms ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > label { font-size: 0.86rem; font-weight: 650; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 0.82rem; }
input, select, textarea { width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; min-width: 0; }
textarea { min-height: 84px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--brand) 30%, transparent); border-color: var(--brand); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.row .field { flex: 1 1 160px; }

dialog { border: 0; padding: 0; background: transparent; color: var(--ink); max-width: none; max-height: none; width: 100%; }
dialog::backdrop { background: rgba(6, 16, 12, 0.55); backdrop-filter: blur(3px); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: 28px 28px 0 0; padding: 22px max(20px, env(safe-area-inset-left)) calc(24px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.4); }
.sheet-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head p { color: var(--ink-2); font-size: 0.92rem; margin-top: 4px; }
@media (min-width: 700px) {
  dialog { margin: auto; width: min(540px, calc(100% - 32px)); }
  .sheet { position: static; border-radius: 28px; padding: 28px; max-height: 88dvh; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog[open] .sheet { animation: rise 0.22s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sc { background: var(--surface); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; align-content: space-between; min-width: 0; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-ico { width: 44px; height: 44px; border-radius: 14px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; }
.sc-label { font-weight: 600; color: var(--ink-2); font-size: 0.92rem; }
.sc-val { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.sc-val b { font: 700 clamp(1.7rem, 4.2vw, 2.2rem)/1.05 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.sc-val span { color: var(--ink-3); font-size: 0.82rem; max-width: 14ch; line-height: 1.25; }
.sc.hl { background: linear-gradient(150deg, var(--hl-from), var(--hl-to)); color: #fff; }
.sc.hl .sc-ico { background: rgba(255, 255, 255, 0.16); color: #fff; }
.sc.hl .sc-label { color: rgba(255, 255, 255, 0.82); }
.sc.hl .sc-val span { color: rgba(255, 255, 255, 0.7); }
.sc.hl .chip { background: var(--mint); color: #08392b; }
.sc.gold .sc-ico { background: var(--gold-soft); color: var(--gold-ink); }
.sc.gold .sc-ico .icon { fill: var(--gold); stroke: var(--gold-ink); }

.cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); align-items: start; }
.stack { display: grid; gap: 20px; min-width: 0; }
@media (min-width: 1280px) { .cols { grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr); } }
@media (min-width: 1200px) { .stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats.four .sc-val b { font-size: 1.7rem; } }
@media (max-width: 480px) { .sc { padding: 16px; } .sc-ico { width: 38px; height: 38px; border-radius: 12px; } }

/* ---------- charts ---------- */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-target { background: var(--bar-target); } .lg-done { background: var(--bar-done); }
.ring-b-dot { background: var(--ring-b); }

.chart { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 8px; height: 240px; margin-top: 8px; }
.yaxis { position: relative; font-size: 0.74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-bottom: 28px; }
.yaxis span { position: absolute; right: 0; transform: translateY(50%); }
.plotwrap { position: relative; }
.grid-l { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.plotarea { position: absolute; inset: 0 0 28px 0; }
.plot { position: absolute; inset: 0; display: flex; gap: 4px; }
.day { flex: 1; min-width: 0; position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 3px; border-radius: 10px; }
.day:hover, .day:focus-visible { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.day .b { width: 38%; max-width: 16px; min-height: 4px; border-radius: 8px; }
.day .b.t { background: var(--bar-target); }
.day .b.d { background: var(--bar-done); }
.day.none .b { height: 0; min-height: 0; }
.day .lab { position: absolute; bottom: -26px; left: 0; right: 0; text-align: center; font-size: 0.74rem; color: var(--ink-3); }
.day.today .lab { color: var(--ink); font-weight: 700; }
.day .tip {
  position: absolute; left: 50%; top: 6px; transform: translate(-50%, 0); z-index: 4; display: none; padding: 9px 12px; border-radius: 12px;
  background: #10241c; color: #fff; font-size: 0.8rem; line-height: 1.5; white-space: nowrap; box-shadow: 0 10px 24px -8px rgba(0, 0, 0, 0.5); pointer-events: none;
}
.day .tip b { font-weight: 700; }
.day .tip em { font-style: normal; color: rgba(255, 255, 255, 0.65); display: block; font-size: 0.74rem; }
.day:hover .tip, .day:focus-visible .tip { display: block; }
.day:first-child .tip { left: 0; transform: none; }
.day:last-child .tip { left: auto; right: 0; transform: none; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.tip .a { background: var(--mint); } .tip .c { background: #9fb0a8; }

.ringwrap { display: grid; justify-items: center; gap: 14px; }
.ring-box { position: relative; width: min(100%, 210px); }
.ring2 { width: 100%; aspect-ratio: 1; display: block; }
.ring2 .trk { stroke: var(--surface-2); }
.ring2 .a1 { stroke: var(--ring-a); } .ring2 .a2 { stroke: var(--ring-b); }
.ring2 .rc1 { stroke: var(--d-1); } .ring2 .rc2 { stroke: var(--d-2); } .ring2 .rc3 { stroke: var(--d-3); } .ring2 .rc4 { stroke: var(--d-4); }
.ring2 .rc5 { stroke: var(--d-5); } .ring2 .rc6 { stroke: var(--d-6); } .ring2 .rc7 { stroke: var(--d-7); } .ring2 .rc8 { stroke: var(--d-8); }
.ring-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 6px; justify-items: center; }
.ring-c b { font: 700 2rem/1 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.ring-c small { color: var(--ink-3); font-size: 0.8rem; }
.ring-c.sm b { font-size: 1.15rem; }

.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.lines li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.lines .li-ico { width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.lines .li-name { flex: 1; font-weight: 600; min-width: 0; }
.lines .li-val { font: 700 1rem var(--f-display); font-variant-numeric: tabular-nums; }

.goals { display: grid; gap: 18px; }
.goal-top { display: flex; justify-content: space-between; gap: 8px; font-size: 0.9rem; font-weight: 600; margin-bottom: 8px; }
.goal-top span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 650; }
.thin { height: 8px; border-radius: 99px; background: var(--surface-2); position: relative; }
.thin i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--brand); }
.thin.hit i { background: var(--d-2); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold-ink); font-weight: 650; font-size: 0.84rem; }
.badge .medal { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #3a2a00; display: grid; place-items: center; }
.badge .medal .icon { width: 15px; height: 15px; }
.empty { display: grid; gap: 4px; justify-items: start; color: var(--ink-2); font-size: 0.92rem; }
.empty b { color: var(--ink); }

.items { list-style: none; margin: 0; padding: 0; display: grid; }
.items li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.items li:first-child { border-top: 0; padding-top: 0; }
.items b { font-weight: 650; overflow-wrap: anywhere; }
.items .meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--ink-2); font-size: 0.88rem; }
.items .meta a { display: inline-flex; align-items: center; gap: 4px; }
.items .views { margin-top: 8px; }
.items .views input { width: 110px; min-height: 36px; padding: 4px 10px; }
.qty { font: 700 1.1rem var(--f-display); color: var(--ink-2); }
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.log li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.log .chip { min-width: 52px; justify-content: center; }
details.card summary { cursor: pointer; font: 650 1.1rem var(--f-display); list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '+'; font-size: 1.4rem; color: var(--ink-3); }
details.card[open] summary::after { content: '−'; }
details.card[open] summary { margin-bottom: 14px; }

/* ---------- manager ---------- */
.monthnav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 14px; padding: 4px; box-shadow: var(--shadow); }
.monthnav a { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: var(--ink-2); }
.monthnav a:hover { background: var(--surface-2); }
.monthnav strong { padding: 0 8px; font: 650 0.95rem var(--f-display); min-width: 128px; text-align: center; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg a { padding: 7px 14px; border-radius: 999px; background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 0.88rem; display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow); }
.seg a[aria-current='true'] { background: var(--brand); color: var(--brand-ink); }
.seg a:hover:not([aria-current='true']) { background: var(--surface-2); }

.meter { position: relative; height: 10px; border-radius: 999px; background: var(--surface-2); }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--brand); }
.meter.hit i { background: var(--d-2); }
.meter .pace { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 2px; opacity: 0.6; }

.roster { list-style: none; margin: 0; padding: 0; display: grid; }
.rrow { display: grid; gap: 10px 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'who status' 'meter meter' 'nums nums'; }
.rrow:first-child { border-top: 0; padding-top: 0; }
.rrow .who { grid-area: who; display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; color: var(--ink); }
.rrow .who b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .who small { color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rrow .status { grid-area: status; justify-self: end; }
.rrow .mcell { grid-area: meter; display: grid; gap: 7px; }
.rrow .mtext { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rrow .nums { grid-area: nums; display: flex; gap: 18px; font-size: 0.86rem; color: var(--ink-2); flex-wrap: wrap; align-items: center; }
.rrow .nums b { color: var(--ink); font-weight: 650; }
.rrow .who small .pts { display: none; }
.rhead { display: none; }
@container (min-width: 500px) {
  .rrow { grid-template-columns: minmax(0, 1.5fr) 84px minmax(0, 1.6fr) 124px; grid-template-areas: 'who today meter status'; }
  .rrow .nums { display: contents; }
  .rrow .nums .n-today { grid-area: today; }
  .rrow .nums .n-pts { display: none; }
  .rrow .nums .lbl { display: none; }
  .rrow .status { justify-self: start; }
  .rrow .who small .pts { display: inline; }
  .rhead { display: grid; grid-template-columns: minmax(0, 1.5fr) 84px minmax(0, 1.6fr) 124px; gap: 16px; padding: 0 0 10px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
}

.attn { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.attn li a { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 14px; text-decoration: none; color: var(--ink); }
.attn li a:hover { background: var(--surface-2); }
.attn b { font-weight: 650; display: block; line-height: 1.25; }
.attn small { color: var(--ink-3); }

.scroll { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.t th { text-align: left; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 0 12px 10px; white-space: nowrap; }
.t td { padding: 12px; border-top: 1px solid var(--line); vertical-align: top; }
.t td.r, .t th.r { text-align: right; }
.t td b { font-weight: 650; }
.t tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.filters .field { flex: 0 1 190px; }

.ulist { list-style: none; margin: 0; padding: 0; display: grid; }
.ulist > li { border-top: 1px solid var(--line); }
.ulist > li:first-child { border-top: 0; }
.urow { display: flex; align-items: center; gap: 12px; padding: 12px 0; flex-wrap: wrap; }
.urow .who { display: flex; align-items: center; gap: 12px; flex: 1 1 220px; min-width: 0; }
.urow .who b { display: block; font-weight: 650; }
.urow .who small { color: var(--ink-3); }
.urow.off { opacity: 0.55; }
details > summary.linkbtn { list-style: none; cursor: pointer; display: inline-block; margin: 0 0 12px 50px; font-size: 0.9rem; }
details > summary.linkbtn::-webkit-details-marker { display: none; }
.edit { padding: 4px 0 18px 50px; display: grid; gap: 16px; }
.edit hr { border: 0; border-top: 1px solid var(--line); width: 100%; margin: 0; }
@media (max-width: 560px) { .edit { padding-left: 0; } details > summary.linkbtn { margin-left: 0; } }

/* ---------- sign in ---------- */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; background: var(--frame); }
.auth-art { background: linear-gradient(160deg, var(--hl-from), var(--hl-to)); color: #fff; padding: 28px max(20px, env(safe-area-inset-left)) 32px; display: grid; gap: 24px; align-content: space-between; }
.auth-art .brand { color: #fff; }
.auth-art .brand-mark { background: rgba(255, 255, 255, 0.16); }
.auth-art h1 { font-size: clamp(2rem, 6vw, 3.4rem); max-width: 13ch; line-height: 1.02; }
.auth-art p { color: rgba(255, 255, 255, 0.78); max-width: 38ch; margin-top: 14px; }
.demo { display: none; }
.auth-form { display: grid; align-content: center; padding: 32px max(20px, env(safe-area-inset-left)) 40px; }
.auth-form .inner { width: 100%; max-width: 400px; margin: 0 auto; display: grid; gap: 20px; }
@media (min-width: 900px) {
  body.bare { padding: 0; }
  .auth { grid-template-columns: 1.1fr 1fr; }
  .auth-art { padding: 44px 56px; }
  .demo { display: flex; align-items: center; gap: 18px; background: rgba(255, 255, 255, 0.1); border-radius: 22px; padding: 18px 22px; width: fit-content; }
  .demo .mini { position: relative; width: 84px; height: 84px; }
  .demo .mini svg { width: 100%; height: 100%; }
  .demo .mini .trk { stroke: rgba(255, 255, 255, 0.2); } .demo .mini .a1 { stroke: var(--mint); }
  .demo .mini b { position: absolute; inset: 0; display: grid; place-items: center; font: 700 1.4rem var(--f-display); }
  .demo b.t { font: 650 1.05rem var(--f-display); display: block; }
  .demo span.s { color: rgba(255, 255, 255, 0.72); font-size: 0.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 899px) { .hide-sm { display: none; } }
.lead-top { margin-top: 18px; }

/* ---------- KPI selector, report form, KPI management ---------- */
.kpisel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kpisel .lbl { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-right: 4px; }
.kpisel a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 0.9rem; text-decoration: none; box-shadow: var(--shadow); }
.kpisel a[aria-current='true'] { background: var(--brand); color: var(--brand-ink); }
.kpisel a[aria-current='true'] .chip { background: rgba(255, 255, 255, 0.2); color: #fff; }
.kpisel a:hover:not([aria-current='true']) { background: var(--surface-2); }
.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 16px; }
.fieldset-reset[hidden] { display: none; }
.tplgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.tpl { display: block; cursor: pointer; }
.tpl input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.tpl > span { display: grid; gap: 4px; padding: 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); height: 100%; }
.tpl b { font-weight: 650; }
.tpl small { color: var(--ink-3); font-size: 0.82rem; line-height: 1.35; }
.tpl:hover > span { border-color: var(--ink-3); }
.tpl:has(input:checked) > span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.tpl:has(input:focus-visible) > span { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
.rolehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.rolehead h2 { display: flex; align-items: center; gap: 10px; }
.kpilist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; }
.kpilist > li { border-top: 1px solid var(--line); padding: 14px 0; display: grid; gap: 10px; }
.kpilist > li:first-child { border-top: 0; padding-top: 4px; }
.kpitop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.kpitop .grow { flex: 1 1 220px; }
.kpitop b { font-weight: 650; }
.kpitop small { color: var(--ink-3); display: block; }
.kpilist details > summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--brand-text); list-style: none; }
.kpilist details > summary::-webkit-details-marker { display: none; }
.kpilist details[open] > summary { margin-bottom: 12px; }
.kpilist .panel { display: grid; gap: 18px; padding: 16px; border-radius: var(--r-sm); background: var(--surface-2); }
.kpilist .panel .field input, .kpilist .panel .field select { background: var(--surface); }
.retired { opacity: 0.6; }
.tgttable { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.tgttable th { text-align: left; font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; padding: 0 8px 10px; }
.tgttable td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.tgttable input { min-height: 40px; padding: 6px 10px; width: 96px; }
.tgttable input[type='month'] { width: 150px; }
.kpilist details > summary { text-decoration: underline; text-underline-offset: 3px; }
.card > details > summary.linkbtn { margin: 14px 0 0; }
