/* Anatoma catalogue (HTML port): obsidian studio tokens, shared with the
   landing site. This file is self-contained: the landing's style.css is NOT
   imported, because the two deploy under different roots
   (site/ → /var/www/anatoma, web/ → /var/www/app) and drift beats coupling. */

@font-face {
  font-family: Vazirmatn;
  src: url("assets/fonts/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: Vazirmatn;
  src: url("assets/fonts/Vazirmatn-SemiBold.woff2") format("woff2");
  font-weight: 600; font-display: swap;
}

:root {
  /* Slate: the same cool clinical ground as the landing page. Browse
     surfaces are read in ambient light; the viewer is the dark room. Page
     (87% luminance) / raised (94%) / card (100%) are three visible steps. */
  --ink: #e9edf1;
  --ink-2: #f7f9fb;
  --ink-3: #e3e8ee;
  --rule: #cfd7de;
  --rule-2: #dbe1e7;
  --text: #151a21;
  --dim: #3f4954;
  --faint: #5b6672;
  --cyan: #0a7389;        /* accent: between ink and card, so it reads as colour */
  --cyan-hover: #086274;
  --cyan-ink: #ffffff;
  --cyan-tint: #15a9c7;   /* fills that carry ink text: selection, focus, modality */
  --cyan-soft: #daeff5;
  --gold: #8a5e0f;
  --gold-soft: #f6edda;
  --danger: #b3364b;
  /* the dark band: header and footer, the same ink-blue as the landing hero */
  /* The dark band (header, footer) and the dark CARD (imaging tiles) share a
     scale. Neither is pure black: the band is ink-blue, the card is a soft
     charcoal, both a step lighter than the image so a black MRI still has
     its own black. */
  --deep: #1b242e;
  --deep-2: #222d39;
  --deep-3: #2a3643;
  --deep-line: #34414f;
  --deep-text: #f4f6f8;
  --deep-muted: #c2cbd4;
  --deep-subtle: #9aa6b2;
  --accent-on-dark: #45c2de;
  --on-accent-dark: #06222c;
  --tile-card: #1c2129;
  --tile-card-2: #252b35;
  --tile-card-line: #323a46;
  --tile-text: #eef1f4;
  --tile-muted: #aab4bf;
  --pad: 20px;
  --maxw: 1440px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* per-modality hues, retuned for a light ground (tokens.dart modality()) */
  --mod-mr: #7556cc;
  --mod-ct: #1c68df;
  --mod-radiograph: #0f7a5a;
  --mod-dsa: #c02f6e;
  --mod-pet: #8a5e0f;
  --mod-endoscopy: #c0392b;
  --mod-illustration: #0b7a72;
  --mod-other: #6b7280;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font: 400 15px/1.6 Vazirmatn, Tahoma, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
html[lang="fa"] body { font-feature-settings: "ss01"; }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -.02em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input { font: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }
::selection { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--text); }


.shell { width: min(var(--maxw), 100% - var(--pad) * 2); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; inset-inline-start: 16px; top: -48px; z-index: 50;
  padding: 9px 16px; border: 1px solid var(--rule); border-radius: 8px;
  background: var(--ink-2); transition: top .15s;
}
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
/* The header is a raised slate band, one step lighter than the page, not a
   dark one. With imaging cards now dark objects, a dark header on top of
   them made the page dark / light / dark again (the "blinding" report): the
   eye crossed a ~15:1 seam at every scroll. A light header, slate page and
   dark cards read as one tonal sequence. The footer keeps the dark close. */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--ink-2) 94%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  border-block-end: 1px solid var(--rule);
  box-shadow: 0 8px 24px -14px rgba(10,14,20,.18);
}
.bar-in {
  max-width: var(--maxw); margin-inline: auto; padding: 0 var(--pad);
  display: flex; align-items: center; gap: 16px; min-height: 56px;
}
.brand { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.brand-mark { width: 20px; height: 20px; color: var(--text); }
.brand-name { font-weight: 700; font-size: 16px; }

.searchwrap {
  position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0;
  display: flex; align-items: center;
}
.search-ic {
  position: absolute; inset-inline-start: 12px; width: 16px; height: 16px;
  color: var(--faint); pointer-events: none;
}
#q {
  width: 100%; padding: 9px 36px; border: 1px solid var(--rule);
  border-radius: 10px; background: var(--ink-2); color: var(--text);
  font-size: 14px;
}
#q::placeholder { color: var(--faint); }
#q:focus { outline: none; border-color: var(--cyan); }
#q::-webkit-search-cancel-button { display: none; }
.qclear {
  position: absolute; inset-inline-end: 6px; width: 26px; height: 26px;
  border-radius: 7px; color: var(--dim); font-size: 17px; line-height: 1;
}
.qclear:hover { color: var(--text); background: var(--ink-3); }

.bar-end { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex: 0 0 auto; }
.lang {
  padding: 7px 12px; border: 1px solid var(--rule); border-radius: 8px;
  color: var(--dim); font-size: 13px; font-weight: 600;
}
.lang:hover { color: var(--text); border-color: var(--faint); }
.acct {
  display: flex; align-items: center; gap: 6px; max-width: 220px;
  padding: 7px 11px; border: 1px solid var(--rule); border-radius: 8px;
  color: var(--dim); font-size: 13px;
}
.acct:hover { color: var(--text); border-color: var(--faint); }
.acct svg { width: 15px; height: 15px; flex: 0 0 auto; }
.acct span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 20px; border: 1px solid transparent;
  border-radius: 10px; font-size: 14px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }
.btn[hidden], .acct[hidden], [hidden] { display: none !important; }
.btn-primary { background: var(--cyan); color: var(--cyan-ink); }
.btn-primary:hover { background: var(--cyan-hover); }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-ghost { border-color: var(--rule); color: var(--text); }
.btn-ghost:hover { background: var(--ink-3); border-color: var(--faint); }

/* ---------- tier switch ---------- */
.tierbar { padding: 14px 0 0; }
main, #main { padding-block-start: 28px; }
.tierbar .seg { margin-block-end: 12px; }
.seg {
  display: inline-flex; gap: 4px; padding: 4px;
  border: 1px solid var(--rule); border-radius: 10px;
}
.seg button {
  padding: 7px 16px; border-radius: 7px; color: var(--dim); font-size: 13.5px;
}
.seg button.is-on { background: var(--text); color: #fff; font-weight: 600; }
/* Same distance from the seg above and the filter row below: the seg row
   is 40px tall, so a 12px gap on both sides makes the hint sit centred
   between them rather than hugging the seg. */
.tierhint {
  display: flex; align-items: baseline; gap: 6px;
  margin-block: 0 14px; padding-block: 0; color: var(--faint); font-size: 11.5px; line-height: 1.4; min-height: 1.4em;
}
.tierhint::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border-radius: 2px; background: color-mix(in srgb, var(--gold) 70%, transparent); }
.tierhint.is-lapsed { color: var(--gold); }

/* ---------- filters ---------- */
.filters { padding-block: 0 2px; }
.frow { display: flex; align-items: baseline; gap: 12px; margin-block-end: 8px; }
.flabel { flex: 0 0 auto; color: var(--faint); font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button {
  padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--dim); font-size: 12.5px;
}
.chips button:hover { color: var(--text); border-color: var(--faint); }
.chips button.is-on { background: var(--text); border-color: var(--text); color: #fff; font-weight: 600; }
.chips .n { color: var(--faint); font-size: 10.5px; margin-inline-start: 4px; font-variant-numeric: tabular-nums; }
.chips button.is-on .n { color: rgba(255,255,255,.62); }
.clearbtn { color: var(--cyan); font-size: 12.5px; font-weight: 600; margin-block-start: 2px; }
.clearbtn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- sections & grid ---------- */
#grid { flex: 1 0 auto; padding-block: 16px 40px; }
.section { margin-block-end: 30px; }
.sec-head {
  display: flex; align-items: center; gap: 10px;
  padding-block: 8px 12px;
}
.sec-head h2 { font-size: 17px; letter-spacing: -.01em; }
.count-pill {
  padding: 2px 9px; border-radius: 999px; background: var(--ink-3);
  border: 1px solid var(--rule-2); color: var(--dim); font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
}
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* An imaging card is ONE dark object: tile and caption share a charcoal
   surface, so the black MRI never sits in a white frame (a 19:1 jump, 64
   times a page: that was the glare). Illustration cards invert to light. */
.card {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--tile-card-line); border-radius: 14px; overflow: hidden;
  background: var(--tile-card); color: var(--tile-text); cursor: pointer;
  box-shadow: 0 1px 2px rgba(10,14,20,.08);
  transition: transform .18s cubic-bezier(.2,.7,.3,1), border-color .18s, box-shadow .18s;
}
@media (prefers-reduced-motion: no-preference) {
  .card:hover { transform: translateY(-2px); }
}
.card:hover { border-color: #4a5666; box-shadow: 0 6px 18px rgba(10,14,20,.18); }
.card.is-illus { background: var(--ink-2); border-color: var(--rule-2); color: var(--text); box-shadow: 0 1px 2px rgba(24,26,30,.05); }
.card.is-illus .lock-tag { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 34%, transparent); color: var(--gold); backdrop-filter: none; }
.card.is-illus:hover { border-color: var(--rule); box-shadow: 0 3px 12px rgba(24,26,30,.09); }
.card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.card.is-locked { border-color: color-mix(in srgb, var(--gold) 55%, var(--tile-card-line)); }
.card.is-illus.is-locked { border-color: color-mix(in srgb, var(--gold) 38%, transparent); }
.card .shot {
  position: relative; aspect-ratio: 16 / 9.5; background: #000; border-block-end: 1px solid var(--tile-card-line);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* letterbox bars: the tile is true black so a thumbnail whose own black is
   #000 merges with it; the inset edge seats the image into the charcoal card */
.card .shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.04), inset 0 -10px 24px -14px rgba(0,0,0,.9);
}
.card.is-illus .shot::after { box-shadow: inset 0 0 0 1px rgba(20,26,32,.05); }
.card .shot img {
  position: relative; z-index: 1;
  width: 100%; height: 100%; object-fit: contain;
  opacity: 0; transition: opacity .25s;
}
.card .shot img.ok { opacity: 1; }
.card.is-illus .shot { background: #fbfcfd; border-block-end-color: var(--rule-2); }
.badge {
  position: absolute; z-index: 2; top: 8px; inset-inline-start: 8px;
  padding: 2px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .02em;
}
/* modality badge: a translucent tint of the modality hue, legible on both
   card materials (the per-hue --mod-* token is set on :root) */
.badge-mod { background: color-mix(in srgb, var(--mod-mr) 18%, rgba(20,24,30,.78)); color: #fff; backdrop-filter: blur(6px); }
.badge-mod[data-m="ct"] { background: color-mix(in srgb, var(--mod-ct) 18%, rgba(20,24,30,.78)); }
.badge-mod[data-m="radiograph"] { background: color-mix(in srgb, var(--mod-radiograph) 18%, rgba(20,24,30,.78)); }
.badge-mod[data-m="dsa"] { background: color-mix(in srgb, var(--mod-dsa) 18%, rgba(20,24,30,.78)); }
.badge-mod[data-m="pet"] { background: color-mix(in srgb, var(--mod-pet) 18%, rgba(20,24,30,.78)); }
.badge-mod[data-m="endoscopy"] { background: color-mix(in srgb, var(--mod-endoscopy) 18%, rgba(20,24,30,.78)); }
.badge-mod[data-m="illustration"] { background: color-mix(in srgb, var(--mod-illustration) 18%, rgba(20,24,30,.78)); }
.card.is-illus .badge-mod { background: color-mix(in srgb, var(--mod-illustration) 12%, #fff); color: var(--mod-illustration); backdrop-filter: none; }
.card.is-illus .badge-mod[data-m="mr"] { background: color-mix(in srgb, var(--mod-mr) 12%, #fff); color: var(--mod-mr); }
.card.is-illus .badge-mod[data-m="ct"] { background: color-mix(in srgb, var(--mod-ct) 12%, #fff); color: var(--mod-ct); }
.badge-free { background: var(--cyan); color: var(--cyan-ink); top: 8px; inset-inline-start: 8px; }
.badge-mod { inset-inline-start: 8px; }
.card .badge-free + .badge-mod { inset-inline-start: auto; inset-inline-end: 8px; }
.lock-tag {
  position: absolute; z-index: 2; inset-block-end: 8px; inset-inline-end: 8px;
  display: flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(251,191,36,.14);
  border: 1px solid rgba(251,191,36,.35);
  color: #fbbf24; font-size: 10.5px; font-weight: 600;
  backdrop-filter: blur(6px);
}
.lock-tag svg { width: 10px; height: 10px; }
.card-body { padding: 10px 12px 12px; }
.card.is-illus .card-meta { color: var(--faint); }
.card:hover .card-name { color: #fff; }
.card.is-illus:hover .card-name { color: var(--text); }
.card-name {
  font-size: 13.5px; font-weight: 600; line-height: 1.35; color: var(--tile-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  unicode-bidi: plaintext;
}
.card.is-illus .card-name { color: var(--text); }
.card-meta { margin-block-start: 3px; color: var(--tile-muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.learn-link { margin-inline-start: 8px; padding-inline-start: 8px; border-inline-start: 1px solid var(--tile-card-line); color: var(--accent-on-dark); text-decoration: none; font-weight: 600; }
.learn-link:hover { text-decoration: underline; text-underline-offset: 2px; }

/* gradient placeholder while the thumb loads (modality-tinted) */
.ph { position: absolute; z-index: 0; inset: 0; display: flex; align-items: center; justify-content: center; }
.ph svg { width: 26px; height: 26px; opacity: .5; }
/* Loading state: the tile is the image's own backdrop (dark for imaging,
   paper for illustrations), so the glyph stays neutral and legible on both. */
.ph { color: rgba(255,255,255,.42); }
.card.is-illus .ph { color: rgba(23,25,28,.30); }

/* ---------- skeleton ---------- */
.skel-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
@media (max-width: 560px) { .skel-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
.skel { border: 1px solid var(--rule-2); border-radius: 14px; overflow: hidden; background: var(--ink-2); }
.skel .s-shot { aspect-ratio: 16 / 9.5; }
.skel .s-line { height: 11px; margin: 12px; border-radius: 6px; }
.skel .s-line.short { width: 55%; margin-block-start: 0; }
.skel .s-shot, .skel .s-line {
  background: linear-gradient(100deg, var(--ink-3) 40%, #f3f5f7 50%, var(--ink-3) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) {
  .skel .s-shot, .skel .s-line { animation: none; }
}

/* ---------- states ---------- */
.state { padding-block: 90px; text-align: center; }
.state-title { font-size: 16px; font-weight: 600; color: var(--dim); }
.state-sub { margin-block-start: 8px; color: var(--faint); font-size: 13px; unicode-bidi: plaintext; }
.state .btn { margin-block-start: 18px; }
.count-note { color: var(--faint); font-size: 12.5px; margin-block-start: 6px; }

/* ---------- label search results ---------- */
#hits { margin-block-start: 10px; }
.hits-head { display: flex; align-items: center; gap: 10px; padding-block: 6px 10px; }
.hits-head h2 { font-size: 15px; }
.hits-count {
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: color-mix(in srgb, var(--cyan) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--cyan) 27%, transparent);
  color: var(--cyan);
}
.searching { display: flex; align-items: center; gap: 8px; padding-block: 8px; color: var(--faint); font-size: 12.5px; }
.spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--rule); border-block-start-color: var(--cyan);
  animation: rot .8s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }

.hits-panel {
  border: 1px solid var(--rule-2); border-radius: 14px; background: var(--ink-2);
  overflow: hidden;
}
.hitgroup { border-block-end: 1px solid var(--rule-2); }
.hitgroup:last-child { border-block-end: 0; }
.hitgroup-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 14px; text-align: start;
}
.hitgroup-head:hover { background: var(--ink-3); }
.hitgroup-head .gname { font-weight: 600; font-size: 13.5px; }
.hitgroup-head .gcount { color: var(--faint); font-size: 11.5px; }
.hitgroup-head .chev { margin-inline-start: auto; color: var(--faint); transition: transform .15s; }
.hitgroup.open .chev { transform: rotate(180deg); }
.hitrows { display: none; }
.hitgroup.open .hitrows { display: block; }
.hitrow {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  padding: 8px 14px 8px 18px; text-align: start;
  border-block-start: 1px solid var(--rule-2); font-size: 13px;
}
.hitrow:hover { background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.hitrow .htext { color: var(--text); unicode-bidi: plaintext; }
.hitrow .hseries { color: var(--faint); font-size: 11.5px; margin-inline-start: auto; flex: 0 0 auto; }
.hitrow .hpos { color: var(--cyan); font-size: 11px; font-family: var(--mono); direction: ltr; unicode-bidi: isolate; flex: 0 0 auto; }
.hitmore {
  display: block; width: 100%; padding: 9px; color: var(--cyan);
  font-size: 12.5px; font-weight: 600; border-block-start: 1px solid var(--rule-2);
}
.hitmore:hover { background: var(--ink-3); }
.hitmore:disabled { color: var(--faint); cursor: default; }

/* ---------- footer ---------- */
.foot { background: var(--deep); border-block-start: 1px solid var(--deep-line); padding-block: 18px; flex-shrink: 0; }
.foot-in {
  max-width: var(--maxw); margin-inline: auto; padding: 0 var(--pad);
  display: flex; gap: 16px; color: var(--deep-subtle); font-size: 12.5px;
}
.foot a { color: var(--deep-muted); }
.foot a:hover { color: var(--deep-text); }
.foot-in a { margin-inline-start: auto; color: var(--dim); }
.foot-in a:hover { color: var(--text); }

/* ---------- pay sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 40;
  background: color-mix(in srgb, #000 62%, transparent);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0;
}
.overlay[hidden] { display: none; }
@media (min-width: 640px) { .overlay { align-items: center; } }
.sheet {
  width: min(460px, 100%); max-height: 88dvh; overflow: auto;
  background: var(--ink-2); border: 1px solid var(--rule);
  border-radius: 18px 18px 0 0; padding: 22px 20px;
  display: flex; flex-direction: column; gap: 12px;
}
@media (min-width: 640px) { .sheet { border-radius: 18px; } }
.sheet h3 { font-size: 18px; }
.sheet-sub { color: var(--dim); font-size: 13.5px; }
.planrow {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: 12px;
  text-align: start;
}
.planrow:hover { border-color: var(--faint); }
.planrow.is-on { border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 7%, transparent); }
.planrow .pname { font-weight: 600; font-size: 14px; }
.planrow .pdays { color: var(--faint); font-size: 11.5px; }
.planrow .pamount { margin-inline-start: auto; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.pay-note { color: var(--dim); font-size: 12.5px; line-height: 1.7; }
.payrow { display: flex; gap: 8px; }
.payrow input {
  flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--rule);
  border-radius: 10px; background: var(--ink); color: var(--text); font-size: 14px;
}
.payrow input:focus { outline: none; border-color: var(--cyan); }
.payrow input[dir] { direction: ltr; text-align: start; }
.pay-done { color: #34d399; font-size: 13px; line-height: 1.7; }
.pay-err { color: var(--danger); font-size: 13px; }

/* account menu */
.menu {
  position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 30;
  min-width: 200px; padding: 6px;
  background: var(--ink-2); border: 1px solid var(--rule); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(24,26,30,.13), 0 2px 6px rgba(24,26,30,.06);
}
.menu .m-email {
  padding: 8px 10px; color: var(--faint); font-size: 11.5px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr;
}
.menu button {
  display: block; width: 100%; padding: 9px 10px; border-radius: 8px;
  text-align: start; font-size: 13.5px;
}
.menu button:hover { background: var(--ink-3); }
.menu .m-meta { padding: 0 10px 8px; color: var(--faint); font-size: 11px; display: flex; gap: 8px; flex-wrap: wrap; }
.menu .m-tier { font-weight: 600; }
.menu .m-tier.full, .menu .m-tier.general { color: var(--gold); }
.menu .m-tier.is-lapsed, .menu .m-exp.is-lapsed { color: var(--gold); }
.menu hr { border: 0; border-block-start: 1px solid var(--rule-2); margin: 6px 0; }

@media (max-width: 640px) {
  :root { --pad: 14px; }
  .bar-in { gap: 10px; }
  /* Two-row header: brand + language + sign-in on the first row, search
     full-width on the second. One row cannot hold all five at 390px without
     clipping the name or squeezing the field below a usable width. */
  .bar-in { flex-wrap: wrap; padding-block: 8px; row-gap: 8px; }
  .brand { order: 1; gap: 6px; }
  .brand-name { font-size: 15px; }
  .bar-end { order: 2; margin-inline-start: auto; }
  .searchwrap { order: 3; flex: 1 1 100%; max-width: none; }
  .acct span { display: none; }
  .tierbar { padding-block-start: 10px; }
  /* Filters: one scrollable line per group instead of 7 wrapped rows.
     Two rows of chips instead of seven keeps the first card visible on a
     844px phone. Edge fade signals that the row scrolls. */
  .frow { flex-direction: row; align-items: center; gap: 8px; margin-block-end: 6px; }
  .flabel { flex: 0 0 auto; width: auto; font-size: 11.5px; }
  .chips {
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none; -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    padding-block-end: 2px;
    mask-image: linear-gradient(to left, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(to left, #000 92%, transparent);
  }
  html[lang="en"] .chips { mask-image: linear-gradient(to right, #000 92%, transparent); -webkit-mask-image: linear-gradient(to right, #000 92%, transparent); }
  .chips::-webkit-scrollbar { display: none; }
  .chips button { flex: 0 0 auto; }
  .card-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

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

.pay-banner { position: fixed; inset-inline: 12px; top: 12px; z-index: 60; display: flex;
  align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; border: 1px solid var(--rule); background: var(--ink-2); color: var(--text); }
.pay-banner.ok { border-color: #34d39955; color: #34d399; }
.pay-banner.err { border-color: #fb718555; color: #fb7185; }
.pay-x { margin-inline-start: auto; background: none; border: 0; color: inherit;
  font-size: 18px; cursor: pointer; padding: 0 4px; }
.toast { position: fixed; inset-inline: 16px; bottom: 18px; z-index: 70; padding: 10px 14px;
  border-radius: 10px; background: var(--ink-3); border: 1px solid var(--rule);
  color: var(--text); font-size: 13px; opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.menu { position: fixed; z-index: 65; }
.menu { background: var(--ink-2); }

/* header "Learn" link: the bar is the glassy light bar, so it takes the
   same ink scale as .lang, not the dark-band scale */
.bar-end .bar-learn { display: inline-flex; align-items: center; padding: 7px 2px; color: var(--cyan); text-decoration: none; font-size: 13px; font-weight: 600; transition: color .15s; }
.bar-end .bar-learn:hover { color: var(--cyan-hover); text-decoration: underline; text-underline-offset: 3px; }
