/* Persistent clinical report sheet, extending the user's monochrome instrument. */
.app-shell[data-theme="robotic"] { --canonical-topbar: 62px; --canonical-rack: 138px; min-height: 620px; grid-template-rows: 54px 62px 138px minmax(0, 1fr) 26px; }
.instrument-masthead { padding-inline: 18px; }
.instrument-identity { gap: 18px; }
.instrument-preview { font-size: 10px; }
.signal-orb { width: 32px; height: 32px; }
.all-pending-button { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; padding: 7px 12px; min-height: 34px; border: 1px solid var(--frame-line); border-radius: 3px; color: var(--frame-ink); background: transparent; font: 12px var(--ui-font); }
.all-pending-button span { color: var(--signal); font-family: var(--mono-font); }
.all-pending-button:hover { background: #292929; border-color: #626262; }
.all-pending-button:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.app-shell[data-theme="robotic"] .workflow-toolbar { height: 62px; min-height: 62px; padding: 6px 18px; gap: 14px; }
.app-shell[data-theme="robotic"] .workflow-control { height: 46px; padding-block: 3px; }
.app-shell[data-theme="robotic"] .template-workspace { padding: 0 12px 10px; }
.clinical-sheet-band { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(190px, 1.1fr) minmax(0, 4fr); height: 128px; background: var(--surface-soft); border-radius: 3px; overflow: hidden; }
.sheet-context-cell { min-width: 0; border-right: 1px solid var(--module-seam); }
.sheet-cell-heading { height: 34px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; gap: 4px; border-bottom: 1px solid var(--line); }
.sheet-cell-heading h3 { margin: 0; color: var(--ink); font: 600 11px/1.3 var(--mono-font); }
.sheet-cell-heading button { padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: 2px; background: transparent; color: var(--ink-soft); font: 10px var(--ui-font); }
.sheet-cell-heading button[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.sheet-context-cell input, .sheet-context-cell textarea { display: block; width: 100%; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 12px/1.6 var(--ui-font); padding: 8px 12px; }
.sheet-context-cell input { font-weight: 600; }
.sheet-context-cell textarea { height: 94px; min-height: 0; resize: none; }
.sheet-context-cell input::placeholder, .sheet-context-cell textarea::placeholder { color: var(--ink-faint); opacity: 1; font-weight: 400; }
.sheet-context-cell input:focus-visible, .sheet-context-cell textarea:focus-visible, .sheet-cell-heading button:focus-visible { outline: 1px solid var(--focus); outline-offset: -3px; }
#sheet-patient-meta { font: 10px/1.6 var(--mono-font); color: var(--ink-soft); margin: 0; padding: 0 12px; overflow-wrap: anywhere; max-height: 53px; overflow: auto; }
.app-shell[data-theme="robotic"] .clinical-sheet-band .module-rack.case-notes-rack { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: 128px; height: 128px; border-radius: 0; overflow: hidden; }
.app-shell[data-theme="robotic"] .clinical-sheet-band .case-note-panel { grid-column: auto; grid-row: auto; height: 128px; border-radius: 0; }
.app-shell[data-theme="robotic"] .clinical-sheet-band .case-note-panel .module-heading { height: 34px; min-height: 34px; padding-inline: 12px; }
.app-shell[data-theme="robotic"] .clinical-sheet-band .case-note-panel .module-heading h3 { font-size: 10px; line-height: 1.25; }
.app-shell[data-theme="robotic"] .clinical-sheet-band .case-note-input { height: 94px; padding: 8px 12px; font-size: 12px; line-height: 1.6; }
.app-shell[data-theme="robotic"] .workspace { margin-inline: 12px; gap: 10px; }
.app-shell[data-theme="robotic"] .source-pane { grid-template-rows: 42px minmax(0, 1fr) auto; }
.app-shell[data-theme="robotic"] .result-pane { grid-template-rows: 42px 34px minmax(0, 1fr); }
.app-shell[data-theme="robotic"] .pane-heading { height: 42px; min-height: 42px; padding-inline: 16px; }
.app-shell[data-theme="robotic"] .document-toolbar { height: 34px; min-height: 34px; padding-block: 2px; }
.app-shell[data-theme="robotic"] .source-canvas { padding: 14px 16px; gap: 8px; }
.app-shell[data-theme="robotic"] .document-scroll { padding: 0; }
.app-shell[data-theme="robotic"] .document-canvas { max-width: none; padding: 20px 24px 40px; }
.app-shell[data-theme="robotic"] .run-dock { padding: 12px 16px; }
.app-shell[data-theme="robotic"][data-view="settings"] .clinical-sheet-band { display: block; height: auto; overflow: visible; }
.app-shell[data-theme="robotic"][data-view="settings"] .sheet-context-cell { display: none; }
.app-shell[data-theme="robotic"][data-view="settings"] .template-workspace { padding: 24px; }
.app-shell[data-theme="robotic"][data-view="settings"] .all-pending-button { display: none; }
.report-sheet-view[hidden], .sheet-file-dialog [hidden] { display: none !important; }
.app-shell[data-sheet-view="open"] { display: none !important; }
.report-sheet-view { min-height: 100dvh; padding: 26px 24px; background: var(--surface-soft); color: var(--ink); font-family: var(--ui-font); }
.sheet-page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line-strong); }
.sheet-page-header h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.sheet-page-header p { margin: 6px 0 0; color: var(--ink-soft); font-size: 13px; }
.report-sheet-view button, .sheet-file-dialog button { min-height: 36px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: 3px; background: var(--surface); color: var(--ink); font: 12px var(--ui-font); }
.report-sheet-view button:not(:disabled):hover, .sheet-file-dialog button:not(:disabled):hover { background: #e7e7e7; }
.report-sheet-view .sheet-primary-action, .sheet-file-dialog .sheet-primary-action { background: var(--signal); border-color: var(--teal-dark); color: #202020; }
.report-sheet-view button:disabled { opacity: .5; cursor: default; }
.report-sheet-view :focus-visible, .sheet-file-dialog :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sheet-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 8px; }
.sheet-filters, .sheet-file-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet-filters button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.sheet-storage-line { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.sheet-storage-line p { margin: 0; font-size: 11px; color: var(--ink-soft); }
.sheet-table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); }
.sheet-table { width: 100%; min-width: 1080px; border-collapse: collapse; table-layout: fixed; background: var(--surface); }
.sheet-table th { text-align: left; padding: 12px; font: 600 11px/1.4 var(--mono-font); vertical-align: middle; background: #e9e9e9; }
.sheet-table th, .sheet-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line-strong); }
.sheet-table th:first-child { width: 18%; }
.sheet-table th:nth-child(2) { width: 22%; }
.sheet-table td { padding: 10px; vertical-align: top; }
.sheet-table tr:last-child td { border-bottom: 0; }
.sheet-cell-input { display: block; width: 100%; min-width: 0; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--ink); padding: 4px; font: 12px/1.6 var(--ui-font); }
.sheet-cell-input:hover { border-color: var(--line); }
.sheet-cell-input:focus { border-color: var(--focus); background: var(--teal-wash); }
textarea.sheet-cell-input { height: 150px; resize: vertical; min-height: 100px; }
.sheet-cell-input::placeholder { color: var(--ink-faint); }
.sheet-identity-field { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; }
.sheet-identity-field span { font: 10px var(--mono-font); color: var(--ink-soft); }
.sheet-patient-cell .sheet-case-state { min-height: 29px; margin-top: 8px; font-size: 11px; }
.sheet-empty { padding: 64px 20px; text-align: center; border-block: 1px solid var(--line); }
.sheet-empty h2 { margin: 0 0 12px; font-size: 18px; font-weight: 500; }
.sheet-empty p { max-width: 58ch; margin: auto; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.sheet-bottom-note { margin-top: 18px; font-size: 11px; color: var(--ink-soft); }
.sheet-file-dialog { width: min(470px, calc(100vw - 28px)); padding: 26px; border: 0; border-radius: 6px; background: var(--surface-soft); color: var(--ink); box-shadow: 0 18px 60px #11111133; }
.sheet-file-dialog::backdrop { background: #111111b8; }
.sheet-file-dialog h2 { font-size: 24px; margin: 0 0 10px; font-weight: 500; }
.sheet-file-dialog p { font-size: 12px; line-height: 1.7; }
.sheet-file-dialog label { display: grid; gap: 6px; margin-top: 16px; font-size: 12px; }
.sheet-file-dialog input { width: 100%; min-height: 38px; border: 1px solid var(--line-strong); padding: 8px; background: var(--surface); color: var(--ink); }
.sheet-password-hint { color: var(--ink-soft); }
#sheet-file-message { min-height: 20px; }
.sheet-file-buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.print-pending-sheet { display: none; }
@media (min-width: 901px) and (max-width: 1180px) {
  .app-shell[data-theme="robotic"] { height: 100dvh; display: grid; min-height: 700px; overflow: hidden; grid-template-rows: 54px 96px 138px minmax(0, 1fr) 26px; }
  .app-shell[data-theme="robotic"] .workflow-toolbar { height: 96px; grid-template-columns: 1fr 1.3fr; gap: 4px 12px; }
  .app-shell[data-theme="robotic"] .utility-actions { padding-top: 0; border: 0; }
  .app-shell[data-theme="robotic"] .workspace { min-height: 0; }
  .clinical-sheet-band { grid-template-columns: 160px 175px minmax(0, 1fr); }
  .sheet-cell-heading, .app-shell[data-theme="robotic"] .clinical-sheet-band .case-note-panel .module-heading { padding-inline: 8px; }
}
@media (max-width: 900px) {
  .app-shell[data-theme="robotic"] { height: auto; display: flex; min-height: 100dvh; }
  .instrument-masthead { min-height: 54px; gap: 10px; padding-inline: 12px; flex-wrap: wrap; }
  .instrument-preview { display: none; }
  .medhx-wordmark { width: 125px; height: 25px; }
  .all-pending-button { gap: 8px; font-size: 11px; padding-inline: 9px; min-height: 38px; }
  .app-shell[data-theme="robotic"] .workflow-toolbar { height: auto; padding: 8px 12px; gap: 8px; }
  .app-shell[data-theme="robotic"] .template-workspace { height: auto; max-height: none; min-height: 0; padding: 0 12px 10px; overflow-x: auto; }
  .clinical-sheet-band { grid-template-columns: 190px 210px 720px; min-width: 1120px; height: 128px; }
  .app-shell[data-theme="robotic"] .clinical-sheet-band .module-rack { grid-auto-flow: initial; grid-auto-columns: auto; }
  .app-shell[data-theme="robotic"] .document-canvas { padding: 18px 18px 32px; }
  .app-shell[data-theme="robotic"] .source-pane { height: 460px; }
  .app-shell[data-theme="robotic"] .result-pane { height: 650px; min-height: 0; }
  .app-shell[data-theme="robotic"][data-view="settings"] .clinical-sheet-band { min-width: 0; }
  .report-sheet-view { padding: 18px 12px; }
  .sheet-page-header { align-items: flex-start; gap: 10px; }
  .sheet-page-header h1 { font-size: 18px; }
  .sheet-page-header button { max-width: 118px; }
  .sheet-controls { align-items: flex-start; flex-direction: column; }
  .sheet-file-actions button { min-height: 40px; padding-inline: 10px; }
}
@media print {
  body[data-print-mode="pending"] { height: auto; overflow: visible; }
  .report-sheet-view, .sheet-file-dialog { display: none !important; }
  body[data-print-mode="pending"] .print-report { display: none !important; }
  body[data-print-mode="pending"] .print-pending-sheet { display: block; font: 9pt/1.4 Arial, sans-serif; color: #000; background: #fff; page: pending-sheet; }
  @page pending-sheet { size: landscape; margin: .4in; }
  .sheet-print-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 1px solid #222; padding-bottom: 8pt; margin-bottom: 12pt; }
  .sheet-print-heading h1 { font-size: 15pt; margin: 0; }
  .sheet-print-heading p { margin: 0; font-size: 8pt; }
  .sheet-print-table { width: 100%; table-layout: fixed; border-collapse: collapse; }
  .sheet-print-table th, .sheet-print-table td { border: 1px solid #777; text-align: left; vertical-align: top; padding: 6pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  .sheet-print-table th { font-size: 8pt; }
  .sheet-print-table th:first-child { width: 17%; }
  .sheet-print-table th:nth-child(2) { width: 23%; }
  .sheet-print-table thead { display: table-header-group; }
  .sheet-print-table tr { break-inside: avoid; }
  .sheet-print-table td { min-height: 50pt; }
}
