:root {
  color-scheme: light;
  --ink: #1a2c37;
  --muted: #536977;
  --line: #dce6eb;
  --accent: #08796c;
  --surface: #fff;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  color: var(--ink);
  background: #f1f5f7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 14px; }
h1, h2, p, dl, dd { margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 24px clamp(14px, 3.5vw, 48px); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 2px 5px #1a2c3708; min-width: 0; }
.usb-panel { margin-bottom: 16px; padding: 16px 22px 14px; }
.usb-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.eyebrow { color: var(--accent); font: 700 11px var(--mono); letter-spacing: .12em; }
.eyebrow span { color: var(--muted); margin-left: 6px; }
h1 { margin-top: 5px; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.055em; }
h2 { font-size: 19px; letter-spacing: -.04em; }
.panel-head { min-height: 76px; padding: 14px 18px 12px; }
.panel-head p { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.part-number { font-family: var(--mono); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button { min-height: 36px; padding: 6px 12px; border: 1px solid #c8d6df; border-radius: 7px; background: #fff; color: var(--ink); font: inherit; font-weight: 650; cursor: pointer; white-space: nowrap; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:not(:disabled):hover { border-color: var(--accent); }
button.primary:not(:disabled):hover { background: #06665b; }
button.quiet { background: #f5f8fa; }
button:disabled { opacity: .53; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #128c7f; outline-offset: 2px; }
.usb-status { display: flex; align-items: baseline; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 13px; }
.usb-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #93a5ae; flex-shrink: 0; }
.usb-status[data-open="true"]::before { background: #129a79; }
.usb-details { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.usb-details dl { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.usb-details dt, #firmware-status { color: var(--muted); font-size: 12px; }
.usb-details dd { margin-top: 4px; font: 650 14px var(--mono); }
.usb-error { margin-top: 10px; color: #a22e23; }
.table-scroll { overflow-x: auto; margin: 0 18px; }
table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.settings-table { min-width: 422px; }
thead { background: #edf3f6; }
thead th { color: #415a67; font-size: 12px; font-weight: 650; white-space: nowrap; }
thead th:first-child { border-radius: 7px 0 0 7px; }
thead th:last-child { border-radius: 0 7px 7px 0; }
th, td { padding: 0 8px; text-align: left; height: 41px; }
thead th { height: 36px; }
th small { font: 10px var(--mono); color: var(--muted); }
tbody tr { border-bottom: 1px solid #edf1f3; }
tbody tr[data-enabled="true"] { background: #f1faf7; }
.channel-name, .adc-code { font: 650 13px var(--mono); white-space: nowrap; }
.settings-table th:nth-child(1) { width: 17%; }
.settings-table th:nth-child(2) { width: 25%; }
.settings-table th:nth-child(3) { width: 21%; }
.settings-table th:nth-child(4) { width: 24%; }
.settings-table :is(th, td):last-child { text-align: center; }
input[type="number"], select { width: 100%; height: 33px; border: 1px solid #cfdce3; border-radius: 6px; color: var(--ink); background: #fff; padding: 4px 6px; }
input[type="number"] { font: 13px var(--mono); }
select { font: inherit; font-size: 13px; }
input:disabled, select:disabled { background: #f2f5f6; }
input[type="number"]:invalid { border-color: #b84d45; }
.toggle { accent-color: var(--accent); width: 17px; height: 17px; margin: 0; vertical-align: middle; cursor: pointer; }
.note { padding: 12px 18px 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.run-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 0 18px; padding: 12px 0 16px; border-top: 1px solid var(--line); }
.duration { display: flex; gap: 6px; align-items: center; }
.duration input { width: 64px; }
.run-controls .actions { margin-left: auto; }
.badge { border-radius: 999px; background: #edf3f6; color: #4c6472; padding: 5px 8px; font-size: 11px; white-space: nowrap; }
.badge[data-live="true"] { background: #e4f5ee; color: #076957; }
.current-figure { margin: 0 18px; }
.current-plot { position: relative; border: 1px solid var(--line); border-radius: 8px; }
.adc-chart { display: block; width: 100%; height: auto; }
.plot-background { fill: #f7fafb; }
.plot-grid { fill: none; stroke: #dae4e9; stroke-width: 1; }
.plot-labels { fill: var(--muted); font: 11px var(--mono); }
#adc-series path { fill: none; stroke: var(--channel-color); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
#adc-series circle { fill: var(--channel-color); stroke: #fff; stroke-width: 1; }
.plot-empty { position: absolute; top: 47%; left: 53%; transform: translate(-50%, -50%); color: var(--muted); background: #f7fafb; padding: 5px 8px; border-radius: 6px; font-size: 12px; text-align: center; width: max-content; max-width: 75%; }
.current-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 12px; }
.adc-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 12px 18px 0; }
.adc-channel { display: flex; align-items: center; gap: 5px; padding: 5px 6px; min-height: 31px; border-color: var(--line); }
.adc-channel .channel-name, .adc-code { font-size: 11px; }
.adc-swatch { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--channel-color); }
.adc-channel[aria-pressed="false"] { background: #f1f5f7; color: var(--muted); }
.adc-channel[aria-pressed="false"] .adc-swatch { background: transparent; border: 1px solid var(--channel-color); }
.adc-code { margin-left: auto; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) and (min-width: 861px) {
  .adc-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
  main { padding-top: 18px; }
}
@media (max-width: 485px) {
  .usb-head { flex-wrap: wrap; }
  .usb-panel { padding: 16px; }
  .panel-head { padding-inline: 12px; }
  .table-scroll, .run-controls, .current-figure, .adc-legend { margin-inline: 12px; }
  .adc-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-table { min-width: 318px; }
  .settings-table th, .settings-table td { padding-inline: 4px; }
  .settings-table th small { display: block; }
  .settings-table th:nth-child(1) { width: 16%; }
  .settings-table th:nth-child(3) { width: 20%; }
  .settings-table th:nth-child(4) { width: 27%; }
  .run-controls .actions { margin-left: 0; }
}
