:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #0f172a; --text-2: #334155; --muted: #64748b; --muted-2: #94a3b8; --line: #e5e7eb; --line-2: #d0d5dd;
  --accent: #2f5aa8; --accent-2: #2f5aa8; --accent-ink: #1e3d73; --accent-bg: #edf2fa; --accent-hover: #264b8c;
  --ok: #15803d; --ok-bg: #ecfdf3; --bad: #c0362c; --bad-bg: #fef3f2; --warn: #a15c07; --warn-bg: #fffaeb;
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05); --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, .08); --shadow-lg: 0 8px 24px rgba(16, 24, 40, .14);
  --ring: 0 0 0 3px rgba(47, 90, 168, .18);
  --font: "Pretendard Variable", "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .row·label의 display: flex가 숨김을 덮어쓰지 않게 */
body { margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14.5px; line-height: 1.5; letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; }
button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; }
button:hover { border-color: #b8bfca; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { filter: brightness(1.05); }
button:disabled { opacity: .5; cursor: default; }
input, select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input[type=number] { width: 90px; }
input.path { flex: 1; min-width: 260px; }
h2 { margin: 0 0 4px; font-size: 20px; font-weight: 600; }
h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.lead { color: var(--muted); margin: 0 0 14px; }
.muted { color: var(--muted); }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 17px; white-space: nowrap; }
.brand .sub { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.steps { display: flex; gap: 6px; flex: 1; justify-content: center; }
.step { border-radius: 999px; padding: 6px 14px; color: var(--muted); white-space: nowrap; }
.step .n { display: inline-block; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: var(--line);
  color: var(--text); font-size: 12px; text-align: center; margin-right: 6px; }
.step.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.step.active .n { background: var(--accent); color: #fff; }
.step.done .n { background: var(--ok); color: #fff; }
.step.stale .n { background: var(--warn); color: #fff; }
.files { display: flex; gap: 6px; }
.guard { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin: 0 0 12px; border-radius: 8px;
  background: var(--warn-bg); color: var(--warn); }
.guard span { flex: 1 1 280px; }
.toolbar { margin-bottom: 6px; }
.toolbar .grow { flex: 1; }
.viewopt { position: relative; }
.viewopt summary { list-style: none; cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.viewopt summary::-webkit-details-marker { display: none; }
.viewopt summary::after { content: " ▾"; color: var(--muted); }
.viewopt-box { position: absolute; z-index: 20; top: 38px; left: 0; display: flex; flex-direction: column; gap: 10px; padding: 12px;
  min-width: 260px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.viewopt-box label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
details.keys, details.adv { margin-top: 10px; }
details.keys summary, details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.adv[open] summary { margin-bottom: 6px; }
.dropzone { margin: 8px 0; padding: 14px; border: 2px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; }
#step-data.drag .dropzone { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.fmt { margin: 6px 0 10px; }
.fmt summary { cursor: pointer; color: var(--accent); }
.fmt p { margin: 8px 0; }
.fmt table.tab { font-size: 13px; }
button.ex-sel { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); font-weight: 600; }
.flow-svg .row-grip { cursor: grab; }
.flow-svg .row-grip rect { fill: #fff; stroke: #9aa3af; stroke-dasharray: 3 2; }
.flow-svg .row-grip:hover rect { stroke: var(--accent); fill: var(--accent-bg); stroke-dasharray: none; }
.flow-svg .row-grip text { font-size: 12px; fill: #6b7280; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pitem.off { opacity: .62; }
.pitem .fit { display: block; font-style: normal; font-size: 11px; color: var(--warn); margin-top: 2px; }
.loading { padding: 18px 4px; }
.skip-task { margin: -6px 0 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.auto-task { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--accent-bg); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.auto-task button { padding: 3px 10px; font-size: 13px; }
.split-note { font-size: 13px; margin: 8px 0 0; }
.verdict { grid-column: 1 / -1; margin-top: 10px; padding: 10px 12px; border-radius: 8px; font-size: 14px; line-height: 1.5; }
.verdict div { color: var(--text); margin-top: 4px; }
.verdict.good { background: var(--ok-bg); color: var(--ok); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }

.message { margin: 12px 20px 0; padding: 10px 40px 10px 14px; border-radius: 8px; background: var(--bad-bg); color: var(--bad); position: relative; }
.message.ok { background: var(--ok-bg); color: var(--ok); }
.message .hint { color: var(--text); }
.message pre { white-space: pre-wrap; font-size: 12px; color: var(--text); max-height: 240px; overflow: auto; }
.message .x { position: absolute; right: 6px; top: 6px; border: none; background: transparent; font-size: 18px; color: inherit; }

main { padding: 16px 20px 40px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.or { color: var(--muted); }
.status { color: var(--muted); font-size: 14px; }
.status.busy::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid var(--accent-bg); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.train-bar { height: 4px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 2px 0 12px; }
.train-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); }
.train-bar.indet > i { width: 30%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .status.busy::before, .train-bar.indet > i { animation-duration: 3s; } }
.more { margin: 8px 0; }
.train-opts { margin: 12px 0; }
.more summary { cursor: pointer; color: var(--muted); }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 16px; margin: 10px 0; align-items: end; }
.grid4 label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.grid4 label.check { flex-direction: row; align-items: center; color: var(--text); }
.btn-cell { display: flex; align-items: end; }
.next { display: flex; justify-content: flex-end; margin-top: 14px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.card { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 20px; font-weight: 600; }
.preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.preview .pv { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.preview.table { display: block; overflow-x: auto; }
.preview.thumbs { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.preview.thumbs .pv { display: flex; flex-direction: column; align-items: center; gap: 4px; }
svg.img { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.chans { display: flex; flex-wrap: wrap; gap: 4px; }
table.tab { border-collapse: collapse; font-size: 13px; }
table.tab th, table.tab td { border: 1px solid var(--line); padding: 4px 8px; text-align: right; white-space: nowrap; }
table.tab th { background: var(--bg); font-weight: 600; }
table.tab .lab { font-weight: 600; background: var(--accent-bg); }
.tag { font-size: 13px; font-weight: 500; color: var(--accent); background: var(--accent-bg); border-radius: 999px; padding: 2px 10px; vertical-align: middle; }
.tcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 8px 0 16px; }
.tcard { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--card); cursor: pointer; }
.tcard:hover { border-color: var(--accent); }
.tcard.sel { border: 2px solid var(--accent); background: #f5f7ff; padding: 11px 13px; }
.tcard.soon { opacity: .55; cursor: not-allowed; }
.tcard .ti { font-size: 24px; }
.tcard .tn { font-weight: 600; font-size: 15px; }
.tcard .td { font-size: 13px; color: var(--text); line-height: 1.4; }
.tcard .te { font-size: 12px; color: var(--muted); line-height: 1.4; }
.badge { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: #eceef1; color: var(--muted); vertical-align: middle; }
.badge.rec { background: var(--accent); color: #fff; }
.badge.fast { background: #e1f5ee; color: #11734f; } .badge.mid { background: #fdf3dc; color: #8a5a00; } .badge.slow { background: #faece7; color: #a8401c; }
.scatter-box { margin-top: 10px; }
.series-box { margin: 8px 0; }
input.path.short { flex: 0 1 260px; min-width: 200px; }
.series-info { margin-bottom: 8px; }
.series-guide { background: var(--warn-bg); color: var(--text); border-radius: 8px; padding: 10px 14px; margin-top: 8px; font-size: 14px; }
.series-guide ol { margin: 6px 0 0; padding-left: 20px; }
.series-guide code { background: #fff; padding: 0 4px; border-radius: 4px; }
.preview .pv .lab { font-size: 12px; color: var(--muted); }

.issues { list-style: none; padding: 0; margin: 8px 0; }
.issues li { padding: 6px 10px; border-radius: 6px; background: var(--bad-bg); color: var(--bad); margin-bottom: 4px; font-size: 14px; }
.issues li .hint { color: var(--text); display: block; font-size: 13px; }
.issues li.muted { background: transparent; color: var(--muted); padding-left: 0; }

.model-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr) 320px; gap: 14px; margin-top: 8px; }
.side { display: flex; flex-direction: column; gap: 10px; max-height: 76vh; overflow: auto; }
.palette { display: flex; flex-direction: column; gap: 6px; max-height: 76vh; overflow: auto; }
.pcat { font-size: 12px; color: var(--muted); margin: 8px 0 0; font-weight: 600; }
.pitem { text-align: left; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border: 1px solid var(--line);
  border-left: 4px solid var(--line); border-radius: 6px; background: #fff; cursor: grab; user-select: none; }
.pitem:active { cursor: grabbing; }
.pitem { cursor: grab; user-select: none; }
.pitem.nudge { animation: nudge .5s; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(6px); } 75% { transform: translateX(-4px); } }
.canvas.dragging { outline: 2px dashed var(--accent); outline-offset: -4px; }
.flow-svg .drop { stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.flow-svg .band { fill: rgba(47, 90, 168, .08); stroke: var(--accent); stroke-dasharray: 4 3; }
.keys { font-size: 12px; line-height: 1.6; margin-top: 12px; }
.flow-svg .drop-dot { fill: var(--accent); }
.pitem b { font-weight: 600; font-size: 14px; }
.pitem span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pitem.p-cnn { border-left-color: #1d9e75; } .pitem.p-act { border-left-color: #7f77dd; }
.pitem.p-rnn { border-left-color: #d85a30; } .pitem.p-struct { border-left-color: #888780; }
.canvas { border: 1px solid var(--line); border-radius: 10px; background: #fbfbfc; overflow: auto; max-height: 76vh;
  min-height: 420px; display: block; padding: 8px; }
.flow-svg { font-family: inherit; user-select: none; flex: none; display: block; }
.palette { user-select: none; }
.flow-svg .t1 { font-size: 13px; font-weight: 600; fill: #1d2330; text-anchor: middle; dominant-baseline: central; }
.flow-svg .t2 { font-size: 12px; fill: #6b7280; text-anchor: middle; dominant-baseline: central; }
.flow-svg .box { stroke-width: 1; }
.flow-svg .c-teal { fill: #e1f5ee; stroke: #1d9e75; } .flow-svg .c-purple { fill: #eeedfe; stroke: #7f77dd; }
.flow-svg .c-coral { fill: #faece7; stroke: #d85a30; } .flow-svg .c-gray { fill: #f1efe8; stroke: #888780; }
.flow-svg .c-add { fill: #ffffff; stroke: #888780; }
.flow-svg .fb, .flow-svg .fg { cursor: pointer; }
.flow-svg .fb:hover rect { stroke-width: 2; }
.flow-svg .fb.sel rect { stroke: var(--accent); stroke-width: 2.6; }
.flow-svg .fb.bad rect { stroke: #c0392b; stroke-width: 2; }
.flow-svg .fb.bad .t2 { fill: #c0392b; }
.flow-svg .fb.loose .box { stroke: #9aa3af; stroke-dasharray: 6 4; stroke-width: 1.6; }
.flow-svg .fb.loose .t2 { fill: #6b7280; }
.flow-svg .grp { fill: rgba(30, 40, 60, 0.025); stroke: #9aa3af; stroke-dasharray: 5 4; stroke-width: 1; }
.flow-svg .fg.sel .grp { stroke: var(--accent); stroke-width: 2; }
.flow-svg .fg.bad .grp { stroke: #c0392b; }
.flow-svg .glabel { font-size: 12px; font-weight: 600; fill: #4b5563; }
.flow-svg .edge { fill: none; stroke: #6b7280; stroke-width: 1.4; }
.flow-svg .edge.skip { stroke: #1d9e75; stroke-dasharray: 4 3; }
.flow-svg .slabel { font-size: 11px; fill: #1d9e75; }
.flow-svg .edge.sel { stroke: var(--accent); stroke-width: 2.6; }
.flow-svg .edge-hit { fill: none; stroke: transparent; stroke-width: 12; cursor: pointer; }
.flow-svg .port { fill: #ffffff; stroke: var(--accent); stroke-width: 1.5; cursor: crosshair; }
.flow-svg .port.in { stroke: #9aa3af; }
.flow-svg .rsz { fill: var(--accent); stroke: #fff; stroke-width: 1.5; cursor: nwse-resize; }
.size-fld .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.size-fld input { width: 72px; }
.flow-svg .port:hover { fill: var(--accent); stroke: var(--accent); }
.ctx-menu { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .16); min-width: 210px; max-height: 72vh; overflow: auto; display: flex; flex-direction: column; }
.ctx-menu.layers { display: grid; grid-template-columns: 1fr 1fr; min-width: 340px; }
.ctx-menu.layers .ctx-title { grid-column: 1 / -1; }
.ctx-menu button { text-align: left; border: none; background: transparent; padding: 6px 10px; border-radius: 6px; font-size: 14px; cursor: pointer; }
.ctx-menu button:hover:not(:disabled) { background: var(--accent-bg); }
.ctx-menu button:disabled { color: #b0b4bb; cursor: default; }
.ctx-menu button.danger { color: var(--bad); }
.ctx-menu .ctx-title { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; font-weight: 600; }
.ctx-menu hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; grid-column: 1 / -1; }
.flow-svg .fb { cursor: grab; }
.flow-svg .grp-head { fill: transparent; cursor: grab; }
.flow-svg .edge.exit { stroke-dasharray: none; }
.flow-svg .brk { font-size: 12px; fill: var(--accent); font-weight: 700; }
.flow-svg .t2b { font-size: 12px; fill: #374151; text-anchor: middle; dominant-baseline: central; }
.flow-svg .t3 { font-size: 10px; fill: #6b7280; text-anchor: middle; dominant-baseline: central; }
.flow-svg .fb.sel circle.box { stroke: var(--accent); stroke-width: 2.6; }
.flow-svg .fb.bad circle.box { stroke: #c0392b; stroke-width: 2; }
.drag-ghost { position: fixed; pointer-events: none; z-index: 1000; padding: 6px 10px; border-radius: 8px; background: #fff;
  border: 1px solid var(--accent); box-shadow: 0 4px 14px rgba(0, 0, 0, .12); font-size: 13px; white-space: nowrap; }
.flow-svg .entry { fill: #9aa3af; }
.flow-svg .wire { stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; }
.flow-svg .wire, .flow-svg .drop, .flow-svg .band, .flow-svg .entry, .flow-svg #snap { pointer-events: none; }
.flow-svg .snap { fill: rgba(47, 90, 168, .08); stroke: var(--accent); stroke-width: 1.6; stroke-dasharray: 6 4; }
.flow-svg .fb.sel .box.c-add { stroke: var(--accent); stroke-width: 2.6; }
.pitem.p-merge { border-left-color: var(--accent); }
.fld ol.ins { margin: 4px 0 0; padding-left: 20px; font-size: 13px; }
.fld ol.ins button { padding: 0 6px; margin-left: 4px; }
#settings h4 { margin: 0 0 4px; font-size: 15px; }
#settings .fld { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--muted); margin: 8px 0; }
#settings .fld input, #settings .fld select { width: 100%; }
#settings .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#settings .acts button { font-size: 13px; padding: 4px 8px; }
#settings .danger { color: var(--bad); }
#settings .err { color: var(--bad); font-size: 13px; background: var(--bad-bg); padding: 6px 8px; border-radius: 6px; }
.issues li { cursor: pointer; }
.box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fff; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }
.kv .v { font-weight: 600; text-align: right; }
.kv .full { grid-column: 1 / -1; }
.bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); }

.flow { display: flex; flex-direction: column; gap: 6px; }
.flow .fs { border-left: 3px solid var(--line); padding: 2px 0 2px 8px; }
.flow .fs .name { font-size: 13px; font-weight: 600; }
.flow .fs .shape { font-size: 12px; color: var(--muted); }
.flow .fs.bad { border-left-color: var(--bad); }
.flow.wide .fs svg:not(.img) { width: 100%; max-width: 760px; }

.train-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin: 12px 0; }
.curve { width: 100%; height: 220px; }

.warns { list-style: none; padding: 0; margin: 8px 0 0; }
.warns li { padding: 6px 10px; border-radius: 6px; background: var(--warn-bg); color: var(--warn); margin-bottom: 4px; font-size: 13px; }
.warns li .hint { color: var(--text); display: block; }
table.cm { border-collapse: collapse; margin-top: 10px; font-size: 13px; }
table.cm th, table.cm td { border: 1px solid var(--line); padding: 4px 8px; text-align: right; }
table.cm th { background: var(--bg); font-weight: 600; }
table.cm td.diag { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.cm-cap { font-size: 12px; color: var(--muted); margin-top: 4px; }
.checks { list-style: none; padding: 0; margin: 10px 0; }
.checks li { padding: 6px 10px; border-radius: 6px; margin-bottom: 4px; font-size: 14px; }
.checks li.ok { background: var(--ok-bg); color: var(--ok); }
.checks li.bad { background: var(--bad-bg); color: var(--bad); }
.checks li .hint { color: var(--text); display: block; font-size: 13px; }
.gpus { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.gpu { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; cursor: pointer; min-width: 180px; }
.gpu.sel { border-color: var(--accent); background: var(--accent-bg); }
.gpu.busy { border-style: dashed; }
.gpu.off { opacity: .5; cursor: not-allowed; }
.gpu .t { font-weight: 600; }
.gpu .s { font-size: 12px; color: var(--muted); }

@media (max-width: 900px) {
  .model-layout, .train-layout { grid-template-columns: 1fr; }
  .palette { flex-direction: row; flex-wrap: wrap; }
  .top { flex-wrap: wrap; }
}

/* ------------------------------------------------------------ 라벨링 작업실 */
.btn-link { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); text-decoration: none; }
.lab-progress { flex: 1; max-width: 640px; }
.lab-bar { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; display: flex; }
.lab-bar .done { background: var(--ok); } .lab-bar .unconf { background: #e0b44c; }
.lab-bar-text { font-size: 12px; color: var(--muted); margin-top: 3px; }
.lab-title { font-weight: 600; margin-right: 8px; }
.lab-panel { margin: 8px 0; }
.lab-classes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.lab-chip { border: 1px solid var(--c, var(--line)); border-left-width: 6px; border-radius: 999px; padding: 4px 12px; background: var(--card); cursor: pointer; }
.lab-chip .key { display: inline-block; min-width: 18px; font-size: 11px; color: var(--muted); }
.lab-chip .n { color: var(--muted); font-size: 12px; }
.lab-chip.on { background: var(--c); color: #fff; } .lab-chip.on .key { color: #fff; }
.lab-chip.add { border-style: dashed; border-left-width: 1px; color: var(--muted); }
.lab-layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 12px; align-items: start; }
.lab-filters label { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.lab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.lab-card { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--card); cursor: pointer; user-select: none; }
.lab-card:hover { border-color: #b8bfca; }
.lab-card.sel { outline: 2px solid var(--accent); outline-offset: -1px; background: #f5f7ff; }
.lab-card.cur { box-shadow: 0 0 0 3px rgba(47, 90, 168, .25); }
.lab-card.bad { border-color: var(--bad); }
.lab-card svg { width: 100%; height: 46px; display: block; }
.lab-name { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lab-err { font-size: 11px; color: var(--bad); height: 46px; overflow: hidden; }
.lab-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; }
.lab-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--c); color: #fff; border: 1px solid var(--c); }
.lab-tag.unconf { background: #fff; color: var(--c); border-style: dashed; }
.lab-tag.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.lab-note { font-size: 12px; color: var(--muted); }
.lab-p { font-size: 11px; color: var(--muted); }
.lab-thumb { height: 46px; display: flex; justify-content: center; }
.lab-thumb svg.lab-img { width: 46px; height: 46px; border: 1px solid var(--line); }
.lab-bigimg { width: 100%; max-height: 360px; object-fit: contain; display: block; margin: 0 auto; border: 1px solid var(--line); background: #fff; }
.lab-bigimg.px { image-rendering: pixelated; }   /* 작은 그림은 크게, 픽셀 그대로 */
.lab-row { max-height: 320px; overflow: auto; }
.lab-numbar input { width: 120px; }
.lab-strip { display: block; width: 100%; height: 6px; margin-top: 2px; }
.lab-seglist { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.lab-boxwrap { position: relative; width: 100%; line-height: 0; user-select: none; }
.lab-boximg { width: 100%; height: auto; display: block; border: 1px solid var(--line); }
.lab-boximg.px { image-rendering: pixelated; }
#lab-boxsvg { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.lab-tag.sel { outline: 2px solid var(--accent); }
.lab-conf { color: var(--warn); font-size: 13px; }
.lab-conflict { background: var(--warn-bg); border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 14px; }
.lab-who { margin-left: auto; }
#lab-d-num { width: 160px; }
.lab-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 8px; }
.lab-group { border: 1px solid var(--line); border-radius: 8px; padding: 6px; }
.lab-group svg { width: 100%; height: 40px; display: block; }
.lab-gl { font-size: 11px; color: var(--muted); margin: 2px 0; }
.lab-pager { justify-content: center; }
.lab-right { position: sticky; top: 8px; }
.lab-dhead { justify-content: space-between; }
.lab-dname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-big { cursor: grab; user-select: none; touch-action: none; }
.lab-dlabels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lab-notefld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 8px 0; }
.lab-notefld textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.lab-stats { margin-top: 8px; }
.grid4 label.wide { grid-column: span 2; }

/* studio 화면: 창에 딱 맞게 (페이지는 스크롤 없음, 안쪽 칸만 스크롤). ③ 모델은 판이 남는 공간을 다 씀 */
body.app { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
body.app > .top { flex: none; }
body.app > .message { position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 60; margin: 0;
  width: max-content; max-width: min(960px, 92vw); box-shadow: 0 6px 20px rgba(0, 0, 0, .14); }
body.app > main { flex: 1; min-height: 0; overflow: auto; padding-bottom: 16px; }
body.app #step-model:not([hidden]) { height: 100%; box-sizing: border-box; display: flex; flex-direction: column; }
body.app #step-model > h2, body.app #step-model > .lead, body.app #step-model > .row, body.app #step-model > .next { flex: none; }
body.app #step-model > .lead { margin: 4px 0 8px; }
body.app #step-model .model-layout { flex: 1; min-height: 0; }
body.app #step-model .model-layout > * { max-height: none; min-height: 0; height: 100%; box-sizing: border-box; }
label.inline { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }

/* 좁은 창: 머리 단추 글자가 세로로 깨지지 않게, 자리가 모자라면 다음 줄로 */
.top { flex-wrap: wrap; row-gap: 8px; }
.files button { white-space: nowrap; }

/* 코드로 보기 창 */
.dialog { position: fixed; inset: 0; background: rgba(20, 24, 33, 0.45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog-box { background: var(--card); border-radius: 12px; width: min(980px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.dialog-head { display: flex; align-items: center; gap: 14px; }
.dialog-head .x { margin-left: auto; border: none; background: transparent; font-size: 20px; }
.tabs { display: flex; gap: 4px; }
.tab { border-radius: 999px; padding: 4px 12px; }
.tab.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
pre.code { margin: 0; flex: 1; min-height: 200px; overflow: auto; background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: 12.5px/1.5 Consolas, "D2Coding", "Malgun Gothic", "Apple SD Gothic Neo", monospace; white-space: pre; tab-size: 4; }
#code-note { margin: 0; }

/* 웹 버전: 준비 중 알림 */
.web-boot { position: fixed; left: 50%; top: 72px; transform: translateX(-50%); z-index: 60; background: var(--accent-bg);
  color: var(--accent); border: 1px solid var(--accent); border-radius: 8px; padding: 10px 16px; max-width: calc(100% - 32px); }
body.web input[readonly] { background: #f6f7f9; }

/* 웹 버전: 내 프로젝트 */
.proj-btn { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-color: var(--accent); color: var(--accent); }
.proj-status { font-size: 12px; color: var(--muted); white-space: nowrap; align-self: center; }
.proj-status.bad { color: var(--bad); }
.proj-box { width: min(760px, 100%); }
.proj-where p { margin: 4px 0; }
.proj-list { list-style: none; margin: 0; padding: 0; overflow: auto; border-top: 1px solid var(--line); }
.proj-list li { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.proj-list li.cur { background: var(--accent-bg); }
.proj-list .pn { flex: 1; min-width: 160px; font-weight: 600; }
.proj-list .pt { color: var(--muted); font-size: 12px; }
.proj-list .bad { color: var(--bad); }
.proj-status.link { color: var(--accent); text-decoration: underline; cursor: pointer; }

/* 첫 화면 '내 프로젝트' (웹) */
.home-start { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.home-tabs { margin: 0 0 8px; }
.proj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin: 10px 0 16px; }
.proj-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.proj-card:hover { border-color: var(--accent); }
.proj-card.cur { border-color: var(--accent); background: var(--accent-bg); }
.proj-card .pn { font-weight: 600; }
.proj-card .pm { font-size: 13px; }
.proj-card .pt { font-size: 12px; color: var(--muted); }
.proj-card .pa { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.proj-card .pa button { padding: 3px 10px; font-size: 13px; }
.step.home-step .n { background: transparent; color: inherit; width: auto; margin-right: 4px; }

/* ④ 학습 기록, 틀린 샘플 모아 보기 */
.table-wrap { overflow-x: auto; }
table.runs td:nth-child(3) { text-align: left; }
table.runs tr.cur td { background: var(--accent-bg); }
table.runs tr.other td { color: var(--muted); }
table.runs .best { color: #b7791f; font-size: 12px; font-weight: 600; }
table.runs .acts-cell { text-align: left; }
table.runs .acts-cell button { padding: 2px 8px; font-size: 12px; }
button.x-small { border: none; background: transparent; color: var(--muted); }
#runs-box { margin-top: 14px; }
table.cm.pick td[data-cell] { cursor: pointer; }
table.cm.pick td[data-cell]:hover { outline: 2px solid var(--accent); }
.cm-pick { margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.cm-pick-head { display: flex; align-items: center; gap: 6px; }
.cm-pick-head .x { margin-left: auto; border: none; background: transparent; font-size: 16px; padding: 0 4px; }
.cm-items { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cm-items button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; font-size: 11px; }

/* ③ 블록 미리보기 */
.preview-box h3 { display: flex; align-items: center; gap: 6px; }
.preview-box .x { margin-left: auto; border: none; background: transparent; font-size: 16px; padding: 0 4px; }
#preview-body svg { max-width: 100%; height: auto; }
#preview-body p { font-size: 12px; margin: 6px 0 0; }

/* ⑤ 추론 */
.predict-table tr.bad td { background: var(--bad-bg); }
.predict-table td:first-child { text-align: left; }
#predict-result .table-wrap { max-height: 480px; overflow: auto; }

h3 .muted { font-weight: 400; font-size: 13px; }


/* ============================================================ 디자인 (사이드바 앱 틀 · 글꼴 · 단추 · 카드) */
a { color: var(--accent); }
button { min-height: 36px; padding: 7px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--text-2);
  font-weight: 500; box-shadow: var(--shadow-xs); transition: background .12s, border-color .12s, box-shadow .12s, color .12s; }
button:hover:not(:disabled) { background: #f9fafb; border-color: #c3c8d0; color: var(--text); }
button:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; }
button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; filter: none; }
button.lg { min-height: 44px; padding: 10px 20px; font-size: 15px; border-radius: 10px; }
button.ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: #f1f5f9; border-color: transparent; }
button.ghost.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
button.x, button.x-small, .cm-pick-head .x, .preview-box .x, .message .x, .dialog-head .x { min-height: 0; box-shadow: none; }
input, select, textarea { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; color: var(--text);
  box-shadow: var(--shadow-xs); transition: border-color .12s, box-shadow .12s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input[type=checkbox] { min-height: 0; box-shadow: none; accent-color: var(--accent); width: 16px; height: 16px; }
details > summary { cursor: pointer; }
h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
h3 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.lead { font-size: 15px; color: var(--muted); margin: 0 0 22px; max-width: 860px; }
.tag { background: var(--accent-bg); color: var(--accent-ink); font-weight: 600; font-size: 12px; padding: 3px 10px; }
.badge { font-weight: 600; padding: 2px 8px; background: #f1f5f9; color: var(--muted); }
.badge.rec { background: var(--accent-bg); color: var(--accent-ink); }

/* 앱 틀: 왼쪽 사이드바 + 오른쪽 내용 */
body.app { display: grid; grid-template-columns: 256px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100vh; overflow: hidden; }
body.app > .top { grid-column: 1; grid-row: 1; position: static; display: flex; flex-direction: column; align-items: stretch; flex-wrap: nowrap;
  gap: 4px; padding: 18px 14px 14px; background: #fff; border-right: 1px solid var(--line); border-bottom: none; overflow-y: auto; }
body.app > main { grid-column: 2; grid-row: 1; min-height: 0; overflow: auto; padding: 28px 36px 40px; }
body.app .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 14px; cursor: pointer; }
.brand svg { flex: none; border-radius: 8px; }
.brand .bt { display: flex; flex-direction: column; font-size: 16.5px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
.brand .sub { margin: 0; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.proj-switch { display: flex; flex-direction: column; gap: 4px; padding: 10px; margin: 0 0 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fafbfc; }
.ps-label { font-size: 11px; font-weight: 600; color: var(--muted-2); letter-spacing: .04em; }
.proj-btn { max-width: none; width: 100%; text-align: left; border: none; background: transparent; box-shadow: none; padding: 0; min-height: 0;
  color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-btn:hover:not(:disabled) { background: transparent; color: var(--accent); }
.proj-status { font-size: 11.5px; color: var(--muted); white-space: normal; }
.steps { display: flex; flex-direction: column; gap: 2px; flex: none; justify-content: flex-start; }
.nav-label { font-size: 11px; font-weight: 650; letter-spacing: .06em; color: var(--muted-2); padding: 14px 10px 6px; }
.step { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; text-align: left; border: none; border-radius: 10px;
  padding: 7px 10px; background: transparent; box-shadow: none; color: var(--text-2); white-space: nowrap; }
.step:hover:not(:disabled) { background: #f4f5f8; border: none; }
.step.active, .step.active:hover:not(:disabled) { background: var(--accent-bg); color: var(--accent-ink); }
.step .n { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 8px;
  background: #f1f5f9; color: #475569; font-size: 12.5px; font-weight: 700; line-height: 1; }
.step.active .n { background: var(--accent); color: #fff; }
.step.done .n { background: var(--ok-bg); color: var(--ok); font-size: 0; }
.step.done .n::after { content: "✓"; font-size: 13px; }
.step.stale .n { background: var(--warn-bg); color: var(--warn); }
.step.home-step .n { width: 26px; margin: 0; background: #f1f5f9; color: #475569; }
.step.home-step.active .n { background: var(--accent); color: #fff; }
.step .sl { display: flex; flex-direction: column; font-size: 14px; font-weight: 600; line-height: 1.25; }
.step .sl small { font-size: 11.5px; font-weight: 450; color: var(--muted); }
.step.active .sl small { color: #3e6bb8; }
.files { margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.files button { width: 100%; }

/* 단계 화면: 흰 카드 하나 + 큰 제목 */
main > .panel { max-width: 1320px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 34px 34px; box-shadow: var(--shadow-sm); }
main > #step-model { max-width: none; padding: 22px 24px 20px; }
main > #step-model > h2 { font-size: 21px; }
.box { border-radius: var(--r-md); border-color: var(--line); padding: 16px; box-shadow: var(--shadow-xs); }
.card { background: #f8fafc; border: 1px solid #eef0f4; border-radius: var(--r-md); padding: 12px 14px; }
.card .v { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.next { margin-top: 22px; gap: 8px; }
.row { gap: 10px; margin: 10px 0; }
.tcards { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 12px; }
.tcard { border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; gap: 6px; box-shadow: var(--shadow-xs); min-height: 0;
  transition: border-color .12s; }
.tcard:hover:not(:disabled) { border-color: var(--accent); background: #fff; }
.tcard.sel { border: 2px solid var(--accent); background: #f6f8fc; padding: 15px; box-shadow: none; }
.tcard .ti { font-size: 26px; }
.tcard .tn { font-size: 15.5px; font-weight: 700; }
.tcard .td { color: var(--text-2); }
h3 { margin-top: 10px; }
.dropzone { border: 1.5px dashed #c7cdd6; border-radius: var(--r-md); background: #fafbfc; padding: 22px; font-weight: 500; }
.guard { border-radius: var(--r-md); background: var(--warn-bg); border: 1px solid #fedf89; }
.verdict { border-radius: var(--r-md); }
.issues li, .warns li { border-radius: var(--r-sm); }
table.tab th, table.tab td, table.cm th, table.cm td { border-color: #eaecf0; padding: 6px 10px; }
table.tab th, table.cm th { background: #f8fafc; color: var(--text-2); }
.canvas { border-radius: var(--r-md); background-color: #fbfcfd; background-image: radial-gradient(#dde1e8 1px, transparent 1px); background-size: 18px 18px; }
.pitem { border-radius: 10px; padding: 9px 11px; box-shadow: var(--shadow-xs); transition: box-shadow .12s, transform .12s; }
.pitem:hover { border-color: #b8bfca; }
.pcat { font-size: 11px; letter-spacing: .04em; color: var(--muted-2); margin: 12px 0 2px; }
.viewopt summary { border-color: var(--line-2); border-radius: var(--r-sm); min-height: 36px; display: flex; align-items: center; box-shadow: var(--shadow-xs); }
.viewopt-box { border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.ctx-menu { border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.dialog-box { border-radius: var(--r-lg); padding: 18px 20px; }
.tab { min-height: 32px; padding: 4px 14px; box-shadow: none; }
.tab.active { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-bg); }

/* 알림: 오른쪽 아래 토스트 */
body.app > .message { position: fixed; top: auto; left: auto; right: 24px; bottom: 24px; transform: none; z-index: 60; margin: 0;
  width: max-content; max-width: min(480px, calc(100vw - 32px)); background: #fff; color: var(--text); border: 1px solid var(--line);
  border-left: 4px solid var(--bad); border-radius: var(--r-md); padding: 14px 42px 14px 16px; box-shadow: var(--shadow-lg); animation: toast .18s ease-out; }
body.app > .message.ok { border-left-color: var(--ok); }
.message #msg-text { font-weight: 650; }
.message .hint { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.message .x { color: var(--muted); }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.web-boot { top: 24px; left: calc(50% + 128px); border: 1px solid #c9d6ec; background: #fff; color: var(--accent-ink); border-radius: var(--r-md);
  box-shadow: var(--shadow-md); padding: 12px 18px; font-weight: 500; }

/* 첫 화면: 소개 + 기능 + 프로젝트 */
main > #step-home { background: transparent; border: none; box-shadow: none; padding: 4px 0 24px; max-width: 1180px; }
.hero-cta { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.video-box { width: min(1120px, 100%); }
.video-box video { display: block; width: 100%; max-height: calc(100vh - 110px); aspect-ratio: 16 / 10; border-radius: 8px; background: #0f172a; }
.fi { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg); color: var(--muted); }
.sec-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.sec-head h2 { font-size: 20px; margin: 0 6px 0 0; }
.sec-head .grow { flex: 1; }
.proj-where p { font-size: 13px; color: var(--muted); }
.proj-cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 12px 0 20px; }
.proj-card { border-radius: var(--r-md); padding: 16px; gap: 6px; box-shadow: none; transition: border-color .12s; }
.proj-card:hover { border-color: #b8bfca; }
.proj-card.cur { border-color: var(--accent); background: #fff; box-shadow: none; }
.pc-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.proj-card .pn { font-size: 15px; font-weight: 700; line-height: 1.35; }
.proj-card .pm { font-size: 13px; color: var(--muted); }
.pc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; padding-top: 10px; border-top: 1px solid #f1f2f5; }
.proj-card .pa { margin: 0; gap: 2px; }
.proj-card .pa button { min-height: 28px; padding: 2px 8px; font-size: 12.5px; }
.empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 36px 16px;
  border: 1.5px dashed #d5d9e0; border-radius: var(--r-md); background: #fff; color: var(--muted); }
.empty b { color: var(--text); font-size: 15px; }
.use-note { font-size: 12.5px; }
.tag:empty { display: none; }
/* ② 데이터: 예시 카드 + 넣는 방법 카드 */
.sec-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 26px 0 10px; }
.sec-title h3 { margin: 0; font-size: 16px; }
.sec-title .muted { font-size: 13px; }
#step-data > .lead + .sec-title { margin-top: 4px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.ex-card { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; padding: 12px 14px; min-height: 64px;
  border-radius: var(--r-md); color: var(--text); position: relative; }
.ex-card:hover:not(:disabled) { border-color: var(--accent); background: #fff; }
.ex-card .ex-name { font-weight: 650; font-size: 14px; line-height: 1.35; padding-right: 54px; }
.ex-card .ex-meta { font-size: 12.5px; color: var(--muted); font-weight: 450; }
.ex-card.sel { border: 2px solid var(--accent); background: var(--accent-bg); padding: 11px 13px; }
.ex-check { position: absolute; top: 10px; right: 10px; font-size: 11.5px; font-weight: 650; color: var(--accent-ink); background: #fff;
  border-radius: 999px; padding: 2px 8px; box-shadow: inset 0 0 0 1px #c9d6ec; }
.src-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.src-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: #fff; box-shadow: var(--shadow-xs); }
.src-head { display: flex; flex-direction: column; gap: 2px; }
.src-head b { font-size: 14.5px; }
.src-head span { font-size: 12.5px; color: var(--muted); }
.src-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.src-row input.path { flex: 1 1 160px; min-width: 0; }
.src-row .grow { flex: 1; }
.src-card .dropzone { margin: 0; padding: 16px; font-size: 13px; }
.src-card .fmt { margin: 0; font-size: 13.5px; }
#step-data .more { margin-top: 18px; }
.panel:not(.is-empty) > .empty-step { display: none; }
.panel.is-empty > :not(h2):not(.empty-step) { display: none !important; }
.empty-step { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 56px 24px 64px;
  border: 1.5px dashed #d5d9e0; border-radius: var(--r-lg); background: #fafbfc; color: var(--muted); }
.empty-step b { font-size: 18px; color: var(--text); }
.empty-step > span { max-width: 520px; line-height: 1.6; }
.es-icon { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 14px;
  background: var(--accent-bg); color: var(--accent); margin-bottom: 4px; }
.es-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.step.locked:not(.active) { opacity: .5; }
.step.locked:not(.active) .n { background: #f1f5f9; color: var(--muted-2); }

/* 좁은 창: 사이드바 → 위쪽 막대 */
@media (max-width: 1000px) {
  body.app { display: flex; flex-direction: column; height: 100vh; }
  body.app > .top { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-right: none; border-bottom: 1px solid var(--line); overflow: visible; }
  body.app > main { flex: 1; padding: 16px; }
  .brand { padding: 0; } .brand .sub { display: none; }
  .proj-switch { flex-direction: row; align-items: center; padding: 4px 10px; margin: 0; } .ps-label { display: none; } .proj-status { white-space: nowrap; }
  .steps { flex-direction: row; flex-wrap: wrap; } .nav-label { display: none; }
  .step { width: auto; min-height: 36px; padding: 4px 10px; } .step .sl small { display: none; }
  .files { margin: 0; flex-direction: row; border: none; padding: 0; } .files button { width: auto; }
      main > .panel { padding: 20px; }
  .web-boot { left: 50%; }
}
.proj-card .pt { white-space: nowrap; }
.proj-card .pa { display: flex; flex-wrap: nowrap; }
#lab-jobs .pc-foot { flex-wrap: wrap; gap: 6px; }
#lab-jobs .pc-foot .pa { margin-left: auto; }
button.icon { min-height: 30px; width: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
button.icon svg { width: 16px; height: 16px; }
body.app #step-model.is-empty:not([hidden]) { height: auto; display: block; }

/* 라벨링 페이지 (body.lab): 위쪽 막대 + 넓은 내용 */
body.lab { min-height: 100vh; }
body.lab > .top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: #fff;
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
body.lab .brand { display: flex; align-items: center; gap: 10px; }
body.lab .brand svg { border-radius: 8px; }
body.lab .brand .bt { display: flex; flex-direction: column; font-size: 16px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.2; }
body.lab .brand .sub { margin: 0; font-size: 11.5px; font-weight: 500; color: var(--muted); }
body.lab .files { display: flex; flex-direction: row; gap: 8px; margin: 0 0 0 auto; align-items: center; padding: 0; border-top: 0; }
body.lab .btn-link { min-height: 36px; display: inline-flex; align-items: center; border-radius: var(--r-sm); border-color: var(--line-2); font-weight: 500; }
body.lab > main { padding: 24px 28px 40px; }
body.lab main > .panel { max-width: 1480px; }
body.lab > .message { position: fixed; top: auto; left: auto; right: 24px; bottom: 24px; transform: none; z-index: 60; margin: 0;
  width: max-content; max-width: min(480px, calc(100vw - 32px)); background: #fff; color: var(--text); border: 1px solid var(--line);
  border-left: 4px solid var(--bad); border-radius: var(--r-md); padding: 14px 42px 14px 16px; box-shadow: var(--shadow-lg); }
body.lab > .message.ok { border-left-color: var(--ok); }
.lab-job { display: flex; flex-direction: column; min-width: 0; max-width: 280px; }
.lab-job-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lab-progress { flex: 1; min-width: 220px; }
.lab-tools { gap: 8px; }

.job-bar { height: 6px; border-radius: 999px; background: #eef0f4; overflow: hidden; margin-top: 4px; }
.job-bar span { display: block; height: 100%; background: var(--ok); }
.lab-chip { min-height: 32px; box-shadow: none; }
/* studio ② 라벨링한 데이터 */
.label-jobs { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.label-job { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border: 1px solid #eef0f4; border-radius: 10px; background: #fafbfc; }
.label-job > div { display: flex; flex-direction: column; min-width: 0; }
.label-job b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.label-job .muted { font-size: 12px; }
.label-job button { min-height: 30px; padding: 3px 10px; font-size: 13px; flex: none; }
.lab-extra { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); grid-column: 1 / -1; }
.lab-extra-cols { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text); }
.lab-extra-cols label.check { display: inline-flex; align-items: center; gap: 4px; }
body.lab .files button, body.lab .btn-link { white-space: nowrap; }
.proj-card .pa button { white-space: nowrap; }

/* 라벨링: 도형 도구 (상자·다각형·점) */
.shape-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.shape-tools .tool { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 10px; font-size: 13.5px; }
.shape-tools .tool.on { background: var(--accent-bg); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }
.shape-tools kbd { font: 600 10.5px/1 var(--font); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 4px; background: #fff; }
.lab-boxwrap #lab-boxsvg { cursor: crosshair; }
#lab-boxsvg [data-i] { cursor: move; }
#lab-boxsvg .shape-vertex { fill: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }
#lab-boxsvg .shape-mid { fill-opacity: .55; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: copy; }
#lab-boxsvg .shape-handle { cursor: nwse-resize; }
#lab-boxsvg .draft-first { cursor: pointer; }
#lab-boxsvg .shape-text { pointer-events: none; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.shape-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.shape-item { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 8px 3px 10px; font-size: 13px; border-radius: 999px; box-shadow: none; }
.shape-item .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.shape-item .muted { font-size: 12px; }
.shape-item .x { color: var(--muted); padding: 0 2px; font-size: 15px; line-height: 1; }
.shape-item .x:hover { color: var(--bad); }
.shape-item.sel { border-color: var(--c); background: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
#lab-boxsvg .shape-hit { fill: transparent; stroke: none; cursor: grab; }
#lab-boxsvg .shape-hit.shape-handle { cursor: nwse-resize; }
#lab-boxsvg .shape-hit.shape-radius { cursor: ew-resize; }
#lab-boxsvg .shape-hit.draft-first { cursor: pointer; }
#lab-boxsvg .shape-vertex, #lab-boxsvg .shape-mid, #lab-boxsvg .shape-handle-look { pointer-events: none; }

/* 객체 탐지: 그림 위 상자 */
.det-img { border-radius: 6px; background: #111; display: block; }
.det-img .det-text { font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 2px; stroke-linejoin: round; }
.det-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; margin: 10px 0; }
.det-card { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.det-card .det-img { width: 100%; height: auto; }
.det-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; margin: 6px 0; }
.det-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-right: 5px; vertical-align: -1px; }
#det-box h3 { margin: 0; }
.det-th b { color: var(--ink, #111); min-width: 34px; display: inline-block; }
.det-head { justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.det-head input[type=range] { vertical-align: middle; width: 140px; }
.det-help { font-size: 12px; line-height: 1.5; margin-top: 8px; }
#data-preview .det-legend { flex-basis: 100%; }
.preview.thumbs.det { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.preview.thumbs.det .det-img { width: 100%; height: auto; max-width: 220px; }

/* 블록 목록: 범주를 누르면 펼침 · 위에 찾기 */
.palette { gap: 6px; }
.palette .psearch { width: 100%; min-height: 36px; padding: 6px 10px; border-radius: var(--r-sm); border-color: var(--line-2); position: sticky; top: 0; z-index: 1; }
.palette .psearch:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.palette .plist { display: flex; flex-direction: column; gap: 4px; }
.pcat-btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border: 1px solid var(--line); border-left: 4px solid var(--cc, var(--line-2)); border-radius: var(--r-sm);
  background: #fff; font-size: 13.5px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-xs); }
.pcat-btn:hover { border-color: var(--line-2); border-left-color: var(--cc, var(--line-2)); background: #fafbff; }
.pcat-btn em { font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--muted); background: #f2f4f7; border-radius: 999px; padding: 1px 8px; }
.pcat-btn::after { content: "▸"; color: var(--muted-2); font-size: 11px; margin-left: 2px; transition: transform .15s; }
.pcat-btn em { margin-left: auto; }
.pcat-btn.on { background: var(--accent-bg); color: var(--accent-ink); border-color: #c9d6ec; border-left-color: var(--cc, var(--accent)); }
.pcat-btn.on::after { transform: rotate(90deg); color: var(--accent); }
.pitems { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 8px 8px; border-left: 2px solid #dde6f4; margin-left: 6px; }
.p-dense { --cc: #888780; } .p-conv { --cc: #1d9e75; } .p-pool { --cc: #15a37a; } .p-up { --cc: #0e8a6a; } .p-rnn { --cc: #d85a30; }
.p-attn { --cc: #2563eb; } .p-tf { --cc: #2f5aa8; } .p-norm { --cc: #d97706; } .p-act { --cc: #7f77dd; } .p-reg { --cc: #6b7280; }
.p-merge { --cc: var(--accent); } .p-shape { --cc: #94a3b8; } .p-prep { --cc: #db2777; } .p-aug { --cc: #e11d48; } .p-pack { --cc: #0f172a; }
.pitem[class*="p-"] { border-left-color: var(--cc); }
.flow-svg .c-blue { fill: #e8f0fe; stroke: #2563eb; } .flow-svg .c-amber { fill: #fef3e2; stroke: #d97706; }
.flow-svg .c-pink { fill: #fdeef4; stroke: #db2777; }

/* 어텐션 열지도 (샘플 따라가기) */
.attn { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; margin-top: 6px; padding: 6px 8px; background: #fef2f2; border-radius: 6px; }
.attn svg, .attn img { max-width: 100%; height: auto; }
.attn-top { border: 1px solid #fecaca; border-radius: 8px; padding: 8px; background: #fff7f7; }
.attn-top svg { max-width: 100%; height: auto; }
.attn-cols { border-collapse: collapse; font-size: 12px; }
.attn-cols td { padding: 1px 6px; white-space: nowrap; }
.attn-cols td:first-child { text-align: right; color: #374151; }
.attn-cols td:last-child { color: #6b7280; font-variant-numeric: tabular-nums; }
.attn-cols span { display: inline-block; height: 10px; border-radius: 2px; vertical-align: middle; }

/* 판 확대·축소 */
.zoom { display: inline-flex; gap: 0; }
.zoom button { border-radius: 0; margin: 0 -1px 0 0; min-width: 34px; }
.zoom button:first-child { border-radius: 8px 0 0 8px; }
.zoom button:last-child { border-radius: 0 8px 8px 0; }
#zoom-reset { min-width: 54px; font-variant-numeric: tabular-nums; }
.canvas { touch-action: pan-x pan-y; }      /* 두 손가락 집기는 판만 확대 (페이지 확대 대신) */

/* 단계 아래 [← 이전] (왼쪽 끝) */
.next .back { margin-right: auto; }

/* 시계열 예측·이상 탐지 결과 */
.fc-box { margin: 10px 0; }
.fc-gallery, .ae-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.fc-card { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #fff; }
.fc-card.ab { border-color: #fecaca; background: #fff7f7; }
.fc-card svg, .ae-hist { max-width: 100%; height: auto; }
.fc-legend { font-size: 12px; }
.ae-at { margin: 6px 0 10px; }
#det-box .det-head button { margin-left: 8px; }

/* 과제 큰 틀 아이콘: 내 프로젝트 화면과 같은 선 그림 상자 */
.tcard .fi.ti { font-size: 0; width: 22px; height: 22px; margin-bottom: 4px; border-radius: 0; background: none; color: var(--muted); }
.tcard.soon .fi.ti { background: none; color: #94a3b8; }
.tcard.sel .fi.ti { background: none; color: var(--accent); }

/* 내 프로젝트 카드: 고른 카드 */
.proj-card.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.ae-img { image-rendering: pixelated; border: 1px solid var(--line); border-radius: 4px; margin-right: 4px; }
.seg-strip { display: block; border-radius: 2px; margin-top: 2px; }
.seg-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 10px; }
table.tab td.seg-cell { text-align: left; }
.loss-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.loss-k { font-weight: 600; color: var(--text-2); }
.loss-term { display: inline-flex; align-items: center; gap: 4px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--accent-bg); }
.loss-term input.lw { width: 76px; } .loss-term .lopt input[type=number] { width: 56px; } .loss-term .lopt { font-size: 12.5px; color: var(--muted); }
.loss-term .ldel { border: 0; background: none; padding: 0 4px; color: var(--muted); }
.lplus { color: var(--muted); }
.loss-parts { margin-top: 6px; font-size: 12.5px; }
.loss-box .loss-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; }
.loss-row .loss-k { min-width: 92px; }
.loss-row .ladd { padding: 2px 8px; }
.head-tabs { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.head-tabs button { border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; background: none; }
.head-tabs button[aria-selected="true"] { background: var(--accent-bg); border-color: var(--accent); }
.loss-box.multi { flex-direction: column; align-items: stretch; }
.loss-box.multi #loss-terms { display: flex; flex-direction: column; gap: 6px; }
.loss-box.multi > .loss-k { align-self: flex-start; }
.loss-row .loss-k { font-weight: 500; color: var(--text); }
.loss-box.multi > button, .loss-box.multi > select { align-self: flex-start; }
.ch-stack { display: flex; flex-direction: column; gap: 2px; }
.series-cols { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.series-cols .chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.role-cols { display: flex; flex-wrap: wrap; gap: 6px; max-height: 180px; overflow: auto; }
.role-box .role, .csv-pick .role { display: inline-flex; gap: 6px; align-items: center; padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: none; font-size: 13px; }
.role-box .role span, .csv-pick .role span { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-box .role.r-target, .csv-pick .role.r-target { background: var(--accent-bg); border-color: var(--accent); }
.role-box .role.r-skip, .csv-pick .role.r-skip { opacity: .5; text-decoration: line-through; }
.role-box .row { margin-top: 8px; }
.runs-compare { margin-top: 10px; }
.tab.cmp th { text-align: left; color: var(--muted); font-weight: 500; }
.tab.cmp tr.diff td { font-weight: 700; background: var(--accent-bg); }
/* 휴대폰 폭: 위쪽 줄이 화면을 넘지 않게 (프로젝트 이름은 말줄임, 단계는 가로로 밀어 보기) */
@media (max-width: 600px) {
  body.app > .top { gap: 6px; padding: 8px 10px; }
  .proj-switch { min-width: 0; max-width: 100%; flex: 1 1 100%; }
  .proj-switch .proj-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .proj-switch .proj-status { display: none; }
  .steps { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .step { flex: none; padding: 4px 8px; }
  body.app > main { padding: 10px; }
  main > .panel { padding: 14px; }
  .grid4 { grid-template-columns: 1fr 1fr; }
  .loss-row .loss-k { min-width: 0; width: 100%; }
  .head-tabs button { padding: 3px 8px; font-size: 13px; }
}
@media (max-width: 1000px) {                               /* 위쪽 줄: 프로젝트 이름이 길어도 화면을 넘지 않게 */
  .proj-switch { min-width: 0; max-width: 100%; }
  .proj-switch .proj-btn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.csv-pick { margin-top: 10px; padding: 10px; border: 1px solid var(--accent); border-radius: 10px; background: var(--accent-bg); }
.csv-pick .pick-head { margin-bottom: 8px; }
.csv-pick .row { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.csv-pick .role { background: var(--card, #fff); }

/* 생성: 새 샘플·되살린 것 격자 */
.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 8px 0 14px; }
.gen-grid.wide { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.gen-grid.pair { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.gen-grid.pair.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gen-cell { display: flex; gap: 4px; justify-content: center; align-items: center; padding: 4px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); overflow: hidden; }
.gen-cell svg, .gen-cell img { max-width: 100%; height: auto; }
.gen-cell { min-width: 0; }
.gen-cell.cap { flex-direction: column; gap: 2px; }
.gen-cell.cap .muted { font-size: 12px; line-height: 1.2; }
.gen-cell.cap .gen-miss { font-size: 12px; line-height: 1.2; color: var(--bad); font-weight: 600; }

/* ⑤ 추론 과정: 왼쪽 목록 (샘플마다) · 오른쪽 상세 (단계 줄 · 확률/값 · 블록마다 값, ▶ 재생) */
.infer-split { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 16px; align-items: start; margin: 12px 0; }
.infer-list { max-height: 640px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--card); }
.infer-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 0; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; background: var(--card); text-align: left; color: var(--text); }
.infer-item:last-child { border-bottom: 0; }
.infer-item:hover:not(:disabled) { background: #f8fafc; border-color: var(--line); }
.infer-item.sel, .infer-item.sel:hover:not(:disabled) { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.infer-item .th { flex: none; width: 56px; display: flex; justify-content: center; }
.infer-item .th svg, .infer-item .th img { display: block; border-radius: 3px; }
.infer-item .bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.infer-item .nm { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.infer-item .pv { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.infer-item .pv .muted { font-size: 12px; }
.infer-item .conf { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.infer-item .conf i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.infer-item .mark { flex: none; font-weight: 700; color: var(--ok); }
.infer-item.bad .pv b, .infer-item.bad .mark { color: var(--bad); }
.infer-item.bad .conf i { background: var(--bad); }
.infer-detail { min-width: 0; }
#infer-detail { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; background: var(--card); }
#infer-panel { margin-top: 12px; }
.infer-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.infer-head .infer-who { flex: 1; min-width: 0; }
.infer-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 12px 0; }
.infer-steps .st { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }   /* 블록 칩과 뒤 화살표를 한 덩어리로 (줄 앞에 화살표만 남지 않게) */
.infer-steps .arr { color: var(--muted-2); font-size: 12px; }
.infer-steps .chip { min-height: 0; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; box-shadow: none; background: var(--bg); border-color: var(--line); }
.infer-result { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: #f8fafc; border: 1px solid #eef0f4; }
.pbars { display: grid; grid-template-columns: minmax(48px, max-content) minmax(0, 1fr) 56px; gap: 6px 10px; align-items: center; font-size: 13px; }
.pbar { display: contents; }                          /* 줄마다 따로 재지 않고 한 격자: 이름 길이가 달라도 막대 시작이 맞음 */
.pbar .pn { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pbar .pt { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pbar .pt i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--muted-2); transition: width .6s ease; }
.pbar .pp { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.pbar.best { font-weight: 700; }
.pbar.best .pt i { background: var(--accent); }
.pbar.best .pp { color: var(--accent-ink); }
.bars-zero .pbar .pt i { width: 0; transition: none; }
.pvalue { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; color: var(--muted); }
.pvalue .k { font-size: 12px; }
.pvalue > b { font-size: 26px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.pvalue > b.txt { font-size: 17px; }
.pvalue span b { color: var(--text); }
.infer-rest { display: contents; }
.infer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 4px; }
.infer-grid label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; }
.infer-grid label span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.infer-grid input[type=number] { width: 100%; min-height: 32px; padding: 4px 8px; }
.infer-detail.playing :is(.chip, .fs, .infer-result) { opacity: .25; transition: opacity .2s; }
.infer-detail.playing .past { opacity: .55; }
.infer-detail.playing .on { opacity: 1; }
.infer-detail.playing .chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.infer-detail.playing .fs.on { border-left-color: var(--accent); }
.predict-table tr[data-i], #predict-gallery [data-i] { cursor: pointer; }
.predict-table tr[data-i]:hover td { background: #f8fafc; }
.predict-table tr.sel td { background: var(--accent-bg); }
#predict-gallery [data-i].sel { outline: 2px solid var(--accent); outline-offset: 1px; }


/* 소리: 듣기 단추 · 스펙트로그램 · 녹음 */
.snd { flex: none; width: 28px; height: 28px; min-height: 0; padding: 0; border-radius: 50%; display: inline-grid; place-items: center;
  color: var(--accent); border: 1px solid var(--line-2); background: var(--card); box-shadow: none; }
.snd:hover:not(:disabled) { background: var(--accent-bg); border-color: var(--accent); }
.snd.on, .snd.on:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: #fff; }
.snd:disabled { opacity: .35; cursor: default; }
.snd.sm { width: 24px; height: 24px; }
.snd svg { width: 15px; height: 15px; display: block; }
.spec { position: relative; display: block; line-height: 0; cursor: pointer; }
.spec img { width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 4px; image-rendering: pixelated; }   /* 모델이 본 칸 그대로 */
.spec .playhead { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--bad); box-shadow: 0 0 0 1px #fff; opacity: 0; pointer-events: none; }   /* 흰 테두리: 빨간 파형 위에서도 보이게 */
.spec.playing .playhead { opacity: 1; }
.spec.wave { height: 46px; }
.spec-ax { display: grid; grid-template-columns: 34px minmax(0, 1fr); column-gap: 4px; max-width: 760px; }
.spec-ax .fq { position: relative; font-size: 10px; color: var(--muted); }
.spec-ax .fq span { position: absolute; right: 0; transform: translateY(-50%); }
.spec-ax .fq span:first-child { transform: none; }
.spec-ax .fq span:last-child { transform: translateY(-100%); }
.spec-ax .tm { grid-column: 2; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); padding-top: 2px; }
.flow .snd-row { margin: 2px 0; flex-wrap: nowrap; }
.flow .snd-row .spec { flex: 1; max-width: 722px; }
.preview.sounds { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.preview.sounds .pv { display: flex; flex-direction: column; gap: 6px; }
.preview.sounds .pv-head { display: flex; align-items: center; gap: 8px; }
.preview.sounds .spec { height: 72px; }
.infer-list.audio .infer-row { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.infer-list.audio .infer-row:last-child { border-bottom: 0; }
.infer-list.audio .infer-row .snd { margin-left: 10px; }
.infer-list.audio .infer-item { border-bottom: 0; }
.infer-list.audio .infer-item .th { width: 72px; }
.infer-list.audio .infer-row.sel { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.infer-list.audio .infer-row.sel .infer-item { background: transparent; box-shadow: none; }
button.rec { position: relative; overflow: hidden; }
button.rec.on { background: var(--bad); border-color: var(--bad); color: #fff; }
button.rec.on::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: var(--p, 0%); background: rgba(255, 255, 255, .85); }
.rec-meter { width: 90px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; visibility: hidden; }   /* 자리는 늘 잡아 둠 (녹음할 때 도구 줄이 밀리지 않게) */
.rec-meter.on { visibility: visible; }
#lab-rec { min-width: 6em; }   /* '● 녹음 R' ↔ '■ 멈추기' 같은 폭 */
#btn-predict-rec { min-width: 8.8em; }
.rec-meter i { display: block; height: 100%; width: 0; background: var(--ok); }
.cm-items .cm-item { position: relative; display: inline-block; }
.cm-items .cm-item .snd { position: absolute; top: 4px; right: 4px; }
#subtasks:has(> :nth-child(4)) { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); }   /* 분류 네 장이 한 줄 (1280·1366px) */
/* 데이터 준비: 소리 작업 */
.lab-card.audio { position: relative; }
.lab-card.audio .lab-name { padding-right: 28px; }
.lab-card.audio .snd { position: absolute; top: 4px; right: 4px; }
.lab-card.audio .lab-thumb { display: block; }
.lab-card.audio .lab-thumb .spec { height: 46px; }
.lab-audio-src { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.lab-wave { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; margin: 6px 0; }
.lab-wave .spec { flex: 1; min-width: 0; }
.lab-spec { margin: 6px 0; }
.lab-del { color: var(--bad); }
button.rec kbd { font: inherit; font-size: 11px; opacity: .7; }

/* ============================================================ 기계 패널 (2026-11-29): 직각 · 선으로 칸 나눔 · 흑백 + 신호색 주황 하나
   숫자·이름표는 고정폭 글꼴, 그래프는 파랑(정확도)·빨강(loss). 그림자·둥근 모서리·알약 모양은 쓰지 않음 */
:root {
  --bg: #ebebe8; --card: #fafaf8; --text: #111; --text-2: #2b2b2b; --muted: #6b6b66; --muted-2: #9a9a94; --line: #cfcfca; --line-2: #8f8f8a;
  --ink: #111; --sig: #ff5a1f; --accent: #111; --accent-2: #111; --accent-ink: #111; --accent-bg: #e4e4df; --accent-hover: #000;
  --ok: #157a3c; --ok-bg: #e6f0e8; --bad: #c4321f; --bad-bg: #f6e6e2; --warn: #8a5a00; --warn-bg: #f4ecd9;
  --r-sm: 0; --r-md: 0; --r-lg: 0;
  --shadow-xs: none; --shadow-sm: none; --shadow-md: none; --shadow-lg: none; --ring: 0 0 0 2px var(--ink);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, "Pretendard Variable", Pretendard, monospace;
}
*, *::before, *::after { border-radius: 0 !important; }
body { background: var(--bg); color: var(--text); }
a { color: var(--ink); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.num, .card .v, .pvalue > b, table td, .pbar .pp, #zoom-reset, .proj-status, .pt { font-variant-numeric: tabular-nums; }
.card .v, .pvalue > b, .pbar .pp, table.tab td, table.cm td { font-family: var(--mono); }
.card .k, .ps-label, .nav-label, .pcat, table.tab th, table.cm th { font-family: var(--mono); letter-spacing: .02em; }
.card .k { font-size: 11.5px; color: var(--muted); }
.ps-label, .nav-label { text-transform: uppercase; font-size: 11px; color: var(--muted); }

/* 단추·입력 */
button { min-height: 34px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); box-shadow: none; font-weight: 500; transition: background .1s; }
button:hover:not(:disabled) { background: #e6e6e2; border-color: var(--ink); color: var(--ink); }
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 1px; box-shadow: none; }
button.primary { background: var(--sig); border-color: var(--ink); color: var(--ink); font-weight: 650; }
button.primary:hover:not(:disabled) { background: #ff7a45; border-color: var(--ink); color: var(--ink); }
button.lg { min-height: 42px; font-size: 15px; }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover:not(:disabled) { background: #e6e6e2; border-color: transparent; }
button.ghost.danger:hover:not(:disabled) { color: var(--bad); background: var(--bad-bg); }
input, select, textarea { min-height: 34px; border: 1px solid var(--line-2); background: #fff; box-shadow: none; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--ink); }
.tag { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); font-family: var(--mono); font-weight: 500; }
.badge, .badge.rec { background: var(--ink); color: #fff; font-family: var(--mono); font-weight: 500; font-size: 11px; padding: 1px 6px; }
h2 { font-weight: 700; letter-spacing: -0.02em; }

/* 앱 틀: 왼쪽 단계 줄 */
body.app > .top { background: var(--card); border-right: 1px solid var(--ink); padding: 0; gap: 0; }
body.app .brand { padding: 0 14px; height: 52px; border-bottom: 1px solid var(--ink); margin: 0; flex: none; }
.brand svg { display: none; }
.brand .bt { font-family: var(--mono); font-size: 14px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.brand .sub { font-family: "Pretendard Variable", Pretendard, sans-serif; text-transform: none; letter-spacing: 0; font-weight: 500; }
.proj-switch { margin: 0; padding: 10px 14px; border: none; border-bottom: 1px solid var(--ink); background: transparent; }
.nav-label { padding: 12px 14px 6px; }
.steps { gap: 0; border-top: 1px solid var(--line); }
.step { min-height: 46px; padding: 0 14px 0 0; gap: 12px; border: none; border-bottom: 1px solid var(--line); background: transparent; color: var(--text-2); }
.step:hover:not(:disabled) { background: #e6e6e2; border: none; border-bottom: 1px solid var(--line); }
.step .n { width: 40px; height: 46px; background: transparent !important; color: var(--muted) !important; font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  border-right: 1px solid var(--line); }
.step.done .n { font-size: 0; } .step.done .n::after { content: "✓"; font-size: 13px; color: var(--ok); }
.step.stale .n { color: var(--warn) !important; }
.step.active, .step.active:hover:not(:disabled) { background: var(--ink); color: #fff; border-bottom-color: var(--ink); }
.step.active .n { color: var(--sig) !important; border-right-color: #333; }
.step.active .sl small { color: #b8b8b2; }
.step.home-step .n { width: 40px; }
.files { padding: 12px 14px; border-top: 1px solid var(--ink); gap: 6px; }

/* 단계 화면: 선으로 둘러싼 판 */
body.app > main { padding: 20px 24px 36px; }
main > .panel { background: var(--card); border: 1px solid var(--ink); padding: 0 24px 24px; }
main > .panel > h2 { margin: 0 -24px 18px; padding: 14px 24px; border-bottom: 1px solid var(--ink); font-size: 20px; }
main > #step-model { padding: 0 16px 16px; }
main > #step-model > h2 { margin: 0 -16px 14px; padding: 12px 16px; font-size: 20px; }
.lead { font-size: 14.5px; color: var(--muted); }
.box, .src-card, .ex-card, .tcard, .label-job, .fc-card, .gen-cell, #infer-detail, .infer-list, .infer-result {
  background: #fff; border: 1px solid var(--line); box-shadow: none; }
.card { background: transparent; border: none; border-left: 1px solid var(--line); padding: 4px 14px; }
.card .v { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; }
.tcard:hover:not(:disabled), .ex-card:hover:not(:disabled) { border-color: var(--ink); background: #fff; }
.tcard.sel, .ex-card.sel { border: 1px solid var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--ink); padding: 16px; }
.ex-card.sel { padding: 12px 14px; }
.tcard.sel .fi.ti { color: var(--ink); }
.ex-check { background: var(--ink); color: #fff; box-shadow: none; font-family: var(--mono); font-weight: 500; }
.dropzone, .empty, .empty-step { border: 1px dashed var(--line-2); background: transparent; }
.es-icon { background: transparent; color: var(--muted); border: 1px solid var(--line-2); }
.guard { background: var(--warn-bg); border: 1px solid var(--warn); }
.verdict { border: 1px solid var(--line-2); }
table.tab th, table.tab td, table.cm th, table.cm td { border-color: var(--line); }
table.tab th, table.cm th { background: #f0f0ec; color: var(--muted); font-size: 11.5px; font-weight: 500; }
.tab { border-color: var(--line-2); }
.tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.canvas { background-color: #f4f4f1; background-image: radial-gradient(#cfcfca 1px, transparent 1px); }
.pitem, .pcat-btn { box-shadow: none; background: #fff; }
.pcat-btn.on { background: #e6e6e2; color: var(--ink); border-color: var(--line-2); }
.pcat-btn em { background: transparent; font-family: var(--mono); }
.pitems { border-left-color: var(--line); }
.viewopt-box, .ctx-menu, .dialog-box { border: 1px solid var(--ink); box-shadow: none; }

/* 진행·확률 막대 */
.train-bar, .job-bar, .pbar .pt, .infer-item .conf, .rec-meter { background: var(--line); }
.train-bar > i, .job-bar span, .pbar.best .pt i, .infer-item .conf i { background: var(--ink); }
.pbar.best .pp { color: var(--ink); }
.infer-item.sel, .infer-item.sel:hover:not(:disabled), .infer-list.audio .infer-row.sel { background: #e6e6e2; box-shadow: inset 3px 0 0 var(--sig); }
.infer-steps .chip { background: transparent; border-color: var(--line-2); font-family: var(--mono); font-size: 11.5px; }
.infer-detail.playing .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.snd { color: var(--ink); border-color: var(--line-2); }
.snd:hover:not(:disabled) { background: #e6e6e2; border-color: var(--ink); }
.snd.on, .snd.on:hover:not(:disabled) { background: var(--ink); border-color: var(--ink); color: #fff; }
.role-box .role.r-target, .csv-pick .role.r-target, .loss-term, .head-tabs button[aria-selected="true"], .tab.cmp tr.diff td { background: #e6e6e2; border-color: var(--ink); }
.csv-pick { background: #fff; border-color: var(--ink); }
.shape-tools .tool.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.shape-item.sel { box-shadow: inset 0 0 0 1px var(--c); }

/* 알림 */
body.app > .message, body.lab > .message { border: 1px solid var(--ink); border-left: 6px solid var(--bad); box-shadow: none; animation: none; }
body.app > .message.ok, body.lab > .message.ok { border-left-color: var(--ok); }
.web-boot { border: 1px solid var(--ink); color: var(--ink); box-shadow: none; }

/* 첫 화면: 가운데 이름(블록 둘을 선으로 이은 모양) + 단추 셋 · 아래 프로젝트 칸 (과제·날짜 / 이름 · 성적) */
.home-top { text-align: center; padding: 48px 0 36px; }
.wordmark { display: inline-flex; align-items: center; margin: 0 0 28px; font-size: 68px; font-weight: 800; letter-spacing: -0.045em; line-height: 1; }
.wordmark span { padding: 10px 18px 14px; border: 2px solid var(--ink); }
.wordmark .wb { background: var(--ink); color: #fff; }
.wordmark i { width: 34px; height: 2px; background: var(--ink); }
#step-home .sec-head { border-bottom: 1px solid var(--ink); padding-bottom: 8px; margin-bottom: 0; }
#home-list { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 14px; }
#home-list .proj-card { padding: 10px 14px 12px; gap: 4px; }
#home-list .pc-top { display: flex; align-items: center; gap: 6px; min-height: 24px; margin: 0; }
#home-list .pk { flex: 1; min-width: 0; font: 11px var(--mono); letter-spacing: .04em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#home-list .pa { opacity: 0; transition: opacity .1s; }
#home-list .proj-card:hover .pa, #home-list .proj-card.sel .pa, #home-list .pa:focus-within { opacity: 1; }
#home-list .pa button.icon { min-height: 24px; width: 24px; }
#home-list .pc-main { display: flex; align-items: baseline; gap: 12px; }
#home-list .pn { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; line-height: 1.35; }
#home-list .pv { font: 600 22px/1 var(--mono); letter-spacing: -0.03em; white-space: nowrap; }
#home-list .pv.none { color: var(--muted-2); font-weight: 400; }
.use-note { text-align: center; color: var(--muted-2); }

main > #step-home { padding: 0 0 24px; }
.sec-head h2 { font-size: 18px; }
.proj-cards { gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.proj-card { border: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--card); padding: 14px 16px; box-shadow: none; }
.proj-card:hover { border-color: var(--line); background: #fff; }
.proj-card.sel, .proj-card.cur { border-color: var(--line); box-shadow: inset 0 0 0 2px var(--ink); background: #fff; }
.pc-foot { border-top-color: var(--line); }
.proj-card .pt { font-family: var(--mono); font-size: 11.5px; }
.proj-cards > .empty { border: none; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* 데이터 준비 페이지 */
body.lab > .top { background: var(--card); border-bottom: 1px solid var(--ink); }
.lab-card.cur { box-shadow: inset 0 0 0 2px var(--ink); }
.next .back.primary, #predict-inputs button.primary { background: var(--card); border-color: var(--ink); font-weight: 600; }
.next .back.primary:hover:not(:disabled), #predict-inputs button.primary:hover:not(:disabled) { background: #e6e6e2; }
button.rec.on { background: var(--bad); border-color: var(--ink); color: #fff; }
.fill, #data-preview td.fill { background: var(--warn-bg); color: var(--warn); font-style: italic; }   /* 평균으로 채운 빈 칸 */
.card .v .fill { padding: 0 4px; }
.sal-key { display: inline-flex; align-items: center; gap: 5px; margin-left: 10px; font-size: 12px; font-weight: 400; color: var(--muted); }
.sal-key i { width: 28px; height: 8px; background: linear-gradient(90deg, #cbd5e1, rgb(239, 68, 68)); }   /* 범례: 회색(덜) → 빨강(크게) */
/* 데이터 준비: 자른 토막의 자리 (원본 위의 창) */
.lab-cut { margin: 8px 0; }
.lab-cut-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.lab-cut-head .muted { flex: 1; font-size: 12.5px; }
.lab-cut-head button { min-height: 28px; padding: 2px 10px; font-size: 12.5px; }
.lab-cut-map { position: relative; height: 36px; border: 1px solid var(--line); cursor: pointer; background: #fff; }
.lab-cut-map img { display: block; width: 100%; height: 100%; }
.lab-cut-map i { position: absolute; top: -1px; bottom: -1px; border: 2px solid var(--sig); background: rgba(255, 90, 31, .12); pointer-events: none; }

/* ============================================================ 좁은 화면 (태블릿·휴대폰, 2026-11-29부터 지원): 왼쪽 단계 줄 → 위쪽 막대 */
@media (max-width: 1000px) {
  body.app > .top { flex-direction: row; flex-wrap: wrap; align-items: stretch; gap: 0; padding: 0; border-right: none; border-bottom: 1px solid var(--ink); }
  body.app .brand { order: 1; height: 44px; border-bottom: 1px solid var(--line); padding: 0 12px; }
  .brand .sub { display: none; }
  .proj-switch { order: 2; flex: 1 1 0; min-width: 0; flex-direction: row; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
  .ps-label { display: none; }
  .files { order: 3; flex-direction: row; align-items: center; gap: 6px; margin: 0; padding: 0 10px; border-top: none; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
  .files button { width: auto; min-height: 30px; padding: 2px 10px; font-size: 13px; }
  .steps { order: 4; flex: 1 1 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; border-top: none; }
  .steps::-webkit-scrollbar { display: none; }
  .nav-label { display: none; }
  .step { flex: none; width: auto; min-height: 42px; padding: 0 12px 0 0; gap: 8px; border-bottom: none; border-right: 1px solid var(--line); }
  .step:hover:not(:disabled) { border-bottom: none; }
  .step .n { width: 32px; height: 42px; }
  .step .sl small { display: none; }
  body.app > main { padding: 12px; }
  main > .panel { padding: 0 14px 18px; }
  main > .panel > h2 { margin: 0 -14px 14px; padding: 11px 14px; font-size: 18px; }
  main > #step-model { padding: 0 10px 12px; }
  main > #step-model > h2 { margin: 0 -10px 10px; padding: 10px; }
  #home-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body.app .brand { flex: 1 1 auto; }
  .proj-switch { order: 3; flex: 1 1 100%; border-left: none; padding: 6px 12px; min-height: 34px; }
  .proj-switch .proj-status { display: none; }
  .files { order: 2; }
  .files #btn-label { padding: 2px 8px; }
  .step.home-step .sl { display: none; }
  .steps.only-home { display: none; }
  .step.home-step { padding-right: 0; }
  body.app > main { padding: 8px; }
  main > .panel { padding: 0 12px 16px; }
  main > .panel > h2 { margin: 0 -12px 12px; padding: 10px 12px; font-size: 17px; }
  .lead { font-size: 13.5px; margin-bottom: 14px; }
  .home-top { padding: 26px 0 22px; }
  .wordmark { font-size: clamp(26px, 10.5vw, 68px); margin-bottom: 20px; }
  .wordmark span { padding: 5px 9px 8px; border-width: 2px; }
  .wordmark i { width: 14px; }
  .hero-cta button.lg { min-height: 40px; padding: 6px 14px; font-size: 14px; }
  #home-list { grid-template-columns: 1fr; }
  #step-home .sec-head { gap: 8px; }
  #step-home .sec-head h2 { font-size: 17px; }
  input.path { min-width: 0; }
}

@media (max-width: 900px) {                               /* ③ 모델: 화면 높이에 맞추지 않고 위에서 아래로 (그림 칸이 가장 크게) */
  body.app #step-model:not([hidden]) { height: auto; display: block; }
  body.app #step-model .model-layout > * { height: auto; }
  body.app #step-model .model-layout .canvas { height: 62vh; min-height: 320px; max-height: none; }
  body.app #step-model .model-layout .palette { max-height: 210px; }
  body.app #step-model .model-layout .side { max-height: none; }
  #step-model .row.toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  #step-model .row.toolbar > * { flex: none; }
  #step-model .row.toolbar .grow { flex: 1 0 8px; }
}
@media (max-width: 900px) {                               /* ④ 학습·⑤ 추론: 넓은 표(혼동 행렬·기록)만 가로로 밀어 보기, 나머지는 화면 폭 */
  .train-layout > *, .infer-split > * { min-width: 0; }
  #train-confusion, #train-scatter, .table-wrap, #predict-table-wrap, #sample-flow { overflow-x: auto; max-width: 100%; }
  #curve svg, #train-scatter svg { max-width: 100%; height: auto; }
  .infer-split { grid-template-columns: 1fr; }
  .infer-list { max-height: 300px; }
}

table.cm tr:first-child th:first-child { white-space: nowrap; }   /* 정답↓ 예측→ 칸이 세로로 쪼개지지 않게 */
@media (max-width: 640px) {                               /* 데이터 준비 페이지 (폰) */
  body.lab > .top { padding: 6px 10px; gap: 6px; }
  body.lab .brand .sub { display: none; }
  body.lab > .top { position: static; }
  body.lab .files { gap: 4px; flex-wrap: wrap; margin-left: 0; }
  body.lab .lab-progress { min-width: 0; flex-basis: 100%; }
  body.lab .files button, body.lab .btn-link { min-height: 30px; padding: 2px 8px; font-size: 12.5px; }
  body.lab > main { padding: 8px; }
}
@media (max-width: 900px) { .lab-layout { grid-template-columns: 1fr; } }   /* 데이터 준비: 카드 격자 아래에 크게 보기 */
body:has(#boot-wait:not([hidden])) .web-boot { display: none; }   /* 처음 자리표시에 이미 '준비 중…'이 있으면 겹쳐 띄우지 않음 */
@media (max-width: 1000px) { .web-boot { top: auto; bottom: 16px; left: 50%; transform: translateX(-50%); } }   /* 좁은 화면: 위쪽 막대를 가리지 않게 아래에 */
