/* ------------------------------------------------------------------
   Flashcards — index cards on a desk.
   Tokens: "desk" is the page background, "paper" is a card surface.
   Text on the desk uses --on-desk; text on paper always uses --ink.
------------------------------------------------------------------- */
:root {
  --desk: #dfe6ef;
  --desk-deep: #cbd5e3;
  --on-desk: #1d2340;
  --on-desk-soft: #4f5877;
  --paper: #fffffb;
  --ink: #1d2340;
  --ink-soft: #5d6585;
  --rule: #b4c8e6;
  --margin: #e2575e;
  --hl-green: #b5ef9b;
  --hl-pink: #ffb3c9;
  --hl-yellow: #ffe55c;
  --focus: #3a6fd8;
  --shadow: 0 1px 0 rgba(29, 35, 64, .08), 0 6px 18px -8px rgba(29, 35, 64, .35);

  /* deck card stock */
  --stock-white: #fffffb;
  --stock-canary: #fff2a3;
  --stock-pink: #ffd5e0;
  --stock-blue: #d3e5ff;
  --stock-green: #d6f2cb;
  --stock-lilac: #e5daff;

  --font: "Bricolage Grotesque", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --hand: "Caveat", "Bradley Hand", "Segoe Print", cursive;

  --gutter: max(16px, env(safe-area-inset-left));
  --gutter-r: max(16px, env(safe-area-inset-right));
  --radius: 14px;
  --line: 28px; /* ruled-line spacing on cards */

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --desk: #151b2e;
    --desk-deep: #0f1424;
    --on-desk: #e9edf7;
    --on-desk-soft: #a3abc6;
    --paper: #f6f4ec;
    --rule: #b9c9e2;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -10px rgba(0, 0, 0, .8);
    --focus: #8fb2ff;
    --stock-white: #f6f4ec;
    --stock-canary: #f5e89a;
    --stock-pink: #f4cdd8;
    --stock-blue: #cbdcf5;
    --stock-green: #cfe8c4;
    --stock-lilac: #ddd3f5;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--desk);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--desk);
  color: var(--on-desk);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

button, input, textarea, select { font: inherit; color: inherit; }
button { touch-action: manipulation; cursor: pointer; }
a { color: inherit; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- page frame ---------- */
.app {
  min-height: 100vh;
  min-height: 100dvh;
}

.page {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 12px)
    var(--gutter-r)
    calc(env(safe-area-inset-bottom) + 40px)
    var(--gutter);
}

.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  margin-bottom: 8px;
}
.topbar .spacer { flex: 1; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--on-desk);
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
}
.icon-btn:active { background: var(--desk-deep); }
.icon-btn svg { width: 22px; height: 22px; flex: none; }

/* ---------- type ---------- */
.title {
  margin: 4px 0 2px;
  font-size: clamp(40px, 12vw, 52px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variation-settings: "opsz" 96;
}
.subtitle {
  margin: 0 0 28px;
  color: var(--on-desk-soft);
}
.h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}
.section-title {
  margin: 36px 0 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.muted { color: var(--on-desk-soft); }
.hand { font-family: var(--hand); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
  transition: transform .08s ease;
  user-select: none;
  -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-line { background: transparent; border-color: currentColor; }
.btn-plain { background: transparent; padding: 0 12px; }
.btn-danger { background: transparent; color: #c2333a; border-color: currentColor; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

@media (prefers-color-scheme: dark) {
  .page > .btn-primary,
  .row > .btn-primary,
  .empty .btn-primary,
  .study-controls .btn-primary { background: var(--on-desk); color: var(--desk); }
  .btn-danger { color: #ff8a8f; }
}

.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > .btn { flex: 1 1 auto; }

/* ---------- the index card surface ---------- */
.paper {
  position: relative;
  background-color: var(--stock, var(--paper));
  color: var(--ink);
  border-radius: 6px;
  box-shadow: var(--shadow);
  background-image:
    /* plain header strip + red rule, painted over the ruled lines */
    linear-gradient(to bottom,
      var(--stock, var(--paper)) 0, var(--stock, var(--paper)) calc(var(--head) - 2px),
      var(--margin) calc(var(--head) - 2px), var(--margin) var(--head),
      transparent var(--head)),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule) calc(var(--line) - 1px), var(--rule) var(--line));
  background-position: 0 0, 0 var(--head);
  background-repeat: no-repeat, repeat;
  --head: 64px;
}

/* ---------- home: decks as stacks ---------- */
.decks { display: grid; gap: 26px; padding: 0; margin: 0; list-style: none; }

.deck {
  position: relative;
  isolation: isolate;
}
.deck::before,
.deck::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 6px;
  background: var(--stock, var(--paper));
  box-shadow: var(--shadow);
  filter: brightness(.96);
}
.deck::before { transform: rotate(-2.2deg) translate(-2px, 6px); }
.deck::after { transform: rotate(1.4deg) translate(3px, 3px); }
.deck[data-count="0"]::before,
.deck[data-count="0"]::after { display: none; }

.deck .paper { padding: 18px 18px 18px; --head: 66px; }
.deck-name {
  margin: 0;
  height: 44px;
  display: flex;
  align-items: center;
  font-size: 23px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.1;
  overflow: hidden;
}
.deck-name span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.deck-meta {
  margin: 12px 0 14px;
  min-height: var(--line);
  line-height: var(--line);
  font-family: var(--hand);
  font-size: 23px;
  color: var(--ink-soft);
}
.deck .row .btn-primary { background: var(--ink); color: #fff; }
.deck .row .btn-line { color: var(--ink); }

.new-deck {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 72px;
  margin-top: 26px;
  border: 2px dashed var(--on-desk-soft);
  border-radius: 8px;
  background: transparent;
  color: var(--on-desk);
  font-weight: 600;
  font-size: 18px;
}
.new-deck:active { background: var(--desk-deep); }
.new-deck svg { width: 22px; height: 22px; }

.empty {
  padding: 0 22px 24px;
  text-align: left;
  --head: 70px;
}
.empty h2 { margin: 0; height: 68px; display: flex; align-items: center; font-size: 24px; font-weight: 800; }
.empty p { margin: 14px 0 20px; line-height: var(--line); font-family: var(--hand); font-size: 24px; color: var(--ink-soft); }
.empty .btn-primary { background: var(--ink); color: #fff; }

.backup {
  margin-top: 44px;
  padding-top: 20px;
  border-top: 1px solid var(--desk-deep);
}
.backup p { margin: 0 0 14px; color: var(--on-desk-soft); font-size: 15px; }

/* ---------- deck editor ---------- */
.deck-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 16px;
}
.deck-head .h2 { flex: 1; font-size: 30px; padding-top: 6px; }

.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin: 0 0 20px; padding: 0; border: 0; }
.swatches legend { margin-bottom: 8px; font-size: 15px; color: var(--on-desk-soft); padding: 0; }
.swatch {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid rgba(29, 35, 64, .18);
  background: var(--stock);
}
.swatch input {
  position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer;
}
.swatch:has(input:checked) { border-color: var(--on-desk); box-shadow: 0 0 0 2px var(--desk), 0 0 0 4px var(--on-desk); }
.swatch:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }

.add-card {
  padding: 16px 16px 18px;
  --head: 0px;
  background-image: none;
}
.add-card .h3 { margin: 0 0 12px; font-size: 19px; font-weight: 800; }

.field { display: block; margin-bottom: 12px; }
.field > span { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--ink-soft); }
.input, .textarea {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  border: 2px solid #c3cad9;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 17px; /* >= 16px stops iOS zooming on focus */
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}
.textarea { resize: vertical; min-height: 76px; }
.input:focus, .textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.hint { margin: -4px 0 12px; font-size: 14px; color: var(--ink-soft); }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: #e9edf4;
}
.tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 16px;
}
.tabs button[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(29,35,64,.18); }

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 34px 0 12px;
}
.list-head .section-title { margin: 0; }

.search { margin-bottom: 14px; }
.search .input { border-color: transparent; background: var(--paper); box-shadow: var(--shadow); }

.cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.card-item {
  display: block;
  width: 100%;
  padding: 12px 14px 12px 18px;
  border: 0;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-align: left;
  position: relative;
}
.card-item::before {
  content: "";
  position: absolute;
  left: 8px; top: 12px; bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--margin);
  opacity: .7;
}
.card-item:active { filter: brightness(.97); }
.card-front { display: block; font-weight: 600; overflow-wrap: anywhere; white-space: pre-wrap; }
.card-back { display: block; margin-top: 2px; color: var(--ink-soft); overflow-wrap: anywhere; white-space: pre-wrap; }
.card-front, .card-back {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-stats { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.no-results { padding: 20px 4px; color: var(--on-desk-soft); }

.danger-zone { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--desk-deep); }

/* ---------- study ---------- */
.study {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 8px)
    var(--gutter-r)
    calc(env(safe-area-inset-bottom) + 16px)
    var(--gutter);
}
.study-top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.study-top .count { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--on-desk-soft); }
.progress {
  height: 6px;
  margin: 6px 0 0;
  border-radius: 6px;
  background: var(--desk-deep);
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--on-desk);
  border-radius: inherit;
  transition: width .3s ease;
}

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 22px 0 18px;
  min-height: 300px;
  perspective: 1400px;
}

.flip {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  max-height: 640px; /* fills the space between the top bar and the buttons */
  min-height: 280px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
/* every scroll container inside the card must also allow only vertical panning,
   otherwise the browser claims horizontal swipes and cancels them */
.flip * { touch-action: pan-y; }

.flip-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.3, .7, .25, 1);
}
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: 0 22px 20px 22px;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  --head: 58px;
}
.face.back { transform: rotateY(180deg); }

.face-label {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--hand);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-soft);
}
.face.back .face-label { color: var(--margin); }

.face-text {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 0;
  text-align: center;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.face-text > span { margin: auto; } /* centers, but stays scrollable when long */
.face-text.sz-xl { font-size: clamp(34px, 10vw, 46px); line-height: 1.12; font-weight: 800; }
.face-text.sz-l { font-size: 28px; line-height: 1.22; }
.face-text.sz-m { font-size: 22px; line-height: 1.32; }
.face-text.sz-s { font-size: 18px; line-height: 1.45; font-weight: 400; text-align: left; }
.face-text.sz-s > span { margin: 0 auto auto 0; }

/* swipe feedback: a highlighter wash over the card */
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--wash, transparent);
  opacity: var(--wash-o, 0);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.tap-hint {
  flex: none;
  text-align: center;
  font-family: var(--hand);
  font-size: 22px;
  color: var(--ink-soft);
}

.study-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 64px;
}
.study-controls .btn { min-height: 60px; font-size: 19px; border-radius: 14px; }
.study-controls .btn-reveal { grid-column: 1 / -1; }
.btn-miss { background: var(--hl-pink); color: #5c1028; }
.btn-got { background: var(--hl-green); color: #183d0b; }

/* study setup + results */
.setup .paper, .result .paper { padding: 0 20px 22px; --head: 64px; }
.setup-head { height: 62px; display: flex; align-items: center; margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.015em; overflow: hidden; }
.choice-list { display: grid; gap: 10px; margin: 18px 0 18px; padding: 0; border: 0; }
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid #c3cad9;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.choice input { width: 22px; height: 22px; margin: 0; accent-color: var(--ink); flex: none; }
.choice:has(input:checked) { border-color: var(--ink); }
.choice:has(input:disabled) { opacity: .5; }
.choice b { display: block; font-weight: 600; }
.choice small { display: block; font-size: 14px; color: var(--ink-soft); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; }
.toggle-row small { display: block; font-size: 14px; color: var(--ink-soft); }

.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #c3cad9; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.grade {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 168px;
  margin: 8px 0 6px;
}
.grade-mark {
  position: relative;
  font-family: var(--hand);
  font-weight: 700;
  font-size: 84px;
  line-height: 1;
  color: var(--margin);
  transform: rotate(-6deg);
  padding: 10px 26px 14px;
}
.grade-mark svg {
  position: absolute;
  inset: -12px -18px;
  width: calc(100% + 36px);
  height: calc(100% + 24px);
  overflow: visible;
}
.grade-mark path {
  fill: none;
  stroke: var(--margin);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: draw .9s .25s cubic-bezier(.5, 0, .3, 1) forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
.grade-note { margin: 0 0 18px; text-align: center; font-family: var(--hand); font-size: 26px; line-height: var(--line); color: var(--ink); }

.missed-list { margin: 0 0 18px; padding: 0; list-style: none; }
.missed-list li {
  padding: 6px 0;
  overflow-wrap: anywhere;
}
.missed-list b { font-weight: 600; }
.missed-list span { display: block; color: var(--ink-soft); }
.result .stack { display: grid; gap: 10px; }
.result .btn-primary, .setup .btn-primary { background: var(--ink); color: #fff; }
.result .btn-line { color: var(--ink); }

/* ---------- sheet (dialog) ---------- */
.sheet {
  width: min(560px, calc(100% - 24px));
  max-height: calc(100dvh - env(safe-area-inset-top) - 24px);
  margin: calc(env(safe-area-inset-top) + 12px) auto auto;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .45);
  overflow: auto;
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(15, 20, 36, .5); }
.sheet[open] { animation: sheet-in .22s ease-out; }
@keyframes sheet-in { from { transform: translateY(-14px); opacity: 0; } }
.sheet-inner { padding: 18px 18px 20px; }
.sheet-title { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -0.015em; }
.sheet-text { margin: 0 0 18px; color: var(--ink-soft); }
/* primary button is first in the DOM (so Enter submits it) but sits on the right */
.sheet-actions { display: flex; flex-direction: row-reverse; gap: 10px; margin-top: 18px; }
.sheet-actions .btn { flex: 1; }
.sheet .btn-primary { background: var(--ink); color: #fff; }
.sheet .btn-line { color: var(--ink); }
.sheet .btn-danger-fill { background: #c2333a; color: #fff; }
.sheet .delete-link { margin-top: 12px; width: 100%; color: #c2333a; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 20px);
  z-index: 50;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,.5);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-color-scheme: dark) {
  .toast { background: var(--on-desk); color: var(--desk); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .grade-mark path { stroke-dashoffset: 0; }
}

/* small phones (iPhone SE etc.) */
@media (max-width: 360px) {
  .study-controls .btn { font-size: 17px; }
  .face { padding: 0 16px 16px; }
}
/* short screens / landscape */
@media (max-height: 560px) {
  .flip { min-height: 200px; }
  .stage { padding: 10px 0; }
}

/* ---------- progress ---------- */
.deck-meta span { display: block; }
.deck .row .btn { padding: 0 14px; }

.result .btn-plain { color: var(--ink); }

.progress-page .notes { padding: 0 20px 20px; --head: 64px; }
.note-lines {
  margin: 0 0 4px;
  padding-top: 0;
  font-family: var(--hand);
  font-size: 23px;
  line-height: var(--line);
  color: var(--ink);
}
.note-lines span { display: block; }
.notes .btn-primary { margin-top: 18px; background: var(--ink); color: #fff; }

.panel {
  padding: 6px 16px 10px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.chart-panel { padding: 14px 6px 12px; }
.chart { position: relative; min-height: 196px; touch-action: pan-y; border-radius: 6px; }
.chart svg { display: block; overflow: visible; -webkit-user-select: none; user-select: none; }
.chart .grid { stroke: rgba(29, 35, 64, .13); stroke-width: 1; }
.chart .tick { fill: var(--ink-soft); font-family: var(--font); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart .end-label { fill: var(--ink); font-family: var(--font); font-size: 13px; font-weight: 600; }
.chart .area { fill: var(--ink); opacity: .08; }
.chart .line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ring { fill: var(--paper); }
.chart .cross { stroke: var(--ink-soft); stroke-width: 1; }
.chart .focus { fill: none; stroke: var(--ink); stroke-width: 2; }
.dot { fill: var(--ink); }
.dot.hollow { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.chart-tip {
  position: absolute;
  z-index: 2;
  min-width: 128px;
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  pointer-events: none;
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .5);
}
.chart-tip b { display: block; font-weight: 600; font-size: 15px; }
.chart-tip span { display: block; opacity: .85; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 10px 12px 0; font-size: 14px; color: var(--ink-soft); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-hint { margin: 8px 12px 0; font-size: 13px; color: var(--ink-soft); }

.card-item.static { cursor: default; }
.card-item.static:active { filter: none; }

.runs { margin: 0; padding: 0; list-style: none; }
.runs li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1px 12px;
  padding: 11px 0;
  border-top: 1px solid rgba(29, 35, 64, .1);
}
.runs li:first-child { border-top: 0; }
.run-when { font-weight: 600; }
.run-score { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.run-mode, .run-pct { font-size: 14px; color: var(--ink-soft); }
.run-pct { text-align: right; font-variant-numeric: tabular-nums; }
.panel .btn-plain { color: var(--ink); margin-top: 2px; }

.progress-page .section-title { margin-top: 32px; }
.progress-page .list-head { margin: 32px 0 12px; }
.progress-page .list-head .section-title { margin: 0; }
