/* LingoCat — design tokens and shared components.
   Look: dreamy gradients (lilac → pink → peach) with film grain, frosted-glass cards,
   felt-toy 3D art and soft "clay" buttons. Six colour themes, chosen by the student. */

/* Self-hosted font (OFL), subset to Latin + Cyrillic. License in /fonts. */
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("../fonts/MPLUSRounded1c-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("../fonts/MPLUSRounded1c-Bold.woff2") format("woff2");
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: "M PLUS Rounded 1c";
  src: url("../fonts/MPLUSRounded1c-ExtraBold.woff2") format("woff2");
  font-weight: 800 900;
  font-display: swap;
}

/* ------------------------------------------------------------------ themes */

:root,
[data-theme="dream"] {
  --bg-a: #b9a0f4;
  --bg-b: #eeb0de;
  --bg-c: #ffc9a6;
  --blob-1: #a996f5;
  --blob-2: #ffc0e3;
  --blob-3: #ffcf9f;
  --accent: #ff4f8b;
  --accent-ink: #c41c5c;
  --accent-soft: #ffe2ed;
  --tile-a: #fff8fb;
  --tile-b: #ffe9f2;
  --stage-a: #fff3f8;
  --stage-b: #ffdcea;
  --swatch-ring: #ffffff;
  --theme-color: #e8b2e3;
}
[data-theme="ocean"] {
  --bg-a: #9fb7ff;
  --bg-b: #a9dcf7;
  --bg-c: #c4f3e2;
  --blob-1: #e1ecff;
  --blob-2: #8fd3ff;
  --blob-3: #d2fff0;
  --accent: #3b82f6;
  --accent-ink: #1d4fc4;
  --accent-soft: #e2edff;
  --tile-a: #f8fbff;
  --tile-b: #e5f1ff;
  --stage-a: #f3f9ff;
  --stage-b: #d9ecff;
  --theme-color: #a9cbf6;
}
[data-theme="mint"] {
  --bg-a: #9fe3c9;
  --bg-b: #c5f0d8;
  --bg-c: #fff3b8;
  --blob-1: #e5fff3;
  --blob-2: #8fe0c2;
  --blob-3: #fff7cf;
  --accent: #10a37f;
  --accent-ink: #0b7a5f;
  --accent-soft: #dcf7ec;
  --tile-a: #f8fffb;
  --tile-b: #e3f8ee;
  --stage-a: #f4fff9;
  --stage-b: #d6f5e6;
  --theme-color: #b5ecd2;
}
[data-theme="sunset"] {
  --bg-a: #ffb38f;
  --bg-b: #ff9fb2;
  --bg-c: #ffd38f;
  --blob-1: #ffe1cf;
  --blob-2: #ff8fa8;
  --blob-3: #ffe9b8;
  --accent: #f0504f;
  --accent-ink: #b8282c;
  --accent-soft: #ffe4dc;
  --tile-a: #fffaf6;
  --tile-b: #ffebe2;
  --stage-a: #fff6f0;
  --stage-b: #ffdcd0;
  --theme-color: #ffb0a4;
}
[data-theme="lilac"] {
  --bg-a: #b9a6ff;
  --bg-b: #d8c6ff;
  --bg-c: #f6d9ff;
  --blob-1: #ece4ff;
  --blob-2: #a996ff;
  --blob-3: #ffe3fb;
  --accent: #8b5cf6;
  --accent-ink: #6436d6;
  --accent-soft: #efe8ff;
  --tile-a: #fbf9ff;
  --tile-b: #efe8ff;
  --stage-a: #f8f5ff;
  --stage-b: #e6dcff;
  --theme-color: #cdbdfd;
}

/* shared (light themes) */
:root {
  --ink: #3a2350;
  --ink-2: #67527f;
  --ink-3: #8a76a1;
  --glass: rgba(255, 255, 255, 0.56);
  --glass-2: rgba(255, 255, 255, 0.4);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-line: rgba(255, 255, 255, 0.8);
  --glass-blur: 18px;
  --shade: 98 46 126;
  --title: #ffffff;
  --title-shadow: 0 2px 10px rgba(110, 40, 120, 0.25);

  --cta-a: #ffd76d;
  --cta-b: #ffa04d;
  --cta-ink: #4a2408;
  --pink-a: #ff79ad;
  --pink-b: #f0457f;
  --good: #11906e;
  --good-ink: #0b6e54;
  --good-tint: #d9f6ea;
  --bad: #d63460;
  --bad-ink: #b0244c;
  --bad-tint: #ffe1e9;
  --warn: #9a5b00;
  --warn-tint: #fff0d4;
  --coin: #f5b83d;

  --food-a: #ffcf70;
  --food-b: #ff8f5a;
  --joy-a: #ffa3d2;
  --joy-b: #ff5797;

  --chart-accent: var(--accent);
  --chart-rest: rgba(103, 82, 127, 0.25);
  --chart-grid: rgba(103, 82, 127, 0.14);

  /* legacy names still used by a few components */
  --bg: transparent;
  --paper: var(--glass-strong);
  --paper-2: var(--glass);
  --line: rgba(103, 82, 127, 0.16);
  --line-strong: rgba(103, 82, 127, 0.3);
  --melon-tint: var(--accent-soft);
  --cherry: var(--accent);

  --font-ui: "M PLUS Rounded 1c", ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Arial Rounded MT Bold", system-ui, sans-serif;

  --r-s: 14px;
  --r-m: 20px;
  --r-l: 28px;
  --r-xl: 36px;
  --focus: 0 0 0 3px rgba(255, 255, 255, 0.95), 0 0 0 6px var(--accent);

  --t-xs: 0.8rem;
  --t-s: 0.9rem;
  --t-m: 1rem;
  --t-l: 1.2rem;
  --t-xl: 1.5rem;
  --t-xxl: 1.9rem;
}

[data-theme="night"] {
  --bg-a: #1f1a4d;
  --bg-b: #47307c;
  --bg-c: #8d4f8f;
  --blob-1: #4b3a9c;
  --blob-2: #7a3f9a;
  --blob-3: #c06a9a;
  --accent: #ff7eb3;
  --accent-ink: #ffb3d1;
  --accent-soft: rgba(255, 126, 179, 0.18);
  --tile-a: rgba(255, 255, 255, 0.16);
  --tile-b: rgba(255, 255, 255, 0.07);
  --stage-a: #3b2f78;
  --stage-b: #6b4a9e;
  --theme-color: #2c2363;
  --ink: #fbf5ff;
  --ink-2: #dccdee;
  --ink-3: #b4a3cb;
  --glass: rgba(42, 30, 88, 0.5);
  --glass-2: rgba(42, 30, 88, 0.34);
  --glass-strong: rgba(52, 38, 104, 0.88);
  --glass-line: rgba(255, 255, 255, 0.18);
  --shade: 8 4 30;
  --good-tint: rgba(17, 144, 110, 0.25);
  --good-ink: #8ff0c9;
  --bad-tint: rgba(214, 52, 96, 0.25);
  --bad-ink: #ffb0c4;
  --warn-tint: rgba(255, 200, 100, 0.2);
  --warn: #ffd58a;
  --chart-rest: rgba(220, 205, 238, 0.28);
  --chart-grid: rgba(220, 205, 238, 0.14);
  --line: rgba(220, 205, 238, 0.16);
  --line-strong: rgba(220, 205, 238, 0.3);
  --focus: 0 0 0 3px rgba(31, 26, 77, 0.95), 0 0 0 6px var(--accent);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg-b);
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--t-m);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background: transparent;
  position: relative;
}

/* dreamy gradient + soft glowing blobs, fixed behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(55% 42% at 12% 8%, var(--blob-1) 0%, transparent 70%),
    radial-gradient(50% 38% at 92% 30%, var(--blob-2) 0%, transparent 72%),
    radial-gradient(70% 45% at 40% 104%, var(--blob-3) 0%, transparent 70%),
    linear-gradient(168deg, var(--bg-a) 0%, var(--bg-b) 50%, var(--bg-c) 100%);
}
/* film grain: the texture that keeps gradients from looking flat */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.015em;
}
h1 { font-size: var(--t-xxl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-l); }

p { margin: 0; }
a { color: inherit; }

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

[hidden] { display: none !important; }

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

.muted { color: var(--ink-2); }
.small { font-size: var(--t-s); }
.num { font-variant-numeric: tabular-nums; }
.num-strong { font-weight: 800; font-variant-numeric: tabular-nums; }
.stack { display: grid; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }

/* ------------------------------------------------------------------ surfaces */

.glass,
.card {
  position: relative;
  background: linear-gradient(160deg, var(--glass-strong), var(--glass) 55%, var(--glass-2));
  border: 1.5px solid var(--glass-line);
  border-radius: var(--r-l);
  box-shadow:
    0 22px 44px -26px rgb(var(--shade) / 0.55),
    0 2px 6px -2px rgb(var(--shade) / 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.card { padding: 18px; }

/* the 3D emoji icons (Fluent Emoji 3D, MIT) */
.emo {
  display: inline-block;
  width: 1.6em;
  height: 1.6em;
  object-fit: contain;
  flex: none;
  vertical-align: middle;
  filter: drop-shadow(0 3px 4px rgb(var(--shade) / 0.18));
  user-select: none;
  -webkit-user-drag: none;
}
/* line icons (dom.js icon()) */
.icon { display: inline-flex; flex: none; }
.icon svg { display: block; }

/* ------------------------------------------------------------------ buttons */

.btn {
  --btn-a: var(--glass-strong);
  --btn-b: var(--glass);
  --btn-ink: var(--ink);
  --btn-edge: rgb(var(--shade) / 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 20px;
  border: 1.5px solid var(--glass-line);
  border-radius: 999px;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b));
  color: var(--btn-ink);
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 10px 20px -12px rgb(var(--shade) / 0.55),
    inset 0 2px 0 rgba(255, 255, 255, 0.55),
    inset 0 -3px 0 var(--btn-edge);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.btn:hover:not(:disabled) { filter: brightness(1.04); }
.btn:active:not(:disabled) {
  transform: translateY(2px) scale(0.99);
  box-shadow:
    0 4px 10px -8px rgb(var(--shade) / 0.5),
    inset 0 2px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 var(--btn-edge);
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  filter: saturate(0.7);
}
/* main call to action: warm sunshine "clay" */
.btn-cta,
.btn-primary {
  --btn-a: var(--cta-a);
  --btn-b: var(--cta-b);
  --btn-ink: var(--cta-ink);
  --btn-edge: rgba(150, 60, 0, 0.28);
  border-color: rgba(255, 255, 255, 0.65);
}
.btn-pink {
  --btn-a: var(--pink-a);
  --btn-b: var(--pink-b);
  --btn-ink: #ffffff;
  --btn-edge: rgba(130, 0, 50, 0.3);
  border-color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(120, 0, 50, 0.35);
}
.btn-good {
  --btn-a: #3ccf9c;
  --btn-b: #12a079;
  --btn-ink: #ffffff;
  --btn-edge: rgba(0, 80, 55, 0.3);
  border-color: rgba(255, 255, 255, 0.55);
  text-shadow: 0 1px 2px rgba(0, 60, 40, 0.35);
}
.btn-quiet {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.btn-quiet:hover { background: var(--glass-2); }
.btn-danger { --btn-ink: var(--bad-ink); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: var(--t-l); padding: 12px 26px; }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: var(--t-s); }
.btn .emo { width: 1.5em; height: 1.5em; margin: -4px 0; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1.5px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 8px 16px -12px rgb(var(--shade) / 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.icon-btn:hover { background: var(--glass-strong); }
.icon-btn svg { width: 22px; height: 22px; }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent-ink);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* glass capsule (coins, streak, mood) */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 4px 14px 4px 8px;
  border-radius: 999px;
  background: var(--glass);
  border: 1.5px solid var(--glass-line);
  box-shadow: 0 10px 20px -14px rgb(var(--shade) / 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  font-weight: 800;
  white-space: nowrap;
}
.pill .emo { width: 26px; height: 26px; }
.pill.bump { animation: bump 0.45s ease-out; }
@keyframes bump {
  40% { transform: scale(1.12); }
}

/* ------------------------------------------------------------------ forms */

.field { display: grid; gap: 6px; }
.field > span,
.field > label {
  font-weight: 800;
  font-size: var(--t-s);
}
.field small { color: var(--ink-2); font-size: var(--t-xs); }
.field .error-text { color: var(--bad-ink); font-size: var(--t-xs); font-weight: 800; }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 50px;
  padding: 11px 16px;
  border: 1.5px solid var(--glass-line);
  border-radius: var(--r-m);
  background: var(--glass-strong);
  box-shadow: inset 0 2px 6px rgb(var(--shade) / 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 100px; resize: vertical; line-height: 1.45; }
.input::placeholder,
.textarea::placeholder { color: var(--ink-3); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.input[aria-invalid="true"],
.textarea[aria-invalid="true"] { border-color: var(--bad); }

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 800;
}
.switch input {
  appearance: none;
  width: 48px;
  height: 30px;
  margin: 0;
  border-radius: 999px;
  background: var(--line-strong);
  position: relative;
  cursor: pointer;
  transition: background-color 0.15s ease;
  flex: none;
}
.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }

/* segmented control (tabs) */
.segmented {
  display: flex;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: var(--glass-2);
  border: 1.5px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow-x: auto;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-weight: 800;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.segmented button .emo { width: 24px; height: 24px; }
.segmented button[aria-selected="true"] {
  background: var(--glass-strong);
  color: var(--accent-ink);
  box-shadow: 0 6px 14px -8px rgb(var(--shade) / 0.5), inset 0 0 0 2px var(--accent);
}

/* language toggle */
.lang-toggle {
  display: inline-flex;
  padding: 4px;
  gap: 2px;
  border-radius: 999px;
  background: var(--glass);
  border: 1.5px solid var(--glass-line);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.lang-toggle button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 6px 14px;
  min-height: 34px;
  font-weight: 800;
  font-size: var(--t-s);
  color: var(--ink-2);
  cursor: pointer;
}
.lang-toggle button[aria-pressed="true"] {
  background: var(--glass-strong);
  color: var(--accent-ink);
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  font-size: var(--t-xs);
  font-weight: 800;
  color: var(--ink-2);
  white-space: nowrap;
}
.chip .emo { width: 16px; height: 16px; }
.chip-good { background: var(--good-tint); border-color: transparent; color: var(--good-ink); }
.chip-bad { background: var(--bad-tint); border-color: transparent; color: var(--bad-ink); }
.chip-warn { background: var(--warn-tint); border-color: transparent; color: var(--warn); }

.coin-dot {
  display: inline-block;
  width: 1em;
  height: 1em;
  flex: none;
  vertical-align: -0.15em;
}

.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 28px 16px;
  text-align: center;
  color: var(--ink-2);
}
.empty strong { color: var(--ink); font-size: var(--t-l); }

/* ------------------------------------------------------------------ toast */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(104px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 100;
  width: min(92vw, 420px);
  pointer-events: none;
}
.toast {
  padding: 13px 18px;
  border-radius: var(--r-m);
  background: rgba(52, 30, 78, 0.88);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 16px 34px -14px rgba(40, 10, 60, 0.6);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: toast-in 0.22s ease-out;
}
.toast.bad { background: rgba(180, 30, 75, 0.92); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ dialog / bottom sheet */

dialog.sheet {
  border: 0;
  padding: 0;
  margin: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
  color: inherit;
}
dialog.sheet::backdrop {
  background: rgba(58, 24, 80, 0.32);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 88vh;
  overflow-y: auto;
  background: linear-gradient(180deg, var(--glass-strong), var(--tile-b));
  border: 1.5px solid var(--glass-line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -20px 50px -20px rgb(var(--shade) / 0.5);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  animation: sheet-up 0.26s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
[data-theme="night"] .sheet-panel { background: linear-gradient(180deg, rgba(60, 44, 118, 0.96), rgba(40, 28, 88, 0.96)); }
.sheet-panel::before {
  content: "";
  display: block;
  width: 46px;
  height: 5px;
  border-radius: 99px;
  background: rgb(var(--shade) / 0.22);
  margin: 0 auto 14px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
@media (min-width: 720px) {
  .sheet-panel {
    left: 50%;
    right: auto;
    bottom: 50%;
    width: min(560px, 92vw);
    transform: translate(-50%, 50%);
    border-radius: var(--r-xl);
    border-bottom: 1.5px solid var(--glass-line);
    animation: none;
  }
  .sheet-panel::before { display: none; }
}
@keyframes sheet-up {
  from { transform: translateY(46px); opacity: 0.5; }
  to { transform: none; opacity: 1; }
}

/* ------------------------------------------------------------------ chart chrome (shared) */

.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis-label { fill: var(--ink-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--chart-grid); stroke-width: 1; }
.chart .mark { cursor: default; }
.chart .mark:hover,
.chart .mark:focus { opacity: 0.8; outline: none; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: var(--t-xs);
  color: var(--ink-2);
  font-weight: 800;
}
.chart-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: -1px;
}
.chart-tip {
  position: absolute;
  pointer-events: none;
  z-index: 5;
  min-width: 120px;
  padding: 8px 10px;
  border-radius: var(--r-s);
  background: var(--glass-strong);
  border: 1px solid var(--glass-line);
  box-shadow: 0 10px 24px -10px rgb(var(--shade) / 0.5);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  font-size: var(--t-xs);
  line-height: 1.4;
  white-space: nowrap;
}
.chart-tip strong { font-size: var(--t-s); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 6px; }
.chart-tip .tip-row i { display: inline-block; width: 10px; height: 3px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
