* { box-sizing: border-box; }
body { margin: 0; background: #f5f5f5; color: #222; font: 13px system-ui, sans-serif; }
.app-shell { height: 100vh; height: 100dvh; padding: 12px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.app-header, .panel-heading, .dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 { font-size: 19px; margin: 0; } h2 { font-size: 15px; margin: 0; }
p { margin: 0; line-height: 1.5; }
.app-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; flex: 1; min-height: 0; }
.settings-panel, .results-panel, .graph-list-panel, figure { background: white; border: 1px solid #ccc; border-radius: 4px; }
.settings-panel { padding: 12px; overflow: auto; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.settings-heading button { padding: 4px 10px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 12px; }
.fields { display: grid; gap: 10px; }
label { display: block; }
select, input, button, textarea { font: inherit; color: inherit; }
select, input, textarea { padding: 6px 8px; border: 1px solid #aaa; border-radius: 3px; background: white; }
select { display: block; width: 100%; margin-top: 4px; height: 32px; }
button { padding: 6px 10px; border: 1px solid #999; border-radius: 3px; background: #eee; cursor: pointer; white-space: nowrap; }
button:hover:enabled { background: #e0e0e0; } button:disabled { opacity: .5; cursor: default; }
select:disabled { background: #eee; }
#run { width: 100%; margin-top: 10px; }
textarea { width: 100%; font: 12px/1.45 ui-monospace, monospace; resize: none; }
summary { cursor: pointer; }
#connection-settings { border-top: 1px solid #ddd; padding-top: 12px; margin-top: 14px; }
pre { font: 11px/1.5 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; margin: 10px 0; }
.command-row { display: grid; grid-template-columns: minmax(0, 1fr) 30px; align-items: center; gap: 6px; }
.copy-command { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; }
#command-copy-status:empty { display: none; }
#command-copy-status { margin-bottom: 6px; }
.connection-controls { display: grid; gap: 6px; }
.connection-controls input { min-width: 0; width: 100%; }
.muted, #connection-status, #graph-info, .timing-note { font-size: 11px; color: #666; }
#connection-status { white-space: nowrap; }
#graph-info { margin-top: 10px; overflow-wrap: anywhere; }
.graph-picker { position: relative; margin-top: 4px; }
.graph-search-row { display: grid; grid-template-columns: minmax(0, 1fr) 28px; }
#graph-search { min-width: 0; width: 100%; height: 32px; border-radius: 3px 0 0 3px; }
#graph-dropdown-toggle { padding: 0; border-left: 0; border-radius: 0 3px 3px 0; }
.graph-dropdown { position: absolute; top: 100%; left: 0; right: 0; z-index: 2; max-height: 240px; overflow: auto; background: white; border: 1px solid #999; border-radius: 3px; box-shadow: 0 3px 8px rgb(0 0 0 / .15); }
.graph-option { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 0; background: white; text-align: left; white-space: normal; overflow-wrap: anywhere; font-size: 12px; }
.graph-option[aria-selected="true"] { font-weight: 600; }
.graph-option.is-active { background: #e6edf6; }
#graph-no-match, #graph-table-empty { padding: 10px 8px; }
.graph-list-panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.graph-table-scroll { overflow: auto; min-height: 0; flex: 1; }
#graph-table th { width: auto; font-weight: 600; white-space: nowrap; position: sticky; top: 0; background: white; }
#graph-table th:first-child { width: 100%; }
#graph-table td:not(:first-child), #graph-table th:not(:first-child) { text-align: right; }
#graph-table .version-cell { text-align: center; min-width: 38px; }
#graph-table tr.is-selected { background: #edf3fa; }
.graph-table-name { border: 0; background: transparent; padding: 0; text-align: left; }
.graph-table-name:hover:enabled { background: transparent; text-decoration: underline; }
.work-area { display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; min-width: 0; }
.results-panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; }
#run-status { color: #666; font-size: 12px; }
#error { color: #a11212; white-space: pre-wrap; overflow-wrap: anywhere; background: #fff0f0; padding: 8px; font-size: 12px; }
.result-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; flex: 1; min-height: 0; }
.measurements { min-width: 0; overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12px; }
th, td { padding: 6px 8px; border-bottom: 1px solid #ddd; text-align: left; }
th { width: 68%; font-weight: normal; } td { white-space: nowrap; }
.timing-note { margin-top: 8px; }
.copy-panel { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
#result-text { flex: 1; min-height: 100px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions button { font-size: 12px; }
#copy-status { font-size: 11px; }
#artifact-links { margin-top: 8px; font-size: 12px; }
#log-details { margin-top: 8px; font-size: 12px; }
#log { height: 100px; margin-top: 6px; }
.images { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; min-height: 0; }
figure { padding: 10px; margin: 0; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
figcaption { font-weight: 600; font-size: 12px; }
.image-preview { display: flex; justify-content: center; flex: 1; min-height: 0; width: 100%; border: 0; background: white; padding: 0; cursor: zoom-in; }
.image-preview:hover:enabled { background: white; }
.image-preview img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
figure > .muted { margin: auto; }
a { color: #1650a0; }
dialog { width: min(94vw, 1100px); max-width: 94vw; height: min(92vh, 1100px); height: min(92dvh, 1100px); max-height: 92dvh; padding: 14px; border: 1px solid #aaa; border-radius: 4px; background: white; }
dialog[open] { display: flex; flex-direction: column; gap: 12px; }
dialog::backdrop { background: rgb(0 0 0 / .55); }
#expanded-image { width: 100%; flex: 1; min-height: 0; object-fit: contain; }
[hidden] { display: none !important; }
@media (max-height: 700px) and (min-width: 721px) { .fields { gap: 6px; } select { height: 29px; margin-top: 2px; } }
@media (max-width: 1000px) and (min-width: 721px) { .app-layout { grid-template-columns: 250px minmax(0, 1fr); } .result-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 10px; } th, td { padding: 5px 4px; } }
@media (max-width: 720px) { .app-shell { height: auto; min-height: 100dvh; overflow: visible; } .app-header { align-items: flex-start; } h1 { font-size: 16px; } .app-layout { grid-template-columns: 1fr; } .fields { grid-template-columns: 1fr 1fr; } .graph-field, .fields > label:first-of-type { grid-column: 1 / -1; } .settings-panel { overflow: visible; } .work-area { grid-template-rows: auto 240px; } .graph-list-panel { height: 320px; } .result-grid { min-height: 240px; } .measurements { overflow: visible; } }

.measurements h3 { font-size: 13px; margin: 8px 0; }
.timing-group th { padding-top: 18px; color: #57677a; font-weight: 600; font-size: 11px; border-bottom: 2px solid #dce5ee; }
.timing-primary { background: #eef5fc; }
.timing-primary th, .timing-primary td { font-weight: 600; padding-top: 10px; padding-bottom: 10px; }
#metrics td { white-space: normal; min-width: 110px; }
#metrics summary { cursor: pointer; }
#metrics ol { max-height: 180px; overflow: auto; padding-left: 24px; font-weight: 400; }
/* Match tools/single_run; graph execution stays entirely in the browser. */
#gpu-state { font-size: 11px; color: #666; }
.fields input { display: block; width: 100%; margin-top: 4px; height: 32px; min-width: 0; }
#drop { margin-top: 4px; border: 1px dashed #aaa; padding: 8px; }
#drop.over { background: #e6edf6; }
#drop input { height: auto; padding: 0; border: 0; font-size: 11px; }
#drop .muted { margin-top: 8px; }
#demo { margin-top: 8px; }
#filename { margin-top: 8px; overflow-wrap: anywhere; }
.run-actions { margin-top: 8px; }
.method-settings { margin-top: 16px; border-top: 1px solid #ddd; padding-top: 12px; font-size: 11px; color: #555; }
.method-settings p { margin-top: 8px; }
.panel-heading { align-items: flex-start; }
#status { color: #666; font-size: 12px; text-align: right; overflow-wrap: anywhere; }
#status.error, #gpu-state.error { color: #a11212; }
.progress-row { display: flex; align-items: center; gap: 8px; color: #666; font-size: 11px; }
progress { width: 100%; height: 10px; }
.measurements td { white-space: normal; overflow-wrap: anywhere; }
.measurements th { width: 48%; }
.export-actions { margin-top: 10px; }
.canvas-wrap { flex: 1; min-height: 0; min-width: 0; position: relative; }
canvas { display: block; width: 100%; height: 100%; background: white; }
#graph { touch-action: none; cursor: grab; }
#graph:active { cursor: grabbing; }
.canvas-actions { gap: 4px; }
.canvas-actions button { padding: 3px 7px; font-size: 11px; }
figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.expand { font-size: 11px; padding: 2px 7px; }
#view-caption { font-size: 10px; }
@media(max-width:720px) { .work-area { grid-template-rows: auto auto; } .images { height: 300px; } .result-grid { grid-template-columns: 1fr; } .copy-panel { min-height: 180px; } .canvas-actions .muted { display: none; } }
@media(max-width:400px) { .images { grid-template-columns: 1fr; height: 550px; } .app-header { flex-direction: column; gap: 4px; } }
