/* ARG 작업대 — 작업 도구용 조용한 UI. 색은 모두 토큰, 라이트/다크/시스템 3상태. */
:root {
  --bg: #f4f4f1; --panel: #ffffff; --panel2: #f2f2ee; --sunk: #ebebe6; --fg: #18191b; --fg2: #3d4045; --mut: #6b6e73; --faint: #a3a6ab;
  --line: #e2e1db; --line2: #d3d2cb;
  --acc: #2563c9; --acc-fg: #ffffff; --acc-weak: #e3ecfb; --acc-line: #9bb8ec;
  --agent: #7a52c7; --agent-weak: #f1ebfc; --agent-line: #c9b5ef; --good: #1f8a52; --good-weak: #e1f3e8; --mid: #b7791f; --mid-weak: #fbf0dc; --bad: #c2372b; --bad-weak: #fbe4e1;
  --viewer: #e9e9e4; --grid1: #c2c1b9; --grid2: #d9d8d1;
  --shadow: 0 1px 2px rgba(20, 22, 26, .06), 0 2px 8px rgba(20, 22, 26, .05);
  --shadow-lg: 0 10px 30px rgba(20, 22, 26, .16);
  --r: 10px; --r-sm: 7px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131417; --panel: #1b1d21; --panel2: #23262b; --sunk: #16181b; --fg: #f0f0ed; --fg2: #c9cbcf; --mut: #9a9ea6; --faint: #6e737b;
    --line: #2c3036; --line2: #383d44;
    --acc: #5b9cff; --acc-fg: #0d1420; --acc-weak: #1b2a42; --acc-line: #36588f;
    --agent: #b59cff; --agent-weak: #261e3d; --agent-line: #5a4791; --good: #4cc584; --good-weak: #173325; --mid: #e3a64a; --mid-weak: #3a2c14; --bad: #f0705f; --bad-weak: #3d1c18;
    --viewer: #202328; --grid1: #454a52; --grid2: #2c3036;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131417; --panel: #1b1d21; --panel2: #23262b; --sunk: #16181b; --fg: #f0f0ed; --fg2: #c9cbcf; --mut: #9a9ea6; --faint: #6e737b;
  --line: #2c3036; --line2: #383d44;
  --acc: #5b9cff; --acc-fg: #0d1420; --acc-weak: #1b2a42; --acc-line: #36588f;
  --agent: #b59cff; --agent-weak: #261e3d; --agent-line: #5a4791; --good: #4cc584; --good-weak: #173325; --mid: #e3a64a; --mid-weak: #3a2c14; --bad: #f0705f; --bad-weak: #3d1c18;
  --viewer: #202328; --grid1: #454a52; --grid2: #2c3036;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 12px 34px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.55 var(--sans); -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
a { color: var(--acc); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
h1 { font-size: 17px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
.mut { color: var(--mut); }
.small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.label { font-size: 11px; letter-spacing: .06em; color: var(--mut); font-weight: 650; text-transform: uppercase; }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
kbd { font: 10.5px var(--mono); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--panel); color: var(--mut); margin-left: 5px; }

/* ---------- 버튼 · 입력 ---------- */
button, .btn {
  font: inherit; font-size: 13px; font-weight: 550; color: var(--fg); background: var(--panel); border: 1px solid var(--line2);
  border-radius: var(--r-sm); padding: 5px 10px; cursor: pointer; line-height: 1.3; text-decoration: none;
  display: inline-flex; align-items: center; gap: 5px; transition: background .12s, border-color .12s, color .12s;
}
button:hover, .btn:hover { border-color: var(--acc-line); background: var(--panel2); }
button:focus-visible, .btn:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
button:disabled { opacity: .45; cursor: default; }
button.on { background: var(--acc-weak); border-color: var(--acc-line); color: var(--acc); }
button.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); }
button.primary:hover { filter: brightness(1.06); }
button.primary kbd, button.on kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .8; }
button.ghost { background: transparent; border-color: transparent; color: var(--mut); }
button.ghost:hover { color: var(--fg); background: var(--panel2); }
button.v-good.on { background: var(--good-weak); border-color: var(--good); color: var(--good); }
button.v-mid.on { background: var(--mid-weak); border-color: var(--mid); color: var(--mid); }
button.v-bad.on { background: var(--bad-weak); border-color: var(--bad); color: var(--bad); }
.ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.play .ic { fill: currentColor; }
textarea, input[type=text], input[type=password], select {
  font: inherit; font-size: 13.5px; color: var(--fg); background: var(--panel); border: 1px solid var(--line2);
  border-radius: var(--r-sm); padding: 6px 9px;
}
textarea, input[type=text], input[type=password] { width: 100%; }
textarea { min-height: 36px; resize: vertical; }
select { padding: 4px 6px; }
/* 붙은 버튼 묶음 */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r-sm); background: var(--panel); overflow: hidden; }
.seg > button { border: 0; border-radius: 0; border-right: 1px solid var(--line); background: transparent; padding: 5px 9px; }
.seg > button:last-child { border-right: 0; }
.seg > button:hover { background: var(--panel2); }
.seg > button.on { background: var(--acc-weak); color: var(--acc); }
.seg.verdict > button { padding: 5px 14px; }

/* ---------- 앱 바 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 120px 8px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.appbar-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.appbar-l h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-r { display: flex; align-items: center; gap: 8px; }
.brand { display: inline-flex; align-items: center; gap: 6px; font-weight: 750; color: var(--fg); text-decoration: none; letter-spacing: .02em; }
.brand img { width: 20px; height: 20px; border-radius: 5px; }
.sep { color: var(--faint); }
.kind-chip { font-size: 11.5px; font-weight: 650; color: var(--acc); background: var(--acc-weak); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.help { position: relative; }
.help > summary { list-style: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--line2); border-radius: 50%; cursor: pointer; font-weight: 700; color: var(--mut); background: var(--panel); }
.help > summary::-webkit-details-marker { display: none; }
.help-pop { position: absolute; right: 0; top: 38px; width: min(360px, 90vw); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-lg); padding: 12px 14px; display: grid; gap: 6px; font-size: 13px; z-index: 35; }
.help-pop b { margin-top: 4px; }

/* ---------- 본문 ---------- */
main { max-width: 1440px; margin: 0 auto; padding-inline: 20px; padding-block: 18px 96px; display: grid; gap: 22px; }
.sections { display: grid; gap: 30px; }
.section { display: grid; gap: 12px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; position: sticky; top: 49px; z-index: 5; padding: 8px 0 6px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sec-head .count { font-size: 12.5px; color: var(--mut); }
.note { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px; white-space: pre-wrap; min-width: 0; }
.note.agent { border-left: 3px solid var(--agent); background: var(--panel2); }
.agent-note { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--acc); border-radius: var(--r); box-shadow: var(--shadow); }
.agent-note > summary { cursor: pointer; padding: 9px 14px; font-weight: 650; font-size: 13px; color: var(--acc); }
.agent-note > div { padding: 0 14px 12px; white-space: pre-wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11.5px; background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--mut); white-space: nowrap; }
.chip.on { background: var(--acc); border-color: var(--acc); color: var(--acc-fg); }

/* ---------- 클립 카드: 왼쪽 3D · 오른쪽 정보 ---------- */
.clips { display: grid; gap: 16px; }
.board-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
body.has-seclist .board-body { grid-template-columns: 280px minmax(0, 1fr); }
.sec-list { position: sticky; top: 64px; max-height: calc(100vh - 170px); overflow-y: auto; display: grid; gap: 6px; padding-right: 4px; }
.sec-filter { width: 100%; font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); color: var(--fg); margin-bottom: 4px; }
#secItems { display: grid; gap: 6px; }
.sec-card { display: grid; gap: 3px; text-align: left; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); white-space: normal; }
.sec-card:hover { border-color: var(--acc-line); }
.sec-card.on { border-color: var(--acc-line); box-shadow: 0 0 0 2px var(--acc-weak); }
.sec-card .sec-t { font-weight: 650; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.sec-card .sec-m { font-size: 11.5px; font-weight: 450; color: var(--mut); }
.sec-card .sec-m .g { color: var(--good); font-weight: 650; } .sec-card .sec-m .b { color: var(--bad); font-weight: 650; }
@media (max-width: 900px) {
  body.has-seclist .board-body { grid-template-columns: minmax(0, 1fr); }
  .sec-list { position: static; max-height: none; grid-auto-flow: column; overflow-x: auto; overflow-y: hidden; }
  #secItems { grid-auto-flow: column; grid-auto-columns: 220px; }
  .sec-filter { display: none; }
}
.more-btn { display: block; width: 100%; margin-top: 12px; padding: 10px; border-style: dashed; color: var(--mut); }
.more-btn:hover { color: var(--fg); border-color: var(--acc-line); }
.clip { display: grid; grid-template-columns: minmax(0, 1fr) 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); outline: none; min-width: 0; overflow: hidden; }
.clip:focus-within, .clip:focus { border-color: var(--acc-line); box-shadow: 0 0 0 3px var(--acc-weak), var(--shadow); }
.clip-main { display: grid; gap: 8px; padding: 10px; min-width: 0; }
.clip-side { display: grid; gap: 14px; align-content: start; padding: 14px 16px; border-left: 1px solid var(--line); background: var(--panel2); min-width: 0; }
.clip-head { display: grid; gap: 6px; }
.clip-head h3 { font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.side-sec { display: grid; gap: 6px; }
@media (max-width: 980px) { .clip { grid-template-columns: minmax(0, 1fr); } .clip-side { border-left: 0; border-top: 1px solid var(--line); } }

.viewer { position: relative; width: 100%; aspect-ratio: 16 / 8.5; max-height: max(300px, calc(100vh - 440px)); background: var(--viewer); border-radius: var(--r); overflow: hidden; }
.viewer canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.viewer canvas:active { cursor: grabbing; }
.viewer .overlay { position: absolute; left: 10px; top: 9px; font: 12px var(--mono); color: var(--mut); pointer-events: none; background: color-mix(in srgb, var(--panel) 70%, transparent); padding: 1px 7px; border-radius: 5px; }
.viewer .views { position: absolute; right: 8px; top: 8px; box-shadow: var(--shadow); }
.viewer .views button { font-size: 12px; padding: 3px 8px; font-weight: 550; }
.viewer .vbtn { position: absolute; right: 8px; bottom: 8px; font-size: 12px; padding: 3px 9px; box-shadow: var(--shadow); }
.viewer .loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--mut); font-size: 13px; }
@media (max-width: 720px) { .viewer { aspect-ratio: 4 / 3.4; } .viewer .views button { padding: 3px 6px; } }

.transport { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tr-btns > button { padding: 5px 8px; }
.tr-btns > .play { padding: 5px 14px; color: var(--acc); }
.transport .fr { font-size: 12.5px; color: var(--mut); flex: 1; text-align: center; min-width: 130px; }
.tr-right { display: flex; align-items: center; gap: 6px; }
.tog { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 28px; border: 1px solid var(--line2); border-radius: var(--r-sm); color: var(--faint); cursor: pointer; background: var(--panel); }
.tog input { display: none; }
.tog:has(input:checked) { color: var(--acc); background: var(--acc-weak); border-color: var(--acc-line); }

/* 타임라인: 위 = 에이전트 표시, 아래 = 내가 고른 것 */
.tl { position: relative; height: 50px; user-select: none; touch-action: none; cursor: pointer; margin: 0 4px; }
.tl-track { position: absolute; left: 0; right: 0; top: 19px; height: 12px; border-radius: 6px; background: var(--sunk); border: 1px solid var(--line); overflow: hidden; }
.tl-ticks { position: absolute; inset: 0; opacity: .7; }
.tl-head { position: absolute; top: 13px; width: 3px; height: 24px; background: var(--acc); border-radius: 2px; transform: translateX(-1.5px); pointer-events: none; box-shadow: 0 0 0 2px var(--panel); }
.tl-mark { position: absolute; transform: translateX(-50%); font-size: 11px; white-space: nowrap; line-height: 1.2; }
.tl-mark.agent { top: 1px; color: var(--mut); }
.tl-mark.agent::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 16px; background: var(--agent); }
.tl-mark.user { top: 34px; color: var(--acc); font-weight: 650; }
.tl-mark.user::before { content: ""; position: absolute; left: 50%; top: -15px; width: 9px; height: 9px; background: var(--acc); transform: translate(-50%, 0) rotate(45deg); border-radius: 1px; box-shadow: 0 0 0 1.5px var(--panel); }
.tl-mark.dot { font-size: 0; width: 5px; height: 5px; }
.tl-mark.agent.dot { top: 9px; background: var(--agent); border-radius: 50%; }
.tl-mark:hover { z-index: 3; }

.pick-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 2px; }
.pick-row .label { margin-right: 2px; }
.chipbtn { border-radius: 999px; padding: 4px 6px 4px 12px; }
.pick-row .b-custom { width: 150px; padding: 4px 9px; }
.pick-row .b-pose { margin-left: auto; }
.kf-list { display: flex; flex-wrap: wrap; gap: 6px; }
.kf { display: inline-flex; gap: 4px; align-items: center; background: var(--acc-weak); border: 1px solid var(--acc-line); border-radius: 999px; padding: 1px 2px 1px 10px; font-size: 12.5px; }
.kf b { font-family: var(--mono); font-weight: 600; color: var(--acc); }
.kf button { padding: 0 6px; border: 0; background: transparent; color: var(--mut); }
.kf button:hover { color: var(--fg); }
.pose-list { display: grid; gap: 6px; }
.pose-chip { justify-content: flex-start; text-align: left; gap: 8px; padding: 3px 8px 3px 3px; width: 100%; background: var(--panel); }
.pose-chip img { width: 56px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--viewer); flex: none; }

/* ---------- 이미지 고르기 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.fig { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: grid; gap: 6px; cursor: pointer; position: relative; min-width: 0; margin: 0; box-shadow: var(--shadow); transition: border-color .12s, box-shadow .12s; }
.fig:hover { border-color: var(--acc-line); }
.fig img { width: 100%; aspect-ratio: 1; object-fit: contain; background: var(--viewer); border-radius: 8px; }
.fig.picked { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-weak), var(--shadow); }
.fig.picked::after { content: "✓ 선택"; position: absolute; top: 14px; left: 14px; background: var(--acc); color: var(--acc-fg); font-size: 12px; font-weight: 650; padding: 2px 9px; border-radius: 999px; }
.fig.ref { border-style: dashed; cursor: default; box-shadow: none; }
.fig.ref::after { content: "원본"; position: absolute; top: 14px; left: 14px; background: var(--agent); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.fig .cap { font-size: 12.5px; word-break: break-all; }
.fig .zoom { position: absolute; top: 14px; right: 14px; font-size: 12px; padding: 2px 7px; }

/* ---------- 홈 ---------- */
.home-hero { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.home-hero h1 { font-size: 24px; }
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 1000px) { .cols { grid-template-columns: minmax(0, 1fr); } }
.blist { display: grid; gap: 10px; align-content: start; }
.col-head { display: grid; gap: 2px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.bcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; text-decoration: none; color: var(--fg); box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.bcard:hover { border-color: var(--acc-line); transform: translateY(-1px); }
.bcard .t { font-weight: 650; }
.bcard .meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); margin-right: 6px; vertical-align: 2px; }

/* ---------- 알림 · 하단 ---------- */
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 8px); background: var(--fg); color: var(--bg); padding: 7px 14px; border-radius: 999px; font-size: 13px; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; z-index: 60; }
.toast.show { opacity: .94; transform: translate(-50%, 0); }
.banner { background: var(--acc); color: var(--acc-fg); padding: 8px 14px; border-radius: var(--r); display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner button { background: var(--panel); color: var(--fg); border: 0; }
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 25; width: min(1100px, calc(100vw - 24px));
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px 8px 16px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); }
@media (max-width: 600px) { #dockInfo { display: none; } .dock { justify-content: flex-end; } .appbar { padding-right: 110px; } #playGroup { display: none; } }

/* ---------- 떠 있는 메뉴 ---------- */
.nav { position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); right: 12px; z-index: 50; display: grid; justify-items: end; gap: 6px; }
.nav-toggle { box-shadow: var(--shadow); background: var(--panel); height: 32px; }
.nav-panel { width: min(330px, calc(100vw - 24px)); max-height: calc(100vh - 70px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: grid; gap: 3px; box-shadow: var(--shadow-lg); }
.nav-home { font-weight: 650; text-decoration: none; padding: 4px 6px; }
.nav-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--mut); font-weight: 650; margin-top: 10px; padding: 0 6px; }
.nav-sub { font-size: 12px; color: var(--mut); padding: 2px 6px 0; }
.nav-item { display: flex; flex-direction: column; align-items: flex-start; gap: 0; text-align: left; width: 100%; border-color: transparent; background: transparent; text-decoration: none; color: var(--fg); padding: 5px 7px; border-radius: 7px; font-size: 13px; font-weight: 500; }
.nav-item:hover { background: var(--panel2); border-color: var(--line); }
.nav-item.on { background: var(--acc-weak); color: var(--acc); }
.nav-item.nav-row { flex-direction: row; justify-content: space-between; gap: 8px; }
.nav-pose { flex-direction: row; align-items: center; gap: 8px; }
.nav-pose img { width: 54px; height: 40px; object-fit: cover; border-radius: 5px; background: var(--viewer); flex: none; }
.nav-cur { background: var(--acc-weak); border: 1px solid var(--acc-line); border-radius: 9px; padding: 7px 9px; font-size: 13px; display: grid; gap: 5px; justify-items: start; }
.nav-theme { display: flex; gap: 4px; padding: 6px 4px 2px; }

/* ---------- 포즈 수정기 ---------- */
.pe { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-rows: auto auto auto 1fr; outline: none;
  padding: env(safe-area-inset-top, 0px) 0 env(safe-area-inset-bottom, 0px); }
.pe-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; padding: 8px 120px 8px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.pe-title b { font-family: var(--mono); font-size: 13.5px; }
.pe-dirty { color: var(--mid); font-weight: 600; }
.pe-vname { width: 170px !important; }
.pe-confirm, .pe-draftbar { display: flex; gap: 8px; align-items: center; padding: 8px 16px; background: var(--acc-weak); border-bottom: 1px solid var(--acc-line); flex-wrap: wrap; }
.pe-body { display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 0; }
.pe-view { position: relative; min-height: 0; background: var(--viewer); }
.pe-view canvas { width: 100%; height: 100%; display: block; touch-action: none; }
.pe-hud { position: absolute; left: 12px; top: 10px; color: var(--mut); pointer-events: none; background: color-mix(in srgb, var(--panel) 72%, transparent); padding: 2px 8px; border-radius: 6px; }
.pe-views { position: absolute; right: 10px; top: 8px; display: flex; gap: 0; box-shadow: var(--shadow); border: 1px solid var(--line2); border-radius: var(--r-sm); overflow: hidden; background: var(--panel); }
.pe-views button { font-size: 12px; padding: 3px 8px; border: 0; border-radius: 0; border-right: 1px solid var(--line); }
.pe-views button:last-child { border-right: 0; }
.pe-tools { position: absolute; left: 10px; right: 10px; bottom: 34px; display: flex; flex-wrap: wrap; gap: 6px; }
.pe-tools button { box-shadow: var(--shadow); }
.pe-tip { position: absolute; left: 12px; bottom: 10px; right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pe-side { overflow-y: auto; border-left: 1px solid var(--line); background: var(--panel); padding: 6px 0 40px; display: grid; gap: 0; align-content: start; }
.pe-side > section { display: grid; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.pe-group { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pe-group > span { width: 54px; font-size: 12px; }
.pe-group button { font-size: 12px; padding: 3px 8px; border-radius: 999px; }
.pe-group button.edited:not(.on) { border-color: var(--good); color: var(--good); }
.pe-sl { display: grid; grid-template-columns: 16px minmax(0, 1fr) 62px; gap: 8px; align-items: center; font: 12px var(--mono); }
.pe-sl input[type=range] { accent-color: var(--acc); }
.pe-sl input[type=number] { font: 12px var(--mono); padding: 3px 5px; border: 1px solid var(--line2); border-radius: 5px; background: var(--panel); color: var(--fg); width: 100%; }
.pe-hist { display: grid; gap: 1px; max-height: 190px; overflow-y: auto; }
.pe-h { justify-content: flex-start; font-size: 12px; font-weight: 500; padding: 3px 7px; border-color: transparent; background: transparent; }
.pe-h.on { background: var(--acc-weak); border-color: var(--acc-line); color: var(--fg); }
.pe-h.future { opacity: .5; }
.pe-versions { display: grid; gap: 4px; }
.pe-v { justify-content: flex-start; text-align: left; gap: 9px; padding: 4px; font-weight: 500; }
.pe-v.on { border-color: var(--acc-line); background: var(--acc-weak); color: var(--fg); }
.pe-v img, .pe-noimg { width: 76px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--viewer); flex: none; display: inline-block; }
.pe-rq { padding: 5px 0; border-bottom: 1px solid var(--line); }
.pe-reply { margin-top: 3px; padding-left: 10px; color: var(--fg); }
.pe-wrist { display: grid; gap: 3px; }
.pe-jt { padding: 1px 0; }
.ok { color: var(--good); font-weight: 650; } .warn { color: var(--mid); font-weight: 650; } .bad { color: var(--bad); font-weight: 700; }
button.linkish { border: 0; background: transparent; padding: 0; color: var(--fg); text-decoration: underline dotted; text-underline-offset: 3px; font-size: 13px; font-weight: 500; }
.pe-wr { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; padding: 3px 0; }
.pe-wr button { font-size: 12px; padding: 1px 6px; }
@media (max-width: 860px) {
  .pe-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 55vh minmax(0, 1fr); }
  .pe-side { border-left: 0; border-top: 1px solid var(--line); }
  .pe-tip { display: none; }
  .pe-bar { padding-right: 110px; }
}

/* ---------- 글자·색 위계 (2026-10-02 사용자: 구분이 잘 안 감) ----------
   1 제목 = --fg 굵게 · 2 본문 = --fg2 · 3 보조 = --mut · 에이전트가 쓴 것 = 보라 · 내가 고른 것 = 파랑 · 상태 = 초록/노랑/빨강 */
body { color: var(--fg2); }
h1, h2, h3, .clip-head h3, .bcard .t, .pe-title b { color: var(--fg); }
.label { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--fg); font-weight: 650; }
.side-sec + .side-sec { border-top: 1px solid var(--line); padding-top: 12px; }
.clip-side { gap: 12px; }
.clip-head h3 { font-family: var(--sans); font-size: 15px; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
/* 에이전트가 쓴 글 */
.note.agent, .agent-note { background: var(--agent-weak); border: 1px solid var(--agent-line); border-left: 3px solid var(--agent); color: var(--fg2); }
.note.agent::before { content: "에이전트"; display: block; font-size: 11px; font-weight: 700; color: var(--agent); margin-bottom: 2px; white-space: normal; }
.agent-note > summary { color: var(--agent); }
.agent-note > summary::after { content: " · 펼치기/접기"; color: var(--mut); font-weight: 500; font-size: 12px; }
.agent-note[open] > summary::after { content: ""; }
/* 타임라인: 에이전트 표시 = 보라, 내가 고른 것 = 파랑 */
.tl-mark.agent { color: var(--agent); font-weight: 550; }
.tl-mark.agent::after { background: var(--agent); opacity: .7; }
.tl-mark.agent.dot { background: var(--agent); }
.tl-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--mut); padding: 0 4px; }
.tl-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; vertical-align: 0; }
.tl-legend .a i { background: var(--agent); border-radius: 50%; }
.tl-legend .u i { background: var(--acc); transform: rotate(45deg); }
/* 평가 버튼: 꺼져 있어도 뜻을 색으로 */
.seg.verdict > button.v-good { color: var(--good); } .seg.verdict > button.v-mid { color: var(--mid); } .seg.verdict > button.v-bad { color: var(--bad); }
.seg.verdict > button.v-good.on { background: var(--good); color: #fff; } .seg.verdict > button.v-mid.on { background: var(--mid); color: #fff; } .seg.verdict > button.v-bad.on { background: var(--bad); color: #fff; }
/* 섹션 머리 */
.sec-head h2 { font-size: 18px; font-weight: 750; }
.sec-head .count { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: 12px; }
.mut, .small.mut { color: var(--mut); }
.transport .fr { color: var(--fg2); }
.viewer .overlay { color: var(--fg); font-weight: 600; }
.chip { color: var(--fg2); }
.kind-chip { background: var(--acc-weak); color: var(--acc); }
.pe-side > section > .label:first-child { font-size: 13px; }
.pick-row .label { color: var(--fg2); font-weight: 600; }
.bcard .meta span + span::before { content: "·"; margin-right: 10px; color: var(--faint); }
.col-head .label { font-size: 13px; }
.pe-title b { font-family: var(--sans); font-size: 15px; font-weight: 700; }

/* ---------- 키모도 스웜 ---------- */
.sw { position: fixed; inset: 0; z-index: 45; background: rgba(10, 12, 16, .45); display: grid; place-items: center; padding: 16px; }
.sw-card { width: min(1100px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.sw-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); z-index: 2; }
.sw-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0; }
.sw-body > section { padding: 14px 18px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.sw-time { grid-column: 1 / -1; border-bottom: 1px solid var(--line); }
.sw-lib { border-right: 1px solid var(--line); }
.sw-jobs-sec { grid-column: 1 / -1; border-top: 1px solid var(--line); }
.sw-tl { position: relative; height: 92px; cursor: pointer; user-select: none; touch-action: none; margin: 0 30px; }
.sw-track { position: absolute; left: 0; right: 0; bottom: 8px; height: 14px; border-radius: 7px; background: var(--sunk); border: 1px solid var(--line); }
.sw-cur { position: absolute; bottom: 2px; width: 3px; height: 26px; background: var(--acc); border-radius: 2px; transform: translateX(-1.5px); pointer-events: none; }
.sw-key { position: absolute; bottom: 26px; transform: translateX(-50%); display: grid; justify-items: center; gap: 1px; font: 11px var(--mono); color: var(--acc); cursor: pointer; }
.sw-key img { width: 64px; height: 46px; object-fit: cover; border-radius: 6px; border: 2px solid var(--acc); background: var(--viewer); }
.sw-key { touch-action: none; user-select: none; cursor: grab; } .sw-key:active { cursor: grabbing; }
.sw-key.sel img { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--fg); } .sw-key.sel span { color: var(--fg); font-weight: 700; }
.sw-key.clash img { border-color: var(--bad); } .sw-krow.sel { background: var(--acc-weak); border-radius: 8px; }
.sw-key::after { content: ""; width: 9px; height: 9px; background: var(--acc); transform: rotate(45deg); margin-top: 2px; }
.sw-keys { display: grid; gap: 6px; }
.sw-krow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 4px 0; border-bottom: 1px solid var(--line); }
.sw-krow img, .sw-krow .pe-noimg { width: 54px; height: 40px; object-fit: cover; border-radius: 5px; background: var(--viewer); }
.sw-krow .kname { flex: 1; min-width: 120px; font-weight: 600; color: var(--fg); }
.sw-poses { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; max-height: 340px; overflow: auto; }
.sw-pose { justify-content: flex-start; text-align: left; gap: 8px; padding: 4px; font-weight: 500; }
.sw-pose img, .sw-pose .pe-noimg { width: 64px; height: 48px; object-fit: cover; border-radius: 5px; background: var(--viewer); flex: none; }
.sw-opts { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; }
.sw-opts input[type=text], .sw-opts input[type=number] { width: auto; }
.sw-opts .chk { display: inline-flex; gap: 5px; align-items: center; }
.sw-job { padding: 8px 0; border-bottom: 1px solid var(--line); display: grid; gap: 3px; }
@media (max-width: 860px) { .sw-body { grid-template-columns: minmax(0, 1fr); } .sw-lib { border-right: 0; border-bottom: 1px solid var(--line); } }
/* 2026-10-06 보관함·도구(첫 화면): 검수 중만 위에, 나머지는 아래로 접어 둔다 */
#toolsec, .archive { margin-top: 22px; }
.archive > summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; padding: 8px 0; }
.archive > summary::-webkit-details-marker { display: none; }
.archive > summary::before { content: '▸'; color: var(--mut, #888); }
.archive[open] > summary::before { content: '▾'; }
.archive .bcard { opacity: .72; }
#archived, #tool { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
