:root {
    --bg: #05060A;
    --ink: #EAF4FF;
    --soft: #7D8796;
    --dim: #3A404C;
    --done: #8FD3FF;
    --open: #FF9A4D;
    --lock: #262A33;
    --panel: #0C0E14;
    --line: #1C2030;
  }
  *, *::before, *::after { box-sizing: border-box; }
  html, body {
    height: 100%; margin: 0; overflow: hidden;
    background: var(--bg); color: var(--ink);
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
                 "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.011em;
  }

  /* 무대 */
  #stage { position: fixed; inset: 0; touch-action: none; cursor: grab; }
  #stage.dragging { cursor: grabbing; }
  #svg { width: 100%; height: 100%; display: block; }
  #svg text { font-family: inherit; user-select: none; -webkit-user-select: none; }

  /* 상단 */
  .top {
    position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
    padding: calc(env(safe-area-inset-top, 0px) + 22px) 24px 0;
  }
  .top > * { pointer-events: auto; }
  .mark { font-weight: 800; font-size: 14px; letter-spacing: 0.24em; }
  .mark span { color: var(--done); }
  .tagline { margin-top: 6px; font-size: 13px; color: var(--soft); }
  .progress { text-align: right; font-size: 13px; color: var(--soft); }
  .progress b { color: var(--ink); font-weight: 700; }
  .reset {
    background: none; border: 0; padding: 4px 0; margin-top: 2px; cursor: pointer;
    font: inherit; font-size: 12px; color: var(--dim); text-decoration: underline;
  }
  .reset:hover { color: var(--soft); }
  .hint {
    position: fixed; left: 0; right: 0; text-align: center; pointer-events: none;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    font-size: 12px; color: #4A5160;
  }

  /* 연결선 */
  .edge { fill: none; stroke-width: 2.5; stroke-linecap: round; transition: stroke .7s ease, opacity .7s ease; }
  .edge.locked { stroke: #1E222B; stroke-dasharray: 3 7; }
  .edge.open   { stroke: var(--open); opacity: .9; filter: url(#glowOrange); }
  .edge.done   { stroke: var(--done); filter: url(#glowBlue); }

  /* 노드 */
  .node { cursor: pointer; outline: none; }
  .node .box { stroke-width: 2; transition: fill .7s ease, stroke .7s ease; }
  .node.done   .box { fill: #CFEBFF; stroke: var(--done); filter: url(#glowBlue); }
  .node.open   .box { fill: #FFD2AE; stroke: var(--open); filter: url(#glowOrange); }
  .node.locked .box { fill: #0E1016; stroke: var(--lock); }
  .node .num { font-size: 14px; font-weight: 800; text-anchor: middle; dominant-baseline: central; }
  .node.done .num, .node.open .num { fill: #0A1A2A; }
  .node.locked .num { fill: var(--dim); }
  .node .label { font-size: 13px; font-weight: 600; text-anchor: middle; fill: var(--ink); transition: fill .7s ease; }
  .node.locked .label { fill: var(--dim); }
  .node:focus-visible .box { stroke: #fff; }

  .node .pulse { fill: none; stroke: var(--open); stroke-width: 2; opacity: 0;
                 transform-box: fill-box; transform-origin: center; }
  @media (prefers-reduced-motion: no-preference) {
    .node.open .pulse { animation: pulse 2.2s ease-out infinite; }
    .node.flash .box { animation: flash 1.4s ease-out; }
  }
  .seed { fill: var(--open); filter: url(#glowOrange); }
  @media (prefers-reduced-motion: no-preference) { .seed { animation: seed 2.4s ease-in-out infinite; } }
  @keyframes seed { 0%,100% { opacity: .35; } 50% { opacity: 1; } }
  @keyframes pulse { 0% { opacity: .75; transform: scale(1); } 100% { opacity: 0; transform: scale(1.9); } }
  @keyframes flash { 0% { stroke: #fff; stroke-width: 6; } 100% { stroke-width: 2; } }

  /* 학습 패널 */
  #scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none;
           transition: opacity .3s ease; z-index: 9; }
  #scrim.show { opacity: 1; pointer-events: auto; }
  #panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 10;
    width: min(620px, 100%); display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--line);
    transform: translateX(100%); transition: transform .38s cubic-bezier(.2,.7,.2,1);
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  #panel.show { transform: none; }
  .p-head { display: flex; justify-content: space-between; align-items: center; padding: 22px 28px 0; }
  .p-meta { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--open); }
  .p-close { background: none; border: 0; color: var(--soft); font-size: 26px; line-height: 1; cursor: pointer; padding: 4px; }
  .p-close:hover { color: var(--ink); }
  .p-scroll { flex: 1; overflow-y: auto; padding: 10px 28px 32px; font-size: 16.5px; line-height: 1.85; }
  .p-title { font-size: clamp(24px, 4.4vw, 32px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.35; margin: 6px 0 28px; }
  .md h1, .md h2, .md h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.45; margin: 44px 0 12px; }
  .p-scroll p { margin: 0 0 16px; color: #C3C7CE; }
  .p-scroll strong { color: var(--ink); font-weight: 600; }
  .p-scroll .stanza { color: var(--ink); font-size: 19px; font-weight: 600; line-height: 2; margin: 20px 0; }
  .p-scroll a { color: var(--ink); text-decoration-color: var(--done); text-underline-offset: 4px; }
  .p-foot { padding: 16px 28px 20px; border-top: 1px solid var(--line); }
  .btn {
    width: 100%; padding: 15px; border: 0; border-radius: 12px; cursor: pointer;
    font: inherit; font-size: 15px; font-weight: 700;
    background: var(--done); color: #05121F; transition: filter .15s;
  }
  .btn:hover { filter: brightness(1.08); }
  .btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
  .btn.ghost { background: transparent; color: var(--soft); border: 1px solid var(--line); cursor: default; filter: none; }

  @media (max-width: 640px) {
    #panel {
      top: auto; height: 88%; width: 100%;
      border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
      transform: translateY(100%);
    }
    .tagline { display: none; }
  }

  /* 토스트 */
  #toast {
    position: fixed; left: 50%; z-index: 20; pointer-events: none;
    top: calc(env(safe-area-inset-top, 0px) + 76px);
    transform: translate(-50%, -8px); opacity: 0; transition: opacity .3s, transform .3s;
    background: #10131B; border: 1px solid var(--line); border-radius: 999px;
    padding: 10px 18px; font-size: 14px; max-width: calc(100% - 40px); text-align: center;
  }
  #toast.show { opacity: 1; transform: translate(-50%, 0); }

  .md img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0 16px; }
  .md ul, .md ol { padding-left: 1.3em; margin: 0 0 16px; color: #C3C7CE; }
  .md blockquote { margin: 20px 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--done); }
  .md blockquote p { color: var(--ink); }
  .md hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
  .loading { color: var(--soft); }

/* ---- 인터랙티브 레슨 ---- */
.lesson .beat { animation: beatIn .25s ease; }
.lesson .beat-heading h1, .lesson .beat-heading h2, .lesson .beat-heading h3 { margin-top: 36px; }
@keyframes beatIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.beat.typing > :last-child::after, .q.typing > :last-child::after, .feedback.typing > :last-child::after {
  content: ""; display: inline-block; width: .45em; height: 1.05em; margin-left: 3px;
  vertical-align: -.15em; background: var(--done); animation: blink .9s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.beat-choice, .beat-think { margin: 26px 0; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: #0F1218; }
.beat-choice .q p, .beat-think .q p { color: var(--ink); font-weight: 600; margin: 0; }
.opts { display: grid; gap: 8px; margin-top: 14px; }
.opt {
  text-align: left; padding: 13px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: #141821; color: var(--ink);
  font: inherit; font-size: 15.5px; transition: border-color .2s, background .2s, opacity .2s;
}
.opt:hover:not(:disabled) { border-color: var(--done); }
.opt:focus-visible { outline: 2px solid var(--done); outline-offset: 2px; }
.opt.picked { border-color: var(--done); background: rgba(143, 211, 255, .12); }
.opt:disabled:not(.picked) { opacity: .4; cursor: default; }
.opt:disabled.picked { cursor: default; }
.feedback { margin-top: 12px; padding: 10px 14px; border-left: 2px solid var(--done); }
.feedback p { margin: 0; color: var(--ink); }
.beat-think textarea, .visit-box textarea, .chat-box textarea {
  width: 100%; min-height: 88px; margin-top: 14px; padding: 12px 14px; resize: vertical;
  border-radius: 12px; border: 1px solid var(--line); background: #141821; color: var(--ink);
  font: inherit; font-size: 15.5px; line-height: 1.7;
}
.beat-think textarea:focus, .visit-box textarea:focus, .chat-box textarea:focus { outline: none; border-color: var(--done); }
.beat-think .row { display: flex; justify-content: flex-end; margin-top: 8px; }
.answer { margin-top: 12px; padding: 10px 14px; border-left: 2px solid var(--open); color: var(--ink); white-space: pre-wrap; }
.btn.small { width: auto; padding: 9px 18px; font-size: 14px; }
.btn:disabled { opacity: .4; cursor: default; filter: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.foot-row { display: flex; gap: 8px; }
.foot-row .btn { flex: 1; }
.tap {
  display: block; width: 100%; padding: 12px; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13.5px; color: var(--soft); text-align: center;
}
.tap:hover { color: var(--ink); }
.tap span { display: inline-block; margin-left: 4px; }
@media (prefers-reduced-motion: no-preference) { .tap span { animation: bob 1.4s ease-in-out infinite; } }
@keyframes bob { 50% { transform: translateY(3px); } }

/* ---- 상단 통계 ---- */
.stats { display: flex; gap: 18px; text-align: right; font-size: 13px; color: var(--soft); }
.stats > div { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.stats .k { font-size: 11.5px; letter-spacing: .04em; }
.stats b { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---- 몰입형 전체 화면 학습 ---- */
#panel {
  top: 0; right: 0; bottom: 0; left: 0; width: auto; height: auto;
  border: 0; border-radius: 0; background: var(--bg);
  transform: none; opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}
#panel.show { opacity: 1; visibility: visible; transform: none; }
#scrim { display: none; }
.p-progress { height: 2px; background: var(--line); flex-shrink: 0; }
.p-progress i { display: block; height: 100%; width: 0; background: var(--done); box-shadow: 0 0 10px var(--done); transition: width .4s ease; }
.p-head { padding: 18px 24px 0; }
.p-back { background: none; border: 0; padding: 6px 0; cursor: pointer; font: inherit; font-size: 14px; color: var(--soft); }
.p-back:hover { color: var(--ink); }
.p-back:focus-visible { outline: 2px solid var(--done); outline-offset: 3px; border-radius: 4px; }
.p-scroll {
  padding: 40px max(24px, calc((100% - 680px) / 2)) 64px;
  font-size: 18px; line-height: 1.9;
}
.p-title { font-size: clamp(28px, 5vw, 40px); margin: 0 0 40px; }
.lesson .beat-text p { color: #D2D6DC; }
.p-foot {
  padding: 14px max(24px, calc((100% - 680px) / 2)) 22px;
  border-top: 0; background: linear-gradient(transparent, var(--bg) 40%);
}
@media (max-width: 640px) {
  .p-scroll { font-size: 17px; padding-top: 28px; }
  .stats { gap: 14px; }
}

/* ---- 시선 고정 + 현재 문장 강조 ---- */
.lesson.playing { padding-bottom: 55vh; }
.lesson.playing .beat { opacity: .38; transition: opacity .5s ease; }
.lesson.playing .beat.current,
.lesson.ended .beat { opacity: 1; }
/* 여러 문단으로 된 읽기 글(인용)은 질문에 답하는 동안 다시 읽을 수 있게 흐려지지 않음 */
.lesson.playing .beat:has(blockquote p + p) { opacity: 1; }

/* ---- 별자리 스타일 ---- */
.sky-star { fill: #CFE3FF; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .sky-star { animation-name: skyTwinkle; animation-timing-function: ease-in-out; animation-iteration-count: infinite; }
}
@keyframes skyTwinkle { 50% { opacity: .05; } }

.edge { stroke-width: 1.2; }
.edge.locked { stroke: #1A1E27; stroke-dasharray: none; }
.edge.open { stroke-width: 1.5; }
.edge.done { stroke-width: 1.5; opacity: .75; }

.node .hit { fill: transparent; }
.node .core { transform-box: fill-box; transform-origin: center; transition: transform .25s ease, fill .6s ease; }
.node.done   .core { fill: #DDF1FF; filter: url(#glowBlue); }
.node.open   .core { fill: #FFE0C4; filter: url(#glowOrange); }
.node.locked .core { fill: #2F3440; }
.node:hover .core, .node:focus-visible .core { transform: scale(1.6); }
.node.locked:hover .core { fill: #4A5160; }
@media (prefers-reduced-motion: no-preference) {
  .node.done .core { animation: starTwinkle 5s ease-in-out infinite; }
  .node.flash .core { animation: starBurst 1.4s ease-out; }
}
@keyframes starTwinkle { 50% { opacity: .55; } }
@keyframes starBurst { 0% { transform: scale(3.2); } 100% { transform: scale(1); } }

.node .pulse { stroke-width: 1.5; }
.node .tip { opacity: 0; transform: translateY(-4px); transition: opacity .25s ease, transform .25s ease; pointer-events: none; }
.node:hover .tip, .node:focus-visible .tip { opacity: 1; transform: none; }
.node .tip .label { font-size: 14px; font-weight: 700; fill: var(--ink); }
.node .tip .status { font-size: 11.5px; text-anchor: middle; fill: var(--soft); }
.node.open .tip .status { fill: var(--open); }
.node.locked .tip .label { fill: var(--soft); }
.node .label, .node .status { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }

/* ---- 진행 대시바 ---- */
.p-progress {
  display: flex; gap: 6px; height: auto; background: none;
  padding: 14px max(24px, calc((100% - 680px) / 2)) 0;
}
.p-progress span { flex: 1; height: 4px; border-radius: 2px; background: #1C2030; overflow: hidden; }
.p-progress i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: var(--done); box-shadow: 0 0 8px rgba(143, 211, 255, .6);
  transition: width .45s ease;
}
.p-head { padding-left: max(24px, calc((100% - 680px) / 2)); padding-right: max(24px, calc((100% - 680px) / 2)); }

/* ---- 자유로운 별자리 ---- */
.node { transition: opacity .9s ease; }
.node.far { pointer-events: none; }
.edge { transition: stroke .7s ease, opacity .9s ease; }
.nebula { pointer-events: none; }
#stage.dragging .node { cursor: grabbing; }

/* ---- 옵시디언식 그래프 ---- */
#nodes { --lab: 0; }
.node .tip { opacity: var(--lab); transform: none; transition: opacity .25s ease; }
.node .tip .status { opacity: 0; transition: opacity .2s ease; }
.node:hover .tip, .node.hov .tip, .node.nb .tip { opacity: 1; }
.node:hover .tip .status, .node.hov .tip .status { opacity: 1; }
.node { transition: opacity .25s ease; }
.node.locked { opacity: .55; }
.edge { transition: stroke .7s ease, opacity .25s ease; }
.edge.rel { stroke: #34405A; stroke-width: 1; opacity: .7; }
#svg.focusing .node:not(.hov):not(.nb) { opacity: .12; }
#svg.focusing .edge { opacity: .05; }
#svg.focusing .edge.nb { opacity: 1; }
#svg.focusing .edge.rel.nb { stroke: #7FA6D9; }

.edge.met { stroke: var(--done); opacity: .35; }   /* 선수 일부만 완료 */

/* ---- 색 체계: 완료 파랑 / 학습 가능 초록 / 작업 중 빨강(작가) / 잠김 거의 안 보임 ---- */
:root { --learn: #5BE3A0; --wip: #FF5C6C; }
.node .tip { opacity: 0; }
.node:hover .tip, .node.hov .tip, .node.nb .tip, .node:focus-visible .tip { opacity: 1; }

.node.open .core { fill: #C9F7DE; filter: url(#glowGreen); }
.node.open .pulse { stroke: var(--learn); }
.node.open .tip .status { fill: var(--learn); }
.edge.open { stroke: var(--learn); filter: url(#glowGreen); opacity: .9; }

.node.wip .core { fill: #FFC2C8; filter: url(#glowRed); }
.node.wip .tip .status { fill: var(--wip); }
.node.wip .tip .label { fill: #FFD9DD; }
.edge.wip { stroke: var(--wip); opacity: .3; stroke-dasharray: 3 5; filter: none; }

.node.locked { opacity: .07; pointer-events: none; }
.node.locked .core { fill: #5A606C; filter: none; }
.edge.locked { stroke: #2A2F3A; opacity: .1; }
.edge.met { opacity: .18; }
#svg.focusing .node.locked.nb { opacity: .45; }
#svg.focusing .edge.locked.nb { opacity: .35; }

body.author .node.locked { opacity: .3; pointer-events: auto; }
.author-tag {
  display: inline-block; margin-top: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  color: var(--wip); border: 1px solid rgba(255, 92, 108, .45);
}

.author-note { margin-top: 8px; padding: 18px 20px; border: 1px dashed rgba(255, 92, 108, .45); border-radius: 14px; font-size: 15.5px; }
.author-note p { margin: 0 0 8px; color: #D2D6DC; }
.author-note b { color: var(--wip); font-weight: 700; margin-right: 6px; }
.author-note .muted { color: var(--soft); font-size: 14px; margin: 12px 0 0; }

/* ---- 은하 전환 ---- */
.galaxies { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; max-width: 60vw; }
.gbtn { background: none; border: 0; padding: 2px 0; cursor: pointer; font: inherit; font-size: 12.5px; color: var(--soft); letter-spacing: .01em; }
.gbtn:hover { color: var(--ink); }
.gbtn.on { color: var(--ink); font-weight: 700; border-bottom: 1px solid var(--done); }
.gbtn.locked { color: var(--dim); }
.gbtn:focus-visible { outline: 2px solid var(--done); outline-offset: 3px; border-radius: 3px; }

/* ---- 한 우주: 은하 이름과 항로 ---- */
#world { --k: 1; --gal: 0; }
.bridge { stroke: #8FD3FF; stroke-opacity: .07; stroke-width: calc(1px / var(--k)); stroke-dasharray: calc(3px / var(--k)) calc(9px / var(--k)); pointer-events: none; }
.galaxy-label {
  font-size: calc(17px / var(--k)); font-weight: 800; letter-spacing: .02em;
  text-anchor: middle; fill: var(--ink); opacity: var(--gal); pointer-events: none; cursor: pointer;
  paint-order: stroke; stroke: var(--bg); stroke-width: calc(5px / var(--k)); stroke-linejoin: round;
  transition: fill .4s ease;
}
#world.far-view .galaxy-label { pointer-events: auto; }
.galaxy-label:hover { fill: var(--done); }
.galaxy-label .gl-lock { display: none; font-size: .7em; font-weight: 600; fill: var(--soft); }
.galaxy-label.locked { fill: var(--soft); }
.galaxy-label.locked .gl-lock { display: inline; }
@media (prefers-reduced-motion: no-preference) { .galaxy-label.flash { animation: galFlash 2.5s ease-out; } }
@keyframes galFlash { 0%, 30% { fill: var(--learn); } 100% { fill: var(--ink); } }
.galaxies { display: none; }

/* ---- 분류하기 ---- */
.beat-sort { margin: 26px 0; padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 14px; background: #0F1218; }
.beat-sort .q p { color: var(--ink); font-weight: 600; margin: 0; }
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 12px; min-height: 8px; }
.sort-card {
  padding: 9px 13px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 14.5px; line-height: 1.4;
  border: 1px solid var(--line); background: #161A23; color: var(--ink); text-align: left; transition: border-color .15s, background .15s;
}
.sort-card:hover:not(:disabled) { border-color: var(--done); }
.sort-card.picked { border-color: var(--done); background: rgba(143, 211, 255, .14); box-shadow: 0 0 0 1px var(--done) inset; }
.sort-card.ok { border-color: rgba(91, 227, 160, .7); background: rgba(91, 227, 160, .1); cursor: default; }
.sort-card.wrong { border-color: rgba(255, 92, 108, .7); background: rgba(255, 92, 108, .08); cursor: default; }
.sort-bins { display: grid; gap: 8px; }
.sort-bin { border: 1px dashed #2A3040; border-radius: 12px; padding: 10px 12px; cursor: pointer; transition: border-color .15s; }
.sort-bin:hover { border-color: var(--done); }
.sort-bin-name { font-size: 13px; font-weight: 700; color: var(--soft); margin-bottom: 6px; }
.sort-bin-items { display: flex; flex-wrap: wrap; gap: 6px; min-height: 6px; }
.sort-check { margin-top: 12px; }
.sort-score { margin: 14px 0 6px !important; color: var(--ink) !important; font-weight: 700; }
.sort-reasons p { margin: 0 0 8px !important; font-size: 15px; color: #C3C7CE; }
.sort-reasons b.ok { color: var(--learn); }
.sort-reasons b.wrong { color: var(--wip); }

/* ---- 겹겹이 그려지는 원 ---- */
.nest-svg { display: block; width: 100%; max-width: 520px; margin: 18px auto 8px; }
.nest-ring { opacity: 0; transform: scale(.94); transform-box: fill-box; transform-origin: center; transition: opacity .6s ease, transform .6s ease; }
.nest-ring.on { opacity: 1; transform: none; }
.nest-ring circle { fill: rgba(143, 211, 255, .05); stroke: rgba(143, 211, 255, .55); stroke-width: 1.2; }
.nest-ring.inner circle { fill: rgba(91, 227, 160, .1); stroke: rgba(91, 227, 160, .85); }
.nest-ring text { fill: var(--ink); font-size: 17px; font-weight: 700; text-anchor: middle; font-family: inherit; }
.nest-caps p { margin: 0 0 10px; }
.nest-caps b { color: var(--ink); margin-right: 4px; }

/* ---- 생각 적기: 답의 예, 체크 항목 ---- */
.think-example { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(143, 211, 255, .06); border: 1px solid rgba(143, 211, 255, .18); animation: beatIn .3s ease; }
.think-example .ex-label { margin: 0 0 4px !important; font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--done) !important; }
.think-example .ex-text { margin: 0 0 10px !important; color: var(--ink) !important; }
.think-example ul { margin: 0; padding-left: 1.2em; }
.think-example li { color: #C3C7CE; font-size: 15px; margin-bottom: 2px; }

/* ---- AI 코치 피드백 ---- */
.think-feedback { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(91, 227, 160, .07); border: 1px solid rgba(91, 227, 160, .28); animation: beatIn .3s ease; }
.think-feedback .fb-label { margin: 0 0 4px !important; font-size: 12.5px; font-weight: 700; letter-spacing: .03em; color: var(--learn) !important; }
.think-feedback .fb-text { margin: 0 !important; color: var(--ink) !important; }
.think-feedback.loading .fb-text { color: var(--soft) !important; animation: fbPulse 1.4s ease-in-out infinite; }
@keyframes fbPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
.ai-note { margin: 8px 0 0 !important; font-size: 12.5px !important; color: var(--soft) !important; }
.fb-note { margin: 12px 0 0 !important; font-size: 13.5px !important; color: var(--soft) !important; }

/* ---- 다녀오기 ---- */
.visit-box { margin-top: 14px; }
.visit-prompt { padding: 12px 14px; border-radius: 12px; border: 1px dashed rgba(143, 211, 255, .35); margin-bottom: 12px; }
.visit-prompt .vp-label { margin: 0 0 4px !important; font-size: 12.5px; font-weight: 700; color: var(--done) !important; }
.visit-prompt .vp-text { margin: 0 0 8px !important; color: var(--ink) !important; }
.visit-links { display: grid; gap: 8px; margin-bottom: 14px; }
.visit-link { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(91, 227, 160, .4); background: rgba(91, 227, 160, .06); text-decoration: none; transition: border-color .15s, background .15s; }
.visit-link:hover { border-color: var(--learn); background: rgba(91, 227, 160, .12); }
.visit-link b { color: var(--ink); font-size: 16px; }
.visit-link b::after { content: " ↗"; color: var(--learn); }
.visit-link span { color: var(--soft); font-size: 13.5px; }
.visit-proof-label { margin: 6px 0 6px !important; font-weight: 600; color: var(--ink) !important; font-size: 15.5px; }
.visit-skip { display: block; margin: 14px auto 0; background: none; border: 0; padding: 4px; font: inherit; font-size: 12.5px; color: #4E5563; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.visit-skip:hover { color: var(--soft); }
.btn.ghost { background: transparent; color: var(--done); border: 1px solid rgba(143, 211, 255, .4); }

/* ---- 강의 안 대화창 ---- */
.chat-box { margin-top: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #0D1017; }
.chat-log { display: grid; gap: 10px; margin-bottom: 10px; }
.chat-msg { max-width: 88%; padding: 10px 12px; border-radius: 12px; }
.chat-msg .who { display: block; font-size: 11.5px; font-weight: 700; margin-bottom: 2px; letter-spacing: .03em; }
.chat-msg p { margin: 0 !important; font-size: 15.5px; white-space: pre-wrap; }
.chat-msg.user { justify-self: end; background: rgba(143, 211, 255, .12); }
.chat-msg.user .who { color: var(--done); }
.chat-msg.ai { justify-self: start; background: rgba(91, 227, 160, .08); }
.chat-msg.ai .who { color: var(--learn); }
.chat-msg.loading p { color: var(--soft) !important; animation: fbPulse 1.4s ease-in-out infinite; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip { font: inherit; font-size: 13.5px; padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); background: #161A23; color: #C3C7CE; cursor: pointer; text-align: left; }
.chip:hover { border-color: var(--done); color: var(--ink); }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }

.chat-box textarea { min-height: 64px; }
.visit-box textarea { min-height: 72px; }

/* 관련 연결이 잠긴 영역에 있을 때: 선수 관계의 잠긴 선과 똑같이 */
.edge.rel.locked { stroke: #2A2F3A; stroke-width: 1; opacity: .1; }

/* 휴대폰에서 빠르게 두 번 탭해도 확대되지 않게 */
#panel, #pScroll, #pFoot { touch-action: manipulation; }
#pFoot { -webkit-user-select: none; user-select: none; }

/* ---- 막다른 별(곁가지)은 작고 조금 흐리게, 그리로 들어가는 선은 가늘게 ---- */
.node.leaf .core { fill-opacity: .72; }
.node.leaf .pulse { stroke-width: 1; }
.edge.to-leaf { stroke-width: .8; }
.edge.to-leaf.open { opacity: .6; }
.edge.to-leaf.done { opacity: .5; }

/* ---- 플랫폼 우주 시제품 ---- */
.gal-hit { fill: transparent; pointer-events: none; cursor: pointer; }
#world.far-view .gal-hit { pointer-events: auto; }
.beacon { fill: none; stroke: #FFC46B; stroke-width: calc(1.5px / var(--k)); opacity: calc(var(--gal) * .55); pointer-events: none; transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: no-preference) {
  .beacon { animation: beaconPulse 2.6s ease-out infinite; }
}
@keyframes beaconPulse { 0% { transform: scale(.55); stroke-opacity: .95; } 100% { transform: scale(1.25); stroke-opacity: 0; } }
.galaxy-label.rising { fill: #FFD9A0; }
.galaxy-label .gl-sub { font-size: .62em; font-weight: 500; letter-spacing: 0; fill: var(--soft); }
.galaxy-label.rising .gl-sub { fill: #FFC46B; }
.galaxy-label .gl-demo { font-size: .55em; font-weight: 700; fill: var(--dim); }
.home-universe {
  margin-top: 10px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line, #222838);
  background: rgba(5, 6, 10, .6); color: var(--soft); font: inherit; font-size: 12.5px; cursor: pointer;
}
.home-universe:hover { color: var(--ink); border-color: var(--done); }

#world { --sz: 1; }
.node .core, .node .pulse { transform: scale(var(--sz)); transform-box: fill-box; transform-origin: center; }
#world.far-view .edge { stroke-width: calc(1px / var(--k) * .7); }
#world.far-view .edge.locked { opacity: .5; stroke: #4A5160; }
#world.far-view .node .tip { display: none; }
.node:hover .core, .node:focus-visible .core { transform: scale(calc(1.6 * var(--sz))); }
#world.far-view .node.locked .core { fill: #8A93A3; }

.galaxy-label:focus { outline: none; }
.galaxy-label:focus-visible { outline: none; text-decoration: underline; }
.here-galaxy { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--ink); min-height: 1.2em; }

body.studio-preview .stats { display: none; }

a.home-universe { display: inline-block; text-decoration: none; margin-left: 6px; }
a.make-galaxy { color: var(--learn); border-color: rgba(91, 227, 160, .35); }

/* 작가 모드 거절 안내 */
.author-deny { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: #11141D; color: #EAF4FF; border: 1px solid #2A3042; border-radius: 12px; padding: 12px 16px; font-size: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; max-width: 92vw; }
.author-deny a { color: #8FD3FF; font-weight: 700; }
.author-deny button { font: inherit; font-size: 13px; background: transparent; color: #8A93A3; border: 1px solid #2A3042; border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* 작가 은하: 만든 사람 · 신고 */
.p-by { margin: -6px 0 14px; font-size: 13px; color: #8A93A3; }
.p-report { font: inherit; font-size: 12px; background: transparent; border: 0; color: #6A7282; text-decoration: underline; cursor: pointer; padding: 0 4px; }
.p-report:hover { color: #FF7A86; }
.report-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .65); display: grid; place-items: center; z-index: 80; padding: 16px; }
.report-box { width: min(440px, 100%); background: #0B0D14; border: 1px solid #2A3042; border-radius: 14px; padding: 20px; color: #EAF4FF; }
.report-box h3 { margin: 0 0 4px; font-size: 17px; }
.report-sub { margin: 0 0 12px; font-size: 13px; color: #8A93A3; }
.report-reasons { display: grid; gap: 6px; font-size: 14px; }
.report-reasons label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.report-box textarea { width: 100%; min-height: 80px; margin-top: 12px; font: inherit; font-size: 14px; color: #EAF4FF; background: #0E1119; border: 1px solid #2A3042; border-radius: 8px; padding: 8px 10px; resize: vertical; box-sizing: border-box; }
.report-msg { min-height: 1.2em; font-size: 13px; color: #FF7A86; margin: 8px 0 0; }
.report-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.report-actions .btn { width: auto; padding: 10px 16px; font-size: 14px; }
.report-actions .btn.ghost { cursor: pointer; }
.p-scroll .p-by { margin: -18px 0 22px; font-size: 13px; color: #8A93A3; }

/* 오른쪽 위 계정 */
.acct { position: relative; }
.acct-login, .acct-me {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line, #222838); background: rgba(5, 6, 10, .6); color: var(--ink);
  font: inherit; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.acct-login:hover, .acct-me:hover { border-color: var(--done); }
.acct-me { padding: 3px 12px 3px 3px; }
.acct-me img { width: 24px; height: 24px; border-radius: 50%; }
.acct-me span { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
.acct-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: 10px; border-radius: 12px; border: 1px solid #2A3042; background: #0B0D14; display: grid; gap: 4px; z-index: 30; }
.acct-pop[hidden] { display: none; }
.acct-pop p { margin: 0 0 4px; font-size: 12px; color: var(--soft); word-break: break-all; }
.acct-pop a, .acct-pop button { display: block; text-align: left; padding: 7px 9px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--ink); text-decoration: none; background: transparent; border: 0; cursor: pointer; }
.acct-pop a:hover, .acct-pop button:hover { background: #151925; }
.top-right { display: flex; align-items: flex-start; gap: 16px; }
@media (max-width: 640px) { .top-right { gap: 10px; } .top-right .stats .k { font-size: 10.5px; } .top-right .stats b { font-size: 15px; } }
.top-right .stats .k, .top-right .stats > div { white-space: nowrap; }
.top .author-tag { margin-right: 6px; }


/* ---- 처음 온 사람 안내 (onboard.js) ---- */
.onboard { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px;
  background: #05060A; transition: opacity .8s ease; overflow: hidden; }
.onboard[hidden] { display: none; }
.onboard::after { content: ""; position: absolute; inset: 0; background: rgba(5, 6, 10, 0); transition: background .9s ease; pointer-events: none; }
.onboard.reveal { background: rgba(5, 6, 10, .8); }
.onboard.leaving { opacity: 0; pointer-events: none; }
body.onboarding .top, body.onboarding .hint { visibility: hidden; }
.ob-sky { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .9s ease; }
.onboard.reveal .ob-sky { opacity: .35; }
.ob-skip { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top, 0px) + 20px); right: 22px; background: none; border: 0; color: var(--soft);
  font: inherit; font-size: 13px; cursor: pointer; padding: 6px 8px; }
.ob-skip:hover { color: var(--ink); }
.ob-page { position: relative; z-index: 1; width: min(720px, 100%); }
.ob-page[hidden] { display: none; }
.ob-text { text-align: left; }
.ob-center { text-align: center; }
.ob-mark { font-weight: 800; font-size: 14px; letter-spacing: .24em; color: var(--soft); margin-bottom: 40px; opacity: 0; animation: obUp .9s ease .1s forwards; }
.ob-mark span { color: var(--done); }
.ob-line { opacity: 0; transform: translateY(12px); }
.ob-line.on { animation: obUp 1s ease forwards; }
@keyframes obUp { to { opacity: 1; transform: none; } }
.ob-mission { font-size: clamp(27px, 5.2vw, 42px); font-weight: 700; line-height: 1.42; letter-spacing: -0.035em; color: var(--ink); margin: 0 0 28px; word-break: keep-all; }
.ob-belief { font-size: clamp(18px, 3.2vw, 23px); line-height: 1.8; color: #AEB6C3; margin: 0 0 48px; word-break: keep-all; }
.ob-final { font-size: clamp(27px, 5.2vw, 42px); font-weight: 700; line-height: 1.5; letter-spacing: -0.035em; margin: 0 0 44px; word-break: keep-all; }
.ob-btn { padding: 14px 36px; border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-size: 16px; font-weight: 700; background: var(--done); color: #05121F; }
.ob-btn:hover { filter: brightness(1.08); }
.ob-btn:focus-visible, .ob-skip:focus-visible, .ob-opts button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.ob-btn[hidden] { display: none; }
.ob-step { min-height: 1.6em; font-size: clamp(18px, 3.6vw, 23px); font-weight: 600; color: var(--ink); margin: 0 0 4px; transition: opacity .35s; word-break: keep-all; }
.ob-step.fade { opacity: 0; }
.ob-map { width: 100%; max-width: 620px; height: auto; display: block; margin: 0 auto; overflow: visible; }
.ob-map .node { cursor: default; }
.ob-map .node.open { cursor: pointer; }
.ob-map .node.locked:hover .core { fill: #2F3440; }
.ob-map .node:not(.open):hover .core { transform: none; }
.ob-map .node.active .core { transform: scale(1.6); }
.ob-far { opacity: 0; transition: opacity 1.4s ease .5s; }
#obWorld.out .ob-far { opacity: 1; }
.ob-map .galaxy-label { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; fill: var(--ink); text-anchor: middle; paint-order: stroke; stroke: #05060A; stroke-width: 6px; opacity: 0; transition: opacity .9s ease .7s; }
#obWorld.out .galaxy-label { opacity: 1; }
.ob-far .galaxy-label { fill: #C9CED8; font-size: 28px; }
.ob-card { position: relative; z-index: 1; width: min(420px, 100%); margin: 6px auto 0; padding: 18px; border-radius: 14px; border: 1px solid #2A3042; background: rgba(11, 13, 20, .94); text-align: left; animation: obUp .5s ease both; }
.ob-card[hidden] { display: none; }
.ob-q { margin: 0 0 12px; font-weight: 700; font-size: 16.5px; }
.ob-opts { display: grid; gap: 8px; }
.ob-opts button { text-align: left; font: inherit; font-size: 15px; padding: 11px 14px; border-radius: 10px; border: 1px solid #2A3042; background: #11141D; color: var(--ink); cursor: pointer; }
.ob-opts button:hover:not(:disabled) { border-color: var(--done); }
.ob-opts button.pick { border-color: var(--done); background: rgba(143, 211, 255, .08); }
.ob-opts button:disabled { cursor: default; }
.ob-fb { margin: 12px 0 0; font-size: 15px; color: #C3C7CE; line-height: 1.7; }
.ob-fb:empty { display: none; }
.ob-card .ob-btn { margin-top: 14px; width: 100%; }
#obNext2 { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) {
  .ob-line, .ob-mark { animation-duration: .01s !important; animation-delay: 0s !important; }
  .ob-far, .ob-map .galaxy-label { transition-duration: .01s !important; transition-delay: 0s !important; }
}
/* 연습 지도: 실제 지도를 멀리서 볼 때처럼 잠긴 별과 선도 보이게 */
.ob-map .edge { vector-effect: non-scaling-stroke; }
.ob-map .edge.locked { stroke: #2A3140; stroke-width: 1.2; }
.ob-map .node.locked .core { fill: #4A5160; }
.ob-map .node .core { transition: transform 1.2s ease, fill .6s ease; }
#obWorld.out .node .core { transform: scale(2.1); }
#obWorld.out .node .pulse { display: none; }
.ob-map .node.locked { opacity: .45; }
.ob-map .edge.locked { opacity: .5; }
#obWorld.out .node.locked { opacity: .75; }
#obWorld.out .node.locked .core { fill: #8A93A3; }
#obWorld.out .edge.locked { stroke: #4A5160; opacity: .6; }

/* 첫 장면: 큰 이름 + 같은 크기의 두 문단 (About YouTube 같은 담백한 구성) */
.ob-page.ob-text { width: min(1040px, 100%); }
.ob-title { font-size: clamp(60px, 12vw, 120px); font-weight: 900; line-height: .95; letter-spacing: -0.055em; margin: 0 0 clamp(36px, 6vw, 64px); color: var(--ink);
  opacity: 0; animation: obUp 1s ease .1s forwards; }
.ob-title span { color: var(--done); }
.ob-mission, .ob-belief, .ob-final { font-size: clamp(21px, 3.3vw, 32px); font-weight: 400; line-height: 1.6; letter-spacing: -0.02em; color: #E6EBF2; margin: 0 0 1.1em; max-width: 30em; word-break: keep-all; }
.ob-belief { margin-bottom: 52px; }
.ob-final { margin-bottom: 48px; }
