:root {
  --harbor: #0b1f33;
  --harbor-soft: #15334a;
  --quarantine: #1d5d74;
  --signal: #ff7a45;
  --signal-dark: #d6572b;
  --frost: #e8f0ef;
  --paper: #f7faf9;
  --white: #ffffff;
  --ink: #172027;
  --muted: #64747d;
  --line: #d5dfdd;
  --success: #268060;
  --danger: #a84332;
  --shadow: 0 20px 60px rgba(11, 31, 51, 0.1);
  --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;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    linear-gradient(rgba(29, 93, 116, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 32px;
}

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 {
  outline: 3px solid rgba(255, 122, 69, 0.35);
  outline-offset: 3px;
}

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

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: 268px;
  flex-direction: column;
  padding: 28px 20px 22px;
  color: #f3f7f6;
  background: var(--harbor);
  border-right: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar::after {
  position: absolute;
  right: 11px;
  bottom: 0;
  width: 1px;
  height: 34%;
  content: "";
  background: rgba(255, 122, 69, 0.7);
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  transform: rotate(45deg);
}

.brand-mark span {
  position: absolute;
  display: block;
  background: var(--signal);
  transform: rotate(-45deg);
}

.brand-mark span:nth-child(1) {
  width: 15px;
  height: 2px;
}

.brand-mark span:nth-child(2) {
  width: 2px;
  height: 15px;
}

.brand-mark span:nth-child(3) {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

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

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

.brand small {
  margin-top: 3px;
  color: #9fb4be;
  font-size: 11px;
  letter-spacing: 0.24em;
}

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

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

.nav-label {
  margin: 0 0 13px 12px;
  color: #7f9aa7;
  font-size: 10px;
}

.nav-item {
  position: relative;
  display: grid;
  width: 100%;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px 12px;
  color: #a9bdc5;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 4px;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav-item + .nav-item {
  margin-top: 6px;
}

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

.nav-item.is-active {
  color: var(--white);
  background: rgba(29, 93, 116, 0.5);
}

.nav-item.is-active::before {
  position: absolute;
  left: 0;
  width: 3px;
  height: 25px;
  content: "";
  background: var(--signal);
}

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

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

.nav-item strong {
  font-size: 14px;
  font-weight: 600;
}

.nav-item small {
  margin-top: 4px;
  color: #718d9a;
  font-size: 11px;
}

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

.system-card {
  margin-top: auto;
  padding: 15px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 4px;
}

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

.status-dot {
  width: 8px;
  height: 8px;
  background: #d28b4b;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(210, 139, 75, 0.13);
}

.status-dot.is-ready {
  background: #5fc49f;
  box-shadow: 0 0 0 5px rgba(95, 196, 159, 0.13);
}

.status-dot.is-error {
  background: #ec7d68;
  box-shadow: 0 0 0 5px rgba(236, 125, 104, 0.13);
}

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

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

.system-status small {
  margin-top: 2px;
  color: #7f9aa7;
  font-family: var(--utility);
  font-size: 9px;
}

.system-counts {
  display: flex;
  justify-content: space-between;
  padding-top: 13px;
  margin-top: 13px;
  color: #8099a5;
  font-size: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.system-counts strong {
  color: #eef5f4;
  font-family: var(--utility);
  font-weight: 500;
}

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

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 48px;
  background: rgba(247, 250, 249, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.topbar-kicker,
.topbar strong {
  display: block;
}

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

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

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

.live-stamp span {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
}

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

.menu-button span {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--harbor);
}

.menu-button span + span {
  margin-top: 7px;
}

.workspace-view {
  display: none;
  width: min(1220px, calc(100% - 64px));
  padding: 58px 0 96px;
  margin: 0 auto;
}

.workspace-view.is-active {
  display: block;
  animation: view-in 280ms ease both;
}

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

.workspace-head {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1.4fr) minmax(270px, 0.7fr);
  gap: 34px;
  align-items: end;
  min-height: 280px;
  padding-bottom: 48px;
}

.workspace-head::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, var(--signal) 0 88px, var(--line) 88px 100%);
}

.field-index {
  align-self: start;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 88px;
  line-height: 0.8;
  opacity: 0.11;
}

.eyebrow {
  display: block;
  margin-bottom: 18px;
  color: var(--signal-dark);
  font-size: 10px;
}

.workspace-copy h1 {
  max-width: 650px;
  margin: 0;
  color: var(--harbor);
  font-family: var(--display);
  font-size: clamp(42px, 5.1vw, 72px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.035em;
}

.workspace-copy p {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.9;
}

.brief-card,
.case-selector-card {
  position: relative;
  padding: 26px;
  background: var(--frost);
  border-left: 3px solid var(--quarantine);
}

.brief-label {
  color: var(--quarantine);
  font-size: 9px;
}

.brief-card strong {
  display: block;
  margin-top: 13px;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}

.brief-card p {
  margin: 10px 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.brief-rule {
  display: grid;
  grid-template-columns: 1fr 0.52fr 0.22fr;
  gap: 4px;
}

.brief-rule span {
  height: 3px;
  background: var(--quarantine);
}

.brief-rule span:last-child {
  background: var(--signal);
}

.chat-workbench,
.dossier,
.decision-board,
.stage-board,
.admin-panel,
.admin-unlock {
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chat-workbench {
  margin-top: 40px;
}

.chat-toolbar,
.dossier-head,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-toolbar {
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
}

.section-code {
  display: block;
  margin-bottom: 5px;
  color: var(--quarantine);
  font-size: 9px;
}

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

.text-button {
  padding: 8px 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  font-size: 12px;
}

.text-button:hover {
  color: var(--signal-dark);
  border-bottom-color: var(--signal);
}

.chat-feed {
  position: relative;
  min-height: 260px;
  max-height: 580px;
  padding: 28px 34px 18px;
  overflow-y: auto;
}

.chat-feed::before,
.stage-chat::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50px;
  width: 1px;
  content: "";
  background: var(--line);
}

.message {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 18px;
}

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

.message-marker {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.message-marker span {
  width: 11px;
  height: 11px;
  background: var(--white);
  border: 3px solid var(--quarantine);
  border-radius: 50%;
}

.user-message .message-marker span {
  border-color: var(--signal);
}

.message-body {
  max-width: 820px;
  padding: 17px 19px;
  background: var(--frost);
  border-radius: 2px 12px 12px;
}

.user-message .message-body {
  margin-left: auto;
  background: #fff2ec;
  border-radius: 12px 2px 12px 12px;
}

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

.message-meta strong {
  color: var(--harbor);
  font-size: 12px;
}

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

.message-body p,
.message-body ul,
.message-body ol {
  margin: 0;
  color: #35454d;
  font-size: 14px;
  line-height: 1.85;
}

.message-body p + p,
.message-body ul + p,
.message-body p + ul {
  margin-top: 10px;
}

.message-body ul,
.message-body ol {
  padding-left: 20px;
}

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

.loading-dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 20px;
}

.loading-dots i {
  width: 5px;
  height: 5px;
  background: var(--quarantine);
  border-radius: 50%;
  animation: dot-pulse 900ms infinite ease-in-out;
}

.loading-dots i:nth-child(2) { animation-delay: 120ms; }
.loading-dots i:nth-child(3) { animation-delay: 240ms; }

@keyframes dot-pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.prompt-shelf {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 26px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
}

.prompt-shelf > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.prompt-shelf button {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: var(--quarantine);
  background: transparent;
  border: 1px solid #bfd1d3;
  border-radius: 999px;
  font-size: 11px;
}

.prompt-shelf button:hover {
  color: var(--white);
  background: var(--quarantine);
  border-color: var(--quarantine);
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px 26px 22px;
  background: #fbfcfc;
  border-top: 1px solid var(--line);
}

.composer textarea {
  width: 100%;
  min-height: 52px;
  max-height: 160px;
  padding: 15px 16px;
  resize: none;
  background: var(--white);
  border: 1px solid #b9c8c8;
  border-radius: 3px;
  line-height: 1.55;
}

.composer textarea::placeholder {
  color: #93a2a8;
}

.send-button,
.primary-button,
.admin-unlock button {
  display: inline-flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  color: var(--white);
  background: var(--harbor);
  border: 1px solid var(--harbor);
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.send-button:hover,
.primary-button:hover,
.admin-unlock button:hover {
  background: var(--quarantine);
  border-color: var(--quarantine);
  transform: translateY(-1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.56;
  transform: none !important;
}

.case-selector-card label,
.admin-unlock label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
}

.case-selector-card select {
  width: 100%;
  padding: 12px 34px 12px 12px;
  color: var(--harbor);
  background: var(--white);
  border: 1px solid #b9c9c9;
  border-radius: 2px;
  font-size: 13px;
}

.outline-button {
  display: inline-flex;
  min-height: 42px;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding: 0 15px;
  color: var(--harbor);
  background: transparent;
  border: 1px solid #9fb5ba;
  border-radius: 2px;
  font-size: 12px;
  font-weight: 600;
}

.outline-button:hover {
  color: var(--white);
  background: var(--quarantine);
  border-color: var(--quarantine);
}

.case-selector-card .outline-button {
  width: 100%;
  margin-top: 12px;
}

.case-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(480px, 1.28fr);
  gap: 24px;
  align-items: start;
  margin-top: 40px;
}

.dossier {
  position: sticky;
  top: 96px;
  padding: 26px;
}

.dossier::before {
  position: absolute;
  top: 0;
  right: 22px;
  width: 16px;
  height: 5px;
  content: "";
  background: var(--signal);
}

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

.dossier h2 {
  margin: 22px 0 18px;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.35;
}

.background-note {
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.background-note span {
  color: var(--signal-dark);
  font-family: var(--utility);
  font-size: 9px;
  letter-spacing: 0.12em;
}

.background-note p {
  margin: 8px 0 0;
  color: #46565d;
  font-size: 13px;
  line-height: 1.8;
}

.patient-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
  margin-top: 12px;
}

.patient-item {
  padding: 13px 0;
  border-bottom: 1px solid #e8eeee;
}

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

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

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

.patient-item strong {
  color: #273941;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.65;
}

.decision-board,
.stage-board {
  padding: 30px;
}

.board-head {
  display: flex;
  gap: 30px;
  align-items: end;
  justify-content: space-between;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.board-head h2 {
  margin: 0;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 28px;
}

.board-head > p {
  max-width: 240px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  text-align: right;
}

.decision-group {
  padding: 25px 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.decision-group legend {
  display: grid;
  width: 100%;
  grid-template-columns: 34px 1fr;
  align-items: baseline;
  margin-bottom: 14px;
}

.decision-group legend span {
  grid-row: 1 / span 2;
  color: var(--signal-dark);
  font-family: var(--utility);
  font-size: 10px;
}

.decision-group legend strong {
  color: var(--harbor);
  font-size: 14px;
}

.decision-group legend small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-left: 34px;
}

.option-card {
  position: relative;
  display: flex;
  min-height: 48px;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  color: #42525a;
  background: #fafcfc;
  border: 1px solid #dbe4e3;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.55;
  transition: border-color 150ms ease, background 150ms ease;
}

.option-card:hover {
  border-color: #9db8bd;
}

.option-card:has(input:checked) {
  color: var(--harbor);
  background: #e9f2f1;
  border-color: var(--quarantine);
}

.option-card input {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 2px 0 0;
  accent-color: var(--quarantine);
}

.primary-button {
  min-height: 52px;
  margin-top: 24px;
}

.feedback-panel {
  padding: 23px;
  margin-top: 24px;
  color: #35454d;
  background: #eef6f3;
  border-left: 3px solid var(--success);
  font-size: 13px;
  line-height: 1.85;
}

.feedback-panel h3 {
  margin: 0 0 10px;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 20px;
}

.feedback-panel .reference {
  padding-top: 14px;
  margin-top: 14px;
  color: var(--muted);
  border-top: 1px solid #cedfd9;
  font-size: 11px;
}

.case-empty {
  padding: 30px;
  margin-top: 40px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #afc0c1;
}

.stage-task,
.stage-data {
  padding: 18px;
  margin-top: 20px;
  color: #3d4e56;
  background: #fff2ec;
  border-left: 3px solid var(--signal);
  font-size: 13px;
  line-height: 1.75;
}

.stage-data {
  background: var(--frost);
  border-left-color: var(--quarantine);
}

.stage-chat {
  position: relative;
  min-height: 180px;
  padding: 28px 0 12px;
}

.stage-chat::before {
  left: 16px;
}

.stage-composer {
  padding: 16px 0 0;
  background: transparent;
}

.stage-board > .outline-button {
  margin-top: 18px;
}

.admin-head {
  grid-template-columns: 88px minmax(0, 1fr);
}

.admin-unlock {
  display: grid;
  grid-template-columns: 80px minmax(220px, 1fr) minmax(300px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 32px;
  margin-top: 40px;
}

.lock-symbol {
  display: grid;
  width: 62px;
  height: 62px;
  color: var(--signal);
  font-family: var(--display);
  font-size: 30px;
  place-items: center;
  border: 1px solid var(--signal);
  transform: rotate(45deg);
}

.admin-unlock h2 {
  margin: 0;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 27px;
}

.admin-unlock p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.password-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.password-row input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid #acbdbe;
  border-radius: 2px 0 0 2px;
}

.password-row button {
  min-width: 88px;
  border-radius: 0 2px 2px 0;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

.admin-panel {
  padding: 28px;
}

.panel-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  color: var(--harbor);
  font-family: var(--display);
  font-size: 25px;
}

.panel-heading > span {
  color: var(--muted);
  font-family: var(--utility);
  font-size: 10px;
}

.content-list {
  max-height: 440px;
  overflow-y: auto;
}

.content-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid #e7eded;
}

.content-row strong,
.content-row small {
  display: block;
}

.content-row strong {
  overflow: hidden;
  color: #30424a;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.delete-button {
  padding: 6px 8px;
  color: var(--danger);
  background: transparent;
  border: 0;
  font-size: 11px;
}

.delete-button:hover {
  background: #fff0ed;
}

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

.upload-zone {
  display: grid;
  gap: 13px;
  padding: 18px;
  margin-top: 22px;
  background: var(--frost);
  border: 1px dashed #9fb7ba;
}

.upload-zone label strong,
.upload-zone label span {
  display: block;
}

.upload-zone label strong {
  color: var(--harbor);
  font-size: 13px;
}

.upload-zone label span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.upload-zone input {
  width: 100%;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 28px;
  bottom: 28px;
  max-width: 380px;
  padding: 14px 18px;
  color: var(--white);
  pointer-events: none;
  background: var(--harbor);
  border-left: 4px solid var(--signal);
  opacity: 0;
  box-shadow: 0 18px 50px rgba(11, 31, 51, 0.28);
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
  font-size: 12px;
  line-height: 1.6;
}

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

.toast.is-error {
  border-left-color: #f19b85;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1050px) {
  .workspace-head {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .brief-card,
  .case-selector-card {
    grid-column: 2;
    margin-top: 6px;
  }

  .case-workspace,
  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .dossier {
    position: static;
  }

  .admin-unlock {
    grid-template-columns: 62px 1fr;
  }

  .admin-unlock form {
    grid-column: 2;
  }
}

@media (max-width: 760px) {
  .sidebar {
    width: min(82vw, 300px);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

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

  .sidebar-scrim {
    position: fixed;
    z-index: 25;
    inset: 0;
    display: block;
    visibility: hidden;
    background: rgba(7, 19, 31, 0.48);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .sidebar-scrim.is-open {
    visibility: visible;
    opacity: 1;
  }

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

  .topbar {
    height: 64px;
    padding: 0 18px;
  }

  .menu-button {
    display: block;
  }

  .topbar > div:nth-child(2) {
    margin-right: auto;
    margin-left: 12px;
  }

  .live-stamp {
    display: none;
  }

  .workspace-view {
    width: min(100% - 30px, 680px);
    padding-top: 38px;
  }

  .workspace-head {
    display: block;
    min-height: 0;
  }

  .field-index {
    position: absolute;
    top: -5px;
    right: 0;
    font-size: 72px;
  }

  .workspace-copy h1 {
    font-size: clamp(39px, 13vw, 58px);
  }

  .brief-card,
  .case-selector-card {
    margin-top: 28px;
  }

  .chat-feed {
    padding-right: 18px;
    padding-left: 18px;
  }

  .chat-feed::before {
    left: 34px;
  }

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

  .prompt-shelf {
    padding-right: 18px;
    padding-left: 18px;
  }

  .composer {
    grid-template-columns: 1fr;
    padding-right: 18px;
    padding-left: 18px;
  }

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

  .patient-grid,
  .option-grid {
    grid-template-columns: 1fr;
  }

  .decision-board,
  .stage-board,
  .dossier,
  .admin-panel,
  .admin-unlock {
    padding: 20px;
  }

  .board-head {
    display: block;
  }

  .board-head > p {
    margin-top: 8px;
    text-align: left;
  }

  .option-grid {
    margin-left: 0;
  }

  .admin-unlock {
    display: block;
  }

  .lock-symbol {
    margin-bottom: 28px;
  }

  .admin-unlock form {
    margin-top: 24px;
  }

  .password-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .password-row input,
  .password-row button {
    min-height: 46px;
    border-radius: 2px;
  }

  .toast {
    right: 15px;
    bottom: 15px;
    left: 15px;
    max-width: none;
  }
}

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