:root {
  --deep: #082f31;
  --deep-2: #0d3f40;
  --teal: #176b69;
  --teal-soft: #dcece7;
  --mint: #b9d8cd;
  --coral: #e86d57;
  --coral-dark: #bd4c3b;
  --evidence: #e3b758;
  --paper: #f2f5f1;
  --sheet: #fffefa;
  --ink: #172625;
  --muted: #687773;
  --line: #ccd8d2;
  --line-dark: rgba(255, 255, 255, 0.14);
  --danger: #a63e33;
  --success: #3ba37f;
  --display: ui-serif, "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 22px 70px rgba(8, 47, 49, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(90deg, rgba(23, 107, 105, 0.028) 1px, transparent 1px),
    linear-gradient(rgba(23, 107, 105, 0.028) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

body:has(dialog[open]) {
  overflow: hidden;
}

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

button,
select,
input[type="file"] {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(232, 109, 87, 0.45);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.is-hidden {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  color: var(--sheet);
  background: var(--deep);
  transform: translateY(-150%);
}

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

.section-code,
.eyebrow,
.topbar-kicker,
.nav-label {
  font-family: var(--utility);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 40;
  inset: 0 auto 0 0;
  display: flex;
  width: 252px;
  flex-direction: column;
  padding: 27px 20px 20px;
  color: #edf7f3;
  background:
    radial-gradient(circle at 20% 0, rgba(71, 145, 134, 0.25), transparent 30%),
    var(--deep);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar::after {
  position: absolute;
  right: 15px;
  bottom: 0;
  width: 1px;
  height: 24%;
  content: "";
  background: linear-gradient(transparent, var(--coral));
}

.brand {
  display: flex;
  width: 100%;
  gap: 13px;
  align-items: center;
  padding: 0;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 0;
}

.brand-mark {
  position: relative;
  display: block;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.36);
}

.brand-mark::before,
.brand-mark::after {
  position: absolute;
  top: 50%;
  left: 50%;
  content: "";
  background: var(--coral);
  transform: translate(-50%, -50%);
}

.brand-mark::before {
  width: 18px;
  height: 2px;
}

.brand-mark::after {
  width: 2px;
  height: 18px;
}

.brand-mark i,
.brand-mark b {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--evidence);
  border-radius: 50%;
}

.brand-mark i {
  top: 5px;
  right: 5px;
}

.brand-mark b {
  bottom: 5px;
  left: 5px;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-family: var(--display);
  font-size: 21px;
  letter-spacing: 0.11em;
}

.brand-copy small {
  margin-top: 4px;
  color: #86aaa5;
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.primary-nav {
  margin-top: 58px;
}

.nav-label {
  display: block;
  padding: 0 11px 14px;
  color: #749e99;
  font-size: 8px;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 32px 1fr;
  gap: 8px;
  align-items: center;
  padding: 13px 10px;
  color: #8fb0ab;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  transition: color 160ms ease, background 160ms ease, padding 160ms ease;
}

.nav-item:hover,
.nav-item.is-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
}

.nav-item.is-active {
  padding-left: 14px;
}

.nav-item.is-active::before {
  position: absolute;
  inset: 9px auto 9px 0;
  width: 2px;
  content: "";
  background: var(--coral);
}

.nav-index {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 11px;
}

.nav-item strong,
.nav-item small {
  display: block;
}

.nav-item strong {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-item small {
  margin-top: 4px;
  color: #688e89;
  font-size: 10px;
}

.nav-item.is-active small {
  color: #9dc0ba;
}

.system-card {
  padding: 14px;
  margin-top: auto;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.system-status {
  display: flex;
  gap: 10px;
  align-items: center;
}

.status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--evidence);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(227, 183, 88, 0.13);
}

.status-dot.is-ready {
  background: var(--success);
  box-shadow: 0 0 0 5px rgba(59, 163, 127, 0.14);
}

.status-dot.is-error {
  background: var(--coral);
  box-shadow: 0 0 0 5px rgba(232, 109, 87, 0.14);
}

.system-status strong,
.system-status small {
  display: block;
}

.system-status strong {
  font-size: 11px;
  font-weight: 600;
}

.system-status small {
  margin-top: 3px;
  color: #70958f;
  font-family: var(--utility);
  font-size: 8px;
}

.system-counts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding-top: 12px;
  margin-top: 12px;
  color: #739a94;
  font-size: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-counts span {
  text-align: center;
}

.system-counts strong {
  display: block;
  margin-bottom: 3px;
  color: #f1f8f5;
  font-family: var(--utility);
  font-size: 12px;
}

.sidebar-note {
  margin: 13px 0 0;
  color: #608984;
  font-size: 9px;
  line-height: 1.7;
}

.main-stage {
  min-height: 100vh;
  margin-left: 252px;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 42px;
  background: rgba(242, 245, 241, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar-context span,
.topbar-context strong {
  display: block;
}

.topbar-kicker {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 8px;
}

.topbar-context strong {
  font-family: var(--display);
  font-size: 16px;
  letter-spacing: 0.05em;
}

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

.top-search {
  padding: 7px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.top-search span {
  margin-right: 8px;
  color: var(--coral);
  font-size: 18px;
}

.live-stamp {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.live-stamp span {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(59, 163, 127, 0.12);
}

.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--line);
}

.menu-button span {
  display: block;
  height: 1px;
  margin: 4px 0;
  background: var(--ink);
}

.workspace-view {
  display: none;
  max-width: 1560px;
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  animation: view-in 260ms ease both;
}

.workspace-view.is-active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.solid-button,
.line-button,
.text-button,
.send-button {
  border: 0;
  transition: color 160ms ease, background 160ms ease, border 160ms ease, transform 160ms ease;
}

.solid-button {
  display: inline-flex;
  min-height: 44px;
  gap: 22px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  color: #fff;
  background: var(--coral);
  border: 1px solid var(--coral);
  font-weight: 600;
}

.solid-button:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
  transform: translateY(-1px);
}

.line-button {
  display: inline-flex;
  min-height: 42px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  color: var(--deep);
  background: transparent;
  border: 1px solid var(--deep);
  font-weight: 600;
}

.line-button:hover {
  color: #fff;
  background: var(--deep);
}

.text-button {
  padding: 5px 0;
  color: var(--teal);
  background: transparent;
  border-bottom: 1px solid currentColor;
  font-size: 11px;
}

.home-hero {
  display: grid;
  min-height: 690px;
  grid-template-columns: minmax(390px, 0.86fr) minmax(520px, 1.14fr);
  gap: clamp(34px, 5vw, 82px);
  align-items: center;
  padding: 58px clamp(38px, 5.2vw, 86px) 64px;
  overflow: hidden;
  background: var(--sheet);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  display: inline-block;
  color: var(--teal);
  font-size: 9px;
}

.hero-copy h1,
.module-intro h1 {
  margin: 21px 0 24px;
  font-family: var(--display);
  font-size: clamp(48px, 5vw, 78px);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.hero-lede {
  max-width: 570px;
  margin-bottom: 31px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  gap: 0;
  margin-top: 48px;
  border-top: 1px solid var(--line);
}

.hero-meta > span {
  min-width: 112px;
  padding: 16px 24px 0 0;
}

.hero-meta > span + span {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.hero-meta strong,
.hero-meta small {
  display: block;
}

.hero-meta strong {
  font-family: var(--display);
  font-size: 29px;
  font-weight: 500;
}

.hero-meta small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.evidence-board {
  position: relative;
  display: grid;
  height: 540px;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-rows: 38px 1.08fr 0.92fr;
  gap: 7px;
}

.evidence-board::before {
  position: absolute;
  z-index: 2;
  top: 23px;
  right: -21px;
  width: 78px;
  height: 78px;
  content: "";
  border-top: 1px solid var(--coral);
  border-right: 1px solid var(--coral);
}

.board-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.board-label b {
  color: var(--coral);
  font-weight: 500;
}

.evidence-image {
  position: relative;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: var(--deep);
  border: 0;
}

.evidence-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.78) contrast(1.03);
  transition: transform 400ms ease, filter 300ms ease;
}

.evidence-image:hover img {
  filter: saturate(1) contrast(1.02);
  transform: scale(1.035);
}

.evidence-image > span {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 24px 13px 11px;
  color: #fff;
  text-align: left;
  background: linear-gradient(transparent, rgba(4, 27, 28, 0.8));
}

.evidence-image b {
  font-family: var(--display);
  font-size: 15px;
}

.evidence-image small {
  color: #d0ded9;
  font-size: 9px;
}

.evidence-a {
  grid-row: 2 / 4;
}

.morphology-ribbon {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 42px;
  padding: 52px clamp(38px, 5.2vw, 86px);
  color: #eaf5f1;
  background: var(--deep);
}

.ribbon-heading .section-code,
.differential-lab .section-code {
  color: var(--evidence);
}

.ribbon-heading h2,
.section-heading h2,
.source-ledger h2,
.differential-lab h2,
.question-brief h2,
.dossier h2,
.stage-brief h2,
.admin-panel h2,
.admin-unlock h2,
.compare-head h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.ribbon-heading h2 {
  margin: 12px 0 12px;
  font-size: 28px;
}

.ribbon-heading p {
  margin-bottom: 0;
  color: #89aba5;
  font-size: 12px;
  line-height: 1.75;
}

.ribbon-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line-dark);
  border-left: 1px solid var(--line-dark);
}

.ribbon-options button {
  display: flex;
  min-height: 86px;
  gap: 13px;
  align-items: center;
  padding: 16px;
  color: #dbeae6;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line-dark);
  border-bottom: 1px solid var(--line-dark);
}

.ribbon-options button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.ribbon-options i {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  background: var(--coral);
  border: 2px solid var(--deep);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--coral);
}

.ribbon-options button:nth-child(2) i {
  border-radius: 50% 50% 45% 55%;
  box-shadow: 0 0 0 1px var(--coral), 7px -3px 0 -3px var(--evidence);
}

.ribbon-options button:nth-child(3) i {
  width: 4px;
  height: 4px;
  box-shadow: 7px 2px 0 var(--coral), -4px 6px 0 var(--coral), 1px -6px 0 var(--coral);
}

.ribbon-options button:nth-child(4) i {
  width: 16px;
  border-radius: 50%;
}

.ribbon-options button:nth-child(5) i {
  width: 4px;
  height: 18px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.ribbon-options button:nth-child(6) i {
  background: transparent;
  border: 1px dashed var(--evidence);
  box-shadow: none;
}

.ribbon-options b,
.ribbon-options small {
  display: block;
}

.ribbon-options b {
  font-size: 12px;
  font-weight: 600;
}

.ribbon-options small {
  margin-top: 5px;
  color: #638e87;
  font-family: var(--utility);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.learning-route {
  padding: 78px clamp(38px, 5.2vw, 86px) 88px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 32px;
}

.section-heading .section-code,
.source-ledger .section-code {
  color: var(--teal);
}

.section-heading h2,
.source-ledger h2 {
  margin: 10px 0 0;
  font-size: 31px;
}

.section-heading > p {
  max-width: 320px;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--line);
  gap: 1px;
  border: 1px solid var(--line);
}

.route-card {
  position: relative;
  min-height: 285px;
  padding: 25px;
  color: var(--ink);
  text-align: left;
  background: var(--sheet);
  border: 0;
}

.route-number {
  color: var(--teal);
  font-family: var(--utility);
  font-size: 11px;
}

.route-accent {
  position: absolute;
  top: 26px;
  right: 25px;
  width: 23px;
  height: 23px;
  border: 1px solid var(--line);
  transform: rotate(45deg);
  transition: background 180ms ease, border 180ms ease;
}

.route-card:hover .route-accent {
  background: var(--coral);
  border-color: var(--coral);
}

.route-card h3 {
  margin: 48px 0 14px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 500;
}

.route-card p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.route-card > b {
  position: absolute;
  right: 25px;
  bottom: 22px;
  left: 25px;
  display: flex;
  justify-content: space-between;
  padding-top: 13px;
  color: var(--teal);
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.source-ledger {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(380px, 1.25fr) auto;
  gap: 42px;
  align-items: center;
  padding: 48px clamp(38px, 5.2vw, 86px);
  background: var(--teal-soft);
  border-top: 1px solid #c0d9d0;
}

.source-ledger p {
  margin-bottom: 0;
  color: #49645f;
  font-size: 12px;
  line-height: 1.85;
}

.module-intro {
  position: relative;
  display: grid;
  min-height: 350px;
  grid-template-columns: 100px minmax(420px, 1fr) minmax(250px, 340px);
  gap: clamp(26px, 4vw, 60px);
  align-items: center;
  padding: 48px clamp(38px, 5.2vw, 86px);
  overflow: hidden;
  background: var(--sheet);
  border-bottom: 1px solid var(--line);
}

.module-number {
  align-self: start;
  padding-top: 36px;
  color: var(--coral);
  font-family: var(--utility);
  font-size: 54px;
  line-height: 1;
  opacity: 0.9;
}

.module-number::after {
  display: block;
  width: 1px;
  height: 88px;
  margin: 19px 0 0 14px;
  content: "";
  background: linear-gradient(var(--coral), transparent);
}

.module-intro h1 {
  margin-bottom: 0;
  font-size: clamp(43px, 4.4vw, 66px);
}

.module-note,
.case-selector-card {
  align-self: end;
  padding: 21px;
  background: var(--paper);
  border-top: 3px solid var(--teal);
}

.module-note strong,
.module-note p {
  display: block;
}

.module-note strong {
  margin-bottom: 9px;
  font-size: 12px;
}

.module-note p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
}

.atlas-workbench {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  gap: 40px;
  padding: 44px clamp(34px, 4.5vw, 72px) 70px;
}

.atlas-controls {
  position: sticky;
  top: 96px;
  align-self: start;
}

.atlas-search > span,
.filter-group legend,
.lab-form > label,
.admin-unlock label {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.atlas-search > div {
  position: relative;
  margin-top: 9px;
}

.atlas-search i {
  position: absolute;
  top: 50%;
  left: 12px;
  color: var(--coral);
  font-style: normal;
  font-size: 20px;
  transform: translateY(-50%);
}

.atlas-search input {
  width: 100%;
  height: 45px;
  padding: 0 12px 0 37px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 12px;
}

.filter-group {
  padding: 0;
  margin: 28px 0 0;
  border: 0;
}

.category-filters,
.morph-filters {
  display: grid;
  margin-top: 10px;
}

.category-filters button,
.morph-filters button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 9px 8px;
  color: var(--muted);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
}

.category-filters button:hover,
.category-filters button.is-active,
.morph-filters button:hover,
.morph-filters button.is-active {
  color: var(--deep);
  background: var(--teal-soft);
}

.category-filters button.is-active::before,
.morph-filters button.is-active::before {
  width: 5px;
  height: 5px;
  margin-right: 8px;
  content: "";
  background: var(--coral);
  border-radius: 50%;
}

.category-filters b,
.morph-filters b {
  margin-left: auto;
  color: var(--teal);
  font-family: var(--utility);
  font-size: 9px;
  font-weight: 500;
}

.reset-filter {
  width: 100%;
  padding: 12px 0;
  margin-top: 20px;
  color: var(--teal);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--teal);
  font-size: 11px;
}

.reset-filter span {
  float: right;
}

.atlas-provenance {
  padding: 17px;
  margin-top: 32px;
  color: #d7e9e4;
  background: var(--deep);
}

.atlas-provenance .section-code {
  color: var(--evidence);
  font-size: 8px;
}

.atlas-provenance p {
  padding-top: 8px;
  margin: 8px 0 0;
  color: #87aaa4;
  border-top: 1px solid var(--line-dark);
  font-size: 9px;
  line-height: 1.5;
}

.results-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.results-toolbar strong,
.results-toolbar span {
  display: block;
}

.results-toolbar strong {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
}

.results-toolbar span {
  margin-top: 5px;
  color: var(--teal);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.results-toolbar p {
  max-width: 320px;
  margin-bottom: 1px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
}

.disease-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 16px;
}

.disease-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: var(--sheet);
  border: 1px solid var(--line);
  transition: border 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.disease-card:hover {
  border-color: #8dafaa;
  box-shadow: 0 14px 38px rgba(8, 47, 49, 0.1);
  transform: translateY(-3px);
}

.disease-cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  background: #d8e1dc;
  border: 0;
}

.disease-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.disease-card:hover .disease-cover img {
  transform: scale(1.025);
}

.disease-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  box-shadow: inset 0 -45px 50px -45px rgba(8, 47, 49, 0.65);
}

.image-tally {
  position: absolute;
  z-index: 1;
  right: 9px;
  bottom: 8px;
  padding: 4px 7px;
  color: #fff;
  background: rgba(8, 47, 49, 0.78);
  font-family: var(--utility);
  font-size: 8px;
}

.disease-card-body {
  padding: 15px;
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.card-kicker .textbook-flag {
  color: var(--coral-dark);
}

.disease-card h3 {
  margin: 12px 0 4px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

.disease-card h3 small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.card-clue {
  display: -webkit-box;
  min-height: 42px;
  margin: 10px 0 14px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.view-disease {
  padding: 0;
  color: var(--teal);
  background: transparent;
  border: 0;
  font-size: 10px;
  font-weight: 600;
}

.compare-toggle {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
}

.compare-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--coral);
}

.atlas-empty {
  padding: 80px 20px;
  text-align: center;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.atlas-empty span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.atlas-empty h3 {
  margin: 13px 0 8px;
  font-family: var(--display);
  font-size: 25px;
  font-weight: 500;
}

.atlas-empty p {
  color: var(--muted);
  font-size: 11px;
}

.differential-lab {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(420px, 1.2fr);
  gap: 46px;
  padding: 54px clamp(38px, 5.2vw, 86px);
  color: #ecf5f2;
  background: var(--deep);
}

.lab-copy h2 {
  max-width: 420px;
  margin: 14px 0 15px;
  font-size: 32px;
  line-height: 1.25;
}

.lab-copy > p {
  max-width: 480px;
  margin-bottom: 20px;
  color: #89aaa4;
  font-size: 12px;
  line-height: 1.8;
}

.candidate-summary {
  padding-left: 13px;
  color: #b9d2cc;
  border-left: 2px solid var(--coral);
  font-size: 10px;
  line-height: 1.6;
}

.lab-form {
  padding: 22px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line-dark);
}

.lab-form > label {
  color: #93b0aa;
}

.lab-form textarea {
  width: 100%;
  min-height: 136px;
  padding: 13px 0;
  color: #fff;
  resize: vertical;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0;
  font-size: 12px;
  line-height: 1.75;
}

.lab-form textarea::placeholder {
  color: #658a84;
}

.lab-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 15px;
}

.lab-form small {
  color: #668b84;
  font-size: 9px;
}

.lab-result {
  grid-column: 1 / -1;
  padding: 25px;
  color: var(--ink);
  background: #f7fbf8;
  border-left: 4px solid var(--evidence);
  font-size: 12px;
  line-height: 1.85;
}

.lab-result h3 {
  margin-bottom: 13px;
  font-family: var(--display);
  font-size: 23px;
}

.knowledge-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  padding: 44px clamp(38px, 5.2vw, 86px) 70px;
}

.question-brief {
  align-self: start;
  padding: 25px;
  color: #eaf4f1;
  background: var(--deep);
}

.question-brief .section-code {
  color: var(--evidence);
}

.question-brief h2 {
  margin: 14px 0 22px;
  font-size: 26px;
  line-height: 1.3;
}

.question-brief ol {
  padding: 0;
  margin: 0 0 27px;
  list-style: none;
  counter-reset: question;
}

.question-brief li {
  display: grid;
  grid-template-columns: 46px 1fr;
  padding: 12px 0;
  border-top: 1px solid var(--line-dark);
  counter-increment: question;
}

.question-brief li b {
  color: var(--mint);
  font-size: 11px;
}

.question-brief li span {
  color: #89aaa4;
  font-size: 10px;
}

.question-brief .line-button {
  width: 100%;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.question-brief .line-button:hover {
  color: var(--deep);
  background: #fff;
}

.chat-workbench {
  min-width: 0;
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(8, 47, 49, 0.07);
}

.chat-toolbar {
  display: flex;
  min-height: 67px;
  align-items: center;
  justify-content: space-between;
  padding: 0 23px;
  border-bottom: 1px solid var(--line);
}

.chat-toolbar .section-code,
.chat-toolbar strong {
  display: block;
}

.chat-toolbar .section-code {
  margin-bottom: 4px;
  color: var(--teal);
  font-size: 8px;
}

.chat-toolbar strong {
  font-family: var(--display);
  font-size: 17px;
}

.chat-feed {
  min-height: 380px;
  max-height: 520px;
  padding: 24px;
  overflow-y: auto;
}

.chat-feed.compact {
  min-height: 260px;
  max-height: 420px;
}

.message {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 11px;
  max-width: 84%;
  animation: message-in 180ms ease both;
}

.message + .message {
  margin-top: 22px;
}

.user-message {
  margin-left: auto;
}

@keyframes message-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-marker {
  padding-top: 4px;
}

.message-marker span {
  display: block;
  width: 12px;
  height: 12px;
  background: var(--teal);
  border: 3px solid var(--sheet);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--teal);
}

.user-message .message-marker span {
  background: var(--coral);
  box-shadow: 0 0 0 1px var(--coral);
}

.message-body {
  padding-bottom: 17px;
  border-bottom: 1px solid var(--line);
}

.user-message .message-body {
  padding: 14px 16px;
  background: var(--teal-soft);
  border-bottom: 0;
}

.message-meta {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 7px;
}

.message-meta strong {
  font-size: 11px;
}

.message-meta span {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 8px;
}

.message-body p {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.85;
}

.message-image {
  width: min(100%, 430px);
  margin-top: 15px;
  border: 1px solid var(--line);
}

.prompt-shelf {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 13px 23px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.prompt-shelf > span {
  margin-right: 4px;
  color: var(--muted);
  font-size: 9px;
}

.prompt-shelf button {
  padding: 6px 9px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 0;
  font-size: 9px;
}

.prompt-shelf button:hover {
  color: #fff;
  background: var(--teal);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  padding: 18px 22px;
}

.composer textarea {
  width: 100%;
  max-height: 160px;
  min-height: 43px;
  padding: 11px 0 8px;
  resize: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-size: 12px;
  line-height: 1.55;
}

.send-button {
  display: flex;
  min-width: 112px;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  color: #fff;
  background: var(--teal);
  font-size: 10px;
}

.send-button:hover {
  background: var(--deep);
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
  padding: 6px 0;
}

.loading-dots i {
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  animation: dot 1s infinite ease-in-out;
}

.loading-dots i:nth-child(2) { animation-delay: 0.13s; }
.loading-dots i:nth-child(3) { animation-delay: 0.26s; }

@keyframes dot {
  0%, 70%, 100% { opacity: 0.3; transform: translateY(0); }
  35% { opacity: 1; transform: translateY(-3px); }
}

.case-selector-card label,
.case-selector-card select,
.case-selector-card button {
  display: block;
  width: 100%;
}

.case-selector-card label {
  margin-bottom: 8px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
}

.case-selector-card select {
  padding: 10px 0;
  margin-bottom: 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  font-weight: 600;
}

.case-workspace {
  padding: 44px clamp(38px, 5.2vw, 86px) 72px;
}

.case-empty {
  padding: 60px;
  margin: 45px clamp(38px, 5.2vw, 86px);
  color: var(--muted);
  text-align: center;
  background: var(--sheet);
  border: 1px dashed var(--line);
}

.dossier {
  padding: 29px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
}

.case-sequence {
  font-family: var(--utility);
  font-size: 10px;
}

.dossier h2 {
  margin: 20px 0 13px;
  font-size: 31px;
}

.dossier > p {
  max-width: 900px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.85;
}

.patient-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 25px;
  background: var(--line);
  gap: 1px;
  border: 1px solid var(--line);
}

.patient-item {
  min-width: 0;
  padding: 14px;
  background: var(--paper);
}

.patient-item.is-wide {
  grid-column: span 2;
}

.patient-item span,
.patient-item strong {
  display: block;
}

.patient-item span {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
}

.patient-item strong {
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.55;
  text-overflow: ellipsis;
}

.decision-board,
.stage-board {
  margin-top: 22px;
}

.decision-board form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.decision-column {
  min-width: 0;
  padding: 23px;
  background: var(--sheet);
}

.decision-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.decision-heading > span {
  color: var(--coral);
  font-family: var(--utility);
  font-size: 17px;
}

.decision-heading strong,
.decision-heading small {
  display: block;
}

.decision-heading strong {
  font-size: 12px;
}

.decision-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 7px;
}

.option-list {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.option-card {
  position: relative;
  display: block;
}

.option-card input {
  position: absolute;
  opacity: 0;
}

.option-card span {
  display: block;
  padding: 10px 10px 10px 30px;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid transparent;
  font-size: 10px;
  line-height: 1.45;
}

.option-card span::before {
  position: absolute;
  top: 12px;
  left: 10px;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--sheet);
  border: 1px solid #97aaa5;
}

.option-card input:checked + span {
  color: var(--deep);
  background: var(--teal-soft);
  border-color: #a9cdc2;
}

.option-card input:checked + span::before {
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: inset 0 0 0 2px var(--teal-soft);
}

.option-card input:focus-visible + span {
  outline: 3px solid rgba(232, 109, 87, 0.4);
}

.evaluate-button {
  grid-column: 1 / -1;
  margin: 18px;
  justify-self: end;
}

.decision-feedback {
  padding: 25px;
  margin-top: 17px;
  background: #fff9eb;
  border-left: 4px solid var(--evidence);
}

.decision-feedback h3 {
  margin-bottom: 10px;
  font-family: var(--display);
  font-size: 21px;
}

.decision-feedback p,
.decision-feedback .reference {
  font-size: 11px;
  line-height: 1.85;
}

.decision-feedback .reference {
  padding-top: 13px;
  margin-top: 13px;
  color: var(--muted);
  border-top: 1px solid #e6d6aa;
}

.stage-board {
  display: grid;
  grid-template-columns: minmax(280px, 0.65fr) minmax(420px, 1.35fr);
  gap: 18px;
}

.stage-brief,
.stage-dialogue {
  padding: 24px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.stage-brief .section-code {
  color: var(--teal);
}

.stage-brief h2 {
  margin: 13px 0 18px;
  font-size: 25px;
}

.stage-task,
.stage-data {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.stage-data {
  padding: 14px;
  margin-top: 16px;
  background: var(--teal-soft);
}

.stage-dialogue .composer {
  padding-right: 0;
  padding-left: 0;
  border-top: 1px solid var(--line);
}

.stage-dialogue > .line-button {
  margin-left: auto;
}

.admin-unlock {
  display: grid;
  min-height: 380px;
  place-items: center;
  padding: 50px;
}

.admin-unlock form {
  width: min(100%, 430px);
  padding: 32px;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-top: 4px solid var(--teal);
  box-shadow: var(--shadow);
}

.admin-unlock .section-code {
  color: var(--teal);
}

.admin-unlock h2 {
  margin: 14px 0 8px;
  font-size: 28px;
}

.admin-unlock p {
  color: var(--muted);
  font-size: 11px;
}

.admin-unlock label {
  display: block;
  margin: 25px 0 7px;
}

.admin-unlock input {
  width: 100%;
  height: 43px;
  padding: 0 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
}

.admin-unlock .solid-button {
  width: 100%;
  margin-top: 15px;
}

.admin-dashboard {
  padding: 44px clamp(38px, 5.2vw, 86px) 72px;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 20px;
  background: var(--deep);
}

.admin-summary div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  color: #9ebdb7;
  font-size: 10px;
}

.admin-summary div + div {
  border-left: 1px solid var(--line-dark);
}

.admin-summary strong {
  color: #fff;
  font-family: var(--display);
  font-size: 25px;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.admin-panel {
  padding: 24px;
  background: var(--sheet);
  border: 1px solid var(--line);
}

.panel-head .section-code {
  color: var(--teal);
}

.admin-panel h2 {
  margin: 10px 0 20px;
  font-size: 24px;
}

.content-list {
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.content-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.content-row > div {
  min-width: 0;
}

.content-row strong,
.content-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-row strong {
  font-size: 10px;
}

.content-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
}

.delete-button {
  padding: 5px 7px;
  color: var(--danger);
  background: transparent;
  border: 1px solid #e2b8b2;
  font-size: 8px;
}

.empty-row {
  padding: 28px;
  color: var(--muted);
  text-align: center;
  font-size: 10px;
}

.compare-dock {
  position: fixed;
  z-index: 35;
  right: 28px;
  bottom: 24px;
  display: grid;
  width: min(560px, calc(100vw - 300px));
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 17px;
  align-items: center;
  padding: 13px 13px 13px 17px;
  color: #fff;
  background: var(--deep);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

.compare-dock > div {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.compare-dock > div > span {
  color: var(--evidence);
  font-family: var(--utility);
  font-size: 10px;
}

.compare-dock p {
  margin: 0;
  overflow: hidden;
  color: #b4cbc6;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-dock .text-button {
  color: #a8c5bf;
}

.compare-dock .solid-button {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 10px;
}

dialog {
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

dialog::backdrop {
  background: rgba(4, 25, 26, 0.72);
  backdrop-filter: blur(5px);
}

.drawer-dialog {
  width: min(760px, 100vw);
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
}

.dialog-shell {
  position: relative;
  min-height: 100%;
  padding: 42px;
  overflow-y: auto;
  background: var(--sheet);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.2);
}

.dialog-close {
  position: absolute;
  z-index: 4;
  top: 18px;
  right: 18px;
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: var(--utility);
  font-size: 19px;
}

.disease-detail-head {
  padding-right: 34px;
}

.detail-kicker {
  color: var(--teal);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.disease-detail-head h2 {
  margin: 13px 0 8px;
  font-family: var(--display);
  font-size: 43px;
  font-weight: 600;
}

.disease-detail-head h2 small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 400;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin: 22px 0 28px;
  flex-wrap: wrap;
}

.detail-actions .line-button,
.detail-actions .solid-button {
  min-height: 40px;
  font-size: 10px;
}

.detail-facts {
  margin-bottom: 30px;
  border-top: 1px solid var(--line);
}

.detail-fact {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.detail-fact b {
  color: var(--teal);
  font-size: 11px;
}

.detail-fact p {
  margin-bottom: 0;
  color: #455b57;
  font-size: 11px;
  line-height: 1.8;
}

.detail-gallery-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-gallery-title h3 {
  margin-bottom: 0;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 500;
}

.detail-gallery-title span {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 9px;
}

.detail-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-figure {
  min-width: 0;
  margin: 0;
  background: var(--paper);
  border: 1px solid var(--line);
}

.detail-image-button {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  background: #d8e1dc;
  border: 0;
}

.detail-image-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-figure figcaption {
  padding: 12px;
}

.figure-source {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  color: var(--teal);
  font-family: var(--utility);
  font-size: 7px;
}

.figure-source span:last-child {
  color: var(--coral-dark);
}

.detail-figure p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.65;
}

.figure-links {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.figure-links a {
  color: var(--teal);
  font-size: 8px;
}

.detail-notice {
  padding: 15px;
  margin-top: 24px;
  color: #735a25;
  background: #fff6df;
  border-left: 3px solid var(--evidence);
  font-size: 9px;
  line-height: 1.7;
}

.compare-dialog {
  width: min(1180px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100vh - 40px);
}

.compare-shell {
  position: relative;
  padding: 30px;
  overflow: auto;
  background: var(--sheet);
  box-shadow: var(--shadow);
}

.compare-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--deep);
}

.compare-head .section-code {
  color: var(--teal);
}

.compare-head h2 {
  margin: 8px 0 0;
  font-size: 30px;
}

.compare-head .dialog-close {
  position: static;
}

.compare-table-wrap {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  min-width: 760px;
  border-spacing: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

.compare-table th,
.compare-table td {
  padding: 16px;
  vertical-align: top;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.compare-table th:first-child,
.compare-table td:first-child {
  width: 116px;
  color: var(--teal);
  background: var(--paper);
  font-size: 10px;
}

.compare-table th:last-child,
.compare-table td:last-child {
  border-right: 0;
}

.compare-disease-head {
  text-align: left;
}

.compare-disease-head img {
  width: 100%;
  height: 150px;
  margin-bottom: 12px;
  object-fit: cover;
}

.compare-disease-head strong {
  display: block;
  font-family: var(--display);
  font-size: 23px;
}

.compare-disease-head small {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 8px;
}

.compare-table td {
  color: #475b57;
  font-size: 10px;
  line-height: 1.75;
}

.image-dialog {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  color: #fff;
  background: #061f20;
}

.image-dialog .dialog-close {
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(255, 255, 255, 0.25);
}

.image-dialog figure {
  display: grid;
  min-height: 70vh;
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
}

.image-dialog img {
  width: 100%;
  max-height: calc(100vh - 150px);
  align-self: center;
  object-fit: contain;
}

.image-dialog figcaption {
  padding: 17px 22px;
  color: #b8cdca;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 10px;
  line-height: 1.65;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 17px;
  color: #fff;
  background: var(--deep);
  border-left: 4px solid var(--success);
  box-shadow: var(--shadow);
  font-size: 11px;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-left-color: var(--coral);
}

.sidebar-scrim {
  display: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 1280px) {
  .home-hero {
    grid-template-columns: minmax(340px, 0.9fr) minmax(430px, 1.1fr);
    gap: 36px;
  }

  .evidence-board {
    height: 480px;
  }

  .disease-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-intro {
    grid-template-columns: 76px minmax(360px, 1fr) minmax(230px, 300px);
  }
}

@media (max-width: 1040px) {
  .sidebar {
    width: 224px;
  }

  .main-stage {
    margin-left: 224px;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .evidence-board {
    height: 550px;
  }

  .morphology-ribbon,
  .knowledge-layout,
  .differential-lab {
    grid-template-columns: 1fr;
  }

  .ribbon-options {
    grid-template-columns: repeat(3, 1fr);
  }

  .source-ledger {
    grid-template-columns: 1fr 1fr;
  }

  .source-ledger .line-button {
    justify-self: start;
  }

  .module-intro {
    grid-template-columns: 68px 1fr;
  }

  .module-note,
  .case-selector-card {
    grid-column: 2;
    align-self: auto;
  }

  .atlas-workbench {
    grid-template-columns: 215px minmax(0, 1fr);
    gap: 26px;
  }

  .question-brief {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 20px;
    align-items: center;
  }

  .question-brief h2,
  .question-brief ol,
  .question-brief .line-button {
    margin: 0;
  }

  .stage-board {
    grid-template-columns: 1fr;
  }

  .compare-dock {
    width: min(560px, calc(100vw - 260px));
  }
}

@media (max-width: 820px) {
  .sidebar {
    width: 252px;
    box-shadow: 20px 0 60px rgba(4, 25, 26, 0.25);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .main-stage {
    margin-left: 0;
  }

  .menu-button {
    display: block;
  }

  .topbar {
    padding: 0 20px;
  }

  .top-search {
    display: none;
  }

  .sidebar-scrim {
    position: fixed;
    z-index: 39;
    inset: 0;
    display: block;
    background: rgba(4, 25, 26, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
  }

  .sidebar-scrim.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .home-hero,
  .module-intro,
  .atlas-workbench,
  .knowledge-layout,
  .case-workspace,
  .admin-dashboard {
    padding-right: 24px;
    padding-left: 24px;
  }

  .learning-route,
  .morphology-ribbon,
  .source-ledger,
  .differential-lab {
    padding-right: 24px;
    padding-left: 24px;
  }

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

  .route-card {
    min-height: 245px;
  }

  .atlas-workbench {
    grid-template-columns: 1fr;
  }

  .atlas-controls {
    position: static;
  }

  .category-filters,
  .morph-filters {
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }

  .category-filters button,
  .morph-filters button {
    background: var(--sheet);
    border: 0;
  }

  .atlas-provenance {
    display: none;
  }

  .question-brief {
    display: block;
  }

  .question-brief h2 {
    margin: 14px 0 22px;
  }

  .question-brief ol {
    margin-bottom: 22px;
  }

  .patient-grid,
  .decision-board form,
  .admin-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .evaluate-button {
    grid-column: 1 / -1;
  }

  .compare-dock {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 600px) {
  .topbar {
    height: 64px;
  }

  .topbar-kicker {
    display: none !important;
  }

  .live-stamp {
    font-size: 8px;
  }

  .workspace-view {
    min-height: calc(100vh - 64px);
  }

  .home-hero {
    min-height: auto;
    padding-top: 40px;
    padding-bottom: 42px;
  }

  .hero-copy h1,
  .module-intro h1 {
    font-size: 42px;
  }

  .hero-lede {
    font-size: 13px;
  }

  .hero-actions {
    display: grid;
  }

  .hero-actions button {
    width: 100%;
  }

  .hero-meta > span {
    min-width: 0;
    flex: 1;
    padding-right: 12px;
  }

  .hero-meta > span + span {
    padding-left: 12px;
  }

  .hero-meta strong {
    font-size: 24px;
  }

  .evidence-board {
    height: 450px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 34px 1fr 1fr;
  }

  .evidence-a {
    grid-row: 2;
  }

  .evidence-image small {
    display: none;
  }

  .morphology-ribbon {
    gap: 28px;
  }

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

  .section-heading,
  .results-toolbar {
    display: block;
  }

  .section-heading > p,
  .results-toolbar > p {
    margin-top: 12px;
  }

  .source-ledger {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .module-intro {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .module-number {
    padding-top: 0;
    font-size: 34px;
  }

  .module-number::after {
    display: none;
  }

  .module-note,
  .case-selector-card {
    grid-column: 1;
  }

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

  .differential-lab {
    gap: 28px;
  }

  .lab-form > div {
    display: grid;
  }

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

  .send-button {
    width: 100%;
  }

  .message {
    max-width: 96%;
  }

  .patient-grid,
  .decision-board form,
  .admin-grid,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .patient-item.is-wide {
    grid-column: span 1;
  }

  .admin-summary div + div {
    border-top: 1px solid var(--line-dark);
    border-left: 0;
  }

  .compare-dock {
    grid-template-columns: 1fr auto;
  }

  .compare-dock .text-button {
    display: none;
  }

  .dialog-shell {
    padding: 54px 20px 30px;
  }

  .disease-detail-head h2 {
    font-size: 34px;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }

  .compare-dialog {
    width: 100vw;
    max-height: 100vh;
  }

  .compare-shell {
    padding: 20px;
  }
}

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

/* --------------------------------------------------------------------------
   2026 dashboard skin
   Pure visual layer: the document structure and application behavior stay intact.
   -------------------------------------------------------------------------- */

:root {
  --deep: #171717;
  --deep-2: #262626;
  --teal: #f2550a;
  --teal-soft: #f1efeb;
  --mint: #d9ead8;
  --coral: #f2550a;
  --coral-dark: #d94600;
  --evidence: #f2550a;
  --paper: #f3f3f1;
  --sheet: #ffffff;
  --ink: #171717;
  --muted: #7e7e7a;
  --line: #e2e1dd;
  --line-dark: rgba(23, 23, 23, 0.12);
  --danger: #b83c2f;
  --success: #71a879;
  --display: "Avenir Next", Avenir, "PingFang SC", "Helvetica Neue", sans-serif;
  --body: "Avenir Next", Avenir, "PingFang SC", "Helvetica Neue", sans-serif;
  --utility: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 18px 50px rgba(24, 24, 24, 0.08);
  --canvas-gap: clamp(18px, 3.2vw, 64px);
  --radius-shell: 28px;
  --radius-card: 16px;
}

html {
  background: #d2d2d0;
}

body {
  padding: var(--canvas-gap);
  background: #d2d2d0;
  font-weight: 450;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline-color: rgba(242, 85, 10, 0.42);
}

.app-shell {
  display: grid;
  max-width: 1580px;
  min-height: calc(100vh - clamp(36px, 6.4vw, 128px));
  grid-template-columns: 232px minmax(0, 1fr);
  align-items: start;
  margin: 0 auto;
  overflow: clip;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius-shell);
  box-shadow: 0 28px 80px rgba(25, 25, 25, 0.12);
}

.sidebar {
  position: sticky;
  z-index: 40;
  inset: auto;
  top: var(--canvas-gap);
  display: flex;
  width: 100%;
  height: calc(100vh - clamp(36px, 6.4vw, 128px));
  min-height: 650px;
  padding: 32px 20px 22px;
  color: var(--ink);
  background: #fff;
  border-right: 1px solid #ecebe8;
}

.sidebar::after {
  display: none;
}

.brand {
  gap: 11px;
  color: var(--ink);
}

.brand-mark {
  width: 38px;
  height: 34px;
  overflow: hidden;
  border: 0;
}

.brand-mark::before,
.brand-mark::after {
  top: 50%;
  left: 50%;
  height: 11px;
  border-radius: 2px;
}

.brand-mark::before {
  width: 31px;
  background: var(--coral);
  transform: translate(-62%, -50%) skewX(-24deg) rotate(-52deg);
}

.brand-mark::after {
  width: 28px;
  background: var(--ink);
  transform: translate(-31%, -50%) skewX(24deg) rotate(52deg);
}

.brand-mark i,
.brand-mark b {
  display: none;
}

.brand-copy strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.brand-copy small {
  color: #989894;
  font-size: 7px;
  letter-spacing: 0.09em;
}

.primary-nav {
  margin-top: 58px;
}

.nav-label {
  padding: 0 10px 12px;
  color: #a3a39f;
  font-family: var(--body);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.nav-item {
  grid-template-columns: 32px 1fr;
  gap: 9px;
  padding: 10px;
  margin-bottom: 5px;
  color: #777773;
  border: 0;
  border-radius: 10px;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink);
  background: #ececea;
}

.nav-item.is-active {
  padding-left: 10px;
}

.nav-item.is-active::before {
  inset: 50% 10px auto auto;
  width: 6px;
  height: 6px;
  background: var(--coral);
  border-radius: 50%;
  transform: translateY(-50%);
}

.nav-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: #8b8b87;
  background: #f3f3f1;
  border-radius: 8px;
  font-size: 9px;
}

.nav-item.is-active .nav-index {
  color: #fff;
  background: var(--ink);
}

.nav-item strong {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.nav-item small,
.nav-item.is-active small {
  margin-top: 2px;
  color: #9a9a96;
  font-size: 9px;
}

.system-card {
  padding: 14px;
  background: #f4f4f2;
  border: 0;
  border-radius: 12px;
}

.system-status small,
.system-counts,
.sidebar-note {
  color: #93938f;
}

.system-counts {
  border-color: #dededb;
}

.system-counts strong {
  color: var(--ink);
}

.sidebar-note {
  padding: 0 3px;
}

.main-stage {
  min-width: 0;
  min-height: inherit;
  margin-left: 0;
  background: var(--paper);
}

.topbar {
  top: var(--canvas-gap);
  height: 76px;
  padding: 0 38px;
  background: rgba(243, 243, 241, 0.93);
  border-bottom-color: transparent;
  backdrop-filter: blur(18px);
}

.topbar-kicker,
.eyebrow,
.section-heading .section-code,
.source-ledger .section-code,
.chat-toolbar .section-code,
.panel-head .section-code,
.admin-unlock .section-code {
  color: var(--coral);
}

.topbar-context strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.top-search {
  color: var(--ink);
  border-color: #d5d5d1;
}

.top-search span {
  color: var(--ink);
}

.live-stamp {
  padding: 8px 11px;
  background: #fff;
  border-radius: 9px;
}

.workspace-view {
  max-width: none;
}

.solid-button,
.line-button,
.send-button,
.menu-button,
.prompt-shelf button,
.delete-button {
  border-radius: 9px;
}

.solid-button {
  min-height: 42px;
  gap: 28px;
  padding: 10px 15px;
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.line-button {
  min-height: 42px;
  color: var(--ink);
  background: #fff;
  border-color: #d0d0cc;
}

.line-button:hover {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.text-button,
.view-disease,
.reset-filter {
  color: var(--coral);
}

.home-hero {
  min-height: 620px;
  grid-template-columns: minmax(300px, 0.76fr) minmax(470px, 1.24fr);
  gap: clamp(28px, 4vw, 64px);
  padding: 48px clamp(34px, 4.3vw, 68px) 44px;
  background: var(--paper);
  border-bottom: 0;
}

.hero-copy h1,
.module-intro h1 {
  font-size: clamp(44px, 4.3vw, 65px);
  font-weight: 650;
  line-height: 1.09;
  letter-spacing: -0.055em;
}

.hero-copy h1 {
  margin: 18px 0 20px;
}

.hero-lede {
  margin-bottom: 26px;
  font-size: 13px;
  line-height: 1.85;
}

.hero-meta {
  padding: 0 13px;
  margin-top: 34px;
  background: #fff;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(25, 25, 25, 0.04);
}

.hero-meta > span {
  min-width: 0;
  flex: 1;
  padding: 15px 10px;
}

.hero-meta > span + span {
  padding-left: 15px;
  border-color: #ecece8;
}

.hero-meta strong {
  font-size: 25px;
  font-weight: 600;
}

.evidence-board {
  height: 500px;
  grid-template-columns: 1.15fr 0.85fr 0.85fr;
  grid-template-rows: 36px 1.08fr 0.92fr;
  gap: 9px;
  padding: 15px;
  background: #fff;
  border-radius: 19px;
  box-shadow: var(--shadow);
}

.evidence-board::before {
  top: 25px;
  right: 17px;
  width: 56px;
  height: 3px;
  background: var(--coral);
  border: 0;
  border-radius: 2px;
}

.board-label {
  padding: 0 3px;
  color: #7c7c78;
}

.board-label b {
  padding-right: 65px;
  color: var(--ink);
}

.evidence-image {
  background: #e6e6e3;
  border-radius: 10px;
}

.evidence-image img {
  filter: saturate(0.88) contrast(1.01);
}

.evidence-image > span {
  padding: 32px 13px 12px;
  background: linear-gradient(transparent, rgba(20, 20, 20, 0.78));
}

.evidence-image b {
  font-size: 14px;
  font-weight: 600;
}

.evidence-a {
  grid-column: 1;
  grid-row: 2 / 4;
}

.evidence-b {
  grid-column: 2 / 4;
  grid-row: 2;
}

.evidence-c {
  grid-column: 2;
  grid-row: 3;
}

.evidence-d {
  grid-column: 3;
  grid-row: 3;
}

.morphology-ribbon {
  grid-template-columns: 250px 1fr;
  gap: 28px;
  padding: 27px;
  margin: 0 38px 30px;
  color: var(--ink);
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.04);
}

.ribbon-heading .section-code,
.differential-lab .section-code {
  color: var(--coral);
}

.ribbon-heading h2 {
  margin: 10px 0 8px;
  font-size: 23px;
  font-weight: 650;
}

.ribbon-heading p {
  color: var(--muted);
}

.ribbon-options {
  gap: 8px;
  border: 0;
}

.ribbon-options button {
  min-height: 72px;
  padding: 12px;
  color: var(--ink);
  background: #f4f4f2;
  border: 0;
  border-radius: 10px;
}

.ribbon-options button:hover {
  color: var(--ink);
  background: #fff0e8;
}

.ribbon-options i {
  border-color: #f4f4f2;
}

.ribbon-options small {
  color: #9a9a96;
}

.learning-route {
  padding: 34px 38px 44px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2,
.source-ledger h2 {
  font-size: 27px;
  font-weight: 650;
}

.route-grid {
  gap: 14px;
  background: transparent;
  border: 0;
}

.route-card {
  min-height: 250px;
  padding: 23px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.045);
}

.route-number {
  color: var(--coral);
}

.route-accent {
  width: 27px;
  height: 27px;
  background: #f1f1ef;
  border: 0;
  border-radius: 50%;
  transform: none;
}

.route-card:hover .route-accent {
  background: var(--coral);
}

.route-card h3 {
  margin-top: 40px;
  font-size: 22px;
  font-weight: 650;
}

.route-card > b {
  color: var(--ink);
}

.source-ledger {
  grid-template-columns: minmax(220px, 0.8fr) minmax(360px, 1.3fr) auto;
  gap: 32px;
  padding: 28px;
  margin: 0 38px 38px;
  background: #fff;
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.04);
}

.source-ledger p {
  color: var(--muted);
}

.module-intro {
  min-height: 285px;
  grid-template-columns: 54px minmax(360px, 1fr) minmax(240px, 310px);
  gap: clamp(22px, 3vw, 42px);
  padding: 40px clamp(34px, 4.3vw, 68px);
  background: var(--paper);
  border-bottom: 0;
}

.module-number {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  align-self: center;
  padding: 0;
  color: #fff;
  background: var(--ink);
  border-radius: 12px;
  font-size: 13px;
  opacity: 1;
}

.module-number::after {
  display: none;
}

.module-intro h1 {
  margin: 16px 0 0;
  font-size: clamp(39px, 3.7vw, 54px);
}

.module-note,
.case-selector-card {
  padding: 20px;
  background: #fff;
  border: 0;
  border-left: 4px solid var(--coral);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(25, 25, 25, 0.04);
}

.atlas-workbench,
.knowledge-layout,
.case-workspace,
.admin-dashboard {
  padding: 26px 38px 52px;
}

.atlas-workbench {
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 26px;
}

.atlas-controls {
  top: calc(var(--canvas-gap) + 94px);
  padding: 20px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.045);
}

.atlas-search input,
.admin-unlock input {
  background: #f4f4f2;
  border: 0;
  border-radius: 9px;
}

.category-filters button,
.morph-filters button {
  padding: 9px 10px;
  border-bottom-color: #eeeeeb;
  border-radius: 7px;
}

.category-filters button:hover,
.category-filters button.is-active,
.morph-filters button:hover,
.morph-filters button.is-active {
  color: var(--ink);
  background: #f1f1ef;
}

.category-filters b,
.morph-filters b {
  color: var(--coral);
}

.reset-filter {
  border-color: #dededb;
}

.atlas-provenance {
  padding: 17px;
  color: var(--ink);
  background: var(--coral);
  border-radius: 12px;
}

.atlas-provenance .section-code {
  color: var(--ink);
}

.atlas-provenance p {
  color: rgba(23, 23, 23, 0.72);
  border-color: rgba(23, 23, 23, 0.15);
}

.results-toolbar {
  padding: 17px 19px;
  margin-bottom: 16px;
  background: #fff;
  border: 0;
  border-radius: 13px;
}

.results-toolbar strong {
  font-size: 21px;
  font-weight: 650;
}

.results-toolbar span {
  color: var(--coral);
}

.disease-grid {
  gap: 16px;
}

.disease-card {
  border: 0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(25, 25, 25, 0.055);
}

.disease-card:hover {
  border-color: transparent;
  box-shadow: 0 16px 36px rgba(25, 25, 25, 0.11);
}

.image-tally {
  background: rgba(23, 23, 23, 0.78);
  border-radius: 7px;
}

.card-kicker,
.view-disease {
  color: var(--coral);
}

.disease-card h3 {
  font-size: 20px;
  font-weight: 650;
}

.differential-lab {
  grid-template-columns: minmax(270px, 0.8fr) minmax(390px, 1.2fr);
  gap: 34px;
  padding: 32px;
  margin: 0 38px 38px;
  color: var(--ink);
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.045);
}

.lab-copy h2 {
  font-size: 27px;
  font-weight: 650;
}

.lab-copy > p,
.candidate-summary,
.lab-form small {
  color: var(--muted);
}

.lab-form {
  background: #f3f3f1;
  border: 0;
  border-radius: 13px;
}

.lab-form > label {
  color: var(--muted);
}

.lab-form textarea {
  color: var(--ink);
  background: #fff;
  border: 0;
  border-radius: 9px;
  padding: 13px;
  margin-top: 8px;
}

.lab-form textarea::placeholder {
  color: #aaa9a5;
}

.lab-result,
.decision-feedback {
  border-left-color: var(--coral);
}

.knowledge-layout {
  grid-template-columns: 265px minmax(0, 1fr);
  gap: 24px;
}

.question-brief {
  padding: 24px;
  color: var(--ink);
  background: var(--coral);
  border-radius: var(--radius-card);
}

.question-brief .section-code,
.question-brief li b,
.question-brief li span {
  color: var(--ink);
}

.question-brief li {
  border-color: rgba(23, 23, 23, 0.15);
}

.question-brief .line-button {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.question-brief .line-button:hover {
  color: var(--ink);
  background: #fff;
}

.chat-workbench,
.dossier,
.stage-brief,
.stage-dialogue,
.admin-panel,
.admin-unlock form {
  border: 0;
  border-radius: var(--radius-card);
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.05);
}

.user-message .message-body,
.stage-data,
.option-card input:checked + span {
  background: #fff0e8;
}

.message-marker span,
.send-button {
  background: var(--coral);
}

.message-marker span {
  box-shadow: 0 0 0 1px var(--coral);
}

.prompt-shelf button {
  color: var(--ink);
  background: #f0f0ee;
}

.prompt-shelf button:hover {
  color: #fff;
  background: var(--ink);
}

.case-selector-card select {
  border-color: #dededb;
}

.case-empty {
  border-radius: var(--radius-card);
}

.dossier-head,
.stage-brief .section-code {
  color: var(--coral);
}

.patient-grid,
.decision-board form {
  gap: 10px;
  background: transparent;
  border: 0;
}

.patient-item,
.decision-column {
  background: #fff;
  border-radius: 12px;
}

.decision-column {
  box-shadow: 0 8px 24px rgba(25, 25, 25, 0.045);
}

.option-card span {
  background: #f4f4f2;
  border-radius: 8px;
}

.option-card input:checked + span {
  color: var(--ink);
  border-color: #f5b08f;
}

.option-card input:checked + span::before {
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: inset 0 0 0 2px #fff0e8;
}

.admin-unlock form {
  border-top: 4px solid var(--coral);
}

.admin-summary {
  gap: 12px;
  background: transparent;
}

.admin-summary div {
  color: var(--muted);
  background: #fff;
  border-radius: 12px;
}

.admin-summary div + div {
  border-left: 0;
}

.admin-summary strong {
  color: var(--ink);
}

.compare-dock {
  right: calc(var(--canvas-gap) + 18px);
  bottom: calc(var(--canvas-gap) + 18px);
  color: #fff;
  background: var(--ink);
  border: 0;
  border-radius: 14px;
}

.compare-dock > div > span {
  color: var(--coral);
}

.compare-dock p,
.compare-dock .text-button {
  color: #bcbcb8;
}

dialog::backdrop {
  background: rgba(26, 26, 26, 0.62);
}

.dialog-shell {
  background: #fff;
  border-radius: 22px 0 0 22px;
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.16);
}

.dialog-close {
  border-radius: 50%;
}

.toast {
  border-left-color: var(--success);
  border-radius: 12px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .sidebar {
    padding-right: 15px;
    padding-left: 15px;
  }

  .home-hero {
    grid-template-columns: 1fr;
  }

  .evidence-board {
    height: 520px;
  }

  .module-intro {
    grid-template-columns: 52px 1fr;
  }

  .module-note,
  .case-selector-card {
    grid-column: 2;
  }

  .source-ledger {
    grid-template-columns: 1fr 1fr;
  }

  .source-ledger .line-button {
    justify-self: start;
  }

  .disease-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  :root {
    --canvas-gap: 18px;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 36px);
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    width: 260px;
    height: 100vh;
    min-height: 0;
    border-radius: 0 18px 18px 0;
    box-shadow: 20px 0 60px rgba(25, 25, 25, 0.18);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .menu-button {
    display: block;
  }

  .topbar {
    top: var(--canvas-gap);
  }

  .morphology-ribbon,
  .knowledge-layout,
  .differential-lab {
    grid-template-columns: 1fr;
  }

  .question-brief {
    display: grid;
    grid-template-columns: 1fr 1.4fr auto;
    gap: 18px;
    align-items: center;
  }

  .question-brief h2,
  .question-brief ol,
  .question-brief .line-button {
    margin: 0;
  }

  .atlas-workbench {
    grid-template-columns: 215px minmax(0, 1fr);
  }

  .compare-dock {
    right: 30px;
    bottom: 30px;
    width: min(560px, calc(100vw - 60px));
  }
}

/* Knowledge answers: hierarchy appears only when the response actually needs it. */
#view-knowledge .assistant-message .message-copy h3 {
  margin: 22px 0 8px;
  color: var(--consult-ink);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.45;
  letter-spacing: -0.01em;
}

#view-knowledge .assistant-message .message-copy h3:first-child {
  margin-top: 0;
}

#view-knowledge .assistant-message .message-copy p + h3,
#view-knowledge .assistant-message .message-copy ol + h3,
#view-knowledge .assistant-message .message-copy ul + h3 {
  padding-top: 3px;
}

#view-knowledge .assistant-message .message-copy ol,
#view-knowledge .assistant-message .message-copy ul {
  margin: 8px 0 15px;
  padding-left: 1.55em;
}

#view-knowledge .assistant-message .message-copy li {
  padding-left: 0.22em;
  line-height: 1.85;
}

#view-knowledge .assistant-message .message-copy li + li {
  margin-top: 5px;
}

#view-knowledge .assistant-message .message-copy li::marker {
  color: var(--consult-orange);
  font-weight: 750;
}

#view-knowledge .assistant-message .message-copy h3 + p,
#view-knowledge .assistant-message .message-copy h3 + ol,
#view-knowledge .assistant-message .message-copy h3 + ul {
  margin-top: 0;
}

#view-knowledge .assistant-message .message-copy .answer-labeled-paragraph {
  margin-top: 17px;
}

#view-knowledge .assistant-message .message-copy .answer-labeled-paragraph:first-child {
  margin-top: 0;
}

#view-knowledge .assistant-message .message-copy .answer-section-label {
  margin-top: 19px;
  margin-bottom: 7px;
  font-size: 13px;
}

#view-knowledge .assistant-message .message-copy .answer-section-label + ul {
  margin-top: 5px;
}

@media (max-width: 760px) {
  #view-knowledge .assistant-message .message-copy h3 {
    margin-top: 18px;
    font-size: 13px;
  }

  #view-knowledge .assistant-message .message-copy .answer-labeled-paragraph,
  #view-knowledge .assistant-message .message-copy .answer-section-label {
    margin-top: 15px;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0;
  }

  .app-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .topbar {
    top: 0;
    height: 66px;
    padding: 0 19px;
  }

  .top-search {
    display: none;
  }

  .home-hero,
  .module-intro,
  .atlas-workbench,
  .knowledge-layout,
  .case-workspace,
  .admin-dashboard,
  .learning-route {
    padding-right: 20px;
    padding-left: 20px;
  }

  .home-hero {
    min-height: auto;
    padding-top: 34px;
    padding-bottom: 28px;
  }

  .hero-copy h1,
  .module-intro h1 {
    font-size: 42px;
  }

  .evidence-board {
    height: 460px;
  }

  .morphology-ribbon,
  .source-ledger,
  .differential-lab {
    margin-right: 20px;
    margin-left: 20px;
  }

  .morphology-ribbon {
    gap: 22px;
  }

  .route-grid,
  .source-ledger,
  .atlas-workbench,
  .question-brief,
  .patient-grid,
  .decision-board form,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .question-brief {
    display: block;
  }

  .question-brief h2 {
    margin: 14px 0 22px;
  }

  .question-brief ol {
    margin-bottom: 22px;
  }

  .atlas-controls {
    position: static;
  }

  .category-filters,
  .morph-filters {
    grid-template-columns: repeat(2, 1fr);
  }

  .atlas-provenance {
    display: none;
  }

  .module-intro {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .module-number,
  .module-note,
  .case-selector-card {
    grid-column: 1;
  }

  .module-number {
    align-self: start;
  }

  .patient-item.is-wide {
    grid-column: span 1;
  }

  .evaluate-button {
    grid-column: 1;
  }

  .compare-dock {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 540px) {
  .topbar-kicker,
  .live-stamp {
    display: none;
  }

  .hero-copy h1,
  .module-intro h1 {
    font-size: 36px;
  }

  .hero-actions,
  .composer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .hero-actions button,
  .send-button {
    width: 100%;
  }

  .hero-meta {
    padding: 0 4px;
  }

  .hero-meta > span,
  .hero-meta > span + span {
    padding-right: 7px;
    padding-left: 7px;
  }

  .evidence-board {
    height: 430px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 34px 1fr 1fr;
    padding: 10px;
  }

  .evidence-a {
    grid-column: 1;
    grid-row: 2;
  }

  .evidence-b {
    grid-column: 2;
    grid-row: 2;
  }

  .evidence-c {
    grid-column: 1;
    grid-row: 3;
  }

  .evidence-d {
    grid-column: 2;
    grid-row: 3;
  }

  .evidence-image small {
    display: none;
  }

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

  .section-heading,
  .results-toolbar {
    display: block;
  }

  .section-heading > p,
  .results-toolbar > p {
    margin-top: 12px;
  }

  .source-ledger {
    gap: 20px;
  }

  .disease-grid,
  .admin-summary {
    grid-template-columns: 1fr;
  }

  .compare-dock {
    grid-template-columns: 1fr auto;
  }

  .compare-dock .text-button {
    display: none;
  }

  .dialog-shell {
    padding: 54px 20px 30px;
    border-radius: 0;
  }
}

/* Sidebar simplification and non-obscuring page header. */
.nav-item {
  min-height: 50px;
  align-items: center;
}

.nav-item > span:last-child {
  display: flex;
  align-items: center;
}

.nav-item strong {
  line-height: 1.25;
}

.topbar {
  position: relative;
  top: auto;
}

.atlas-controls {
  top: var(--canvas-gap);
}

/* Full-bleed workspace and contextual atlas controls. */
html,
body {
  width: 100%;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  padding: 0;
}

.app-shell {
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  grid-template-columns: 292px minmax(0, 1fr);
  align-items: stretch;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.sidebar {
  position: sticky;
  inset: auto;
  top: 0;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  padding: 28px 18px 0;
  overflow: hidden;
  border-radius: 0;
}

.brand,
.primary-nav {
  flex: 0 0 auto;
}

.primary-nav {
  margin-top: 46px;
}

.sidebar.has-atlas-tools .primary-nav {
  margin-top: 34px;
}

.sidebar-atlas-tools {
  display: none;
  min-height: 0;
  flex: 1 1 auto;
  padding: 18px 18px 28px;
  margin: 18px -18px 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fafaf8;
  border-top: 1px solid #ecebe8;
  scrollbar-color: #cecec9 transparent;
  scrollbar-width: thin;
}

.sidebar.has-atlas-tools .sidebar-atlas-tools {
  display: flex;
  flex-direction: column;
}

.sidebar-tools-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 15px;
  border-bottom: 1px solid #e7e7e3;
}

.sidebar-tools-heading .section-code {
  color: var(--coral);
  font-size: 7px;
}

.sidebar-tools-heading strong {
  font-size: 13px;
  font-weight: 650;
}

.sidebar .atlas-controls {
  position: static;
  top: auto;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.sidebar .atlas-search > span,
.sidebar .filter-group legend {
  color: #8f8f8b;
  font-size: 8px;
}

.sidebar .atlas-search > div {
  margin-top: 7px;
}

.sidebar .atlas-search input {
  height: 42px;
  padding-left: 34px;
  background: #efefed;
  border: 0;
  border-radius: 9px;
  font-size: 11px;
}

.sidebar .atlas-search i {
  left: 11px;
  font-size: 17px;
}

.sidebar .filter-group {
  margin-top: 20px;
}

.sidebar .category-filters,
.sidebar .morph-filters {
  grid-template-columns: 1fr;
  gap: 2px;
  margin-top: 7px;
}

.sidebar .category-filters button,
.sidebar .morph-filters button {
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: 0;
  border-radius: 7px;
  font-size: 10px;
  line-height: 1.35;
}

.sidebar .category-filters button:hover,
.sidebar .category-filters button.is-active,
.sidebar .morph-filters button:hover,
.sidebar .morph-filters button.is-active {
  background: #e9e9e6;
}

.sidebar .reset-filter {
  padding: 11px 2px;
  margin-top: 17px;
  border-color: #d6d6d1;
  font-size: 10px;
}

.sidebar .atlas-provenance {
  display: block;
  padding: 14px;
  margin-top: 20px;
  border-radius: 10px;
}

.main-stage {
  min-height: 100dvh;
}

.topbar {
  position: relative;
  top: auto;
}

.atlas-workbench {
  display: block;
  padding-top: 30px;
}

.knowledge-layout,
.case-workspace {
  padding-top: 30px;
}

.knowledge-layout {
  grid-template-columns: minmax(0, 1fr);
}

.case-commandbar {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(260px, 1.4fr) auto;
  gap: 18px;
  align-items: end;
  padding: 17px 19px;
  margin-bottom: 16px;
  background: #fff;
  border-radius: 13px;
  box-shadow: 0 10px 32px rgba(25, 25, 25, 0.045);
}

.case-commandbar > div span,
.case-commandbar > div strong,
.case-commandbar label span {
  display: block;
}

.case-commandbar > div strong {
  margin-top: 5px;
  font-size: 17px;
  font-weight: 650;
}

@media (min-width: 761px) {
  .case-commandbar > div {
    position: relative;
    display: flex;
    min-height: 42px;
    align-items: center;
  }

  .case-commandbar > div .section-code {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
  }

  .case-commandbar > div strong {
    margin-top: 0;
  }
}

.case-commandbar label span {
  margin-bottom: 6px;
  color: var(--muted);
  font-family: var(--utility);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-commandbar select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  background: #f4f4f2;
  border: 0;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 600;
}

.case-commandbar .line-button {
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 272px minmax(0, 1fr);
  }
}

@media (max-width: 940px) {
  .app-shell {
    display: block;
    min-height: 100dvh;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    top: 0;
    width: min(320px, calc(100vw - 36px));
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .main-stage {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  .atlas-workbench,
  .knowledge-layout,
  .case-workspace {
    padding-top: 22px;
  }

  .case-commandbar {
    grid-template-columns: 1fr;
    gap: 13px;
  }

  .case-commandbar .line-button {
    width: 100%;
  }

  .sidebar .atlas-provenance {
    display: none;
  }
}

/* Knowledge consult — clinical evidence workspace. */
#view-knowledge {
  --consult-ink: #171717;
  --consult-muted: #74746f;
  --consult-canvas: #e9eae7;
  --consult-card: #ffffff;
  --consult-line: #deded9;
  --consult-orange: #f2550a;
}

#view-knowledge .knowledge-layout {
  min-height: calc(100dvh - 76px);
  padding: 26px 38px 34px;
}

#view-knowledge .chat-workbench {
  display: grid;
  width: min(100%, 1120px);
  min-height: calc(100dvh - 136px);
  grid-template-rows: auto minmax(360px, 1fr) auto;
  margin: 0 auto;
  overflow: hidden;
  background: var(--consult-canvas);
  border: 1px solid #d9d9d4;
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(24, 24, 24, 0.08);
}

#view-knowledge .chat-toolbar {
  min-height: 100px;
  padding: 20px 24px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--consult-line);
  backdrop-filter: blur(18px);
}

#view-knowledge .assistant-lockup,
#view-knowledge .chat-toolbar-actions,
#view-knowledge .knowledge-ready {
  display: flex;
  align-items: center;
}

#view-knowledge .assistant-lockup {
  gap: 14px;
}

#view-knowledge .console-sigil {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  color: #fff;
  background: var(--consult-ink);
  border-radius: 14px;
  font-family: var(--utility);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.05em;
  box-shadow: inset 0 -3px 0 var(--consult-orange);
}

#view-knowledge .chat-toolbar .section-code {
  margin-bottom: 3px;
  color: var(--consult-orange);
  font-size: 8px;
}

#view-knowledge .chat-toolbar strong {
  color: var(--consult-ink);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

#view-knowledge .chat-toolbar p {
  margin: 3px 0 0;
  color: var(--consult-muted);
  font-size: 10px;
}

#view-knowledge .chat-toolbar-actions {
  gap: 10px;
}

#view-knowledge .knowledge-ready {
  gap: 7px;
  padding: 7px 10px;
  color: #4e6655;
  background: #edf5ee;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
}

#view-knowledge .knowledge-ready i {
  width: 7px;
  height: 7px;
  background: #71a879;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(113, 168, 121, 0.13);
}

#view-knowledge .chat-toolbar .text-button {
  padding: 7px 3px;
  color: var(--consult-muted);
  border-bottom: 1px solid #c7c7c2;
  font-size: 9px;
}

#view-knowledge .chat-toolbar .text-button:hover {
  color: var(--consult-orange);
  border-color: var(--consult-orange);
}

#view-knowledge .chat-feed {
  min-height: 0;
  max-height: none;
  padding: 30px clamp(22px, 4vw, 48px) 38px;
  overscroll-behavior: contain;
  scrollbar-color: #c9c9c4 transparent;
  scrollbar-width: thin;
}

#view-knowledge .message {
  display: grid;
  width: min(92%, 820px);
  max-width: none;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
}

#view-knowledge .message + .message {
  margin-top: 26px;
}

#view-knowledge .message-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #fff;
  background: var(--consult-ink);
  border-radius: 12px;
  font-family: var(--utility);
  font-size: 10px;
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--consult-orange);
}

#view-knowledge .message-body {
  position: relative;
  min-width: 0;
  padding: 19px 21px 20px;
  color: var(--consult-ink);
  background: var(--consult-card);
  border: 1px solid var(--consult-line);
  border-radius: 4px 16px 16px;
  box-shadow: 0 8px 24px rgba(24, 24, 24, 0.045);
}

#view-knowledge .assistant-message .message-body::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: -1px;
  width: 3px;
  content: "";
  background: var(--consult-orange);
  border-radius: 0 3px 3px 0;
}

#view-knowledge .message-meta {
  gap: 9px;
  margin-bottom: 12px;
}

#view-knowledge .message-meta strong {
  font-size: 11px;
  font-weight: 700;
}

#view-knowledge .message-meta span {
  padding: 3px 7px;
  color: var(--consult-muted);
  background: #f0f0ed;
  border-radius: 999px;
  font-family: var(--body);
  font-size: 8px;
}

#view-knowledge .message-copy {
  color: #2a2a28;
  font-size: 12px;
  line-height: 1.9;
}

#view-knowledge .message-copy p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
}

#view-knowledge .message-copy p + p {
  margin-top: 12px;
}

#view-knowledge .message-copy strong {
  color: var(--consult-ink);
  font-weight: 750;
}

#view-knowledge .message-hint {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 16px;
}

#view-knowledge .message-hint span {
  padding: 5px 8px;
  color: #676762;
  background: #f1f1ee;
  border-radius: 7px;
  font-size: 8px;
}

#view-knowledge .user-message {
  width: min(72%, 620px);
  grid-template-columns: minmax(0, 1fr) 38px;
  margin-left: auto;
}

#view-knowledge .user-message .message-avatar {
  grid-column: 2;
  grid-row: 1;
  color: var(--consult-ink);
  background: #fff;
  border: 1px solid #d7d7d2;
  box-shadow: inset 0 -3px 0 #d7d7d2;
}

#view-knowledge .user-message .message-body {
  grid-column: 1;
  grid-row: 1;
  padding: 17px 19px;
  color: #fff;
  background: var(--consult-ink);
  border: 0;
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 10px 24px rgba(23, 23, 23, 0.11);
}

#view-knowledge .user-message .message-meta strong,
#view-knowledge .user-message .message-copy,
#view-knowledge .user-message .message-copy strong {
  color: #fff;
}

#view-knowledge .user-message .message-meta span {
  color: #c8c8c3;
  background: rgba(255, 255, 255, 0.1);
}

#view-knowledge .message-atlas-gallery {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid #e5e6e2;
}

#view-knowledge .message-atlas-head {
  display: flex;
  gap: 12px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

#view-knowledge .message-atlas-head strong {
  color: var(--consult-ink);
  font-size: 11px;
}

#view-knowledge .message-atlas-head span {
  color: var(--consult-muted);
  font-family: var(--utility);
  font-size: 8px;
}

#view-knowledge .message-atlas-track {
  display: grid;
  grid-auto-columns: min(66%, 340px);
  grid-auto-flow: column;
  gap: 10px;
  padding: 0 0 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: inline mandatory;
  scrollbar-color: #b8b9b4 transparent;
  scrollbar-width: thin;
}

#view-knowledge .message-atlas-track.is-single {
  grid-auto-columns: min(100%, 520px);
}

#view-knowledge .message-atlas-item {
  margin: 0;
  overflow: hidden;
  background: #f2f2ef;
  border: 1px solid #e2e3df;
  border-radius: 12px;
  scroll-snap-align: start;
}

#view-knowledge .message-atlas-item button {
  display: block;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  background: #e7e7e3;
  border: 0;
}

#view-knowledge .message-atlas-item img {
  display: block;
  width: 100%;
  height: 190px;
  object-fit: cover;
}

#view-knowledge .message-atlas-item figcaption {
  display: grid;
  gap: 3px;
  padding: 9px 11px 10px;
}

#view-knowledge .message-atlas-item figcaption strong {
  color: var(--consult-ink);
  font-size: 10px;
}

#view-knowledge .message-atlas-item figcaption span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--consult-muted);
  font-size: 9px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-knowledge .loading-dots {
  min-height: 28px;
  align-items: center;
}

#view-knowledge .message-loading {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 28px;
  color: var(--consult-muted);
  font-size: 10px;
}

#view-knowledge .composer[aria-busy="true"] {
  opacity: 0.72;
}

#view-knowledge .composer textarea:disabled {
  cursor: progress;
}

#view-knowledge .chat-input-dock {
  padding: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--consult-line);
}

#view-knowledge .prompt-shelf {
  gap: 7px;
  padding: 0 4px 10px;
  border: 0;
}

#view-knowledge .prompt-shelf > span {
  margin-right: 3px;
  color: #92928d;
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

#view-knowledge .prompt-shelf button {
  padding: 6px 9px;
  color: #52524e;
  background: #efefec;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 9px;
}

#view-knowledge .prompt-shelf button:hover {
  color: var(--consult-orange);
  background: #fff;
  border-color: #e2e2dd;
}

#view-knowledge .composer {
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border: 1px solid #d8d8d3;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(24, 24, 24, 0.06);
}

#view-knowledge .composer-field {
  min-width: 0;
}

#view-knowledge .composer-field label,
#view-knowledge .composer-field small {
  display: block;
}

#view-knowledge .composer-field label {
  margin-bottom: 4px;
  color: var(--consult-ink);
  font-size: 9px;
  font-weight: 700;
}

#view-knowledge .composer textarea {
  min-height: 33px;
  padding: 5px 0;
  border: 0;
  font-size: 12px;
}

#view-knowledge .composer textarea::placeholder {
  color: #a2a29d;
}

#view-knowledge .composer-field small {
  margin-top: 3px;
  color: #a0a09b;
  font-size: 8px;
}

#view-knowledge .send-button {
  min-width: 0;
  min-height: 54px;
  align-self: stretch;
  padding: 12px 14px;
  color: #fff;
  background: var(--consult-orange);
  border-radius: 11px;
  font-size: 10px;
  font-weight: 700;
}

#view-knowledge .send-button:hover {
  background: var(--consult-ink);
  transform: translateY(-1px);
}

@media (max-width: 760px) {
  #view-knowledge .knowledge-layout {
    min-height: calc(100dvh - 66px);
    padding: 14px 14px 20px;
  }

  #view-knowledge .chat-workbench {
    min-height: calc(100dvh - 100px);
    border-radius: 16px;
  }

  #view-knowledge .chat-toolbar {
    min-height: 82px;
    padding: 14px;
  }

  #view-knowledge .console-sigil,
  #view-knowledge .knowledge-ready {
    display: none;
  }

  #view-knowledge .chat-toolbar p {
    display: none;
  }

  #view-knowledge .chat-feed {
    padding: 20px 14px 28px;
  }

  #view-knowledge .message,
  #view-knowledge .user-message {
    width: 100%;
  }

  #view-knowledge .message {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 9px;
  }

  #view-knowledge .user-message {
    grid-template-columns: minmax(0, 1fr) 32px;
  }

  #view-knowledge .message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  #view-knowledge .message-body,
  #view-knowledge .user-message .message-body {
    padding: 15px;
  }

  #view-knowledge .message-atlas-track {
    grid-auto-columns: 84%;
  }

  #view-knowledge .message-atlas-track.is-single {
    grid-auto-columns: 100%;
  }

  #view-knowledge .message-atlas-item img {
    height: 165px;
  }

  #view-knowledge .prompt-shelf > span {
    display: none;
  }

  #view-knowledge .composer {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  #view-knowledge .send-button {
    width: 100%;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-knowledge .message,
  #view-knowledge .send-button {
    animation: none;
    transition: none;
  }
}

/* Knowledge consult — edge-to-edge bubbles and capsule composer. */
#view-knowledge {
  background: #eef0ed;
}

#view-knowledge .knowledge-layout {
  min-height: calc(100dvh - 76px);
  padding: 0;
}

#view-knowledge .chat-workbench {
  width: 100%;
  min-height: calc(100dvh - 76px);
  grid-template-rows: minmax(0, 1fr) auto;
  margin: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#view-knowledge .chat-feed {
  padding: 42px clamp(28px, 6vw, 92px) 48px;
  background: #eef0ed;
}

#view-knowledge .message,
#view-knowledge .user-message {
  display: block;
  width: min(88%, 820px);
  margin-left: 0;
}

#view-knowledge .message + .message {
  margin-top: 28px;
}

#view-knowledge .message-body,
#view-knowledge .user-message .message-body {
  position: relative;
  padding: 22px 24px 23px;
  color: #20201f;
  background: #fff;
  border: 1px solid #e0e1dd;
  border-radius: 27px 27px 27px 8px;
  box-shadow: 0 12px 28px rgba(25, 25, 25, 0.045);
}

#view-knowledge .assistant-message .message-body::before {
  display: none;
}

#view-knowledge .user-message {
  margin-left: auto;
}

#view-knowledge .user-message .message-body {
  color: #fff;
  background: var(--consult-orange);
  border: 0;
  border-radius: 27px 8px 27px 27px;
  box-shadow: 0 12px 24px rgba(242, 85, 10, 0.14);
}

#view-knowledge .user-message .message-meta strong,
#view-knowledge .user-message .message-copy,
#view-knowledge .user-message .message-copy strong {
  color: #fff;
}

#view-knowledge .chat-input-dock {
  padding: 19px clamp(20px, 5vw, 72px) 25px;
  background: #eef0ed;
  border-top: 0;
}

#view-knowledge .composer {
  grid-template-columns: minmax(0, 1fr) 52px;
  gap: 10px;
  min-height: 70px;
  padding: 10px 10px 10px 24px;
  background: #fff;
  border: 1px solid #dfe0dc;
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(25, 25, 25, 0.06);
}

#view-knowledge .composer-field {
  display: flex;
  min-width: 0;
  align-items: center;
}

#view-knowledge .composer textarea {
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  font-size: 12px;
}

#view-knowledge .composer textarea::placeholder {
  color: #a0a09b;
}

#view-knowledge .send-button,
#view-knowledge .send-button:hover {
  display: grid;
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  place-items: center;
  color: #fff;
  background: var(--consult-ink);
  border-radius: 50%;
  font-size: 0;
  transform: none;
}

#view-knowledge .send-button span:first-child {
  display: none;
}

#view-knowledge .send-button span:last-child {
  font-size: 20px;
  line-height: 1;
}

#view-knowledge .send-button:hover {
  background: var(--consult-orange);
}

@media (max-width: 760px) {
  #view-knowledge .knowledge-layout,
  #view-knowledge .chat-workbench {
    min-height: calc(100dvh - 66px);
  }

  #view-knowledge .chat-feed {
    padding: 25px 16px 32px;
  }

  #view-knowledge .message,
  #view-knowledge .user-message {
    width: 94%;
  }

  #view-knowledge .message-body,
  #view-knowledge .user-message .message-body {
    padding: 18px 17px 19px;
    border-radius: 23px 23px 23px 7px;
  }

  #view-knowledge .user-message .message-body {
    border-radius: 23px 7px 23px 23px;
  }

  #view-knowledge .chat-input-dock {
    padding: 12px 14px 17px;
  }

  #view-knowledge .composer {
    min-height: 62px;
    grid-template-columns: minmax(0, 1fr) 46px;
    padding-left: 18px;
  }

  #view-knowledge .send-button,
  #view-knowledge .send-button:hover {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
  }
}

/* Final interaction pass — neutral learner bubbles and keyboard-first input. */
#view-knowledge .user-message .message-body {
  color: #20201f;
  background: #fff;
  border: 1px solid #e0e1dd;
  box-shadow: 0 12px 28px rgba(25, 25, 25, 0.045);
}

#view-knowledge .user-message .message-meta strong,
#view-knowledge .user-message .message-copy,
#view-knowledge .user-message .message-copy strong {
  color: #20201f;
}

#view-knowledge .user-message .message-meta span {
  color: var(--consult-muted);
  background: #f0f0ed;
}

#view-knowledge .composer {
  grid-template-columns: 1fr;
}

#view-knowledge .composer textarea,
#view-knowledge .composer textarea:focus,
#view-knowledge .composer textarea:focus-visible {
  outline: none !important;
  outline-offset: 0;
  box-shadow: none;
}

#view-knowledge .composer:focus-within {
  border-color: #dfe0dc;
  box-shadow: 0 12px 28px rgba(25, 25, 25, 0.06);
}

#view-knowledge .composer-field {
  width: 100%;
}

#view-knowledge .composer textarea::placeholder {
  color: transparent;
}

#view-admin .admin-grid {
  grid-template-columns: minmax(0, 1fr);
}

/* Atlas sidebar: quiet active states without decorative status dots. */
.sidebar .nav-item.is-active::before,
.sidebar .category-filters button.is-active::before,
.sidebar .morph-filters button.is-active::before {
  display: none;
}

.sidebar .nav-item.is-active,
.sidebar .category-filters button.is-active,
.sidebar .morph-filters button.is-active {
  box-shadow: 0 7px 18px rgba(25, 25, 25, 0.08);
}

.sidebar .atlas-search input {
  height: 34px;
  border-radius: 7px;
}

.sidebar .atlas-controls,
.sidebar .atlas-search,
.sidebar .atlas-search > div,
.sidebar .filter-group,
.sidebar .category-filters,
.sidebar .morph-filters {
  width: 100%;
}

/* Comparison tray: a centered, quiet surface that stays readable over the atlas. */
.compare-dock {
  right: auto;
  bottom: 24px;
  left: 50%;
  width: min(560px, calc(100vw - 48px));
  transform: translateX(-50%);
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(25, 25, 25, 0.14);
}

.compare-dock > div > span {
  color: var(--coral);
}

.compare-dock p {
  color: var(--muted);
}

.compare-dock .text-button {
  color: var(--ink);
}

/* Comparison view: prioritize the clinical images and the actual differences. */
.compare-shell {
  padding-top: 54px;
}

.compare-shell > .dialog-close {
  top: 16px;
  right: 16px;
}

.compare-disease-head img {
  height: clamp(220px, 28vh, 290px);
}

/* Center the tray in the workspace to the right of the persistent sidebar. */
.compare-dock {
  left: calc(50% + 146px);
}

@media (max-width: 1180px) {
  .compare-dock {
    left: calc(50% + 136px);
  }
}

@media (max-width: 940px) {
  .compare-dock {
    left: 50%;
  }

  .compare-disease-head img {
    height: 210px;
  }
}

/* Knowledge conversation proportions: compact learner bubbles and a quieter composer. */
#view-knowledge .user-message {
  width: fit-content;
  max-width: min(70%, 620px);
  margin-left: auto;
}

#view-knowledge .user-message .message-body {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
}

#view-knowledge .user-message .message-copy {
  overflow-wrap: anywhere;
}

#view-knowledge .chat-input-dock {
  display: flex;
  justify-content: center;
}

#view-knowledge .composer {
  width: 70%;
  min-height: 49px;
  margin: 0 auto;
  padding: 7px 18px;
}

#view-knowledge .composer textarea {
  min-height: 28px;
  padding: 4px 0;
}

@media (max-width: 760px) {
  #view-knowledge .user-message {
    width: fit-content;
    max-width: 84%;
  }

  #view-knowledge .composer {
    width: 84%;
    min-height: 46px;
    padding: 6px 16px;
  }

  #view-knowledge .composer textarea {
    min-height: 27px;
  }
}

/* Composer send affordance: compact, unmistakable, and stable while streaming. */
#view-knowledge .composer {
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: center;
  padding: 5px 7px 5px 18px;
}

#view-knowledge .send-button,
#view-knowledge .send-button:hover {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  min-height: 44px;
  align-self: center;
  padding: 0;
  align-content: center;
  justify-content: center;
  place-items: center;
  color: #fff;
  background: #111;
  border-radius: 50%;
  transform: none;
}

#view-knowledge .send-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#view-knowledge .send-button:hover {
  background: #2a2a29;
}

#view-knowledge .send-button:disabled {
  background: #111;
  opacity: 0.42;
}

#view-knowledge .send-button.is-busy svg {
  opacity: 0.72;
}

#clearCompare,
#clearCompare:hover,
#clearCompare:focus-visible {
  border-bottom: 0;
  text-decoration: none;
}

#clearCompare::after {
  display: none;
}

@media (max-width: 760px) {
  #view-knowledge .composer {
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
    padding: 4px 6px 4px 16px;
  }

  #view-knowledge .send-button,
  #view-knowledge .send-button:hover {
    width: 42px;
    min-width: 42px;
    height: 42px;
    min-height: 42px;
  }
}
