/* MedHx / robotic instrument. The user-requested 2026-09-07 visual world.
   The existing stylesheet owns component mechanics; this layer owns appearance.
   No remote fonts, effects libraries, clinical state, or provider dependencies. */
:root {
  --canvas: #e6e6e6;
  --surface: #fff;
  --surface-soft: #f4f4f4;
  --surface-muted: #eaeaea;
  --ink: #202020;
  --ink-soft: #626262;
  --ink-faint: #6c6c6c;
  --midnight: #111111;
  --navy: #1e1e1e;
  --navy-deep: #202020;
  --teal: #d7ff5f;
  --teal-dark: #3e5411;
  --teal-wash: #edf4db;
  --cyan: #c6efec;
  --cold-blue: #c6efec;
  --ice: #f1f1f1;
  --line: #d8d8d8;
  --line-strong: #bdbdbd;
  --module-seam: #cccccc;
  --module-seam-soft: #dedede;
  --edit-guide: #a9a9a9;
  --focus: #5c730e;
  --design-navy: #202020;
  --design-wash: #f4f4f4;
  --amber: #795315;
  --danger: #a33037;
  --danger-wash: #fff1f1;
  --signal: #d7ff5f;
  --frame-ink: #f3f3f3;
  --frame-muted: #ababab;
  --frame-line: #353535;
  --mono-font: "Cascadia Mono", "Consolas", monospace;
  --ui-font: "Segoe UI Variable", "Segoe UI", sans-serif;
  --document-font: "Segoe UI Variable", "Segoe UI", sans-serif;
  --canonical-topbar: 80px;
  --canonical-rack: 110px;
  --canonical-pane-heading: 58px;
  --canonical-editor-toolbar: 40px;
}
body { background: var(--midnight); }
::selection { color: var(--ink); background: var(--signal); }
button, input, select, textarea { accent-color: var(--teal-dark); }
button, select { touch-action: manipulation; }
.app-shell[data-theme="robotic"] {
  height: 100dvh;
  min-height: 720px;
  grid-template-rows: 76px var(--canonical-topbar) var(--canonical-rack) minmax(0, 1fr) 32px;
  background: var(--midnight);
  overflow: hidden;
}
.instrument-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 24px;
  color: var(--frame-ink);
  background: var(--midnight);
  border-bottom: 1px solid var(--frame-line);
}
.instrument-identity, .instrument-preview, .instrument-path {
  display: flex;
  align-items: center;
}
.instrument-identity { gap: 24px; }
.medhx-wordmark { display: block; width: 150px; height: 30px; }
.identity-divider { height: 24px; width: 1px; background: var(--frame-line); }
.instrument-caption { color: var(--frame-muted); font-size: 13px; }
.instrument-path { gap: 16px; margin-left: auto; margin-right: auto; color: var(--frame-muted); font: 11px/1 var(--mono-font); text-transform: uppercase; letter-spacing: .1em; }
.instrument-path svg { width: 60px; height: 12px; stroke: #666666; stroke-width: 1; }
.instrument-preview { gap: 16px; color: var(--frame-muted); font: 10px/1 var(--mono-font); text-transform: uppercase; letter-spacing: .06em; }
.signal-orb { width: 42px; height: 42px; color: var(--cyan); }
.signal-orbit { stroke-width: 2; stroke-dasharray: .1 4.1; transform-origin: 24px 24px; animation: signal-assemble 1.5s cubic-bezier(.16,1,.3,1) both; }
.signal-core { fill: var(--signal); stroke: none; }
@keyframes signal-assemble { from { transform: rotate(-30deg) scale(.85); opacity: .35; } to { transform: rotate(0) scale(1); opacity: 1; } }
.app-shell[data-theme="robotic"] .workflow-toolbar {
  display: grid;
  grid-template-columns: minmax(300px, .93fr) minmax(400px, 1.2fr) auto;
  gap: 22px;
  min-height: 80px;
  height: 80px;
  padding: 12px 28px;
  background: var(--midnight);
  border: 0;
}
.app-shell[data-theme="robotic"] .case-controls { grid-column: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.app-shell[data-theme="robotic"] .workflow-controls { grid-column: auto; grid-template-columns: minmax(140px, .72fr) minmax(240px, 1.28fr); gap: 0; }
.app-shell[data-theme="robotic"] .workflow-control--dob { grid-column: auto; }
.app-shell[data-theme="robotic"] .workflow-control {
  height: 50px;
  min-width: 0;
  padding: 5px 13px;
  border: 0;
  border-left: 1px solid var(--frame-line);
  border-radius: 0;
  background: transparent;
}
.app-shell[data-theme="robotic"] .workflow-control > span { color: var(--frame-muted); font: 10px/1.3 var(--mono-font); text-transform: uppercase; letter-spacing: .09em; }
.app-shell[data-theme="robotic"] .workflow-control input,
.app-shell[data-theme="robotic"] .workflow-control select {
  height: 28px;
  min-width: 0;
  padding: 2px 0;
  color: var(--frame-ink);
  background: var(--midnight);
  font: 13px/1.4 var(--ui-font);
  color-scheme: dark;
  border: 0;
}
.app-shell[data-theme="robotic"] .workflow-control input::placeholder { color: #a0a0a0; opacity: 1; }
.app-shell[data-theme="robotic"] .workflow-control:focus-within { border-left-color: var(--signal); box-shadow: none; }
.app-shell[data-theme="robotic"] .workflow-control :focus-visible { outline: 1px solid var(--signal); outline-offset: 3px; }
.app-shell[data-theme="robotic"] .workflow-status { display: none; }
.app-shell[data-theme="robotic"] .utility-actions { grid-column: auto; gap: 4px; }
.app-shell[data-theme="robotic"] .utility-actions button {
  width: 38px;
  height: 38px;
  padding: 9px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--frame-ink);
  background: transparent;
  transition: background .16s ease-out, border-color .16s ease-out;
}
.app-shell[data-theme="robotic"] .utility-actions .settings-action {
  min-width: 75px;
  width: auto;
  padding-inline: 13px;
  margin-right: 6px;
  border-color: var(--frame-line);
  font: 12px/1 var(--ui-font);
}
.app-shell[data-theme="robotic"] .utility-actions svg { width: 18px; height: 18px; stroke-width: 1.5; }
.app-shell[data-theme="robotic"] .utility-actions button:not(:disabled):hover { background: #292929; border-color: #626262; }
.app-shell[data-theme="robotic"] .utility-actions button:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
.app-shell[data-theme="robotic"] .utility-actions button:disabled { color: #797979; opacity: .65; }
.app-shell[data-theme="robotic"] .template-workspace {
  padding: 0 16px 14px;
  min-height: var(--canonical-rack);
  height: var(--canonical-rack);
  max-height: var(--canonical-rack);
  background: var(--midnight);
  border: 0;
  box-shadow: none;
}
.app-shell[data-theme="robotic"] .module-rack {
  height: 154px;
  padding: 0;
  gap: 0;
  border: 0;
  border-radius: 4px;
  background: var(--surface-soft);
  overflow: hidden;
}
.app-shell[data-theme="robotic"] .workspace-module {
  height: 154px;
  background: var(--surface-soft);
  border-right: 1px solid var(--module-seam);
}
.app-shell[data-theme="robotic"] .module-heading { height: 38px; min-height: 38px; padding: 0 16px; background: transparent; border-bottom: 1px solid var(--module-seam-soft); }
.app-shell[data-theme="robotic"] .module-heading h3 { font: 600 11px/1 var(--mono-font); letter-spacing: .07em; color: var(--ink); }
.app-shell[data-theme="robotic"] .module-heading::after { content: ""; width: 16px; height: 8px; background-image: radial-gradient(circle, #939393 1px, transparent 1.3px); background-size: 4px 4px; flex-shrink: 0; }
.case-notes-description { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.app-shell[data-theme="robotic"] .module-rack.case-notes-rack { height: 96px; }
.app-shell[data-theme="robotic"] .workspace-module.case-note-panel { height: 96px; }
.app-shell[data-theme="robotic"] .case-note-panel .module-heading { height: 34px; min-height: 34px; }
.app-shell[data-theme="robotic"] .case-note-panel .module-heading h3 { white-space: normal; overflow: visible; text-overflow: clip; text-transform: none; line-height: 1.35; letter-spacing: .015em; }
.app-shell[data-theme="robotic"] .case-note-input { display: block; width: 100%; height: 62px; min-height: 0; margin: 0; padding: 7px 16px; border: 0; border-radius: 0; resize: none; background: transparent; color: var(--ink); font: 12px/1.65 var(--ui-font); scrollbar-width: thin; scrollbar-color: #bfbfbf transparent; }
.app-shell[data-theme="robotic"] .case-note-input::placeholder { color: #6c6c6c; opacity: 1; }
.app-shell[data-theme="robotic"] .case-note-input:focus-visible { outline: 1px solid var(--focus); outline-offset: -5px; }
.app-shell[data-theme="robotic"] .module-unit-grid { height: 115px; min-height: 0; padding: 10px 12px; gap: 2px; grid-template-rows: repeat(5, minmax(0, 1fr)); background-color: transparent; }
.app-shell[data-theme="robotic"] .functional-unit { padding-inline: 0; color: #4e4e4e; font-family: var(--ui-font); font-size: 10.5px; background: transparent; }
.app-shell[data-theme="robotic"] .unit-checkmark { border-color: #8c8c8c; border-radius: 0; background: transparent; }
.app-shell[data-theme="robotic"] .unit-status-dot { border-color: #898989; background: #898989; }
.app-shell[data-theme="robotic"] .unit-line { border-color: #bfbfbf; }
.app-shell[data-theme="robotic"] .unit-label { color: inherit; }
.app-shell[data-theme="robotic"] .primitive-toggle { width: 9px; height: 9px; border: 1px solid #8c8c8c; border-radius: 0; background: transparent; box-shadow: none; }
.app-shell[data-theme="robotic"] .primitive-status-dot { background: #898989; border-color: #898989; box-shadow: none; width: 6px; height: 6px; }
.app-shell[data-theme="robotic"] .primitive-write-line,
.app-shell[data-theme="robotic"] .primitive-text-line { border-color: #c4c4c4; }
.app-shell[data-theme="robotic"] .unit-other,
.app-shell[data-theme="robotic"] .unit-line { background: transparent; }
.app-shell[data-theme="robotic"] .workspace {
  margin: 0 16px;
  min-height: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  background: transparent;
}
.app-shell[data-theme="robotic"] .source-pane,
.app-shell[data-theme="robotic"] .result-pane {
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--surface-soft);
}
.app-shell[data-theme="robotic"] .source-pane { grid-template-rows: 58px minmax(0, 1fr) auto; }
.app-shell[data-theme="robotic"] .result-pane { grid-template-rows: 58px 40px minmax(0, 1fr); }
.app-shell[data-theme="robotic"] .pane-heading { height: 58px; min-height: 58px; padding: 0 22px; flex-direction: row; align-items: center; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.app-shell[data-theme="robotic"] .pane-heading h2 { color: var(--ink); font: 600 15px/1.1 var(--ui-font); letter-spacing: -.015em; text-transform: none; }
.app-shell[data-theme="robotic"] .result-heading .review-state { display: inline-flex; color: var(--ink-soft); border: 1px solid #c0c0c0; border-radius: 3px; padding: 5px 7px; background: transparent; font: 9px/1 var(--mono-font); letter-spacing: .04em; }
.app-shell[data-theme="robotic"] .source-actions { gap: 2px; }
.app-shell[data-theme="robotic"] .source-actions button { width: 30px; height: 30px; padding: 6px; color: #8a8a8a; background: transparent; opacity: .7; }
.app-shell[data-theme="robotic"] .source-actions svg { width: 18px; height: 18px; stroke-width: 1.5; }
.app-shell[data-theme="robotic"] .source-canvas { min-height: 0; height: auto; display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 24px 22px 14px; background: var(--surface-soft); overflow: hidden; }
.app-shell[data-theme="robotic"] .source-canvas.is-dragover { background: #eef1e7; outline: 2px dashed #647d20; outline-offset: -8px; }
.app-shell[data-theme="robotic"] .source-local-label { color: #666; font: 9px/1.4 var(--mono-font); letter-spacing: .02em; }
.app-shell[data-theme="robotic"] .source-text-area { position: relative; flex: 1 1 0; min-height: 80px; }
.app-shell[data-theme="robotic"] .source-empty-hint { position: absolute; top: 39px; left: 4px; right: 4px; margin: 0; color: #666; font: 11px/1.65 var(--ui-font); pointer-events: none; }
.app-shell[data-theme="robotic"] .source-canvas[data-empty="false"] .source-empty-hint { display: none; }
.app-shell[data-theme="robotic"] .source-document::placeholder { color: #737373; opacity: 1; font: 400 23px/1.5 var(--ui-font); letter-spacing: -.03em; }
.app-shell[data-theme="robotic"] .source-upload-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; flex-shrink: 0; }
.app-shell[data-theme="robotic"] .source-upload-bar > span { color: #666; font: 9px/1.5 var(--mono-font); }
.app-shell[data-theme="robotic"] .source-upload-button { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 7px 10px; border: 1px solid #bbb; border-radius: 3px; background: transparent; color: var(--ink); font: 500 11px/1.4 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-upload-button:hover { border-color: #666; background: #e8e8e8; }
.app-shell[data-theme="robotic"] .source-upload-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.app-shell[data-theme="robotic"] .source-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0; min-height: 16px; }
.app-shell[data-theme="robotic"] .source-input-status { margin: 0; color: #666; font: 10px/1.5 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-input-status[data-error="true"] { color: #a33037; }
.app-shell[data-theme="robotic"] .source-cancel-button,
.app-shell[data-theme="robotic"] .source-attachment button { min-height: 30px; padding: 3px 6px; border: 1px solid #bbb; border-radius: 2px; background: transparent; color: #424242; font: 10px/1.4 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-cancel-button:hover,
.app-shell[data-theme="robotic"] .source-attachment button:hover { background: #e4e4e4; border-color: #666; }
.app-shell[data-theme="robotic"] .source-attachments { flex: 0 1 auto; max-height: 150px; min-height: 0; overflow: auto; scrollbar-width: thin; margin: 0; padding: 0; list-style: none; }
.app-shell[data-theme="robotic"] .source-attachment { padding: 9px 0; border-top: 1px solid var(--line); }
.app-shell[data-theme="robotic"] .source-attachment-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.app-shell[data-theme="robotic"] .source-attachment-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #333; font: 500 11px/1.5 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-attachment-size { flex-shrink: 0; color: #666; font: 9px/1.5 var(--mono-font); }
.app-shell[data-theme="robotic"] .source-attachment-actions { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.app-shell[data-theme="robotic"] .source-attachment-status { flex: 1; margin: 0; color: #666; font: 10px/1.5 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-attachment[data-state="failed"] .source-attachment-status { color: #a33037; }
.app-shell[data-theme="robotic"] .source-image-preview { margin-top: 5px; color: #555; font: 10px/1.5 var(--ui-font); }
.app-shell[data-theme="robotic"] .source-image-preview summary { cursor: pointer; min-height: 26px; padding-top: 4px; }
.app-shell[data-theme="robotic"] .source-image-preview img { display: block; width: 100%; max-height: 180px; margin-top: 6px; object-fit: contain; background: #e3e3e3; }
.app-shell[data-theme="robotic"] .source-document {
  min-height: 0;
  height: 100%;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  resize: none;
  color: #595959;
  background: transparent;
  font: 12px/1.85 var(--mono-font);
  scrollbar-width: thin;
  scrollbar-color: #bfbfbf transparent;
}
.app-shell[data-theme="robotic"] .source-document:focus-visible { outline: 1px solid var(--focus); outline-offset: 6px; }
.app-shell[data-theme="robotic"] .source-sheet { display: none; }
.app-shell[data-theme="robotic"] .run-dock { position: static; transform: none; min-height: 86px; padding: 15px 22px; margin: 0; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid var(--line); background: var(--surface-soft); }
.app-shell[data-theme="robotic"] .run-button { flex: 0 0 auto; width: 148px; min-width: 148px; height: 42px; padding: 0 15px; justify-content: space-between; gap: 14px; color: #21271a; border: 1px solid #b4ce67; border-radius: 3px; background: var(--signal); font: 600 12px/1 var(--ui-font); box-shadow: none; }
.app-shell[data-theme="robotic"] .run-button:not(:disabled):hover { background: #e1ff88; border-color: #7a8e3d; }
.app-shell[data-theme="robotic"] .run-button:disabled { background: #e0e0e0; border-color: #c7c7c7; color: #636363; }
.app-shell[data-theme="robotic"] .run-button svg { width: 20px; height: 20px; }
.generation-preview-note { max-width: 120px; margin: 0; color: var(--ink-soft); font: 10px/1.5 var(--mono-font); text-align: right; }
.app-shell[data-theme="robotic"] .processing-copy { display: none; }
.app-shell[data-theme="robotic"] .document-toolbar { height: 40px; min-height: 40px; padding: 4px 20px; gap: 4px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.app-shell[data-theme="robotic"] .document-toolbar button,
.app-shell[data-theme="robotic"] .document-toolbar select { height: 30px; min-height: 30px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--ink-soft); font: 11px/1 var(--ui-font); padding-inline: 9px; }
.app-shell[data-theme="robotic"] .document-toolbar label { font-size: 10px; }
.app-shell[data-theme="robotic"] .document-toolbar button[aria-pressed="true"] { color: var(--surface); background: var(--ink); }
.app-shell[data-theme="robotic"] .document-toolbar button:not(:disabled):hover { color: var(--ink); border-color: var(--line-strong); }
.app-shell[data-theme="robotic"] .document-toolbar button[aria-pressed="true"]:hover { color: var(--surface); }
.app-shell[data-theme="robotic"] .document-toolbar button:disabled { opacity: .5; }
.app-shell[data-theme="robotic"] .document-scroll { padding: 24px 32px 0; background: #e6e6e6; scrollbar-width: thin; scrollbar-color: #b0b0b0 #e6e6e6; }
.app-shell[data-theme="robotic"] .document-canvas { width: 100%; max-width: 860px; min-height: 100%; margin: 0 auto; padding: 36px 42px 64px; background: var(--surface); }
.app-shell[data-theme="robotic"] .document-canvas.is-freeform { display: flex; flex-direction: column; }
.app-shell[data-theme="robotic"] .document-canvas.is-freeform > .document-block { display: flex; flex: 1; }
.app-shell[data-theme="robotic"] .document-canvas.is-freeform .document-block-input { flex: 1; min-height: 300px; }
.app-shell[data-theme="robotic"] .document-block { padding: 2px 0; border-radius: 0; }
.app-shell[data-theme="robotic"] .document-block-state { display: none; }
.app-shell[data-theme="robotic"] .block-placeholder { background: transparent; }
.app-shell[data-theme="robotic"] .review-state::before { background: #929292; }
.app-shell[data-theme="robotic"] .block-heading { margin-top: 18px; padding-bottom: 6px; border-bottom-color: var(--line); }
.app-shell[data-theme="robotic"] .block-heading .document-block-input { color: var(--ink); font: 600 13px/1.4 var(--ui-font); letter-spacing: 0; }
.app-shell[data-theme="robotic"] .block-heading:first-child { margin: 0 0 10px; padding: 0 0 20px; border-bottom: 1px solid var(--ink); }
.app-shell[data-theme="robotic"] .block-heading:first-child .document-block-input { color: var(--ink); font: 500 clamp(18px, 1.55vw, 24px)/1.3 var(--ui-font); letter-spacing: -.025em; }
.app-shell[data-theme="robotic"] .block-paragraph .document-block-input,
.app-shell[data-theme="robotic"] .block-placeholder .document-block-input,
.app-shell[data-theme="robotic"] .block-bullet-list .document-block-input { color: var(--ink); font: 400 13px/1.7 var(--document-font); }
.app-shell[data-theme="robotic"] .block-placeholder .document-block-input { min-height: 32px; }
.app-shell[data-theme="robotic"] .document-block.is-bold .document-block-input { font-weight: 700; }
.app-shell[data-theme="robotic"] .document-block.is-italic .document-block-input { font-style: italic; }
.app-shell[data-theme="robotic"] .document-block[data-color="NAVY"] .document-block-input { color: #202020; }
.app-shell[data-theme="robotic"] .document-block[data-color="TEAL"] .document-block-input { color: #286659; }
.app-shell[data-theme="robotic"] .document-block[data-color="RED"] .document-block-input { color: #a33037; }
.app-shell[data-theme="robotic"] .document-block[data-color="MUTED"] .document-block-input { color: #686868; }
.app-shell[data-theme="robotic"] .document-block-input:focus-visible { outline: 1px solid var(--focus); outline-offset: 5px; }
.app-shell[data-theme="robotic"] .system-bar { display: flex; height: 32px; padding: 0 22px; background: var(--midnight); border: 0; color: var(--frame-muted); font: 9px/1.4 var(--mono-font); }
.app-shell[data-theme="robotic"] .system-bar p { color: inherit; font: inherit; }
.app-shell[data-theme="robotic"] .system-bar strong { color: var(--frame-ink); font-weight: 400; }
.app-shell[data-theme="robotic"] .system-disclosures { display: none; }
.app-shell[data-theme="robotic"] .utility-status { background: #262626; color: var(--frame-ink); border: 1px solid #535353; border-radius: 3px; box-shadow: 0 8px 24px #0002; }
.app-shell[data-theme="robotic"] .new-case-dialog { border: 0; border-radius: 6px; background: var(--surface-soft); box-shadow: 0 18px 60px #0004; }
.app-shell[data-theme="robotic"] .new-case-dialog::backdrop { background: #111111b8; }
.app-shell[data-theme="robotic"] .new-case-dialog form { padding: 30px; }
.app-shell[data-theme="robotic"] .new-case-dialog h2 { font-weight: 500; font-size: 24px; letter-spacing: -.025em; }
.app-shell[data-theme="robotic"] .new-case-dialog p { font-size: 13px; line-height: 1.7; }
.app-shell[data-theme="robotic"] .dialog-actions button { min-width: 76px; min-height: 40px; border-radius: 3px; background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); }
.app-shell[data-theme="robotic"] .dialog-actions .dialog-confirm-button { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.app-shell[data-theme="robotic"] .settings-panel { padding: 28px; background: var(--surface-soft); border-block: 1px solid var(--line-strong); }
.app-shell[data-theme="robotic"] .settings-panel-heading h1 { font-size: 24px; font-weight: 500; letter-spacing: -.025em; }
.app-shell[data-theme="robotic"] .settings-panel h2 { color: var(--ink); }
.app-shell[data-theme="robotic"] .settings-panel button { min-height: 36px; border-radius: 3px; }
.app-shell[data-theme="robotic"] .settings-done-button { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.app-shell[data-theme="robotic"] .layout-console,
.app-shell[data-theme="robotic"] .document-structure-controls { background: #e9e9e9; color: var(--ink); border-color: var(--line-strong); }
.app-shell[data-theme="robotic"] .layout-console { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "copy split" "selected selected" "units add" "reset reset"; }
.app-shell[data-theme="robotic"] .layout-console button,
.app-shell[data-theme="robotic"] .layout-console select,
.app-shell[data-theme="robotic"] .layout-console input,
.app-shell[data-theme="robotic"] .document-structure-controls button,
.app-shell[data-theme="robotic"] .document-structure-controls select { border-color: #acacac; border-radius: 2px; background: var(--surface); color: var(--ink); }
.app-shell[data-theme="robotic"] .layout-console-copy strong,
.app-shell[data-theme="robotic"] .selected-module-controls > strong,
.app-shell[data-theme="robotic"] .selected-unit-controls > strong,
.app-shell[data-theme="robotic"] .template-workspace-heading h1 { color: var(--ink); }
.app-shell[data-theme="robotic"] .split-controls button[aria-pressed="true"] { color: var(--surface); background: var(--ink); border-color: var(--ink); }
.app-shell[data-theme="robotic"] .template-workspace[data-mode="edit"] .workspace-module.is-selected { box-shadow: inset 0 0 0 1px #647d20; border-color: #647d20; }
.app-shell[data-theme="robotic"] .template-workspace[data-mode="edit"] .functional-unit.is-selected { box-shadow: inset 0 0 0 1px #647d20; border-color: #647d20; }
.app-shell[data-theme="robotic"] .template-workspace[data-mode="edit"] .module-heading { background: #e4e4e4; }
.app-shell[data-theme="robotic"] .template-workspace[data-mode="edit"] .module-unit-grid { background-image: linear-gradient(to right, #6e7c561c 1px, transparent 1px), linear-gradient(to bottom, #6e7c561c 1px, transparent 1px); }
.app-shell[data-theme="robotic"] .result-pane[data-mode="edit"] .document-block.is-selected { border-color: #647d20; background: #f3f7ea; }
.app-shell[data-theme="robotic"] .custom-subspecialty-editor { background: var(--midnight); border-color: var(--frame-line); }
.app-shell[data-theme="robotic"][data-view="settings"] { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: 76px 80px auto auto minmax(720px, auto) 32px; }
.app-shell[data-theme="robotic"][data-view="settings"] .template-workspace { height: auto; min-height: 440px; max-height: none; padding: 24px; background: var(--surface-soft); grid-template-rows: auto auto minmax(180px, 1fr) auto; overflow: visible; }
.app-shell[data-theme="robotic"][data-view="settings"] .workspace { padding-top: 16px; min-height: 720px; }
.app-shell[data-theme="robotic"][data-view="settings"] .result-pane { grid-template-rows: 58px 40px auto minmax(0, 1fr); }
.app-shell[data-theme="robotic"][data-view="settings"] .module-rack { overflow: visible; border-radius: 0; }
@media (max-width: 1180px) {
  .app-shell[data-theme="robotic"] { height: auto; min-height: 100dvh; overflow: visible; grid-template-rows: 70px auto var(--canonical-rack) minmax(650px, auto) 32px; }
  .instrument-masthead { padding-inline: 20px; }
  .instrument-path { display: none; }
  .app-shell[data-theme="robotic"] .workflow-toolbar { height: auto; min-height: 80px; padding: 10px 20px; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
  .app-shell[data-theme="robotic"] .utility-actions { grid-column: 1 / -1; justify-content: flex-end; border-top: 1px solid var(--frame-line); padding-top: 6px; }
  .app-shell[data-theme="robotic"] .workflow-controls { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); }
  .app-shell[data-theme="robotic"] .workspace { min-height: 650px; }
  .app-shell[data-theme="robotic"] .document-scroll { padding: 20px 18px 0; }
  .app-shell[data-theme="robotic"] .document-canvas { padding: 28px 28px 48px; }
  .app-shell[data-theme="robotic"] .run-dock { padding: 14px; flex-wrap: wrap; }
  .generation-preview-note { max-width: none; text-align: left; }
  .app-shell[data-theme="robotic"][data-view="settings"] { grid-template-rows: 70px auto auto auto minmax(720px, auto) 32px; }
}
@media (max-width: 900px) {
  .app-shell[data-theme="robotic"] { display: flex; flex-direction: column; }
  .instrument-masthead { min-height: 74px; flex-shrink: 0; }
  .instrument-caption, .identity-divider { display: none; }
  .app-shell[data-theme="robotic"] .workflow-toolbar { display: grid; width: 100%; }
  .app-shell[data-theme="robotic"] .template-workspace { height: auto; max-height: none; min-height: 0; display: block; padding: 0 12px 12px; }
  .app-shell[data-theme="robotic"] .template-workspace-heading { display: none; }
  .app-shell[data-theme="robotic"] .module-rack { display: grid; grid-template-columns: none; grid-template-rows: 154px; grid-auto-flow: column; grid-auto-columns: 340px; height: 168px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: none; scrollbar-color: #929292 #e1e1e1; scrollbar-width: thin; }
  .app-shell[data-theme="robotic"] .module-rack.case-notes-rack { grid-template-rows: 96px; height: 110px; }
  .app-shell[data-theme="robotic"] .module-rack:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
  .app-shell[data-theme="robotic"] .workspace-module { grid-column: auto; grid-row: auto; height: 154px; scroll-snap-align: start; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .app-shell[data-theme="robotic"] .module-unit-grid { padding-inline: 8px; }
  .app-shell[data-theme="robotic"] .workspace { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 0 12px; }
  .app-shell[data-theme="robotic"] .source-pane { min-height: 480px; height: 480px; }
  .app-shell[data-theme="robotic"] .result-pane { min-height: 720px; height: 850px; }
  .app-shell[data-theme="robotic"] .source-canvas { height: auto; }
  .app-shell[data-theme="robotic"] .pane-heading p { display: none; }
  .app-shell[data-theme="robotic"] .document-toolbar { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; }
  .app-shell[data-theme="robotic"] .document-toolbar > * { flex-shrink: 0; }
  .app-shell[data-theme="robotic"] .system-bar { min-height: 42px; height: auto; padding: 10px 16px; }
  .app-shell[data-theme="robotic"][data-view="settings"] { display: flex; }
  .app-shell[data-theme="robotic"][data-view="settings"] .template-workspace { display: grid; }
  .app-shell[data-theme="robotic"][data-view="settings"] .template-workspace-heading { display: flex; }
  .app-shell[data-theme="robotic"][data-view="settings"] .module-rack { min-height: 0; height: auto; padding: 0; grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; overflow: visible; }
  .app-shell[data-theme="robotic"][data-view="settings"] .workspace-module { grid-column: auto; grid-row: auto; }
  .app-shell[data-theme="robotic"] .layout-console { grid-template-areas: "copy" "selected" "units" "add" "split" "reset"; grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .instrument-masthead { padding: 0 18px; gap: 12px; }
  .medhx-wordmark { width: 125px; height: 25px; }
  .instrument-preview { gap: 9px; font-size: 8px; }
  .signal-orb { width: 32px; height: 32px; }
  .app-shell[data-theme="robotic"] .workflow-toolbar { padding: 4px 12px 12px; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .app-shell[data-theme="robotic"] .case-controls,
  .app-shell[data-theme="robotic"] .workflow-controls { grid-column: 1 / -1; }
  .app-shell[data-theme="robotic"] .workflow-controls { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .app-shell[data-theme="robotic"] .workflow-control { padding-inline: 10px; }
  .app-shell[data-theme="robotic"] .utility-actions { justify-self: stretch; justify-content: space-between; padding-top: 10px; }
  .app-shell[data-theme="robotic"] .utility-actions button { min-width: 40px; min-height: 40px; }
  .app-shell[data-theme="robotic"][data-view="settings"] .module-rack { grid-template-columns: minmax(0, 1fr); }
  .app-shell[data-theme="robotic"] .functional-unit { font-size: 10.5px; }
  .app-shell[data-theme="robotic"] .pane-heading { padding-inline: 16px; }
  .app-shell[data-theme="robotic"] .document-toolbar { padding-inline: 12px; }
  .app-shell[data-theme="robotic"] .document-scroll { padding: 12px 10px 0; }
  .app-shell[data-theme="robotic"] .document-canvas { padding: 26px 22px 44px; }
  .app-shell[data-theme="robotic"] .block-heading:first-child .document-block-input { font-size: 19px; }
  .app-shell[data-theme="robotic"] .settings-panel { padding: 22px 16px; }
  .app-shell[data-theme="robotic"] .settings-panel-heading { gap: 16px; }
  .app-shell[data-theme="robotic"] .settings-panel-heading h1 { font-size: 21px; }
  .app-shell[data-theme="robotic"][data-view="settings"] .template-workspace { padding: 16px; }
  .app-shell[data-theme="robotic"] .selected-module-controls,
  .app-shell[data-theme="robotic"] .selected-unit-controls,
  .app-shell[data-theme="robotic"] .add-unit-controls { min-width: 0; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .signal-orbit { animation: none; } }
@media print { .app-shell[data-theme="robotic"] { display: none !important; } }
