:root {
  color-scheme: light;
  --ink: #0d1736;
  --muted: #5d6578;
  --paper: #f4f1e9;
  --white: #fffef9;
  --gold: #b69a55;
  --line: #d9d6cc;
  --line-soft: #e6e3da;
  --kodeks: #0d1736;
  --farmon: #9c6b1f;
  --farmoyish: #2f6f5e;
  --qaror: #7b3b57;
  --nav-w: 258px;
  --detail-w: 412px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  overflow: hidden;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
}

.placeholder { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.placeholder.small { font-size: 12px; }

/* ---------- Shell ---------- */

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  height: 54px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--ink); text-decoration: none;
  font-size: 19px; font-weight: 850; letter-spacing: -.04em;
}
.topbar-spacer { flex: 1; }
.topbar-link {
  color: var(--muted); text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.topbar-link:hover { color: var(--ink); }
button, a, select, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #a17c46;
  outline-offset: 3px;
}
h1, h2, h3 { scroll-margin-top: 96px; }
.chip {
  border: 1px solid var(--gold); border-radius: 999px;
  padding: 4px 11px; color: #6e5a25; font-size: 12px; font-weight: 600;
  /* Kodeks nomi uzun; tor ekranda topbar'ni cho'zmasligi uchun qisqaradi. */
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0; max-width: 46vw;
}

/* ---------- Graf paneli (yuqori) ---------- */

.rightcol {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  background: var(--white);
  border-left: 1px solid var(--line);
}

.graphbar { border-bottom: 1px solid var(--line); }
.graphbar-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 10px;
  padding: 10px 16px 8px;
}
.graphbar-head h2 {
  margin: 0; font-size: 12px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase; color: #846b30;
  white-space: nowrap;
}
.graphbar-head .ghost { grid-row: 1; grid-column: 2; }
.legend {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 4px 10px;
  margin: 0; padding: 0; list-style: none;
  font-size: 11px; color: var(--muted);
}
.legend li { display: flex; align-items: center; gap: 5px; }
.dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
.dot.kodeks { background: var(--kodeks); }
.dot.farmon { background: var(--farmon); }
.dot.farmoyish { background: var(--farmoyish); }
.dot.qaror { background: var(--qaror); }
.graph-meta { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

.ghost {
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--muted);
  padding: 5px 11px; font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.ghost:hover { color: var(--ink); border-color: var(--gold); }

.graphbar-body {
  height: 252px;
  padding: 0 10px 12px;
  overflow: hidden;
}
.graphbar.collapsed .graphbar-body { display: none; }
#graph { width: 100%; height: 100%; display: block; }
#graph .edge { stroke: #c2bdb0; stroke-width: 1.2; }
#graph .node circle { stroke: var(--white); stroke-width: 2; cursor: pointer; }
#graph .node.matched circle { stroke: var(--gold); stroke-width: 2.5; }
#graph .node text {
  font-size: 9.5px; font-weight: 700; fill: var(--ink);
  text-anchor: middle; pointer-events: none;
}
#graph .node:hover circle { stroke: var(--gold); }

/* ---------- Uch panel ---------- */

.panes {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--detail-w);
  min-height: 0;
}
.pane { min-height: 0; overflow-y: auto; }
.nav {
  background: var(--white);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
}
.detail { padding: 18px; }

/* ---------- Chap panel ---------- */

.autoswitch { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.switch { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  flex: 0 0 34px; width: 34px; height: 20px; margin-top: 2px;
  border-radius: 999px; background: #cfcabc; position: relative;
  transition: background .15s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%; background: var(--white);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--gold); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch-text { display: grid; gap: 1px; }
.switch-text strong { font-size: 13px; }
.switch-text small { color: var(--muted); font-size: 11.5px; line-height: 1.4; }

.sections { padding: 10px 10px 16px; flex: 1; }
.section-item {
  display: block; width: 100%; text-align: left;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: inherit;
  padding: 9px 11px; margin-bottom: 2px;
  font: inherit; cursor: pointer; text-decoration: none;
}
.section-item:hover { background: #f6f3ea; border-color: var(--line-soft); }
.section-item[aria-current="page"] {
  background: #f1ece0; border-color: var(--gold);
}
.section-item.unavailable { cursor: pointer; }
.section-row { display: flex; align-items: center; gap: 8px; }
.section-row strong { font-size: 13.5px; font-weight: 650; flex: 1; }
.count {
  font-size: 11px; font-weight: 700; color: var(--muted);
  background: #efece2; border-radius: 999px; padding: 2px 7px;
}
.section-item.unavailable .section-row strong { color: #8b91a1; }
.section-sub { margin: 3px 0 0; font-size: 11.5px; color: var(--muted); }

.nav-foot { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.nav-foot p { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }

/* ---------- O'rta panel: chat ---------- */

.chat {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  padding: 0 20px 12px;
}
.conversation {
  display: flex; flex-direction: column; gap: 16px;
  padding: 20px 0;
  overflow-y: auto;
  min-height: 0;
}
.message { display: flex; gap: 11px; align-items: flex-start; max-width: 780px; }
.bubble {
  padding: 14px 17px; background: var(--white);
  border: 1px solid var(--line); border-radius: 4px 16px 16px;
  box-shadow: 0 8px 26px rgba(13, 23, 54, .045);
}
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.user .bubble {
  background: var(--ink); color: #fff; border-color: var(--ink);
  border-radius: 16px 4px 16px 16px;
}
.message.user .avatar { background: var(--gold); color: #171308; }
.avatar {
  flex: 0 0 32px; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: var(--ink); font-weight: 800; font-size: 13px;
}
.message p { margin: 0; white-space: pre-wrap; }

.sources { margin: 13px 0 0; padding: 11px 0 0; border-top: 1px solid var(--line-soft); }
.sources-title {
  font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #846b30; margin: 0 0 7px;
}
.source-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.source-chip {
  border: 1px solid var(--line); border-radius: 999px;
  background: #faf8f1; color: #4a4231;
  padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 650;
  cursor: pointer;
}
.source-chip:hover { border-color: var(--gold); background: #f4efe1; }
.source-chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.composer {
  display: flex; gap: 10px; padding: 9px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 10px 34px rgba(13, 23, 54, .08);
}
textarea {
  flex: 1; resize: none; min-height: 48px; max-height: 160px;
  padding: 11px; border: 0; outline: 0;
  background: transparent; color: var(--ink); font: inherit;
}
button[type="submit"] {
  align-self: stretch; min-width: 108px;
  border: 0; border-radius: 11px;
  background: var(--gold); color: #171308;
  font: inherit; font-weight: 800; cursor: pointer;
}
button[type="submit"]:disabled { opacity: .55; cursor: wait; }
.disclaimer { margin: 9px 0 0; text-align: center; color: var(--muted); font-size: 11.5px; }

/* ---------- O'ng panel: modda matni ---------- */

.detail-head { margin-bottom: 12px; }
.detail-kicker {
  margin: 0 0 4px; font-size: 11px; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: #846b30;
}
.detail h3 { margin: 0; font-size: 16px; line-height: 1.35; letter-spacing: -.01em; }
.detail-body { margin: 0; white-space: pre-wrap; font-size: 14px; line-height: 1.68; }
.detail-link {
  display: inline-block; margin-top: 14px;
  color: #66521f; font-size: 12.5px; font-weight: 650;
}
.detail-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.code-card {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 14px; margin-bottom: 10px; background: #faf8f1;
}
.code-card h4 { margin: 0 0 4px; font-size: 14px; }
.code-card p { margin: 0; font-size: 12px; color: var(--muted); }
.code-card.empty { background: transparent; border-style: dashed; }

/* ---------- Responsiv ---------- */

@media (max-width: 1240px) {
  :root { --nav-w: 222px; --detail-w: 348px; }
  .graphbar-body { height: 216px; }
}

@media (max-width: 960px) {
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
  .panes { grid-template-columns: 1fr; }
  .pane { overflow: visible; }
  .nav { border-right: 0; border-bottom: 1px solid var(--line); }
  .rightcol { border-left: 0; border-top: 1px solid var(--line); }
  .chat { height: 72vh; }
  .graphbar-body { height: 200px; }
}

@media (max-width: 620px) {
  button[type="submit"] { min-width: 84px; }
}

/* ---------- Premium landing page ---------- */

:root {
  --ink: #172c26;
  --muted: #6f7972;
  --paper: #f5f3ed;
  --white: #fffefa;
  --gold: #b58d52;
  --line: #deded5;
  --line-soft: #e9e7df;
  --kodeks: #172c26;
  --farmon: #a5793d;
  --farmoyish: #477765;
  --qaror: #84596b;
}

body { overflow: auto; background: var(--paper); }
.app { display: block; min-height: 100vh; height: auto; }
.app.is-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; min-height: 0; }
body.workspace-open { height: 100%; overflow: hidden; }
.panes[hidden], .landing[hidden] { display: none !important; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  height: 76px;
  gap: 15px;
  padding: 0 clamp(20px, 5.5vw, 88px);
  background: rgba(255, 254, 250, .94);
  border-bottom: 1px solid rgba(23, 44, 38, .09);
  backdrop-filter: blur(18px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -.055em;
}
.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: #f7f1e4;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  font-weight: 400;
  letter-spacing: -.04em;
}
.brand-period { color: var(--gold); }
.topbar .chip {
  margin-left: 9px;
  padding: 5px 11px;
  border-color: #e1d9c8;
  color: #69766d;
  background: #f8f6f0;
  font-size: 11px;
}
.topbar-link {
  padding: 8px 4px;
  color: #5f6d65;
  font-size: 12px;
  letter-spacing: .03em;
}
.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 11px 16px;
  border-radius: 3px;
  background: var(--ink);
  color: #fffefa;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  transition: background .2s ease, transform .2s ease;
}
.topbar-cta:hover { background: #29483d; transform: translateY(-1px); }
.topbar-cta span { color: #d7b77b; font-size: 16px; line-height: 1; }

.landing { overflow: hidden; }
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(450px, 1.08fr);
  align-items: center;
  gap: clamp(36px, 7vw, 112px);
  width: min(100%, 1600px);
  min-height: min(760px, calc(100vh - 76px));
  margin: 0 auto;
  padding: 66px clamp(24px, 8vw, 128px) 76px;
}
.hero-copy { position: relative; z-index: 1; max-width: 540px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 24px;
  color: #7a765f;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .16em;
}
.eyebrow-line { width: 26px; height: 1px; background: var(--gold); }
.hero h1, .how-section h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(60px, 7.1vw, 104px);
  font-weight: 400;
  letter-spacing: -.075em;
  line-height: .99;
}
.hero h1 em, .how-section h2 em {
  color: #a77f45;
  font-weight: 400;
}
.hero-lede {
  max-width: 420px;
  margin: 27px 0 0;
  color: #68756d;
  font-size: 15px;
  line-height: 1.85;
}
.hero-actions { display: flex; align-items: center; gap: 29px; margin-top: 31px; }
.button-primary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 53px;
  padding: 0 19px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  background: var(--ink);
  color: #fffefa;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.button-primary:hover {
  transform: translateY(-2px);
  border-color: #29483d;
  background: #29483d;
}
.button-arrow { color: #dbbd88; font-size: 17px; line-height: 1; }
.text-link {
  color: #5c6b62;
  text-decoration: none;
  font-size: 12px;
  font-weight: 650;
}
.text-link span { margin-left: 6px; color: #9e7840; }
.text-link:hover { color: var(--ink); }
.hero-proof {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 52px;
}
.proof-seal {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid #d8c9a9;
  border-radius: 50%;
  color: #9a7540;
  font-size: 13px;
}
.hero-proof p { margin: 0; color: #788179; font-size: 11px; line-height: 1.55; }
.hero-proof strong { color: #34473e; font-weight: 700; }

.hero-art {
  position: relative;
  display: grid;
  min-height: 500px;
  place-items: center;
  isolation: isolate;
}
.hero-art::before {
  position: absolute;
  z-index: -2;
  inset: 2% -11% 0 1%;
  border-radius: 50% 50% 3px 3px;
  background:
    radial-gradient(ellipse at 45% 42%, rgba(255, 255, 255, .07), transparent 50%),
    linear-gradient(145deg, #29483d 0%, #1b342d 46%, #142720 100%);
  content: "";
}
.hero-art::after {
  position: absolute;
  z-index: -1;
  right: -4%;
  bottom: 0;
  width: 58%;
  height: 28%;
  background: linear-gradient(145deg, transparent 50%, rgba(179, 140, 78, .18));
  content: "";
  pointer-events: none;
}
.art-grid {
  position: absolute;
  z-index: -1;
  inset: 2% -11% 0 1%;
  border-radius: 50% 50% 3px 3px;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 85%);
}
.orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(224, 199, 152, .18);
  border-radius: 50%;
  pointer-events: none;
}
.orbit-one { width: 76%; aspect-ratio: 1; }
.orbit-two { width: 94%; aspect-ratio: 1; border-color: rgba(255,255,255,.08); }
.orbit-core {
  position: absolute;
  top: 17%;
  right: 14%;
  display: grid;
  width: 63px;
  height: 63px;
  place-items: center;
  border: 1px solid rgba(222, 192, 139, .46);
  border-radius: 50%;
  background: rgba(18, 39, 31, .62);
  color: #dfc38e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
}
.insight-card {
  position: relative;
  width: min(74%, 390px);
  min-height: 335px;
  margin-top: 14px;
  padding: 27px 29px 22px;
  border: 1px solid rgba(255,255,255,.64);
  background: #fbfaf5;
  box-shadow: 0 30px 80px rgba(7, 21, 15, .3);
  transform: rotate(-2deg);
}
.insight-top, .insight-bottom { display: flex; align-items: center; justify-content: space-between; }
.insight-kicker { color: #7d857c; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.insight-number {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 1px solid #e4dac6;
  border-radius: 50%;
  color: #a17c46;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
}
.insight-rule { height: 1px; margin: 23px 0 22px; background: #e7e3d9; }
.insight-card h2 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: -.05em;
  line-height: 1.08;
}
.insight-card h2 em { color: #a77f45; font-weight: 400; }
.insight-card > p { max-width: 275px; margin: 16px 0 23px; color: #758078; font-size: 11px; line-height: 1.7; }
.article-tag { padding: 7px 9px; background: #edf0e9; color: #3f5e4e; font-size: 9px; font-weight: 750; letter-spacing: .04em; }
.insight-link { color: #9d7944; font-size: 9px; font-weight: 800; letter-spacing: .1em; }
.float-label {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 1px solid rgba(234, 229, 213, .2);
  background: rgba(23, 44, 38, .76);
  color: #e7e4d9;
  font-size: 8px;
  font-weight: 750;
  letter-spacing: .11em;
  backdrop-filter: blur(12px);
}
.float-label-top { top: 11%; left: -7%; }
.float-label-bottom { right: -5%; bottom: 13%; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #bac88a; box-shadow: 0 0 0 4px rgba(186, 200, 138, .14); }
.mini-check { color: #d9bd8a; font-size: 13px; }
.art-index { position: absolute; right: -7%; bottom: 1%; color: rgba(255,255,255,.46); font-size: 9px; letter-spacing: .16em; }

.trust-strip {
  display: grid;
  grid-template-columns: 1.15fr repeat(3, 1fr);
  align-items: center;
  gap: 25px;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 24px clamp(24px, 8vw, 128px);
  border-top: 1px solid #dfddd5;
  border-bottom: 1px solid #dfddd5;
}
.trust-intro { color: #928a77; font-size: 8px; font-weight: 700; letter-spacing: .14em; line-height: 1.75; }
.trust-intro strong { color: #4b5c51; font-family: Georgia, "Times New Roman", serif; font-size: 14px; font-weight: 400; letter-spacing: -.01em; }
.trust-item { display: flex; align-items: center; gap: 11px; }
.trust-icon { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid #ddd4c2; border-radius: 50%; color: #a07a43; font-size: 9px; }
.trust-item strong, .trust-item small { display: block; }
.trust-item strong { color: #34473e; font-size: 11px; font-weight: 700; }
.trust-item small { margin-top: 2px; color: #899087; font-size: 9px; }

.how-section {
  position: relative;
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 103px clamp(24px, 8vw, 128px) 100px;
}
.how-section .eyebrow { margin-bottom: 20px; }
.how-section h2 { max-width: 720px; font-size: clamp(42px, 5vw, 67px); line-height: 1.08; }
.how-section h2 em { color: #78816f; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px; margin-top: 55px; }
.step { padding-top: 17px; border-top: 1px solid #d9d7ce; }
.step-no { color: #a17c46; font-family: Georgia, "Times New Roman", serif; font-size: 14px; }
.step h3 { margin: 19px 0 8px; color: #30443a; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; letter-spacing: -.025em; }
.step p { max-width: 280px; margin: 0; color: #778078; font-size: 12px; line-height: 1.75; }
.how-cta { margin-top: 37px; }
.landing-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 82px;
  padding: 14px clamp(24px, 8vw, 128px);
  border-top: 1px solid #dfddd5;
  background: #eeece5;
}
.footer-brand { font-size: 16px; }
.footer-brand .brand-mark { width: 25px; height: 25px; font-size: 15px; }
.landing-footer p { margin: 0; color: #798078; font-size: 10px; }
.landing-footer > span { color: #8b8c81; font-size: 8px; font-weight: 700; letter-spacing: .13em; }

/* Existing chat workspace shares the same visual system. */
.app.is-workspace .topbar { position: relative; }
.app.is-workspace .panes { min-height: 0; }
.app.is-workspace .nav, .app.is-workspace .rightcol, .app.is-workspace .chat { background: var(--white); }
.app.is-workspace .composer { border-radius: 5px; box-shadow: 0 9px 28px rgba(23,44,38,.06); }
.app.is-workspace button[type="submit"] { background: var(--ink); color: var(--white); }
.app.is-workspace .message.user .bubble { background: var(--ink); border-color: var(--ink); }

@media (max-width: 1000px) {
  .hero { grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 32px; padding-right: 6vw; padding-left: 6vw; }
  .hero h1 { font-size: clamp(58px, 8vw, 82px); }
  .hero-art { min-height: 440px; }
  .trust-strip { padding-right: 6vw; padding-left: 6vw; }
  .how-section { padding-right: 6vw; padding-left: 6vw; }
  .landing-footer { padding-right: 6vw; padding-left: 6vw; }
}

@media (max-width: 760px) {
  .topbar { height: 66px; padding: 0 20px; }
  .topbar .chip { max-width: 36vw; margin-left: 0; font-size: 10px; }
  .topbar-link { display: none; }
  .topbar-link[href="#/codes"] { display: block; font-size: 11px; }
  .topbar .chip { display: none; }
  .topbar-cta { gap: 10px; padding: 10px 12px; font-size: 11px; }
  .hero { grid-template-columns: 1fr; gap: 32px; min-height: auto; padding: 73px 24px 51px; }
  .hero-copy { max-width: 590px; }
  .hero h1 { font-size: clamp(64px, 13vw, 94px); }
  .hero-lede { max-width: 480px; margin-top: 20px; }
  .hero-proof { margin-top: 29px; }
  .hero-art { min-height: 450px; margin: 4px 12px 5px; }
  .hero-art::before, .art-grid { inset: 0 -5% 0; }
  .insight-card { width: min(78%, 390px); }
  .float-label-top { left: -4%; }
  .float-label-bottom { right: -3%; }
  .trust-strip { grid-template-columns: 1fr 1fr; gap: 22px 16px; padding: 24px; }
  .trust-intro { grid-column: 1 / -1; }
  .how-section { padding: 72px 24px 70px; }
  .steps { grid-template-columns: 1fr; gap: 23px; margin-top: 38px; }
  .step { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; padding-top: 13px; }
  .step-no { grid-row: span 2; padding-top: 2px; }
  .step h3 { margin: 0 0 5px; }
  .landing-footer { flex-wrap: wrap; padding: 18px 24px; }
  .landing-footer p { order: 3; width: 100%; }
  .app.is-workspace { height: auto; min-height: 100vh; }
  body.workspace-open { height: auto; overflow: auto; }
}

@media (max-width: 440px) {
  .brand { font-size: 18px; }
  .brand-mark { width: 27px; height: 27px; font-size: 16px; }
  .topbar { gap: 9px; padding: 0 15px; }
  .topbar .chip { max-width: 31vw; padding: 4px 8px; }
  .topbar-cta { padding: 9px 10px; }
  .hero { padding: 62px 20px 39px; }
  .hero h1 { font-size: 62px; }
  .hero-actions { gap: 17px; }
  .hero-art { min-height: 400px; margin-right: 8px; margin-left: 8px; }
  .insight-card { width: 82%; min-height: 310px; padding: 23px 22px 19px; }
  .float-label { padding: 9px 10px; font-size: 7px; }
  .float-label-top { left: -2%; }
  .float-label-bottom { right: -1%; bottom: 9%; }
  .trust-strip { padding: 21px 20px; }
  .trust-item { gap: 8px; }
  .trust-icon { width: 29px; height: 29px; }
}

@media (max-width: 360px) {
  .topbar .chip { display: none; }
  .hero h1 { font-size: 56px; }
  .hero-actions { gap: 13px; }
  .button-primary { gap: 20px; padding: 0 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

/* ---------- Internationalization, quiz, and code catalogue ---------- */

.language-toggle {
  min-width: 38px;
  padding: 7px 9px;
  border: 1px solid #ddd7c8;
  border-radius: 3px;
  background: transparent;
  color: #5f6d65;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.language-toggle:hover { border-color: var(--gold); color: var(--ink); }

.quiz-section {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 88px clamp(24px, 8vw, 128px) 92px;
}
.quiz-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 38px;
  margin-bottom: 35px;
}
.quiz-heading .eyebrow { margin-bottom: 16px; }
.quiz-heading h2 {
  max-width: 660px;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(35px, 4.2vw, 56px);
  font-weight: 400;
  letter-spacing: -.055em;
  line-height: 1.1;
}
.quiz-heading > p {
  max-width: 330px;
  margin: 0 0 4px;
  color: #778078;
  font-size: 12px;
  line-height: 1.8;
}
.quiz-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.quiz-group { min-width: 0; padding: 19px 18px 12px; border: 1px solid #dfded5; background: #fbfaf5; }
.quiz-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid #e7e4dc; }
.quiz-level-name { color: #3f5e4e; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.quiz-level-count { color: #929389; font-size: 10px; }
.quiz-level-hard .quiz-level-name { color: #9b713d; }
.quiz-level-hardest .quiz-level-name { color: #8a5260; }
.quiz-list { margin: 0; padding: 0; list-style: none; }
.quiz-item + .quiz-item { border-top: 1px solid #eeece5; }
.quiz-question {
  display: grid;
  grid-template-columns: 25px 1fr 14px;
  align-items: start;
  gap: 9px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  background: transparent;
  color: #4e5a51;
  text-align: left;
  font: inherit;
  font-size: 11px;
  line-height: 1.6;
  cursor: pointer;
}
.quiz-question:hover .quiz-question-text { color: #a17c46; }
.quiz-question-number { color: #aaa391; font-size: 9px; font-weight: 700; }
.quiz-question-arrow { color: #a17c46; font-size: 13px; }

.codes-page[hidden] { display: none !important; }
.codes-page { min-height: calc(100vh - 76px); padding: 48px 24px 90px; }
.codes-page-inner { width: min(100%, 1180px); margin: 0 auto; }
.codes-back { display: inline-block; margin-bottom: 46px; color: #66736b; font-size: 12px; text-decoration: none; }
.codes-back:hover { color: var(--ink); }
.codes-page .eyebrow { margin-bottom: 16px; }
.codes-page h1 {
  max-width: 740px;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 6vw, 76px);
  font-weight: 400;
  letter-spacing: -.06em;
  line-height: 1.05;
}
.codes-intro { max-width: 730px; margin: 18px 0 34px; color: #758078; font-size: 13px; line-height: 1.8; }
.code-catalog { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.catalog-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 264px;
  margin: 0;
  padding: 21px;
  border-color: #dfded5;
  border-radius: 3px;
  background: #fbfaf5;
}
.catalog-card.compact { min-height: 0; padding: 14px; }
.catalog-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-country { color: #798078; font-size: 10px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.catalog-state { padding: 4px 8px; border-radius: 99px; font-size: 9px; font-weight: 700; }
.catalog-state.is-loaded { background: #e8efe7; color: #42614e; }
.catalog-state.is-missing { background: #f1e9e5; color: #83584b; }
.catalog-title { margin: 17px 0 8px; color: #30443a; font-family: Georgia, "Times New Roman", serif; font-size: 20px; font-weight: 400; line-height: 1.3; }
.catalog-count { margin: 0; color: #65736a; font-size: 11px; }
.catalog-date { margin: 11px 0 0; color: #8a8d83; font-size: 10px; }
.catalog-date strong { color: #59665c; font-weight: 650; }
.catalog-language-note { margin: 8px 0 0 !important; color: #8b7041 !important; font-size: 10px !important; }
.catalog-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 18px 0 14px; }
.catalog-link { color: #725c30; font-size: 10px; font-weight: 700; text-decoration: none; }
.catalog-link:hover { text-decoration: underline; }
.catalog-link.secondary { color: #758078; }
.catalog-choose {
  align-self: flex-start;
  margin-top: auto;
  padding: 8px 11px;
  border: 1px solid #d8d5ca;
  border-radius: 3px;
  background: transparent;
  color: #536359;
  font: inherit;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}
.catalog-choose:hover:not(:disabled) { border-color: var(--gold); color: #8b6a35; }
.catalog-choose:disabled { opacity: .5; cursor: not-allowed; }
.codes-note { max-width: 780px; margin: 24px 0 0; color: #85867d; font-size: 10px; line-height: 1.7; }

@media (max-width: 760px) {
  .quiz-section { padding: 62px 24px 70px; }
  .quiz-heading { display: block; }
  .quiz-heading > p { margin-top: 15px; }
  .quiz-groups { grid-template-columns: 1fr; }
  .codes-page { padding: 35px 22px 65px; }
  .codes-back { margin-bottom: 34px; }
  .code-catalog { grid-template-columns: 1fr; }
}
