/* ============================================================================
   Vault Clinical — Deep Ink / Emerald Ledger (dark theme)
   Deep desaturated navy canvas, blue-tinted raised surfaces, a single emerald
   accent rationed to positive financial signal (pay + projections + data bars).
   All text pairs verified WCAG AA. Layout/markup unchanged from the light theme.
   ============================================================================ */
:root {
  --bg: #0b1220;            /* page canvas — deep navy-ink */
  --header-bg: #0d1526;     /* masthead plane */
  --surface: #121c30;       /* primary raised surface (dash, table, uploader, filerow) */
  --surface2: #172339;      /* nested/inset surface (cards, thead, input) */
  --surface3: #1d2c47;      /* hover/active lift */
  --border: #243450;        /* hairline border */
  --border-soft: #1c2a43;   /* quieter dividers / resting dashed border */
  --ink: #eef2f8;           /* primary text (soft off-white, low halation) */
  --dim: #9aacc4;           /* secondary text (labels, th, status) */
  --dim2: #8fa0bd;          /* large de-emphasized glyphs ($ prefix) */
  --accent: #34d3a6;        /* emerald — positive money + data + focus */
  --accent-hover: #48e0b6;
  --accent-base: #1f8a6e;   /* visible deeper base for bar gradients (>=3:1) */
  --accent-glow: rgba(52, 211, 166, 0.28);
  --good: #34d3a6;          /* success (done) */
  --warn: #f0b450;          /* amber — carrier-priced / unrecognized / note */
  --warn-bg: rgba(240, 180, 80, 0.10);
  --bad: #f3736b;           /* error (coral-red, AA on dark) */
  --track: #243450;         /* unfilled progress track */
  --focus: #5be3c0;         /* keyboard focus ring */
  --shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 8px 24px -12px rgba(0, 0, 0, 0.55);
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%; padding-bottom: env(safe-area-inset-bottom);
}

/* ============================================================
   Tahoe water — fixed full-page backdrop behind all content.
   Three seamless wave layers (1200px period, slopes matched at
   the tile seam) drift at different speeds/directions; deepest
   layer slowest, like real water. GPU transform only.
   ============================================================ */
.ocean {
  position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(110% 65% at 72% -12%, rgba(91, 227, 192, 0.10), transparent 55%),
    radial-gradient(80% 50% at 15% 110%, rgba(27, 110, 116, 0.18), transparent 60%),
    linear-gradient(180deg, #0b1220 0%, #0c1a30 48%, #0b2238 100%);
}
.wave {
  position: absolute; left: 0; width: calc(100% + 1200px);
  background-repeat: repeat-x; background-size: 1200px 100%;
  will-change: transform; animation: drift linear infinite;
}
.w1 { bottom: 0; height: 52vh; opacity: .85; animation-duration: 110s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 260' preserveAspectRatio='none'%3E%3Cpath d='M0,140 C100,100 200,100 300,140 C400,180 500,180 600,140 C700,100 800,100 900,140 C1000,180 1100,180 1200,140 L1200,260 L0,260 Z' fill='%230f2c47'/%3E%3C/svg%3E"); }
.w2 { bottom: 0; height: 38vh; opacity: .55; animation-duration: 70s; animation-direction: reverse;
  background-position-x: 420px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 260' preserveAspectRatio='none'%3E%3Cpath d='M0,150 C100,105 200,105 300,150 C400,195 500,195 600,150 C700,105 800,105 900,150 C1000,195 1100,195 1200,150 L1200,260 L0,260 Z' fill='%2314506b'/%3E%3C/svg%3E"); }
.w3 { bottom: 0; height: 24vh; opacity: .42; animation-duration: 45s;
  background-position-x: 180px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 260' preserveAspectRatio='none'%3E%3Cpath d='M0,160 C100,126 200,126 300,160 C400,194 500,194 600,160 C700,126 800,126 900,160 C1000,194 1100,194 1200,160 L1200,260 L0,260 Z' fill='%231b6e74'/%3E%3C/svg%3E"); }
@keyframes drift { to { transform: translateX(-1200px); } }
@media (prefers-reduced-motion: reduce) { .wave { animation: none; } }

header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(13, 21, 38, 0.74); color: var(--ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 12px 18px;
  padding-top: calc(12px + env(safe-area-inset-top));
}
header h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
header .sub { margin: 4px 0 0; color: var(--dim); font-size: 14px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.logo .mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 15px;
  background: linear-gradient(135deg, var(--accent), var(--accent-base));
  box-shadow: 0 4px 16px -4px var(--accent-glow);
}
.navspacer { flex: 1; }
.chip {
  font-size: 12.5px; color: var(--dim); border: 1px solid var(--border); border-radius: 999px;
  padding: 5px 12px; background: rgba(13, 24, 44, .45); white-space: nowrap;
}
.chip b { color: var(--accent); font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .chip { display: none; } }   /* phones: nav stays logo + sign-out */
main { max-width: 760px; margin: 0 auto; padding: 18px; }

.uploader {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: rgba(18, 28, 48, 0.66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 2px dashed var(--border-soft); border-radius: 16px;
  padding: 34px 18px; color: var(--dim); cursor: pointer; transition: border-color .15s, background .15s;
}
.uploader:active, .uploader:hover, .uploader.hot {
  border-color: var(--accent); background: var(--surface3);
  box-shadow: inset 0 0 0 100px rgba(52, 211, 166, 0.04);
}
.uploader.hot { border-color: var(--accent-hover); }
.uploader:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-glow); }
.uploader .big { font-size: 40px; }
.uploader .ctahead { font-size: 17px; font-weight: 650; color: var(--ink); letter-spacing: .1px; }

/* per-file progress list */
.files { list-style: none; margin: 14px 0 0; padding: 0; }
.filerow {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 8px;
}
.filerow .fname { font-size: 14px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filerow .fstatus { font-size: 12px; color: var(--dim); text-align: right; white-space: nowrap; }
.filerow .bar { grid-column: 1 / -1; height: 6px; border-radius: 4px; background: var(--track); overflow: hidden; }
.filerow .fill { height: 100%; width: 0; background: var(--accent); transition: width .2s ease; }
.filerow.done .fill { background: var(--good); }
.filerow.done .fstatus { color: var(--good); }
.filerow.error .fill { background: var(--bad); width: 100%; }
.filerow.error .fstatus { color: var(--bad); }
/* indeterminate (server is recognizing) — a glowing sliver that fades at the edges */
.bar.indet .fill {
  width: 40%; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: slide 1.1s ease-in-out infinite;
}
@keyframes slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .bar.indet .fill { animation: none; width: 100%; opacity: .55; margin-left: 0; }
}

.reset {
  margin: 14px 2px 0; padding: 10px 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--ink); border-radius: 10px; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s;
}
.reset:hover { background: var(--surface3); border-color: var(--border); }
.reset:active { background: var(--surface2); }
.reset:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-glow); }

.status { margin: 16px 2px; padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.status.busy { background: var(--surface2); color: var(--accent); }
.status.error { background: var(--warn-bg); color: var(--bad); }

/* ---- dashboard ---- */
.dash {
  background: rgba(18, 28, 48, 0.72); border: 1px solid var(--border); border-radius: 16px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.hero {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  background:
    linear-gradient(135deg, rgba(52, 211, 166, 0.10), rgba(18, 28, 48, 0) 40%),
    rgba(18, 28, 48, 0.72);
}
.hero-left { flex: 1 1 340px; min-width: 0; }
.eyebrow {
  display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--dim);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); animation: dotPulse 2.4s ease-in-out infinite;
}
@keyframes dotPulse { 50% { opacity: .35; } }
.leadrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 2px; }
.leadnum {
  display: block; font-size: clamp(64px, 14vw, 104px); font-weight: 800; line-height: .98;
  letter-spacing: -3px; font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #eafff8 10%, #5be3c0 58%, #1f8a6e);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(52, 211, 166, .28));  /* the one glowing number */
}
.leadunit {
  font-size: 19px; font-weight: 650; color: var(--dim); letter-spacing: .02em;
  display: inline-flex; align-items: center; gap: 8px;
}
.pr-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .12em; color: #1c1503;
  background: linear-gradient(135deg, #fde68a, var(--warn)); border-radius: 7px; padding: 4px 9px;
  box-shadow: 0 0 18px rgba(240, 180, 80, .45); animation: prPop .5s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes prPop { from { transform: scale(0); } }
.hero-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.hchip {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--dim);
  background: rgba(11, 18, 32, .5); border: 1px solid var(--border); border-radius: 999px; padding: 6px 13px;
}
.hchip b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hchip .up { color: var(--accent); }
.hchip .dn { color: var(--bad); }
.pace-pill {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--dim);
  border: 1px solid rgba(52, 211, 166, .25); background: rgba(52, 211, 166, .07);
  border-radius: 12px; padding: 9px 15px;
}
.pace-pill b { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; }
.pace-pill .pill-note { opacity: .65; }
.herorow {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 16px;
}
.rate label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 4px; }
.rateline { display: flex; align-items: center; gap: 4px; font-size: 22px; font-weight: 600; }
.rateline span { color: var(--dim2); }
.rateline input {
  width: 110px; font: inherit; font-size: 22px; font-weight: 600; color: var(--ink);
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: 6px 10px; text-align: right; font-variant-numeric: tabular-nums;
}
.rateline input::placeholder { color: var(--dim2); }
.rateline input:focus {
  outline: 2px solid var(--focus); outline-offset: 1px;
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow);
}
.pay { text-align: right; }
.pay .big {
  display: block; font-size: 28px; font-weight: 750; line-height: 1.05; letter-spacing: -.4px;
  color: var(--accent); font-variant-numeric: tabular-nums;   /* glow reserved for the lead number */
}
.pay small { display: block; color: var(--dim); font-size: 12px; }

/* ---- stat cards: value + delta + sparkline ---- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px;
  margin-bottom: 16px;
}
.stat {
  position: relative; overflow: hidden;
  background: rgba(23, 35, 57, 0.72); border: 1px solid var(--border); border-radius: 14px;
  padding: 13px 14px 10px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: transform .18s ease, border-color .18s ease;
}
.stat:hover { transform: translateY(-3px); border-color: var(--accent-base); }
@media (prefers-reduced-motion: reduce) { .stat, .stat:hover { transition: none; transform: none; } }
.stat .k { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim2); }
.stat .v { display: block; font-size: 23px; font-weight: 800; letter-spacing: -.5px; margin-top: 2px;
  color: var(--ink); font-variant-numeric: tabular-nums; }
.stat .d { display: block; font-size: 11.5px; margin-top: 1px; color: var(--dim); min-height: 15px; }
.stat .d.up { color: var(--accent); }
.stat .d.dn { color: var(--bad); }
.stat > svg { position: absolute; right: 0; bottom: 0; width: 92px; height: 34px; opacity: .8; pointer-events: none; }
.spark-l { fill: none; stroke: var(--accent); stroke-width: 1.8; }
.spark-a { fill: rgba(52, 211, 166, .12); stroke: none; }
/* ---- daily wRVU area chart (replaces the old mini-bars) ---- */
.bars { display: block; }
#trendSvg { width: 100%; height: 240px; display: block; touch-action: pan-y; }
.ch-grid { stroke: var(--border-soft); stroke-width: 1; }
.ch-gridlbl { fill: var(--dim2); font: 500 10.5px ui-sans-serif, system-ui; }
.ch-title { fill: var(--dim); font: 600 11px ui-sans-serif, system-ui; letter-spacing: .08em; text-transform: uppercase; }
.ch-area { fill: url(#chGrad); }
.ch-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round;
  stroke-linecap: round; filter: drop-shadow(0 0 6px var(--accent-glow)); }
.ch-dot { fill: var(--accent); stroke: #0b1220; stroke-width: 1.5; }
.ch-today-halo { fill: none; stroke: var(--focus); stroke-width: 1.5; opacity: .8; }
.ch-avg { stroke: #7da7d9; stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .75; }
.ch-avglbl { fill: #9dc1ea; font: 600 11px ui-sans-serif, system-ui; }
.ch-goal { stroke: var(--warn); stroke-width: 1.2; stroke-dasharray: 2 5; opacity: .8; }
.ch-goallbl { fill: var(--warn); font: 700 10.5px ui-sans-serif, system-ui; opacity: .9; }
.ch-val { fill: var(--ink); font: 700 12.5px ui-sans-serif, system-ui; font-variant-numeric: tabular-nums; }
.ch-val.peak { fill: var(--accent); }
.ch-x { fill: var(--dim); font: 500 10.5px ui-sans-serif, system-ui; }
.ch-x.today { fill: var(--focus); font-weight: 700; }
.ch-cursor line { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 3 3; }
.ch-cursor circle { fill: var(--focus); stroke: #0b1220; stroke-width: 1.5; }
.ch-tipbg { fill: #1d2c47; stroke: var(--border); rx: 6; }
.ch-tip { fill: var(--ink); font: 600 12px ui-sans-serif, system-ui; font-variant-numeric: tabular-nums; }
.ch-tipdate { fill: var(--dim); font: 500 10px ui-sans-serif, system-ui; }

.reshead {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 4px 2px 10px; font-weight: 600; color: var(--ink);
}
.reshead .reset { margin: 0; padding: 6px 12px; font-size: 13px; }

@media (max-width: 420px) { .cards { grid-template-columns: repeat(2, 1fr); } }

.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--border-soft); }
td { color: var(--ink); }
th { background: var(--surface2); color: var(--dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
tr.carrier td.r { color: var(--warn); font-weight: 600; }
tr.unrec td { background: var(--warn-bg); }
tr.unrec td.r { color: var(--warn); font-weight: 600; }
tr.redacted td { background: var(--warn-bg); }   /* a possible identifier was auto-redacted — verify */

.note { color: var(--warn); font-size: 13px; margin: 10px 2px 0; }
footer { text-align: center; color: var(--dim); padding: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.danger-link {
  background: transparent; border: 0; color: var(--bad); font-size: 12px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; opacity: .8;
}
.danger-link:hover { opacity: 1; text-decoration: underline; }
.danger-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- header bar (signed-in user) ---- */
header .bar { display: flex; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.whoname { color: var(--dim); font-size: 13px; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logout {
  background: transparent; color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; transition: background .15s;
}
.logout:hover { background: var(--surface3); }
.logout:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-glow); }

/* ---- billing banner ---- */
.billing-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0 0 16px;
  font-size: 14px;
}
.billing-banner[hidden] { display: none; }   /* display:flex above would defeat the hidden attribute */
.billing-banner.trial { background: var(--surface2); color: var(--dim); }
.billing-banner.blocked { background: var(--warn-bg); color: var(--ink); border-color: rgba(243, 115, 107, .25); }
.billing-banner .btn-primary { margin: 0 0 0 auto; padding: 8px 14px; font-size: 13px; }
.btn-secondary {
  margin-left: auto; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; transition: background .15s;
}
.btn-secondary:hover { background: var(--surface3); }
.btn-secondary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-glow); }
.uploader.disabled { opacity: .5; pointer-events: none; }

/* ---- authorization attestation ---- */
.attest {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--warn-bg); border: 1px solid rgba(240, 180, 80, .28); border-radius: 12px;
  padding: 14px; margin: 0 0 16px; font-size: 14px; color: var(--ink);
}
.attest[hidden] { display: none; }   /* same hidden-attribute guard as .phi-warn */
.attest-text { flex: 1 1 320px; color: var(--dim); }
.attest .btn-primary { margin: 0; padding: 9px 16px; font-size: 14px; flex-shrink: 0; }

/* ---- paste + settings (collapsible) ---- */
.paste, .settings { margin: 10px 2px 0; font-size: 14px; }
.paste > summary, .settings > summary {
  cursor: pointer; color: var(--dim); padding: 4px 0; list-style: revert; user-select: none;
}
.paste textarea {
  width: 100%; margin: 8px 0; font: inherit; font-size: 14px; color: var(--ink);
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; resize: vertical;
}
.paste textarea:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.settings label { display: block; font-size: 13px; color: var(--dim); margin: 10px 0 5px; }
.settings .opt { color: var(--dim2); }
.settings input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px;
}
.settings input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.settings .hint { color: var(--dim2); font-size: 12px; margin: 6px 0 0; }

/* ---- auth pages (login / signup) ---- */
.authwrap { max-width: 400px; }
.authcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow); padding: 22px; margin-top: 8px;
  display: flex; flex-direction: column;
}
.authcard h2 { margin: 0 0 14px; font-size: 18px; }
.authcard label { font-size: 13px; color: var(--dim); margin: 12px 0 5px; }
.authcard label .opt { color: var(--dim2); font-weight: 400; }
.authcard input {
  font: inherit; font-size: 16px; color: var(--ink); background: var(--surface2);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
}
.authcard input:focus {
  outline: 2px solid var(--focus); outline-offset: 1px;
  border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow);
}
.btn-primary {
  margin-top: 18px; padding: 12px 14px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--accent); color: #04231a; font-size: 15px; font-weight: 700;
  transition: background .15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px var(--accent-glow); }
.authalt { margin: 14px 0 0; font-size: 14px; color: var(--dim); text-align: center; }
.authalt a, .authcard a { color: var(--accent); text-decoration: none; }
.authalt a:hover { text-decoration: underline; }
.formerr {
  margin: 0 0 4px; padding: 10px 12px; border-radius: 10px; font-size: 14px;
  background: var(--warn-bg); color: var(--bad); border: 1px solid rgba(243, 115, 107, .25);
}
.authnote { text-align: center; margin-top: 16px; color: var(--dim); }

/* ---- banners + blackout tool (moved from index.html inline styles) ---- */
.phi-warn {
  background: #3a1d12; border: 1px solid #b4571e; color: #ffd9b8; border-radius: 10px;
  padding: 10px 12px; margin: 10px 0; font-size: 13px; display: flex; gap: 10px; align-items: flex-start;
}
.phi-warn[hidden] { display: none; }   /* display:flex above would defeat the hidden attribute */
.phi-warn button { margin-left: auto; }
.attest-text ul { margin: 8px 0; padding-left: 20px; }
.attest-text li { margin: 4px 0; }
.attest-text p { margin: 8px 0 0; }
.toggle { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 8px; cursor: pointer; }
.blackout { position: fixed; inset: 0; background: rgba(4, 9, 18, .97); z-index: 50; display: flex; flex-direction: column; }
.blackout[hidden] { display: none; }
.bo-head { padding: 10px 14px; color: #dbe7ff; font-size: 13px; }
.bo-canvaswrap { flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 0 8px; }
#boCanvas { max-width: 100%; max-height: 100%; touch-action: none; cursor: crosshair; border-radius: 6px; }
.bo-controls { display: flex; gap: 8px; padding: 10px; align-items: center; flex-wrap: wrap; }
.bo-controls .spacer { flex: 1; }
.bo-controls select { background: #101a2c; color: #dbe7ff; border: 1px solid #28395a; border-radius: 8px; padding: 6px; }

/* ---- engagement layer: hero goal ring (outer = goal, inner = pace vs required) ---- */
.ring-wrap { position: relative; width: 198px; height: 198px; flex: none; margin: 4px auto; }
.ring-wrap svg { transform: rotate(-90deg); display: block; width: 100%; height: 100%; }
.ring-bg { fill: none; stroke: var(--track); stroke-width: 13; }
.ring-val, .ring-lap, .ring-pace {
  fill: none; stroke-linecap: round;
  transition: stroke-dashoffset 1.2s cubic-bezier(.22, 1, .36, 1);
}
.ring-val { stroke: url(#ringGrad); stroke-width: 13; filter: drop-shadow(0 0 8px rgba(52, 211, 166, .5)); }
.ring-lap { stroke: var(--focus); stroke-width: 13; }   /* second lap past 100% */
.ring-pace { stroke: rgba(125, 211, 252, .55); stroke-width: 4; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 1px; }
.ring-center .pct { font-size: 36px; font-weight: 800; letter-spacing: -1.2px; color: var(--ink); font-variant-numeric: tabular-nums; }
.ring-center .lbl { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
.ring-center .lbl.goal { color: var(--dim2); margin-top: 2px; }
.prflag {
  font: 600 10px ui-sans-serif, system-ui; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent-base); border-radius: 4px; padding: 1px 5px;
}

/* ---- earnings ticker chip ---- */
.pay { position: relative; }
.paychip {
  position: absolute; right: 4px; top: -4px; color: var(--accent); font-weight: 700; font-size: 16px;
  text-shadow: 0 0 14px var(--accent-glow); pointer-events: none; animation: chipRise 1.4s ease-out forwards;
}
@keyframes chipRise { from { opacity: 0; transform: translateY(6px); }
  18% { opacity: 1; } to { opacity: 0; transform: translateY(-34px); } }

/* ---- duo: main chart + side column ---- */
.duo { display: grid; grid-template-columns: 1fr 300px; gap: 16px; margin-bottom: 16px; }
@media (max-width: 720px) { .duo { grid-template-columns: 1fr; } }
.duo .dash { margin-bottom: 0; }
.side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dash h2 {
  margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim);
}
.trendhead { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chartsub { font-size: 12px; color: var(--dim2); }
.tabs {
  margin-left: auto; display: flex; gap: 4px; background: rgba(11, 18, 32, .55);
  border: 1px solid var(--border); border-radius: 11px; padding: 4px;
}
.tab {
  background: none; border: 0; color: var(--dim); font: 600 12.5px/1 inherit; font-family: inherit;
  padding: 7px 12px; border-radius: 8px; cursor: pointer; transition: color .15s, background .15s;
}
.tab.active {
  color: #04211a; background: linear-gradient(135deg, #5be3c0, var(--accent-base));
  box-shadow: 0 2px 10px -2px var(--accent-glow);
}
.tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---- side cards: modality mix + records ---- */
.mix-row { display: grid; grid-template-columns: 30px 1fr 86px; gap: 10px; align-items: center; margin-top: 10px; }
.mix-row .m { font-size: 12px; font-weight: 700; color: var(--dim); }
.mix-bar { height: 9px; border-radius: 6px; background: var(--track); overflow: hidden; }
.mix-fill { height: 100%; width: 0; border-radius: 6px; transition: width 1.1s cubic-bezier(.22, 1, .36, 1); }
.mix-row .n { font-size: 11.5px; color: var(--dim); text-align: right; font-variant-numeric: tabular-nums; }
.rec { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border-soft); }
.rec:last-child { border: 0; padding-bottom: 2px; }
.rec .ico {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; font-size: 17px;
  background: rgba(52, 211, 166, .10); border: 1px solid rgba(52, 211, 166, .2); flex: none;
}
.rec .t { font-size: 12.5px; color: var(--dim); min-width: 0; }
.rec .t b { display: block; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---- year heatmap card ---- */
.months { display: grid; grid-auto-flow: column; font-size: 10.5px; color: var(--dim2); margin: 8px 0 4px; }
.heatscroll { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px);
  grid-auto-columns: 11px; gap: 2.5px; }
.hm { width: 11px; height: 11px; border-radius: 3px; background: var(--surface3); }
.hm.l1 { background: rgba(52, 211, 166, .18); } .hm.l2 { background: rgba(52, 211, 166, .36); }
.hm.l3 { background: rgba(52, 211, 166, .60); } .hm.l4 { background: rgba(52, 211, 166, .95); }
.hm.pr { outline: 1.5px solid var(--warn); outline-offset: 1px; }   /* gold ring = personal record */
.heatfoot { display: flex; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px;
  color: var(--dim); flex-wrap: wrap; }
.heatlegend { display: inline-flex; align-items: center; gap: 3px; }
.hl { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--surface3); }
.hl1 { background: rgba(52, 211, 166, .18); } .hl2 { background: rgba(52, 211, 166, .36); }
.hl3 { background: rgba(52, 211, 166, .60); } .hl4 { background: rgba(52, 211, 166, .95); }
#heatSum { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---- forecast cone ---- */
#coneSvg { width: 100%; height: 170px; display: block; }
.fchead { font-size: 13px; color: var(--dim); margin-bottom: 6px; display: flex; gap: 8px; }
.fchead #fcRange { margin-left: auto; font-variant-numeric: tabular-nums; }
.fc-actual { fill: none; stroke: var(--accent); stroke-width: 2; }
.fc-cone { fill: rgba(52, 211, 166, .10); stroke: none; }
.fc-proj { fill: none; stroke: var(--accent-base); stroke-width: 1.5; stroke-dasharray: 5 4; }
.fc-goal { stroke: var(--dim); stroke-width: 1; stroke-dasharray: 2 4; }
.fc-goaldot { fill: var(--focus); }
.fc-label { fill: var(--dim); font: 500 10px ui-sans-serif, system-ui; }
.goalline { margin-top: 8px; font-size: 13px; color: var(--accent); }
.goalline.behind { color: var(--warn); }

/* ---- what-if ---- */
.whatif { margin-top: 10px; background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 10px 14px; }
.whatif summary { cursor: pointer; color: var(--dim); font-size: 14px; }
.wifrow { display: flex; gap: 14px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.wifrow select { background: var(--surface2); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 8px; }
.wifslider { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--dim); }
.wifslider input { accent-color: var(--accent); width: 140px; }
.wifout { font-size: 15px; margin: 10px 0 2px; color: var(--ink); }
.wifout b { color: var(--accent); }

/* ---- milestone moment ---- */
.milestone { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.milestone[hidden] { display: none; }
.ms-glow { position: absolute; left: 50%; top: 40%; width: 320px; height: 320px;
  transform: translate(-50%, -50%) scale(.8);
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 65%);
  border-radius: 50%; opacity: 0; animation: msGlow .9s ease-out forwards; }
@keyframes msGlow { 30% { opacity: .45; } to { opacity: 0; transform: translate(-50%, -50%) scale(1.15); } }
.ms-particles { position: absolute; left: 50%; top: 46%; }
.msp { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 6px var(--accent-glow); opacity: 0; animation: mspRise 1.3s ease-out forwards; }
@keyframes mspRise { 12% { opacity: 1; } to { opacity: 0; transform: translateY(calc(-1 * var(--rise, 110px))); } }
.ms-caption { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; background: var(--surface2);
  border: 1px solid var(--accent-base); border-radius: 10px; padding: 10px 14px;
  color: var(--ink); font-size: 14px; font-weight: 600; box-shadow: 0 6px 24px rgba(0, 0, 0, .4); }
@media (prefers-reduced-motion: reduce) {
  .ms-glow, .msp { animation: none; opacity: 0; }
  .ring-val, .ring-lap, .ring-pace, .mix-fill { transition: none; }
  .eyebrow .dot, .pr-badge { animation: none; }
  .paychip { animation: none; opacity: 0; }
}

/* ---- mobile ---- */
@media (max-width: 420px) {
  .ring-wrap { width: 158px; height: 158px; }
  .ring-center .pct { font-size: 28px; }
  .leadnum { letter-spacing: -2px; }
}

/* ---- capture FAB (same picker as the dropzone, thumb-reach) ---- */
.fab {
  position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 14.5px/1 inherit; font-family: inherit; color: #04211a; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #5be3c0, var(--accent-base));
  border-radius: 999px; padding: 14px 20px;
  box-shadow: 0 10px 34px -8px var(--accent-glow), 0 4px 14px rgba(0, 0, 0, .4);
  transition: transform .15s;
}
.fab:hover { transform: translateY(-2px) scale(1.03); }
.fab:active { transform: scale(.97); }
.fab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .fab, .fab:hover, .fab:active { transition: none; transform: none; } }

/* ---- light shaft drifting across the water ---- */
.glint {
  position: absolute; top: -20%; left: -10%; width: 70%; height: 80%;
  background: radial-gradient(45% 45% at 50% 50%, rgba(125, 211, 252, .06), transparent 70%);
  animation: glint 26s ease-in-out infinite alternate;
}
@keyframes glint { to { transform: translate(36vw, 8vh) scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .glint { animation: none; } }
.phi-reason { display: block; margin-top: 6px; font-style: italic; opacity: .9; }

/* ---- manage data (undo upload / delete day) ---- */
.uploadlist { list-style: none; margin: 6px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.uploadlist li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--dim);
  background: var(--surface2); border: 1px solid var(--border-soft); border-radius: 8px; padding: 7px 10px;
  flex-wrap: wrap; }
.uploadlist li b { color: var(--ink); font-variant-numeric: tabular-nums; }
.uploadlist .up-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.uploadlist .up-actions .reset { margin-left: 0; }
.uploadlist .up-signed { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.uploadlist input[type="date"] { background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; padding: 5px 8px; font-size: 12px; }
.uploadlist .reset { padding: 4px 10px; font-size: 12px; }
.delrow { display: flex; gap: 10px; align-items: center; margin-top: 6px; }
.delrow input[type="date"] { background: var(--surface2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; }

/* blocked-uploader feedback: pulse the banner that's doing the blocking */
.pulse { animation: bannerPulse 1.2s ease-out 2; }
@keyframes bannerPulse {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  35% { box-shadow: 0 0 0 4px var(--accent-glow); }
}
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

/* three windows: Today (daily) / Year to date / All time */
.windows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.win {
  background: rgba(18, 28, 48, 0.72); border: 1px solid var(--border); border-radius: 14px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.win-today {
  background: linear-gradient(135deg, rgba(52, 211, 166, 0.12), rgba(18, 28, 48, 0) 55%), rgba(18, 28, 48, 0.72);
  border-color: var(--accent-base);
}
.win-k { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim2); font-weight: 700; }
.win-v { font-size: 30px; font-weight: 800; letter-spacing: -.5px; color: var(--ink); line-height: 1.05;
  font-variant-numeric: tabular-nums; }
.win-v small { font-size: 13px; font-weight: 600; color: var(--dim); letter-spacing: 0; }
.win-sub { font-size: 12.5px; color: var(--dim); }
.win-sub b { color: var(--ink); font-weight: 700; }
@media (max-width: 640px) { .windows { grid-template-columns: 1fr; } }

/* daily log — studies + wRVU read per SIGNED day */
.loghead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.logsub { color: var(--dim); font-size: 12px; }
.logtable td, .logtable th { padding: 8px 12px; }
.logtable tbody tr:hover td { background: var(--surface3); }
.logtable .logtoday td { background: rgba(52, 211, 166, 0.10); }
.logtable .logtoday td:first-child {
  font-weight: 700; color: var(--ink); box-shadow: inset 3px 0 0 var(--accent);
}
.logcard .tablewrap { max-height: 360px; overflow: auto; }
.logtable input.dayrate { width: 66px; background: var(--surface2); color: var(--ink);
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; font-size: 12px;
  text-align: right; font-variant-numeric: tabular-nums; }
.logtable input.dayrate.ovr { border-color: var(--accent-base); color: var(--accent); font-weight: 600; }
.logtable input.dayrate:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* signed-date prompt (count-now-confirm-later) */
.signed-prompt {
  background: linear-gradient(135deg, rgba(52, 211, 166, 0.12), rgba(18, 28, 48, 0)), var(--surface2);
  border: 1px solid var(--accent-base); color: var(--ink); border-radius: 10px;
  padding: 10px 12px; margin: 10px 0; font-size: 13px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.signed-prompt[hidden] { display: none; }   /* display:flex above would defeat [hidden] */
.signed-prompt .sp-text { flex: 1 1 240px; }
.signed-prompt small { color: var(--dim); }
.signed-prompt input[type="date"] {
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px;
}
