:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #1d232b; --muted: #5d6874; --line: #dde2e8;
  --accent: #2459c2; --accent-ink: #ffffff; --ok: #1d7a46; --warn: #a15c00; --err: #b3261e;
  --code: #f0f2f5; --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
header { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
header h1 { font-size: 17px; margin: 0; }
header .sub { color: var(--muted); }
header .right { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--muted); }
a { color: var(--accent); }
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  padding: 6px 12px; border-radius: 6px; cursor: pointer; text-decoration: none; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { font: inherit; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px;
  background: var(--panel); color: var(--ink); }
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; width: 100%; }
label { color: var(--muted); }
main { display: grid; grid-template-columns: 380px 1fr; gap: 16px; padding: 16px 20px; max-width: 1600px; margin: 0 auto; }
@media (max-width: 1000px) { main { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.panel h2 { font-size: 14px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
.tabs button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; padding: 6px 10px; color: var(--muted); }
.tabs button.on { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
tbody tr.pick { cursor: pointer; }
tbody tr.pick:hover { background: var(--code); }
tbody tr.sel { background: #e3ebfb; }
.scroll { max-height: 260px; overflow: auto; }
.tag { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 11px; background: var(--code); }
.tag.train { background: #fde9c8; color: #7a4600; }
.tag.test { background: #d7f0df; color: #135c33; }
.tag.validation { background: #dbe7fb; color: #1c4590; }
.note { padding: 8px 10px; border-radius: 6px; background: #fff6e5; border: 1px solid #f1d39b; margin: 8px 0; }
.error { padding: 8px 10px; border-radius: 6px; background: #fdecea; border: 1px solid #f2b8b5; color: var(--err); margin: 8px 0; }
#log { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; background: #11161c; color: #d6dde5;
  border-radius: 6px; padding: 8px 10px; min-height: 80px; max-height: 260px; overflow: auto; white-space: pre-wrap; }
#log .t { color: #7d8a97; } #log .dt { color: #9fd3a6; float: right; } #log .err { color: #ff8a80; }
.progress { height: 6px; background: var(--code); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress div { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.stat { background: var(--code); border-radius: 6px; padding: 8px 10px; }
.stat .v { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat .k { color: var(--muted); font-size: 12px; }
#viewer { width: 100%; height: 480px; position: relative; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.slices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.slices figure { margin: 0; }
.slices canvas { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.slices figcaption { color: var(--muted); font-size: 12px; text-align: center; }
.cbar { height: 10px; border-radius: 3px; margin-top: 2px; }
.cbar-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.seg button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
footer { padding: 16px 20px 30px; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.6; }
footer a, header a { color: inherit; }
.guide { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.guide h2 { font-size: 16px; margin: 22px 0 8px; }
.guide td, .guide th { padding: 4px 8px; vertical-align: top; }

.hidden { display: none !important; }
.login { max-width: 360px; margin: 12vh auto; }
.login input { width: 100%; margin-bottom: 10px; }
