:root { --accent: #1f6fd1; --line: #d9dde3; --muted: #667085; --bg: #f6f7f9; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 system-ui, "Segoe UI", Arial, sans-serif; color: #1d2433; background: #fff; }
header { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
header nav { margin-left: auto; display: flex; gap: 4px; }
.muted { color: var(--muted); }
button, .button, select, input { font: inherit; }
button, .button { padding: 6px 12px; border: 1px solid var(--line); background: #fff; border-radius: 6px;
  cursor: pointer; color: inherit; text-decoration: none; display: inline-block; }
button:hover, .button:hover { border-color: var(--accent); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.small { padding: 2px 8px; font-size: 12px; }
button:disabled { opacity: .5; cursor: default; }
.tab.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
main { padding: 16px; }
.tab-page { display: none; }
.tab-page.active { display: flex; gap: 16px; align-items: flex-start; }
#tab-results.active, #tab-validation.active { display: block; }
.panel { width: 300px; flex: none; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.panel h3 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.panel h3:first-child { margin-top: 0; }
.panel select { width: 100%; }
.row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.row > label:first-child { min-width: 52px; }
.row input[type=number] { width: 72px; }
.hint { color: var(--muted); font-size: 12px; margin: 4px 0; }
.upload { display: inline-block; margin-top: 6px; color: var(--accent); cursor: pointer; font-size: 13px; }
.stage { flex: 1; min-width: 0; }
.notice { background: #eef4fd; border: 1px solid #c9dcf6; border-radius: 6px; padding: 8px 12px; margin-bottom: 8px; }
.notice.warn { background: #fff6e5; border-color: #f2d49b; }
canvas { display: block; max-width: 100%; border: 1px solid var(--line); border-radius: 4px; cursor: crosshair; }
.timeline { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.timeline input[type=range] { flex: 1; }
.timeline .play { min-width: 56px; }
.timeline .rate { width: auto; padding: 1px 2px; font-size: 12px; }
.playback { max-width: 820px; margin-top: 12px; }
#res-canvas { cursor: default; }
.hint.warn { color: #b54708; }
.progress { position: relative; height: 18px; background: #e4e7ec; border-radius: 9px; margin: 8px 0; overflow: hidden; }
.progress div { height: 100%; width: 0; background: var(--accent); }
.progress span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; }
.hidden { display: none !important; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar h2 { margin: 0 auto 0 0; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(320px, 1.3fr); gap: 24px; margin-top: 12px; }
table { border-collapse: collapse; width: 100%; margin-bottom: 8px; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; }
td:not(:first-child), th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.images img { max-width: 100%; display: block; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 4px; }
.cards { display: flex; gap: 12px; flex-wrap: wrap; margin: 12px 0; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 200px; }
.card b { font-size: 20px; display: block; }
#val-scatter { max-width: 900px; width: 100%; display: block; margin-bottom: 12px; }
#start_s, #end_s { width: 104px !important; }
.login { margin: 48px auto; }
.login input:not([type]), .login input[type=password] { flex: 1; min-width: 0; }
.login .row > label:first-child { min-width: 72px; }
.login button { margin-top: 8px; width: 100%; }
