/* 시나브로 데이터 랩 — 밝고 친근한 기본 테마. 글자 14px 이상, 눈에 잘 띄는 포커스. */
:root {
  --font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --bg: #f5f7fb;
  --bg2: #eef2f9;
  --panel: #ffffff;
  --ink: #1d2742;
  --ink2: #3b4766;
  --muted: #5f6b85;
  --line: #e1e7f0;
  --line2: #cfd8e6;
  --brand: #2f6fde;
  --brand2: #1f56c0;
  --brand-soft: #e8f0ff;
  --accent: #ff8a3d;
  --ok: #15803d;
  --ok-soft: #e7f7ec;
  --warn: #b45309;
  --warn-soft: #fff4e0;
  --err: #c62828;
  --err-soft: #fdecec;
  --focus: #ffb020;
  --r: 12px;
  --r-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 4px 16px rgba(20, 30, 60, .06);
  --shadow-lg: 0 10px 40px rgba(20, 30, 60, .18);
  --top-h: 56px;
  --pal-w: 236px;
  --insp-w: 380px;
  --tut-w: 330px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--bg); }
img, svg { max-width: 100%; }
a { color: var(--brand2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 1000; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
small { font-size: 14px; }
.pad { padding: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
kbd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #fff; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .92em; background: var(--bg2); padding: 1px 5px; border-radius: 5px; }
.noscript { padding: 2rem; }

/* ------------------------------------------------------------------ 단추·입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 7px 14px; border-radius: 10px;
  border: 1px solid var(--line2); background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover:not(:disabled) { background: var(--bg2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand2); }
.btn-danger { color: var(--err); border-color: #f1c4c4; }
.btn-danger:hover:not(:disabled) { background: var(--err-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 14px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 10px 22px; font-size: 17px; border-radius: 14px; }
.btn-google { background: #fff; border-color: var(--line2); }
.g-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 800; font-size: 13px; color: #fff;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0); }
.btn-account { padding: 4px 10px 4px 4px; border-radius: 999px; max-width: 220px; }
.account-name { overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-letter { display: inline-grid; place-items: center; background: var(--brand-soft); color: var(--brand2); font-weight: 800; }
.icon-btn { display: inline-grid; place-items: center; min-width: 32px; min-height: 32px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--muted); }
.icon-btn:hover:not(:disabled) { background: var(--bg2); color: var(--ink); }
.link-btn { background: none; border: 0; padding: 2px 4px; color: var(--brand2); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.input { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 9px; background: #fff; }
.input:focus { border-color: var(--brand); outline: 3px solid rgba(47, 111, 222, .2); outline-offset: 0; }
.input-sm { min-height: 32px; padding: 4px 8px; font-size: 14px; }
.input-num { width: 92px; flex: none; }
.input-color { width: 56px; padding: 2px; }
.input-code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
textarea.input { resize: vertical; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line2); background: #fff; font-size: 14px; font-weight: 600; color: var(--ink2); }
.chip[aria-pressed="true"], .chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-sm { min-height: 26px; padding: 2px 8px; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--bg2); color: var(--ink2); font-size: 13px; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.role-chip { display: inline-block; padding: 0 6px; border-radius: 6px; background: #fff1e6; color: #b45309; font-size: 12px; font-weight: 700; margin-left: 4px; }
.port-chip { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 13px; color: #fff; background: #64748b; margin: 2px 3px 2px 0; }
.port-chip[data-t="data"] { background: #2f7de1; } .port-chip[data-t="learner"] { background: #d14f9a; } .port-chip[data-t="model"] { background: #8a55d6; }
.port-chip[data-t="results"] { background: #c4730f; } .port-chip[data-t="distances"] { background: #13887a; }

/* ------------------------------------------------------------------ 알림·창·메뉴 */
.toasts { position: fixed; z-index: 900; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; box-shadow: var(--shadow-lg); animation: toastIn .2s ease-out; }
.toast-ok { background: #14532d; } .toast-warning { background: #7c4a03; } .toast-error { background: #8f1d1d; }
.toast.bye { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.modal-back { position: fixed; inset: 0; z-index: 800; background: rgba(15, 23, 42, .42); display: grid; place-items: center; padding: 16px; animation: fadeIn .15s; }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; }
.modal-wide { width: min(980px, 100%); }
.modal-full { width: min(1280px, 100%); height: calc(100vh - 32px); }
.modal-head { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-body { padding: 16px 18px; overflow: auto; flex: 1; min-height: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.modal-full .modal-body { padding: 0; display: flex; }
.popmenu { position: fixed; z-index: 850; min-width: 220px; max-width: min(380px, calc(100vw - 12px)); max-height: min(70vh, 520px); overflow: auto; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); }
.popmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; text-align: left; min-height: 38px; }
.popmenu-item:hover:not(:disabled), .popmenu-item:focus-visible { background: var(--bg2); }
.popmenu-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none; font-size: 16px; }
.popmenu-label { flex: 1; font-weight: 600; }
.popmenu-sub { color: var(--muted); font-size: 13px; }
.popmenu-head { padding: 6px 10px; font-size: 14px; font-weight: 700; color: var(--muted); }
.popmenu-sep { height: 1px; margin: 4px 6px; background: var(--line); }
.popmenu-suggest { width: 320px; }
.suggest { display: flex; flex-direction: column; gap: 6px; }
.suggest .input { margin: 0 4px; width: calc(100% - 8px); }
.copy-row { display: flex; gap: 8px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field[hidden] { display: none; }
.field-label { font-weight: 700; font-size: 14px; color: var(--ink2); }
.field-help { color: var(--muted); font-size: 13.5px; }
.field-error { color: var(--err); font-size: 13.5px; }
.auto-note { color: var(--brand2); font-size: 13.5px; }
.auto-note:empty { display: none; }

/* ------------------------------------------------------------------ 메시지 */
.msg { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); font-size: 14.5px; }
.msg-ic { flex: none; }
.msg-warning { background: var(--warn-soft); } .msg-error { background: var(--err-soft); color: #7f1d1d; } .msg-ok { background: var(--ok-soft); }
.msg-hint { background: #f3efff; }

/* ------------------------------------------------------------------ 작업 화면 틀 */
.page-app { overflow: hidden; height: 100vh; height: 100dvh; }
.app { display: grid; grid-template-rows: var(--top-h) auto minmax(0, 1fr); height: 100vh; height: 100dvh; }
.topbar { grid-row: 1; display: flex; align-items: center; gap: 10px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); min-width: 0; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; flex: none; }
.brand-name { font-size: 17px; letter-spacing: -.02em; }
.proj { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 auto; }
.proj-title { border: 1px solid transparent; background: none; font-weight: 700; font-size: 16px; padding: 4px 8px; border-radius: 8px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-title:hover:not(:disabled) { border-color: var(--line2); }
.save-status { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toolbar { display: flex; gap: 2px; align-items: center; flex: none; }
.tool { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; min-width: 52px; min-height: 48px; padding: 3px 6px; border: 0; border-radius: 10px; background: none; color: var(--ink2); }
.tool:hover { background: var(--bg2); }
.tool-ic { font-size: 18px; line-height: 1.2; }
.tool-lbl { font-size: 13px; font-weight: 600; white-space: nowrap; }
.tool-more { display: none; }
.pal-toggle { display: none; }
.account-slot { flex: none; }
.banner { grid-row: 2; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; font-size: 14.5px; border-bottom: 1px solid var(--line); }
.banner[hidden] { display: none; }
.banner-info { background: #fff8e6; }
.banner-login { background: #eef4ff; }
.main { grid-row: 3; display: grid; grid-template-columns: var(--pal-w) minmax(0, 1fr) var(--insp-w); min-height: 0; }
body.has-tutorial .main { grid-template-columns: var(--pal-w) minmax(0, 1fr) calc(var(--insp-w) + var(--tut-w)); }
.palette { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.center { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.side { display: flex; min-height: 0; background: #fff; border-left: 1px solid var(--line); position: relative; }
.side .tutorial { width: var(--tut-w); flex: none; border-right: 1px solid var(--line); overflow: auto; background: #fbfcff; }
.side .inspector { flex: 1; min-width: 0; overflow: auto; }
.sheet-handle { display: none; }
.scrim { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .3); }
.scrim[hidden] { display: none; }
.fatal { padding: 3rem; text-align: center; grid-column: 1 / -1; }

/* ------------------------------------------------------------------ 위젯 상자 */
.pal-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.pal-title { margin: 0; font-size: 16px; }
.pal-list { overflow: auto; padding: 6px 8px 24px; flex: 1; }
.pal-cat { margin-bottom: 4px; }
.pal-cat-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 6px; border: 0; background: none; border-radius: 8px; text-align: left; font-weight: 800; color: var(--ink); }
.pal-cat-head:hover { background: var(--bg2); }
.pal-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--cat); flex: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat) 25%, transparent); }
.pal-cat-name { font-size: 15px; }
.pal-cat-en { color: var(--muted); font-weight: 500; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-count { font-size: 12.5px; color: var(--muted); background: var(--bg2); border-radius: 999px; padding: 0 7px; }
.chev { transition: transform .15s; color: var(--muted); }
.pal-cat:not(.open) .chev { transform: rotate(-90deg); }
.pal-items { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 6px 4px; }
.pal-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 8px; border: 1px solid transparent; border-radius: 10px; background: none; text-align: left; cursor: grab; min-height: 42px; }
.pal-item:hover, .pal-item:focus-visible { background: color-mix(in srgb, var(--cat) 12%, #fff); border-color: color-mix(in srgb, var(--cat) 35%, #fff); }
.pal-item:active { cursor: grabbing; }
.pal-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 17px; background: var(--cat); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.pal-names { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pal-name { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-en { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-heavy { margin-left: auto; font-size: 13px; }
.pal-item.is-best { background: color-mix(in srgb, var(--cat) 14%, #fff); border-color: color-mix(in srgb, var(--cat) 45%, #fff); }
.pal-enter { margin-left: auto; font-size: 11.5px; padding: 0 5px; }
.pal-item.pulse, .tut-pulse { animation: pulse 1.2s ease-in-out infinite; position: relative; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, .65); } 50% { box-shadow: 0 0 0 7px rgba(255, 138, 61, 0); background: #fff3e6; } }
.pal-card { position: fixed; z-index: 700; width: 300px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); font-size: 14px; pointer-events: none; }
.pal-card[hidden] { display: none; }
.pal-card-head { display: flex; gap: 10px; align-items: center; }
.pal-card p { margin: 8px 0; }
.pal-ports { display: flex; flex-direction: column; gap: 4px; }

/* ------------------------------------------------------------------ 캔버스 */
.canvas-tools { display: flex; align-items: center; gap: 2px; padding: 5px 8px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.canvas-tools::-webkit-scrollbar { display: none; }
.ctool { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 3px 9px; border: 0; border-radius: 8px; background: none; color: var(--ink2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.ctool:hover:not(:disabled) { background: var(--bg2); }
.ctool-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; flex: none; }
.canvas-wrap { position: relative; overflow: hidden; background: #f8fafd; min-height: 0; }
.canvas-wrap.is-drop { outline: 3px dashed var(--brand); outline-offset: -8px; background: #eef4ff; }
.canvas { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
.canvas:focus { outline: none; }
.canvas:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.is-panning .canvas, .is-space .canvas { cursor: grabbing; }
.grid-dot { fill: #d5dce8; }
.canvas-bg { fill: url(#gridDots); }
.node { cursor: pointer; }
.node:focus { outline: none; }
.node-halo { fill: transparent; stroke: transparent; stroke-width: 4; }
.node.is-sel .node-halo { stroke: var(--brand); fill: rgba(47, 111, 222, .08); }
.node:focus-visible .node-halo { stroke: var(--focus); stroke-width: 4; stroke-dasharray: 6 4; }
.node-ring { fill: #fff; stroke-width: 4; }
.node-body { opacity: .95; }
.node-face { fill: rgba(255, 255, 255, .92); }
.node-icon { font-size: 25px; pointer-events: none; }
.node-title { font-size: 14px; font-weight: 700; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: #f8fafd; stroke-width: 4px; }
.node-sum { font-size: 12.5px; fill: var(--muted); pointer-events: none; paint-order: stroke; stroke: #f8fafd; stroke-width: 3px; }
.node-status { fill: #cbd5e1; stroke: #fff; stroke-width: 2.5; }
.node[data-status="ok"] .node-status { fill: #22c55e; }
.node[data-status="warning"] .node-status { fill: #f59e0b; }
.node[data-status="error"] .node-status { fill: #ef4444; }
.node[data-status="skipped"] .node-status { fill: #94a3b8; }
.node[data-status="running"] .node-status, .node[data-status="queued"] .node-status, .node[data-status="stale"] .node-status { fill: #3b82f6; animation: blink 1s infinite; }
.node[data-status="waiting"] .node-status { fill: #a855f7; }
.node[data-status="error"] .node-ring { stroke: #ef4444; }
.node[data-status="stale"], .node[data-status="queued"] { opacity: .75; }
@keyframes blink { 50% { opacity: .35; } }
.node-progress { fill: none; stroke: #2563eb; stroke-width: 4; stroke-linecap: round; pointer-events: none; transition: stroke-dasharray .3s; }
.node.is-indeterminate .node-progress { animation: spin 1s linear infinite; transform-origin: 0 0; }
@keyframes spin { to { transform: rotate(270deg); } }
.run-pill rect { fill: #7c3aed; }
.run-pill text { fill: #fff; font-size: 12.5px; font-weight: 700; }
.run-pill { cursor: pointer; }
.port { cursor: crosshair; }
.port-hit { fill: transparent; }
.port-dot { stroke-width: 2.5; transition: r .1s; }
.port:hover .port-dot { r: 8; }
.port-in.is-used .port-dot { fill: var(--line2); }
.port-optional .port-dot { stroke-dasharray: 2 2; }
.is-readonly .port { cursor: default; }
.node.can-drop .node-ring { stroke-dasharray: 5 3; }
.node.cant-drop { opacity: .35; }
.node.drop-ok .node-halo { stroke: #16a34a; fill: rgba(22, 163, 74, .12); }
.node.drop-bad .node-halo { stroke: #ef4444; fill: rgba(239, 68, 68, .1); }
.node.pulse .node-halo { animation: nodePulse 1.2s ease-in-out infinite; stroke: var(--accent); }
@keyframes nodePulse { 50% { stroke-width: 10; stroke-opacity: .25; } }
.node.kbd-from .node-halo { stroke: #7c3aed; stroke-width: 5; }
.node.kbd-to .node-halo { stroke: #16a34a; stroke-width: 5; stroke-dasharray: 6 4; }
.link { cursor: pointer; }
.link-hit { fill: none; stroke: transparent; stroke-width: 16; }
.link-line { fill: none; stroke: var(--lc); stroke-width: 3; stroke-linecap: round; opacity: .85; }
.link:hover .link-line { stroke-width: 4.5; opacity: 1; }
.link.is-sel .link-line { stroke-width: 5; stroke-dasharray: 9 5; animation: dash 1s linear infinite; }
.link.link-empty .link-line { stroke-dasharray: 3 6; opacity: .5; }
@keyframes dash { to { stroke-dashoffset: -28; } }
.link-temp { fill: none; stroke: var(--lc); stroke-width: 3; stroke-dasharray: 6 5; pointer-events: none; }
.box-sel { fill: rgba(47, 111, 222, .08); stroke: var(--brand); stroke-dasharray: 5 3; }
.note { cursor: move; }
.note-bg { fill: #fff9db; stroke: #f0d97a; }
.note.is-sel .note-bg { stroke: var(--brand); stroke-width: 2; }
.note-text { font-size: 14px; line-height: 1.45; color: #5c4a00; white-space: pre-wrap; overflow: hidden; height: 100%; word-break: keep-all; overflow-wrap: anywhere; }
.note-resize { fill: #f0d97a; cursor: nwse-resize; }
.note-editor { position: absolute; z-index: 30; border: 2px solid var(--brand); border-radius: 10px; padding: 6px 8px; background: #fffdf0; resize: none; }
.link-tip { position: fixed; z-index: 900; max-width: 300px; padding: 6px 10px; background: #7f1d1d; color: #fff; border-radius: 8px; font-size: 14px; pointer-events: none; box-shadow: var(--shadow); }
.canvas-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; pointer-events: none; color: var(--ink2); }
.canvas-empty[hidden] { display: none; }
.canvas-empty p { margin: 4px 0; max-width: 460px; }
.empty-art { font-size: 34px; margin-bottom: 10px; letter-spacing: 6px; opacity: .85; }
.kbd-banner { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); z-index: 20; max-width: calc(100% - 20px); padding: 8px 14px; border-radius: 12px; background: #4c1d95; color: #fff; font-size: 14.5px; box-shadow: var(--shadow); }
.kbd-banner[hidden] { display: none; }
.statusbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 12px; background: #fff; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink2); min-height: 32px; }
.statusbar > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-right { color: var(--muted); flex: none; }
.sb-err { color: var(--err); font-weight: 700; } .sb-warn { color: var(--warn); font-weight: 700; }
.run-live { display: inline-flex; align-items: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #bfdbfe; border-top-color: var(--brand); animation: spin2 .8s linear infinite; display: inline-block; }
@keyframes spin2 { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ 살펴보기 */
.insp { display: flex; flex-direction: column; min-height: 100%; }
.insp-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, color-mix(in srgb, var(--cat) 10%, #fff), #fff); }
.insp-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cat); font-size: 22px; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6); flex: none; }
.insp-names { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.insp-title { border: 1px solid transparent; background: none; padding: 0 4px; margin-left: -4px; border-radius: 6px; font-weight: 800; font-size: 17px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insp-title:hover:not(:disabled) { border-color: var(--line2); }
.insp-title-input { font-weight: 800; font-size: 16px; }
.insp-en { color: var(--muted); font-size: 13.5px; }
.status-chip { font-size: 13px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg2); color: var(--ink2); white-space: nowrap; }
.status-chip[data-status="ok"] { background: var(--ok-soft); color: var(--ok); }
.status-chip[data-status="warning"] { background: var(--warn-soft); color: var(--warn); }
.status-chip[data-status="error"] { background: var(--err-soft); color: var(--err); }
.status-chip[data-status="running"], .status-chip[data-status="queued"], .status-chip[data-status="stale"] { background: var(--brand-soft); color: var(--brand2); }
.status-chip[data-status="waiting"] { background: #f3e8ff; color: #6b21a8; }
.insp-actions { display: flex; gap: 6px; width: 100%; flex-wrap: wrap; }
.insp-msgs { display: flex; flex-direction: column; gap: 6px; padding: 0 14px; }
.insp-msgs:not(:empty) { padding-top: 10px; }
.tabs { display: flex; gap: 2px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 3; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 10px 10px 0 0; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; font-size: 14.5px; }
.tab[aria-selected="true"] { color: var(--brand2); border-bottom-color: var(--brand); }
.tab:hover { color: var(--ink); }
.tabs-sub { position: static; padding: 0; margin-bottom: 8px; flex-wrap: wrap; }
.tabs-sub .tab { padding: 6px 10px; font-size: 14px; }
.insp-body { padding: 14px; flex: 1; }
.insp-big { width: 100%; min-height: 0; }
.insp-big .insp-body { overflow: auto; }
.insp-empty { padding: 28px 22px; text-align: center; }
.insp-empty h2 { margin: 8px 0 6px; font-size: 18px; }
.insp-mascot { display: flex; justify-content: center; }
.mascot { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.tips { text-align: left; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.tips li { background: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 14px; }
.settings .fields { display: flex; flex-direction: column; gap: 14px; }
.adv { margin-top: 16px; border-top: 1px dashed var(--line2); padding-top: 10px; }
.adv summary { cursor: pointer; font-weight: 700; color: var(--muted); }
.adv .fields { margin-top: 12px; }
.num-row { display: flex; align-items: center; gap: 10px; }
.range { flex: 1; min-width: 0; accent-color: var(--brand); height: 26px; }
.bool-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.switch { position: relative; width: 50px; height: 28px; border-radius: 999px; border: 0; background: #cbd5e1; flex: none; transition: background .15s; }
.switch[aria-checked="true"] { background: var(--brand); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: left .15s; }
.switch[aria-checked="true"] .switch-knob { left: 25px; }
.seg { display: flex; flex-wrap: wrap; background: var(--bg2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-btn { flex: 1 1 auto; border: 0; background: none; padding: 6px 10px; border-radius: 8px; font-weight: 650; font-size: 14px; color: var(--ink2); min-height: 32px; }
.seg-btn[aria-checked="true"] { background: #fff; color: var(--brand2); box-shadow: 0 1px 3px rgba(20, 30, 60, .15); }
.seg-btn[style*="--dot"] { color: var(--dot); }
.checks { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.checks-inline { flex-direction: row; flex-wrap: wrap; max-height: 120px; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 4px; border-radius: 6px; font-size: 14.5px; cursor: pointer; }
.check:hover { background: var(--bg); }
.check input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.cols-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.cols-bar .input { flex: 1 1 120px; }
.cond { display: flex; flex-direction: column; gap: 8px; }
.cond-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; background: var(--bg); padding: 6px; border-radius: 10px; }
.cond-row > select, .cond-row > input { flex: 1 1 110px; min-width: 0; }
.mapping { display: flex; flex-direction: column; gap: 8px; }
.ds-field { display: flex; flex-direction: column; gap: 8px; }
.ds-current { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px dashed var(--line2); border-radius: 12px; background: var(--bg); }
.ds-emoji { font-size: 28px; }
.paint-wrap { display: flex; flex-direction: column; gap: 8px; }
.paint { width: 100%; max-width: 360px; border-radius: 10px; cursor: crosshair; touch-action: none; }
.paint-bg { fill: #fff; stroke: var(--line2); }
.help section { margin-bottom: 16px; }
.help h3 { margin: 0 0 6px; font-size: 16px; }
.help-meta dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0 0 8px; font-size: 14.5px; }
.help-meta dt { color: var(--muted); }
.help-meta dd { margin: 0; }
.io-list { padding-left: 0; list-style: none; margin: 4px 0; display: flex; flex-direction: column; gap: 6px; }
.result { display: flex; flex-direction: column; gap: 10px; }
.result-empty { text-align: center; padding: 24px 10px; color: var(--muted); }
.out-sum { display: flex; flex-wrap: wrap; gap: 6px; }
.out-chip { font-size: 13.5px; padding: 3px 10px; border-radius: 999px; background: var(--bg2); color: var(--ink2); border-left: 4px solid #64748b; }
.out-chip[data-t="data"] { border-left-color: #2f7de1; } .out-chip[data-t="learner"] { border-left-color: #d14f9a; } .out-chip[data-t="model"] { border-left-color: #8a55d6; }
.out-chip[data-t="results"] { border-left-color: #c4730f; } .out-chip.is-empty { opacity: .65; }
.sel-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 10px; background: #fff7ed; border-radius: 10px; font-size: 14.5px; }

/* ------------------------------------------------------------------ 보기(결과) */
.view { min-width: 0; }
.view + .view { margin-top: 12px; }
.view-title { margin: 0 0 8px; font-size: 15px; }
.view-note { color: var(--muted); font-size: 14px; margin: 6px 0 0; }
.md p { margin: 0 0 8px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 22px; }
.md .md-h { margin: 12px 0 6px; font-size: 15.5px; }
.md blockquote { margin: 0 0 8px; padding: 6px 12px; border-left: 4px solid var(--line2); color: var(--ink2); background: var(--bg); border-radius: 0 8px 8px 0; }
.tbl-wrap { display: flex; flex-direction: column; gap: 6px; }
.tbl-info { font-size: 14px; color: var(--ink2); display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.tbl-scroll { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.insp-big .tbl-scroll { max-height: calc(100vh - 260px); }
.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; }
.tbl th, .tbl td { padding: 6px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.tbl thead th { position: sticky; top: 0; background: #f4f7fc; z-index: 1; font-weight: 700; }
.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl td.na { color: #b0b8c8; }
.tbl .tbl-rn { color: var(--muted); text-align: right; width: 1%; font-variant-numeric: tabular-nums; }
.tbl .tbl-chk { width: 1%; }
.th-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; font-weight: 700; }
.th-name { overflow: hidden; text-overflow: ellipsis; }
.sort-ic { font-size: 10px; color: var(--brand); }
.kind-ic { font-size: 13px; }
.tbl th.is-target { background: #fff3e6; }
.tbl th.is-meta { color: var(--muted); }
.tbl-selectable tbody tr { cursor: pointer; }
.tbl-selectable tbody tr:hover td { background: #f6f9ff; }
.tbl tbody tr.is-sel td { background: #e6efff; }
.tbl-metrics td.is-best { background: #ecfbf0; font-weight: 800; color: #14532d; }
.tbl.keys th { width: 40%; }
.sel-count { font-weight: 600; }
.mx-wrap { display: flex; flex-direction: column; gap: 8px; }
.mx { border-collapse: separate; border-spacing: 3px; font-size: 14px; }
.mx th { font-weight: 700; padding: 4px 8px; }
.mx-corner { font-size: 13px; color: var(--muted); text-align: left; }
.mx-col { text-align: center; }
.mx-row { text-align: right; }
.mx-cell { min-width: 64px; height: 44px; text-align: center; border-radius: 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mx-selectable .mx-cell { cursor: pointer; }
.mx-selectable .mx-cell:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.mx-cell.is-sel { box-shadow: inset 0 0 0 3px #111; }
.mx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.img-wrap { display: flex; flex-direction: column; gap: 6px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.img-item { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 0; padding: 6px; border: 2px solid transparent; border-radius: 10px; background: var(--bg); }
.img-item img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 6px; background: #fff; }
.img-selectable .img-item:hover { border-color: var(--line2); }
.img-item.is-sel { border-color: var(--brand); background: var(--brand-soft); }
.img-cap { font-size: 13px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-sub { font-size: 12px; color: var(--muted); }
.img-missing { font-size: 30px; padding: 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 6px; }
.stat-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.stat-head { display: flex; align-items: center; gap: 6px; }
.stat-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { font-size: 13.5px; color: var(--muted); }
.warn-t { color: var(--warn); font-weight: 700; }
.stat-dl { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2px 8px; margin: 0; font-size: 13.5px; }
.stat-dl dt { color: var(--muted); }
.stat-dl dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.top-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13.5px; }
.top-list li { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; gap: 6px; align-items: center; }
.top-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-bar { height: 8px; background: var(--bg2); border-radius: 4px; overflow: hidden; }
.top-bar i { display: block; height: 100%; background: #e9b949; }
.top-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-hist { display: block; }
.tree-wrap { overflow: auto; max-height: 560px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.tree, .tree ul { list-style: none; margin: 0; padding-left: 18px; }
.tree { padding-left: 0; }
.tree li { position: relative; }
.tree ul { border-left: 2px dotted var(--line2); margin-left: 9px; }
.tree li:not(.open) > ul { display: none; }
.tree-node { display: flex; align-items: center; gap: 6px; padding: 3px 4px; border-radius: 6px; flex-wrap: wrap; }
.tree-node:hover { background: var(--bg); }
.tree-tog { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--line2); background: #fff; padding: 0; font-size: 11px; display: inline-grid; place-items: center; }
.tree-tog::before { content: "▸"; }
.tree li.open > .tree-node .tree-tog::before { content: "▾"; }
.tree-name { font-weight: 650; }
.tree-meta { color: var(--muted); }
.tree-dist { display: inline-flex; width: 70px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--bg2); }
.tree-dist i { display: block; height: 100%; }
.chart-wrap { display: flex; flex-direction: column; gap: 4px; }
.chart { width: 100%; min-height: 220px; }
.chart-hint { margin: 0; font-size: 13.5px; color: var(--muted); }
.multi-stack { display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------------------------------------------ 튜토리얼 */
.tutorial[hidden] { display: none !important; }
.tut-head { display: flex; align-items: flex-start; gap: 8px; padding: 12px 14px 8px; position: sticky; top: 0; background: #fbfcff; z-index: 2; }
.tut-titles { flex: 1; min-width: 0; }
.tut-subject { color: var(--brand2); font-weight: 700; }
.tut-title { margin: 2px 0 0; font-size: 17px; line-height: 1.35; }
.tut-progress { display: flex; align-items: center; gap: 8px; padding: 0 14px 8px; }
.tut-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.tut-bar i { display: block; height: 100%; background: linear-gradient(90deg, #3dbb8f, #5b8fe0); border-radius: 999px; transition: width .4s; }
.tut-goals { margin: 0 14px 8px; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 14.5px; }
.tut-goals summary { cursor: pointer; font-weight: 700; }
.tut-goals ul { margin: 6px 0; padding-left: 20px; }
.tut-steps { list-style: none; margin: 0; padding: 0 10px 16px; display: flex; flex-direction: column; gap: 6px; }
.tut-step { border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.tut-step-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: none; text-align: left; font-weight: 700; }
.tut-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg2); color: var(--ink2); font-size: 13.5px; flex: none; }
.tut-step.is-done .tut-num { background: #22c55e; color: #fff; }
.tut-step.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 111, 222, .15); }
.tut-step.is-current .tut-num { background: var(--brand); color: #fff; }
.tut-step.is-future { opacity: .7; }
.tut-step.is-done .tut-step-title { color: var(--muted); }
.tut-step-body { display: none; padding: 0 14px 12px 48px; font-size: 14.5px; }
.tut-step.is-current .tut-step-body, .tut-step.is-peek .tut-step-body { display: block; }
.tut-step.just-done { animation: done .7s ease-out; }
@keyframes done { 30% { transform: scale(1.02); background: #ecfdf3; } }
.tut-auto { color: var(--brand2); margin: 6px 0; }
.tut-hint { background: #fff8e6; padding: 8px 10px; border-radius: 10px; margin: 6px 0; }
.tut-skip { display: block; margin-top: 6px; font-weight: 500; color: var(--muted); }
.quiz { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.quiz-q { margin: 0 0 4px; }
.quiz-opt { display: flex; gap: 8px; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line2); background: #fff; }
.quiz-opt:hover:not(:disabled) { border-color: var(--brand); background: var(--brand-soft); }
.quiz-opt.is-right { border-color: #16a34a; background: var(--ok-soft); }
.quiz-opt.is-wrong { border-color: #ef4444; background: var(--err-soft); animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.quiz-k { font-weight: 700; color: var(--brand2); }
.quiz-fb:not(:empty) { padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.tut-wrap { margin: 4px 10px 20px; padding: 16px; border-radius: 16px; background: linear-gradient(135deg, #fff8e6, #eef4ff); text-align: center; }
.tut-wrap ul { text-align: left; }
.tut-trophy { font-size: 44px; animation: bob 2s ease-in-out infinite; }
.tut-picker .tut-group { margin: 14px 0 8px; font-size: 16px; }
.tut-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tut-card { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.tut-card:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 950; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation-name: fall; animation-timing-function: cubic-bezier(.3, .6, .6, 1); animation-fill-mode: forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

/* ------------------------------------------------------------------ 첫 방문 안내 */
.coach { position: fixed; inset: 0; z-index: 820; }
.coach-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .55); transition: all .25s ease; pointer-events: none; outline: 3px solid var(--focus); }
.coach-bubble { position: fixed; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-lg); transition: all .25s ease; }
.coach-bubble h3 { margin: 2px 0 4px; font-size: 17px; }
.coach-bubble p { margin: 0 0 10px; font-size: 14.5px; }

/* ------------------------------------------------------------------ 데이터셋 카드 */
.ds-tools { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.ds-card { position: relative; display: flex; flex-direction: column; border-radius: 18px; background: #fff; border: 1px solid var(--line); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.ds-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ds-art { display: grid; place-items: center; height: 92px; font-size: 46px; background: var(--hue); }
.ds-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ds-title { margin: 0; font-size: 16px; line-height: 1.35; }
.ds-en { color: var(--muted); font-size: 13px; margin-top: -4px; }
.ds-story { margin: 0; font-size: 14px; color: var(--ink2); }
.ds-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink2); }
.ds-pick { margin: 0 14px 14px; }
.ds-card-compact .ds-art { height: 64px; font-size: 34px; }
.drop-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px; border: 2px dashed var(--line2); border-radius: 16px; text-align: center; background: var(--bg); }
.drop-zone.is-over { border-color: var(--brand); background: var(--brand-soft); }
.drop-ic { font-size: 34px; }
.quota { display: flex; flex-direction: column; gap: 4px; }
.quota-bar { height: 10px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.quota-bar i { display: block; height: 100%; background: var(--brand); }
.proj-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.proj-item { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.proj-item.is-current { border-color: var(--brand); }
.proj-open { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; flex: 1; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; min-width: 0; }
.proj-open:hover { background: var(--bg); }
.proj-ic { grid-row: span 2; font-size: 24px; }
.proj-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-dialog h3 { margin: 16px 0 6px; }
.help-hero { display: flex; gap: 14px; align-items: center; background: var(--bg); border-radius: 14px; padding: 12px; }
.help-hero p { margin: 2px 0; }

/* ------------------------------------------------------------------ 첫 화면 */
.page-home { background: var(--bg); }
.home-top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px; padding: 10px clamp(14px, 4vw, 40px); background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.home-top .brand { margin-right: auto; }
.home-nav { display: flex; gap: 4px; }
.home-nav a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink2); font-weight: 650; font-size: 15px; }
.home-nav a:hover { background: var(--bg2); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.hero { position: relative; overflow: hidden; padding: clamp(36px, 7vw, 76px) 0 clamp(28px, 5vw, 56px); background: radial-gradient(1200px 400px at 80% -10%, #dfe9ff 0, transparent 60%), radial-gradient(800px 360px at -10% 110%, #fff0dd 0, transparent 60%); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); line-height: 1.15; letter-spacing: -.03em; margin: 0 0 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #2f6fde, #9a72d6 60%, #e0675f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: clamp(16px, 1.8vw, 19px); color: var(--ink2); margin: 0 0 22px; max-width: 560px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-note { margin-top: 14px; font-size: 14px; color: var(--muted); }
.hero-art { position: relative; aspect-ratio: 4 / 3; border-radius: 24px; background: #fff; box-shadow: var(--shadow-lg); padding: 10px; }
.hero-art svg { width: 100%; height: 100%; display: block; }
.flow-node { animation: bob 3.4s ease-in-out infinite; }
.flow-line { stroke-dasharray: 8 6; animation: dash 1.4s linear infinite; }
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.section { padding: clamp(28px, 5vw, 56px) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section h2 { margin: 0; font-size: clamp(22px, 2.6vw, 28px); letter-spacing: -.02em; }
.section-sub { margin: 4px 0 0; color: var(--muted); }
.steps3 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.step3 { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.step3 .big { font-size: 30px; }
.step3 h3 { margin: 6px 0 4px; font-size: 16px; }
.step3 p { margin: 0; color: var(--ink2); font-size: 14.5px; }
.subject-tabs { margin-bottom: 14px; }
.tut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tcard { display: flex; flex-direction: column; gap: 8px; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 18px; text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.tcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tcard h3 { margin: 0; font-size: 16.5px; }
.tcard p { margin: 0; color: var(--ink2); font-size: 14.5px; }
.tcard-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); }
.tcard-subj { font-size: 13px; font-weight: 800; color: var(--brand2); }
.recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rcard { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; }
.rcard:hover { border-color: var(--brand); }
.empty-box { padding: 20px; border: 1px dashed var(--line2); border-radius: 16px; text-align: center; color: var(--muted); background: #fff; }
.home-foot { margin-top: 30px; padding: 26px 0 40px; border-top: 1px solid var(--line); background: #fff; font-size: 14.5px; color: var(--ink2); }
.foot-grid { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.server-line { display: inline-flex; align-items: center; gap: 8px; }
.server-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px #dcfce7; }

/* ------------------------------------------------------------------ 문서(개인정보·관리자) */
.doc { max-width: 900px; margin: 0 auto; padding: 28px clamp(16px, 4vw, 32px) 60px; }
.doc h1 { font-size: 28px; margin: 10px 0 6px; }
.doc h2 { font-size: 19px; margin: 28px 0 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; table-layout: fixed; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.doc th { background: #f1f5fb; }
.doc .card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.kpi b { display: block; font-size: 24px; }
.kpi span { color: var(--muted); font-size: 14px; }
.admin-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.admin-tools .input { max-width: 320px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
.bars .bar { flex: 1 0 22px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; height: 100%; font-size: 11.5px; color: var(--muted); }
.bars .bar i { display: block; width: 100%; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; }
.page-doc .tbl td { white-space: normal; }

/* ------------------------------------------------------------------ 반응형 */
@media (max-width: 1440px) {
  :root { --insp-w: 360px; --tut-w: 310px; }
}
@media (max-width: 1280px) {
  :root { --pal-w: 220px; --insp-w: 350px; }
  .tool { min-width: 46px; }
  .tool-lbl { font-size: 12.5px; }
  body.has-tutorial .main { grid-template-columns: var(--pal-w) minmax(0, 1fr) var(--insp-w); }
  body.has-tutorial .side { flex-direction: column; }
  body.has-tutorial .side .tutorial { width: auto; max-height: 50%; border-right: 0; border-bottom: 2px solid var(--line); flex: 0 1 auto; }
  body.has-tutorial .side .inspector { flex: 1 1 50%; }
  body.has-tutorial.insp-is-empty .side .tutorial { max-height: none; flex: 1 1 auto; }
  body.has-tutorial.insp-is-empty .side .inspector { display: none; }
}
@media (max-width: 1180px) {
  .brand-name { display: none; }
  .tool { min-width: 0; padding: 3px 5px; }
  .ctool-lbl { display: none; }
  .ctool { min-width: 36px; justify-content: center; }
}
@media (max-width: 1100px) {
  :root { --pal-w: 210px; --insp-w: 330px; }
  .save-status { display: none; }
}
@media (max-width: 980px) {
  .tool-lbl { display: none; }
  .tool { min-width: 40px; min-height: 40px; }
}
.only-phone { display: none; }

@media (max-width: 900px) {
  :root { --top-h: 52px; }
  .main, body.has-tutorial .main { grid-template-columns: minmax(0, 1fr); }
  .pal-toggle { display: inline-flex; }
  .brand-name { display: none; }
  .palette { position: fixed; z-index: 70; top: var(--top-h); bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.pal-open .palette { transform: none; }
  .toolbar .tool:not(.tool-more):not([data-toolbar="tutorial"]):not([data-toolbar="save"]) { display: none; }
  .tool-more { display: inline-flex; }
  .side, body.has-tutorial .side { position: fixed; z-index: 65; left: 0; right: 0; bottom: 0; height: 48vh; flex-direction: column; border-left: 0; border-top: 1px solid var(--line2);
    border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(20, 30, 60, .15); transform: translateY(calc(100% - 30px)); transition: transform .2s; }
  body.sheet-open .side { transform: none; }
  .sheet-handle { display: flex; justify-content: center; align-items: center; flex: none; height: 26px; border: 0; background: none; width: 100%; }
  .sheet-handle span[aria-hidden] { width: 46px; height: 5px; border-radius: 999px; background: var(--line2); }
  body:not(.sheet-open) .sheet-handle { height: 30px; gap: 8px; }
  body:not(.sheet-open) .sheet-handle::after { content: "▲ 살펴보기"; font-size: 14px; font-weight: 700; color: var(--ink2); }
  .side .tutorial, body.has-tutorial .side .tutorial { width: auto; max-height: 45%; border-right: 0; border-bottom: 2px solid var(--line); }
  body.has-tutorial.insp-is-empty .side .tutorial { max-height: none; flex: 1 1 auto; }
  .side .inspector { flex: 1; }
  .center { padding-bottom: 30px; }
  body.sheet-open .center { padding-bottom: 48vh; }
  .hero-grid { grid-template-columns: 1fr; }
  .steps3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .only-phone { display: block; }
  .not-phone { display: none; }
  .topbar { gap: 6px; padding: 0 8px; }
  .pal-toggle, .toolbar .tool[data-toolbar="save"] { display: none; }
  .proj-title { font-size: 15px; max-width: 46vw; }
  .btn-account .account-name, #loginBtn span:last-child { display: none; }
  .btn-account { padding: 3px; }
  .canvas-tools .ctool:not(#ct-fit):not(#ct-zoomin):not(#ct-zoomout):not(#ct-run) { display: none; }
  .canvas-tools .ctool-sep { display: none; }
  .side, body.has-tutorial .side { height: 55vh; }
  body.sheet-open .center { padding-bottom: 55vh; }
  .sb-right { display: none; }
  .home-nav { display: none; }
  .steps3 { grid-template-columns: 1fr; }
  .ds-grid, .tut-grid { grid-template-columns: 1fr; }
  .modal-back { padding: 0; align-items: end; }
  .modal, .modal-wide, .modal-full { width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-full { height: 92vh; }
  .stat-dl { grid-template-columns: auto 1fr; }
  .home-top .btn-google span:last-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ===================================================================== 3라운드: 열 확인·결과 요약·수업 */
.result-summary { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; padding: 12px 14px; border-radius: 12px;
  background: linear-gradient(135deg, #eef4ff, #f6f0ff); border: 1px solid #d6e2fb; }
.result-summary p { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.result-summary-ic { font-size: 20px; flex: none; }
.msg-callout { border-left: 4px solid #e9b949; background: #fff8db; }
.msg-fix { display: block; margin-top: 4px; color: var(--ink2); }
.msg-sample { align-items: center; }
.msg-sample .btn { margin-top: 6px; }
.col-check .tbl td, .col-check .tbl th { vertical-align: top; }
.cc-table select { min-width: 84px; width: auto; }
.cc-sample { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-table td.cc-warn { white-space: normal; min-width: 220px; max-width: 380px; font-size: 13.5px; }
.cc-w + .cc-w { margin-top: 4px; }
.cc-table tr.has-warn th { box-shadow: inset 3px 0 0 #e9b949; }
.kind-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--bg2); color: var(--ink2); }
.kind-numeric { background: #e6f0ff; color: #1f56c0; } .kind-categorical { background: #fff0e0; color: #9a4b00; } .kind-text { background: #f1e9ff; color: #6531b8; }
.kind-datetime { background: #e6f7f2; color: #0f6b52; } .kind-image { background: #ffe8f1; color: #a3255d; } .kind-id { background: #eceff4; color: #4b5568; }
.role-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.role-card { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left; padding: 16px; border-radius: 14px; border: 2px solid var(--line2); background: #fff; }
.role-card:hover, .role-card:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); }
.role-card b { font-size: 18px; } .role-card small { color: var(--muted); font-size: 14px; }
.role-ic { font-size: 34px; }
.input-code { font-size: 26px; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-weight: 800; }
.danger-zone { margin-top: 8px; padding: 8px 12px; border: 1px solid #f3c4c4; border-radius: 10px; background: #fffafa; }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--err); }
.row-between { justify-content: space-between; }
.teacher section { margin: 18px 0 26px; }
.card-box { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card-box h2 { margin-top: 0; font-size: 18px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.class-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line2); background: #fff; text-align: left; min-width: 0; }
.class-card:hover, .class-card:focus-visible { border-color: var(--brand); box-shadow: var(--shadow); }
.class-card.is-archived { opacity: .7; background: var(--bg); }
.class-card-name { font-size: 17px; overflow-wrap: anywhere; }
.class-card-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 22px; font-weight: 800; letter-spacing: .15em; color: var(--brand2); }
.class-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.class-head h2 { margin: 0 0 4px; overflow-wrap: anywhere; }
.class-code-big { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 14px 22px; border-radius: 16px;
  background: #1d2742; color: #fff; min-width: 220px; }
.class-code-big small { opacity: .8; font-size: 14px; }
.class-code-big b { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 44px; letter-spacing: .18em; line-height: 1.1; }
.class-code-hint, .class-code-site { font-size: 13px; opacity: .8; }
.class-code-big:fullscreen, .class-code-big.is-modal { min-height: 100vh; gap: 2vh; border-radius: 0; }
.class-code-big.is-modal { min-height: 70vh; border-radius: 16px; }
.class-code-big:fullscreen b, .class-code-big.is-modal b { font-size: min(22vw, 30vh); }
.class-code-big:fullscreen small, .class-code-big:fullscreen span { font-size: 3vh; }
.members-tbl .pm { text-align: center; font-weight: 700; white-space: nowrap; }
.pm-done { color: var(--ok); background: var(--ok-soft); } .pm-doing { color: var(--warn); background: var(--warn-soft); font-size: 13px; } .pm-none { color: #9aa4b8; }
.pm-head { max-width: 110px; font-size: 13px; }
.members-tbl td.err-cell { white-space: normal; max-width: 280px; font-size: 13.5px; }
.teacher-sec .teacher-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; padding: 0; list-style: none; }
.teacher-sec .teacher-points li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.teacher-sec .teacher-points b { display: block; margin-bottom: 4px; }
@media (max-width: 720px) {
  .class-head { grid-template-columns: 1fr; }
  .class-code-big b { font-size: 36px; }
  .cc-warn { min-width: 160px; }
}

/* ===================================================================== 4라운드: 부드러운 움직임 · 살펴보기 넣고 빼기 · 시나브로 AI */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-1: .14s;
  --dur-2: .22s;
  --dur-3: .32s;
  --ai: #d95f00;
  --ai-dark: #b34d00;
  --ai-soft: #fff4e8;
  --ai-line: #f6dcc0;
}

/* ------------------------------------------------------------------ 단추·입력: 손에 붙는 느낌 */
.btn { transition: background var(--dur-1) ease, border-color var(--dur-1) ease, color var(--dur-1) ease,
  box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn-primary:hover:not(:disabled) { box-shadow: 0 4px 14px rgba(47, 111, 222, .28); transform: translateY(-1px); }
.tool, .ctool, .icon-btn, .chip, .tab, .seg-btn, .pal-item, .pal-cat-head, .popmenu-item, .quiz-opt, .class-card, .role-card,
.proj-open, .tut-card, .tcard, .rcard, .link-btn, .tut-step-head {
  transition: background var(--dur-1) ease, color var(--dur-1) ease, border-color var(--dur-1) ease,
    box-shadow var(--dur-2) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.tool:active, .ctool:active:not(:disabled), .icon-btn:active:not(:disabled), .chip:active:not(:disabled) { transform: scale(.95); }
.tool-ic { display: inline-block; transition: transform var(--dur-2) var(--ease-spring); }
.tool:hover .tool-ic { transform: translateY(-1px) scale(1.1); }
.pal-ic { transition: transform var(--dur-2) var(--ease-spring); }
.pal-item:hover .pal-ic, .pal-item:focus-visible .pal-ic { transform: scale(1.08) rotate(-5deg); }
.pal-items { animation: fadeDown var(--dur-2) var(--ease-out) both; }
.chev { transition: transform var(--dur-2) var(--ease-out); }
.class-card:hover, .role-card:hover, .tut-card:hover { transform: translateY(-2px); }
.quiz-opt:hover:not(:disabled) { transform: translateX(2px); }
.input { transition: border-color var(--dur-1) ease, box-shadow var(--dur-2) var(--ease-out), background var(--dur-1) ease; }
.input:focus { box-shadow: 0 0 0 4px rgba(47, 111, 222, .12); }
.switch { transition: background var(--dur-2) ease; }
.switch-knob { transition: left var(--dur-2) var(--ease-spring), transform var(--dur-1) ease; }
.switch:active .switch-knob { transform: scaleX(1.15); }
.seg-btn[aria-checked="true"] { animation: pop var(--dur-2) var(--ease-out); }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-4px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes pop { from { opacity: .4; transform: scale(.97); } }

/* ------------------------------------------------------------------ 살펴보기: 탭·내용이 부드럽게 바뀜 */
.insp { animation: fadeIn var(--dur-2) ease both; }
.tab { position: relative; }
.tab:hover:not([aria-selected="true"]) { background: var(--bg); }
.tab::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: -3px; height: 3px; border-radius: 3px; background: var(--brand);
  transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out); }
.tab[aria-selected="true"] { border-bottom-color: transparent; }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.insp-body.tab-in > * { animation: fadeUp var(--dur-2) var(--ease-out) both; }
.insp-empty > * { animation: fadeUp var(--dur-3) var(--ease-out) both; }
.insp-empty > *:nth-child(2) { animation-delay: .04s; } .insp-empty > *:nth-child(3) { animation-delay: .08s; }
.insp-empty > *:nth-child(4) { animation-delay: .12s; } .insp-empty > *:nth-child(5) { animation-delay: .16s; }
.result-summary { animation: pop var(--dur-3) var(--ease-spring) both; }
.insp-msgs .msg { animation: fadeUp var(--dur-2) var(--ease-out) both; }
.tut-bar i { transition: width .5s var(--ease-out); }
.tut-step { transition: border-color var(--dur-2) ease, box-shadow var(--dur-2) var(--ease-out), opacity var(--dur-2) ease; }
.tut-step.is-current .tut-step-body, .tut-step.is-peek .tut-step-body { animation: fadeUp var(--dur-2) var(--ease-out) both; }

/* ------------------------------------------------------------------ 창·메뉴·알림 */
.modal-back { animation: fadeIn var(--dur-2) ease both; }
.modal { animation: modalIn var(--dur-3) var(--ease-out) both; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-back-closing { position: fixed; inset: 0; z-index: 800; background: rgba(15, 23, 42, .42); display: grid; place-items: center; padding: 16px;
  animation: fadeOut .17s ease forwards; pointer-events: none; }
.modal-closing { width: min(520px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--panel); border-radius: 18px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: modalOut .17s ease forwards; }
.modal-closing.modal-wide { width: min(980px, 100%); }
.modal-closing.modal-full { width: min(1280px, 100%); height: calc(100vh - 32px); }
@keyframes modalOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.popmenu { animation: popIn var(--dur-2) var(--ease-out) both; transform-origin: top left; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.97); } }
.toast { animation: toastIn2 var(--dur-3) var(--ease-spring) both; align-items: center; }
@keyframes toastIn2 { from { opacity: 0; transform: translateX(28px) scale(.96); } }
.toast.bye { opacity: 0; transform: translateX(28px); transition: opacity .25s ease, transform .3s var(--ease-out); }
.toast.has-action { flex-wrap: wrap; }
.toast-text { flex: 1 1 200px; }
.toast-act { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; min-height: 32px; padding: 3px 12px 3px 6px; border-radius: 999px;
  border: 0; background: #fff; color: var(--ai-dark); font-weight: 800; font-size: 14px; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.toast-act:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, .25); }
.coach-bubble { animation: pop var(--dur-3) var(--ease-spring) both; }

/* ------------------------------------------------------------------ 캔버스: 새 위젯은 톡, 새 선은 쓱 */
.node-halo { transition: stroke var(--dur-1) ease, fill var(--dur-1) ease, stroke-width var(--dur-1) ease; }
.node-ring { transition: stroke-width var(--dur-1) ease; }
.node:hover .node-ring { stroke-width: 5.5; }
.node-status { transition: fill .3s ease; }
.node.is-new .node-halo, .node.is-new .node-ring, .node.is-new .node-body, .node.is-new .node-face {
  transform-box: fill-box; transform-origin: center; animation: nodePop .5s var(--ease-spring) both; }
.node.is-new .node-icon, .node.is-new .node-title, .node.is-new .node-sum, .node.is-new .port { animation: fadeIn .35s ease .1s both; }
@keyframes nodePop { from { transform: scale(.35); opacity: 0; } }
.link-line { transition: stroke-width var(--dur-1) ease, opacity var(--dur-1) ease; }
.links .link .link-line.is-drawing { stroke-dasharray: 1; stroke-dashoffset: 1; animation: drawLine .45s var(--ease-out) forwards; }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
.canvas-empty:not([hidden]) > * { animation: fadeUp var(--dur-3) var(--ease-out) both; }

/* ------------------------------------------------------------------ 오른쪽 살펴보기 창 넣기·꺼내기(큰 화면) */
.side-toggle { display: none; }
@media (min-width: 901px) {
  body.is-ready .main { transition: grid-template-columns var(--dur-3) var(--ease-out); }
  .side { overflow: hidden; justify-content: flex-end; transition: border-color var(--dur-2) ease, visibility 0s linear 0s; }
  .side .inspector { flex: 0 0 auto; width: calc(var(--insp-w) - 1px); }
  body.side-hidden .main, body.side-hidden.has-tutorial .main { grid-template-columns: var(--pal-w) minmax(0, 1fr) 0px; }
  body.side-hidden .side { visibility: hidden; border-left-color: transparent; transition: border-color var(--dur-2) ease, visibility 0s linear var(--dur-3); }
  .side-toggle { display: flex; align-items: center; justify-content: center; gap: 6px; position: absolute; z-index: 25; top: 50%; right: 0;
    width: 24px; height: 60px; padding: 0; transform: translate(50%, -50%); border: 1px solid var(--line2); border-radius: 999px; background: #fff;
    color: var(--ink2); box-shadow: var(--shadow); font-size: 20px; font-weight: 800; line-height: 1;
    transition: width var(--dur-2) var(--ease-out), background var(--dur-1) ease, color var(--dur-1) ease, box-shadow var(--dur-2) var(--ease-out); }
  .side-toggle:hover { width: 30px; background: var(--brand-soft); color: var(--brand2); box-shadow: 0 6px 18px rgba(20, 30, 60, .16); }
  .side-toggle-ic { display: inline-block; transition: transform var(--dur-3) var(--ease-spring); }
  .side-toggle-lbl { display: none; }
  body.side-hidden .side-toggle { width: auto; height: auto; padding: 12px 8px 14px; transform: translate(0, -50%); border-right: 0; border-radius: 16px 0 0 16px;
    flex-direction: column; animation: slideInR var(--dur-3) var(--ease-out) both; }
  body.side-hidden .side-toggle:hover { padding-right: 12px; }
  body.side-hidden .side-toggle-ic { transform: rotate(180deg); }
  body.side-hidden .side-toggle-lbl { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 14px; font-weight: 800; color: var(--ink2); }
  body.side-hidden .side-toggle-lbl > span { writing-mode: vertical-rl; letter-spacing: .08em; }
  .side-toggle .mascot { animation: none; }
  .side-toggle.nudge { animation: nudge .5s var(--ease-spring); }
}
@keyframes slideInR { from { opacity: 0; transform: translate(12px, -50%); } }
@keyframes nudge { 0%, 100% { transform: translate(0, -50%); } 35% { transform: translate(-7px, -50%); } 70% { transform: translate(2px, -50%); } }

/* ------------------------------------------------------------------ 시나브로 AI */
.ai-logo { display: inline-block; vertical-align: middle; flex: none; }
.tab-ai { display: inline-flex; align-items: center; gap: 2px; }
.tab-ai .ai-logo { transition: transform var(--dur-3) var(--ease-spring); }
.tab-ai:hover .ai-logo, .tab-ai[aria-selected="true"] .ai-logo { transform: rotate(-10deg) scale(1.12); }
.tab-ai[aria-selected="true"] { color: var(--ai-dark); }
.tab-ai::after { background: var(--ai); }
.ai-panel { display: flex; flex-direction: column; gap: 10px; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, var(--ai-soft), #eef7ec);
  border: 1px solid var(--ai-line); }
.ai-head-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.35; }
.ai-head-txt b { font-size: 16px; }
.ai-head-txt small { color: var(--muted); font-size: 13px; }
.ai-left { font-size: 13px; font-weight: 800; color: #9a4b00; background: #fff; border-radius: 999px; padding: 2px 10px; border: 1px solid var(--ai-line); white-space: nowrap; }
.ai-left:empty { display: none; }
.ai-logo-lg { animation: aiBob 3.4s ease-in-out infinite; transform-origin: 50% 80%; }
@keyframes aiBob { 50% { transform: translateY(-3px) rotate(-4deg); } }
.ai-notice { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 9px 12px; border-radius: 10px; background: #fff8e6; font-size: 14.5px; animation: fadeUp var(--dur-2) var(--ease-out) both; }
.ai-notice[hidden] { display: none; }
.ai-sent { border: 1px dashed var(--line2); border-radius: 10px; padding: 6px 10px; font-size: 14px; background: #fbfcff; }
.ai-sent summary { cursor: pointer; font-weight: 700; color: var(--ink2); }
.ai-sent[open] > div { animation: fadeDown var(--dur-2) var(--ease-out) both; }
.ai-sent-list { margin: 6px 0; padding-left: 18px; }
.ai-sent-list li { margin: 2px 0; overflow-wrap: anywhere; }
.ai-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chip:hover:not(:disabled) { transform: translateY(-1px); border-color: #f0b27a; background: #fff6ee; box-shadow: 0 3px 10px rgba(217, 95, 0, .12); }
.ai-thread { list-style: none; margin: 0; padding: 0 2px; display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow: auto; overscroll-behavior: contain; }
.insp-big .ai-thread { max-height: calc(100vh - 380px); }
.ai-empty { text-align: center; padding: 6px 10px; }
.ai-msg { display: flex; gap: 8px; align-items: flex-end; }
.ai-me { justify-content: flex-end; }
.ai-bubble { max-width: 88%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.ai-me .ai-bubble { background: var(--brand); color: #fff; border-bottom-right-radius: 6px; }
.ai-q-kind { display: block; font-weight: 700; font-size: 13.5px; }
.ai-q-kind + span { display: block; }
.ai-bot .ai-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: 0 1px 3px rgba(20, 30, 60, .05); }
.ai-bot .ai-bubble .md p:last-child, .ai-bot .ai-bubble .md ul:last-child { margin-bottom: 0; }
.ai-bot.is-error .ai-bubble { background: var(--warn-soft); border-color: #f3d39a; }
.ai-bot.is-error .ai-bubble p { margin: 0 0 6px; }
.ai-avatar { flex: none; border-radius: 50%; background: var(--ai-soft); padding: 1px; }
.ai-msg.is-new { animation: msgIn .34s var(--ease-out) both; }
.ai-bot.is-new .md > * { animation: fadeUp .4s var(--ease-out) both; }
.ai-bot.is-new .md > *:nth-child(2) { animation-delay: .06s; } .ai-bot.is-new .md > *:nth-child(3) { animation-delay: .12s; }
.ai-bot.is-new .md > *:nth-child(4) { animation-delay: .18s; } .ai-bot.is-new .md > *:nth-child(n+5) { animation-delay: .24s; }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ai-typing { display: inline-flex; gap: 4px; vertical-align: middle; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #f28320; animation: aiDot 1s infinite ease-in-out; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-4px); opacity: 1; } }
.ai-form { display: flex; flex-direction: column; gap: 6px; }
.ai-input { min-height: 64px; resize: vertical; line-height: 1.5; }
.ai-input:focus { border-color: var(--ai); outline-color: rgba(217, 95, 0, .2); box-shadow: 0 0 0 4px rgba(217, 95, 0, .1); }
.ai-form-row { display: flex; align-items: center; gap: 8px; }
.ai-form-row .ai-keys { margin-right: auto; }
.ai-count { min-width: 52px; font-variant-numeric: tabular-nums; }
.ai-send { background: var(--ai); border-color: var(--ai); }
.ai-send:hover:not(:disabled) { background: var(--ai-dark); box-shadow: 0 4px 14px rgba(217, 95, 0, .3); }
.ai-foot { margin: 0; }
.btn-ai { background: var(--ai); border-color: var(--ai); color: #fff; }
.btn-ai:hover:not(:disabled) { background: var(--ai-dark); box-shadow: 0 4px 14px rgba(217, 95, 0, .3); transform: translateY(-1px); }
.btn-ai-mini { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 2px 11px 2px 4px; border-radius: 999px; border: 1px solid #f3d3b0;
  background: #fff; color: #9a4b00; font-weight: 700; font-size: 13.5px; white-space: nowrap;
  transition: background var(--dur-1) ease, transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
.btn-ai-mini:hover { background: var(--ai-soft); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(217, 95, 0, .15); }
.btn-ai-mini:active { transform: scale(.96); }
.btn-ai-mini .ai-logo { transition: transform var(--dur-3) var(--ease-spring); }
.btn-ai-mini:hover .ai-logo { transform: rotate(-12deg) scale(1.12); }
.result-summary-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.msg-ai { display: block; margin-top: 6px; }
.insp-ai-card { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 18px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: linear-gradient(135deg, var(--ai-soft), #eef7ec); border: 1px solid var(--ai-line); }
.insp-ai-card > div:nth-child(2) { flex: 1; min-width: 150px; }
.insp-ai-card p { margin: 2px 0 0; }
.insp-ai-open { margin-top: 16px; text-align: left; animation: fadeUp var(--dur-3) var(--ease-out) both; }
.tut-ai { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tut-ai-btn { border-color: #f3d3b0; color: #9a4b00; background: #fff; }
.tut-ai-btn:hover:not(:disabled) { background: var(--ai-soft); }
.tut-ai-out { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.tut-ai-ans { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 8px 10px; border-radius: 12px; background: #fff7ee; border: 1px solid var(--ai-line); font-size: 14.5px; }
.tut-ai-ans .md p:last-child { margin-bottom: 0; }
.tut-ai-ans.is-new, .tut-ai-ans.is-pending { animation: msgIn .34s var(--ease-out) both; }
.tut-ai-ans.is-error { background: var(--warn-soft); }
.help-ai { display: flex; gap: 12px; align-items: center; background: #fff7ee; border-radius: 14px; padding: 10px 12px; }
.help-ai p { margin: 0; }
.ai-hist-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-hist-list details { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; }
.ai-hist-list summary { cursor: pointer; font-weight: 650; }
.ai-hist-list .md { margin-top: 6px; font-size: 14.5px; }
/* 선생님 화면: 수업별 시나브로 AI 설정·질문 기록 */
.ai-class { display: flex; flex-direction: column; gap: 10px; }
.ai-class-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-class-head h2 { margin: 0; flex: 1; }
.ai-class-set { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--ai-soft); border: 1px solid var(--ai-line); }
.ai-class-set label { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ai-log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ai-log-list details { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: #fff; }
.ai-log-list summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ai-log-who { font-weight: 800; }
.ai-log-q { flex: 1 1 260px; min-width: 0; overflow-wrap: anywhere; }
.ai-log-list .md { margin-top: 8px; padding: 8px 10px; background: var(--bg); border-radius: 10px; font-size: 14.5px; }
@media (max-width: 640px) {
  .ai-keys { display: none; }
  .ai-thread { max-height: none; }
  .toast-act { margin-left: 0; }
}
.ai-class-head h2 { border-top: 0; padding-top: 0; margin: 0; }
