/* codex.css — 유술가들 기술 도감 (코스믹 다크 / 스킬트리) */
@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Noto+Sans+KR:wght@400;500;600;700;900&display=swap");
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css");

:root {
  --bg: #05060c;
  --night: #0a0c18;
  --fg: #f2f6ff;
  --fg-2: rgba(244, 248, 255, 0.9);
  --muted: rgba(217, 226, 255, 0.62);
  --faint: rgba(217, 226, 255, 0.4);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --surface: rgba(18, 22, 38, 0.72);
  --surface-2: rgba(28, 33, 54, 0.85);
  --glass: rgba(10, 13, 26, 0.66);
  --violet: #7c5cff;
  --cyan: #8ed3ff;
  --pink: #ff9acb;
  --gold: #ffd76f;
  --red: #ff5e7a;
  --orange: #ffb46d;
  --font-d: "Space Grotesk", "Noto Sans KR", sans-serif;
  --font-s: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-s);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  word-break: keep-all;
  overflow-wrap: break-word;
}
#root { height: 100%; }
button { font-family: inherit; cursor: pointer; }
::selection { background: rgba(124, 92, 255, 0.4); }

/* ── shell ───────────────────────────────────────── */
.cx-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* atmosphere (auroras + stars + grain) */
.cx-atmo { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.cx-aurora { position: absolute; border-radius: 50%; filter: blur(110px); mix-blend-mode: screen; opacity: 0.65; }
.cx-aurora.a1 { width: 60vw; height: 60vw; left: -12vw; top: -18vw; background: radial-gradient(circle, var(--violet), transparent 62%); animation: cxFloat1 19s ease-in-out infinite alternate; }
.cx-aurora.a2 { width: 50vw; height: 50vw; right: -10vw; top: -6vw; background: radial-gradient(circle, var(--cyan), transparent 62%); animation: cxFloat2 23s ease-in-out infinite alternate; }
.cx-aurora.a3 { width: 56vw; height: 56vw; left: 28vw; bottom: -26vw; background: radial-gradient(circle, var(--pink), transparent 62%); animation: cxFloat3 17s ease-in-out infinite alternate; }
@keyframes cxFloat1 { to { transform: translate(6vw, 5vh) scale(1.12); } }
@keyframes cxFloat2 { to { transform: translate(-5vw, 6vh) scale(1.08); } }
@keyframes cxFloat3 { to { transform: translate(4vw, -5vh) scale(1.15); } }
.cx-stars { position: absolute; inset: 0; background-image:
    radial-gradient(1px 1px at 20% 30%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 70% 20%, rgba(255,255,255,.6), transparent),
    radial-gradient(1.4px 1.4px at 40% 70%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 85% 60%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 12% 80%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.2px 1.2px at 60% 85%, rgba(255,255,255,.6), transparent),
    radial-gradient(1px 1px at 92% 35%, rgba(255,255,255,.5), transparent);
  opacity: 0.7; }
.cx-grain { position: absolute; inset: 0; opacity: 0.35; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ── top header (브랜드 nav) ─────────────────────── */
.cx-head {
  position: relative; z-index: 30; flex: 0 0 auto;
  height: 60px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; gap: 18px;
  background: rgba(7, 9, 18, 0.7); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.cx-brand { display: flex; align-items: center; gap: 14px; }
.cx-mark { width: 44px; height: 24px; border-radius: 4px; flex: 0 0 auto;
  background: linear-gradient(90deg, #0c0d10 0 34%, #f4f5f7 34% 42%, var(--violet) 42% 58%, #f4f5f7 58% 66%, #0c0d10 66% 100%); }
.cx-name { font-family: var(--font-d); display: flex; align-items: baseline; gap: 5px; }
.cx-name b { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; }
.cx-name i { color: var(--cyan); font-style: normal; font-size: 13px; }
.cx-nav { display: flex; gap: 4px; margin-left: 10px; }
.cx-nav a { position: relative; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14.5px; padding: 6px 12px; border-radius: 8px; transition: color 0.2s, background 0.2s; white-space: nowrap; }
.cx-nav a:hover { color: var(--fg); }
.cx-nav a.on { color: var(--fg); }
.cx-nav a.on::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 2px; border-radius: 2px; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.cx-head__right { display: flex; align-items: center; gap: 10px; }
.cx-login { color: var(--fg-2); font-weight: 600; font-size: 14px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: transparent; transition: 0.2s; white-space: nowrap; }
.cx-login:hover { border-color: var(--cyan); color: var(--fg); }
.cx-join { color: #0a0c18; font-weight: 700; font-size: 14px; padding: 8px 16px; border-radius: 999px; border: none; background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 10px 26px -10px rgba(124,92,255,.7); transition: 0.2s; white-space: nowrap; }
.cx-join:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -10px rgba(124,92,255,.9); }

/* ── HUD bar (게임 chrome) ───────────────────────── */
.cx-hud { position: relative; z-index: 20; flex: 0 0 auto; height: 56px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 20px; gap: 16px;
  background: linear-gradient(180deg, rgba(7,9,18,.55), transparent); }
.cx-hud__title { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-d); white-space: nowrap; }
.cx-hud__title .t { font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.cx-hud__title .sub { font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
.cx-seg { display: inline-flex; position: relative; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.cx-seg__ind { position: absolute; top: 3px; bottom: 3px; border-radius: 999px; background: linear-gradient(135deg, rgba(142,211,255,.22), rgba(124,92,255,.22)); border: 1px solid var(--line-strong); transition: transform 0.34s var(--ease), width 0.34s var(--ease); }
.cx-seg button { position: relative; z-index: 1; border: none; background: transparent; color: var(--muted); font-weight: 600; font-size: 13.5px; padding: 6px 16px; border-radius: 999px; transition: color 0.2s; white-space: nowrap; }
.cx-seg button.on { color: var(--fg); }
.cx-stats { display: flex; align-items: center; gap: 8px; }
.cx-stat { display: flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.cx-stat svg { width: 15px; height: 15px; }
.cx-stat .n { font-family: var(--font-d); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.cx-stat .lb { font-size: 11px; color: var(--muted); }
.cx-stat--belt svg { color: var(--cyan); }
.cx-stat--learn svg { color: var(--gold); }
.cx-stat--total svg { color: var(--pink); }

/* ── map stage ──────────────────────────────────── */
.cx-stage { position: relative; z-index: 10; flex: 1 1 auto; overflow: hidden; cursor: grab; touch-action: none; }
.cx-stage.dragging { cursor: grabbing; }
.cx-canvas { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.cx-edges { position: absolute; top: 0; left: 0; overflow: visible; pointer-events: none; }
.cx-edge { fill: none; transition: stroke-opacity 0.3s, stroke 0.3s; }
.cx-edge--glow { filter: blur(3px); }
.cx-edge-label { font-family: var(--font-s); font-size: 12px; fill: var(--faint); paint-order: stroke; stroke: rgba(5,6,12,.85); stroke-width: 4px; opacity: 0; transition: opacity 0.25s; }

/* node */
.cx-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 9px; cursor: pointer; transition: opacity 0.3s; }
.cx-node__ring { position: relative; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 50% 36%, rgba(30,36,60,.96), rgba(8,10,20,.96)); transition: transform 0.25s var(--ease), box-shadow 0.25s; }
.cx-node__ring::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--nc); opacity: 0.5; transition: opacity 0.25s, box-shadow 0.25s; box-shadow: 0 0 14px -2px var(--nc); }
.cx-node__ring svg { width: 46%; height: 46%; color: var(--nc); }
.cx-node:hover .cx-node__ring { transform: translateY(-3px) scale(1.06); }
.cx-node:hover .cx-node__ring::before { opacity: 1; box-shadow: 0 0 26px -1px var(--nc), inset 0 0 16px -4px var(--nc); }
.cx-node__label { font-family: var(--font-d); font-weight: 600; font-size: 13px; color: var(--fg-2); text-align: center; max-width: 130px; line-height: 1.25; text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.cx-node__en { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-top: -6px; }
.cx-node--root .cx-node__ring { box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.cx-node--root .cx-node__ring::before { opacity: 1; border-width: 2.5px; box-shadow: 0 0 30px -2px var(--nc), inset 0 0 20px -6px var(--nc); }
.cx-node--learned .cx-node__ring { background: radial-gradient(circle at 50% 36%, color-mix(in srgb, var(--nc) 38%, #0a0c18), #0a0c18); }
.cx-node--learned .cx-node__ring::before { opacity: 1; box-shadow: 0 0 22px -1px var(--nc); }
.cx-node__check { position: absolute; right: -3px; top: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: #0a0c18; display: grid; place-items: center; box-shadow: 0 0 12px -2px var(--gold); }
.cx-node__check svg { width: 12px; height: 12px; }
/* recommended pulse */
.cx-node--rec .cx-node__ring::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; border: 2px solid var(--gold); opacity: 0; animation: cxPulse 2s ease-out infinite; }
@keyframes cxPulse { 0% { transform: scale(0.9); opacity: 0.8; } 100% { transform: scale(1.35); opacity: 0; } }
.cx-node--dim { opacity: 0.22; }
.cx-node--dim:hover { opacity: 0.5; }
.cx-node__belt { position: absolute; left: -3px; top: -3px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #0a0c18; }

/* tooltip card */
.cx-tip { position: absolute; z-index: 40; width: 252px; padding: 16px 18px; border-radius: 14px;
  background: var(--surface-2); border: 1px solid var(--line-strong); backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(0,0,0,.6); pointer-events: none; transform: translateY(6px); opacity: 0;
  transition: opacity 0.18s, transform 0.18s; }
.cx-tip.show { opacity: 1; transform: translateY(0); }
.cx-tip__eyebrow { font-family: var(--font-d); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tc); display: flex; align-items: center; gap: 7px; }
.cx-tip__name { font-family: var(--font-d); font-weight: 700; font-size: 18px; margin: 6px 0 2px; }
.cx-tip__en { font-size: 11px; color: var(--faint); letter-spacing: 0.08em; }
.cx-tip__sum { font-size: 12.5px; color: var(--muted); line-height: 1.55; margin: 10px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cx-tip__foot { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--tc); font-weight: 600; display: flex; align-items: center; gap: 6px; }

/* zoom controls */
.cx-zoom { position: absolute; right: 18px; bottom: 70px; z-index: 25; display: flex; flex-direction: column; gap: 6px; }
.cx-zoom button { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); transition: 0.2s; }
.cx-zoom button:hover { border-color: var(--cyan); color: var(--fg); background: var(--surface-2); }
.cx-zoom svg { width: 18px; height: 18px; }
.cx-hint { position: absolute; left: 50%; bottom: 64px; transform: translateX(-50%); z-index: 15; font-size: 12px; color: var(--faint); letter-spacing: 0.04em; pointer-events: none; opacity: 0.9; }
.cx-hint b { color: var(--muted); font-weight: 600; }

/* ── bottom bar ─────────────────────────────────── */
.cx-foot { position: relative; z-index: 20; flex: 0 0 auto; height: 48px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px;
  background: linear-gradient(0deg, rgba(7,9,18,.7), transparent); }
.cx-key { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.cx-key .kbd { font-family: var(--font-d); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); }
.cx-legend { display: flex; gap: 16px; align-items: center; font-size: 11.5px; color: var(--muted); }
.cx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cx-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ── detail sheet ───────────────────────────────── */
.cx-detail { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: flex-end;
  background: rgba(4, 5, 11, 0.62); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.3s; }
.cx-detail.show { opacity: 1; }
.cx-sheet { width: min(720px, 100%); height: 100%; overflow-y: auto; overflow-x: hidden; position: relative;
  background: linear-gradient(180deg, rgba(13,16,30,.97), rgba(7,9,18,.98)); border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0,0,0,.6); transform: translateX(40px); transition: transform 0.4s var(--ease); }
.cx-detail.show .cx-sheet { transform: translateX(0); }
.cx-sheet__bg { position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: radial-gradient(120% 60% at 80% 0%, color-mix(in srgb, var(--dc) 22%, transparent), transparent 60%); }
.cx-sheet__in { position: relative; padding: 22px 40px 80px; }

.cx-sheet__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 5; margin: 0 -40px; padding: 14px 40px; background: linear-gradient(180deg, rgba(9,11,22,.96), rgba(9,11,22,.7) 70%, transparent); backdrop-filter: blur(8px); }
.cx-crumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cx-crumb b { color: var(--dc); font-weight: 600; }
.cx-back { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; transition: 0.2s; white-space: nowrap; flex-shrink: 0; }
.cx-back:hover { border-color: var(--cyan); color: var(--fg); }
.cx-close { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--fg-2); transition: 0.2s; flex-shrink: 0; }
.cx-close:hover { border-color: var(--red); color: var(--fg); }

.cx-d-head { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.cx-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.cx-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-d); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--fg-2); background: var(--surface); white-space: nowrap; }
.cx-badge--tree { color: var(--dc); border-color: color-mix(in srgb, var(--dc) 45%, transparent); }
.cx-belt-dot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); }
.cx-d-title { font-family: var(--font-d); font-weight: 700; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.02; letter-spacing: -0.02em; margin: 2px 0 0; }
.cx-d-en { font-size: 14px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.cx-d-toprow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cx-d-toprow > div { min-width: 0; flex: 1; }
.cx-learn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); transition: 0.2s; white-space: nowrap; flex-shrink: 0; }
.cx-learn svg { width: 16px; height: 16px; }
.cx-learn:hover { border-color: var(--gold); }
.cx-learn.on { background: linear-gradient(135deg, var(--gold), var(--orange)); color: #0a0c18; border-color: transparent; box-shadow: 0 10px 26px -10px var(--gold); }

/* hero image slot */
.cx-d-hero { margin: 20px 0 8px; }
.cx-d-hero image-slot { display: block; width: 100%; height: clamp(220px, 30vw, 300px); border: 1px dashed var(--line-strong); border-radius: 16px; background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--dc) 14%, transparent), rgba(10,13,26,.6)); box-shadow: inset 0 12px 40px rgba(0,0,0,.4); }
.cx-d-cap { font-size: 12px; color: var(--faint); margin-top: 8px; text-align: center; }

/* ── 포지션 스테이지 (게임식 도식 + 반응) ───────── */
.cx-stage2 { margin: 18px 0 4px; }
.cx-stage2__arena { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-strong);
  background: radial-gradient(120% 100% at 50% 0%, color-mix(in srgb, var(--dc) 16%, transparent), rgba(7,9,18,.92)); box-shadow: inset 0 14px 44px rgba(0,0,0,.5); }
.cx-stage2__arena .cx-arena-fig { display: block; width: 100%; height: auto; position: relative; z-index: 0; }
.cx-stage2__arena .cx-pos-img { position: absolute; inset: 0; width: 100% !important; height: 100% !important; z-index: 1; transition: opacity 0.35s; }
.cx-stage2__arena.fading .cx-pos-img { opacity: 0.12; }
.cx-pos-img::part(frame) { background: transparent; }
.cx-pos-img:not([data-filled])::part(empty) { opacity: 0; }
.cx-pos-img:not([data-filled])::part(ring) { border-color: rgba(142, 211, 255, 0.22); border-radius: 18px; }
.cx-stage2__arena .cx-arena-hot { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.cx-stage2__arena .cx-arena-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: opacity 0.35s; user-select: none; -webkit-user-drag: none; }
.cx-stage2__arena.has-photo { aspect-ratio: 3 / 2; }
.cx-stage2__arena.has-photo .cx-arena-fig { height: 100%; }
.cx-stage2__arena.fading { box-shadow: inset 0 14px 44px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--gold) 30%, transparent); }
.cx-scene-g { transition: opacity 0.32s var(--ease); }
.cx-stage2__tag { position: absolute; left: 14px; bottom: 12px; z-index: 3; display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); background: rgba(7,9,18,.6); padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); backdrop-filter: blur(6px); }
.cx-stage2__me, .cx-stage2__opp { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cx-stage2__me { background: #8ed3ff; box-shadow: 0 0 7px #8ed3ff; }
.cx-stage2__opp { background: #ff8f6b; box-shadow: 0 0 7px #ff8f6b; margin-left: 4px; }
.cx-stage2__moving { position: absolute; right: 14px; top: 12px; z-index: 3; font-size: 12.5px; font-weight: 600; color: #0a0c18; background: linear-gradient(135deg, var(--gold), var(--orange)); padding: 6px 13px; border-radius: 999px; box-shadow: 0 8px 22px -8px var(--gold); animation: cxMovePulse 0.82s ease; }
@keyframes cxMovePulse { 0% { opacity: 0; transform: translateY(-4px); } 20%, 100% { opacity: 1; transform: none; } }
.cx-pos-hint { position: absolute; right: 14px; bottom: 12px; z-index: 3; font-size: 11px; color: var(--faint); background: rgba(7,9,18,.5); padding: 5px 10px; border-radius: 999px; border: 1px dashed var(--line-strong); pointer-events: none; transition: opacity 0.3s; }
.cx-pos-img[data-filled] ~ .cx-pos-hint { opacity: 0; }
.cx-stage2__arena.fading .cx-pos-hint { opacity: 0; }
.cx-hot { transition: r 0.18s, stroke-width 0.18s; }
.cx-hot.on { filter: drop-shadow(0 0 8px #ffd76f); }

.cx-stage2__react { margin-top: 16px; }
.cx-stage2__rtitle { display: flex; align-items: baseline; gap: 10px; font-family: var(--font-d); font-weight: 700; font-size: 15px; color: var(--fg); }
.cx-stage2__rtitle span { font-family: var(--font-s); font-weight: 500; font-size: 12.5px; color: var(--faint); }
.cx-stage2__choices { display: grid; gap: 10px; margin-top: 12px; }
.cx-choice { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--surface); transition: 0.2s var(--ease); }
.cx-choice:hover, .cx-choice.hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--toc) 60%, transparent); background: var(--surface-2); box-shadow: 0 14px 34px -22px rgba(0,0,0,.8); }
.cx-choice.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.cx-choice:disabled { cursor: default; opacity: 0.55; }
.cx-choice:disabled.active { opacity: 1; }
.cx-choice__num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-d); font-weight: 700; font-size: 14px; color: var(--gold); border: 1.5px solid color-mix(in srgb, var(--gold) 45%, transparent); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.cx-choice__txt { flex: 1 1 auto; min-width: 0; }
.cx-choice__move { display: block; font-size: 13px; color: var(--muted); line-height: 1.45; }
.cx-choice__to { display: flex; align-items: center; gap: 8px; font-family: var(--font-d); font-weight: 700; font-size: 16px; margin-top: 2px; }
.cx-choice__to .arr { color: var(--toc); }
.cx-choice__cross { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent); padding: 1px 7px; border-radius: 999px; }
.cx-choice__go { width: 20px; height: 20px; flex: 0 0 auto; color: var(--faint); transition: 0.2s; }
.cx-choice:hover .cx-choice__go, .cx-choice.hover .cx-choice__go { color: var(--toc); transform: translateX(3px); }
.cx-stage2__finish { font-size: 14px; color: var(--faint); padding: 16px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }

/* ── 위키 협업 레이어 ───────────────────────────── */
.cx-wikibar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.cx-wikibar__l { display: flex; align-items: center; gap: 12px; }
.cx-contribs { display: flex; }
.cx-contribs .cx-avatar { margin-left: -8px; border: 2px solid #0a0c18; }
.cx-contribs .cx-avatar:first-child { margin-left: 0; }
.cx-avatar.xs { width: 28px; height: 28px; font-size: 11px; }
.cx-avatar.sm { width: 30px; height: 30px; font-size: 12px; flex: 0 0 auto; }
.cx-wikibar__meta { display: flex; flex-direction: column; gap: 2px; }
.cx-wikibar__edits { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--fg-2); white-space: nowrap; }
.cx-wikibar__edits svg { width: 14px; height: 14px; color: var(--cyan); }
.cx-wikibar__last { font-size: 11.5px; color: var(--faint); white-space: nowrap; }
.cx-wikibar__r { display: flex; gap: 8px; }
.cx-wbtn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-2); font-weight: 600; font-size: 13px; transition: 0.2s; white-space: nowrap; }
.cx-wbtn svg { width: 15px; height: 15px; }
.cx-wbtn:hover { border-color: var(--cyan); color: var(--fg); }
.cx-wbtn--primary { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0a0c18; border-color: transparent; }
.cx-wbtn--primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -10px var(--violet); }

.cx-sec__hint { margin-left: auto; font-family: var(--font-s); font-weight: 500; font-size: 11.5px; letter-spacing: 0; text-transform: none; color: var(--faint); align-self: center; }

/* 주석 리스트 */
.cx-list--annot li::before { top: 16px; }
.cx-annot-row { display: flex; align-items: flex-start; gap: 10px; }
.cx-annot-text { flex: 1; }
.cx-annot-btn { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--faint); transition: 0.18s; margin-top: 1px; }
.cx-annot-btn svg { width: 14px; height: 14px; }
.cx-annot-btn:hover { color: var(--fg); border-color: var(--line-strong); }
.cx-annot-btn.has { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.cx-annot-n { font-family: var(--font-d); font-weight: 700; font-size: 11px; }
.cx-annot-panel { margin: 12px 0 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); border-left: 2px solid var(--dc); background: rgba(255,255,255,.025); display: flex; flex-direction: column; gap: 12px; }
.cx-annot-item { display: flex; gap: 10px; }
.cx-annot-bd { flex: 1; min-width: 0; }
.cx-annot-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.cx-annot-meta b { font-weight: 700; }
.cx-annot-time { font-size: 11.5px; color: var(--faint); margin-left: auto; }
.cx-annot-bd p { margin: 5px 0 0; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.cx-annot-empty { font-size: 13px; color: var(--faint); }
.cx-annot-add { display: flex; gap: 8px; }
.cx-annot-add textarea { flex: 1; resize: none; background: rgba(0,0,0,.2); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); font-family: inherit; font-size: 13.5px; line-height: 1.5; padding: 9px 11px; outline: none; }
.cx-annot-add textarea:focus { border-color: color-mix(in srgb, var(--dc) 50%, transparent); }
.cx-annot-add button { flex: 0 0 auto; align-self: flex-end; display: inline-flex; align-items: center; gap: 5px; padding: 8px 13px; border-radius: 10px; border: none; background: var(--surface-2); color: var(--fg); font-weight: 600; font-size: 13px; }
.cx-annot-add button svg { width: 14px; height: 14px; }
.cx-annot-add button:hover { background: color-mix(in srgb, var(--dc) 24%, var(--surface-2)); }

/* 패널 공통 (편집역사 / 편집제안) */
.cx-revwrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(4,5,11,.62); backdrop-filter: blur(8px); animation: cxFade 0.25s ease; }
@keyframes cxFade { from { opacity: 0; } }
.cx-revpanel, .cx-editpanel { width: min(520px, 100%); max-height: 86vh; display: flex; flex-direction: column; border-radius: 18px; border: 1px solid var(--line-strong); background: linear-gradient(180deg, rgba(16,20,36,.99), rgba(8,10,20,.99)); box-shadow: 0 40px 100px rgba(0,0,0,.7); overflow: hidden; animation: cxPop 0.3s var(--ease); }
@keyframes cxPop { from { transform: translateY(20px) scale(.97); opacity: 0; } }
.cx-revpanel__h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cx-revpanel__t { display: flex; align-items: center; gap: 9px; font-family: var(--font-d); font-weight: 700; font-size: 18px; }
.cx-revpanel__t svg { width: 19px; height: 19px; color: var(--dc); }
.cx-revpanel__s { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.cx-close.sm { width: 32px; height: 32px; }
.cx-close.sm svg { width: 16px; height: 16px; }

.cx-revlist { padding: 18px 20px 6px; overflow-y: auto; }
.cx-rev { display: flex; gap: 14px; }
.cx-rev__line { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 4px; }
.cx-rev__dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 8px currentColor; z-index: 1; }
.cx-rev__bar { flex: 1; width: 2px; background: var(--line-strong); margin: 3px 0; }
.cx-rev__bd { flex: 1; min-width: 0; padding-bottom: 18px; }
.cx-rev__top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cx-rev__top b { font-weight: 700; font-size: 14px; }
.cx-rev__tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: var(--dc); border: 1px solid color-mix(in srgb, var(--dc) 40%, transparent); padding: 1px 8px; border-radius: 999px; }
.cx-rev__when { font-size: 11.5px; color: var(--faint); margin-left: auto; }
.cx-rev__act { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: var(--fg-2); }

.cx-contribsbox { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: rgba(255,255,255,.015); }
.cx-contribsbox__t { display: flex; align-items: center; gap: 7px; font-family: var(--font-d); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); margin-bottom: 12px; }
.cx-contribsbox__t svg { width: 14px; height: 14px; }
.cx-contribrow { display: flex; align-items: center; gap: 9px; padding: 7px 0; }
.cx-contribrow b { font-weight: 600; font-size: 14px; }
.cx-contribrow__n { font-size: 12px; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* 편집 제안 */
.cx-editbody { padding: 18px 20px; overflow-y: auto; }
.cx-editlb { display: block; font-family: var(--font-d); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin: 0 0 9px; }
.cx-editsegs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.cx-editsegs button { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13px; transition: 0.18s; }
.cx-editsegs button.on { color: #0a0c18; background: var(--dc); border-color: transparent; }
.cx-editta { width: 100%; min-height: 120px; resize: vertical; background: rgba(0,0,0,.22); border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font-family: inherit; font-size: 14.5px; line-height: 1.6; padding: 13px 15px; outline: none; }
.cx-editta:focus { border-color: color-mix(in srgb, var(--dc) 50%, transparent); }
.cx-editnote { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.cx-editnote svg { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; color: #5fd6a0; }
.cx-editfoot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px; border-top: 1px solid var(--line); }

/* TOC */
.cx-toc { display: flex; flex-wrap: wrap; gap: 7px; margin: 22px 0 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.cx-toc__t { font-family: var(--font-d); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); width: 100%; margin-bottom: 2px; }
.cx-toc a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 8px; transition: 0.18s; }
.cx-toc a:hover { color: var(--fg); background: rgba(255,255,255,.05); }
.cx-toc a .num { font-family: var(--font-d); color: var(--dc); font-weight: 600; margin-right: 5px; }

/* sections */
.cx-sec { margin-top: 30px; scroll-margin-top: 70px; }
.cx-sec__h { display: flex; align-items: baseline; gap: 12px; font-family: var(--font-d); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; padding-bottom: 10px; border-bottom: 2px solid var(--line-strong); }
.cx-sec__h .num { color: var(--dc); font-size: 15px; }
.cx-prose { font-size: 16px; line-height: 1.85; color: var(--fg-2); margin: 14px 0 0; }
.cx-list { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-direction: column; gap: 11px; }
.cx-list li { position: relative; padding-left: 26px; font-size: 15px; line-height: 1.6; color: var(--fg-2); }
.cx-list li::before { content: ""; position: absolute; left: 6px; top: 9px; width: 7px; height: 7px; border-radius: 2px; background: var(--dc); box-shadow: 0 0 8px var(--dc); transform: rotate(45deg); }
.cx-list--mis li::before { background: var(--red); box-shadow: 0 0 8px var(--red); border-radius: 50%; transform: none; width: 8px; height: 8px; top: 7px; }
.cx-list b { color: var(--fg); }

/* transitions */
.cx-trans { display: grid; gap: 10px; margin-top: 16px; }
.cx-trans__card { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 15px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: 0.22s var(--ease); }
.cx-trans__card:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--toc) 55%, transparent); background: var(--surface-2); box-shadow: 0 14px 34px -20px rgba(0,0,0,.7); }
.cx-trans__icon { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 11px; display: grid; place-items: center; color: var(--toc); border: 1px solid color-mix(in srgb, var(--toc) 40%, transparent); background: color-mix(in srgb, var(--toc) 12%, transparent); }
.cx-trans__icon svg { width: 22px; height: 22px; }
.cx-trans__txt { flex: 1 1 auto; min-width: 0; }
.cx-trans__move { font-size: 13px; color: var(--muted); line-height: 1.45; }
.cx-trans__to { font-family: var(--font-d); font-weight: 700; font-size: 16px; margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.cx-trans__to .arr { color: var(--toc); }
.cx-trans__cross { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--cyan); border: 1px solid color-mix(in srgb, var(--cyan) 40%, transparent); padding: 2px 7px; border-radius: 999px; }
.cx-trans__go { flex: 0 0 auto; color: var(--faint); transition: 0.2s; }
.cx-trans__card:hover .cx-trans__go { color: var(--toc); transform: translateX(3px); }
.cx-empty { font-size: 14px; color: var(--faint); margin-top: 14px; padding: 18px; border: 1px dashed var(--line); border-radius: 12px; text-align: center; }

/* recommend chips */
.cx-rec { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.cx-rec__chip { display: inline-flex; align-items: center; gap: 9px; padding: 10px 15px 10px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 36%, transparent); background: color-mix(in srgb, var(--gold) 9%, var(--surface)); color: var(--fg); font-weight: 600; font-size: 14px; transition: 0.2s; }
.cx-rec__chip:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -14px var(--gold); border-color: var(--gold); }
.cx-rec__chip .ico { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 18%, transparent); color: var(--gold); }
.cx-rec__chip .ico svg { width: 15px; height: 15px; }

/* discussion */
.cx-disc__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.cx-disc__count { font-family: var(--font-d); font-weight: 700; font-size: 16px; }
.cx-disc__count b { color: var(--dc); }
.cx-sort { display: inline-flex; gap: 2px; }
.cx-sort button { background: transparent; border: none; color: var(--muted); font-weight: 600; font-size: 13px; padding: 5px 10px; border-radius: 8px; transition: 0.18s; }
.cx-sort button.on { color: var(--fg); background: rgba(255,255,255,.06); }
.cx-composer { margin-top: 14px; display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.cx-composer textarea { flex: 1; background: transparent; border: none; resize: none; color: var(--fg); font-family: inherit; font-size: 14px; line-height: 1.6; min-height: 44px; outline: none; }
.cx-composer textarea::placeholder { color: var(--faint); }
.cx-avatar { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px; font-family: var(--font-d); }
.cx-composer__foot { display: flex; flex-direction: column; justify-content: flex-end; }
.cx-composer__btn { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0a0c18; border: none; font-weight: 700; font-size: 13px; padding: 9px 16px; border-radius: 999px; white-space: nowrap; }
.cx-cmts { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.cx-cmt { display: flex; gap: 12px; }
.cx-cmt__body { flex: 1; min-width: 0; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.cx-cmt__top { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cx-cmt__au { font-weight: 700; font-size: 14px; }
.cx-cmt__belt { width: 9px; height: 9px; border-radius: 50%; }
.cx-cmt__best { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); padding: 1px 7px; border-radius: 999px; }
.cx-cmt__time { font-size: 12px; color: var(--faint); margin-left: auto; }
.cx-cmt__text { font-size: 14.5px; line-height: 1.65; color: var(--fg-2); margin: 8px 0 0; }
.cx-cmt__actions { display: flex; gap: 14px; margin-top: 10px; }
.cx-cmt__act { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: none; color: var(--muted); font-size: 13px; font-weight: 600; transition: 0.18s; }
.cx-cmt__act svg { width: 15px; height: 15px; }
.cx-cmt__act:hover { color: var(--fg); }
.cx-cmt__act.liked { color: var(--red); }

/* toast */
.cx-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(18px); z-index: 90;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--fg); font-weight: 600; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; backdrop-filter: blur(20px); box-shadow: 0 20px 50px rgba(0,0,0,.6);
  opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s var(--ease); }
.cx-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* scrollbar */
.cx-sheet::-webkit-scrollbar { width: 10px; }
.cx-sheet::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }

/* reveal */
.cx-reveal { opacity: 0; transform: translateY(16px); }
.is-loaded .cx-reveal { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: var(--d, 0ms); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; }
  .cx-reveal { opacity: 1 !important; transform: none !important; }
}

/* responsive */
@media (max-width: 760px) {
  .cx-nav, .cx-stats { display: none; }
  .cx-sheet__in { padding: 18px 20px 80px; }
  .cx-sheet__top { margin: 0 -20px; padding: 12px 20px; }
  .cx-hud { padding: 0 12px; }
  .cx-hud__title .sub { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   유술가들 production overrides (codex)
   The prototype-only "drop your own photo" affordance is disabled;
   baked illustrations + SVG schematics are the production look.
   ───────────────────────────────────────────────────────────── */
.cx-pos-img, .cx-pos-hint { display: none !important; }
