/* COLORGLOT — styles derived from the logo: 8 rainbow squares + slate wordmark on white. */

:root {
  /* Logo palette */
  --red: #EC2227; --orange: #F58607; --yellow: #F9B90B; --green: #46B357;
  --cyan: #07B4D1; --blue: #2D78E6; --indigo: #4F31A3; --purple: #8E24AA;

  --ink: #2A323B;
  --ink-soft: #5b6672;
  --bg: #ffffff;
  --card: #F4F5F7;
  --line: #dfe3e8;
  --primary: var(--blue);
  --primary-dark: #1f5cb8;
  --radius: 12px;

  /* Word-group chips: tint background + dark shade text (all pairs >= 5.6:1) */
  --c0-bg: #ECEEF1; --c0-fg: #4a535d;
  --c1-bg: #FCDCDC; --c1-fg: #761114; /* red    */
  --c2-bg: #DDE9FB; --c2-fg: #163C73; /* blue   */
  --c3-bg: #E1F3E4; --c3-fg: #235A2C; /* green  */
  --c4-bg: #FDECD7; --c4-fg: #7A4304; /* orange */
  --c5-bg: #EDDCF1; --c5-fg: #471255; /* purple */
  --c6-bg: #D7F3F8; --c6-fg: #045A68; /* cyan   */
  --c7-bg: #FEF4D8; --c7-fg: #7C5C06; /* yellow */
  --c8-bg: #E3DEF0; --c8-fg: #281852; /* indigo */
  --c9-bg: #FBDCEB; --c9-fg: #7A1346; /* pink */
  --c10-bg: #EAF3D2; --c10-fg: #3F5A0B; /* lime */
  --c11-bg: #D5F0EA; --c11-fg: #0B5A4B; /* teal */
  --c12-bg: #EFE3D6; --c12-fg: #5C3A1C; /* brown */
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary-dark); }

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

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 16px 16px 8px;
}
.site-header .logo { display: inline-block; }
.site-header img { display: block; width: min(240px, 60vw); height: auto; }
.site-header--home img { width: min(460px, 82vw); }
.tagline {
  margin: 6px 0 0;
  font-size: clamp(0.85rem, 2.6vw, 1rem);
  font-weight: 500;
  color: var(--ink-soft);
}
.site-header--home .tagline { font-size: clamp(1rem, 3.4vw, 1.35rem); color: var(--ink); }

.rainbow { display: flex; height: 5px; }
.rainbow i { flex: 1; }
.rainbow i:nth-child(1) { background: var(--red); }
.rainbow i:nth-child(2) { background: var(--orange); }
.rainbow i:nth-child(3) { background: var(--yellow); }
.rainbow i:nth-child(4) { background: var(--green); }
.rainbow i:nth-child(5) { background: var(--cyan); }
.rainbow i:nth-child(6) { background: var(--blue); }
.rainbow i:nth-child(7) { background: var(--indigo); }
.rainbow i:nth-child(8) { background: var(--purple); }

.page {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-footer {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.8rem;
  padding: 16px;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: var(--radius);
  min-height: 48px;
  padding: 0 24px;
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--ghost { background: var(--card); color: var(--ink); }
.btn--ghost:hover { background: var(--line); }
.btn[disabled] { opacity: 0.4; cursor: default; }

/* ---------- Home form ---------- */
.search {
  display: grid;
  gap: 18px;
  max-width: 560px;
  margin: 16px auto 0;
}
.field label { display: block; margin-bottom: 6px; font-weight: 500; }
.field select {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-style: italic;
}
.field select:focus { border-color: var(--primary); }
.field select.has-value { font-style: normal; }
.actions { text-align: center; margin-top: 4px; }
.actions .btn { width: 100%; max-width: 280px; min-height: 56px; }
.alert {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #FCDCDC;
  color: #761114;
  font-weight: 500;
}

@media (min-width: 900px) {
  .search {
    max-width: 980px;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: end;
  }
  .search .alert, .search .actions { grid-column: 1 / -1; }
}

/* ---------- Results ---------- */
.crumbs { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 500; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.page-title { font-size: clamp(1.5rem, 5vw, 2.2rem); line-height: 1.2; margin: 8px 0; }
.page-subtitle { margin: 0 0 20px; color: var(--ink-soft); font-size: 1.05rem; }
.summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; }
.pill { background: var(--card); border-radius: 999px; padding: 4px 14px; font-weight: 500; font-size: 0.9rem; }
.pill--level { background: var(--c3-bg); color: var(--c3-fg); }

.book-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.book__link {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 20px;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
}
.book__link:hover, .book__link:focus-visible { border-color: var(--primary); background: var(--card); }
.book__cover {
  display: block;
  width: clamp(84px, 22vw, 150px);
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
}
.book__text { min-width: 0; }
.book__title { display: block; font-size: 1.3rem; font-weight: 700; }
.book__subtitle { display: block; color: var(--ink-soft); margin-top: 2px; }
.book__meta { display: block; margin-top: 10px; font-size: 0.85rem; color: var(--ink-soft); }
.empty { text-align: center; padding: 32px 0; }

/* ---------- Reader (FORMAT C) ---------- */
.reader-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 28px);
}
.sentence + .sentence { margin-top: 28px; padding-top: 28px; border-top: 1px solid var(--line); }
.js .sentence { display: none; margin: 0; padding: 0; border: 0; }
.js .sentence.is-current { display: block; }
.summary { display: none !important; }
.js .summary.is-current { display: block !important; }
.summary__count { margin: 0 0 14px; font-size: 1.15rem; }
.summary__count strong { font-size: 1.6rem; color: var(--primary); }
.summary__count { margin-bottom: 4px; }
.summary__total { color: var(--ink-soft); font-size: 0.9rem; }
.summary__intro { margin: 0 0 16px; color: var(--ink-soft); font-size: 0.95rem; }
.summary__statswrap { margin-top: 18px; }
.stats { margin-top: 18px; }
.stats__tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.stat__value { margin: 0; font-size: 3.2rem; font-weight: 700; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat__label { margin: 6px 0 14px; color: var(--ink); font-weight: 500; }
.stat__note { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.meter { height: 12px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 6px; background: var(--primary); transition: width 0.7s cubic-bezier(.2,.8,.2,1); }
.bars { margin-top: 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.bars__title { margin: 0 0 12px; font-weight: 600; font-size: 0.95rem; }
.bars__row { display: grid; grid-template-columns: 9.5em 1fr 8.5em; align-items: center; gap: 12px; padding: 6px 0; }
.bars__label { font-size: 0.9rem; color: var(--ink); }
.bars__value { font-size: 0.85rem; color: var(--ink-soft); text-align: right; font-variant-numeric: tabular-nums; }
.stats__msg { margin: 14px 2px 0; font-weight: 500; }
@media (max-width: 560px) { .bars__row { grid-template-columns: 1fr; gap: 4px; } .bars__value { text-align: left; } }
@media (prefers-reduced-motion: reduce) { .meter__fill { transition: none; } }
.summary__scroll { max-height: 55vh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.summary__table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.summary__table th, .summary__table td { padding: 8px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.summary__table thead th { position: sticky; top: 0; background: var(--card); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.summary__table tbody th { width: 3.5em; color: var(--ink-soft); font-weight: 400; }
.summary__table td:last-child, .summary__table th:last-child { text-align: right; width: 8em; }
.summary__table th, .summary__table td { vertical-align: middle; }
.summary__check { text-align: center; width: 7em; }
.summary__table thead th:nth-child(2) { text-align: center; }
.summary__check input { width: 20px; height: 20px; accent-color: var(--primary); cursor: pointer; }
.summary__listen { text-align: center; width: 5em; }
.summary__table thead th:nth-child(3) { text-align: center; }
.summary__word { font-weight: 500; }
.summary__reveal { font: inherit; font-size: 0.85rem; padding: 4px 12px; border: 1.5px solid var(--primary); border-radius: 999px; background: var(--bg); color: var(--primary-dark); cursor: pointer; }
.summary__reveal:hover { background: var(--card); }
.summary__trans { margin-left: 10px; }
.summary__table tr.is-known .summary__word { color: var(--ink-soft); text-decoration: line-through; }
.summary__table tbody tr:last-child th, .summary__table tbody tr:last-child td { border-bottom: 0; }
.js .hint { display: block; }
.hint { display: none; margin: 16px 0 0; font-size: 0.85rem; color: var(--ink-soft); }

.moral-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.row + .row { margin-top: 18px; }
.row__label {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.row__text {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: clamp(1.05rem, 3.4vw, 1.5rem);
  line-height: 1.35;
}

.chip {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--c0-bg);
  color: var(--c0-fg);
  position: relative;
  cursor: pointer;
  transition: box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.chip.c1 { background: var(--c1-bg); color: var(--c1-fg); }
.chip.c2 { background: var(--c2-bg); color: var(--c2-fg); }
.chip.c3 { background: var(--c3-bg); color: var(--c3-fg); }
.chip.c4 { background: var(--c4-bg); color: var(--c4-fg); }
.chip.c5 { background: var(--c5-bg); color: var(--c5-fg); }
.chip.c6 { background: var(--c6-bg); color: var(--c6-fg); }
.chip.c7 { background: var(--c7-bg); color: var(--c7-fg); }
.chip.c8 { background: var(--c8-bg); color: var(--c8-fg); }
.chip.c9 { background: var(--c9-bg); color: var(--c9-fg); }
.chip.c10 { background: var(--c10-bg); color: var(--c10-fg); }
.chip.c11 { background: var(--c11-bg); color: var(--c11-fg); }
.chip.c12 { background: var(--c12-bg); color: var(--c12-fg); }
.chip.is-linked { box-shadow: 0 0 0 3px currentColor; }

.show-nums .chip[data-g]::after {
  content: attr(data-g);
  position: absolute;
  top: -9px; right: -7px;
  min-width: 20px; height: 20px;
  padding: 0 4px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  background: var(--c0-fg);
  color: #fff;
}
.show-nums .chip.c1[data-g]::after { background: var(--c1-fg); }
.show-nums .chip.c2[data-g]::after { background: var(--c2-fg); }
.show-nums .chip.c3[data-g]::after { background: var(--c3-fg); }
.show-nums .chip.c4[data-g]::after { background: var(--c4-fg); }
.show-nums .chip.c5[data-g]::after { background: var(--c5-fg); }
.show-nums .chip.c6[data-g]::after { background: var(--c6-fg); }
.show-nums .chip.c7[data-g]::after { background: var(--c7-fg); }
.show-nums .chip.c8[data-g]::after { background: var(--c8-fg); }
.show-nums .chip.c9[data-g]::after { background: var(--c9-fg); }
.show-nums .chip.c10[data-g]::after { background: var(--c10-fg); }
.show-nums .chip.c11[data-g]::after { background: var(--c11-fg); }
.show-nums .chip.c12[data-g]::after { background: var(--c12-fg); }

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 20px;
}
.controls[hidden] { display: none; }
.controls .progress { grid-column: 1 / -1; grid-row: 1; text-align: center; font-weight: 500; font-size: 0.9rem; }
.progress__bar { height: 8px; border-radius: 4px; background: var(--line); margin-top: 6px; overflow: hidden; }
.progress__fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--cyan), var(--blue), var(--indigo), var(--purple)); background-size: 980px 100%; transition: width 0.2s; }

.toggle { display: block; margin-top: 18px; text-align: center; font-size: 0.9rem; color: var(--ink-soft); }
.toggle[hidden] { display: none; }
.toggle input { width: 18px; height: 18px; vertical-align: middle; margin-right: 6px; }

@media (min-width: 600px) {
  .controls { grid-template-columns: auto 1fr auto; align-items: center; }
  .controls .progress { grid-column: auto; grid-row: auto; }
}

/* Phones: keep Prev/Next within thumb reach */
@media (max-width: 599px) {
  .reader .page { padding-bottom: 96px; }
  .reader .controls {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid var(--line);
    z-index: 10;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Audio ---------- */
.row__label { display: flex; align-items: center; gap: 8px; }
.listen {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg);
  color: var(--primary-dark);
  box-shadow: inset 0 0 0 1.5px var(--line);
  cursor: pointer;
}
.listen:hover { box-shadow: inset 0 0 0 2px var(--primary); }
.listen.is-playing { background: var(--primary); color: #fff; box-shadow: none; }
.chip.is-playing { box-shadow: 0 0 0 3px currentColor; }

/* ---------- Scripts not covered by Montserrat ---------- */
/* Kazakh Cyrillic letters (ә ғ қ ң ө ұ ү һ і) */
:lang(kk) { font-family: "Montserrat", "Noto Sans", "Segoe UI", "Arial", sans-serif; }
:lang(hi) { font-family: "Montserrat", "Noto Sans Devanagari", "Nirmala UI", "Mangal", sans-serif; }
:lang(ja) { font-family: "Montserrat", "Noto Sans JP", "Hiragino Sans", "Yu Gothic", "Meiryo", sans-serif; }
:lang(zh) { font-family: "Montserrat", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
:lang(hi) .row__text, :lang(ja) .row__text, :lang(zh) .row__text { line-height: 1.55; }

/* ---------- Book cover placeholder (until the illustration is uploaded) ---------- */
.book__cover--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: var(--c0-bg);
  color: var(--c0-fg);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05);
}
.book__cover--ph.c1 { background: var(--c1-bg); color: var(--c1-fg); }
.book__cover--ph.c2 { background: var(--c2-bg); color: var(--c2-fg); }
.book__cover--ph.c3 { background: var(--c3-bg); color: var(--c3-fg); }
.book__cover--ph.c4 { background: var(--c4-bg); color: var(--c4-fg); }
.book__cover--ph.c5 { background: var(--c5-bg); color: var(--c5-fg); }
.book__cover--ph.c6 { background: var(--c6-bg); color: var(--c6-fg); }
.book__cover--ph.c7 { background: var(--c7-bg); color: var(--c7-fg); }
.book__cover--ph.c8 { background: var(--c8-bg); color: var(--c8-fg); }
.book__cover--ph.c9 { background: var(--c9-bg); color: var(--c9-fg); }
.book__cover--ph.c10 { background: var(--c10-bg); color: var(--c10-fg); }
.book__cover--ph.c11 { background: var(--c11-bg); color: var(--c11-fg); }
.book__cover--ph.c12 { background: var(--c12-bg); color: var(--c12-fg); }

/* ---------- Account bar, forms, auth pages ---------- */
.topbar { width: 100%; display: flex; justify-content: center; align-items: center; gap: 6px; max-width: 980px; margin: 0 auto; padding: 8px 16px 0; font-size: 0.9rem; }
.topbar a, .topbar__link { color: var(--ink); text-decoration: none; font-weight: 500; padding: 6px 10px; border-radius: 8px; }
.topbar a:hover, .topbar__link:hover { background: var(--card); }
.topbar__cta { background: var(--primary); color: #fff !important; font-weight: 700 !important; }
.topbar__cta:hover { background: var(--primary-dark) !important; }
.topbar__form { margin: 0; display: inline; }
.topbar__link { font: inherit; font-weight: 500; background: none; border: 0; cursor: pointer; }

/* Language menu in the top bar */
.langmenu { position: relative; }
.langmenu summary { list-style: none; cursor: pointer; padding: 6px 10px; border-radius: 8px; font-weight: 500; user-select: none; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover, .langmenu[open] summary { background: var(--card); }
.langmenu ul { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; margin: 0; padding: 6px; list-style: none; min-width: 11rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.langmenu li a { display: block; padding: 7px 10px; border-radius: 6px; white-space: nowrap; }
.langmenu li a[aria-current="true"] { font-weight: 700; background: var(--card); }

@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; justify-content: center; gap: 2px 4px; padding: 8px 8px 0; font-size: 0.85rem; }
  .topbar a, .topbar__link, .langmenu summary { padding: 6px 8px; white-space: nowrap; }
  .langmenu ul { right: 0; max-height: 60vh; overflow-y: auto; }
}
.site-footer__links { margin-top: 6px !important; }
.site-footer__links a { color: var(--ink-soft); }

.auth { max-width: 460px; margin: 0 auto; }
.auth .page-title { text-align: center; }
.auth__card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.auth__field { margin: 0 0 16px; }
.auth__field label { display: block; font-weight: 500; margin-bottom: 6px; }
.auth__field input[type=email], .auth__field input[type=password], .auth__field input[type=text] {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink);
}
.auth__field input:focus { outline: none; border-color: var(--primary); }
.auth__hint { margin: 6px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.auth__check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; margin: 0 0 18px; }
.auth__check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--primary); }
.auth__actions { margin-top: 6px; }
.auth__actions .btn { width: 100%; }
.auth__links { margin: 18px 0 0; text-align: center; font-size: 0.95rem; }
.auth__links a { color: var(--primary-dark); }
.notice { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; font-size: 0.95rem; }
.notice--ok { background: #e8f6ec; color: #1f6b36; }
.notice--err { background: #fdecec; color: #a12020; }
.notice--info { background: #e8f0fd; color: #1f4f9f; }

/* ---------- Legal pages ---------- */
.legal { max-width: 720px; margin: 0 auto; line-height: 1.6; }
.legal h2 { font-size: 1.15rem; margin: 26px 0 6px; }
.legal p, .legal ul { margin: 0 0 12px; }
.legal__date { color: var(--ink-soft); font-size: 0.85rem; margin-top: 24px; }

.summary__save { margin: 0 0 8px; min-height: 1.2em; font-size: 0.85rem; color: var(--ink-soft); text-align: right; }
.summary__save.is-error { color: #a12020; font-weight: 500; }
.summary__cta { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: left; }
.summary__cta .btn { width: auto; max-width: 100%; text-transform: none; letter-spacing: 0; font-size: 1rem; text-align: left; padding: 12px 22px; background: var(--orange); color: var(--ink); }
.summary__cta .btn:hover, .summary__cta .btn:focus-visible { background: #e07a05; }
.summary__cta-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.locked { text-align: center; padding: 8px 0; }
.locked__title { margin: 6px 0 10px; font-size: 1.5rem; }
.locked__text { max-width: 480px; margin: 0 auto 18px; color: var(--ink-soft); }
.locked__sub { margin: 14px 0 0; font-size: 0.9rem; }
.js .locked { display: none; }
.js .locked.is-current { display: block; }

/* ---------- Account dashboard ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dash-plan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 0 0 18px; }
.dash-plan p { margin: 0; }
.dash-plan form { margin: 0; }
.pill--ok { background: #e8f6ec; color: #1f6b36; }
.pill--warn { background: #fff1de; color: #8a4b00; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.dash-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 18px; }
.dash-card h2 { margin: 0 0 12px; font-size: 1.1rem; }
.dash-count { color: var(--ink-soft); font-weight: 400; }
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--line); stroke-width: 1; }
.chart__tick { font-size: 11px; fill: var(--ink-soft); }
.chart__fill { fill: var(--primary); }
.chart__bar:hover .chart__fill { fill: var(--primary-dark); }
.chart__line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart__dot { fill: var(--primary); stroke: var(--card); stroke-width: 2; }
.dash-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.dash-scroll--tall { max-height: 360px; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.dash-table th, .dash-table td { padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; white-space: nowrap; }
.dash-table thead th { position: sticky; top: 0; background: var(--card); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.dash-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table tr[hidden] { display: none; }
.dash-table a { color: var(--primary-dark); }
.dash-table .meter { display: inline-block; width: 110px; vertical-align: middle; height: 10px; }
.dash-pct { margin-left: 8px; font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.dash-filter { width: 100%; min-height: 44px; padding: 0 14px; font: inherit; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); margin-bottom: 12px; }
.dash-filter:focus { outline: none; border-color: var(--primary); }

/* ---------- Pricing ---------- */
.pricing { }
.hero { text-align: center; max-width: 760px; margin: 8px auto 36px; }
.hero__title { font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 14px; }
.hero__accent { background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--cyan), var(--blue), var(--indigo), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__lead { font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 22px; }
.hero__demo { display: inline-block; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; line-height: 2.2; }
.hero__demo .row__label { display: block; line-height: 1.4; margin-top: 6px; }
.hero__demo .row__label:first-child { margin-top: 0; }
.block { margin: 0 0 40px; }
.block__title { text-align: center; font-size: clamp(1.3rem, 3.6vw, 1.8rem); margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.card { position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 30px 20px 18px; box-shadow: 0 1px 2px rgba(20, 30, 50, 0.04); }
/* thick, flat colour bar on top of each card, in the colours of the COLORGLOT logo */
.card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 12px; background: var(--bar, var(--primary)); }
.card:nth-child(6n+1) { --bar: #eb2529; } .card:nth-child(6n+2) { --bar: #f17d00; } .card:nth-child(6n+3) { --bar: #43b253; }
.card:nth-child(6n+4) { --bar: #07b4d1; } .card:nth-child(6n+5) { --bar: #2b76e4; } .card:nth-child(6n) { --bar: #8b26a9; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }
.plan { max-width: 440px; margin: 0 auto; background: var(--bg); border: 2px solid var(--primary); border-radius: 20px; padding: 28px 26px; text-align: center; box-shadow: 0 10px 30px rgba(45, 120, 230, 0.12); }
.plan__name { margin: 0; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.85rem; color: var(--ink-soft); }
.plan__price { margin: 8px 0 16px; }
.plan__amount { font-size: 3.2rem; font-weight: 700; line-height: 1; }
.plan__per { color: var(--ink-soft); font-size: 1.1rem; }
.plan__list { list-style: none; padding: 0; margin: 0 0 22px; text-align: left; }
.plan__list li { position: relative; padding: 7px 0 7px 28px; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.plan__list li:last-child { border-bottom: 0; }
.plan__list li::before { content: "\2713"; position: absolute; left: 4px; top: 7px; color: var(--green); font-weight: 700; }
.plan__cta { width: 100%; text-align: center; }
.plan form { margin: 0; }
.plan__note { margin: 12px 0 0; font-size: 0.85rem; color: var(--ink-soft); }
.plan .notice { text-align: center; }
.free-note { max-width: 560px; margin: 18px auto 0; text-align: center; color: var(--ink-soft); font-size: 0.95rem; }
.faq { max-width: 680px; margin: 0 auto 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { margin: 10px 0 2px; color: var(--ink-soft); line-height: 1.55; }
.faq__legal { text-align: center; font-size: 0.85rem; color: var(--ink-soft); margin-top: 16px; }

/* ---------- Catalog ---------- */
.cat-filters { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 0 0 14px; }
.cat-filters__row { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; }
.cat-filters__row + .cat-filters__row { margin-top: 12px; }
.cat-filters .field { margin: 0; flex: 1 1 180px; min-width: 0; }
.cat-filters__search { flex: 2 1 280px !important; }
.cat-filters .field label { display: block; font-weight: 500; font-size: 0.9rem; margin-bottom: 5px; }
.cat-filters input[type=search], .cat-filters select {
  width: 100%; min-height: 44px; padding: 0 12px; font: inherit; color: var(--ink);
  border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.cat-filters input:focus, .cat-filters select:focus { outline: none; border-color: var(--primary); }
.cat-filters__reset { flex: 0 0 auto !important; }
.cat-levels { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cat-levels legend { float: left; margin-right: 10px; padding: 0; font-weight: 500; font-size: 0.9rem; line-height: 38px; }
.chipbtn { font: inherit; font-size: 0.9rem; font-weight: 500; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; }
.chipbtn span { color: var(--ink-soft); font-weight: 400; margin-left: 4px; }
.chipbtn:hover { border-color: var(--primary); }
.chipbtn.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chipbtn.is-on span { color: #dbe8fb; }
.cat-count { margin: 0 2px 12px; color: var(--ink-soft); font-size: 0.9rem; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cat-grid[hidden], .cat-card[hidden] { display: none; }
.cat-card__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; }
.cat-card__link:hover, .cat-card__link:focus-visible { border-color: var(--primary); box-shadow: 0 6px 18px rgba(45, 120, 230, 0.15); }
.cat-card__cover { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--card); }
.cat-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.cat-card__title { font-weight: 700; line-height: 1.25; }
.cat-card__sub { color: var(--ink-soft); font-size: 0.85rem; line-height: 1.3; }
.cat-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 0.8rem; color: var(--ink-soft); }
.cat-card__access { margin-top: auto; padding-top: 8px; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
.cat-card__access.is-free { color: #1f6b36; }
.cat-card__access.is-promo { color: #8a4b02; }
.pill--lvl { font-size: 0.75rem; padding: 2px 10px; font-weight: 700; }
.lvl-very-easy { background: #e8f6ec; color: #1f6b36; }
.lvl-easy { background: #e6f4fa; color: #0b5a73; }
.lvl-medium { background: #fdf1de; color: #8a4b02; }
.lvl-difficult { background: #fbe4e4; color: #8a1a1a; }
@media (max-width: 520px) { .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } .cat-card__body { padding: 10px 10px 12px; } }

/* Rainbow method page */
.eyebrow { margin: 0 0 8px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.8rem; color: var(--primary); }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 22px 0 0; }
.method .hero__demo { max-width: 100%; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; counter-reset: step; }
.step { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px 18px; }
.step__num { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; margin-bottom: 8px; background: var(--bar, var(--primary)); }
.step:nth-child(1) { --bar: #eb2529; } .step:nth-child(2) { --bar: #f17d00; } .step:nth-child(3) { --bar: #43b253; } .step:nth-child(4) { --bar: #2b76e4; }
.step h3 { margin: 0 0 6px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }
.author { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center; max-width: 820px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.author__photo { display: block; width: 200px; height: 200px; object-fit: cover; border-radius: 50%; border: 5px solid #fff; box-shadow: 0 0 0 4px var(--blue), 0 8px 24px rgba(20, 30, 50, 0.15); }
.author__text h3 { margin: 0; font-size: 1.4rem; }
.author__role { margin: 2px 0 12px; font-weight: 700; color: var(--primary); }
.author__text p { margin: 0 0 10px; line-height: 1.6; color: var(--ink-soft); }
.block--cta { text-align: center; }
.cta__text { max-width: 560px; margin: 0 auto; color: var(--ink-soft); }
@media (max-width: 640px) {
  .author { grid-template-columns: 1fr; text-align: center; justify-items: center; }
}

/* Cookie banner */
.cookiebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: center; padding: 14px 16px; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0,0,0,.10); font-size: 0.9rem; }
.cookiebar[hidden] { display: none; }
.cookiebar__text { margin: 0; max-width: 64ch; color: var(--ink); }
.cookiebar__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookiebar .btn { padding: 9px 22px; min-width: 7.5rem; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--primary-dark); }
.legal__table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0 0 14px; display: block; overflow-x: auto; }
.legal__table th, .legal__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal__table th { font-weight: 700; background: var(--card); }
.legal__table code { font-size: 0.85em; }

/* Story finder on the account page */
.dash-find { margin-top: 36px; scroll-margin-top: 16px; }
.dash-find h2 { margin: 0 0 14px; font-size: 1.3rem; }
