/* ============================================================
   Joint Log
   A measurement instrument, not an app: cool neutral greys,
   monospaced legends, hairline rules, calibrated tracks.
   ============================================================ */

:root {
  /* Cool-neutral ink scale (dark is the primary scheme) */
  --ink-0:  #0B0C0D;   /* page            */
  --ink-1:  #131517;   /* surface         */
  --ink-2:  #1B1E21;   /* track / raised  */
  --ink-3:  #23272B;   /* pressed         */
  --rule:   #2A2E33;   /* hairlines       */
  --dim:    #79828A;   /* secondary text  */
  --dimmer: #4E555C;   /* tertiary        */
  --fg:     #EDF0F2;   /* primary text    */

  /* Severity scale, 0 → 10. Hue turns green→red and brightness
     climbs with it, so the order survives colour blindness. */
  --scale-0: #178355;   /* 0   calm      */
  --scale-1: #6BA531;   /* 2.5 mild      */
  --scale-2: #D9AC1C;   /* 5   moderate  */
  --scale-3: #E8762A;   /* 7.5 bad       */
  --scale-4: #F04A3C;   /* 10  worst     */

  /* Track fill stays neutral — the logger is not a severity read. */
  --ramp-lo: #1B1E21;
  --ramp-hi: #EDF0F2;

  /* Rising pain, flares, errors: the top of the scale. */
  --signal: var(--scale-4);

  --radius:    10px;
  --radius-sm: 6px;

  --mono: ui-monospace, "SF Mono", SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;

  --pad: 18px;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --ink-0:  #F7F7F5;
    --ink-1:  #FFFFFF;
    --ink-2:  #ECEDEE;
    --ink-3:  #E0E2E4;
    --rule:   #DCDEE0;
    --dim:    #6B737A;
    --dimmer: #9AA1A8;
    --fg:     #14181B;
    --ramp-lo: #E6E8EA;
    --ramp-hi: #14181B;
    /* Deeper and less luminous, to hold up against white. */
    --scale-0: #10704A;
    --scale-1: #55892C;
    --scale-2: #9A7708;
    --scale-3: #C25F16;
    --scale-4: #C93429;
    --signal:  var(--scale-4);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--ink-0);
  color: var(--fg);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

body { -webkit-tap-highlight-color: transparent; }

button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: 3px;
}

[hidden] { display: none !important; }

/* Instrument legend: the recurring label voice */
.eyebrow,
.legend {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0;
}

/* ============================================================
   Gate (boot + sign-in)
   ============================================================ */

.gate {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: var(--ink-0);
  z-index: 60;
}

.gate-inner { width: 100%; max-width: 340px; text-align: center; }
.gate-mark  { color: var(--fg); opacity: .9; margin-bottom: 20px; }

.gate-title {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 0 0 32px;
}

.gate-form { display: grid; gap: 12px; text-align: left; }

.field { display: grid; gap: 6px; }

.field-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 13px;
  background: var(--ink-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 16px;               /* 16px stops iOS zooming on focus */
  transition: border-color .15s var(--ease);
}
.field input:focus { outline: none; border-color: var(--dim); }

.gate-error {
  font-size: 13px;
  line-height: 1.45;
  color: var(--signal);
  margin: 2px 0 0;
}

.gate-status {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--dimmer);
  margin: 24px 0 0;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  transition: transform .12s var(--ease), opacity .12s var(--ease), background .12s var(--ease);
}
.btn:active { transform: scale(.975); }

.btn-primary { background: var(--fg); color: var(--ink-0); }
.btn-primary:disabled { opacity: .28; transform: none; }

.btn-ghost {
  height: 38px;
  padding: 0 14px;
  background: var(--ink-1);
  border: 1px solid var(--rule);
  color: var(--dim);
}
.btn-ghost:active { background: var(--ink-2); color: var(--fg); }

.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--dim);
  border-radius: var(--radius-sm);
  margin-right: -8px;
}
.icon-btn:active { background: var(--ink-1); color: var(--fg); }

/* ============================================================
   App frame
   ============================================================ */

.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-x: hidden;
  max-width: 100vw;
}

.topbar {
  flex: none;
  padding: calc(env(safe-area-inset-top) + 10px) 0 0;
  background: var(--ink-0);
  border-bottom: 1px solid var(--rule);
  z-index: 20;
}

.topbar-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0 var(--pad) 12px;
}

.date-title {
  font-family: var(--mono);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: .04em;
  margin: 5px 0 0;
}

/* ── Date strip ───────────────────────────────────────────── */

.datestrip {
  display: flex;
  gap: 6px;
  padding: 0 var(--pad) 11px;
  overflow-x: auto;
  overflow-y: hidden;             /* pin the cross axis */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.datestrip::-webkit-scrollbar { display: none; }

.daychip {
  flex: none;
  width: 42px;
  padding: 7px 0 6px;
  border-radius: var(--radius-sm);
  display: grid;
  justify-items: center;
  gap: 4px;
  background: transparent;
  transition: background .12s var(--ease);
}
.daychip:active { background: var(--ink-1); }

.daychip-dow {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--dimmer);
}
.daychip-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--dim);
  line-height: 1;
}
.daychip-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--dimmer);
  opacity: .35;
}
.daychip.has-entry .daychip-dot { background: var(--fg); opacity: 1; }
.daychip.is-selected { background: var(--ink-2); }
.daychip.is-selected .daychip-num { color: var(--fg); }
.daychip.is-selected .daychip-dow { color: var(--dim); }
.daychip.is-today .daychip-num { text-decoration: underline; text-underline-offset: 3px; }

/* ── Scroll body ──────────────────────────────────────────── */

.scroll {
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;   /* don't hand scroll to the page */
}

.scroll-tail { height: calc(env(safe-area-inset-bottom) + 30px); }

/* ============================================================
   Collapsed day summary
   ============================================================ */

.summary {
  width: calc(100% - var(--pad) * 2);
  margin: 14px var(--pad) 0;
  padding: 14px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--ink-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-align: left;
  transition: background .12s var(--ease);
}
.summary:active { background: var(--ink-2); }

.summary-left { display: grid; gap: 5px; min-width: 0; }

.summary-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}

.summary-stats {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: .02em;
  color: var(--fg);
}
.summary-stats b { font-weight: 500; }
.summary-stats i { font-style: normal; color: var(--dimmer); padding: 0 7px; }

.summary-edit {
  flex: none;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

/* ============================================================
   Logger
   ============================================================ */

.logger {
  padding: 16px var(--pad) 104px;
  transition: opacity .28s var(--ease);
}
.logger.is-collapsing { opacity: 0; }

.logger-tools { margin-bottom: 20px; }

.logger-foot {
  font-size: 12px;
  line-height: 1.5;
  color: var(--dimmer);
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

/* ── Joint group ──────────────────────────────────────────── */

.jgroup { margin-bottom: 22px; }

.jgroup-name {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 9px;
}

/* ── The calibrated track: the signature object ───────────── */

.jrow {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
}

.jrow-side {
  flex: none;
  width: 11px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dimmer);
  text-align: center;
}

.track {
  flex: 1;
  position: relative;
  height: 44px;              /* full 44pt touch target */
  display: flex;
  align-items: center;
  touch-action: pan-y;       /* vertical scroll stays native */
  min-width: 0;
}

.track-bed {
  position: absolute;
  left: 0; right: 0;
  height: 26px;
  border-radius: 7px;
  background: var(--ink-2);
  overflow: hidden;
}

.track-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0;
  background: var(--ramp-hi);
  opacity: .13;
  transition: width .14s var(--ease);
}

/* Calibration ticks: 11 stops, every fifth is taller */
.track-ticks {
  position: absolute;
  left: 5.5px; right: 5.5px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.tick {
  width: 1px;
  height: 5px;
  background: var(--dimmer);
  opacity: .5;
  border-radius: .5px;
}
.tick.major { height: 9px; opacity: .8; }

/* Where yesterday sat */
.track-ghost {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 20px;
  margin-top: -10px;
  border-radius: 1px;
  background: var(--fg);
  opacity: .3;
  pointer-events: none;
  transition: left .14s var(--ease);
}

/* The machined cap that marks the value */
.track-cap {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 26px;
  margin-top: -13px;
  margin-left: -2.5px;
  border-radius: 2.5px;
  background: var(--ramp-hi);
  transition: left .14s var(--ease), transform .12s var(--ease), opacity .14s var(--ease);
  opacity: 0;
  pointer-events: none;
}

.track.is-set .track-cap { opacity: 1; }
.track.is-dragging .track-cap { transform: scaleY(1.14); }
.track.is-dragging .track-fill,
.track.is-dragging .track-cap { transition: none; }

/* Value badge doubles as the yesterday-adopt button */
.jval {
  flex: none;
  width: 34px;
  height: 44px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--dimmer);
  border-radius: var(--radius-sm);
  transition: color .12s var(--ease), background .12s var(--ease);
}
.jval.is-set { color: var(--fg); }
.jval.is-recall { color: var(--dim); }
.jval.is-recall:active { background: var(--ink-2); }

.jval-recall {
  display: grid;
  justify-items: center;
  gap: 3px;
}
.jval-recall::after {
  content: "";
  width: 10px;
  height: 1px;
  background: var(--dimmer);
  opacity: .8;
}

/* ── Save bar ─────────────────────────────────────────────── */

.savebar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 10px var(--pad) calc(env(safe-area-inset-bottom) + 10px);
  background: color-mix(in srgb, var(--ink-0) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--rule);
  transform: translateY(0);
  transition: transform .3s var(--ease);
}
.savebar.is-hidden { transform: translateY(140%); }

.savebar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.savebar-count {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .1em;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
}
.savebar-count.is-complete { color: var(--fg); }

.savebar .btn-primary { flex: 1; max-width: 190px; }

/* ============================================================
   Dashboard
   ============================================================ */

.dash { padding: 6px var(--pad) 0; }

.card {
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.card:first-child { border-top: 0; padding-top: 18px; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg);
  margin: 0;
}

.card-note {
  font-size: 12px;
  line-height: 1.5;
  color: var(--dimmer);
  margin: 12px 0 0;
}

/* Segmented control */
.seg {
  display: flex;
  gap: 2px;
  padding: 2px;
  background: var(--ink-1);
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
}
.seg button {
  padding: 5px 9px;
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dim);
  transition: background .12s var(--ease), color .12s var(--ease);
}
.seg button.is-on { background: var(--ink-3); color: var(--fg); }

/* Big readouts */
.readouts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.readout {
  background: var(--ink-1);
  padding: 14px 12px 13px;
  display: grid;
  gap: 6px;
}
.readout-val {
  font-family: var(--mono);
  font-size: 25px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.readout-val small { font-size: 13px; color: var(--dimmer); font-weight: 400; }
.readout-lab {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  line-height: 1.3;
}

/* Body node map */
.bodymap { display: grid; justify-items: center; gap: 14px; }
.bodymap svg { width: 100%; max-width: 220px; height: auto; overflow: visible; }
.node { transition: fill .2s var(--ease); cursor: pointer; }
.bodymap-readout {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--dim);
  min-height: 15px;
  text-align: center;
}
.bodymap-readout b { color: var(--fg); font-weight: 500; }

/* Ramp key */
.rampkey {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .1em;
  color: var(--dimmer);
}
.rampkey-bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right,
    var(--scale-0), var(--scale-1), var(--scale-2), var(--scale-3), var(--scale-4));
  border: 1px solid var(--rule);
}

/* Charts */
.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart-line   { fill: none; stroke: var(--fg); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-raw    { fill: none; stroke: var(--dim); stroke-width: 1; opacity: .5; stroke-linejoin: round; }
.chart-grid   { stroke: var(--rule); stroke-width: 1; }
.chart-axis   { font-family: var(--mono); font-size: 9px; fill: var(--dimmer); letter-spacing: .06em; }
.chart-dot    { fill: var(--fg); }
.chart-flare  { fill: none; stroke: var(--signal); stroke-width: 1.5; }

/* Per-joint trend rows */
.trendrow {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
}
.trendrow:last-child { border-bottom: 0; }

.trendrow-name {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trendrow-spark { flex: none; opacity: .75; }
.trendrow-now {
  flex: none;
  width: 30px;
  text-align: right;
  font-family: var(--mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.trendrow-delta {
  flex: none;
  width: 52px;
  text-align: right;
  font-family: var(--mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--dimmer);
}
.trendrow-delta.up   { color: var(--signal); }
.trendrow-delta.down { color: var(--fg); }

/* Calendar heatmap */
.calwrap { display: grid; gap: 9px; }

/* One scroller holds both the labels and the grid, so a month
   name can never drift away from the column it belongs to. */
.cal-scroll {
  overflow-x: auto;
  overflow-y: hidden;             /* or the browser makes this `auto` too */
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cal-scroll::-webkit-scrollbar { display: none; }

.cal-inner {
  display: inline-flex;
  flex-direction: column;
  gap: 7px;
  min-width: 100%;
}

.cal {
  display: flex;
  align-items: flex-start;        /* stop columns stretching to the card */
  gap: 3px;
}
.calweek {
  flex: none;
  display: grid;
  grid-template-rows: repeat(7, 13px);   /* fixed, not 1fr */
  gap: 3px;
}
.calcell {
  width: 13px; height: 13px;
  border-radius: 3px;
  background: var(--ink-1);
}
/* A day you didn't log reads as a plain grey tile: clearly a cell,
   clearly not a score. Faint outlines used to merge into blobs. */
.calcell.empty  { background: var(--ink-2); }
.calcell.future { background: transparent; }

.calmonths {
  display: flex;
  gap: 3px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dimmer);
  height: 11px;
  line-height: 11px;
}
.calmonths span {
  flex: none;
  width: 13px;
  overflow: visible;
  white-space: nowrap;
}

/* Generic list rows (symmetry, pairs, flares) */
.listrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .04em;
}
.listrow:last-child { border-bottom: 0; }
.listrow-k { text-transform: uppercase; color: var(--fg); min-width: 0; }
.listrow-v { flex: none; color: var(--dim); font-variant-numeric: tabular-nums; }
.listrow-v b { color: var(--fg); font-weight: 500; }
.listrow-sub { display: block; text-transform: none; letter-spacing: 0; color: var(--dimmer); font-size: 10px; margin-top: 3px; }

/* Locked card */
.locked {
  padding: 22px 16px;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  text-align: center;
  display: grid;
  gap: 7px;
}
.locked-title {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.locked-sub { font-size: 12px; line-height: 1.5; color: var(--dimmer); }

/* Empty state */
.empty { padding: 46px 20px; text-align: center; display: grid; gap: 9px; }
.empty-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.empty-sub { font-size: 13px; line-height: 1.55; color: var(--dimmer); }

/* ============================================================
   Sheet, toast
   ============================================================ */

.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 40;
  animation: fade .2s var(--ease);
}

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  background: var(--ink-1);
  border-top: 1px solid var(--rule);
  border-radius: 16px 16px 0 0;
  padding: 8px var(--pad) calc(env(safe-area-inset-bottom) + 14px);
  animation: rise .26s var(--ease);
}

.sheet-grip {
  width: 34px; height: 4px;
  border-radius: 2px;
  background: var(--rule);
  margin: 4px auto 10px;
}

.sheet-item {
  width: 100%;
  padding: 15px 2px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sheet-item:last-child { border-bottom: 0; }
.sheet-item:active { color: var(--dim); }
.sheet-item-quiet { color: var(--dim); }

.sheet-hint {
  flex: none;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: none;
  color: var(--dimmer);
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 88px);
  transform: translateX(-50%);
  z-index: 55;
  padding: 10px 16px;
  background: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
  white-space: nowrap;
  max-width: calc(100vw - 36px);
  overflow: hidden;
  text-overflow: ellipsis;
  animation: toast-rise .22s var(--ease);
}
.toast.is-error { border-color: var(--signal); color: var(--signal); }

@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: translateY(0) } }

/* The toast is centred with translateX, so its keyframe has to
   carry that too — otherwise the animation would knock it left. */
@keyframes toast-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) }
  to   { opacity: 1; transform: translateX(-50%) translateY(0) }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
   Print — the "save as PDF" report
   ============================================================ */

@media print {
  :root {
    --ink-0: #fff; --ink-1: #fff; --ink-2: #f0f0f0; --ink-3: #e8e8e8;
    --rule: #ccc; --dim: #555; --dimmer: #888; --fg: #000;
    --ramp-lo: #f0f0f0; --ramp-hi: #000;
    --scale-0: #1B7A50; --scale-1: #6E9C33; --scale-2: #C89A10;
    --scale-3: #CE6A1C; --scale-4: #C93429;
  }
  html, body {
    height: auto;
    background: #fff;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;      /* or every cell prints blank */
  }
  .app { display: block; height: auto; }
  .topbar, .savebar, .logger, .summary, .sheet, .sheet-scrim, .toast, .scroll-tail, .seg { display: none !important; }
  .scroll { overflow: visible; height: auto; }
  .dash { padding: 0; }
  .card { break-inside: avoid; page-break-inside: avoid; }
  .print-header { display: block !important; }
}

.print-header { display: none; margin-bottom: 18px; }
.print-header h2 { font-family: var(--mono); font-size: 15px; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 4px; }
.print-header p { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; color: var(--dim); margin: 0; }
