:root {
  --ink: #0b132b;
  --ocean: #102d44;
  --navy: #071a2f;
  --navy-soft: #0c2942;
  --teal: #00bfc4;
  --teal-dark: #078c94;
  --teal-wash: #e7f8f7;
  --coral: #ff7a59;
  --amber: #e9af45;
  --paper: #fffdf9;
  --cream: #f7f4ed;
  --mist: #eef3f2;
  --line: #dce3e2;
  --muted: #68778b;
  --white: #ffffff;
  --shadow: 0 18px 52px rgba(13, 31, 48, 0.08);
  --sidebar-width: 268px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--cream);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% 5%, rgba(0, 191, 196, 0.08), transparent 26rem),
    var(--cream);
  color: var(--ink);
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

button,
textarea,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 750;
  transform: translateY(-180%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  height: 100vh;
  padding: 30px 24px 28px;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 115%, rgba(0, 191, 196, 0.23), transparent 44%),
    linear-gradient(180deg, var(--navy) 0%, #08233b 100%);
  color: var(--white);
}

.sidebar::after {
  position: absolute;
  right: -100px;
  bottom: -135px;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(117, 238, 240, 0.13);
  border-radius: 50%;
  box-shadow:
    0 0 0 32px rgba(117, 238, 240, 0.05),
    0 0 0 70px rgba(117, 238, 240, 0.035),
    0 0 0 112px rgba(117, 238, 240, 0.02);
  content: "";
  pointer-events: none;
}

.brand {
  display: flex;
  position: relative;
  z-index: 1;
  align-items: center;
  gap: 13px;
  color: var(--white);
  text-decoration: none;
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  box-shadow: 0 9px 30px rgba(0, 0, 0, 0.2);
}

.brand > span {
  display: flex;
  flex-direction: column;
}

.brand strong {
  font-size: 1.55rem;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand strong span {
  color: var(--teal);
}

.brand small {
  margin-top: 6px;
  color: #c7d3dd;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.brand-line {
  margin: 38px 7px 27px;
  color: #cbd6df;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.75;
}

.brand-line span {
  color: var(--teal);
}

.primary-nav {
  display: grid;
  position: relative;
  z-index: 1;
  gap: 9px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  align-items: center;
  gap: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #d6e0e7;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 680;
  text-align: left;
  transition: 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.055);
  color: var(--white);
}

.nav-item.is-active {
  border-color: rgba(117, 238, 240, 0.28);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 4px 0 var(--teal);
  color: var(--white);
}

.nav-symbol {
  display: inline-grid;
  width: 27px;
  color: var(--teal);
  font-size: 1.25rem;
  place-items: center;
}

.sidebar-foot {
  position: relative;
  z-index: 1;
  margin-top: auto;
}

.local-state {
  display: flex;
  padding: 15px;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  background: rgba(3, 19, 34, 0.54);
}

.local-state i,
.state-pill i {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 7px rgba(0, 191, 196, 0.12);
}

.local-state span {
  display: flex;
  flex-direction: column;
}

.local-state strong {
  font-size: 0.8rem;
}

.local-state small {
  margin-top: 2px;
  color: #9db0c0;
  font-size: 0.7rem;
}

.sidebar-foot > p {
  margin: 20px 7px 0;
  color: #9db0c0;
  font-size: 0.73rem;
  line-height: 1.6;
}

.workspace {
  display: flex;
  min-width: 0;
  min-height: 100vh;
  flex-direction: column;
}

.topbar {
  display: flex;
  z-index: 4;
  min-height: 78px;
  padding: 0 clamp(24px, 4vw, 68px);
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid rgba(11, 19, 43, 0.08);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(18px);
}

.mobile-brand {
  display: none;
}

.product-title {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.product-title strong {
  font-size: 1.08rem;
}

.product-title span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.state-pill {
  display: flex;
  min-height: 38px;
  padding: 0 15px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ocean);
  font-size: 0.78rem;
  font-weight: 740;
}

.language-switch {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.language-switch button {
  width: 36px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 800;
}

.language-switch button.is-active {
  background: var(--ink);
  color: var(--white);
}

main {
  flex: 1;
}

.view {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(50px, 7vw, 90px) 0 70px;
}

.view[hidden] {
  display: none;
}

.ask-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  align-items: end;
  gap: clamp(40px, 7vw, 100px);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--teal-dark);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.2em;
}

.hero-copy h1,
.page-intro h1 {
  max-width: 780px;
  margin: 0;
  color: var(--ink);
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.97;
  white-space: pre-line;
}

.hero-body,
.page-intro > p:last-child {
  max-width: 720px;
  margin: 26px 0 0;
  color: #4b5c6d;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.72;
}

.hero-principle {
  padding: 26px 0 4px 26px;
  border-left: 1px solid var(--line);
}

.hero-principle > span {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.18em;
}

.hero-principle strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--ocean);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 500;
}

.hero-principle p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.7;
}

.query-card {
  position: relative;
  margin-top: 46px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.query-card label {
  display: block;
  margin-bottom: 11px;
  color: var(--ocean);
  font-size: 0.78rem;
  font-weight: 790;
  letter-spacing: 0.02em;
}

.composer {
  display: flex;
  min-height: 92px;
  padding: 8px 8px 8px 19px;
  align-items: stretch;
  gap: 12px;
  border: 1.5px solid #b9cece;
  border-radius: 17px;
  background: var(--paper);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.composer:focus-within {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 4px rgba(0, 191, 196, 0.1);
}

.composer textarea {
  min-width: 0;
  flex: 1;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
}

.composer textarea::placeholder {
  color: #8996a3;
}

.ask-button {
  display: flex;
  min-width: 168px;
  padding: 0 20px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  border: 0;
  border-radius: 13px;
  background: var(--teal);
  color: var(--ink);
  cursor: pointer;
  font-weight: 820;
  box-shadow: 0 8px 24px rgba(0, 191, 196, 0.2);
  transition: transform 150ms ease, background 150ms ease;
}

.ask-button:hover {
  background: #18ccd0;
  transform: translateY(-1px);
}

.ask-button:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.ask-button b {
  font-size: 1.15rem;
}

.composer-meta {
  display: flex;
  margin: 10px 3px 0;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 0.7rem;
}

kbd {
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--cream);
  font-size: 0.65rem;
}

.suggestions {
  display: flex;
  margin-top: 21px;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.suggestions > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.suggestions button,
.quiet-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ocean);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 680;
}

.suggestions button:hover,
.quiet-button:hover {
  border-color: var(--teal-dark);
  color: var(--teal-dark);
}

.foundation-strip {
  display: grid;
  margin-top: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(247, 244, 237, 0.7);
}

.foundation-strip > div {
  display: flex;
  min-width: 0;
  padding: 17px 20px;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.foundation-strip > div:last-child {
  border-right: 0;
}

.foundation-strip strong {
  color: var(--ocean);
  font-size: 1.05rem;
  line-height: 1.2;
}

.foundation-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
}

.hash-stat strong {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-region {
  margin-top: 54px;
  padding-top: 43px;
  border-top: 1px solid var(--line);
}

.result-region[hidden] {
  display: none;
}

.result-head {
  display: flex;
  margin-bottom: 20px;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.decision-badge {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--teal-wash);
  color: var(--teal-dark);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.decision-badge.is-insufficient {
  background: #fff3d8;
  color: #8a641d;
}

.decision-badge.is-error {
  background: #ffede8;
  color: #a4442c;
}

.result-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  letter-spacing: -0.04em;
}

.result-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.answer-panel {
  min-height: 460px;
  padding: clamp(28px, 4vw, 46px);
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 30% 8%, rgba(0, 191, 196, 0.055), transparent 18rem),
    var(--paper);
}

.answer-kicker {
  margin: 0 0 20px;
  color: var(--teal-dark);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.17em;
}

.answer-question {
  margin: 0 0 28px;
  color: var(--ink);
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.retrieved-note {
  display: flex;
  margin-bottom: 18px;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 680;
}

.retrieved-note::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  content: "";
}

.primary-passage {
  margin: 0;
  color: #263a4a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1.8vw, 1.28rem);
  line-height: 1.72;
}

.primary-citation {
  display: flex;
  margin-top: 28px;
  padding-top: 20px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--line);
  color: var(--ocean);
  font-size: 0.76rem;
  font-weight: 760;
}

.verified-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal-dark);
  white-space: nowrap;
}

.verified-mark::before {
  display: inline-grid;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--teal-wash);
  content: "✓";
  font-size: 0.68rem;
  place-items: center;
}

.answer-boundary {
  margin: 25px 0 0;
  padding: 14px 16px;
  border-left: 3px solid var(--amber);
  background: #fffaf0;
  color: #6e6045;
  font-size: 0.78rem;
  line-height: 1.6;
}

.empty-answer {
  display: grid;
  min-height: 350px;
  align-content: center;
  justify-items: start;
}

.empty-answer .empty-symbol {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: 22px;
  border-radius: 50%;
  background: #fff3d8;
  color: #8a641d;
  font-size: 1.4rem;
  place-items: center;
}

.empty-answer h3 {
  margin: 0 0 12px;
  font-size: 1.6rem;
  letter-spacing: -0.035em;
}

.empty-answer p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
}

.evidence-panel {
  padding: 30px 24px;
  background: #fbfaf6;
}

.evidence-heading {
  display: flex;
  margin-bottom: 20px;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.evidence-heading span {
  color: var(--teal-dark);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.evidence-heading h3 {
  margin: 4px 0 0;
  font-size: 1.1rem;
}

#result-timing {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0;
  white-space: nowrap;
}

#evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}

.evidence-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.evidence-rank {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.evidence-card h4 {
  margin: 7px 0 4px;
  color: var(--ocean);
  font-size: 0.87rem;
  line-height: 1.35;
}

.citation-label {
  margin: 0;
  color: var(--teal-dark);
  font-size: 0.67rem;
  font-weight: 760;
}

.evidence-excerpt {
  display: -webkit-box;
  margin: 12px 0 0;
  overflow: hidden;
  color: #536273;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.76rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.evidence-card details {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #edf0ee;
}

.evidence-card summary {
  color: var(--muted);
  cursor: pointer;
  font-size: 0.66rem;
  font-weight: 700;
}

.identity-list {
  display: grid;
  margin: 10px 0 0;
  gap: 6px;
}

.identity-list div {
  min-width: 0;
}

.identity-list dt {
  color: var(--muted);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.identity-list dd {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--ocean);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.61rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-intro {
  padding-bottom: 44px;
  border-bottom: 1px solid var(--line);
}

.page-intro h1 {
  font-size: clamp(3rem, 6vw, 5rem);
}

.catalog-grid {
  display: grid;
  margin-top: 34px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.manual-card {
  display: grid;
  min-height: 270px;
  padding: 26px;
  grid-template-rows: auto auto 1fr auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 0 10px 32px rgba(13, 31, 48, 0.045);
}

.manual-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.manual-id,
.ready-badge {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 800;
}

.manual-id {
  color: var(--teal-dark);
}

.ready-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--teal-wash);
  color: var(--teal-dark);
}

.manual-card h2 {
  margin: 22px 0 12px;
  color: var(--ink);
  font-size: 1.45rem;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.manual-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.manual-meta {
  display: flex;
  margin-top: 24px;
  padding-top: 17px;
  flex-wrap: wrap;
  gap: 8px 18px;
  border-top: 1px solid var(--line);
  color: var(--ocean);
  font-size: 0.7rem;
  font-weight: 700;
}

.about-intro {
  border-bottom: 0;
}

.boundary-grid {
  display: grid;
  margin-top: 44px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.boundary-grid article {
  min-height: 260px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
}

.boundary-grid article > span {
  color: var(--teal-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.7rem;
  font-weight: 800;
}

.boundary-grid h2 {
  margin: 52px 0 12px;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.boundary-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.7;
}

.proof-chain {
  display: grid;
  margin-top: 18px;
  padding: 28px;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  background: var(--navy);
  color: var(--white);
}

.proof-chain div {
  display: flex;
  flex-direction: column;
}

.proof-chain small {
  color: var(--teal);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.62rem;
}

.proof-chain strong {
  margin: 7px 0 3px;
  font-size: 0.85rem;
}

.proof-chain span {
  color: #9db0c0;
  font-size: 0.68rem;
}

.proof-chain i {
  color: var(--teal);
  font-style: normal;
}

.workspace-footer {
  display: flex;
  min-height: 62px;
  padding: 18px clamp(24px, 4vw, 68px);
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.66rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1020px) {
  :root {
    --sidebar-width: 224px;
  }

  .sidebar {
    padding-inline: 17px;
  }

  .ask-hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .hero-principle {
    max-width: 680px;
  }

  .result-layout {
    grid-template-columns: 1fr;
  }

  .answer-panel {
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .boundary-grid article {
    min-height: 0;
  }

  .boundary-grid h2 {
    margin-top: 28px;
  }

  .proof-chain {
    grid-template-columns: 1fr;
  }

  .proof-chain i {
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: block;
    width: auto;
    height: 68px;
    padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar::after,
  .sidebar > .brand,
  .brand-line,
  .sidebar-foot {
    display: none;
  }

  .primary-nav {
    display: grid;
    height: 54px;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
  }

  .nav-item {
    min-height: 52px;
    padding: 4px 6px;
    flex-direction: column;
    justify-content: center;
    gap: 1px;
    border-radius: 10px;
    font-size: 0.62rem;
    text-align: center;
  }

  .nav-item.is-active {
    box-shadow: inset 0 3px var(--teal);
  }

  .nav-symbol {
    height: 22px;
    font-size: 1rem;
  }

  .topbar {
    min-height: 68px;
    padding-inline: 17px;
  }

  .mobile-brand {
    display: block;
    width: 118px;
    height: 42px;
    overflow: hidden;
  }

  .mobile-brand img {
    width: 118px;
    height: auto;
    transform: translateY(5px);
  }

  .product-title,
  .state-pill {
    display: none;
  }

  .view {
    width: min(100% - 30px, 1180px);
    padding-top: 42px;
    padding-bottom: 110px;
  }

  .hero-copy h1,
  .page-intro h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .hero-body {
    margin-top: 20px;
  }

  .hero-principle {
    padding: 18px 0 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .query-card {
    margin-top: 30px;
    padding: 17px;
    border-radius: 17px;
  }

  .composer {
    min-height: 150px;
    padding: 13px;
    flex-direction: column;
  }

  .composer textarea {
    min-height: 72px;
    font-size: 1rem;
  }

  .ask-button {
    min-height: 48px;
  }

  .composer-meta span:last-child {
    display: none;
  }

  .suggestions {
    align-items: start;
  }

  .suggestions > span {
    width: 100%;
  }

  .foundation-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .foundation-strip > div:nth-child(2) {
    border-right: 0;
  }

  .foundation-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .result-head {
    align-items: start;
  }

  .answer-panel,
  .evidence-panel {
    padding: 24px 19px;
  }

  .primary-citation {
    align-items: start;
    flex-direction: column;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .workspace-footer {
    display: none;
  }
}

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

/* Production demo surfaces */
.nav-item {
  text-decoration: none;
}

.nav-item > span {
  display: inline-grid;
  width: 27px;
  color: var(--teal);
  font-size: 1.1rem;
  place-items: center;
}

.nav-item b {
  font-weight: 680;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.7fr);
  align-items: end;
  gap: clamp(40px, 7vw, 100px);
}

.home-hero .hero-copy h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 6vw, 5.8rem);
  font-weight: 720;
  letter-spacing: -0.065em;
  line-height: 0.97;
  white-space: pre-line;
}

.home-hero .hero-copy > p:last-of-type,
.reader-deck {
  max-width: 720px;
  margin: 26px 0 0;
  color: #4b5c6d;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
  line-height: 1.72;
}

.hero-actions {
  display: flex;
  margin-top: 32px;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-action,
.secondary-action,
.manual-open,
.original-link {
  display: inline-flex;
  min-height: 48px;
  padding: 0 19px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 780;
}

.primary-action {
  background: var(--teal);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0, 191, 196, 0.2);
}

.secondary-action,
.manual-open,
.original-link {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ocean);
}

.trust-grid {
  display: grid;
  margin-top: 28px;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.trust-grid article {
  min-height: 190px;
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
}

.trust-grid article > span,
.boundary-grid article > span {
  color: var(--teal-dark);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.trust-grid h2 {
  margin: 28px 0 9px;
  font-size: 1.12rem;
}

.trust-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.compact-intro h1 {
  max-width: 900px;
  font-size: clamp(2.7rem, 5.3vw, 5rem);
}

.library-search {
  display: grid;
  margin-top: 34px;
  gap: 8px;
  color: var(--ocean);
  font-size: 0.76rem;
  font-weight: 780;
}

.library-search input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1.5px solid #b9cece;
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
}

.library-count {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
}

.manual-card {
  display: flex;
  flex-direction: column;
}

.manual-open {
  align-self: flex-start;
  min-height: 42px;
  margin-top: auto;
  padding-inline: 15px;
  font-size: 0.75rem;
}

.catalog-empty {
  grid-column: 1 / -1;
  padding: 45px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.citation-button {
  display: flex;
  width: 100%;
  margin-top: 14px;
  padding: 12px 13px;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  border: 1px solid #b9dedd;
  border-radius: 11px;
  background: var(--teal-wash);
  color: var(--ocean);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 760;
  text-align: left;
}

.citation-button:hover {
  border-color: var(--teal-dark);
}

.primary-citation-button {
  margin-top: 28px;
  padding: 15px;
}

.answer-query {
  margin-top: 18px !important;
  color: var(--ocean) !important;
  font-family: Georgia, "Times New Roman", serif;
}

.back-button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 14px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ocean);
  cursor: pointer;
  font-weight: 720;
}

.reader-content {
  margin-top: 30px;
}

.reader-shell {
  max-width: 920px;
  margin: 0 auto;
}

.reader-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}

.reader-header h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 4.7rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.reader-meta {
  display: grid;
  margin: 24px 0;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--line);
}

.reader-meta div {
  min-width: 0;
  padding: 15px;
  background: var(--paper);
}

.reader-meta dt {
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 800;
  text-transform: uppercase;
}

.reader-meta dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--ocean);
  font-size: 0.78rem;
}

.reader-passage {
  margin-top: 20px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.reader-passage.is-cited {
  border: 2px solid var(--teal-dark);
  box-shadow: 0 18px 55px rgba(0, 191, 196, 0.12);
}

.passage-label {
  color: var(--teal-dark);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.reader-passage p {
  margin: 18px 0 0;
  color: #263a4a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 1.9vw, 1.28rem);
  line-height: 1.78;
}

.reader-passage small {
  display: block;
  margin-top: 24px;
  color: var(--teal-dark);
  font-weight: 700;
}

.text-link {
  margin-top: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--teal-dark);
  cursor: pointer;
  font-weight: 780;
}

.original-link {
  margin-top: 20px;
}

.reader-error,
.empty-page {
  padding: 80px 20px;
  text-align: center;
}

.empty-page > span {
  color: var(--teal-dark);
  font-weight: 850;
  letter-spacing: 0.18em;
}

.empty-page h1 {
  margin: 15px 0 28px;
}

.menu-button,
.mobile-nav {
  display: none;
}

@media (max-width: 1020px) {
  .home-hero {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .trust-grid article {
    min-height: 0;
  }
}

@media (max-width: 760px) {
  .primary-nav {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-item {
    font-size: 0.58rem;
  }

  .nav-item > span {
    width: auto;
    height: 22px;
    font-size: 0.95rem;
  }

  .home-hero .hero-copy h1 {
    font-size: clamp(2.65rem, 13vw, 4rem);
  }

  .home-hero .hero-copy > p:last-of-type {
    margin-top: 20px;
  }

  .hero-actions > * {
    width: 100%;
  }

  .reader-meta {
    grid-template-columns: 1fr;
  }

  .reader-passage {
    padding: 23px 18px;
  }

  .citation-button {
    align-items: flex-start;
    flex-direction: column;
  }

  .menu-button,
  .mobile-nav {
    display: none;
  }
}
