/* ════════════════════════════════════════════════════════════════════
   VOLLEY · console  (the design system)
   The instrument, warmed and made tangible: graphite-brown ground, rounded
   surfaces on one ascending radius scale, and a layered elevation ladder so
   cards read as liftable hardware (no glass, no neon). Every color, space,
   radius, shadow, and motion value is a token from tokens.css; raw hex here
   is a defect. Self-contained so the repo stays sellable.
   ════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark light; }
body {
  background: var(--obsidian); color: var(--platinum);
  font-family: var(--body); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; min-height: 100vh; min-height: 100dvh;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--ember) 28%, transparent); color: var(--platinum); }
.num, .money, .clock, .mono { font-variant-numeric: tabular-nums; }

.app-ground { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.disp { font-family: var(--disp); font-weight: 500; letter-spacing: -.005em; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.mono-cap { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--plat-faint); }

/* ── Topbar ─────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 22px;
  background: var(--header-bg); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 24px; height: 24px; flex: none; color: var(--tool-volley); display: block; }
.brand .disp { font-size: 15.5px; font-weight: 600; letter-spacing: -.01em; }
.brand .sub { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--plat-faint); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.tb-meta { display: flex; align-items: center; gap: 14px; }
.tb-stat { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--plat-faint); }
.tb-stat b { color: var(--platinum); font-weight: 600; letter-spacing: 0; }
.clock { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; color: var(--plat-dim); }
.member-chip {
  font-family: var(--mono); font-size: 10px; letter-spacing: .1em; color: var(--platinum);
  border: 1px solid var(--line-hi); border-radius: var(--r-chip); padding: 5px 7px;
}

/* ── View canvas ────────────────────────────────────────────────── */
.main-view { flex: 1; }
.view { padding: 22px; max-width: 1216px; width: 100%; margin: 0 auto; }
.view:focus { outline: none; }
.view > * { animation: riseIn var(--m-enter) var(--ease-exit) backwards; }
.view > *:nth-child(2) { animation-delay: 60ms; }
@keyframes riseIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── Buttons · exactly ONE .btn-gold per surface (brand law) ─────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 13.5px; font-weight: 600; letter-spacing: .01em;
  padding: 10px 18px; min-height: 40px;
  border-radius: var(--r-control); border: 1px solid var(--line-hi);
  background: transparent; color: var(--platinum); white-space: nowrap;
}
.btn:hover { border-color: var(--plat-faint); background: var(--tint-hover); }
.btn-sm { padding: 7px 13px; min-height: 36px; font-size: 12.5px; }
.btn-gold {
  background: var(--grad-ember); color: var(--ember-ink); border: none;
  border-radius: 2px; clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 13px, 100% 100%, 0 100%);
  padding: 12px 24px; min-height: 42px; font-weight: 700; font-size: 13.5px; white-space: nowrap;
}
.btn-gold:hover { filter: brightness(1.05); }
.tlink {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--plat-dim);
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 6px 4px;
}
.tlink:hover { color: var(--platinum); }

/* pressables give under the thumb (the alive layer) */
.btn, .btn-gold, .btn-sm, .tlink, .vrow.clickable, .fm-press {
  transition: transform var(--m-fast) var(--ease-spring),
              border-color var(--m-fast) var(--ease),
              background var(--m-fast) var(--ease),
              color var(--m-fast) var(--ease), filter var(--m-fast) var(--ease);
}
.btn:active, .btn-gold:active, .tlink:active, .fm-press:active { transform: scale(.965); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Status chips · rectangles, mono 10px, 12% tints ────────────── */
.chip {
  display: inline-block; font-family: var(--mono); font-size: 10px;
  letter-spacing: .12em; text-transform: uppercase; line-height: 1;
  border-radius: var(--r-chip); padding: 4px 7px; white-space: nowrap;
}
/* color-as-text on its tint. Red and trust use the brighter --*-text tones
   (the raw saturated --red / --trust fail AA as text); the canonical AA fix. */
.chip.ok    { color: var(--green);      background: var(--tint-green); }
.chip.warn  { color: var(--amber);      background: var(--tint-amber); }
.chip.bad   { color: var(--red-text);   background: var(--tint-red); }
.chip.info  { color: var(--trust-text); background: var(--tint-trust); }
.chip.gold  { color: var(--ember);      background: var(--tint-ember); }
.chip.dim   { color: var(--plat-dim);   background: color-mix(in srgb, var(--platinum) 7%, transparent); }
/* Light mode: the pale (12-16%) tints over warm paper cannot carry saturated
   color as text at 4.5:1, so darken each chip's ink toward black while keeping
   the hue. Token-based (no raw hex); AA-verified in both themes. */
@media (prefers-color-scheme: light) {
  .chip.ok   { color: color-mix(in srgb, var(--green) 55%, black); }
  .chip.warn { color: color-mix(in srgb, var(--amber) 60%, black); }
  .chip.bad  { color: color-mix(in srgb, var(--red-text) 62%, black); }
  .chip.info { color: color-mix(in srgb, var(--trust-text) 64%, black); }
  .chip.gold { color: color-mix(in srgb, var(--ember) 58%, black); }
  .chip.dim  { color: var(--platinum); }
}

/* ── The work strip · today's due touches, the one gold CTA ─────── */
.workstrip {
  border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--graphite-2); margin-bottom: 18px; overflow: hidden;
}
.ws-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 15px 18px; border-bottom: 1px solid var(--line);
}
.ws-title { display: inline; font-family: var(--body); font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--platinum); }
.ws-count { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--plat-faint); margin-left: 6px; }
.ws-head .btn-gold, .ws-head .ws-allheld, .ws-head .ws-clear { margin-left: auto; }
.ws-allheld { color: var(--amber); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ws-clear { color: var(--plat-faint); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ws-note { padding: 11px 18px 0; color: var(--plat-dim); font-size: 13px; }
.ws-list { padding: 4px 0; }

/* ── Workspace · one read at a time behind a segmented control ───── */
.workspace { display: flex; flex-direction: column; gap: 12px; }

/* segmented control (iOS-style, one thing at a time), ember only on .on */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--obsidian); border: 1px solid var(--line); border-radius: var(--r-control); }
.seg {
  flex: 1 1 0; text-align: center; font-family: var(--body); font-weight: 600; font-size: 13px;
  color: var(--plat-dim); background: transparent; border: 0; border-radius: var(--r-inner); padding: 9px 10px;
  transition: color var(--m-base) var(--ease), background var(--m-base) var(--ease), box-shadow var(--m-base) var(--ease);
}
.seg:hover { color: var(--platinum); }
.seg.on { color: var(--platinum); background: var(--graphite-3); box-shadow: var(--e1); }

/* ── Panels · flat hairline, graphite-2 ─────────────────────────── */
.vpanel { background: var(--graphite-2); border: 1px solid var(--line); border-radius: var(--r-card); }
.vpanel-head {
  display: flex; align-items: baseline; gap: 12px;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
  font-family: var(--body); font-weight: 600; font-size: 14px; letter-spacing: -.005em; color: var(--platinum);
}
.vp-meta { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; color: var(--plat-faint); }
.vpanel-body { padding: 14px 16px; }
.vpanel-body-list { padding: 4px 0; }
.vpanel-foot { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; }

/* ── Ruled rows ─────────────────────────────────────────────────── */
.vrow {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.vrow:last-child { border-bottom: none; }
.vrow .why { display: block; font-size: 12.5px; color: var(--plat-faint); margin-top: 2px; }
.vrow .grow { flex: 1; min-width: 0; }
.vrow.clickable { cursor: pointer; }
.vrow.clickable:hover { background: var(--tint-row); }
.vrow.on { background: var(--tint-hover); border-left: 2px solid var(--ember); padding-left: 14px; }
.vrow.reply-row { background: color-mix(in srgb, var(--green) 5%, transparent); }
.vrow.held-row { background: color-mix(in srgb, var(--amber) 5%, transparent); }
.held-note { color: var(--amber); }
.r-due { color: var(--plat-faint); margin-left: auto; }
.r-due.over { color: var(--amber); }

/* ── Row overflow menu (kebab) · demoted sibling actions ────────── */
.rowkebab { position: relative; }
.kebab-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--r-inner);
  border: 1px solid var(--line-hi); background: transparent; color: var(--plat-dim);
}
.kebab-btn:hover { border-color: var(--plat-faint); color: var(--platinum); background: var(--tint-hover); }
.rowkebab .row-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  min-width: 152px; padding: 5px; display: none; flex-direction: column; gap: 2px;
  background: var(--graphite); border: 1px solid var(--line-hi);
  border-radius: var(--r-card); box-shadow: var(--e3), var(--e-inset);
}
.rowkebab.open .row-menu { display: flex; }
.menu-item {
  text-align: left; font-family: var(--body); font-size: 13px; font-weight: 500;
  color: var(--platinum); background: transparent; border: 0;
  border-radius: var(--r-inner); padding: 8px 10px;
}
.menu-item:hover { background: var(--tint-hover); }

/* steps */
.steps .meter-grid { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.steps .step-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.steps .step-row:last-child { border-bottom: none; }
.step-day { color: var(--plat-faint); min-width: 26px; }

/* ── Empty states ───────────────────────────────────────────────── */
.empty { padding: 30px 16px; }
.empty p { font-size: 14px; font-weight: 600; color: var(--plat-dim); }

/* ── Footer ─────────────────────────────────────────────────────── */
.appfoot {
  display: flex; align-items: center; gap: 10px 26px; flex-wrap: wrap;
  padding: 20px 22px 30px; border-top: 1px solid var(--line); margin-top: 8px;
}
.appfoot .tlink { margin-left: auto; }

/* ── Toasts · spring in from the right, settle precisely ─────────── */
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  background: var(--graphite); border: 1px solid var(--line-hi); border-left: 2px solid var(--ember);
  border-radius: var(--r-control); padding: 12px 14px;
  animation: toastIn var(--m-pulse) var(--ease-spring);
}
.toast .t-kind { font-family: var(--mono); font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--ember); display: block; margin-bottom: 3px; }
.toast .t-msg { font-size: 13.5px; color: var(--platinum); line-height: 1.45; }
.toast.leaving { animation: toastOut var(--m-base) var(--ease-exit) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .tb-meta { display: none; }
  .view { padding: 16px; }
  .vrow { flex-wrap: wrap; }
  .vrow .btn, .vrow .btn-sm { margin-top: 4px; }
  .rowkebab .row-menu { right: auto; left: 0; }
}

/* ════════════════════════════════════════════════════════════════════
   LEGACY EVOLVED · elevation language (the "tangible")
   The tokens already warmed the ground and rounded the corners. Here the
   surfaces lift: every object reads as liftable hardware, not a flat
   hairline. USAGE LAW (from the canonical): one elevation tier per
   surface, never stack. e1 rest controls · e2 cards · e3 floating.
   ════════════════════════════════════════════════════════════════════ */

/* One elevation tier per surface, never stacked. The hero work strip and
   each panel carry the single e2 card tier + top-edge light-catch. */
.workstrip,
.vpanel {
  box-shadow: var(--e2), var(--e-inset);
}

/* Interactive object-rows (the cadence list rows) give a quiet hover, no
   lift-out-of-panel double elevation. */
.vrow.clickable {
  border-radius: var(--r-inner);
  transition: background var(--m-fast) var(--ease);
}
.vrow.clickable:hover { background: var(--graphite-3); }

/* Status rows read by a hairline left tint only, inside the already-e2
   panel: green ink for a warm reply-to-hand, amber for a consent hold.
   No nested e2, no r-card break in the ruled list, no ember. */
.vrow.reply-row { border-left: 2px solid var(--green); padding-left: 14px; }
.vrow.held-row { border-left: 2px solid var(--amber); padding-left: 14px; }

/* Floating / overlay surfaces (sticky/fixed) carry the e3 float tier per the
   usage law, one step above the e2 cards they hover over. */
.topbar { box-shadow: var(--e3); }
.toast { box-shadow: var(--e3); }

/* Controls: buttons rest carry e1; the single gold CTA carries e2. */
.btn { box-shadow: var(--e1); }
.btn-gold { box-shadow: var(--e2); }
.member-chip { box-shadow: var(--e1); }

/* ── Keyboard focus · a visible ring on every interactive surface ──
   The token ring for most controls; an OUTLINE (not box-shadow) for the
   clip-path gold CTA, since clip-path would crop a box-shadow ring. */
.btn:focus-visible,
.btn-sm:focus-visible,
.tlink:focus-visible,
.member-chip:focus-visible,
.vrow.clickable:focus-visible,
[data-act]:focus-visible {
  outline: none;
  box-shadow: var(--ring-ember);
}
.btn-gold:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
}
