:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #192c3c;
  background: #edf2f6;
  line-height: 1.55;
}
* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 1040px; margin: 0 auto; padding: 36px 20px; }
header { margin-bottom: 28px; }
h1 { font-size: clamp(1.6rem, 5vw, 2rem); margin: 0; font-weight: 600; }
h2 { font-size: 1.1rem; margin: 0; }
p { margin: 12px 0; }
header > p:last-child { color: #536675; }
section { background: #fff; border: 1px solid #d6e0e8; border-radius: 12px; padding: 22px; margin: 18px 0; }
.section-heading, .actions, .command-row { display: flex; align-items: center; gap: 10px; }
.section-heading { justify-content: space-between; flex-wrap: wrap; }
.actions { flex-wrap: wrap; }
button, input, select, textarea { font: inherit; }
button { background: #14685c; border: 1px solid #14685c; color: white; border-radius: 7px; padding: 9px 15px; cursor: pointer; }
button.secondary { color: #243e50; background: #f3f6f9; border-color: #c9d6df; }
button:hover:not(:disabled) { filter: brightness(.93); }
button:disabled { opacity: .48; cursor: not-allowed; }
:focus-visible { outline: 3px solid #d18419; outline-offset: 3px; }
.badge { padding: 4px 10px; border-radius: 4px; background: #eaf0f4; font-size: .85rem; }
.badge[data-state="connected"] { color: #07503b; background: #d9f5e8; }
.connection-options { margin-top: 18px; }
.options { display: grid; gap: 8px; margin-top: 12px; }
.options input { accent-color: #14685c; }
.notice { background: #fff8e8; color: #644714; border: 1px solid #e6ca8e; padding: 14px; border-radius: 4px; overflow-wrap: anywhere; }
a { color: #245a8a; }
pre { background: #18222c; color: #e1e7ed; border-radius: 4px; padding: 16px; height: 340px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: .88rem/1.6 ui-monospace, monospace; }
form label { display: block; margin-bottom: 7px; font-weight: 600; }
.command-row input { min-width: 0; flex: 1; border: 1px solid #9bacbb; padding: 10px 12px; border-radius: 4px; font-family: ui-monospace, monospace; }
.hint, footer { color: #536675; font-size: .85rem; font-weight: 400; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; }
.config-grid label { font-size: .9rem; margin: 0; }
.config-grid input, .config-grid select { display: block; width: 100%; margin-top: 7px; padding: 10px 12px; border: 1px solid #b5c5d0; border-radius: 7px; background: #fff; color: #192c3c; }
.config-grid :disabled { background: #f3f6f9; color: #6b7d88; }
.config-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 20px; }
.config-footer p { max-width: 520px; }
.config-footer button { flex-shrink: 0; }
.measurement-actions { border-top: 1px solid #dfe6ec; padding-top: 20px; margin-top: 20px; }
#recording-panel .section-heading { margin-bottom: 18px; }
.recording-metadata { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 18px 24px; }
.recording-metadata label { font-size: .9rem; font-weight: 600; }
.recording-metadata input, .recording-metadata textarea { display: block; width: 100%; min-width: 0; margin-top: 7px; padding: 10px 12px; border: 1px solid #b5c5d0; border-radius: 7px; background: #fff; color: #192c3c; font-weight: 400; }
.recording-metadata textarea { resize: vertical; min-height: 90px; }
.recording-metadata :disabled { background: #f3f6f9; color: #6b7d88; }
#recording-metadata-note[data-error="true"] { color: #9d3827; }
h3 { font-size: .95rem; margin: 0 0 12px; font-weight: 600; }
.recording-progress { margin-top: 18px; }
.progress-heading, .progress-times { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.progress-heading { font-size: .85rem; font-weight: 600; }
.recording-progress progress { display: block; width: 100%; height: 10px; margin: 10px 0; border: 0; border-radius: 8px; overflow: hidden; background: #e5ecef; accent-color: #14685c; }
.recording-progress progress::-webkit-progress-bar { background: #e5ecef; border-radius: 8px; }
.recording-progress progress::-webkit-progress-value { background: #14685c; border-radius: 8px; }
.recording-progress progress::-moz-progress-bar { background: #14685c; border-radius: 8px; }
.recording-progress > p { font-size: .75rem; margin-bottom: 0; }
.browser-setup { margin: 12px 0; }
.browser-setup label { display: block; margin-bottom: 8px; }
#config-status[data-error="true"] { color: #9d3827; }
#preview-canvas { display: block; width: 100%; height: 420px; background: #f8fafb; border: 1px solid #dfe6ec; border-radius: 7px; }
.preview-window { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; font-size: .9rem; font-weight: 600; }
.preview-window select { width: auto; min-width: 160px; padding: 10px 12px; border: 1px solid #b5c5d0; border-radius: 7px; background: #fff; color: #192c3c; font-weight: 400; cursor: pointer; }
.preview-window select:hover { border-color: #14685c; }
.preview-counters { display: flex; flex-wrap: wrap; gap: 12px 26px; font-size: .85rem; margin-top: 12px; color: #536675; }
#preview-loss[data-loss="true"] { color: #a34424; }
.preview-statistics { margin-top: 16px; font-size: .85rem; }
.preview-statistics dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; }
.preview-statistics dd { margin: 0; font-variant-numeric: tabular-nums; }
.sd-files { list-style: none; padding: 0; margin: 14px 0 0; max-height: 300px; overflow-y: auto; border: 1px solid #dfe6ec; border-radius: 7px; }
.sd-files:empty { display: none; }
.sd-files li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 12px 14px; }
.sd-files li + li { margin: 0; border-top: 1px solid #dfe6ec; }
.sd-file-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.sd-file-name { font: .9rem ui-monospace, monospace; font-weight: 600; }
.sd-file-info { flex: 1; min-width: 0; }
.sd-file-metadata { display: grid; gap: 3px; flex-basis: 100%; font-size: .85rem; color: #536675; white-space: pre-wrap; overflow-wrap: anywhere; }
.sd-files button { font-size: .85rem; }
#sd-status[data-error="true"] { color: #9d3827; }
.sd-progress { margin-top: 16px; }
.sd-progress progress { display: block; width: 100%; height: 12px; accent-color: #14685c; }
.sd-progress p { margin-bottom: 0; font-variant-numeric: tabular-nums; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { color: #536675; font-size: .85rem; margin-bottom: 8px; padding: 0; }
fieldset p { margin-bottom: 0; }
summary { cursor: pointer; font-weight: 600; }
details + details { border-top: 1px solid #dfe6ec; margin-top: 16px; padding-top: 16px; }
li + li { margin-top: 6px; }
footer { border-top: 1px solid #d6dce2; margin-top: 24px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 9px; border-bottom: 1px solid #dfe6ec; vertical-align: top; }
code { font-family: ui-monospace, monospace; }
td:first-child { min-width: 240px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  main { padding: 22px 12px; }
  section { padding: 16px; }
  .section-heading { align-items: flex-start; }
  pre { height: 300px; }
  .config-grid, .recording-metadata { grid-template-columns: 1fr; }
  .config-footer { align-items: stretch; flex-direction: column; gap: 8px; }
  .browser-setup .command-row { flex-wrap: wrap; }
}
