:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --surface-3: #e8eef5;
  --text: #0f172a;
  --muted: #64748b;
  --subtle: #94a3b8;
  --border: #dbe3ec;
  --border-strong: #cbd5e1;
  --primary: #0f8f8f;
  --primary-dark: #0b6f73;
  --primary-soft: #d9f2f1;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --green: #16803d;
  --green-soft: #dcfce7;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --shadow: 0 14px 36px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar: 280px;
  --rail: 342px;
  font-family:
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Apple SD Gothic Neo",
    "Noto Sans KR",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(15, 143, 143, 0.08), transparent 320px),
    var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 240px;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  background: #0f8f8f;
  color: white;
  box-shadow: 0 10px 24px rgba(15, 143, 143, 0.26);
}

.brand h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.topbar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 10px;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.metric-pill strong {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 260px;
  gap: 8px;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--rail);
  min-width: 0;
  min-height: calc(100vh - 68px);
  transition: grid-template-columns 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.layout.sidebar-collapsed {
  grid-template-columns: 72px minmax(0, 1fr) var(--rail);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: start;
  justify-items: center;
  padding: 78px 18px 28px;
  overflow: auto;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

.exam-scope-modal {
  width: min(940px, 100%);
  border: 1px solid rgba(15, 143, 143, 0.24);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
  padding: 18px;
}

.modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0 0 7px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.35;
}

.modal-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.scope-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.scope-pill {
  min-height: 54px;
  padding: 11px;
  border: 1px solid rgba(15, 143, 143, 0.2);
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
}

.scope-columns {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 12px;
}

.scope-section {
  min-width: 0;
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.scope-section.focus {
  border-color: #fed7aa;
  background: #fff7ed;
}

.scope-section h3 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
}

.scope-section ul,
.scope-section ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 20px;
}

.scope-section li {
  color: #334155;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.scope-cycle-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.scope-cycle {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.scope-cycle strong {
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 950;
}

.scope-cycle span {
  color: #334155;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.privacy-note {
  margin: 12px 0 0;
  padding: 10px 11px;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.sidebar,
.score-rail {
  min-height: calc(100vh - 68px);
  border-right: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  padding: 16px;
  transition:
    padding 220ms ease,
    background-color 220ms ease,
    box-shadow 220ms ease;
}

.sidebar.collapsed {
  overflow: hidden;
  padding: 14px 10px;
  background:
    linear-gradient(90deg, rgba(15, 143, 143, 0.08), rgba(255, 255, 255, 0.82) 72%),
    rgba(255, 255, 255, 0.82);
}

.score-rail {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  border-right: 0;
  border-left: 1px solid var(--border);
  padding: 16px;
}

.main {
  min-width: 0;
  padding: 18px;
}

.sidebar-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
  animation: sidebarPanelIn 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.search-box {
  position: relative;
  min-width: 0;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--subtle);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  outline: none;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 143, 143, 0.13);
}

.sidebar-toggle {
  color: var(--muted);
}

.sidebar-bookmark {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 184px;
  justify-items: center;
  align-content: start;
  gap: 9px;
  padding: 12px 7px 20px;
  border: 1px solid rgba(15, 143, 143, 0.28);
  border-bottom: 0;
  border-radius: 12px 12px 5px 5px;
  background:
    linear-gradient(180deg, #ffffff, #f7fbfb 62%, #e9f8f7),
    white;
  color: var(--primary-dark);
  text-align: center;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 180ms ease;
  animation: bookmarkSlideIn 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-bookmark::after {
  position: absolute;
  right: -1px;
  bottom: -16px;
  left: -1px;
  height: 18px;
  clip-path: polygon(0 0, 50% 78%, 100% 0, 100% 100%, 0 100%);
  border: 1px solid rgba(15, 143, 143, 0.24);
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: #e9f8f7;
  content: "";
}

.sidebar-bookmark:hover {
  border-color: rgba(15, 143, 143, 0.5);
  box-shadow: 0 12px 30px rgba(15, 143, 42, 0.11);
  transform: translateX(2px);
}

.bookmark-grip {
  display: flex;
  justify-content: center;
  gap: 3px;
  width: 100%;
  color: var(--subtle);
}

.bookmark-grip i {
  width: 3px;
  height: 16px;
  border-radius: 999px;
  background: currentColor;
}

.bookmark-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 950;
  white-space: nowrap;
}

.sidebar-bookmark strong {
  display: block;
  max-width: 100%;
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-score {
  display: inline-grid;
  min-width: 42px;
  height: 25px;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
}

@keyframes sidebarPanelIn {
  from {
    opacity: 0;
    transform: translateX(-14px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes bookmarkSlideIn {
  from {
    opacity: 0.2;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.sidebar-section-title,
.rail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-item {
  width: 100%;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: inherit;
  text-align: left;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease,
    transform 150ms ease;
}

.case-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.case-item.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 143, 143, 0.12);
}

.case-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.case-item h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.case-item p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mini-score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.mini-score.good {
  background: var(--green-soft);
  color: var(--green);
}

.mini-score.mid {
  background: var(--amber-soft);
  color: var(--amber);
}

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.station-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  min-width: 0;
  gap: 14px;
  margin-bottom: 14px;
}

.case-hero {
  min-width: 0;
  padding: 18px;
}

.eyeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 11px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tag.primary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.tag.warning {
  background: var(--amber-soft);
  color: var(--amber);
}

.case-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.16;
}

.case-hero .diagnosis {
  margin: 10px 0 0;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.case-hero .focus {
  margin: 14px 0 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 14px;
  line-height: 1.65;
}

.timer-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.timer-display {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.timer-display strong {
  font-variant-numeric: tabular-nums;
  font-size: 42px;
  line-height: 1;
}

.timer-display span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.timer-phase {
  display: grid;
  gap: 7px;
  margin: 14px 0 12px;
}

.phase-bar {
  position: relative;
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
}

.phase-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), #19a6a6);
  transition: width 180ms ease;
}

.phase-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.btn:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.danger {
  border-color: #fecaca;
  background: var(--red-soft);
  color: var(--red);
}

.btn.icon-only {
  width: 38px;
  padding: 0;
}

.station-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  min-width: 0;
  gap: 14px;
}

.workspace {
  min-width: 0;
  padding: 16px;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.tab.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.tab-panel {
  display: none;
  padding-top: 16px;
}

.tab-panel.active {
  display: block;
}

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

.info-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.info-box h3,
.check-section h3,
.note-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.3;
}

.info-box p,
.info-box li {
  color: #334155;
  font-size: 13px;
  line-height: 1.58;
}

.info-box p {
  margin: 0;
}

.info-box ul,
.info-box ol {
  margin: 0;
  padding-left: 18px;
}

.patient-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.avatar {
  display: grid;
  width: 84px;
  height: 84px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(15, 143, 143, 0.16), transparent 60%),
    var(--surface-2);
  color: var(--primary-dark);
}

.patient-meta {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 8px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quote {
  padding: 12px;
  min-width: 0;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.checklist {
  display: grid;
  gap: 12px;
}

.check-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  padding: 12px;
}

.check-items {
  display: grid;
  gap: 8px;
}

.check-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  min-height: 34px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #334155;
  font-size: 13px;
  line-height: 1.45;
}

.check-item:hover {
  border-color: var(--border);
  background: var(--surface-2);
}

.check-item input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--primary);
}

.check-item.checked {
  background: rgba(15, 143, 143, 0.06);
  color: #0f3f45;
}

.critical-badge {
  min-width: max-content;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10px;
  font-weight: 850;
}

.script-list {
  display: grid;
  gap: 8px;
}

.script-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
}

.script-item strong {
  color: var(--primary-dark);
  font-size: 12px;
}

.script-item span {
  color: #334155;
  font-size: 13px;
  line-height: 1.5;
}

.study-layout {
  display: grid;
  gap: 12px;
}

.study-brief,
.study-card,
.reference-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.study-brief {
  background:
    linear-gradient(135deg, rgba(15, 143, 143, 0.11), rgba(37, 99, 235, 0.06)),
    #fff;
}

.study-kicker {
  margin-bottom: 6px;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.study-brief h3,
.study-card h3,
.reference-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 15px;
  line-height: 1.35;
}

.study-brief p,
.study-card p,
.study-card li,
.reference-card p,
.reference-list a,
.reference-list span {
  color: #334155;
  font-size: 13px;
  line-height: 1.62;
}

.study-brief p,
.study-card p,
.reference-card p {
  margin: 0;
}

.study-brief p,
.study-card p,
.study-card li,
.diagnosis-card li,
.exam-block li,
.reference-list a,
.reference-list span,
.info-box p,
.info-box li {
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.memory-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.memory-row span {
  padding: 5px 9px;
  border: 1px solid rgba(15, 143, 143, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 850;
}

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

.study-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 21px;
}

.study-card li::marker {
  color: var(--primary-dark);
  font-weight: 850;
}

.opening-card,
.closing-card,
.reference-card {
  grid-column: 1 / -1;
}

.opening-card {
  border-color: #bde8e5;
  background: var(--primary-soft);
}

.closing-card {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.reference-card {
  background: var(--surface-2);
}

.reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.reference-list a,
.reference-list span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.reference-list a:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
}

.diagnosis-layout {
  display: grid;
  gap: 12px;
}

.diagnosis-head,
.diagnosis-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.diagnosis-head {
  border-color: #bfdbfe;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.11), rgba(15, 143, 143, 0.06)),
    #fff;
}

.diagnosis-head h3,
.diagnosis-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 15px;
  line-height: 1.35;
}

.diagnosis-head p,
.diagnosis-card li {
  color: #334155;
  font-size: 13px;
  line-height: 1.62;
}

.diagnosis-head p {
  margin: 0;
}

.diagnosis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 255px), 1fr));
  gap: 12px;
}

.diagnosis-card ol,
.diagnosis-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 21px;
}

.diagnosis-card li::marker {
  color: var(--blue);
  font-weight: 850;
}

.criteria-card {
  border-color: #bfdbfe;
}

.exam-layout {
  display: grid;
  gap: 12px;
}

.exam-head,
.exam-guide-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px;
}

.exam-head {
  border-color: #bde8e5;
  background:
    linear-gradient(135deg, rgba(15, 143, 143, 0.12), rgba(230, 169, 74, 0.09)),
    #fff;
}

.exam-head h3 {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
}

.exam-head p {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.62;
}

.exam-head .exam-source-note {
  margin-top: 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.exam-guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.exam-guide-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.exam-guide-card.primary {
  grid-column: 1 / -1;
  border-color: rgba(15, 143, 143, 0.32);
}

.exam-card-title {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.exam-index {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.exam-card-title h3 {
  margin: 0 0 5px;
  font-size: 15px;
  line-height: 1.35;
}

.exam-card-title p,
.exam-block li,
.exam-script p {
  color: #334155;
  font-size: 13px;
  line-height: 1.62;
}

.exam-card-title p,
.exam-script p {
  margin: 0;
}

.exam-block h4,
.exam-script strong {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.exam-block ol,
.exam-block ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 21px;
}

.exam-block li::marker {
  color: var(--primary-dark);
  font-weight: 850;
}

.exam-script {
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  padding: 11px;
}

.exam-media {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(15, 143, 143, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 143, 143, 0.08), rgba(255, 255, 255, 0.86));
  padding: 11px;
}

.exam-media h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
}

.media-link-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.media-link {
  display: grid;
  min-width: 0;
  gap: 4px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.media-link:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.media-link span {
  color: #1f2937;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.media-link b {
  justify-self: start;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  font-size: 10px;
  line-height: 1;
}

.exam-media p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
}

.watch-block {
  border-top: 1px solid var(--border);
  padding-top: 11px;
}

.side-work {
  display: grid;
  align-content: start;
  gap: 12px;
}

.note-card {
  padding: 14px;
}

.coach-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.coach-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 14px;
  line-height: 1.3;
}

.coach-log {
  display: grid;
  align-content: start;
  max-height: 270px;
  gap: 8px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.coach-bubble {
  max-width: 92%;
  padding: 9px 10px;
  border-radius: var(--radius);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.coach-bubble.coach {
  justify-self: start;
  border: 1px solid #bde8e5;
  background: var(--primary-soft);
  color: #0f4f55;
}

.coach-bubble.user {
  justify-self: end;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

.coach-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.coach-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
}

.coach-input-row input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  outline: none;
}

.coach-input-row input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 143, 143, 0.13);
}

.note-card textarea {
  width: 100%;
  min-height: 168px;
  resize: vertical;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  line-height: 1.55;
}

.note-card textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 143, 143, 0.13);
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.score-card {
  padding: 16px;
}

.score-ring {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.ring {
  --score: 0;
  display: grid;
  width: 112px;
  height: 112px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, white 0 58%, transparent 59%),
    conic-gradient(var(--primary) calc(var(--score) * 1%), var(--surface-3) 0);
}

.ring strong {
  font-size: 25px;
}

.score-text h3 {
  margin: 0;
  font-size: 17px;
}

.score-text p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.score-bars {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.score-bar-row {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.small-bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-3);
}

.small-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.warning-box {
  margin-top: 12px;
  padding: 11px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.5;
}

.missed-list,
.plain-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.missed-list li,
.plain-list li {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: #334155;
  font-size: 12px;
  line-height: 1.45;
}

.missed-list li {
  border-color: #fed7aa;
  background: #fff7ed;
}

.empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.source-note {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mobile-drawer-button {
  display: none;
}

.print-only {
  display: none;
}

@media (max-width: 1180px) {
  :root {
    --sidebar: 250px;
    --rail: 315px;
  }

  .station-header,
  .station-body {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand,
  .topbar-actions {
    min-width: 0;
  }

  .topbar-center,
  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .layout {
    grid-template-columns: 1fr;
    max-width: 100vw;
  }

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

  .sidebar,
  .score-rail {
    position: static;
    height: auto;
    min-height: 0;
    max-width: 100vw;
    border: 0;
  }

  .sidebar {
    overflow: hidden;
    padding: 12px 14px 0;
  }

  .sidebar.collapsed {
    padding: 12px 14px;
  }

  .sidebar.collapsed .sidebar-bookmark {
    display: inline-flex;
    width: auto;
    min-height: 38px;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
  }

  .sidebar.collapsed .sidebar-bookmark::after,
  .sidebar.collapsed .bookmark-grip,
  .sidebar.collapsed .sidebar-bookmark strong,
  .sidebar.collapsed .bookmark-score {
    display: none;
  }

  .sidebar.collapsed .bookmark-label {
    min-height: 0;
    padding: 0;
    background: transparent;
  }

  .score-rail {
    padding: 0 18px 18px;
  }

  .case-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 8px;
  }

  .case-item {
    flex: 0 0 min(236px, 72vw);
  }

  .content-grid,
  .side-work,
  .study-grid,
  .diagnosis-grid,
  .exam-guide-grid {
    grid-template-columns: 1fr;
  }

  .media-link-list {
    grid-template-columns: 1fr;
  }

  .modal-backdrop {
    padding: 72px 12px 20px;
  }

  .scope-quick-grid,
  .scope-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    max-width: 100vw;
    padding: 12px;
  }

  .topbar {
    padding: 12px;
  }

  .brand h1 {
    font-size: 17px;
  }

  .case-hero h2 {
    font-size: 23px;
  }

  .timer-display strong {
    font-size: 34px;
  }

  .score-ring {
    grid-template-columns: 1fr;
  }

  .patient-card,
  .script-item {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 72px;
    height: 72px;
  }

  .topbar-actions .btn:not(.icon-only) {
    min-width: max-content;
  }

  .exam-scope-modal {
    padding: 14px;
  }

  .modal-head h2 {
    font-size: 17px;
  }

  .scope-cycle-list {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: white;
  }

  .topbar,
  .sidebar,
  .score-rail,
  .timer-card,
  .tabs,
  .note-card,
  .quick-actions {
    display: none !important;
  }

  .layout,
  .station-header,
  .station-body,
  .content-grid {
    display: block;
  }

  .main {
    padding: 0;
  }

  .panel,
  .info-box,
  .check-section {
    border-color: #999;
    box-shadow: none;
    break-inside: avoid;
  }

  .tab-panel {
    display: block !important;
  }

  .print-only {
    display: block;
  }
}
