:root {
  --bg: #f0e7cd;
  --panel: #f4ecd6;
  --text: #28231c;
  --muted: #2f6b6b;
  --line: #e6d9b6;
  --blue: #2f6b6b;
  --blue-dark: #28231c;
  --blue-soft: #f0e7cd;
  --amber-soft: #f3e3c0;
  --amber-line: #e0b066;
  --danger: #a8432f;
  --radius: 8px;
  --entry-panel-height: 44px;
  --reader-toolbar-height: 48px;
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 100%;
  overflow-x: hidden;
}

.app-header {
  min-height: 56px;
  padding: 9px 18px;
  background: linear-gradient(135deg, #28231c, #2f6b6b);
  color: #f4ecd6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 4px solid #cdba90;
}

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

.app-brand > div {
  min-width: 0;
}

.app-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(5, 23, 46, .2);
}

.app-header h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.app-header p {
  margin: 2px 0 0;
  color: #f0e7cd;
  font-size: 12px;
}

.version-badge {
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  color: #f0e7cd;
  white-space: nowrap;
}

.app-shell,
.shell {
  width: min(1260px, calc(100% - 28px));
  margin: 8px auto 20px;
}

.notice,
.notice-panel {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-left: 5px solid var(--amber-line);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: #a8651c;
  font-size: 12px;
  line-height: 1.35;
  margin-bottom: 8px;
}

.entry-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
  position: static;
  padding: 5px 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(216, 227, 242, .72);
}

.entry-card {
  --module-accent: #2f6b6b;
  --module-soft: #f0e7cd;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 7px 10px;
  text-align: left;
  background: linear-gradient(180deg, #f4ecd6, var(--module-soft));
  border: 1px solid #e6d9b6;
  border-left: 4px solid var(--module-accent);
  border-radius: var(--radius);
  color: var(--blue-dark);
  overflow: hidden;
}

.entry-card span {
  display: block;
  max-width: 100%;
  font-size: 11.8px;
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.entry-card small {
  display: block;
  max-width: 100%;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.entry-card.active {
  min-height: 48px;
  padding: 7px 10px;
  background: var(--module-accent);
  border-color: var(--module-accent);
  border-left-color: #e6d9b6;
  color: #f4ecd6;
  box-shadow: 0 2px 8px rgba(31, 94, 168, .12);
}

.entry-card.active span {
  font-size: 11.8px;
}

.entry-card.active small {
  color: #f0e7cd;
}

.entry-card[data-mode="symptom"] { order: 1; --module-accent: #2f6b6b; --module-soft: #ece3c8; }
.entry-card[data-mode="lab"] { order: 2; --module-accent: #2f6b6b; --module-soft: #ece3c8; }
.entry-card[data-mode="emergency"] { order: 3; --module-accent: #d98a3d; --module-soft: #f3e3c0; }
.entry-card[data-mode="disease"] { order: 4; --module-accent: #2f6b6b; --module-soft: #f0e7cd; }
.entry-card[data-mode="score"] { order: 5; --module-accent: #5f968d; --module-soft: #f0e7cd; }
.entry-card[data-mode="screening"] { order: 6; --module-accent: #2f6b6b; --module-soft: #ece3c8; }
.entry-card[data-mode="procedure"] { order: 7; --module-accent: #2f6b6b; --module-soft: #f0e7cd; }
.entry-card[data-mode="drug"] { order: 8; --module-accent: #a8432f; --module-soft: #f0d6c2; }
.entry-card[data-mode="route"] { order: 9; --module-accent: #2f6b6b; --module-soft: #f0e7cd; }

.workspace {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  gap: 8px;
}

.workspace.simple-entry {
  grid-template-columns: 1fr;
}

.workspace.simple-entry .sidebar {
  display: none;
}

.workspace.simple-entry .tabs {
  display: none;
}

.workspace.disease-entry .tabs,
.workspace.disease-entry .toolbar-actions {
  display: none;
}

.workspace.disease-entry {
  grid-template-columns: 1fr;
  gap: 0;
}

.workspace.disease-entry .reader {
  border-color: var(--line);
  box-shadow: none;
}

.workspace.disease-entry .sidebar {
  display: none;
}

.workspace.disease-entry .reader {
  border-radius: var(--radius);
}

.sidebar,
.reader,
.emergency-panel,
.roadmap,
.roadmap-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.sidebar {
  padding: 8px;
  align-self: start;
  position: sticky;
  top: 12px;
}

.field {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
}

label {
  font-weight: 700;
  font-size: 11.5px;
  color: var(--blue-dark);
}

input,
select {
  width: 100%;
  min-height: 32px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  padding: 5px 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #f4ecd6;
}

input:focus,
select:focus {
  outline: 3px solid rgba(31, 94, 168, .14);
  border-color: var(--blue);
}

.diagnosis-list {
  display: grid;
  gap: 4px;
  max-height: calc(100vh - 190px);
  overflow: auto;
  padding-right: 4px;
}

.diagnosis-item {
  border: 1px solid var(--line);
  background: #f4ecd6;
  color: var(--text);
  border-radius: var(--radius);
  padding: 5px 7px;
  text-align: left;
  cursor: pointer;
  font-size: 12.2px;
  font-weight: 650;
  line-height: 1.16;
}

.diagnosis-item small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 500;
  margin-top: 2px;
}

.diagnosis-item-title {
  display: inline;
}

.completion-list-badge {
  display: none;
}

.section-completion-badge {
  display: none;
}

.diagnosis-item.active,
.diagnosis-item:hover {
  border-color: #cdba90;
  background: var(--blue-soft);
}

.reader {
  min-width: 0;
  padding: 9px;
}

.reader-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  position: static;
  background: rgba(246, 249, 252, .98);
  padding: 2px 0;
}

.eyebrow {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.reader h2,
.emergency-panel h2,
.roadmap h2,
.roadmap-panel h2 {
  margin: 1px 0 0;
  font-size: 16px;
  line-height: 1.18;
  color: var(--blue-dark);
}

.toolbar-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.toolbar-actions button {
  min-height: 28px;
  padding: 3px 8px;
  font-size: 11.8px;
  font-weight: 700;
  border-radius: 7px;
}

.workspace.card-actions-entry .reader-toolbar,
.workspace.disease-entry .reader-toolbar {
  display: block;
  margin: 0 0 7px;
  padding: 7px 10px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(251, 253, 255, .97);
  box-shadow: 0 5px 14px rgba(21, 32, 51, .05);
}

.workspace.card-actions-entry .reader-toolbar .toolbar-actions,
.workspace.disease-entry .reader-toolbar .toolbar-actions,
.workspace.card-actions-entry .reader-toolbar .eyebrow,
.workspace.disease-entry .reader-toolbar .eyebrow {
  display: none;
}

.workspace.card-actions-entry .reader-toolbar h2,
.workspace.disease-entry .reader-toolbar h2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 430px);
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 17px;
  line-height: 1.18;
}

.module-title-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.module-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.module-inline-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-inline-select option.completed-option {
  background: #f4ecd6;
  color: inherit;
  font-weight: inherit;
}

.searchable-module-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.searchable-picker-control {
  width: 100%;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  position: relative;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.searchable-picker-control::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-dark);
  font-size: 12px;
}

.searchable-module-picker.open .searchable-picker-control::after {
  content: "▴";
}

.searchable-picker-current {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.searchable-picker-panel {
  position: absolute;
  z-index: 80;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: min(60vh, 460px);
  padding: 6px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  box-shadow: 0 14px 28px rgba(21, 32, 51, .18);
}

.searchable-picker-input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 650;
  outline: none;
}

.searchable-picker-input:focus {
  border-color: #cdba90;
  box-shadow: 0 0 0 2px rgba(31, 94, 168, .12);
}

.searchable-picker-list {
  max-height: min(48vh, 370px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 6px;
  border: 1px solid #f0e7cd;
  border-radius: 7px;
}

.searchable-picker-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  display: block;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0e7cd;
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.searchable-picker-option:last-child {
  border-bottom: 0;
}

.searchable-picker-option:hover,
.searchable-picker-option:focus {
  background: var(--blue-soft);
}

.searchable-picker-option.active {
  background: var(--blue);
  color: #f4ecd6;
}

.searchable-picker-empty {
  padding: 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.mobile-module-picker {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  position: relative;
}

.mobile-module-picker summary {
  min-height: 34px;
  padding: 7px 28px 7px 10px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  cursor: pointer;
  list-style: none;
  position: relative;
  overflow: hidden;
}

.mobile-module-picker summary::-webkit-details-marker {
  display: none;
}

.mobile-module-picker summary::after {
  content: "▾";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--blue-dark);
  font-size: 12px;
}

.mobile-module-picker[open] summary::after {
  content: "▴";
}

.mobile-module-picker summary span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-module-picker-list {
  width: 100%;
  max-width: 100%;
  max-height: min(58vh, 430px);
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 4px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  box-shadow: 0 10px 24px rgba(21, 32, 51, .14);
}

.mobile-module-picker-option {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  display: block;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f0e7cd;
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.mobile-module-picker-option:last-child {
  border-bottom: 0;
}

.mobile-module-picker-option.active {
  background: var(--blue);
  color: #f4ecd6;
}

.workspace.emergency-entry.card-actions-entry .reader-toolbar {
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--line);
}

.workspace.emergency-entry.card-actions-entry .reader-toolbar .toolbar-actions,
.workspace.emergency-entry.card-actions-entry .reader-toolbar .eyebrow {
  display: none;
}

.workspace.emergency-entry.card-actions-entry .reader-toolbar h2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 360px);
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 19px;
}

.emergency-inline-select {
  max-width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-button {
  display: none;
}

.workspace.simple-entry .source-button {
  display: inline-flex;
  align-items: center;
}

.workspace.emergency-entry .source-button {
  display: inline-flex;
  align-items: center;
}

.source-button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #f4ecd6;
}

button {
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f4ecd6;
  color: var(--blue-dark);
  min-height: 30px;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--blue-soft);
}

.annotation-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  min-height: 38px;
  padding: 8px 12px;
  border-color: #cdba90;
  border-radius: 999px;
  background: #f4ecd6;
  box-shadow: 0 8px 24px rgba(13, 43, 79, 0.18);
}

.annotation-toggle.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #f4ecd6;
}

.annotation-layer {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  pointer-events: none;
}

.annotation-layer.active {
  display: block;
  pointer-events: auto;
}

.annotation-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.annotation-layer.note-tool .annotation-canvas {
  cursor: copy;
}

.annotation-layer.eraser-tool .annotation-canvas {
  cursor: cell;
}

.annotation-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.annotation-note {
  position: fixed;
  z-index: 1110;
  width: min(238px, calc(100vw - 20px));
  min-height: 118px;
  border: 1px solid #e0b066;
  border-radius: 8px;
  background: #e0b066;
  box-shadow: 0 10px 24px rgba(77, 62, 10, 0.2);
  overflow: hidden;
  pointer-events: auto;
}

.annotation-note-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  padding: 4px 8px;
  background: #e0b066;
  color: #a8651c;
  font-size: 12px;
  font-weight: 800;
  cursor: move;
  user-select: none;
}

.annotation-note-head button {
  min-height: 22px;
  width: 24px;
  padding: 0;
  border-color: #d98a3d;
  border-radius: 999px;
  background: #f3e3c0;
  color: #a8651c;
  line-height: 1;
}

.annotation-note textarea {
  display: block;
  width: 100%;
  height: 90px;
  border: 0;
  resize: vertical;
  padding: 8px;
  background: transparent;
  color: #a8651c;
  font: inherit;
  font-size: 13px;
  line-height: 1.35;
}

.annotation-note textarea:focus {
  outline: 2px solid rgba(179, 54, 54, 0.35);
  outline-offset: -2px;
}

.annotation-toolbar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 1210;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 124px);
  padding: 8px;
  border: 1px solid #e6d9b6;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(13, 43, 79, 0.18);
  transform: translateX(-50%);
}

.annotation-toolbar[hidden] {
  display: none;
}

.annotation-toolbar button {
  min-height: 30px;
  white-space: nowrap;
}

.annotation-toolbar button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #f4ecd6;
}

.annotation-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.annotation-toolbar input[type="color"] {
  width: 30px;
  height: 24px;
  padding: 0;
  border: 1px solid #e6d9b6;
  border-radius: 5px;
  background: #f4ecd6;
}

.annotation-toolbar input[type="range"] {
  width: 92px;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
  margin: 5px 0 8px;
}

.tab {
  min-height: 30px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 700;
}

.tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #f4ecd6;
}

.content {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f4ecd6;
  padding: 8px;
  min-height: 480px;
}

.empty-state {
  color: var(--muted);
  padding: 14px;
}

.section-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 4px;
  overflow: visible;
}

.section-card summary {
  cursor: pointer;
  list-style: none;
  padding: 6px 8px;
  background: linear-gradient(90deg, var(--blue-soft), #f4ecd6);
  color: var(--blue-dark);
  font-size: 12.2px;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.section-card summary::-webkit-details-marker { display: none; }

.section-summary-title {
  flex: 1 1 160px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid #f0e7cd;
}

.section-action {
  min-height: 22px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 750;
  line-height: 1;
  background: #f4ecd6;
}

.section-action-close {
  color: #2f6b6b;
  border-color: #e6d9b6;
  background: #f0e7cd;
}

.section-card summary::after {
  content: "+";
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f4ecd6;
  border: 1px solid #e6d9b6;
}

.section-card[open] > summary::after { content: "-"; }

.disease-parent-card {
  background: #f0e7cd;
}

.disease-parent-card > summary {
  background: linear-gradient(90deg, #f0e7cd, #f4ecd6);
  border-left: 3px solid var(--blue);
  font-size: 12.8px;
  font-weight: 850;
}

.disease-parent-body {
  display: grid;
  gap: 5px;
  padding: 7px !important;
  background: #f0e7cd;
}

.disease-subcard {
  margin-bottom: 0;
  background: #f4ecd6;
}

.disease-subcard > summary {
  padding: 5px 8px;
  background: #f0e7cd;
  border-left: 3px solid #cdba90;
  font-size: 12px;
  font-weight: 800;
}

.disease-subcard > .section-body {
  background: #f4ecd6;
}

.disease-topic-card {
  margin-bottom: 0;
  background: #f0e7cd;
}

.disease-topic-card > summary {
  background: linear-gradient(90deg, #f0e7cd, #f0e7cd);
  border-left: 3px solid var(--blue);
  font-size: 12.8px;
  font-weight: 850;
}

.disease-topic-card > .disease-topic-body {
  gap: 4px;
  padding: 6px !important;
}

.disease-topic-subcard > summary {
  padding-left: 10px;
  background: #f4ecd6;
  border-left-color: #cdba90;
  font-size: 11.8px;
}

.disease-topic-subcard > .section-body {
  border-top: 1px solid #f0e7cd;
}

.section-body {
  padding: 7px 10px 8px;
  font-size: 12.8px;
}

.section-body ul {
  margin: 0;
  padding-left: 17px;
}

.section-body li {
  margin-bottom: 4px;
  line-height: 1.38;
}

.direction-line {
  list-style: disc;
}

.direction-line-lead {
  margin-right: 5px;
}

.direction-chip-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-left: 2px;
  vertical-align: middle;
}

.direction-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  background: #f0e7cd;
  color: var(--blue-dark);
  font-size: 11.2px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.direction-chip:hover,
.direction-chip:focus {
  background: var(--blue-soft);
  border-color: #cdba90;
  outline: none;
}

.direction-chip:active {
  transform: translateY(1px);
}

.direction-chip-muted {
  border-color: #e6d9b6;
  background: #f4ecd6;
  color: #2f6b6b;
  cursor: default;
}

.direction-back-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding: 6px 8px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f0e7cd;
}

.direction-back-button {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  background: #f4ecd6;
  color: var(--blue-dark);
  font-size: 11.4px;
  font-weight: 800;
  line-height: 1.2;
  cursor: pointer;
}

.direction-back-button:hover,
.direction-back-button:focus {
  background: var(--blue-soft);
  border-color: #cdba90;
  outline: none;
}

.direction-back-label {
  min-width: 0;
  color: #2f6b6b;
  font-size: 11.4px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.direction-focus-target {
  border-left: 4px solid #d98a3d !important;
  border-radius: 7px;
  background: #f3e3c0 !important;
  box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.22);
  padding: 5px 7px;
}

tr.direction-focus-target {
  display: table-row;
  border-left: 0 !important;
  box-shadow: none;
}

tr.direction-focus-target > td,
tr.direction-focus-target > th {
  background: #f3e3c0 !important;
  box-shadow: inset 0 1px 0 rgba(245, 158, 11, 0.22), inset 0 -1px 0 rgba(245, 158, 11, 0.22);
}

.section-body li.section-subheading-line {
  list-style: none;
  margin: 10px 0 3px -17px;
  padding: 0;
  border-left: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.section-body li.section-subheading-line.lab-template-heading {
  border-left-color: transparent;
  background: transparent;
  color: var(--blue-dark);
}

.section-body li strong {
  color: var(--blue-dark);
  font-weight: 850;
}

.section-body li.section-table-line {
  list-style: none;
  margin: 9px 0 8px -17px;
}

.section-table-title {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.section-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4ecd6;
}

.section-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 12px;
}

.section-table th,
.section-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e6d9b6;
  vertical-align: top;
  text-align: left;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.section-table th {
  background: #f0e7cd;
  color: var(--blue-dark);
  font-weight: 850;
}

.section-table tr:last-child td {
  border-bottom: 0;
}

.section-body li.decision-flow-line {
  list-style: none;
  margin: 10px 0 10px -17px;
}

.decision-flow {
  padding: 8px;
  border: 1px solid #e6d9b6;
  border-radius: 8px;
  background: #f0e7cd;
}

.decision-flow-title {
  margin: 0 0 7px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.decision-flow-steps {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.decision-step {
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  background: #f4ecd6;
  overflow: hidden;
  max-width: 100%;
}

.decision-step[open] {
  border-color: #cdba90;
  box-shadow: 0 4px 14px rgba(31, 99, 173, 0.08);
}

.decision-step summary {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 8px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.decision-step summary::-webkit-details-marker {
  display: none;
}

.decision-step summary::after {
  content: "+";
  margin-left: auto;
  width: 18px;
  height: 18px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  color: #2f6b6b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  background: #f0e7cd;
}

.decision-step[open] summary::after {
  content: "-";
}

.decision-step-number {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #2f6b6b;
  color: #f4ecd6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 850;
}

.decision-step-label {
  min-width: 0;
}

.decision-step-body {
  padding: 0 10px 9px 35px;
  color: #28231c;
  font-size: 12px;
  line-height: 1.38;
}

.decision-step-body p {
  margin: 5px 0;
}

.decision-step-next {
  margin-top: 7px;
  padding: 6px 7px;
  border-left: 3px solid #2f6b6b;
  border-radius: 6px;
  background: #ece3c8;
  color: #2f6b6b;
  font-weight: 750;
}

.decision-step-alert .decision-step-number {
  background: #a8432f;
}

.decision-step-alert .decision-step-next {
  border-left-color: #a8432f;
  background: #f0d6c2;
  color: #7a3022;
}

.decision-step-caution .decision-step-number {
  background: #d98a3d;
}

.decision-step-caution .decision-step-next {
  border-left-color: #d98a3d;
  background: #f3e3c0;
  color: #a8651c;
}

.score-calculator-panel {
  position: fixed;
  right: max(18px, calc((100vw - 1260px) / 2 + 18px));
  bottom: 78px;
  z-index: 45;
  width: min(520px, calc(100vw - 32px));
  max-height: min(72vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 8px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f0e7cd;
  box-shadow: 0 16px 42px rgba(15, 61, 110, .18);
}

.score-calculator-inline {
  position: static;
  right: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  max-height: none;
  overflow: visible;
  margin: 10px 0 8px;
  box-shadow: none;
  background: #f0e7cd;
}

.score-calculator-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--blue-dark);
  font-size: 12.2px;
  font-weight: 850;
}

.score-calculator-close {
  border: 1px solid #e6d9b6;
  border-radius: 6px;
  background: #f4ecd6;
  color: var(--blue-dark);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  cursor: pointer;
}

.score-calculator-close:hover {
  background: #f0e7cd;
}

.score-calculator-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 6px;
}

.score-calculator-field {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: #28231c;
  font-size: 10.8px;
  font-weight: 760;
}

.score-calculator-field input,
.score-calculator-field select {
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #e6d9b6;
  border-radius: 6px;
  background: #f4ecd6;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.score-calculator-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 7px;
}

.score-calculator-submit {
  min-height: 28px;
  padding: 4px 12px;
  border: 1px solid #2f6b6b;
  border-radius: 6px;
  background: #2f6b6b;
  color: #f4ecd6;
  font: inherit;
  font-size: 11.4px;
  font-weight: 850;
  cursor: pointer;
}

.score-calculator-submit:hover {
  background: #2f6b6b;
}

.score-calculator-result {
  margin-top: 7px;
  padding: 7px 8px;
  border-radius: 6px;
  background: #f4ecd6;
  border: 1px solid #e6d9b6;
  color: #28231c;
  font-size: 11.8px;
  line-height: 1.32;
}

.score-calculator-result strong {
  display: block;
  margin-bottom: 2px;
  color: #28231c;
  font-size: 12.6px;
}

.score-calculator-result p {
  margin: 2px 0 0;
}

.clinical-route-panel {
  margin: 0;
  padding: 10px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f0e7cd;
}

.clinical-route-intro {
  display: grid;
  gap: 2px;
  margin-bottom: 10px;
  color: #28231c;
  font-size: 12.4px;
  line-height: 1.35;
}

.clinical-route-intro strong {
  color: var(--blue-dark);
  font-size: 13px;
}

.clinical-route-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.clinical-route-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #28231c;
  font-size: 11.2px;
  font-weight: 780;
}

.clinical-route-field input,
.clinical-route-field select,
.clinical-route-field textarea {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  background: #f4ecd6;
  color: var(--ink);
  font: inherit;
  font-weight: 720;
}

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

.clinical-route-text-field {
  grid-column: 1 / -1;
}

.clinical-route-drug-field {
  grid-column: 1 / -1;
}

.clinical-route-drug-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 6px;
  border: 1px solid #e6d9b6;
  border-radius: 8px;
  background: #f0e7cd;
}

.clinical-route-drug-suggestions[hidden] {
  display: none;
}

.clinical-route-drug-suggestions button {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  background: #f4ecd6;
  color: var(--blue-dark);
  font: inherit;
  font-size: 11.3px;
  font-weight: 780;
  cursor: pointer;
}

.clinical-route-drug-suggestions button:hover,
.clinical-route-drug-suggestions button.is-active {
  background: #f0e7cd;
  border-color: #5f968d;
}

.clinical-route-field textarea {
  min-height: 132px;
  line-height: 1.42;
  resize: vertical;
}

.clinical-route-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

.clinical-route-result {
  margin-top: 10px;
}

.clinical-route-empty,
.clinical-route-result-card {
  padding: 9px 10px;
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  background: #f4ecd6;
  color: #28231c;
  font-size: 12.2px;
  line-height: 1.38;
}

.clinical-route-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.clinical-route-title {
  display: block;
  color: #28231c;
  font-size: 13.4px;
}

.clinical-route-type-badge {
  flex: 0 0 auto;
  max-width: 48%;
  padding: 3px 7px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  background: #f0e7cd;
  color: #28231c;
  font-size: 10.8px;
  font-weight: 820;
  line-height: 1.15;
  text-align: center;
}

.clinical-route-result-card.clinical-route-critical {
  border-color: #c8765f;
  background: #f0d6c2;
}

.clinical-route-result-card.clinical-route-critical .clinical-route-title {
  color: #a8432f;
}

.clinical-route-result-card.clinical-route-alarm .clinical-route-type-badge {
  border-color: #c8765f;
  background: #f0d6c2;
  color: #a8432f;
}

.clinical-route-result-card.clinical-route-warning {
  border-color: #e0b066;
  background: #f3e3c0;
}

.clinical-route-result-card.clinical-route-warning .clinical-route-title {
  color: #a8651c;
}

.clinical-route-result-card.clinical-route-calculation .clinical-route-type-badge {
  border-color: #5f968d;
  background: #ece3c8;
  color: #2f6b6b;
}

.clinical-route-result-card.clinical-route-decision .clinical-route-type-badge {
  border-color: #e6d9b6;
  background: #f0e7cd;
  color: #2f6b6b;
}

.clinical-route-result-card.clinical-route-drug .clinical-route-type-badge {
  border-color: #e6d9b6;
  background: #f0e7cd;
  color: #2f6b6b;
}

.clinical-route-result-card.clinical-route-guide .clinical-route-type-badge {
  border-color: #e6d9b6;
  background: #f0e7cd;
  color: #2f6b6b;
}

.clinical-route-result-card p {
  margin: 3px 0 0;
}

.clinical-route-alert {
  margin-top: 7px !important;
  padding: 7px 9px;
  border-left: 3px solid #a8432f;
  border-radius: 6px;
  background: #f0d6c2;
  color: #a8432f;
  font-weight: 820;
}

.clinical-route-block {
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #f0e7cd;
}

.clinical-route-block h4 {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12.4px;
}

.clinical-route-block ul {
  margin: 0;
  padding-left: 18px;
}

.clinical-route-block li {
  margin-bottom: 4px;
}

.clinical-route-compact ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 0;
  list-style: none;
}

.clinical-route-compact li {
  margin: 0;
  padding: 2px 7px;
  border: 1px solid #e6d9b6;
  border-radius: 999px;
  background: #f0e7cd;
  color: #28231c;
  font-size: 11.2px;
}

.clinical-route-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.clinical-route-button {
  min-height: 24px;
}

.clinical-route-footnote {
  margin-top: 8px !important;
  color: #2f6b6b;
  font-size: 11.4px;
}

.clinical-route-followup {
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px solid #f0e7cd;
}

.clinical-route-followup .clinical-route-field textarea {
  min-height: 58px;
}

.clinical-route-followup .clinical-route-actions {
  margin-top: 0;
}

.emergency-consult-card {
  margin-top: 8px;
  border-color: #e6d9b6;
  background: #f0e7cd;
}

.emergency-consult-card > summary {
  background: #f0e7cd;
}

.emergency-consult-body {
  display: grid;
  gap: 9px;
}

.emergency-consult-form {
  grid-template-columns: 1fr;
}

.emergency-consult-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 8px;
}

.emergency-consult-grid .clinical-route-field textarea {
  min-height: 72px;
}

.emergency-consult-grid .clinical-route-field:first-child,
.emergency-consult-grid .clinical-route-field:nth-child(2),
.emergency-consult-grid .clinical-route-field:last-child {
  grid-column: 1 / -1;
}

.emergency-consult-result {
  background: #f4ecd6;
}

.emergency-consult-output {
  width: 100%;
  min-height: 270px;
  padding: 8px 9px;
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  background: #f0e7cd;
  color: #28231c;
  font: 720 12.2px/1.45 Inter, "Segoe UI", Arial, sans-serif;
  resize: vertical;
  white-space: pre-wrap;
}

.emergency-consult-actions {
  margin-top: 7px;
}

.score-visual {
  margin: 9px 0 4px;
  padding: 8px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f0e7cd;
}

.score-visual-title {
  margin-bottom: 7px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 850;
}

.prague-stage {
  display: grid;
  grid-template-columns: minmax(120px, 190px) 1fr;
  gap: 10px;
  align-items: center;
}

.prague-tube {
  position: relative;
  height: 160px;
  border: 2px solid #cdba90;
  border-radius: 32px 32px 16px 16px;
  background: linear-gradient(180deg, #f4ecd6 0 20%, #f0e7cd 20% 100%);
  overflow: hidden;
}

.prague-tube::before {
  content: "Özofagus";
  position: absolute;
  top: 6px;
  left: 10px;
  color: #2f6b6b;
  font-size: 10px;
  font-weight: 750;
}

.prague-column {
  position: absolute;
  bottom: 16px;
  background: rgba(245, 158, 11, .68);
  border: 1px solid rgba(180, 83, 9, .4);
}

.prague-c {
  left: 16%;
  width: 68%;
  height: 42px;
  border-radius: 18px 18px 5px 5px;
}

.prague-m {
  left: 58%;
  width: 17%;
  height: 95px;
  border-radius: 999px 999px 4px 4px;
}

.prague-line {
  position: absolute;
  left: 8px;
  right: 8px;
  border-top: 1px dashed #2f6b6b;
}

.prague-line span {
  position: absolute;
  right: 0;
  top: -10px;
  padding: 1px 4px;
  border-radius: 5px;
  background: #f4ecd6;
  color: #28231c;
  font-size: 9.5px;
  font-weight: 750;
}

.prague-m-line { bottom: 111px; }
.prague-c-line { bottom: 58px; }
.prague-gej-line {
  bottom: 16px;
  border-top-color: #a8432f;
}

.prague-gej-line span {
  color: #a8432f;
}

.prague-note {
  color: #28231c;
  font-size: 12px;
  line-height: 1.45;
}

.hill-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.hill-panel {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 7px 5px;
  border: 1px solid #e6d9b6;
  border-radius: 7px;
  background: #f4ecd6;
  text-align: center;
  color: #28231c;
  font-size: 10.5px;
  line-height: 1.2;
}

.hill-panel strong {
  color: var(--blue-dark);
  font-size: 11px;
}

.hill-shape {
  position: relative;
  width: 56px;
  height: 48px;
  border: 2px solid #cdba90;
  border-radius: 52% 52% 38% 38%;
  background: linear-gradient(180deg, #f4ecd6, #f0e7cd);
}

.hill-lumen {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #28231c;
}

.hill-fold {
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 12px;
  height: 7px;
  border-radius: 999px;
  background: #d98a3d;
}

.hill-grade-2 .hill-fold {
  left: 12px;
  right: 12px;
  height: 5px;
}

.hill-grade-3 .hill-fold {
  left: 9px;
  right: 9px;
  height: 3px;
  opacity: .78;
}

.hill-grade-3 .hill-lumen {
  width: 16px;
  height: 13px;
}

.hill-grade-4 .hill-fold {
  left: 20px;
  right: 20px;
  height: 3px;
  opacity: .45;
}

.hill-grade-4 .hill-lumen {
  width: 24px;
  height: 16px;
}

.section-line-lead {
  display: inline;
  max-width: 100%;
  margin: 0 4px 0 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
  color: var(--blue-dark);
  font-size: 1em;
  font-weight: 650;
  line-height: inherit;
  vertical-align: baseline;
}

.warning-line .section-line-lead {
  background: transparent;
  border-color: transparent;
  color: var(--danger);
}

.warning-line {
  list-style: none;
  margin: 7px 0 7px -17px;
  padding: 5px 8px;
  border-left: 3px solid var(--danger);
  border-radius: 6px;
  background: #f0d6c2;
  color: var(--danger);
  font-weight: 650;
}

.guidance-line {
  list-style: none;
  margin: 7px 0 7px -17px;
  padding: 5px 8px;
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  background: #f0e7cd;
  color: var(--blue-dark);
  font-weight: 650;
}

button.abbr-term {
  display: inline;
  position: relative;
  min-height: 0;
  margin: 0 1px;
  padding: 0 2px;
  border: 0;
  border-bottom: 1px dotted currentColor;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  vertical-align: baseline;
  cursor: pointer;
}

button.abbr-term:hover,
button.abbr-term:focus-visible {
  background: #f0e7cd;
  color: var(--blue-dark);
  border-bottom-color: transparent;
}

.abbr-popover {
  display: none;
}

.abbr-floating-popover {
  position: fixed;
  z-index: 2000;
  top: 0;
  left: 0;
  width: max-content;
  max-width: min(340px, 72vw);
  padding: 5px 7px;
  border: 1px solid #e6d9b6;
  border-radius: 6px;
  background: #f4ecd6;
  box-shadow: 0 8px 20px rgba(15, 23, 42, .14);
  color: #28231c;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translate3d(0, 0, 0);
  transition: opacity .08s ease;
}

.abbr-floating-popover.visible,
.abbr-floating-popover.measuring {
  opacity: 1;
  visibility: visible;
}

.abbr-floating-popover.measuring {
  pointer-events: none;
}

.med-term {
  display: inline;
  margin: 0 1px;
  padding: 0 3px;
  border-bottom: 1px solid #5f968d;
  border-radius: 5px;
  background: #ece3c8;
  color: #2f6b6b;
  font-weight: 700;
  vertical-align: baseline;
}

.section-source,
.section-abbreviations {
  margin-top: 8px;
  padding: 7px 9px;
  border: 1px solid #e6d9b6;
  border-radius: var(--radius);
  background: #f0e7cd;
}

.section-abbreviations {
  background: #f0e7cd;
  border-color: #e6d9b6;
}

.section-abbreviations-focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}

.section-source h4,
.section-abbreviations h4 {
  margin: 0 0 5px;
  color: var(--blue-dark);
  font-size: 12px;
}

.section-source ul,
.section-abbreviations ul {
  padding-left: 16px;
}

.section-abbreviations ul {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.section-source li,
.section-abbreviations li {
  font-size: 12px;
}

.section-source-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid #f0e7cd;
  color: #2f6b6b;
  font-size: 11.5px;
  line-height: 1.35;
}

.section-source-library-button {
  min-height: 26px;
  padding: 3px 8px;
  border-color: #e6d9b6;
  border-radius: 999px;
  color: var(--blue-dark);
  font-size: 11.3px;
  font-weight: 800;
}

.section-source-library-button:hover {
  background: #f0e7cd;
}

.section-abbreviations li {
  flex: 1 1 240px;
  max-width: 100%;
  line-height: 1.35;
}

.section-abbreviations strong {
  color: var(--blue-dark);
}

.print-section-target {
  display: none;
}

.emergency-panel,
.roadmap,
.roadmap-panel {
  margin-top: 8px;
  padding: 9px;
}

.roadmap,
.roadmap-panel {
  display: none;
}

.compact-field {
  width: min(300px, 100%);
  margin-bottom: 0;
}

.compact-content {
  min-height: 190px;
}

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

.roadmap article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
  background: #f0e7cd;
}

.roadmap h3,
.roadmap-panel h3 {
  margin: 0 0 4px;
  font-size: 12.5px;
  color: var(--blue-dark);
}

.roadmap p,
.roadmap-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 920px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .workspace.disease-entry {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .workspace.disease-entry .sidebar,
  .workspace.disease-entry .reader {
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .sidebar {
    position: static;
  }

  .diagnosis-list {
    max-height: 230px;
  }

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

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

  .entry-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    position: static;
    max-height: none;
    overflow: visible;
  }

  .reader-toolbar {
    position: static;
    top: auto;
    z-index: auto;
  }

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

  .emergency-consult-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 10px;
    gap: 8px;
  }

  .app-brand {
    align-items: center;
    gap: 9px;
  }

  .app-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .app-header h1 {
    font-size: 20px;
  }

  .app-header p {
    font-size: 12px;
  }

  .app-shell,
  .shell {
    width: min(100% - 16px, 1260px);
    margin-top: 8px;
  }

  .reader-toolbar {
    flex-direction: column;
    gap: 5px;
  }

  .workspace.card-actions-entry .reader-toolbar h2,
  .workspace.disease-entry .reader-toolbar h2 {
    grid-template-columns: 1fr;
    font-size: 16px;
  }

  .workspace.emergency-entry.card-actions-entry .reader-toolbar h2 {
    grid-template-columns: 1fr;
    font-size: 17px;
  }

  .emergency-inline-select {
    width: 100%;
  }

  .searchable-picker-control,
  .searchable-picker-input,
  .searchable-picker-option {
    min-height: 44px;
  }

  .searchable-picker-panel {
    max-height: min(64vh, 520px);
  }

  .searchable-picker-list {
    max-height: min(52vh, 420px);
  }

  .toolbar-actions,
  .toolbar-actions button {
    width: auto;
  }

  .toolbar-actions {
    align-self: stretch;
  }

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

  .content {
    min-height: 320px;
    padding: 7px;
  }

  .entry-card {
    min-height: 48px;
    padding: 7px 10px;
  }

  .entry-card span {
    font-size: 11.8px;
  }

  .entry-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
    overflow: visible;
  }

  .diagnosis-item,
  .section-card summary,
  button {
    font-size: 11.8px;
  }

  .section-actions {
    gap: 2px;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .section-action {
    min-height: 21px;
    padding: 2px 5px;
    font-size: 10px;
  }

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

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

  .clinical-route-actions {
    justify-content: stretch;
  }

  .clinical-route-actions button {
    flex: 1;
  }

  .section-body {
    font-size: 12.4px;
  }

  .section-body li.section-table-line {
    margin-left: -14px;
    margin-right: 0;
  }

  .section-table-wrap {
    overflow-x: visible;
    border: 0;
    background: transparent;
  }

  .section-table {
    display: block;
    min-width: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: transparent;
  }

  .section-table thead {
    display: none;
  }

  .section-table tbody,
  .section-table tr,
  .section-table td {
    display: block;
    width: 100%;
  }

  .section-table tr {
    margin: 0 0 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #f4ecd6;
    overflow: hidden;
  }

  .section-table td {
    padding: 6px 8px 7px;
    border-bottom: 1px solid #f0e7cd;
    font-size: 12.1px;
  }

  .section-table td:last-child {
    border-bottom: 0;
  }

  .section-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--blue-dark);
    font-size: 10.4px;
    font-weight: 850;
    line-height: 1.2;
  }

  .prague-stage,
  .hill-grid {
    grid-template-columns: 1fr;
  }

  .prague-tube {
    max-width: 210px;
    margin: 0 auto;
  }

  .hill-panel {
    grid-template-columns: 64px 1fr;
    justify-items: start;
    text-align: left;
  }

  .hill-panel span {
    grid-column: 2;
  }
}

@media (max-width: 720px) {
  .annotation-toggle {
    right: 12px;
    bottom: 12px;
  }

  .annotation-toolbar {
    left: 8px;
    right: 8px;
    bottom: 58px;
    max-width: none;
    flex-wrap: wrap;
    justify-content: center;
    transform: none;
  }
}

@media print {
  .app-header,
  .notice,
  .notice-panel,
  .entry-panel,
  .sidebar,
  .tabs,
  .toolbar-actions,
  .emergency-panel,
  .roadmap,
  .roadmap-panel,
  .annotation-toggle,
  .annotation-layer,
  .annotation-toolbar {
    display: none !important;
  }

  .app-shell,
  .shell {
    width: 100%;
    margin: 0;
  }

  .workspace {
    display: block;
  }

  .reader,
  .content,
  .section-card {
    border: 0;
    padding: 0;
  }

  body.section-print-mode .shell {
    display: none !important;
  }

  body.section-print-mode .print-section-target {
    display: block !important;
    padding: 0;
    color: #28231c;
    font-family: Arial, sans-serif;
  }

  body.section-print-mode .print-section-target h1 {
    margin: 0 0 8px;
    font-size: 18px;
  }

  body.section-print-mode .print-section-target h2 {
    margin: 0 0 10px;
    font-size: 15px;
  }

  body.section-print-mode .print-section-target li {
    margin-bottom: 6px;
    line-height: 1.4;
  }
}
