:root {
  color-scheme: dark;
  color: #dce2e6;
  background: #101315;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  --border: #30363a;
  --border-strong: #465057;
  --panel: #171b1e;
  --muted: #98a3aa;
  --soft: #1d2226;
  --accent: #e3e7e9;
  --accent-soft: #272c30;
  --good: #70b995;
  --good-soft: #1d3028;
  --danger: #df8585;
  --danger-soft: #352323;
  --warning: #d3ab62;
  --warning-soft: #30291d;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { --sidebar-size: 280px; display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar-size); height: 100vh; overflow: hidden; transition: grid-template-columns .16s ease; }
.app-shell.is-sidebar-collapsed { --sidebar-size: 58px; }
.work-area { display: grid; grid-template-rows: 48px minmax(0, 1fr); min-width: 0; min-height: 0; background: #101315; }
.work-toolbar { display: grid; grid-template-columns: auto minmax(120px, 1fr) auto auto; gap: 10px; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border); background: var(--panel); }
.workspace-identity { display: flex; gap: 8px; align-items: center; min-width: 0; }
.workspace-identity .section-label { display: none; }
.product-logo { width: 26px; height: 26px; flex: 0 0 auto; opacity: .9; filter: invert(1); }
.section-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: inherit; font-weight: 600; }
h1 { font-size: 17px; }
h2 { font-size: 18px; }
.workspace-actions { display: flex; gap: 10px; align-items: center; }
.batch-summary { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.batch-summary span { color: var(--muted); }
.text-button { padding: 5px 0; border: 0; color: var(--accent); font-size: 13px; background: transparent; cursor: pointer; }
.text-button:hover:not(:disabled) { text-decoration: underline; }
.text-button:disabled { color: #606a70; cursor: not-allowed; }
.workspace-tabs { display: flex; min-width: 0; gap: 2px; align-items: center; overflow-x: auto; scrollbar-width: thin; }
.workspace-tab { display: flex; height: 30px; flex: 0 0 auto; align-items: center; border: 1px solid transparent; border-radius: 2px; color: var(--muted); background: transparent; }
.workspace-tab.is-active { border-color: var(--border-strong); color: var(--accent); background: var(--accent-soft); }
.workspace-tab-select, .workspace-tab-close { height: 28px; padding: 0 8px; border: 0; color: inherit; white-space: nowrap; background: transparent; cursor: pointer; }
.workspace-tab-close { width: 26px; padding: 0; color: var(--muted); }
.workspace-tab-close:disabled { visibility: hidden; }
.workspace-tab-select:hover, .workspace-tab-close:hover { color: var(--accent); }

.work-content { --terminal-size: 220px; display: grid; grid-template-rows: auto minmax(190px, 1fr) 4px var(--terminal-size); gap: 4px; min-height: 0; padding: 6px; }
body.is-sequence-review .work-content, body.is-ades-review .work-content,
body.is-ades-review .sequence-review-page { display: none; }
.sequence-review-page { min-height: 0; padding: 6px; overflow-y: auto; background: #101315; }
.sequence-review-page[hidden] { display: none; }
.sequence-review-header { position: sticky; top: -6px; z-index: 6; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; min-height: 54px; padding: 8px 10px; border: 1px solid var(--border); background: var(--panel); }
.sequence-review-header h2 { font-size: 16px; }
.sequence-review-header p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.sequence-review-header > button:last-child, .sequence-playback button, .sequence-table button { height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--accent); font-size: 12px; background: transparent; cursor: pointer; }
.sequence-review-header > button:last-child:disabled { color: #697278; cursor: not-allowed; }
.sequence-gate { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; align-items: baseline; margin-top: 6px; padding: 9px 11px; border: 1px solid var(--border); background: var(--panel); }
.sequence-gate strong { color: #dce2e6; font-size: 13px; }
.sequence-gate p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.sequence-gate.is-warning { border-color: #6f5c37; }
.sequence-gate.is-warning strong { color: var(--warning); }
.sequence-gate.is-blocked { border-color: #793e3e; background: var(--danger-soft); }
.sequence-gate.is-blocked strong { color: var(--danger); }
.sequence-review-grid { display: grid; grid-template-columns: minmax(330px, 0.9fr) minmax(480px, 1.1fr); gap: 6px; margin-top: 6px; }
.sequence-animation, .sequence-plots, .sequence-aladin, .sequence-table-section { min-width: 0; border: 1px solid var(--border); background: var(--panel); }
.sequence-panel-heading { display: flex; min-height: 38px; gap: 10px; align-items: center; justify-content: space-between; padding: 7px 9px; border-bottom: 1px solid var(--border); }
.sequence-panel-heading h3, .sequence-plots h3 { margin: 0; font-size: 13px; font-weight: 600; }
.sequence-panel-heading span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sequence-frame { display: grid; height: 390px; place-items: center; overflow: hidden; background: #090b0c; }
.sequence-frame canvas { display: block; max-width: 100%; max-height: 100%; }
.sequence-playback { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; gap: 9px; align-items: center; padding: 7px 9px; border-top: 1px solid var(--border); }
.sequence-playback input { width: 100%; accent-color: var(--danger); }
.sequence-playback span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 10px; white-space: nowrap; }
.sequence-plots { display: grid; grid-template-rows: repeat(3, auto); gap: 0; }
.sequence-plots > div + div { border-top: 1px solid var(--border); }
.sequence-plots h3 { padding: 7px 9px 0; color: var(--muted); }
.sequence-plots svg { display: block; width: 100%; height: 220px; }
.plot-frame { fill: #111518; stroke: var(--border-strong); }
.plot-grid { stroke: #2d3438; stroke-width: 1; }
.plot-line { fill: none; stroke: #ef6868; stroke-width: 2; }
.plot-line.series-2 { stroke: #c8cdd0; stroke-dasharray: 5 4; }
.plot-point { fill: #ef6868; stroke: #111518; stroke-width: 1; }
.plot-point.series-2 { fill: #c8cdd0; }
.plot-tick, .plot-axis-title, .plot-legend { fill: #aab3b8; font-size: 10px; }
.plot-legend.series-1 { fill: #ef8686; }
.plot-legend.series-2 { fill: #d7dcde; }
.sequence-aladin { display: grid; grid-column: 1 / -1; grid-template-rows: auto minmax(520px, 1fr) auto; }
.sequence-simulator { width: 100%; min-height: 520px; border: 0; background: #090b0c; }
#aladin-status { padding: 7px 9px; color: var(--muted); font-size: 11px; }
.frame-simulator-dialog { width: min(1500px, calc(100vw - 36px)); height: min(850px, calc(100vh - 36px)); padding: 0; border: 1px solid var(--border-strong); color: var(--text); background: var(--panel); }
.frame-simulator-dialog::backdrop { background: #07090acc; }
.frame-simulator-dialog[open] { display: grid; grid-template-rows: 38px minmax(0, 1fr) auto; }
.frame-simulator-dialog header { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; border-bottom: 1px solid var(--border); }
.frame-simulator-dialog iframe { width: 100%; height: 100%; border: 0; background: #090b0c; }
.frame-simulator-dialog p { margin: 0; padding: 7px 10px; color: var(--muted); font-size: 11px; }
.sequence-table-section { margin-top: 6px; }
.sequence-table-section .table-shell { max-height: 330px; }
.sequence-table td { padding-top: 7px; padding-bottom: 7px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; }
.sequence-table td:nth-child(3) { max-width: 250px; overflow: hidden; font-family: inherit; text-overflow: ellipsis; white-space: nowrap; }
.sequence-table td:last-child { display: flex; gap: 8px; align-items: center; justify-content: space-between; font-family: inherit; }
.sequence-table tbody tr { cursor: pointer; }
.sequence-table tbody tr.is-current { background: var(--accent-soft); }
.sequence-table button { height: 26px; flex: none; padding: 0 7px; line-height: 24px; }

.ades-page { min-height: 0; padding: 6px; overflow-y: auto; background: #101315; }
.ades-page[hidden] { display: none; }
.ades-header { position: sticky; top: -6px; z-index: 6; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; min-height: 54px; padding: 8px 10px; border: 1px solid var(--border); background: var(--panel); }
.ades-header h2 { font-size: 16px; }
.ades-header p { margin-top: 3px; color: var(--muted); font-size: 12px; }
.ades-readiness { margin-top: 6px; padding: 10px 12px; border: 1px solid var(--border); background: var(--panel); font-size: 13px; line-height: 1.45; }
.ades-readiness.is-blocked { border-color: #793e3e; background: var(--danger-soft); }
.ades-readiness strong { display: block; margin-bottom: 3px; }
.ades-readiness ul { margin: 4px 0 0; padding-left: 20px; color: var(--muted); }
.ades-grid { display: grid; grid-template-columns: minmax(360px, .75fr) minmax(500px, 1.25fr); gap: 6px; margin-top: 6px; }
.ades-context-form, .ades-preview-panel { min-width: 0; border: 1px solid var(--border); background: var(--panel); }
.ades-context-form { padding: 12px; }
.ades-context-form h3 { margin: 0; font-size: 13px; }
.ades-context-form > p { margin: 4px 0 12px; color: var(--muted); font-size: 12px; }
.ades-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ades-fields label { display: grid; align-content: start; gap: 4px; color: var(--muted); font-size: 12px; }
.ades-fields input, .ades-fields select, .ades-fields textarea { width: 100%; min-height: 32px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: 2px; color: #dce2e6; background: #15191c; }
.ades-fields textarea { resize: vertical; }
.ades-context-form > button, .ades-actions button { height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--accent); white-space: nowrap; background: transparent; cursor: pointer; }
.ades-context-form > button { margin-top: 12px; }
.ades-context-form > button:disabled, .ades-actions button:disabled { color: #697278; cursor: not-allowed; }
.ades-preview-panel { display: grid; grid-template-rows: auto minmax(360px, 1fr) auto; }
.ades-preview { min-height: 360px; }
#ades-preview { width: 100%; min-height: 360px; padding: 12px; border: 0; outline: 0; color: #dce2e6; background: #0d1012; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.ades-actions { display: flex; gap: 6px; justify-content: flex-end; padding: 7px 9px; border-top: 1px solid var(--border); }
.ades-boundary { margin: 6px 0 0; padding: 8px 10px; border: 1px solid var(--border); color: var(--muted); background: var(--panel); font-size: 12px; }
.ades-boundary code { color: var(--accent); }

@media (max-width: 1400px) {
  .sequence-review-grid { grid-template-columns: minmax(320px, 1fr) minmax(390px, 1.15fr); }
}

@media (max-width: 900px) {
  .sequence-review-header { grid-template-columns: auto minmax(0, 1fr); }
  .sequence-review-header > button:last-child { grid-column: 1 / -1; }
  .sequence-review-grid { grid-template-columns: minmax(0, 1fr); }
  .sequence-aladin { grid-column: auto; }
  .ades-grid { grid-template-columns: minmax(0, 1fr); }
}
.inspection-grid { --files-size: 32%; display: grid; grid-template-columns: minmax(240px, var(--files-size)) 4px minmax(360px, 1fr); min-height: 0; }
.work-content.is-panel-open { grid-template-rows: minmax(0, 1fr); }
.inspection-grid.is-single-panel { grid-template-columns: minmax(0, 1fr); }
.panel[hidden], .drop-zone[hidden], .inspection-grid[hidden], .layout-resizer[hidden] { display: none; }
.drop-zone { display: grid; grid-template-columns: auto 1fr auto auto auto; gap: 10px; align-items: center; min-height: 60px; padding: 8px 12px; border: 1px dashed #586269; border-radius: 3px; outline: none; background: var(--panel); }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: var(--accent-soft); }
.drop-plus { display: block; width: 20px; color: var(--accent); font-size: 24px; font-weight: 400; line-height: 1; text-align: center; }
.drop-zone strong, .drop-zone span { display: block; }
.drop-zone strong { margin-bottom: 4px; font-size: 15px; }
.drop-zone div span { color: var(--muted); font-size: 13px; }
.drop-formats { color: var(--muted); font-size: 12px; font-weight: 700; }
.drop-folder-action { padding: 2px 3px; border: 0; color: var(--muted); font-size: 12px; background: transparent; cursor: pointer; }
.drop-folder-action:hover, .drop-folder-action:focus-visible { color: var(--accent); text-decoration: underline; }
.drop-zone.is-compact { min-height: 36px; padding: 4px 10px; }
.drop-zone.is-compact strong { margin: 0; }
.drop-zone.is-compact #drop-help, .drop-zone.is-compact .drop-formats { display: none; }

.panel { position: relative; display: grid; grid-template-rows: minmax(0, 1fr); min-height: 0; border: 1px solid var(--border); border-radius: 3px; background: var(--panel); overflow: hidden; }
.panel-open-button { padding: 2px 3px; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; background: transparent; cursor: pointer; }
.panel-open-button:hover, .panel-open-button:focus-visible { color: var(--accent); text-decoration: underline; }
.panel-corner-button { position: absolute; top: 6px; right: 7px; z-index: 5; background: var(--panel); }
.queue-panel { container-type: inline-size; }
.queue-panel th:last-child { width: 1%; padding: 5px 7px; text-align: right; white-space: nowrap; }
.pending-label { padding: 4px 7px; border-radius: 3px; color: var(--warning) !important; font-weight: 700; background: var(--warning-soft); }
.layout-resizer { position: relative; z-index: 2; border-radius: 3px; outline: none; touch-action: none; }
.layout-resizer::after { position: absolute; border-radius: 2px; background: var(--border-strong); content: ""; }
.layout-resizer:hover::after, .layout-resizer:focus-visible::after, .layout-resizer.is-dragging::after { background: var(--accent); }
.layout-resizer.is-columns { cursor: col-resize; }
.layout-resizer.is-columns::after { top: 12%; bottom: 12%; left: 1px; width: 2px; }
.layout-resizer.is-rows { cursor: row-resize; }
.layout-resizer.is-rows::after { top: 1px; right: 12%; left: 12%; height: 2px; }
body.is-resizing { user-select: none; }
.table-shell { min-height: 0; overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 14px; border-bottom: 1px solid #292f33; text-align: left; }
th { position: sticky; top: 0; z-index: 1; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; background: var(--soft); }
td { font-size: 14px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.is-selected { background: var(--accent-soft); }
.file-select { display: block; width: 100%; padding: 0; border: 0; color: inherit; text-align: left; background: transparent; cursor: pointer; }
.file-select:disabled { cursor: default; }
.file-select:not(:disabled):hover .file-name, .file-select:not(:disabled):focus-visible .file-name { color: var(--accent); }
.file-name { display: block; max-width: 520px; overflow: hidden; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.file-detail { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.status-badge { display: inline-block; padding: 4px 7px; border-radius: 2px; font-size: 12px; font-weight: 700; }
.status-badge.is-pending { color: var(--warning); background: var(--warning-soft); }
.status-badge.is-warning { color: var(--warning); background: var(--warning-soft); }
.status-badge.is-ready { color: var(--good); background: var(--good-soft); }
.status-badge.is-error { color: var(--danger); background: var(--danger-soft); }
.remove-button { border: 0; color: var(--muted); font-size: 13px; background: transparent; cursor: pointer; }
.remove-button:hover, .remove-button:focus-visible { color: var(--danger); }
.empty-row td { height: 92px; color: var(--muted); text-align: center; }
.sequence-row td { padding-top: 7px; padding-bottom: 7px; color: var(--accent); background: #202428; }
.sequence-row button { border: 0; color: inherit; background: transparent; cursor: pointer; }
.sequence-toggle { display: flex; gap: 7px; align-items: center; width: 100%; padding: 0; text-align: left; }
.sequence-count-label { color: var(--muted); font-size: 11px; font-weight: 400; }
.ades-scope { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 11px; white-space: nowrap; cursor: pointer; }
.ades-scope input { margin: 0; accent-color: #c9ced1; }
.folder-row td { padding-top: 6px; padding-bottom: 6px; color: var(--muted); font-size: 12px; background: #1a1f22; }
.folder-toggle { display: flex; gap: 6px; align-items: center; width: 100%; padding: 0; border: 0; color: inherit; text-align: left; background: transparent; cursor: pointer; }
.tree-name-cell { position: relative; padding-left: calc(9px + var(--depth, 0) * 16px) !important; }
.tree-name-cell::before { position: absolute; top: 0; bottom: 0; left: calc(1px + var(--depth, 0) * 16px); width: 1px; background: var(--border); content: ""; }

@container (max-width: 420px) {
  .queue-panel th:nth-child(2), .queue-panel td:nth-child(2) { display: none; }
  .queue-panel th, .queue-panel td { padding-right: 9px; padding-left: 9px; }
}

.viewer-panel { grid-template-rows: auto minmax(0, 1fr) auto; }
.viewer-controls { display: grid; grid-template: "view hint actions" auto "overlays overlays overlays" auto / auto minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; min-width: 0; padding: 5px 58px 5px 8px; border-bottom: 1px solid var(--border); }
.view-switch, .target-actions, .zoom-controls, .image-actions { display: flex; gap: 4px; align-items: center; flex: none; }
.view-switch { grid-area: view; }
.image-actions { grid-area: actions; gap: 8px; }
.view-switch button, .target-actions button, .zoom-controls button { height: 30px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--muted); font-size: 12px; line-height: 28px; white-space: nowrap; background: transparent; cursor: pointer; }
.zoom-controls button { min-width: 30px; padding: 0 7px; }
.zoom-controls #zoom-reset { min-width: 48px; }
.view-switch button[aria-pressed="true"], .target-actions button.is-armed { color: var(--accent); background: var(--accent-soft); }
.target-actions button:disabled, .zoom-controls button:disabled { opacity: .45; cursor: default; }
.target-actions button[hidden] { display: none; }
.overlay-toggles { display: flex; grid-area: overlays; flex-wrap: wrap; gap: 4px 12px; align-items: center; min-width: 0; padding-top: 5px; border-top: 1px solid #292f33; }
.overlay-toggles label { display: inline-flex; gap: 3px; align-items: center; color: var(--muted); font-size: 12px; white-space: nowrap; cursor: pointer; }
.overlay-toggles input { margin: 0; accent-color: var(--accent); }
.target-hint { grid-area: hint; min-width: 0; overflow: hidden; color: var(--warning); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.viewer-stage { position: relative; display: grid; min-height: 0; padding: 6px; place-items: center; overflow: hidden; background: #090b0c; }
.viewer-stage[hidden], .viewer-info[hidden], .viewer-image[hidden], .viewer-empty[hidden], .preview-metadata[hidden] { display: none; }
.viewer-image { position: absolute; top: 50%; left: 50%; min-width: 0; min-height: 0; overflow: hidden; border: 1px solid #252b2e; transform: translate(-50%, -50%); transform-origin: center; }
.viewer-image.is-zoomed { cursor: grab; }
.viewer-image.is-panning { cursor: grabbing; }
.viewer-image canvas { display: block; width: 100%; height: 100%; image-rendering: auto; }
#annotation-layer { position: absolute; inset: 0; pointer-events: none; }
.viewer-image.is-picking #annotation-layer { cursor: crosshair; pointer-events: auto; touch-action: none; }
.viewer-empty { color: var(--muted); text-align: center; }
.viewer-empty strong, .viewer-empty span { display: block; }
.viewer-empty strong { margin-bottom: 5px; color: #d5dde1; font-size: 15px; }
.viewer-empty span { font-size: 13px; }
.image-readout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(250px, 1fr) auto; gap: 14px; min-height: 28px; align-items: center; padding: 4px 8px; border-top: 1px solid var(--border); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; }
.image-readout[hidden] { display: none; }
.image-readout span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#display-note { text-align: right; }
.viewer-info { min-height: 0; overflow-y: auto; background: var(--soft); }
.preview-metadata { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); margin: 0; border-bottom: 1px solid var(--border); }
.preview-metadata div { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.4fr); gap: 12px; min-width: 0; padding: 9px 12px; border-bottom: 1px solid #292f33; }
.preview-metadata div:nth-child(odd) { border-right: 1px solid var(--border); }
.preview-metadata dt { align-self: start; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.preview-metadata dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; line-height: 1.35; }
.metadata-editor { border-top: 1px solid var(--border); }
.metadata-editor[hidden] { display: none; }
.metadata-heading { display: flex; justify-content: space-between; gap: 12px; padding: 14px 12px 10px; }
.metadata-heading > div { display: grid; gap: 2px; }
.metadata-heading .section-label { margin: 0; }
.metadata-heading strong { font-size: 13px; }
.metadata-heading > span, .metadata-note { color: var(--muted); font-size: 12px; }
.metadata-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; align-items: end; padding: 0 12px 12px; }
.metadata-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.metadata-form input { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: 2px; color: #dce2e6; background: var(--panel); }
.metadata-form #metadata-site { text-transform: uppercase; }
.metadata-actions { display: flex; gap: 6px; }
.metadata-actions button { height: 32px; min-width: 112px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--accent); line-height: 30px; white-space: nowrap; background: transparent; cursor: pointer; }
.metadata-actions button:hover { border-color: var(--accent); background: var(--accent-soft); }
.metadata-note { padding: 0 10px 10px; }
.solution-report { border-top: 1px solid var(--border); }
.solution-report[hidden] { display: none; }
.solution-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px 5px; }
.solution-heading > div { display: grid; gap: 2px; }
.solution-heading .section-label { margin: 0; }
.solution-heading strong { font-size: 13px; }
.solution-action { flex: none; padding: 3px; border: 0; color: var(--muted); font-size: 12px; font-weight: 700; text-decoration: none; }
.solution-action:hover, .solution-action:focus-visible { color: var(--accent); text-decoration: underline; }
.solution-action[hidden] { display: none; }
.solution-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin: 0; }
.solution-details div { display: grid; grid-template-columns: minmax(110px, .8fr) minmax(0, 1.4fr); gap: 12px; min-width: 0; padding: 9px 12px; border-top: 1px solid #292f33; }
.solution-details div:nth-child(odd) { border-right: 1px solid var(--border); }
.solution-details dt { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.solution-details dd { margin: 0; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; line-height: 1.35; }
.ephemeris-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; padding: 10px; border-top: 1px solid var(--border); }
.ephemeris-form label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
.ephemeris-form input, .ephemeris-form textarea { min-height: 32px; padding: 5px 7px; border: 1px solid var(--border-strong); border-radius: 2px; color: inherit; background: var(--panel); }
.ephemeris-form textarea { width: 210px; resize: vertical; }
.ephemeris-form label:nth-child(2) input { width: 90px; text-transform: uppercase; }
.ephemeris-form button { height: 32px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--accent); line-height: 30px; white-space: nowrap; background: transparent; cursor: pointer; }
.ephemeris-form button:hover { border-color: var(--accent); background: var(--accent-soft); }
.ephemeris-form button:disabled { opacity: .6; cursor: wait; }
.ephemeris-help, .ephemeris-result { padding: 0 10px 10px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.ephemeris-help { padding-bottom: 4px; }
.ephemeris-help a { color: var(--accent); }
.ephemeris-result { white-space: pre-line; }

.terminal-output { min-height: 0; padding: 8px 58px 8px 0; overflow-y: auto; color: #b8c2c8; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; line-height: 1.45; background: #121618; }
.terminal-panel { grid-template-rows: minmax(0, 1fr) 38px; }
.terminal-line { display: grid; grid-template-columns: 72px 82px minmax(0, 1fr); gap: 10px; padding: 3px 14px; }
.terminal-line time { color: #68747b; font-variant-numeric: tabular-nums; }
.terminal-level { color: #8d999f; font-weight: 700; }
.terminal-line.is-success .terminal-level { color: var(--good); }
.terminal-line.is-warning .terminal-level { color: var(--warning); }
.terminal-line.is-error .terminal-level { color: var(--danger); }
.terminal-message { min-width: 0; overflow-wrap: anywhere; }
.terminal-prompt-actions { display: inline-flex; gap: 5px; margin-left: 10px; }
.terminal-prompt-actions button, .terminal-input button { height: 28px; min-width: 40px; padding: 0 9px; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--accent); line-height: 26px; white-space: nowrap; background: transparent; cursor: pointer; }
.terminal-prompt-actions button:hover, .terminal-input button:hover { border-color: var(--accent); background: var(--accent-soft); }
.terminal-prompt-actions button:disabled { opacity: .5; cursor: default; }
.terminal-input { display: flex; gap: 6px; align-items: center; padding: 4px 7px; border-top: 1px solid var(--border); color: var(--muted); background: var(--panel); font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px; }
.terminal-input label { flex: none; }
.terminal-input input { flex: 1; min-width: 0; padding: 4px 5px; border: 0; outline: none; color: #dce2e6; background: transparent; font-family: inherit; font-size: 12px; }
.terminal-input input:focus-visible { box-shadow: inset 0 -1px var(--accent); }

.sidebar { min-height: 0; border-left: 1px solid var(--border); background: var(--panel); }
.sidebar-heading { display: flex; height: 48px; gap: 8px; align-items: center; justify-content: space-between; padding: 7px 10px 7px 12px; border-bottom: 1px solid var(--border); }
.sidebar-heading-copy { min-width: 0; }
.sidebar-heading .section-label { display: none; }
.sidebar-heading strong { display: block; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-toggle { display: grid; width: 28px; height: 28px; flex: 0 0 auto; padding: 0; place-items: center; border: 1px solid var(--border-strong); border-radius: 2px; color: var(--muted); font-size: 18px; line-height: 1; background: transparent; cursor: pointer; }
.sidebar-toggle:hover, .sidebar-toggle:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.sidebar-content { height: calc(100% - 48px); overflow-y: auto; }
.sidebar-section { padding: 16px; border-bottom: 1px solid var(--border); }
.sidebar-section h2 { margin-bottom: 14px; }
.sidebar-section.compact { padding-bottom: 12px; }
.stage-list { margin: 0; padding: 0; list-style: none; }
.stage { display: grid; grid-template-columns: auto 1fr auto; gap: 9px; align-items: center; min-height: 54px; padding: 7px 8px; color: #6f7a83; }
.stage + .stage { border-top: 1px solid #292f33; }
.stage.is-current { color: #e3eaed; background: #20282b; }
.stage.is-complete { color: var(--good); }
.stage.is-warning { color: var(--warning); }
.stage.is-error { color: var(--danger); }
.stage-number { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 12px; }
.stage strong, .stage small { display: block; }
.stage strong { font-size: 14px; }
.stage small { margin-top: 3px; font-size: 12px; }
.stage-state { color: currentColor; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.stage.is-current .stage-state { color: var(--accent); }
.fact-list { margin: 8px 0 0; }
.fact-list div { display: flex; justify-content: space-between; padding: 9px 0; font-size: 13px; }
.fact-list div + div { border-top: 1px solid #292f33; }
.fact-list dt { color: var(--muted); }
.fact-list dd { margin: 0; font-weight: 700; }

.app-shell.is-sidebar-collapsed .sidebar-heading { justify-content: center; padding: 10px; }
.app-shell.is-sidebar-collapsed .sidebar-heading-copy,
.app-shell.is-sidebar-collapsed .sidebar-section > .section-label,
.app-shell.is-sidebar-collapsed .sidebar-section > h2,
.app-shell.is-sidebar-collapsed .sidebar-section.compact,
.app-shell.is-sidebar-collapsed .stage > div,
.app-shell.is-sidebar-collapsed .stage-state { display: none; }
.app-shell.is-sidebar-collapsed .sidebar-section { padding: 10px 8px; }
.app-shell.is-sidebar-collapsed .stage { grid-template-columns: 1fr; min-height: 48px; padding: 6px 0; justify-items: center; }

.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .app-shell { --sidebar-size: 230px; }
  .inspection-grid { grid-template-columns: 1fr; grid-template-rows: minmax(135px, .72fr) minmax(180px, 1fr); }
  .layout-resizer.is-columns { display: none; }
  .work-content { --terminal-size: 180px; grid-template-rows: auto minmax(0, 1fr) 4px var(--terminal-size); }
  .inspection-grid.is-single-panel { grid-template-rows: minmax(0, 1fr); }
}

@media (max-width: 650px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) 180px; }
  .app-shell.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar { border-top: 1px solid var(--border); border-left: 0; }
  .sidebar-toggle { display: none; }
  .app-shell.is-sidebar-collapsed .sidebar-heading-copy { display: block; }
  .app-shell.is-sidebar-collapsed .sidebar-heading { justify-content: space-between; padding: 7px 12px; }
  .app-shell.is-sidebar-collapsed .sidebar-section > .section-label { display: block; }
  .app-shell.is-sidebar-collapsed .sidebar-section > h2 { display: block; }
  .app-shell.is-sidebar-collapsed .stage > div { display: block; }
  .app-shell.is-sidebar-collapsed .sidebar-section { padding: 12px; }
  .app-shell.is-sidebar-collapsed .stage { display: grid; grid-template-columns: auto 1fr; min-height: 38px; padding: 7px 8px; justify-items: stretch; }
  .sidebar-content { display: grid; grid-template-columns: 1fr 1fr; height: calc(100% - 48px); }
  .sidebar-section { padding: 12px; }
  .sidebar-section.compact { display: none; }
  .stage-list { display: grid; grid-template-columns: repeat(3, 1fr); }
  .stage { grid-template-columns: auto 1fr; min-height: 38px; }
  .stage small, .stage-state { display: none; }
  .drop-formats { display: none !important; }
}

/* Monospace layer: square corners, bracketed controls, green for success. Shared look with the
   landing page in index.html. Layout is unchanged. */
:root { --good: #5fd38a; --good-soft: #15281d; --dim: #4a514d; background: #0b0d0d; }
h3 { font-family: inherit; }
*, *::before, *::after { border-radius: 0 !important; }
.work-area, .sequence-review-page, .ades-page { background: #0b0d0d; }
.viewer-stage, .sequence-frame { background: #070808; }
.home-link { color: var(--muted); font-weight: 700; text-decoration: none; }
.home-link:hover, .home-link:focus-visible { color: var(--good); }
.workspace-identity h1 { font-size: 14px; letter-spacing: .08em; }
.workspace-identity h1::before { content: "~/"; color: var(--muted); letter-spacing: 0; }
.text-button::before, .status-badge::before, .stage-number::before { content: "["; color: var(--dim); }
.text-button::after, .status-badge::after, .stage-number::after { content: "]"; color: var(--dim); }
.text-button:hover:not(:disabled) { text-decoration: none; color: var(--good); }
.status-badge { padding: 0; background: transparent !important; white-space: nowrap; }
/* The base rule draws a 28px circle as a grid, which stacks "[", "1" and "]" vertically. */
.stage-number { display: block; width: auto; height: auto; border: 0; font-weight: 700; white-space: nowrap; }
.stage.is-current { background: #141a17; }
th, td { border-bottom-style: dashed; }
.panel, .drop-zone { border-style: dashed; }
.drop-plus { font-size: 20px; }
.terminal-output { background: #080a09; }
/* Monospace labels such as "CENTROID CHECK" are wider than the base 82px column. */
.terminal-line { grid-template-columns: 9ch 15ch minmax(0, 1fr); }
.terminal-input label { color: var(--good); }
