:root {
  --ink: #202a35;
  --ink-2: #35414e;
  --muted: #66717e;
  --primary: #245b78;
  --primary-hover: #1c4961;
  --nav: #202b35;
  --nav-line: #3b4854;
  --paper: #ffffff;
  --bg: #eef1f4;
  --subtle: #f5f7f9;
  --line: #cfd6dd;
  --line-strong: #b6c0c9;
  --ok: #26734d;
  --ok-bg: #eaf4ee;
  --warn: #8a5b08;
  --warn-bg: #fbf2dc;
  --bad: #a53b38;
  --bad-bg: #f8e9e8;
  --ai: #59627a;
  --ai-bg: #f1f2f6;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { color-scheme: light; background: var(--bg); }
body {
  min-width: 0;
  margin: 0;
  overflow-wrap: break-word;
  background: var(--bg);
  color: var(--ink);
  font: 13.5px/1.38 -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
a { color: var(--primary); }
h1 { margin: 0 0 7px; font-size: 25px; line-height: 1.16; letter-spacing: -.015em; font-weight: 680; }
h2 { margin: 0 0 8px; font-size: 17px; line-height: 1.22; font-weight: 680; }
h3 { margin: 0 0 6px; font-size: 14px; line-height: 1.28; font-weight: 700; }
p { margin: 5px 0 9px; }
small { font-size: 12px; }

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 48px;
  display: flex;
  align-items: stretch;
  gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid #172029;
  color: #fff;
  background: var(--nav);
}
.brand-lockup { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.brand-lockup > span { padding-left: 8px; border-left: 1px solid #62707d; color: #9dabb8; font-size: 9px; letter-spacing: .16em; }
.brand { color: #fff; text-decoration: none; font-size: 15px; font-weight: 760; letter-spacing: .045em; }
.app-nav { min-width: 0; display: flex; align-items: stretch; gap: 0; flex: 1 1 auto; }
.app-nav a {
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-bottom: 2px solid transparent;
  color: #cbd3da;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
}
.app-nav a:hover, .app-nav a:focus-visible { color: #fff; border-bottom-color: #8eafc1; background: #ffffff08; }
.account-nav { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.account-nav form { margin: 0; }
.account-nav .user { max-width: 165px; overflow: hidden; color: #d6dde3; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.app-header button.quiet, .app-header .button.quiet { border-color: #596774; color: #e5eaee; background: transparent; }
.app-header button.quiet:hover { background: #ffffff0d; }
.mobile-menu { display: none; }
.pwa-install { display: none; }
.install-action { color: #b8c3cc !important; font-size: 11.5px !important; }
.mobile-upload-toggle { display: none; }
.mobile-nav-account { display: none; }
.radiologist-queue-list { display: grid; gap: 7px; }
.radiologist-queue-card { display: grid; gap: 4px; min-width: 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper); text-decoration: none; }
.radiologist-queue-card:hover, .radiologist-queue-card:focus-visible { border-color: var(--primary); box-shadow: 0 1px 3px #0001; }
.radiologist-queue-card.radiologist-urgent { border-left: 4px solid var(--bad); }
.radiologist-card-primary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.radiologist-card-primary strong { font-size: 16px; }
.radiologist-card-secondary { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.radiologist-tabs { margin-bottom: 8px; }
.radiologist-tabs a.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--subtle); }
.radiologist-clinical-header .clinical-primary { font-size: 16px; font-weight: 650; }
.radiologist-context-nav { position: sticky; top: 48px; z-index: 6; display: flex; justify-content: space-between; gap: 10px; margin: -4px 0 8px; padding: 6px 0; background: var(--bg); }
.radiologist-context-nav a { min-height: 36px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: none; }
.radiologist-report-fields { display: grid; gap: 4px; margin: 4px 0 8px; }
.radiologist-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.radiologist-field-head label { margin: 0; }
.radiologist-mic { min-height: 36px; padding: 5px 8px; }
.radiologist-voice-state { margin: 2px 0 3px; }
.patient-identity-reveal { display: grid; gap: 5px; padding: 0 9px 8px; }
.patient-identity-button { justify-self: start; min-height: 32px; }
.patient-identity-result { padding: 6px 8px; border: 1px solid var(--line); background: var(--subtle); font-size: 12px; }
.radiologist-ai .actions { margin-top: 7px; }
.radiologist-proposal pre { min-height: 100px; margin: 0 0 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; white-space: pre-wrap; }
.laborant-tabs { display: flex; gap: 4px; margin: 0 0 8px; border-bottom: 1px solid var(--line); }
.laborant-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-weight: 700; }
.laborant-tabs a.active { color: var(--primary); border-bottom: 3px solid var(--primary); background: var(--subtle); }
.laborant-tabs span, .section-count { display: inline-block; min-width: 1.5em; padding: 1px 5px; border-radius: 10px; background: var(--line); text-align: center; font-size: 11px; }
.laborant-study-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 7px; }
.laborant-study-card, .laborant-journal-entry { display: block; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: var(--paper); text-decoration: none; }
.laborant-study-card:hover, .laborant-journal-entry:hover { border-color: var(--primary); box-shadow: 0 1px 3px #0001; }
.study-card-top, .study-card-bottom { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.study-card-top { justify-content: flex-start; margin-bottom: 4px; }
.study-card-patient { display: block; margin-bottom: 3px; }
.study-card-meta, .journal-workflow { color: var(--muted); font-size: 12px; }
.study-card-bottom { margin-top: 7px; font-size: 11px; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0; }
.laborant-context-nav { position: sticky; top: 48px; z-index: 5; display: flex; justify-content: space-between; gap: 10px; margin: -4px 0 8px; padding: 6px 0; background: var(--bg); }
.laborant-context-nav a { min-height: 32px; display: inline-flex; align-items: center; font-weight: 700; text-decoration: none; }
.laborant-summary h1 { margin: 0; font-size: 20px; }
.laborant-summary > strong { display: block; margin: 5px 0 2px; font-size: 16px; }
.laborant-journal-list { display: grid; gap: 7px; }
.laborant-journal-entry > strong { display: block; margin: 3px 0; }
.journal-workflow { margin-top: 6px; font-size: 11px; }
.laborant-report-header { display: grid; gap: 3px; margin-bottom: 18px; color: var(--muted); }
.laborant-report-header strong { color: var(--ink); font-size: 18px; }
.laborant-report h1 { font-size: 23px; }
.report-result { margin: 0 0 18px; white-space: pre-wrap; font-size: 16px; line-height: 1.6; }
.desktop-only { display: inline-flex; }

.mobile-viewer-page {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  background: #111820;
}
.mobile-viewer-bar {
  z-index: 2;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(6px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 6px max(10px, env(safe-area-inset-left));
  border-bottom: 1px solid #3b4854;
  color: #e5eaee;
  background: var(--nav);
  font-size: 12px;
}
.mobile-viewer-bar a { color: #fff; font-weight: 700; text-decoration: none; }
.mobile-viewer-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-stone-frame { width: 100%; height: 100%; border: 0; background: #000; }

main { width: 100%; max-width: 1540px; margin: 12px auto; padding: 0 16px 30px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 9px; }
.page-head > .actions { margin: 0; }
.page-subtitle { margin: 0; color: var(--muted); font-size: 13px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.section-head h2, .section-head p { margin-bottom: 0; }
.eyebrow { display: block; margin-bottom: 3px; color: var(--muted); font-size: 9.5px; font-weight: 760; letter-spacing: .13em; }
.back-link { display: inline-block; margin-bottom: 5px; color: var(--muted); text-decoration: none; font-size: 12px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.card {
  min-width: 0;
  margin: 0 0 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: none;
}
.card.compact { padding: 9px 11px; }
.card.flat { box-shadow: none; }
.narrow { max-width: 520px; margin: 28px auto; }
.muted, small { color: var(--muted); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }

.health-strip, .metric-strip {
  display: grid;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.health-strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.health-item, .metric-item { min-width: 0; padding: 8px 10px; border-right: 1px solid var(--line); }
.health-item:last-child, .metric-item:last-child { border-right: 0; }
.health-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.health-value { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; font-weight: 720; }
.health-item small { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.metric-item { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 10px; }
.metric-item > span { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.metric { grid-row: span 2; margin: 0; color: var(--ink); font-size: 21px; line-height: 1; font-weight: 720; }
.metric-item small { align-self: start; }
.dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #82909c; }
.dot.ok { background: var(--ok); }
.dot.warn { background: #bd7a0b; }
.dot.bad { background: var(--bad); }
.toolbar-panel { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toolbar-panel .section-head { margin: 0; }
.toolbar-panel .actions { margin: 0; }

.test-badge, .urgent, .status, .section-count {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 6px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 10.5px;
  line-height: 1.2;
  font-weight: 760;
  letter-spacing: .025em;
  white-space: nowrap;
}
.test-badge { margin-left: 5px; border-color: #c7c1d8; color: #5c5271; background: #f1eff6; }
.urgent { border-color: #a53b38; color: #fff; background: #a53b38; }
.status { border-color: #d6dce2; color: #485563; background: #f1f3f5; }
.status.ok { border-color: #bfd7c8; color: var(--ok); background: var(--ok-bg); }
.status.warn { border-color: #e2cf9f; color: var(--warn); background: var(--warn-bg); }
.status.bad { border-color: #dfb9b6; color: var(--bad); background: var(--bad-bg); }
.section-count { min-width: 22px; justify-content: center; color: var(--muted); background: var(--subtle); border-color: var(--line); }
.urgent-card, .row-urgent { box-shadow: inset 3px 0 0 var(--bad); }
.row-urgent td:first-child { padding-left: 12px; }

button, .button {
  min-height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  color: #fff;
  background: var(--primary);
  font: inherit;
  font-size: 12.5px;
  font-weight: 660;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
button.secondary, .button.secondary { border-color: #566b79; background: #566b79; }
button.secondary:hover, .button.secondary:hover { border-color: #425764; background: #425764; }
button.quiet, .button.quiet { border-color: var(--line-strong); color: var(--ink-2); background: #fff; }
button.quiet:hover, .button.quiet:hover { border-color: #8f9aa4; background: var(--subtle); }
button.danger, .button.danger { border-color: var(--bad); background: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
.icon-help { min-width: 25px; min-height: 25px; padding: 1px 7px; }
form.inline { display: inline-flex; margin: 0; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.secondary-actions { margin-bottom: 0; padding-top: 3px; border-top: 1px solid var(--line); }
.urgency-control { display: grid; gap: 4px; max-width: 320px; margin: 6px 0 8px; }
.urgency-control > span { color: var(--muted); font-size: 11px; font-weight: 650; }
.urgency-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.urgency-buttons button { min-width: 0; }
.urgency-buttons button.selected { box-shadow: 0 0 0 2px var(--primary); }
.urgency-buttons button.urgent.selected { box-shadow: 0 0 0 2px var(--bad); }

label { display: block; margin: 7px 0 3px; color: var(--ink-2); font-size: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid #6d91a633; border-color: #66879a; }
textarea { min-height: 110px; resize: vertical; }
.report-area { min-height: 175px; line-height: 1.45; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.template-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; align-items: end; margin-bottom: 7px; }
.template-toolbar label { grid-column: 1 / -1; margin-top: 0; }
.template-toolbar button { white-space: nowrap; }
.flash, .file-state {
  margin: 7px 0;
  padding: 7px 9px;
  border: 1px solid #dfca94;
  border-radius: var(--radius);
  color: #604d21;
  background: #fcf6e8;
  font-size: 12.5px;
}
.flash.error { border-color: #dfb9b6; color: var(--bad); background: var(--bad-bg); }
.flash.success { border-color: #bfd7c8; color: var(--ok); background: var(--ok-bg); }

.notice-strip, .telegram-line {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 8px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.notice-strip > div:first-child { min-width: 0; display: flex; align-items: baseline; gap: 8px; flex: 1; }
.notice-strip span { color: var(--muted); font-size: 12px; }
.notice-strip .actions, .telegram-line .actions { margin: 0 0 0 auto; }
.telegram-line { width: 100%; }
.telegram-line > .muted { margin-right: auto; font-size: 12px; }
.telegram-line form { margin-left: auto; }

.tabs { display: flex; gap: 0; overflow-x: auto; margin: 0 0 8px; border-bottom: 1px solid var(--line-strong); }
.tabs a {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  background: transparent;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.tabs a:hover, .tabs a:focus-visible { border-bottom-color: var(--primary); color: var(--primary); background: #ffffff80; }
.tabs a span { min-width: 19px; padding: 1px 5px; border-radius: 2px; color: var(--muted); background: #dfe4e8; text-align: center; font-size: 10px; }

.table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 12.8px; }
th, td { height: 36px; padding: 6px 8px; border-bottom: 1px solid #dfe4e8; text-align: left; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7f9fa; }
th { color: #5b6773; background: #f2f4f6; font-size: 10.5px; font-weight: 720; letter-spacing: .045em; text-transform: uppercase; }
td > .button, td > button { min-height: 28px; padding: 3px 8px; }
.table-actions { white-space: nowrap; }
.queue-section { padding: 9px 10px 10px; }
.queue-section + .queue-section { margin-top: 8px; }
.queue-table th:first-child { width: 160px; }
.queue-table th:nth-child(2) { width: 132px; }
.queue-table th:nth-child(4) { width: 90px; }
.queue-table th:nth-child(5) { width: 150px; }
.queue-table th:nth-child(6) { width: 55px; }
.queue-table th:last-child { width: 74px; }
.empty-state { padding: 12px !important; color: var(--muted); text-align: center; }

.upload-panel { display: grid; grid-template-columns: minmax(230px, .65fr) minmax(420px, 1.35fr); gap: 18px; align-items: end; }
.upload-copy p { margin-bottom: 0; }
.upload-form { display: grid; grid-template-columns: minmax(240px, 1fr) auto; gap: 5px 7px; align-items: end; }
.upload-form label { grid-column: 1 / -1; margin: 0; }
.upload-form .file-state { grid-column: 1; margin: 0; min-height: 31px; display: flex; align-items: center; }
.upload-form > button { grid-column: 2; grid-row: 2 / 4; align-self: stretch; }

.meta { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-bottom: 0; }
.meta div { min-width: 0; padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #fff; }
.meta div:nth-child(3n) { border-right: 0; }
.meta strong { color: var(--muted); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .025em; }
.meta small { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; }
.technical { padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--subtle); font: 11.5px/1.42 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.voice-panel { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 3px 0; }
.voice-state { color: var(--muted); font-size: 11.5px; font-weight: 650; }
.experimental { margin: 2px 0 5px; color: #75623c; font-size: 11px; }

.ai-panel { border-color: #cdd0d9; background: #fbfbfc; }
.ai-warning { padding: 7px 8px; border-left: 2px solid #8d829d; color: #555065; background: var(--ai-bg); font-size: 12px; }
.assistant-panel { border-top: 2px solid #747d93; }
.third-opinion-panel { border-top: 2px solid #697187; }
.preliminary-ai { max-width: 900px; }
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.comparison pre { min-height: 100px; margin: 0; padding: 7px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font: inherit; white-space: pre-wrap; }
.readonly-ai { user-select: none; -webkit-user-select: none; }
.integration-result { margin: 7px 0; padding: 8px; border: 1px solid var(--line); background: #fff; }
.integration-details { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 7px; }
.integration-details summary { color: var(--primary); cursor: pointer; font-size: 12px; font-weight: 650; }
.integration-details form { margin-top: 7px; }

.workstation-head { margin-bottom: 6px; }
.workstation-head h1 { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.workstation-tabs { display: none; }
.workstation-shell { display: grid; grid-template-columns: 205px minmax(380px, 1fr) minmax(390px, .9fr); gap: 8px; align-items: start; }
.worklist-panel { position: sticky; top: 56px; max-height: calc(100vh - 70px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.worklist-title { position: sticky; z-index: 1; top: 0; display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid var(--line); background: #f2f4f6; font-size: 11.5px; }
.worklist-title a { font-weight: 650; text-decoration: none; }
.worklist-item { display: block; padding: 7px 8px; border-bottom: 1px solid #e2e6e9; color: var(--ink); text-decoration: none; }
.worklist-item:last-child { border-bottom: 0; }
.worklist-item:hover { background: #f4f7f8; }
.worklist-item.current { box-shadow: inset 3px 0 0 var(--primary); background: #edf3f6; }
.worklist-item.urgent-item { border-left: 3px solid var(--bad); padding-left: 5px; }
.worklist-item.urgent-item.current { border-left: 0; box-shadow: inset 3px 0 0 var(--bad); }
.worklist-item > span:first-child { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.worklist-item small, .worklist-meta { display: block; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.viewer-column, .report-column { min-width: 0; }
.viewer-panel { padding: 10px; }
.viewer-launch { min-height: 108px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 4px 0 8px; padding: 16px; color: #e8edf0; background: #26313b; }
.viewer-launch > div { display: grid; gap: 3px; }
.viewer-launch strong { font-size: 16px; font-weight: 650; }
.viewer-launch span { color: #aeb9c2; font-size: 11.5px; }
.viewer-launch form { margin: 0; }
.viewer-launch button { border-color: #8ba9ba; background: #315f77; white-space: nowrap; }
.report-column .card:last-child, .viewer-column .card:last-child { margin-bottom: 0; }
.report-editor h2 { padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.report-editor > form > label { margin-top: 8px; }

.help-list { columns: 2; column-gap: 26px; }
.help-list section { break-inside: avoid; margin: 0 0 12px; }

.preview-banner {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 6px 9px;
  border: 1px solid #b68b3a;
  border-radius: var(--radius);
  background: #fff7df;
  color: #4f411f;
}
.preview-banner span { color: #6c5a2d; font-size: 12px; }
.preview-banner form { margin-left: auto; }
.search-bar { display: grid; grid-template-columns: minmax(260px, 520px) auto auto; gap: 5px; align-items: end; margin: 0 0 8px; }
.search-bar label { grid-column: 1 / -1; margin: 0; }
.identity-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 9px; }
.identity-grid label { margin: 0; }
.identity-grid .wide { grid-column: 1 / -1; }
.identity-grid textarea { min-height: 72px; }
.source-note { display: block; margin-top: 2px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
.check-line { display: flex; align-items: center; gap: 7px; }
.check-line input { width: auto; min-height: auto; margin: 0; }
.viewer-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.viewer-state { max-width: 230px; color: #d4dde3; font-size: 11px; }
.viewer-help { border-color: #71818c; color: #dce5ea; background: transparent; }
.viewer-help:hover { color: #fff; background: #35444f; }
.voice-panel label { margin: 0; font-size: 11px; }
.voice-panel select { width: auto; min-width: 120px; }
.mode-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  background: var(--paper);
  font-size: 12px;
}
.mode-summary.warn { border-left-color: var(--warn); }
.mode-summary span { color: var(--muted); }
.source-guidance {
  margin: 4px 0 8px;
  padding: 7px 9px;
  border-left: 3px solid #758491;
  background: var(--subtle);
  color: var(--ink-2);
  font-size: 12px;
}
.identity-editor .form-row { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.laborant-identity-card h2 { margin: 0 0 8px; }
.laborant-identity-primary { display: grid; gap: 2px; }
.laborant-identity-primary > label { margin-top: 5px; }
.laborant-extra-fields { margin-top: 8px; padding: 0 8px 6px; border: 1px solid var(--line); background: var(--subtle); }
.laborant-extra-fields summary { padding: 7px 0; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 650; }
.laborant-extra-fields label { margin: 5px 0 2px; }
.laborant-extra-fields textarea { min-height: 72px; }
.laborant-identity-actions { display: grid; grid-template-columns: 1fr; margin-top: 10px; }
.laborant-identity-actions button:first-child { width: 100%; }
.laborant-identity-actions button.quiet { justify-self: start; }
.clinical-header {
  margin-bottom: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--primary);
  background: var(--paper);
  color: var(--ink-2);
  font-size: 12.5px;
}
.clinical-header > div + div { margin-top: 3px; }
.clinical-primary { color: var(--ink); font-size: 13.5px; }
.patient-details, .history-panel {
  margin: 0 0 6px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.patient-details summary {
  padding: 6px 9px;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 650;
}
.patient-details-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 0 9px 8px;
  font-size: 12px;
}
.history-panel { padding: 8px 9px; }
.history-panel h2 { font-size: 14px; }
.history-panel .table-wrap { margin-top: 5px; }
.history-panel td:last-child { white-space: nowrap; }
.clinical-metadata { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1180px) {
  .health-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-item:nth-child(3) { border-right: 0; }
  .health-item:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .workstation-shell { grid-template-columns: 190px minmax(0, 1fr); }
  .report-column { grid-column: 2; }
}

@media (max-width: 820px) {
  .app-nav a { padding: 0 7px; font-size: 12px; }
  .account-nav .user { display: none; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-item:nth-child(2) { border-right: 0; }
  .metric-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .upload-panel { grid-template-columns: 1fr; gap: 8px; }
  .workstation-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .clinical-metadata { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .patient-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta div:nth-child(3n) { border-right: 1px solid var(--line); }
  .meta div:nth-child(2n) { border-right: 0; }
}

@media (max-width: 700px) {
  body { font-size: 14px; }
  h1 { font-size: 21px; }
  h2 { font-size: 16px; }
  .app-header { position: sticky; min-height: 50px; padding: 0 10px; flex-wrap: wrap; align-items: center; gap: 8px; }
  .brand-lockup > span { display: none; }
  .mobile-menu { min-width: 42px; min-height: 42px; display: inline-flex; margin-left: auto; font-size: 18px; }
  .app-nav { display: none; order: 4; width: calc(100% + 20px); margin: 0 -10px; padding: 3px 8px 7px; border-top: 1px solid var(--nav-line); flex-direction: column; align-items: stretch; }
  .app-nav.open { display: flex; }
  .app-nav a { min-height: 42px; padding: 0 8px; border-bottom: 0; }
  .account-nav { display: none; }
  .mobile-nav-account { display: block; padding: 5px 8px 0; border-top: 1px solid var(--nav-line); }
  .mobile-nav-account button { width: 100%; min-height: 44px; }
  main { margin: 8px auto; padding: 0 8px 24px; }
  .page-head { align-items: center; }
  .page-head > .button { flex: 0 0 auto; }
  .page-subtitle { font-size: 12px; }
  .grid, .two, .form-row, .comparison { grid-template-columns: 1fr; }
  .health-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-item, .health-item:nth-child(3) { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .health-item:nth-child(2n) { border-right: 0; }
  .health-item:nth-last-child(-n+2) { border-bottom: 0; }
  .metric-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .toolbar-panel { display: block; }
  .toolbar-panel .section-head { margin-bottom: 5px; }
  .card { padding: 9px; }
  button, .button, input, select { min-height: 42px; }
  button, .button { padding: 7px 10px; }
  .icon-help { min-width: 42px; min-height: 42px; }
  form.inline { display: flex; width: 100%; }
  form.inline > button { width: 100%; }
  .actions { align-items: stretch; }
  .actions > .button, .actions > button { flex: 1 1 145px; }
  .notice-strip { align-items: flex-start; }
  .notice-strip > div:first-child { display: grid; gap: 1px; }
  .notice-strip .actions { flex: 0 0 auto; }
  .notice-strip .actions .button, .notice-strip .actions button { min-height: 36px; }
  .notice-strip .actions form { display: none; }
  .telegram-line { min-height: 34px; flex-wrap: nowrap; gap: 6px; padding: 4px 7px; }
  .telegram-line > .muted { display: none; }
  .telegram-line form { width: auto; margin-left: auto; }
  .telegram-line form button { min-height: 32px; padding: 4px 8px; }
  .laborant-dashboard { display: flex; flex-direction: column; }
  .laborant-dashboard .page-head { order: 1; }
  .laborant-tabs { margin-top: 2px; }
  .laborant-tabs a { flex: 1; padding: 8px 4px; text-align: center; }
  .laborant-study-grid { grid-template-columns: 1fr; gap: 6px; }
  .laborant-study-card, .laborant-journal-entry { min-height: 44px; padding: 9px; }
  .laborant-context-nav { top: 50px; margin-top: -8px; }
  .laborant-dashboard .page-head h1 { font-size: 0; margin: 0; }
  .laborant-dashboard .page-head h1::after { content: 'Очереди'; font-size: 21px; }
  .laborant-dashboard .page-subtitle, .laborant-dashboard .page-head > .button { display: none; }
  .laborant-dashboard .search-bar label { display: none; }
  .desktop-only { display: none !important; }
  .mode-summary { align-items: flex-start; flex-direction: column; gap: 2px; }
  .clinical-header { padding: 8px; }
  .clinical-primary { line-height: 1.55; }
  .history-panel .section-head { align-items: flex-start; flex-direction: column; gap: 2px; }
  .preview-banner { align-items: flex-start; flex-wrap: wrap; }
  .preview-banner form { width: 100%; margin-left: 0; }
  .preview-banner button { width: 100%; }
  .search-bar { grid-template-columns: minmax(0, 1fr) auto; }
  .search-bar label { grid-column: 1 / -1; }
  .search-bar .button { min-height: 42px; }
  .identity-grid { grid-template-columns: 1fr; }
  .identity-grid .wide { grid-column: 1; }
  .laborant-identity-card { padding: 9px; }
  .laborant-identity-primary .laborant-birth-age { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .laborant-extra-fields { padding: 0 7px 5px; }
  .laborant-extra-fields label { margin-top: 4px; }
  .urgency-buttons button { min-height: 44px; }
  .laborant-identity-actions { flex-direction: column; }
  .laborant-identity-actions button, .laborant-identity-actions button:first-child, .laborant-identity-actions button.quiet { width: 100%; flex: 1 1 auto; }
  .tabs a { min-height: 40px; padding: 6px 9px; }
  .upload-form { grid-template-columns: 1fr; }
  .upload-form label, .upload-form .file-state, .upload-form > button { grid-column: 1; grid-row: auto; }
  .table-wrap { border: 0; overflow: visible; }
  table.mobile-cards thead { display: none; }
  table.mobile-cards, table.mobile-cards tbody, table.mobile-cards tr, table.mobile-cards td { display: block; width: 100%; }
  table.mobile-cards tr { margin-bottom: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
  table.mobile-cards tr.row-urgent { padding-left: 10px; }
  table.mobile-cards td { min-height: 0; height: auto; padding: 3px 0; border: 0; }
  table.mobile-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 11px; font-weight: 650; }
  table.mobile-cards td:last-child { padding-top: 6px; }
  table.mobile-cards td:last-child .button { width: 100%; min-height: 40px; }
  .history-panel table.mobile-cards td:last-child { display: grid; gap: 4px; }
  .history-panel .table-wrap { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
  .queue-section { padding: 8px; }
  .radiologist-context-nav { top: 50px; margin-top: -8px; }
  .radiologist-queue { padding: 8px; }
  .radiologist-tabs { display: flex; gap: 2px; }
  .radiologist-tabs a { flex: 1 1 0; min-height: 44px; padding: 7px 3px; text-align: center; }
  .radiologist-card-primary { align-items: flex-start; flex-direction: column; gap: 1px; }
  .radiologist-field-head { flex-direction: row; }
  .radiologist-mic { width: 100%; min-height: 44px; }
  .radiologist-ai .actions button { width: 100%; min-height: 44px; }
  .report-editor form > .actions { flex-direction: column; }
  .report-editor form > .actions button[type='submit'] { width: 100%; min-height: 48px; }
  .radiologist-ai .radiologist-proposal pre { min-height: 120px; }
  .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-area { min-height: 170px; }
  .workstation-tabs { display: flex; }
  .workstation-shell { display: flex; flex-direction: column; }
  .worklist-panel { position: static; width: 100%; max-height: 205px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-y: auto; }
  .worklist-title { grid-column: 1 / -1; }
  .worklist-item { min-width: 0; border-right: 1px solid #e2e6e9; }
  .viewer-column, .report-column { width: 100%; }
  .report-column { order: 2; }
  .viewer-column { order: 1; }
  .viewer-launch { min-height: 0; align-items: stretch; flex-direction: column; padding: 12px; }
  .viewer-launch button { width: 100%; min-height: 44px; }
  .viewer-actions { width: 100%; align-items: stretch; flex-direction: column; }
  .viewer-actions .button { width: 100%; }
  .viewer-state { max-width: none; }
  .help-list { columns: 1; }
}

@media (max-width: 430px) {
  .health-strip { grid-template-columns: 1fr; }
  .health-item, .health-item:nth-child(2n), .health-item:nth-last-child(-n+2) { border-right: 0; border-bottom: 1px solid var(--line); }
  .health-item:last-child { border-bottom: 0; }
  .metric-strip { grid-template-columns: 1fr 1fr; }
  .metric-item { padding: 7px 8px; }
  .metric-item > span { font-size: 11px; }
  .worklist-panel { grid-template-columns: 1fr; max-height: 190px; }
  .worklist-title { grid-column: 1; }
  .meta { grid-template-columns: 1fr; }
  .clinical-metadata, .patient-details-grid { grid-template-columns: 1fr; }
  .meta div, .meta div:nth-child(2n), .meta div:nth-child(3n) { border-right: 0; }
  .page-head .button.quiet { min-width: 42px; overflow: hidden; font-size: 0; }
  .page-head .button.quiet::after { content: "?"; font-size: 15px; }
  .radiologist-tabs a { font-size: 12px; padding-left: 1px; padding-right: 1px; }
  .radiologist-tabs span { padding-left: 3px; padding-right: 3px; }
  .radiologist-card-primary strong { font-size: 15px; }
  .radiologist-field-head { flex-wrap: wrap; }
  .radiologist-field-head label { flex: 1 1 90px; }
  .radiologist-mic { flex: 0 1 auto; }
}

@media print {
  body { color: #000; background: #fff; font-size: 10.5pt; }
  .app-header, .no-print, .readonly-ai, .worklist-panel, .workstation-tabs { display: none !important; }
  main { max-width: none; margin: 0; padding: 0; }
  .card { padding: 0; border: 0; box-shadow: none; }
  .workstation-shell { display: block; }
  button, .button { display: none !important; }
  .laborant-context-nav, .radiologist-context-nav, .laborant-report .actions, .radiologist-mic, .radiologist-ai, .radiologist-pagination, .patient-identity-reveal { display: none !important; }
}


/* Radiologist mobile v3 */
.radiologist-queue-picker { display: none; }
@media (max-width: 700px) {
  body:has(.radiologist-queue) .page-head { margin-bottom: 6px; }
  body:has(.radiologist-queue) .page-head h1 { font-size: 21px; }
  body:has(.radiologist-queue) .page-subtitle { display: none; }
  .radiologist-tabs { display: none !important; }
  .radiologist-queue-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 7px; }
  .radiologist-queue-picker label { margin: 0; font-weight: 700; }
  .radiologist-queue-picker select { min-height: 42px; }
  .radiologist-search { grid-template-columns: minmax(0, 1fr) auto; }
  .radiologist-search label { display: none; }
  .radiologist-queue { padding: 6px; }
  .radiologist-queue .section-head { display: none; }
  .radiologist-queue-list { gap: 5px; }
  .radiologist-queue-card { gap: 2px; padding: 9px 10px; }
  .radiologist-card-primary { flex-direction: row; align-items: baseline; }
  .radiologist-card-primary strong { font-size: 15px; }
  .radiologist-card-secondary { font-size: 11.5px; }

  .radiologist-context-nav { top: 50px; min-height: 44px; align-items: center; margin: -8px -1px 7px; padding: 5px 2px; border-bottom: 1px solid var(--line); }
  .radiologist-context-nav strong { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
  .radiologist-context-nav a { min-height: 40px; }
  .workstation-head, .workstation-tabs, .worklist-panel { display: none !important; }
  .workstation-shell { display: flex; flex-direction: column; gap: 6px; }
  .viewer-column, .report-column { width: 100%; }
  .viewer-column { order: 1; }
  .report-column { order: 2; }
  .clinical-header { margin-bottom: 5px; padding: 7px 8px; }
  .radiologist-clinical-header .clinical-primary { font-size: 14px; }
  .patient-details, .history-panel { margin-bottom: 5px; }
  .history-empty { display: none !important; }
  .patient-details summary { min-height: 40px; display: flex; align-items: center; }
  .history-panel { padding: 7px 8px; }

  .viewer-panel { padding: 7px; }
  .viewer-panel > h2, .viewer-panel .eyebrow, .viewer-panel .viewer-state { display: none; }
  .viewer-launch { min-height: 0; margin: 0; padding: 8px; background: transparent; }
  .viewer-launch > div { display: none; }
  .viewer-launch form { width: 100%; }
  .viewer-launch button, .viewer-launch .button { width: 100%; min-height: 50px; font-size: 15px; }
  .viewer-launch button::before, .viewer-launch .button::before { content: '🩻 '; }
  .viewer-actions { display: none; }

  .report-editor { padding: 8px; }
  .report-editor h2 { display: none; }
  .template-toolbar { margin-bottom: 4px; }
  .radiologist-field-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
  .radiologist-field-head label { margin: 0; font-size: 14px; }
  .radiologist-mic { width: 44px !important; min-width: 44px; min-height: 44px; padding: 0; border-radius: 50%; font-size: 20px; }
  .radiologist-mic.recording { width: auto !important; min-width: 150px; padding: 0 12px; border-radius: var(--radius); border-color: var(--bad); color: #fff; background: var(--bad); font-size: 13px; }
  .radiologist-mic.processing { width: auto !important; min-width: 150px; padding: 0 12px; border-radius: var(--radius); font-size: 13px; }
  .radiologist-voice-state { min-height: 34px; display: flex; align-items: center; margin: 4px 0 2px; padding: 6px 8px; border-radius: var(--radius); color: var(--muted); background: var(--subtle); font-size: 12px; }
  .radiologist-voice-state.recording { color: #fff; background: var(--bad); font-weight: 700; }
  .radiologist-voice-state.processing { color: var(--ink); background: var(--warn-bg); font-weight: 700; }
  .report-area { min-height: 145px; }

  .radiologist-ai-compact { padding: 8px; border-top-width: 1px; }
  .radiologist-ai-compact .section-head { display: none; }
  .radiologist-ai-compact > p:not(#openai-state) { display: none; }
  .radiologist-ai-compact .actions { margin: 0; }
  .radiologist-ai-compact #openai-suggest { width: 100%; min-height: 46px; }
  .radiologist-ai-compact #openai-state { margin: 5px 0 0; font-size: 12px; }
  .radiologist-ai-compact .radiologist-proposal pre { min-height: 90px; max-height: 240px; overflow-y: auto; }

  .radiologist-final-actions { margin-top: 7px; }
  .radiologist-manual-save { display: none !important; }
  .radiologist-final-actions button[type='submit'] { width: 100%; min-height: 50px; font-size: 14px; }

  .mobile-viewer-bar { min-height: 48px; flex: 0 0 auto; }
}


/* Radiologist mobile v4: one obvious workflow, no desktop workstation clutter. */
@media (max-width: 700px) {
  .radiologist-context-nav {
    position: sticky;
    top: 50px;
    z-index: 12;
    min-height: 46px;
    margin: -8px -8px 8px;
    padding: 3px 8px;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
  }
  .radiologist-context-nav a { min-height: 40px; font-size: 13px; }
  .radiologist-context-nav strong { font-size: 12px; }

  .radiologist-clinical-header { margin: 0 0 7px; padding: 8px 9px; }
  .radiologist-clinical-header .status { display: none; }
  .radiologist-clinical-header .clinical-primary { font-size: 14px; line-height: 1.42; }

  .mobile-primary-viewer {
    margin: 0 0 7px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
  }
  .mobile-primary-viewer .section-head,
  .mobile-primary-viewer .identity-summary,
  .mobile-primary-viewer .flash,
  .mobile-primary-viewer .secondary-actions,
  .mobile-primary-viewer .viewer-help,
  .mobile-primary-viewer .viewer-launch > div:first-child { display: none !important; }
  .mobile-primary-viewer .viewer-launch {
    margin: 0;
    padding: 0;
    background: transparent;
  }
  .mobile-primary-viewer .viewer-actions,
  .mobile-primary-viewer .viewer-launch form { width: 100%; }
  .mobile-primary-viewer .viewer-launch button,
  .mobile-primary-viewer .viewer-launch .button {
    width: 100%;
    min-height: 52px;
    max-height: 52px;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 15px;
    flex: 0 0 52px !important;
  }
  .mobile-primary-viewer .viewer-launch button::before,
  .mobile-primary-viewer .viewer-launch .button::before { content: '🩻 '; }

  .patient-details { margin-bottom: 6px; }
  .patient-details summary { min-height: 42px; padding: 7px 9px; }

  .history-panel { padding: 0; }
  .history-panel .section-head {
    min-height: 42px;
    margin: 0;
    padding: 7px 9px;
    cursor: pointer;
    flex-direction: row;
    align-items: center;
  }
  .history-panel .section-head::after { content: '▾'; margin-left: auto; color: var(--muted); }
  .history-panel.history-collapsed .section-head::after { content: '›'; }
  .history-panel.history-collapsed .table-wrap { display: none !important; }
  .history-panel .section-head .muted { display: none; }
  .history-panel h2 { margin: 0; font-size: 13px; }
  .history-panel .table-wrap { max-height: 310px; margin: 0 7px 7px; }
  .history-panel table.mobile-cards tr { padding: 7px 8px; }
  .history-panel table.mobile-cards td:last-child { grid-template-columns: 1fr 1fr; }
  .history-panel table.mobile-cards td:last-child .button:first-child { display: none; }
  .history-panel table.mobile-cards td:last-child .button { min-height: 40px; }

  .report-editor { margin: 0; padding: 8px 9px; }
  .template-toolbar { margin-bottom: 5px; }
  .template-toolbar select { min-height: 44px; }
  .radiologist-report-fields { gap: 5px; }
  .radiologist-field-head { margin-top: 5px; }
  .radiologist-field-head label { font-size: 15px; font-weight: 720; }
  .radiologist-mic {
    width: 46px !important;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    flex: 0 0 46px !important;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    color: var(--ink);
    background: #fff;
    font-size: 21px;
  }
  .radiologist-mic:hover { color: var(--ink); background: var(--subtle); }
  .radiologist-mic.voice-hidden { display: none !important; }
  .report-area { min-height: 145px; }

  .radiologist-voice-state {
    min-height: 0;
    display: grid;
    gap: 7px;
    margin: 7px 0 3px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--muted);
    background: var(--subtle);
    font-size: 12px;
  }
  .radiologist-voice-state.recording {
    border-color: #c94b47;
    color: #7a1e1c;
    background: #fff0ef;
  }
  .radiologist-voice-state.processing {
    border-color: #d8bd77;
    color: #604d21;
    background: var(--warn-bg);
  }
  .doctor-stop-recording {
    width: 100% !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    flex: 0 0 50px !important;
    opacity: 1 !important;
    border-color: #a52f2c !important;
    background: #b63a36 !important;
    color: #fff !important;
    font-size: 14px;
    font-weight: 760;
  }
  .doctor-stop-recording:disabled {
    opacity: 1 !important;
    border-color: #8d969e !important;
    background: #8d969e !important;
    color: #fff !important;
  }

  #autosave-state { margin: 4px 0 7px; font-size: 11.5px; }
  .radiologist-ai-compact { margin: 0 0 8px; padding: 0; border: 0; background: transparent; }
  .radiologist-ai-compact #openai-suggest {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
    flex: 0 0 48px !important;
  }

  .radiologist-final-actions {
    display: block !important;
    margin: 8px 0 0 !important;
  }
  .radiologist-manual-save { display: none !important; }
  .radiologist-final-actions button[type='submit'] {
    display: flex !important;
    width: 100% !important;
    height: 52px !important;
    min-height: 52px !important;
    max-height: 52px !important;
    flex: 0 0 52px !important;
    padding: 8px 12px !important;
    font-size: 15px;
  }
}


/* Radiologist mobile v4 final specificity fixes */
@media (max-width: 700px) {
  .mobile-primary-viewer .viewer-launch > .viewer-actions {
    display: flex !important;
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
  }
  .mobile-primary-viewer .viewer-launch > .viewer-actions form { display: block !important; width: 100% !important; }
  .mobile-primary-viewer .viewer-launch > .viewer-actions .viewer-help { display: none !important; }
}


/* Radiologist mobile v4.1 fixes */
@media (max-width: 700px) {
  .doctor-stop-recording[hidden] { display: none !important; }
  .radiologist-ai-compact .actions {
    display: block !important;
    width: 100% !important;
  }
  .radiologist-ai-compact #openai-suggest {
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    flex: none !important;
    white-space: normal;
  }
  .radiologist-ai-compact #openai-comparison .actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .radiologist-ai-compact #openai-comparison .actions button {
    width: 100% !important;
    min-height: 44px !important;
    flex: none !important;
  }
}


/* Radiologist mobile v4.3 queue buttons */
@media (max-width: 700px) {
  .radiologist-queue-picker {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    margin: 0 0 8px !important;
  }
  .radiologist-queue-picker a {
    min-width: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 4px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    color: var(--ink-2);
    background: #fff;
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
  }
  .radiologist-queue-picker a span {
    min-width: 20px;
    padding: 1px 5px;
    border-radius: 10px;
    color: var(--muted);
    background: var(--subtle);
    text-align: center;
    font-size: 11px;
  }
  .radiologist-queue-picker a.active {
    border-color: var(--primary);
    color: #fff;
    background: var(--primary);
  }
  .radiologist-queue-picker a.active span {
    color: var(--primary);
    background: #fff;
  }
}
