/* 텍토: tecto-, 판이 어긋나며 지형이 갈라지는 것.
   식은 현무암 위에, 갈라진 틈에서만 새어나오는 마그마 한 점.
   기본은 밤. 게임은 어두운 데서 더 잘 보이고, 글은 어두운 데서 더 오래 읽힌다.
   원칙: 화면의 대부분은 무채색. 주황은 '지금 고를 수 있는 자리'에만. */

:root {
  /* 새카만 화면은 대비가 너무 세서 오래 못 본다. 어도비·VS Code처럼
     한 단계 올린 중간 회색을 바닥으로 삼는다(#1E2227 근처). */
  --bg:        #1E2227;   /* 가장 깊은 바닥 */
  --surface:   #2A3037;   /* 눌리는 면 */
  --surface-2: #23282E;   /* 카드 바탕 */
  --raise:     #333A42;   /* 떠오른 면: 호버·선택 */
  --field:     #262C32;   /* 입력칸 */
  --ink:       #EDEBE7;   /* 순백은 긴 글에서 눈이 먼저 지친다 */
  --ink-60:    #B0B7BF;
  --ink-40:    #868E97;
  --line:      #3C444C;
  --blue:      #2E9BFF;   /* accent: azure. 이름은 옛것을 그대로 두어 손댈 곳을 줄인다 */
  --blue-dark: #5CB3FF;
  --blue-soft: #0C2437;
  --red:       #E85A4A;
  --glow:      0 0 0 1px rgb(46 155 255 / .35), 0 8px 28px -10px rgb(46 155 255 / .5);
  --on-accent: #04121F;   /* azure 위에 얹는 글자 */
  --art:       #2B3138;   /* 그림이 아직 없는 자리 */
  --stage-top: #262C33;   /* 미리보기 무대 그러데이션 */
  --stage-bot: #1E2227;

  --sans: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", "Malgun Gothic", sans-serif;
  --mono: ui-monospace, "SF Mono", "D2Coding", Menlo, monospace;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 9px;
  --gut: 24px;
}

/* 낮. 밤이 기본이지만, 밝은 데서 쓰는 사람도 있다.
   바탕은 흰 종이, 눌리는 면만 옅은 회색 — 네이버·밀리처럼 글을 오래 읽는 곳의 방식이다.
   예전엔 어도비식 중회색(#F4F5F7 바탕에 #E9EBEF 면)이었는데, 읽는 화면이 통째로
   잿빛이라 글이 가라앉았다. 회색은 '면'을 나눌 때만 쓰고 바탕은 비워 둔다.
   값은 BRAND.md의 라이트 팔레트 그대로다. */
[data-mode="day"] {
  --bg: #FFFFFF; --surface: #F2F4F6; --surface-2: #F9FAFB; --raise: #E8EBED;
  --field: #FFFFFF; --ink: #191F28; --ink-60: #4E5968; --ink-40: #8B95A1;
  --line: #E5E8EB; --blue: #3182F6; --blue-dark: #1B64DA; --blue-soft: #E8F3FF; --red: #F04452;
  --glow: 0 0 0 1px rgb(49 130 246 / .28), 0 8px 24px -10px rgb(25 31 40 / .22);
  --on-accent: #FFFFFF; --art: #E5E8EB; --stage-top: #FFFFFF; --stage-bot: #F9FAFB;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* 스크롤막대·기본 폼도 테마를 따라오게 — 안 그러면 어두운 화면에 흰 막대가 박힌다 */
:root { color-scheme: dark; }
[data-mode="day"] { color-scheme: light; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ── 눈에 보이는 초점 ──
   키보드로 다니는 사람에게 "지금 여기"가 안 보이면 화면이 통째로 미궁이 된다.
   마우스로 누를 때는(:focus-visible이 아니므로) 안 뜬다. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 5px;
}
/* 본문 안에 숨겨 두는 건너뛰기 링크: Tab 한 번에 튀어나온다 */
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--blue); color: var(--on-accent); font-size: 13px; font-weight: 700;
  transition: top .15s;
}
.skip:focus { top: 12px; }
/* 손가락으로도 눌리는 크기: 아이콘 단추가 11px 글자 하나만 하면 못 누른다 */
.pane__fold, .pane__add, .pane__close, .mode-btn {
  min-width: 26px; min-height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── 살아 있는 무대(첫 화면) ──
   한 문장이 두 갈래로 갈라지는 순간을 화면으로 옮긴다.
   원고와 플레이는 다른 면이지만, 중앙의 얇은 길로 하나의 경험이다. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.hero-live { position: relative; isolation: isolate; margin: 22px 0 0; padding: 18px 20px; overflow: hidden;
  border: 1px solid rgb(90 133 179 / .22); border-radius: 28px; background: #171d25; }
.hero-live::before { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .7;
  background: radial-gradient(52% 110% at 92% 22%, rgb(68 139 255 / .18), transparent 60%); }
.hero-live::after { content: ''; position: absolute; z-index: -1; inset: 0; opacity: .18;
  background-image: linear-gradient(rgb(146 180 225 / .28) 1px, transparent 1px), linear-gradient(90deg, rgb(146 180 225 / .28) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(90deg, #000, transparent 72%); }
.hero-live__aurora { position: absolute; z-index: -1; width: 280px; height: 200px; right: -12px; top: -4px; pointer-events: none; opacity: .65; }
.hero-live__path { position: absolute; width: 320px; right: 0; top: 8px; overflow: visible; }
.hero-live__path path { stroke: rgb(119 174 255 / .64); stroke-width: 1.25; stroke-dasharray: 4 6; }
.hero-live__path circle { fill: #82b6ff; filter: drop-shadow(0 0 7px rgb(77 145 255 / .95)); }
.hero-orbit { position: absolute; display: block; border: 1px solid rgb(122 176 255 / .22); border-radius: 50%; }
.hero-orbit--a { width: 230px; height: 230px; right: 10px; top: 2px; }
.hero-orbit--b { width: 330px; height: 330px; right: -70px; top: -46px; }
.hero-star { position: absolute; display: block; width: 3px; height: 3px; border-radius: 50%; background: #a7cbff; box-shadow: 0 0 10px 2px rgb(112 173 255 / .8); }
.hero-star--a { right: 82px; top: 19px; }.hero-star--b { right: 268px; top: 102px; }.hero-star--c { right: 24px; top: 185px; }
.hero-live__intro { display: none; }
.hero-live__eyebrow, .hero-pane__label { font-size: 12px; font-weight: 700; letter-spacing: .02em; }
.hero-live__eyebrow { color: #72adff; }
.hero-live__h1 { margin-top: 10px; max-width: 540px; color: #f5f8fc; font-size: clamp(36px, 5vw, 52px); font-weight: 800; letter-spacing: -0.06em; line-height: 1.04; text-shadow: 0 5px 24px rgb(0 0 0 / .18); }
.hero-live__sub { max-width: 540px; color: #bac6d3; margin-top: 14px; font-size: 15px; line-height: 1.7; word-break: keep-all; }
.hero-live__guide { display: flex; align-items: center; gap: 8px; margin-top: 22px; color: #95a4b5; font-size: 12.5px; font-weight: 600; }
.hero-live__guide span { width: 24px; height: 1px; background: var(--blue); }
.hero-live__panes { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; margin-top: 0; align-items: stretch;
  box-shadow: 0 26px 58px -32px rgb(0 0 0 / .92); }
.hero-live__panes::before { content: '→'; position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%;
  width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%;
  background: var(--bg); color: var(--blue); font-size: 15px; font-weight: 700; }
.hero-script, .hero-play { padding: 16px 20px; min-height: 176px; }
.hero-script { border: 1px solid #3c4d5e; border-radius: 18px 0 0 18px; background: #111821; color: #c9d4de; }
.hero-play { border: 1px solid #3c4d5e; border-left: 0; border-radius: 0 18px 18px 0; background: #202832; }
.hero-script .hero-pane__label { display: block; margin-bottom: 14px; color: #82909d; }
.hero-play .hero-pane__label { display: block; margin-bottom: 14px; color: var(--ink-40); }
.hero-script__body { margin: 0; font-family: var(--mono); font-size: 13px; line-height: 1.9;
  white-space: pre-wrap; word-break: break-word; }
.hero-play__ttl { font-size: 12px; font-weight: 700; color: #9eacbb; margin-bottom: 10px; }
.hero-play__ln { color: #f2f5f8; font-size: 15px; line-height: 1.85; margin-bottom: 10px;
  animation: hero-sprout .24s cubic-bezier(.2,.7,.3,1) both; }
.hero-play__acts { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.hero-caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: text-bottom;
  background: var(--blue); animation: tekto-caret 1s step-end infinite; }
.hero-choice { text-align: left; padding: 11px 14px; border-radius: 11px; font-size: 14.5px; font-weight: 600;
  background: #171d25; border: 1px solid #3c4d5e; color: #f2f5f8; cursor: pointer;
  animation: hero-sprout .22s cubic-bezier(.2,.7,.3,1) both; }
/* 밝은 테마에서 --blue-soft는 거의 흰색이라, 흰 글씨를 그대로 두면 눌리는 순간 글자가 사라진다 */
.hero-choice:hover:not(:disabled) { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.hero-choice.is-on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); }
.hero-choice.is-off { opacity: .38; text-decoration: line-through; }
.hero-choice:disabled { cursor: default; }
@keyframes hero-sprout { from { opacity: 0; transform: translateY(6px); } }
.hero-live__foot { display: flex; flex-direction: column; align-items: center; margin-top: 16px; }
.hero-live__cap { color: #bac6d3; font-size: 14px; margin-bottom: 12px; text-align: center; }
.hero-live__cta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.hero-script__body .h-scene,
.hero-script__body .h-bullet,
.hero-script__body .h-arrow { color: #6FB6FF; font-weight: 700; }
.hero-script__body .h-dest { color: #9FC9F0; }

.stage-foot { margin: 40px 0 72px; padding: 22px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--surface-2);
  display: flex; flex-direction: column; gap: 12px; }
.stage-foot p { font-size: 15px; font-weight: 600; }

@media (max-width: 720px) {
  .hero-live { margin: 18px -12px 0; padding: 14px; border-radius: 18px; }
  .hero-live__aurora { right: -160px; top: -8px; opacity: .55; }
  .hero-live__intro { min-height: 0; }
  .hero-live__h1 { font-size: 37px; }
  .hero-live__panes { grid-template-columns: 1fr; gap: 12px; }
  .hero-live__panes::before { display: none; }
  .hero-script, .hero-play { border: 1px solid var(--line); border-radius: 16px; }
  .hero-script { border-color: #3c4d5e; }
  .hero-play { order: -1; }
  .hero-script { min-height: 0; }
  .hero-script__body { max-height: 8.4em; overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .hero-caret { display: none; } }

/* ── 골격 ───────────────────────────── */
.sheet { max-width: 960px; margin: 0 auto; padding: 0 var(--gut); }
.sheet--narrow { max-width: 620px; }

.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.masthead__mark { display: flex; align-items: center; gap: 8px; }
.masthead__mark .mark {
  width: 26px; height: 26px; color: var(--blue); flex: none;
}
.masthead__word { font-size: 20px; font-weight: 800; letter-spacing: -0.045em; }
.masthead__sub { display: none; }
.masthead nav { display: flex; gap: 4px; margin-left: auto; }
.masthead nav a {
  position: relative;
  font-size: 13.5px; font-weight: 700; color: var(--ink-40);
  padding: 9px 14px; border-radius: var(--r-sm);
  transition: background .15s, color .15s;
}
.masthead nav a:hover { background: var(--surface); color: var(--ink); }
.masthead nav a[aria-current] { color: var(--ink); background: var(--raise); }
/* 찾기 칸: 머리띠 가운데를 차지하고, 결과는 아래로 떨어진다 */
.hunt { position: relative; flex: 1 1 auto; max-width: 320px; margin-left: auto; }
.hunt__ico {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-40); pointer-events: none;
}
.hunt input {
  width: 100%; padding: 8px 12px 8px 33px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 13px;
}
.hunt input::placeholder { color: var(--ink-40); }
.hunt input:focus { outline: none; border-color: var(--blue); background: var(--surface-2); }
.hunt input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hunt__pop {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  padding: 5px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); box-shadow: 0 16px 40px -14px rgb(0 0 0 / .6);
  max-height: 60vh; overflow: auto;
}
.hunt__pop a { display: block; padding: 8px 10px; border-radius: 7px; color: inherit; text-decoration: none; }
.hunt__pop a:hover, .hunt__pop a:focus { background: var(--raise); }
.hunt__pop b { display: block; font-size: 13.5px; font-weight: 700; }
.hunt__pop span { font-size: 11.5px; color: var(--ink-40); }
.hunt__none { padding: 12px 10px; font-size: 12.5px; color: var(--ink-40); }
.hunt__all {
  margin-top: 3px; border-top: 1px solid var(--line);
  font-size: 12.5px; font-weight: 700; color: var(--blue) !important;
}

/* 폰의 아래쪽 탭: 엄지에 닿는 자리. 넓은 화면에선 머리띠가 그 일을 하므로 숨는다. */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    display: grid; grid-template-columns: repeat(4, 1fr);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 9px 4px 8px; min-height: 48px;
    color: var(--ink-40); text-decoration: none; font-size: 10.5px; font-weight: 700;
  }
  .tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current] { color: var(--blue); }
  /* 탭이 본문 끝을 가리지 않게 자리를 비워 둔다 */
  .sheet { padding-bottom: 68px; }
  /* 몰입해서 읽는 동안엔 걷어낸다 */
  body.immersive .tabbar { display: none; }
  /* 폰에서는 아래 탭이 길잡이다 — 머리띠의 같은 고리는 지운다 */
  .masthead nav { display: none; }
}

/* 프로필 단추: 이름 첫 글자만 동그라미로 */
.face-btn {
  flex: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-60);
  font-size: 13px; font-weight: 800; line-height: 1;
}
.face-btn:hover { border-color: var(--blue); color: var(--ink); }
.face-btn--out {
  width: auto; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 700;
}
/* 필명 칸: 쓸 수 있는지 바로 아래에서 알려 준다 */
.pen-field { display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.pen-field .inp { max-width: 200px; }
.pen-msg { font-size: 11.5px; font-weight: 600; min-height: 1em; }
.pen-msg.is-bad { color: var(--red); }
.pen-msg.is-ok { color: var(--blue); }

/* 공지 목록: 제목만 늘어놓고, 누르면 그 자리에서 펼친다 */
.notice-list { list-style: none; }
.notice { border-bottom: 1px solid var(--line); }
.notice > summary {
  display: flex; align-items: center; gap: 14px; cursor: pointer;
  padding: 20px 2px; list-style: none;
}
.notice > summary::-webkit-details-marker { display: none; }
.notice > summary:hover b { color: var(--blue); }
.notice__txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.notice__txt b { font-size: 15px; font-weight: 600; line-height: 1.4; }
.notice__at { font-size: 12.5px; color: var(--ink-40); font-variant-numeric: tabular-nums; }
.notice__v {
  flex: none; width: 20px; height: 20px; color: var(--ink-40);
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  transition: transform .16s;
}
.notice[open] .notice__v { transform: rotate(180deg); }
.notice > p {
  padding: 2px 2px 22px; font-size: 13.5px; line-height: 1.7; color: var(--ink-60);
}

.me-menu { padding: 6px; }
/* 자주 가는 자리는 격자 타일로 — 목록으로 세우면 길어지기만 한다 */
.me-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 4px 2px 8px; }
.me-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  background: none; border: 0; border-radius: 9px; padding: 12px 4px; cursor: pointer;
  font-size: 11.5px; font-weight: 600; color: var(--ink-60);
}
.me-grid button:hover { background: var(--raise); color: var(--ink); }
.me-grid svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.me-menu__foot { border-top: 1px solid var(--line); padding-top: 4px; }
.me-menu__head { display: flex; align-items: center; gap: 10px; padding: 10px 9px 12px; }
.me-menu__head .my__face { width: 38px; height: 38px; font-size: 15px; }
.me-menu__head div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.me-menu__head b { font-size: 13.5px; }
.me-menu__head span { font-size: 11.5px; color: var(--ink-40); }
.mode-btn {
  flex: none; background: none; border: 0; border-radius: 8px; padding: 4px 8px;
  color: var(--ink-40); font-size: 14px; line-height: 1; cursor: pointer;
}
.mode-btn:hover { background: var(--raise); color: var(--ink); }
/* 지금 있는 자리에만 마그마 한 줄 */
.masthead nav a[aria-current]::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 4px;
  height: 2px; border-radius: 2px; background: var(--blue);
  box-shadow: 0 0 8px rgb(46 155 255 / .8);
}

.colophon {
  margin-top: 88px; padding: 28px 0 48px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-40);
  display: flex; flex-direction: column; gap: 18px;
}
/* display를 준 요소는 [hidden]만으로 안 숨는다 — 라우터가 껐다 켰다 하므로 못 박아 둔다 */
.colophon[hidden] { display: none; }
.colophon__links { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.colophon__links a { color: var(--ink-60); font-weight: 600; }
.colophon__links a:hover { color: var(--ink); }
.colophon__links b { font-weight: 800; color: var(--ink); }
/* 사업자 정보: 법으로 밝혀야 하는 것이라 작아도 읽히게 둔다 */
.colophon__biz { display: flex; flex-direction: column; gap: 5px; font-style: normal; line-height: 1.5; }
.colophon__biz i { font-style: normal; opacity: .45; margin: 0 4px; }

/* ── 타이포 요소 ─────────────────────── */
.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.rule--thick { border-top: 1px solid var(--line); }

.kicker {
  font-size: 13px; font-weight: 700; color: var(--blue);
  letter-spacing: 0;
}
.dek { color: var(--ink-60); font-size: 15px; }
h1, h2, h3 { letter-spacing: -0.025em; line-height: 1.35; font-weight: 700; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 19px; }
h3 { font-size: 15px; }

.seal {
  display: inline-block; background: var(--blue-soft); color: var(--blue);
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 3px 8px; border-radius: 6px; vertical-align: 2px;
}

/* ── 조작부 ─────────────────────────── */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 700;
  padding: 11px 18px; border-radius: var(--r-sm);
  transition: background .14s, border-color .14s, box-shadow .14s, transform .08s;
}
.btn:hover { background: var(--raise); border-color: color-mix(in srgb, var(--blue) 40%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn--seal {
  background: var(--blue); color: var(--on-accent); border-color: transparent;
  box-shadow: 0 6px 20px -8px rgb(46 155 255 / .7);
}
.btn--seal:hover { background: var(--blue-dark); box-shadow: 0 8px 26px -8px rgb(46 155 255 / .85); }
.btn--quiet { background: transparent; border-color: transparent; color: var(--ink-60); font-weight: 600; }
.btn--quiet:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: .32; cursor: not-allowed; transform: none; box-shadow: none; }
.btn--sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block; font-size: 12.5px; font-weight: 600;
  color: var(--ink-40); margin-bottom: 6px;
}
.inp, textarea.inp, select.inp {
  width: 100%; background: var(--field); border: 1.5px solid transparent;
  padding: 11px 13px; font-size: 14.5px; border-radius: var(--r-sm);
  outline: none; transition: border-color .15s, background .15s;
}
.inp:focus { border-color: var(--blue); background: var(--bg); }
textarea.inp { line-height: 1.7; resize: vertical; }
select.inp { appearance: none; font-weight: 600; }
.inp--mono { font-family: var(--mono); font-size: 13px; }
/* 대본 본문은 등폭(타자기)이 아니라 고딕으로 읽는다 — 12만 자를 쓰는 칸이라 가독성이 먼저다.
   기호를 세로로 맞춰 볼 일이 있는 CSS·수치 칸은 등폭을 그대로 둔다. */
#scriptBox, #siBox, .ed__hl {
  font-family: var(--sans); font-size: 14px; line-height: 1.75; letter-spacing: -0.005em;
}

/* ── 대본 편집기 ──
   글자는 textarea가 그리고, 색과 줄번호는 뒤에 깐 판이 그린다.
   둘의 글자 자리가 1px이라도 어긋나면 색이 밀려 보이므로,
   글꼴·크기·자간·줄높이·여백·줄바꿈 규칙을 **똑같이** 맞춰야 한다. 아래 두 규칙을 쌍으로 고칠 것. */
.ed { position: relative; }
.ed__hl, .ed__box {
  margin: 0;
  padding: 12px 14px 12px 52px;      /* 왼쪽 여백 = 줄번호 자리 */
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  tab-size: 2;
}
.ed__hl {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  border-color: transparent;
  background: var(--field);
  color: var(--ink);
}
.ed__box {
  position: relative;
  width: 100%; min-height: 420px; resize: vertical;
  background: transparent;
  color: transparent;                 /* 글자는 뒤판이 보여 준다 */
  caret-color: var(--blue);
  -webkit-text-fill-color: transparent;
}
.ed__box::selection { background: color-mix(in srgb, var(--blue) 30%, transparent); }
.ed__box:focus { outline: none; border-color: var(--blue); box-shadow: var(--glow); }
.ed__box::placeholder { color: var(--ink-40); -webkit-text-fill-color: var(--ink-40); }

/* 줄번호는 글의 흐름 밖에 둔다 — 글자 수를 한 자도 안 늘려야 뒤판과 앞판이 안 어긋난다.
   번호는 CSS 카운터가 센다: 줄 하나가 끼어들어도 뒤 번호를 JS가 다시 안 써도 된다. */
.ed__hl { counter-reset: edln; }
/* content-visibility: auto 를 여기 걸어 봤다가 뺐다 — 칸 경계 끌기는 나아졌지만
   타자 한 자가 137ms로 뛰었다(줄 하나를 갈아끼울 때마다 3,578줄의 보임 여부를 다시 따진다).
   타자가 훨씬 자주 하는 일이라 그쪽을 지킨다. 폭 바뀔 때 무거운 건 아래 .is-resizing 으로 푼다. */
.ed__ln { position: relative; min-height: 1.75em; counter-increment: edln; }
/* 화면 밖 구간: 색도 줄번호도 없이 글자만. 같은 서식이라 줄바꿈 자리가 앞판과 똑같다 */
.ed__flat { white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; }

/* 칸 경계를 끄는 동안만: 겹쳐 둔 강조판을 내리고 글자를 원래 색으로 돌려 준다.
   그러면 배치할 것이 textarea 하나뿐이라 폭이 바뀌어도 가볍다.
   끌기를 놓으면 색이 돌아온다 — 끄는 동안 색이 잠깐 빠지는 편이 버벅이는 것보다 낫다. */
.is-resizing .ed__hl { display: none; }
.is-resizing .ed__box { color: var(--ink); -webkit-text-fill-color: var(--ink); }
.is-resizing .ac { display: none; }
.ed__ln::before {
  content: counter(edln);
  position: absolute; left: -42px; top: 0; width: 32px;
  text-align: right; font-size: 11px; line-height: inherit;
  color: var(--ink-40); opacity: .55; user-select: none;
}
.ed__ln.is-err  { background: color-mix(in srgb, var(--red) 13%, transparent); }
.ed__ln.is-warn { background: color-mix(in srgb, #c9a227 15%, transparent); }
.ed__ln.is-err::before  { color: var(--red); opacity: 1; font-weight: 700; }
.ed__ln.is-warn::before { color: #c9a227; opacity: 1; font-weight: 700; }

/* 문법 색: 화면 대부분은 그대로 두고, 뜻이 있는 기호만 물들인다 */
.h-scene   { color: var(--blue); font-weight: 700; }
.h-ending  { color: #c9a227; font-weight: 600; }
.h-key     { color: var(--blue); font-weight: 700; }
.h-bullet  { color: var(--blue); font-weight: 700; }
.h-off     { color: var(--ink-40); font-weight: 700; }
.h-arrow   { color: var(--blue); font-weight: 700; }
.h-dest    { color: var(--blue-dark); }
.h-cond    { color: #8a9a5b; }
.h-var     { color: #b07cc6; }
.h-em      { font-style: italic; color: var(--ink); }
.h-comment { color: var(--ink-40); font-style: italic; }
.h-rule    { color: var(--ink-40); letter-spacing: .2em; }
.h-title   { color: var(--ink); font-weight: 800; }
[data-mode="day"] .h-cond { color: #5f7a2e; }
[data-mode="day"] .h-var  { color: #8b4fa8; }

/* 지금 커서가 있는 장면 — 3,578줄 안에서 길을 잃지 않게 */
.ed__where {
  flex: none; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 20px; padding: 3px 10px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--ink-60);
  white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
}
.ed__where:hover { border-color: var(--blue); color: var(--ink); }
.ed__where[hidden] { display: none; }

/* ══ 화면 디자인 책상 ══ */
.dz-bar { display: flex; align-items: center; gap: 10px; padding: 0 0 10px; flex-wrap: wrap; }
.dz-wrap {
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); min-height: 0;
}
/* 무대를 실제 기기 비율로 놓는다 — 여기서 보이는 게 독자가 보는 것이어야 하니까 */
.dz-stage {
  position: relative; overflow: hidden; background: var(--bg);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: 0 18px 44px -22px rgb(0 0 0 / .55);
}
.dz-stage--폰   { width: 380px; min-height: 620px; }
.dz-stage--판   { width: 560px; min-height: 640px; }
.dz-stage--넓게 { width: 100%; min-height: 620px; }
/* 화면비를 정한 작품은 그 비율 그대로 보여 준다 — 독자 화면에서도 이 비율로 줄어든다 */
.dz-stage--fixed { min-height: 0; height: auto; }
.dz-stage--fixed .stage { height: 100%; }
.dz-stage .stage { padding: 16px; min-height: inherit; }
.dz-stage .prose { font-size: 15px; }
.dz-stage [data-layer] { cursor: grab; }
.dz-stage .prose, .dz-stage .scene-title, .dz-stage .choices,
.dz-stage .hud, .dz-stage .scene-art, .dz-stage .ending { cursor: grab; }
.dz-stage .is-dzpick { outline: 2px dashed var(--blue); outline-offset: 3px; border-radius: 4px; }
.dz-stage [data-layer]:active { cursor: grabbing; }

/* 층 목록 */
.ly-drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 14px 10px; margin-bottom: 10px; cursor: pointer; font-size: 12px; color: var(--ink-60);
  border: 1.5px dashed var(--line); border-radius: var(--r-sm);
}
.ly-drop:hover, .ly-drop:focus-visible { border-color: var(--blue); background: var(--surface-2); }
.ly-drop.is-over { border-color: var(--blue); background: var(--blue-soft); }
.ly-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ly-row {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; cursor: pointer;
  border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-60);
}
.ly-row:hover { background: var(--raise); color: var(--ink); }
.ly-row.is-on { background: var(--blue-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--blue); }
.ly-thumb { width: 26px; height: 26px; object-fit: cover; border-radius: 5px; background: var(--art); flex: none; }
.ly-thumb--text {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--ink-60); background: var(--surface);
}
/* 글 층: 그림이 아니라 글자라 줄바꿈과 그림자를 챙겨 준다 */
.tl--text { line-height: 1.3; white-space: pre-wrap; text-shadow: 0 1px 10px rgb(0 0 0 / .35); }
.ly-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-40); flex: none; margin: 0 9px; }
.ly-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-spot { font-size: 10.5px; color: var(--ink-40); flex: none; }
.ly-x {
  flex: none; background: none; border: 0; color: var(--ink-40); cursor: pointer;
  padding: 2px 4px; border-radius: 5px; font-size: 11px;
}
.ly-x:hover { background: var(--surface); color: var(--ink); }

/* 아홉 자리 고르기 */
.spot-grid { display: grid; grid-template-columns: repeat(3, 28px); gap: 4px; }
.spot {
  width: 28px; height: 24px; border: 1px solid var(--line); border-radius: 5px;
  background: var(--surface-2); cursor: pointer;
}
.spot:hover { border-color: var(--blue); }
.spot.is-on { background: var(--blue); border-color: var(--blue); }
.ds-val { font-size: 11px; color: var(--ink-40); font-variant-numeric: tabular-nums; margin-left: 6px; }

/* 이름 채워 주기: 커서가 있는 줄 바로 밑에 붙는다 */
.ac {
  position: absolute; z-index: 40; min-width: 180px; max-width: 320px;
  max-height: 216px; overflow: auto; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: 0 14px 34px -14px rgb(0 0 0 / .55);
  display: flex; flex-direction: column; gap: 1px;
}
.ac[hidden] { display: none; }
.ac__row {
  background: none; border: 0; text-align: left; cursor: pointer;
  padding: 6px 9px; border-radius: 6px; font-size: 13px; color: var(--ink-60);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ac__row:hover { background: var(--raise); color: var(--ink); }
.ac__row.is-on { background: var(--blue); color: var(--on-accent); font-weight: 600; }

/* 문제 목록: 자르지 않고 다 보여 준다. 누르면 그 줄로 간다 */
.probs { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.probs > summary {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; cursor: pointer; background: var(--surface-2); font-size: 12.5px;
}
.probs > summary::-webkit-details-marker { display: none; }
.probs > summary::before { content: '▸'; color: var(--ink-40); }
.probs[open] > summary::before { content: '▾'; }
.probs__err  { color: var(--red); }
.probs__warn { color: #c9a227; }
.probs > summary .hint { margin-left: auto; font-size: 11px; }
.probs__list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow: auto; }
.probs__row {
  display: flex; align-items: baseline; gap: 10px; width: 100%; text-align: left;
  background: none; border: 0; border-top: 1px solid var(--line);
  padding: 8px 12px; font-size: 12.5px; color: var(--ink-60); cursor: pointer;
}
.probs__row:hover { background: var(--raise); color: var(--ink); }
.probs__ln {
  flex: none; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums;
  font-size: 11px; color: var(--ink-40);
}
.probs__row.is-err  .probs__ln { color: var(--red); font-weight: 700; }
.probs__row.is-warn .probs__ln { color: #c9a227; font-weight: 700; }
.probs__msg { flex: 1; }
.probs__scene { flex: none; font-size: 11px; color: var(--ink-40); }

/* ── 히어로 ─────────────────────────── */
.hero {
  position: relative; padding: 60px 0 40px; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -120px; right: -140px;
  width: 380px; height: 380px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--blue-soft), transparent 70%);
  z-index: -1;
}

/* ── 추천 보드: 어두운 무대 위 한 작품 ── */
/* 장르 띠가 이미 위를 갈라 주므로 카탈로그는 제 여백만 갖는다 */
.stage-catalog { padding: 8px 0 0; }
.stage-spotlight { padding-bottom: 8px; }
.stage-spotlight .stage-section__head { margin-top: 0; }
.stage-discover { margin-top: 64px; padding: 32px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stage-official { margin-top: 56px; }
.stage-catalog__head { max-width: 500px; padding-bottom: 22px; }
.stage-catalog__head .kicker, .stage-section__head .kicker { margin-bottom: 7px; }
.stage-catalog__head h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.04em; }
.stage-catalog__head > p:last-child { margin-top: 8px; color: var(--ink-60); font-size: 15px; }
.stage-section__head { margin: 64px 0 16px; }
.stage-section__head h2 { font-size: 20px; font-weight: 750; }
.stage-section__head--row { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-top: 0; }
.stage-section__note { padding-bottom: 3px; color: var(--ink-40); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
/* 추천 배너는 두 테마에서 다 어두운 면이다. 그래서 글자색만 테마를 따라가게 두면
   밝은 테마에서 어두운 글자가 어두운 배너에 얹혀 통째로 안 보인다 — 여기서만 색을 못 박는다. */
.feat {
  position: relative; margin-top: 0; background: #171d23;
  --ink: #F2F5F8; --ink-60: #B0B8C1; --ink-40: #8B95A1;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 20px; padding: 40px 44px 36px;
  display: grid; grid-template-columns: 1fr 240px; gap: 36px; align-items: center;
  min-height: 300px; overflow: hidden;
}
.feat__body { display: flex; flex-direction: column; gap: 10px; min-height: 220px; }
.feat__kicker {
  align-self: flex-start; background: var(--blue); color: var(--on-accent);
  font-size: 11px; font-weight: 800; padding: 5px 11px; border-radius: 6px;
  letter-spacing: .02em; box-shadow: 0 4px 16px -6px rgb(46 155 255 / .8);
}
.feat__ttl { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; }
.feat__ttl a { color: inherit; }
.feat__quote { font-size: 15px; color: var(--ink-60); line-height: 1.7; max-width: 480px; }
.feat__by { font-size: 12.5px; color: var(--ink-40); }
.feat__art {
  aspect-ratio: 1/1; border-radius: 14px; overflow: hidden;
  background: var(--art) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  box-shadow: 0 20px 48px -18px rgb(0 0 0 / .9);
}
.feat__count {
  position: absolute; top: 18px; right: 112px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink-60);
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 6px;
}
.feat__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); font-size: 18px; line-height: 1;
  transition: background .15s, border-color .15s;
}
.feat__nav:hover { background: var(--raise); border-color: var(--blue); }
/* 이 단추들은 어두운 배너 위에 얹힌다. 면 색까지 테마를 따라가면 밝은 테마에서
   흰 글자가 흰 칩에 얹혀 사라진다 — 배너 안에서는 면도 못 박는다. */
.feat .feat__count, .feat .feat__nav {
  background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .2);
}
.feat .feat__nav:hover { background: rgb(255 255 255 / .18); border-color: var(--blue); }
.feat__nav--l { left: auto; right: 58px; top: 34px; }
.feat__nav--r { right: 14px; top: 34px; }

/* ── 갈래 필터 ───────────────────────── */
.genre-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* 스테이지의 장르 띠: 머리띠 바로 아래 붙어서 목록을 스크롤해도 따라온다.
   좁은 화면에서는 줄바꿈 대신 가로로 민다 — 칩이 세 줄로 쌓이면 목록이 화면 밖으로 밀린다. */
.genre-bar {
  position: sticky; top: var(--masthead-h, 69px); z-index: 15;
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 0 0 24px; padding: 12px 0;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.genre-bar::-webkit-scrollbar { display: none; }
.genre-bar .chip { flex: none; }

/* 정렬 띠: 장르 아래에 한 단 낮은 무게로 */
.sort-bar {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: -12px 0 22px; padding: 2px 0;
}
.sort-bar::-webkit-scrollbar { display: none; }
.chip--sort {
  flex: none; border-radius: 999px; padding: 6px 13px; font-size: 12px;
  background: none; border-color: transparent; color: var(--ink-40);
}
.chip--sort:hover { background: var(--surface); color: var(--ink); }
.chip--sort[aria-selected="true"] {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}

/* 홈에서 갈라지는 두 길: 읽기와 짓기 */
.home-ways { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 32px 0 8px; }
.home-way {
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg, 20px);
  background: var(--surface-2); color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.home-way:hover { border-color: var(--blue); transform: translateY(-2px); }
.home-way h2 { font-size: 21px; margin: 0; }
.home-way p { color: var(--ink-60); font-size: 13.5px; line-height: 1.6; margin: 0; }
.home-way__go { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--blue); }
@media (max-width: 720px) { .home-ways { grid-template-columns: 1fr; } }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-60);
  font-size: 12.5px; font-weight: 700; padding: 7px 15px; border-radius: 999px;
  transition: background .14s, color .14s, border-color .14s;
}
.chip:hover { background: var(--raise); color: var(--ink); }
.chip[aria-selected="true"] {
  background: var(--blue-soft); color: var(--blue); border-color: var(--blue);
}

/* ── 공식 입점작 카드 (앨범형) ───────── */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.album-card {
  display: block; border-radius: 14px;
  transition: transform .16s cubic-bezier(.2,.7,.3,1);
}
.album-card:hover { transform: translateY(-4px); }
.album-cover {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px;
  background: var(--art) center / cover no-repeat;
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -14px rgb(0 0 0 / .9);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow .16s, border-color .16s;
}
.album-card:hover .album-cover {
  border-color: var(--blue);
  box-shadow: var(--glow), 0 18px 36px -16px rgb(0 0 0 / .95);
}
/* 그림 없는 작품에 지어 주는 표지: 제목을 그대로 앉힌다 */
.cover-made {
  display: flex; flex-direction: column; gap: 6px; padding: 14% 12%;
  width: 100%; height: 100%; justify-content: flex-end; text-align: left;
}
.cover-made b {
  font-size: clamp(15px, 13cqw, 30px); font-weight: 800; line-height: 1.22;
  letter-spacing: -0.035em; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cover-made i {
  font-style: normal; font-size: clamp(9px, 5cqw, 12px); font-weight: 600;
  color: rgb(255 255 255 / .62);
}
.album-cover, .feat__art, .work-hero__cover { container-type: inline-size; }
.album-cover__text {
  font-family: var(--mono); font-weight: 800; font-size: 30px;
  color: #ff5a5a; letter-spacing: -0.02em;
  text-shadow: 0 0 18px rgb(255 90 90 / .55);
}
.album-body { padding: 13px 2px 0; }
.album-tag {
  font-size: 11px; font-weight: 800; color: var(--blue);
  text-transform: uppercase; letter-spacing: .04em;
}
.album-ttl { font-size: 16px; font-weight: 800; letter-spacing: -0.025em; margin-top: 3px; }
.album-dek {
  font-size: 11.5px; color: var(--ink-40); line-height: 1.5; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.album-cta { display: block; margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--ink-60); }
.badge-official {
  position: absolute; top: 10px; right: 10px;
  background: rgb(255 255 255 / .88); color: #14171A;
  font-size: 10px; font-weight: 800; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 20px; backdrop-filter: blur(4px);
}

/* ── 공식작 무대(iframe) ────────────── */
.native-stage { display: flex; flex-direction: column; height: 100dvh; margin: 0 calc(var(--gut) * -1); }
.native-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px var(--gut);
  border-bottom: 1px solid var(--line);
}
.native-bar__ttl { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.native-frame { flex: 1; width: 100%; border: 0; background: #000; }

/* ── 스테이지(목록) ─────────────────────── */
.shelf { list-style: none; display: grid; gap: 12px; padding: 28px 0 0; }
.shelf li { border: 0; }
.shelf a.entry {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px;
  align-items: center; padding: 20px 22px;
  background: var(--surface-2); border-radius: var(--r-lg);
  box-shadow: 0 1px 2px rgb(0 0 0 / .03);
  transition: background .15s, transform .12s, box-shadow .15s;
}
.shelf a.entry:hover { background: var(--surface); transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgb(0 0 0 / .18); }
.shelf .no {
  font-size: 15px; font-weight: 800; color: var(--ink-40);
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
}
.shelf .ttl { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.shelf .by { font-size: 13px; color: var(--ink-40); font-weight: 500; }
.shelf .meta { font-size: 12px; color: var(--ink-40); text-align: right; line-height: 1.8; }
.shelf .tag {
  display: inline-block; background: var(--blue-soft); color: var(--blue);
  font-weight: 700; font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
}
.shelf .tag--go { margin-left: 6px; }

.empty {
  background: var(--surface-2); border-radius: var(--r-lg);
  padding: 44px 20px; text-align: center;
  color: var(--ink-40); font-size: 14.5px;
}

/* ── 마이페이지: 장식을 걷고 정보만. 면과 선, 여백으로만 나눈다 ── */
.my { padding: 40px 0 20px; }
.my__head { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.my__head h1 { font-size: 26px; font-weight: 800; }
.my__face {
  flex: none; width: 54px; height: 54px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 21px; font-weight: 800; color: var(--ink-60);
}
.my__who { min-width: 0; }
.my__who p { font-size: 12.5px; color: var(--ink-40); margin-top: 3px; }
.my__head .btn { margin-left: auto; flex: none; }

/* 읽던·소장·지은을 한 자리에서 갈아끼운다 */
.my__tabs { display: flex; gap: 4px; margin: 32px 0 4px; border-bottom: 1px solid var(--line); }
.my__tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px;
  padding: 10px 14px; font-size: 14px; font-weight: 700; color: var(--ink-40); cursor: pointer;
}
.my__tabs button span { font-size: 12px; font-weight: 600; opacity: .7; }
.my__tabs button:hover { color: var(--ink); }
.my__tabs button[aria-selected="true"] { color: var(--blue); border-bottom-color: var(--blue); }

.my__set { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.my__set > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.my__set b { font-size: 13.5px; }
.my__set > :last-child { margin-left: auto; flex: none; }

.my__nums {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.my__nums > div { padding: 18px 4px; }
.my__nums > div + div { border-left: 1px solid var(--line); padding-left: 20px; }
.my__nums dt { font-size: 12.5px; font-weight: 600; color: var(--ink-40); margin-bottom: 4px; }
.my__nums dd { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; }

.my__sec { margin-top: 40px; }
.my__h {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 700; margin-bottom: 4px;
}
.my__h span { font-size: 13px; font-weight: 600; color: var(--ink-40); }

.my__list { list-style: none; }
.my__row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 2px; border-bottom: 1px solid var(--line);
}
.my__row:hover { background: var(--surface-2); }
.my__art {
  flex: none; width: 44px; height: 44px; border-radius: 6px; overflow: hidden;
  background: var(--surface); display: flex; align-items: center; justify-content: center;
}
.my__art img { width: 100%; height: 100%; object-fit: cover; }
.my__art--none { font-size: 15px; font-weight: 800; color: var(--ink-40); }
.my__txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.my__txt b { font-size: 15px; font-weight: 700; letter-spacing: -0.02em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my__txt span { font-size: 12.5px; color: var(--ink-40); }
.my__go { flex: none; font-size: 13px; font-weight: 700; color: var(--blue); }
.my__acts { flex: none; display: flex; gap: 12px; font-size: 12.5px; }
.my__empty { padding: 28px 4px; color: var(--ink-40); font-size: 14px; border-bottom: 1px solid var(--line); }
.my__plain { font-size: 13px; }

/* 엔딩 모음 */
.end-list { list-style: none; display: grid; gap: 2px; max-height: 360px; overflow: auto; }
.end-row {
  display: flex; align-items: center; gap: 10px; padding: 11px 4px;
  border-top: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.end-row:first-child { border-top: 0; }
.end-row--locked { color: var(--ink-40); font-weight: 500; }
.end-dot { color: var(--blue); font-size: 12px; }
.end-row--locked .end-dot { color: var(--ink-40); }

/* 몰입 모드: 게임 중엔 사이트 껍데기를 걷어낸다 */
body.immersive .masthead, body.immersive .colophon { display: none; }
body.immersive { min-height: 100dvh; }

.play-bar {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.play-bar .ttl { font-size: 13.5px; font-weight: 700; color: var(--ink-60); }

/* ── 무대(플레이) ───────────────────── */
.stage { padding: 6px 0 60px; }
/* 무대의 글이 담기는 칸. 폭을 인라인으로 박아 두면 작가가 못 바꾸므로 여기로 뺐다 */
/* 폭은 글자 수로 잰다 — 글자를 키우면 한 줄에 담기는 수가 그대로여야 읽는 결이 안 바뀐다 */
.stage__body {
  max-width: 578px;
  margin: 0 auto; position: relative; z-index: 1;
}

/* 미리보기 아래에 늘 붙어 있는 기호표. 판으로 따로 꺼내 쓰는 길(cheat 판)도 그대로 둔다 —
   여기 것은 「지금 쓰다가 잠깐 확인」용이라 접힌 채로 시작한다. */
.cheat-fold { margin-top: 14px; border-top: 1px solid var(--line); }
.cheat-fold > summary {
  padding: 10px 2px; cursor: pointer; list-style: none;
  font-size: 11.5px; font-weight: 700; color: var(--ink-40);
}
.cheat-fold > summary::-webkit-details-marker { display: none; }
.cheat-fold > summary::before { content: '▸ '; }
.cheat-fold[open] > summary::before { content: '▾ '; }
.cheat-fold > summary:hover { color: var(--ink); }
.cheat-fold .cheat-list { padding-bottom: 12px; }

/* 대사 옆에 세우는 얼굴. 낱말처럼 흐르게 둬서 지문의 줄바꿈을 안 흩뜨린다. */
.say { display: inline-flex; align-items: flex-start; gap: 9px; vertical-align: top; }
.say__face {
  flex: none; width: 2.1em; height: 2.1em; border-radius: 50%; object-fit: cover;
  background: var(--surface); border: 1px solid var(--line);
  margin-top: .12em;
}
.say__face--none {
  display: flex; align-items: center; justify-content: center;
  font-size: .78em; font-weight: 800; color: var(--ink-40);
}
.say__line { min-width: 0; }

/* 값을 치러야 넘어가는 자리 */
.paywall {
  max-width: 420px; margin: 8vh auto 0; padding: 34px 30px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-lg, 20px); background: var(--surface-2);
}
.paywall h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 4px; }
.paywall__by { font-size: 13px; color: var(--ink-40); margin-bottom: 18px; }
.paywall__dek { font-size: 14px; line-height: 1.7; color: var(--ink-60); margin-bottom: 22px; }
.paywall__nums {
  display: flex; justify-content: center; gap: 22px; margin-bottom: 24px;
  padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.paywall__nums span { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-40); }
.paywall__nums b { font-size: 19px; font-weight: 800; color: var(--ink); }
.paywall .btn { width: 100%; }
.paywall .btn + .btn { margin-top: 8px; }
.buy-price { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 10px; }
.studio__status .is-paid { color: var(--blue); font-weight: 700; }

/* ── 장면 연출 ──
   대본에 `연출: 글리치` 한 줄이면 무대가 그렇게 움직인다.
   시간(`연출: 진동 0.4초`)을 적으면 --fx-sec만큼만 하고 멎는다(안 적으면 계속).
   무대 자체가 아니라 안쪽을 움직인다 — 무대를 움직이면 층·HUD까지 통째로 흔들려
   글이 못 읽힐 만큼 요란해진다. */
.stage[data-fx] .stage__body { animation-duration: var(--fx-sec, 0s); }
.stage[data-fx="진동"] .stage__body {
  animation: fx-진동 .09s linear infinite;
  animation-duration: .09s;
  animation-iteration-count: var(--fx-once, infinite);
}
.stage[data-fx="글리치"] .prose { animation: fx-글리치 2.4s steps(3) infinite; }
.stage[data-fx="깜빡임"] .stage__body { animation: fx-깜빡임 3.1s ease-in-out infinite; }
.stage[data-fx="암전"] .stage__body { animation: fx-암전 5.5s ease-in-out infinite; }
.stage[data-fx="기울어짐"] .stage__body { animation: fx-기울어짐 7s ease-in-out infinite; }
/* 노이즈는 움직임이 아니라 결이다 — 무대 위에 얇게 한 겹 깐다 */
.stage[data-fx="노이즈"]::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3; opacity: .05;
  background-image: repeating-linear-gradient(0deg, #fff 0 1px, transparent 1px 3px);
  animation: fx-노이즈 .5s steps(4) infinite;
}
/* 시간을 적었으면 그만큼만 하고 제자리에 선다 */
.stage[data-fx][style*="--fx-sec"] .stage__body,
.stage[data-fx][style*="--fx-sec"] .prose {
  animation-duration: var(--fx-sec);
  animation-iteration-count: 1;
  animation-fill-mode: both;
}
@keyframes fx-진동 { 0%,100%{translate:0} 25%{translate:-1.5px} 75%{translate:1.5px} }
@keyframes fx-글리치 {
  0%,72%,100% { translate: 0; filter: none; }
  76% { translate: -2px 1px; filter: hue-rotate(18deg) contrast(1.25); }
  80% { translate: 3px -1px; }
  84% { translate: -1px 2px; filter: contrast(1.4); }
}
@keyframes fx-깜빡임 { 0%,88%,100% { opacity: 1 } 90% { opacity: .34 } 92% { opacity: 1 } 94% { opacity: .5 } }
@keyframes fx-암전 { 0%,80%,100% { opacity: 1 } 90% { opacity: .06 } }
@keyframes fx-기울어짐 { 0%,100% { rotate: 0deg } 50% { rotate: .6deg } }
@keyframes fx-노이즈 { 0%,100% { transform: translateY(0) } 50% { transform: translateY(2px) } }
/* 움직임을 줄인 기기에서는 연출을 걷어낸다 — 멀미와 발작을 부를 수 있다 */
@media (prefers-reduced-motion: reduce) {
  .stage[data-fx] .stage__body, .stage[data-fx] .prose { animation: none !important; }
  .stage[data-fx]::after { animation: none !important; opacity: .03; }
}

/* ── 화면 층 ── 작가가 무대에 직접 얹는 그림 */
.stage { position: relative; }
.tl { display: block; pointer-events: none; user-select: none; }
.tl.is-picked { outline: 2px solid var(--blue); outline-offset: 2px; }
/* 등장 몸짓: 한 번 뜨고 끝. 되풀이하지 않는다 — 시간은 읽는 사람이 감는다 */
@keyframes tl-스밈    { from { opacity: 0 } }
@keyframes tl-위로    { from { opacity: 0; translate: calc(var(--tx,0px)) calc(var(--ty,0px) + 24px) } }
@keyframes tl-아래로  { from { opacity: 0; translate: calc(var(--tx,0px)) calc(var(--ty,0px) - 24px) } }
@keyframes tl-왼쪽    { from { opacity: 0; translate: calc(var(--tx,0px) + 30px) calc(var(--ty,0px)) } }
@keyframes tl-오른쪽  { from { opacity: 0; translate: calc(var(--tx,0px) - 30px) calc(var(--ty,0px)) } }
@keyframes tl-커짐    { from { opacity: 0; scale: .88 } }
@keyframes tl-흔들    { 0%,100% { rotate: 0deg } 25% { rotate: -2.5deg } 75% { rotate: 2.5deg } }
.tl--스밈   { animation: tl-스밈 .55s ease both; }
.tl--위로   { animation: tl-위로 .5s cubic-bezier(.2,.7,.3,1) both; }
.tl--아래로 { animation: tl-아래로 .5s cubic-bezier(.2,.7,.3,1) both; }
.tl--왼쪽   { animation: tl-왼쪽 .5s cubic-bezier(.2,.7,.3,1) both; }
.tl--오른쪽 { animation: tl-오른쪽 .5s cubic-bezier(.2,.7,.3,1) both; }
.tl--커짐   { animation: tl-커짐 .5s cubic-bezier(.2,.7,.3,1) both; }
.tl--흔들   { animation: tl-흔들 .5s ease both; }
.stage.themed { margin: 0 calc(var(--gut) * -1); padding: 6px var(--gut) 80px; min-height: 100dvh; }
.stage.themed .hud, .stage.themed .play-bar { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }

.ask-box {
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 20px; margin-top: 32px; max-width: 380px;
}
.hud {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 12px 0; margin-bottom: 32px;
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.hud .stat {
  font-size: 12.5px; font-weight: 600; color: var(--ink-60);
  background: var(--surface); padding: 6px 12px; border-radius: 20px;
}
.hud .stat b { color: var(--ink); font-weight: 800; }
.hud .stat.up b { color: var(--blue); }

.stat--gauge { display: inline-flex; align-items: center; gap: 8px; padding-right: 14px; }
.stat__label { white-space: nowrap; }
.stat__bar {
  display: inline-block; width: 56px; height: 6px; border-radius: 6px;
  background: var(--line); overflow: hidden;
}
.stat__bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .25s ease; }
.stat__max { font-style: normal; font-weight: 600; color: var(--ink-40); font-size: 10.5px; }

/* 읽는 눈금은 독자가 정한다 — 작가가 지정한 값이 없을 때의 기본은 그대로 17px/1.95 */
.prose {
  font-size: 17px; line-height: 1.95;
  white-space: pre-wrap; font-weight: 450;
}
.prose em { color: var(--blue); font-style: normal; font-weight: 700; }
.scene-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
  color: var(--ink-40); margin-bottom: 16px;
}
/* 장면 표식: 판이 갈라진 틈에서 새어나온 마그마 한 조각 */
.scene-title__mark {
  flex: none; width: 3px; height: 13px; border-radius: 2px;
  background: var(--blue); box-shadow: 0 0 8px rgb(46 155 255 / .7);
}

.choices { list-style: none; margin-top: 36px; display: grid; gap: 10px; }
.choices li { border: 0; }
.choices button {
  width: 100%; text-align: left; border: 0;
  background: var(--surface-2); border-radius: var(--r-md);
  padding: 16px 18px; font-size: 15.5px; font-weight: 600;
  display: flex; gap: 12px; align-items: baseline;
  transition: background .15s, transform .12s;
}
.choices button:hover { background: var(--blue-soft); transform: translateY(-1px); }
.choices button::before {
  content: attr(data-n);
  font-family: var(--mono); font-size: 11px; font-weight: 700; color: var(--blue);
}
.choices button:disabled { color: var(--ink-40); background: var(--surface-2); transform: none; }
.choices button:disabled:hover { background: var(--surface-2); }
.choices button:disabled::before { color: var(--ink-40); }
.choices .lock { font-size: 11.5px; font-weight: 500; color: var(--ink-40); margin-left: auto; }

.ending {
  background: var(--surface-2); border-radius: var(--r-lg);
  padding: 40px 30px; margin-top: 44px; text-align: center;
}
.ending .kicker { display: block; margin-bottom: 10px; }
.ending h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }

/* ── 게임 테마: 배경·글자·포인트 셋에서 나머지 전부를 섞어 만든다 ──
   AI도, 색 하나하나를 고르는 일도 없다. color-mix가 회색조·옅은칩·hover를
   그 자리에서 계산한다. 작가는 세 가지만 고르면 된다. */
.themed {
  background: var(--bg); color: var(--ink);
  --surface: color-mix(in srgb, var(--ink) 7%, var(--bg));
  --surface-2: color-mix(in srgb, var(--ink) 4%, var(--bg));
  --field: color-mix(in srgb, var(--ink) 7%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 14%, var(--bg));
  --ink-60: color-mix(in srgb, var(--ink) 64%, var(--bg));
  --ink-40: color-mix(in srgb, var(--ink) 42%, var(--bg));
  --blue-dark: color-mix(in srgb, var(--blue) 80%, black);
  --blue-soft: color-mix(in srgb, var(--blue) 16%, var(--bg));
  transition: background .2s, color .2s;
}

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-chip {
  aspect-ratio: 2/1; border-radius: var(--r-sm); border: 2px solid transparent;
  display: flex; align-items: flex-end; padding: 8px 10px; cursor: pointer;
  font-size: 11.5px; font-weight: 700; overflow: hidden;
}
.theme-chip[aria-current="true"] { border-color: var(--blue); }
.theme-chip .swatch { display: flex; gap: 3px; margin-bottom: 2px; }
.theme-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.color-row { display: flex; align-items: center; gap: 8px; }
.color-row input[type="color"] {
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; cursor: pointer; background: none;
}
.color-row input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type="color"]::-webkit-color-swatch { border: 1px solid var(--line); border-radius: 8px; }

.fade { animation: fade .4s cubic-bezier(.2,.7,.3,1) both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── 장면 넘김 ──
   예전엔 무대 전체(.stage)에 .fade를 걸었다. 선택할 때마다 머리줄과 수치 띠까지
   0.4초 동안 같이 어두워졌다 돌아와서, 이야기가 이어지는 게 아니라 화면이 깜빡이는 것처럼 보였다.
   바뀌는 건 글과 선택지뿐이니 그 칸만, 더 짧게, 완전히 사라지지 않을 만큼만 움직인다. */
.stage__body.scene-in { animation: scene-in .2s cubic-bezier(.2,.7,.3,1) both; }
@keyframes scene-in { from { opacity: .45; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .stage__body.scene-in { animation: none; }
}

/* ── 스튜디오(에디터) ─────────────────
   웹페이지가 아니라 프로그램 창이다: 사이트 머리띠를 접고 100dvh 안에 머리띠·작업대·상태띠를
   고정으로 앉힌다. 스크롤은 바깥이 아니라 판 안에서만 일어난다. */
body.studio-mode .masthead,
body.studio-mode .colophon { display: none; }
html:has(body.studio-mode) { overflow: hidden; height: 100%; }
body.studio-mode { overflow: hidden; margin: 0; height: 100%; }
body.studio-mode .sheet { max-width: none; padding: 0; margin: 0; }
body.studio-mode #app { margin: 0; }

.studio {
  height: 100dvh; display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--bg);
}
.studio__bar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 12px; border-bottom: 1px solid var(--line); background: var(--surface);
}
/* 스튜디오 안에서도 텍토 표시는 남는다 — 여기가 어떤 프로그램인지, 어떻게 나가는지 */
.studio__home {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  color: var(--ink); text-decoration: none; font-size: 11px; font-weight: 800;
  padding: 2px 4px; border-radius: 7px;
}
.studio__home:hover { background: var(--raise); }
.studio__home .mark { width: 15px; height: 15px; color: var(--blue); }
.studio__doc { font-size: 11px; font-weight: 700; letter-spacing: -0.01em; }
.studio__bar .saved { font-size: 10.5px; color: var(--ink-40); }
.studio__sep { width: 1px; align-self: stretch; margin: 2px 6px; background: var(--line); }
/* min-width:0 + overflow:hidden 이 없으면 구조도 캔버스(수천 px)가 flex 사슬을 통째로 벌린다 */
.studio__work { min-height: 0; min-width: 0; overflow: hidden; display: flex; }
.studio__status {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 5px 12px; border-top: 1px solid var(--line); background: var(--surface);
  font-size: 11px; color: var(--ink-40); font-variant-numeric: tabular-nums;
}
.studio__status .is-bad { color: var(--red); font-weight: 700; }
.studio__reset {
  background: none; border: 0; color: var(--ink-40); font: inherit;
  text-decoration: underline; cursor: pointer; padding: 0;
}
.studio__reset:hover { color: var(--ink); }

/* 작업대: 세 판이 늘 나란히. 판마다 제 머리띠와 제 스크롤을 갖는다.
   너비는 flex-grow로 나눈다 — 칸 사이 손잡이가 grid 칸을 잡아먹지 않게. */
.bench { flex: 1; min-width: 0; min-height: 0; display: flex; }
.pane {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-right: 1px solid var(--line);
}
.bench > .pane:last-child { border-right: 0; }
.pane__bar {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; border-bottom: 1px solid var(--line);
  background: var(--surface-2); cursor: grab;
}
.pane__bar:active { cursor: grabbing; }
.pane__bar h3 { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--ink-60); margin: 0; white-space: nowrap; }
/* 판 이름을 누르면 이 자리에 놓을 판을 고른다 */
.pane__pick {
  background: none; border: 0; padding: 2px 5px; border-radius: 6px; cursor: pointer;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--ink-60);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 4px;
}
.pane__pick i { font-style: normal; font-size: 8px; opacity: .6; }
.pane__pick:hover { background: var(--raise); color: var(--ink); }
.pane.is-shut .pane__pick { writing-mode: vertical-rl; letter-spacing: .1em; }
/* 되돌릴 수 없는 동작을 물을 때 쓰는 화면 안 창 — 네이티브 confirm() 대신 */
.confirm-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgb(0 0 0 / .45); padding: 20px;
}
.confirm-modal__card {
  width: 100%; max-width: 360px; padding: 20px; border-radius: var(--r-md, 14px);
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 24px 60px -16px rgb(0 0 0 / .6);
}
.confirm-modal__msg { margin: 0 0 18px; font-size: 13.5px; line-height: 1.6; color: var(--ink); white-space: pre-line; }
.confirm-modal__row { display: flex; justify-content: flex-end; gap: 8px; }
.pane-menu {
  position: fixed; z-index: 90; min-width: 150px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  box-shadow: 0 12px 32px -12px rgb(0 0 0 / .5); display: flex; flex-direction: column; gap: 1px;
}
.pane-menu button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: none; border: 0; text-align: left; padding: 7px 9px; border-radius: 6px;
  font-size: 12px; color: var(--ink-60); cursor: pointer;
}
.pane-menu button:hover { background: var(--raise); color: var(--ink); }
.pane-menu button[aria-selected="true"] { color: var(--blue); font-weight: 700; }
.pane-menu i { font-style: normal; font-size: 10px; color: var(--ink-40); }
/* 틀 목록: 이름 + 무엇이 담겼는지 한 줄 */
.pane-menu--wide { min-width: 256px; max-width: 320px; }
.pane-menu--wide button { flex-direction: column; align-items: flex-start; gap: 2px; position: relative; padding-right: 26px; }
.tm-name { font-weight: 700; color: var(--ink); }
.tm-sub { font-size: 10.5px; color: var(--ink-40); }
.tm-sep { padding: 7px 9px 3px; font-size: 10.5px; color: var(--ink-40); letter-spacing: .04em; }
.pane-menu--wide [data-tdel] {
  position: absolute; right: 6px; top: 50%; translate: 0 -50%;
  padding: 3px 5px; border-radius: 5px; cursor: pointer;
}
.pane-menu--wide [data-tdel]:hover { background: var(--surface); color: var(--red); }
#dzTmpl i { font-style: normal; font-size: 8px; opacity: .6; margin-left: 4px; }
/* 기호표는 판 하나를 통째로 쓰므로 줄 간격을 넉넉히 */
.cheat-list { line-height: 2; }

/* ── 글꼴 고르기 ── 이름 대신 그 글꼴로 쓴 견본을 보여 준다 */
.font-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px; margin-bottom: 14px;
}
.font-card {
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  padding: 10px 12px; text-align: left; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); transition: border-color .12s, background .12s;
}
.font-card:hover { background: var(--raise); }
.font-card[aria-current="true"] { border-color: var(--blue); box-shadow: var(--glow); }
.font-card__name { font-size: 11px; font-weight: 700; color: var(--ink-40); letter-spacing: .02em; }
.font-card__eg { font-size: 17px; line-height: 1.35; }
.font-drop {
  display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center;
  padding: 18px 14px; cursor: pointer;
  border: 1.5px dashed var(--line); border-radius: var(--r-md); color: var(--ink-60);
  transition: border-color .12s, background .12s;
}
.font-drop:hover, .font-drop:focus-visible { border-color: var(--blue); background: var(--surface-2); }
.font-drop.is-over { border-color: var(--blue); background: var(--blue-soft); }
.font-drop b { font-size: 13px; color: var(--ink); }
.font-mine { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.font-mine li {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  background: var(--surface-2); border-radius: var(--r-sm); font-size: 14px;
}
.font-mine li .hint { margin-left: auto; font-size: 11px; }
.pane__grip { font-size: 10px; color: var(--ink-40); line-height: 1; }
.pane__fold {
  flex: none; background: none; border: 0; padding: 0 2px; cursor: pointer;
  color: var(--ink-40); font-size: 9px; line-height: 1;
}
.pane__fold:hover { color: var(--ink); }
.pane__body { flex: 1; min-height: 0; min-width: 0; overflow: auto; padding: 12px; }
.pane.is-dragging { opacity: .5; }
.pane.is-over { outline: 2px solid var(--blue); outline-offset: -2px; }

/* 접힌 판: 이름만 세로로 세운 손잡이 한 줄로 줄어든다 */
.pane.is-shut { overflow: hidden; }
.pane.is-shut .pane__bar {
  flex-direction: column; align-items: center; gap: 8px;
  height: 100%; border-bottom: 0; padding: 8px 4px; cursor: default;
}
.pane.is-shut .pane__bar h3 { writing-mode: vertical-rl; letter-spacing: .1em; }
.pane.is-shut .pane__body { display: none; }

.pane-split {
  flex: 0 0 5px; margin: 0 -2px; cursor: col-resize; z-index: 3;
  background: transparent; transition: background .12s;
}
.pane-split:hover { background: var(--blue); }
/* 세로칸: 판을 위아래로 쌓는 자리. min-* 0 사슬을 여기서도 끊지 말 것 —
   구조도 캔버스(수천 px)가 이 칸을 통째로 벌린다. */
.pane-col { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.pane-split--row {
  flex: 0 0 5px; margin: -2px 0; cursor: row-resize; width: auto;
}
.pane__add, .pane__close {
  flex: none; background: none; border: 0; cursor: pointer; border-radius: 6px;
  padding: 1px 5px; font-size: 11px; line-height: 1.4; color: var(--ink-40);
}
.pane__add:hover, .pane__close:hover { background: var(--raise); color: var(--ink); }
.pane.is-shut .pane__add, .pane.is-shut .pane__close { display: none; }
.nav-search { margin-bottom: 10px; }
.nav-search .inp { width: 100%; }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  width: 100%; text-align: left; background: none; border: 0; border-radius: 8px;
  padding: 7px 8px; display: flex; flex-direction: column; gap: 3px;
  font-size: 13px; color: var(--ink-70); cursor: pointer; transition: background .12s;
}
.nav-item:hover { background: var(--raise); }
.nav-item.is-cur { background: var(--raise); color: var(--ink); font-weight: 600; }
.nav-item__ttl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item__badges { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-badge {
  font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-40);
}
.nav-badge--start { color: var(--blue); background: var(--blue-soft); }
.nav-badge--end { color: var(--blue); background: var(--blue-soft); }
.nav-badge--warn { color: var(--red); background: color-mix(in srgb, var(--red) 18%, transparent); }
/* 끄는 동안에는 놓을 수 있는 자리를 밝혀 준다 — 194장면에서 어디에 놓이는지 안 보이면 못 쓴다 */
.nav-list.is-dragging .nav-folder { outline: 1px dashed var(--line); outline-offset: -2px; }
.nav-list.is-dragging .nav-item { opacity: .75; }
.nav-folder.is-drop, .nav-item.is-drop {
  background: var(--blue-soft); box-shadow: inset 0 0 0 1.5px var(--blue);
  border-radius: var(--r-sm);
}
.nav-item.is-drop { opacity: 1; }
/* 폴더 순서 바꾸기: 위/아래 어디에 끼는지 선으로 보여 준다 */
.nav-folder.is-above { box-shadow: inset 0 2px 0 0 var(--blue); }
.nav-folder.is-below { box-shadow: inset 0 -2px 0 0 var(--blue); }
.nav-list.is-dragging .nav-folder[draggable] { cursor: grab; }
.nav-folder--loose { opacity: .8; }

.nav-empty { font-size: 12.5px; color: var(--ink-40); padding: 8px; }

/* 폴더(직접 만드는 서랍)와 하위 장면(이름으로 자동으로 엮이는 갈래) */
.nav-tools { display: flex; gap: 4px; margin-bottom: 8px; }
.nav-row { display: flex; align-items: flex-start; gap: 2px; padding-left: calc(var(--d, 0) * 13px); }
.nav-row .nav-item { min-width: 0; }
.nav-twist {
  flex: 0 0 14px; width: 14px; align-self: stretch; background: none; border: 0; padding: 0;
  color: var(--ink-40); font-size: 9px; line-height: 1; cursor: pointer;
}
.nav-twist:hover { color: var(--ink); }
.nav-twist--none { cursor: default; }
.nav-folder {
  display: flex; align-items: center; gap: 4px; padding: 8px 6px 4px;
  font-size: 11.5px; font-weight: 700; color: var(--ink-60);
  border-radius: 8px; border: 1px dashed transparent;
}
.nav-folder.is-drop { border-color: var(--blue); background: var(--blue-soft); }
.nav-folder__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: text; }
.nav-folder--loose .nav-folder__name { cursor: default; color: var(--ink-40); font-weight: 600; }
.nav-folder__n { flex: none; color: var(--ink-40); font-weight: 600; }
.nav-folder__x { flex: none; background: none; border: 0; color: var(--ink-40); cursor: pointer; padding: 0 2px; }
.nav-folder__x:hover { color: var(--red); }

/* 칸 너비 배분은 benchHTML이 flex-grow로 직접 준다(WS_GROW / 사용자 조절값) */

/* 구조도는 이 판의 본체다: 판 높이를 끝까지 쓰되, 넘치는 건 지도 안에서 굴린다.
   min-width:0 이 없으면 flex 자식이 캔버스(수천 px) 너비로 벌어져 도구 단추가 화면 밖으로 나간다 */
.ws-structure #paneMap { flex: 1; display: flex; min-width: 0; min-height: 0; }
.ws-structure .pane[data-pane="map"] .pane__body { display: flex; padding: 0; }
.ws-structure #paneMap .map {
  display: flex; flex-direction: column; flex: 1;
  min-height: 0; min-width: 0; margin: 0; padding: 12px;
}
.ws-structure #paneMap .map__body { max-height: none; flex: 1; min-height: 0; min-width: 0; }

#sceneInsight .stat-mini {
  background: var(--surface-2); border-radius: var(--r-sm); padding: 8px 10px;
  font-size: 12.5px; color: var(--ink-60); text-align: center;
}
#testPanel .empty-section { margin-top: 16px; }
#testPanel .empty-section h3 { font-size: 13px; margin-bottom: 4px; color: var(--ink-60); }

/* 워크스페이스 스위처(상위: 어느 책상이냐)와 설정(하위: 그 책상 위에 잠깐 펴는 서랍)은
   같은 층이 아니다. 스위처는 알약 세그먼트, 설정은 곁딸린 글자 단추로 층을 갈라 놓는다. */
.ws-switch { flex: 0 0 auto; }
.ws-settings { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; }
.ws-settings i { font-style: normal; font-size: 8px; opacity: .6; }
.ws-settings[aria-selected="true"] { color: var(--blue); border-color: var(--blue); }
.ws-settings {
  display: inline-flex; gap: 2px; align-items: center;
  padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--line);
}
.ws-settings button {
  background: none; border: 0; border-radius: 7px; padding: 5px 8px;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--ink-40); cursor: pointer;
}
.ws-settings button:hover { background: var(--raise); color: var(--ink-70); }
.ws-settings button[aria-selected="true"] { background: var(--raise); color: var(--ink); }

/* 밑줄 탭: 상자 대신, 고른 자리 아래로 마그마 선 하나만 긋는다 */
.tabs--top {
  display: flex; gap: 22px; margin: 20px 0 0; padding: 0;
  background: none; border-bottom: 1px solid var(--line);
}
.tabs--top button {
  background: none; border: 0; border-radius: 0;
  padding: 0 1px 12px; margin-bottom: -1px;
  font-size: 14.5px; font-weight: 600; color: var(--ink-40);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.tabs--top button:hover { color: var(--ink-60); }
.tabs--top button[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--blue); }

/* 구조도: 깊이대로 층을 쌓아, 어디서 갈라지는지 눈으로 본다 */
.map { margin: 20px 0 0; }
.map__bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 4px 2px 12px;
}
.map__stat {
  font-size: 12px; font-weight: 600; color: var(--ink-60);
  background: var(--surface); padding: 4px 10px; border-radius: 20px;
}
/* 모눈 위에 놓인 작업대: 배경을 칠하는 대신 격자만 아주 옅게 깐다 */
.map__body {
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 16px; max-height: 420px; overflow: auto;
  cursor: grab;   /* 바탕을 잡아 밀 수 있다 */
}
.map__body.is-panning { cursor: grabbing; user-select: none; }
.map__body .nd { cursor: pointer; }
.map__zoom { position: relative; }
.map__canvas { position: relative; transform-origin: 0 0; }
.map__collbl {
  position: absolute; top: 0; font-family: var(--mono); font-size: 10px;
  color: var(--ink-40); letter-spacing: .02em;
}
.map__svg { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.map__svg .edge { pointer-events: auto; cursor: pointer; }
.map__svg .edge:hover .edge__line { stroke: var(--red); stroke-width: 2.4; stroke-dasharray: none; }

.nd {
  position: absolute; width: 190px; min-height: 86px; text-align: left;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 10px 12px; display: grid; gap: 2px; align-content: start;
  cursor: grab; touch-action: none; user-select: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.nd:hover { border-color: var(--blue); box-shadow: 0 6px 18px -10px rgb(0 0 0 / .3); }
.nd:active { cursor: grabbing; z-index: 2; }
.nd[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.nd--orphan { border-style: dashed; opacity: .8; }
.nd--dead { border-color: var(--red); }
.nd--target { border-color: var(--blue); background: var(--blue-soft); box-shadow: 0 0 0 4px var(--blue-soft); }
/* 시작과 끝은 한눈에 갈라져야 한다: 194장 사이에서 이 둘만은 배지 없이도 보여야 한다 */
.nd--start { border-left: 4px solid var(--blue); }
.nd--end { background: var(--surface); border-style: double; border-width: 3px; }

/* 고른 장면에 닿는 길만 도드라지게 */
.map__svg .edge--in .edge__line, .map__svg .edge--out .edge__line { stroke-dasharray: none; }
.map__svg .edge--in, .map__svg .edge--out { filter: drop-shadow(0 0 3px var(--blue-soft)); }

.map__legend {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px; color: var(--ink-40); margin-bottom: 10px;
}
.map__legend span { display: inline-flex; align-items: center; gap: 5px; }
.map__legend .lg { width: 16px; height: 0; border-top: 2px solid var(--ink-60); }
.map__legend .lg--jump { border-color: var(--blue); border-top-style: dashed; }
.map__legend .lg--rand { border-color: var(--ink-40); border-top-style: dashed; }
.map__legend .lg--on { border-color: var(--blue); border-top-width: 3px; }

/* 플레이테스트 결과 */
.pt-bars { display: grid; gap: 6px; margin: 10px 0 4px; }
.pt-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 10px; align-items: center; font-size: 12.5px; }
.pt-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pt-row i { display: block; height: 8px; border-radius: 8px; background: var(--blue); opacity: .85; }
.pt-row b { text-align: right; font-size: 12px; color: var(--ink-60); }
.pt-notes { list-style: none; display: grid; gap: 6px; margin-top: 10px; }
.pt-notes li { font-size: 13px; color: var(--ink-60); padding-left: 14px; position: relative; }
.pt-notes li::before { content: '·'; position: absolute; left: 2px; }
.pt-notes li.bad { color: var(--red); font-weight: 600; }
.nd__top { display: flex; gap: 4px; flex-wrap: wrap; min-height: 0; }
.nd__ttl { font-size: 13.5px; font-weight: 700; letter-spacing: -0.02em; }
.nd__sub { font-size: 11px; color: var(--ink-40); font-weight: 500; }
.nd__flag {
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 20px;
  background: var(--surface); color: var(--ink-60);
}
.nd__flag--start { background: var(--blue-soft); color: var(--blue); }
.nd__flag--end   { background: var(--ink); color: var(--bg); }
.nd__flag--warn  { background: color-mix(in srgb, var(--red) 14%, transparent); color: var(--red); }
.nd__run { font-size: 10px; font-weight: 600; color: var(--ink-40); }
.nd__flag--fold { background: color-mix(in srgb, var(--blue) 16%, transparent); color: var(--blue); }
/* 접기 단추: 카드 안에 있지만 카드와 따로 눌린다 */
.nd__fold {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 6px;
  background: var(--raise); border: 1px solid var(--line);
  font-size: 10px; font-weight: 800; line-height: 1; color: var(--ink-60);
}
.nd__fold:hover { background: var(--blue); border-color: var(--blue); color: var(--on-accent); }
.nd--folded { border-style: dashed; }

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px; margin-bottom: 12px; }
.card--off { opacity: .55; border-style: dashed; }

.hist-list { list-style: none; display: grid; gap: 2px; max-height: 340px; overflow: auto; }
.hist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 4px; border-top: 1px solid var(--line);
}
.hist-row:first-child { border-top: 0; }
.hist-row b { font-size: 13px; font-weight: 700; margin-right: 8px; }
.hist-row .hint { font-size: 12.5px; }
.card__head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-size: 12px; font-weight: 700; color: var(--ink-40);
}
.card__head .x { margin-left: auto; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── 작품 상세: 웹툰 플랫폼처럼, 표지가 무대가 된다 ─────────────────────── */
.work-hero {
  position: relative; margin: 20px calc(-1 * var(--gut)) 0;
  border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line);
  /* 표지가 없어도 무대처럼 보이게: 위쪽에서 마그마가 한 번 번진다 */
  background:
    radial-gradient(110% 80% at 78% 0%, rgb(46 155 255 / .14), transparent 60%),
    linear-gradient(180deg, #1A1F25, #101318);
  color: #EDEBE6;
}
.work-hero::before {
  content: ''; position: absolute; inset: -40px;
  background: var(--hero-img, none) center / cover no-repeat;
  filter: blur(28px) saturate(1.1) brightness(.42);
}
.work-hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgb(14 17 20 / .15), rgb(14 17 20 / .82) 78%);
}
.work-hero__in {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 240px 1fr; gap: 34px;
  padding: 44px; align-items: end;
}
.work-hero__cover {
  aspect-ratio: 1/1; border-radius: var(--r-md);
  background: var(--art) center / cover no-repeat;
  box-shadow: 0 18px 44px -16px rgb(0 0 0 / .6);
  display: flex; align-items: center; justify-content: center;
}
.work-hero__tags { display: flex; gap: 6px; margin-bottom: 10px; }
.work-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .04em;
  padding: 4px 10px; border-radius: 20px;
  background: rgb(237 235 230 / .14); color: #EDEBE6;
  backdrop-filter: blur(4px);
}
.work-badge--official { background: var(--blue); color: #fff; }
.work-hero__ttl {
  font-size: clamp(26px, 4vw, 38px); font-weight: 900; letter-spacing: -0.03em;
  line-height: 1.15; color: #FDFCFA;
}
.work-hero__by { margin-top: 8px; font-size: 14px; font-weight: 600; color: rgb(237 235 230 / .72); }
.work-hero__desc {
  margin-top: 14px; max-width: 520px;
  font-size: 14.5px; line-height: 1.7; color: rgb(237 235 230 / .82);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.work-hero__cta { display: flex; gap: 8px; margin-top: 22px; }
.work-hero__cta .btn--ghost {
  background: rgb(237 235 230 / .12); color: #EDEBE6; backdrop-filter: blur(4px);
}
.work-hero__cta .btn--ghost:hover { background: rgb(237 235 230 / .2); }
.work-hero__stats {
  display: flex; gap: 16px; margin-top: 18px;
  font-size: 12px; font-weight: 600; color: rgb(237 235 230 / .55);
}
.work-body { max-width: 680px; padding: 30px 0 40px; display: grid; gap: 28px; }
.store-comments { max-width: 640px; }
.comment-form {
  display: grid; gap: 10px; margin-bottom: 24px;
  background: var(--surface); border-radius: var(--r-md); padding: 14px;
}
.comment-form textarea { width: 100%; resize: vertical; background: var(--bg); }
.comment-form .btn { justify-self: end; }
.comment-list { list-style: none; display: grid; gap: 10px; }
.comment {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; background: var(--bg);
}
.comment__head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.comment__head b { font-size: 13.5px; font-weight: 700; }
.comment__head span { font-size: 11.5px; color: var(--ink-40); }
.comment__head .linkish { margin-left: auto; }
.comment p { font-size: 14px; line-height: 1.6; color: var(--ink-60); }
.store-art {
  aspect-ratio: 1/1; border-radius: var(--r-lg); background: var(--ink) center / cover no-repeat;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px -14px rgb(0 0 0 / .35);
}
.get-card {
  background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px;
}

.plat-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 10px;
  font-size: 13px; font-weight: 600; color: var(--ink-60);
}
/* 좁아지면 셀렉트가 먼저 줄어야 한다 — 라벨이 「이 기 / 기」로 쪼개지지 않게 */
.plat-row > span { flex: none; white-space: nowrap; }
.plat-row select.inp { min-width: 0; flex: 1 1 auto; }
.plat-row select.inp { padding: 5px 26px 5px 10px; font-size: 12.5px; }

.social-btn { width: 100%; text-align: center; }
.social-btn .hint { font-weight: 500; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-card { background: var(--surface-2); border-radius: var(--r-lg); padding: 20px 22px; }
.stat-card b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; }
.stat-card span { font-size: 12.5px; color: var(--ink-40); font-weight: 500; }

.linkish { border: 0; background: none; color: var(--ink-40); font-size: 12px; text-decoration: underline; padding: 0; }
.linkish:hover { color: var(--red); }

/* ── 그림 올리는 자리 ────────────────── */
.art-slot {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  aspect-ratio: 1 / 1; cursor: pointer; overflow: hidden;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--r-md);
  transition: background .15s, border-color .15s;
}
.art-slot:hover { border-color: var(--blue); background: var(--blue-soft); }
.art-slot b { font-size: 13px; font-weight: 600; color: var(--ink-60); }
.art-slot .hint { font-size: 10.5px; text-align: center; padding: 0 8px; }
.art-slot.has { border-style: solid; border-color: var(--line); background: var(--surface-2); padding: 0; }
.art-slot img { width: 100%; height: 100%; object-fit: contain; }
.art-x {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: rgb(25 31 40 / .62); color: #fff;
  font-size: 11px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.art-x:hover { background: var(--red); }

/* 목록 속 작은 표지: 글씨 없이 색만 — 44px 칸에 제목을 넣으면 뭉갠 것만 보인다 */
.no--art { padding: 0; overflow: hidden; background-size: cover; background-position: center; }
.no--art img { width: 100%; height: 100%; object-fit: cover; }

.hud-logo { margin-left: auto; height: 26px; width: auto; max-width: 190px; object-fit: contain; }

.drop-zone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 32px 20px; text-align: center; cursor: pointer;
  background: var(--surface-2); border: 1.5px dashed var(--line); border-radius: var(--r-md);
  transition: background .15s, border-color .15s;
}
.drop-zone:hover { background: var(--surface); }
.drop-zone b { font-size: 14px; font-weight: 600; }
.drop-zone.over { border-color: var(--blue); background: var(--blue-soft); }
.drop-zone.has { border-style: solid; border-color: var(--blue); background: var(--blue-soft); }
.drop-zone.has b { color: var(--blue); }
textarea.inp.drop { border: 1.5px dashed var(--blue); background: var(--blue-soft); }

.report { background: var(--surface); color: var(--ink-60); border-radius: var(--r-md); padding: 12px 14px; font-size: 12.5px; line-height: 1.7; margin-bottom: 8px; }
.report b { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 4px; }
.report ul { margin: 0; padding-left: 16px; }
.report li { margin-top: 2px; }
.report--err  { background: #2E171A; color: #FF8A92; }
.report--warn { background: #2B2413; color: #E5C165; }
.report--ok   { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
[data-mode="day"] .report--err  { background: #fff0f1; color: #c53844; }
[data-mode="day"] .report--warn { background: #fff8e6; color: #9a6c14; }

.hint { font-size: 12.5px; color: var(--ink-40); line-height: 1.8; }
.hint code {
  font-family: var(--mono); font-size: 11px; color: var(--blue);
  background: var(--blue-soft); padding: 1px 5px; border-radius: 5px;
}

.toolbar {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 4px 0 14px;
}
.toolbar .spacer { flex: 1; }
.toolbar .saved {
  font-size: 12px; font-weight: 500; color: var(--ink-40);
  display: flex; align-items: center; gap: 6px;
}
.toolbar .saved::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--blue);
  animation: tekto-pulse 1.8s ease-in-out infinite;
}
@keyframes tekto-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
/* 저장이 안 되고 있으면 점부터 붉어진다. 초록빛 안심을 주면 안 된다. */
.toolbar .saved--bad { color: var(--red); font-weight: 700; }
.toolbar .saved--bad::before { background: var(--red); animation: none; }

/* 저장 실패 경보: 사라지지 않는다. 원고를 잃는 것보다 거슬리는 게 낫다. */
.save-alarm {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  max-width: calc(100vw - 32px);
  background: var(--surface); border: 1.5px solid var(--red);
  border-radius: var(--r-md); padding: 12px 16px;
  box-shadow: 0 18px 44px -18px rgb(0 0 0 / .9);
}
.save-alarm b { color: var(--red); font-size: 13px; font-weight: 800; flex: none; }
.save-alarm span { font-size: 12.5px; color: var(--ink-60); }

/* ── 로고·표지 만들기 ── */
dialog.dlg--wide { width: min(680px, calc(100vw - 40px)); }
.mk-stage {
  background:
    repeating-conic-gradient(var(--surface) 0% 25%, var(--surface-2) 0% 50%) 0 0 / 22px 22px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; display: flex; justify-content: center;
}
.mk-stage canvas { max-width: 100%; height: auto; border-radius: 6px; }
.mk-stage--logo canvas { max-height: 140px; }
.field span i { font-style: normal; font-family: var(--mono); color: var(--blue); margin-left: 4px; }

/* ── 새 화 알림 띠 ── */
.newep {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120%);
  z-index: 60; display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--blue);
  border-radius: var(--r-md); padding: 12px 14px;
  box-shadow: var(--glow), 0 18px 40px -18px rgb(0 0 0 / .9);
  transition: transform .32s cubic-bezier(.2,.8,.3,1);
}
.newep.is-in { transform: translate(-50%, 0); }
.newep b { color: var(--blue); font-size: 11.5px; font-weight: 800; flex: none; }
.newep span {
  font-size: 13px; color: var(--ink); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.newep__x {
  border: 0; background: transparent; color: var(--ink-40);
  font-size: 13px; padding: 4px 2px; flex: none;
}
.newep__x:hover { color: var(--ink); }

/* ── 연출: 글이 드러나는 동안 ── */
.prose.revealing::after {
  content: '▌'; color: var(--blue); font-weight: 400;
  animation: tekto-caret .7s steps(1) infinite;
}
@keyframes tekto-caret { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
/* 다 드러날 때까지 선택지는 조용히 기다린다 */
.choices.is-waiting, .ending.is-waiting {
  opacity: 0; pointer-events: none;
}
.choices, .ending { transition: opacity .28s ease; }
@media (prefers-reduced-motion: reduce) {
  /* 어지럼증·전정기관 문제가 있는 사람에게 움직임은 통증이다. 기기 설정을 그대로 따른다 */
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .choices.is-waiting, .ending.is-waiting { opacity: 1; pointer-events: auto; }
  .prose.revealing::after { display: none; }
  /* 애니메이션이 꺼진 환경에서 fade가 opacity:0에 멈춰 글이 안 보이는 일이 없게 */
  .fade { animation: none; }
}

/* 이어받기 수치 고르기 */
.carry-row { display: flex; gap: 6px; flex-wrap: wrap; }
.carry-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 8px; padding: 6px 11px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-60);
  transition: background .14s, color .14s, border-color .14s;
}
.carry-chip input { accent-color: var(--blue); }
.carry-chip.on { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); }

/* ── 연재: 시즌 묶음 ── */
.season {
  margin-top: 34px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2); overflow: hidden;
}
.season__head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.season__head h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.025em; }
.season__badge {
  font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 6px;
  background: var(--blue-soft); color: var(--blue);
}
.season__badge.is-done { background: var(--surface); color: var(--ink-40); }
.season__n { font-family: var(--mono); font-size: 11px; color: var(--ink-40); }
.season__eps { list-style: none; }
.season__ep {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line);
  transition: background .14s;
}
.season__eps li:first-child .season__ep { border-top: 0; }
.season__ep:hover { background: var(--raise); }
.season__no { font-family: var(--mono); font-size: 11.5px; color: var(--blue); font-weight: 700; }
.season__ttl { font-size: 14px; font-weight: 700; }
.season__mark { font-size: 11px; color: var(--ink-40); }
.season__ep.is-seen .season__ttl { color: var(--ink-60); }

/* 앞 화에서 이어졌다는 알림 */
.prev-ep {
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 18px;
  font-size: 13px; color: var(--ink-60); line-height: 1.7;
}
.prev-ep b { color: var(--blue); font-weight: 800; }
.prev-ep span { display: block; font-size: 12px; color: var(--ink-40); }
.play-bar .ep {
  font-size: 11.5px; font-weight: 700; color: var(--blue);
  background: var(--blue-soft); padding: 3px 9px; border-radius: 6px;
}

/* ── 엔딩 갤러리: 모은 칸은 빛나고, 못 본 칸은 비어 있다 ── */
.gal { padding-bottom: 40px; }
.gal__bar {
  height: 6px; border-radius: 6px; background: var(--surface);
  overflow: hidden; margin: 16px 0 18px;
}
.gal__bar i {
  display: block; height: 100%; border-radius: 6px;
  background: var(--blue); box-shadow: 0 0 12px rgb(46 155 255 / .7);
  transition: width .4s cubic-bezier(.2,.7,.3,1);
}
.gal__grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px;
}
.gal__card {
  display: grid; gap: 4px; align-content: start;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 14px 16px; min-height: 84px;
}
.gal__card--got {
  background: var(--blue-soft); border-color: var(--blue);
  box-shadow: 0 6px 20px -12px rgb(46 155 255 / .8);
}
.gal__no { font-family: var(--mono); font-size: 11px; color: var(--ink-40); }
.gal__card b { font-size: 15px; font-weight: 800; letter-spacing: -0.02em; }
.gal__card--got b { color: var(--blue); }
.gal__hidden { color: var(--ink-40); letter-spacing: .12em; }
.gal__tag { font-size: 11px; font-weight: 700; color: var(--ink-40); }
.gal__card--got .gal__tag { color: var(--blue); }

/* 갈 곳이 없을 땐 상자 대신 한 줄로만 알린다 */
.choices-none { padding: 4px 2px; font-size: 13px; color: var(--ink-40); }

/* 판 머리글: 제목은 절대 접히지 않고, 도구들은 자리가 모자라면 다음 줄로 */
.pane-head {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 6px;
}
.pane-head h2 { flex: none; white-space: nowrap; }
.pane-head .btn, .pane-head select { flex: none; white-space: nowrap; }

/* 미리보기는 카드가 아니라 '작은 게임 화면'이다. 실제로 굴러가는 곳처럼 보여야 한다. */
.mini-stage {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 18px; font-size: 14px;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .04), 0 12px 32px -18px rgb(0 0 0 / .9);
  min-height: 260px;
}
/* 플랫폼 기본 무대는 어둡게. 다만 작가가 테마를 고르면 그 색이 이겨야 한다:
   여기서 배경을 못 박으면 밝은 테마가 검은 바탕에 검은 글자로 보인다. */
.mini-stage:not(.themed) { background: linear-gradient(180deg, var(--stage-top), var(--stage-bot)); }
.mini-stage .prose { font-size: 14px; line-height: 1.85; }
.mini-stage .choices { margin-top: 18px; gap: 6px; }
.mini-stage .choices button {
  padding: 10px 12px; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background .14s, border-color .14s, transform .12s;
}
.mini-stage .choices button:not(:disabled):hover { transform: translateX(2px); }
.mini-stage .choices button:hover { background: var(--raise); border-color: var(--blue); }

/* ── 만드는 법 길잡이 ────────────────── */
.tutor {
  position: fixed; right: 24px; bottom: 24px; width: 340px; max-width: calc(100vw - 32px);
  background: var(--bg); border-radius: var(--r-lg); padding: 20px;
  box-shadow: 0 4px 12px rgb(0 0 0 / .08), 0 20px 48px -16px rgb(0 0 0 / .3);
  z-index: 60; animation: fade .3s cubic-bezier(.2,.7,.3,1) both;
}
.tutor__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tutor__no { font-size: 11.5px; font-weight: 700; color: var(--blue); }
.tutor__head b { font-size: 15.5px; font-weight: 700; letter-spacing: -0.02em; }
.tutor__x {
  margin-left: auto; border: 0; background: none; color: var(--ink-40);
  font-size: 13px; padding: 2px 4px; border-radius: 6px;
}
.tutor__x:hover { background: var(--surface); color: var(--ink); }
.tutor__body { font-size: 13.5px; color: var(--ink-60); line-height: 1.7; }
.tutor__look {
  margin-top: 10px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--blue-soft); color: var(--blue);
  font-size: 12.5px; font-weight: 600; line-height: 1.6;
}
.tutor__foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.tutor__dots { display: flex; gap: 4px; margin-right: auto; }
.tutor__dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tutor__dots i.on { background: var(--blue); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--ink); color: var(--bg); padding: 12px 22px;
  font-size: 13.5px; font-weight: 600; border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgb(0 0 0 / .18); z-index: 40;
  animation: fade .25s ease both;
}

dialog {
  border: 0; background: var(--bg); color: var(--ink);
  padding: 28px; max-width: 580px; width: 92%;
  border-radius: var(--r-lg); box-shadow: 0 20px 60px rgb(0 0 0 / .25);
  /* margin:auto 중앙 정렬은 내용이 뷰포트보다 길면 위로 붙어버린다:      그래서 위치는 transform으로 못박고, 넘치는 내용만 안에서 스크롤한다 */
  position: fixed; top: 50%; left: 50%; margin: 0;
  transform: translate(-50%, -50%);
  max-height: 86vh; overflow-y: auto;
}
dialog::backdrop { background: rgb(25 31 40 / .55); }

/* 작업대는 화면이 정말 좁아질 때까지 좌우를 지킨다.
   쓰는 곳과 굴러가는 곳이 동시에 보이는 게 이 도구의 전부라서. */
/* 대본 기호표: 넓으면 펼쳐 두고, 좁으면 접어 둔다 */
.cheat > summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700; color: var(--ink-60);
  padding: 8px 0; list-style: none;
}
.cheat > summary::-webkit-details-marker { display: none; }
.cheat > summary::before { content: '▸ '; color: var(--blue); }
.cheat[open] > summary::before { content: '▾ '; }

@media (max-width: 720px) {
  /* 손가락 화면에서는 세 칸을 못 세운다: 창을 풀고 예전처럼 위아래로 쌓아 굴린다 */
  body.studio-mode { overflow: auto; }
  .studio { height: auto; display: block; }
  .studio__work { display: block; }
  .studio__status { position: static; }
  .bench, .bench[data-ws] { display: block; }
  .pane-col { display: block; }
  .pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .pane__body { overflow: visible; }
  .pane-split { display: none; }
  /* activeWorkspace()가 이미 처음처럼으로 고정되지만, 스위처·설정 칩까지 숨겨야
     "누르면 뭔가 바뀌는데 화면은 그대로"인 혼란이 없다 */
  .seg.ws-switch, .ws-settings { display: none; }
  /* 장면 목록은 뺀다 — 장면은 그대로 구조도 카드로 옮겨 다닌다(지금까지 하던 방식) */
  .pane[data-pane="nav"] { display: none; }
  .ws-structure #paneMap { display: block; }
  .ws-structure #paneMap .map__body { max-height: 420px; }
  /* 폰에서 미리보기는 '확인용'이라 무대를 낮춘다 */
  .mini-stage { min-height: 180px; padding: 14px; }
  /* 두세 칸으로 나란히 둔 폼은 좁은 화면에서 한 칸씩 내려 쌓는다 */
  .row, .row--3 { grid-template-columns: 1fr; }
  /* 입력 글자가 16px보다 작으면 누를 때마다 iOS가 화면을 확대한다 */
  .inp, textarea.inp, select.inp, input, textarea, select { font-size: 16px; }
  .inp--mono { font-size: 15px; }
}

/* 터치 기기: 입력 글자가 16px보다 작으면 누를 때마다 화면이 확대된다.
   확대되면 되돌리기가 번거로워 글 쓰는 흐름이 매번 끊긴다. */
@media (pointer: coarse) {
  .inp, textarea.inp, select.inp, input, textarea, select { font-size: 16px; }
  .inp--mono { font-size: 15px; }
  /* 손가락은 화살표보다 뭉툭하다 — 누를 것은 최소 44px를 준다 */
  .chip, .btn--sm, .linkish, .my__tabs button, .colophon__links a {
    min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  }
  .chip--sort { min-height: 40px; }
  .face-btn { width: 40px; height: 40px; }
  .notice > summary { padding: 22px 2px; }
}

@media (max-width: 880px) {
  /* 좁은 화면에서 nav를 줄바꿈시키면 링크가 짜부라져 「스테/이지」처럼 글자가 쪼개진다.
     대신 로고와 nav를 위아래로 나누고, nav는 가로로 밀어 본다. */
  .masthead { flex-wrap: wrap; gap: 8px 12px; padding: 10px 0; }
  .masthead nav {
    order: 3; width: 100%; margin-left: 0; gap: 2px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  /* 찾기 칸은 로고 줄에 남는 자리를 쓴다. 프로필은 그 오른쪽. */
  .hunt { order: 2; flex: 1 1 120px; max-width: none; margin-left: 12px; }
  .hunt input { padding: 7px 10px 7px 30px; }
  .face-btn { order: 2; }
  .masthead nav::-webkit-scrollbar { display: none; }
  .masthead nav a { flex: none; white-space: nowrap; padding: 8px 11px; font-size: 13px; }
  .masthead nav a[aria-current]::after { left: 11px; right: 11px; }
  /* 좁은 화면에선 밝기 단추를 따로 두지 않는다 — 프로필 차림표 안에 같은 것이 있다 */
  .masthead .mode-btn { display: none; }
  h1 { font-size: 26px; }
  .prose { font-size: 16px; }
  .shelf a.entry { grid-template-columns: 1fr auto; }
  .shelf .no { display: none; }
  .feat { grid-template-columns: 1fr; padding: 28px 24px 26px; }
  .feat__art { max-width: 200px; }
  .feat__ttl { font-size: 25px; }
  .feat__nav { display: none; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .native-stage { height: 100dvh; }
  .work-hero__in { grid-template-columns: 1fr; gap: 20px; padding: 26px 22px; }
  .work-hero__cover { max-width: 180px; }
  .stat-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  /* 폰에서 배너는 위아래로 쌓지 않는다: 한 화면을 통째로 잡아먹어 아래 목록이 안 보인다.
     글 왼쪽, 표지 오른쪽으로 나란히 두고 표지를 엄지만 하게 줄인다. */
  .feat {
    grid-template-columns: 1fr 96px; gap: 16px; align-items: start;
    padding: 20px; min-height: 0;
  }
  .feat__body { min-height: 0; gap: 7px; }
  .feat__art { max-width: 96px; width: 96px; box-shadow: none; }
  .feat__ttl { font-size: 21px; }
  .feat__kicker { font-size: 10px; padding: 4px 8px; }
  .feat__quote {
    font-size: 13px; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .feat .btn--seal { margin-top: 10px !important; }
  .feat__count { position: static; justify-self: start; grid-column: 1; }
  .stage-catalog { padding-top: 8px; }
  .stage-discover { margin-top: 46px; padding: 26px 0; }
  .stage-official { margin-top: 42px; }
  .stage-section__head { margin-top: 46px; }
  .stage-section__head--row { display: block; }
  .stage-section__note { display: block; margin-top: 8px; }
  /* 설정 줄은 좁으면 단추를 아래로 내린다 — 나란히 두면 「이 기기」가 글자째 쪼개진다 */
  .my__set { flex-direction: column; align-items: flex-start; gap: 10px; }
  .my__set > :last-child { margin-left: 0; }
  .my__head { flex-wrap: wrap; }
  .my__head .btn { margin-left: auto; }
  /* 표지를 한 줄에 하나씩 두면 카드 하나가 화면을 다 먹는다 — 폰에서도 두 칸을 지킨다 */
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .album-ttl { font-size: 15px; }
  .album-dek {
    font-size: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}

/* ── 눌러서 고치기 ─────────────────────
   미리보기가 곧 편집기다. 누르면 잡히고, 슬라이더로 민다. */

.pv-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pv-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.pv-foot .hint { font-size: 11px; }

.seg { display: inline-flex; background: var(--surface); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-40);
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: -0.02em;
  padding: 6px 10px; border-radius: 7px; transition: background .15s, color .15s;
}
.seg button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .06); }
.seg--sm button { font-size: 11.5px; padding: 5px 9px; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }

.speed-row { display: flex; gap: 6px; margin-bottom: 4px; }
.speed-chip {
  flex: 1; padding: 8px 10px; border-radius: var(--r-sm); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-60); text-align: center;
}
.speed-chip:hover { background: var(--line); }
.speed-chip[aria-current="true"] { background: var(--ink); color: var(--bg); }

.skip-type {
  display: block; margin: -6px 0 14px; background: none; color: var(--ink-40);
  font-size: 12px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
.skip-type:hover { color: var(--ink); }

/* 고를 수 있는 상태: 얇은 점선이 「여기 누르면 잡혀요」라고 말한다 */
.pickable, .pickable .pick-on { cursor: pointer; }
.pickable .pick-on { outline: 1px dashed transparent; outline-offset: 3px; border-radius: 4px; transition: outline-color .12s, background .12s; }
.pickable .pick-on:hover { outline-color: color-mix(in srgb, var(--blue) 55%, transparent); }
.pickable .picked, .pickable.picked { outline: 2px solid var(--blue) !important; outline-offset: 3px; }
.pickable .choices button:disabled { opacity: .55; }

/* 그 자리에서 고쳐 쓰기 */
.pv-edit {
  width: 100%; font: inherit; color: inherit; background: color-mix(in srgb, var(--blue) 7%, transparent);
  border: 0; border-left: 2px solid var(--blue); border-radius: 4px;
  padding: 4px 8px; outline: none; resize: none; display: block;
}
.pv-edit--title { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: none; margin-bottom: 10px; }
.pv-edit--prose { font-size: 14px; line-height: 1.85; min-height: 90px; white-space: pre-wrap; }
.pv-edit--choice { font-size: 13.5px; font-weight: 600; }

/* ── 인스펙터 ── */
.insp-hint {
  margin-top: 12px; font-size: 12px; line-height: 1.7; color: var(--ink-40);
  background: var(--surface); border-radius: var(--r-md); padding: 12px 14px;
}
.insp { margin-top: 12px; background: var(--surface); border-radius: var(--r-md); padding: 12px; }
.insp__head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.insp__tag { font-size: 12.5px; font-weight: 700; letter-spacing: -0.02em; }
.insp__sel { font-family: var(--mono); font-size: 10px; color: var(--ink-40); }
.insp__body { display: flex; flex-direction: column; gap: 2px; }

.ifld { padding: 8px 6px; border-radius: 8px; }
.ifld.on { background: color-mix(in srgb, var(--blue) 8%, transparent); }
.ifld__top { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.ifld__lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-60); }
.ifld__val { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-40); }
.ifld__x {
  border: 0; background: none; cursor: pointer; color: var(--ink-40);
  font-size: 10px; line-height: 1; padding: 3px 4px; border-radius: 4px;
}
.ifld__x:hover { background: var(--line); color: var(--ink); }
.ifld__switch { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ifld__sel { font-size: 12px; padding: 6px 8px; }

.ifld__rng, .hsl__s { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: none; cursor: pointer; }
.ifld__rng::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line); }
.hsl__s::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: var(--track); }
.ifld__rng::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line); }
.hsl__s::-moz-range-track { height: 8px; border-radius: 4px; background: var(--track); }
.ifld__rng::-webkit-slider-thumb, .hsl__s::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 15px; height: 15px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--ink); margin-top: -5.5px;
  box-shadow: 0 1px 3px rgb(0 0 0 / .22);
}
.hsl__s::-webkit-slider-thumb { margin-top: -3.5px; }
.ifld__rng::-moz-range-thumb, .hsl__s::-moz-range-thumb {
  width: 15px; height: 15px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / .22);
}
.hsl { display: flex; flex-direction: column; gap: 2px; }
.ifld__hex {
  margin-left: auto; width: 74px; font-family: var(--mono); font-size: 10.5px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  border-radius: 6px; padding: 3px 5px; outline: none;
}
.ifld__hex:focus { border-color: var(--blue); }
.ifld__chip { width: 18px; height: 18px; border-radius: 6px; border: 1px solid var(--line); flex: none; }

/* ── 장면의 그림과 소리 ── */
.scene-art {
  display: block; width: 100%; max-height: 220px; object-fit: cover;
  border-radius: var(--r-md); margin: 20px 0;
}
.art-slot--wide { aspect-ratio: 16 / 9; }
.sound-slot {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; aspect-ratio: 16 / 9; cursor: pointer; overflow: hidden; text-align: center;
  background: var(--surface); border: 1.5px dashed var(--line); border-radius: var(--r-md);
}
.sound-slot:hover { border-color: var(--blue); background: var(--blue-soft); }
.sound-slot b { font-size: 12.5px; font-weight: 600; color: var(--ink-60); padding: 0 10px; }
.sound-slot .hint { font-size: 10.5px; }
.sound-slot.has { border-style: solid; }

.code-peek {
  margin-top: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.6;
  background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px;
  white-space: pre-wrap; color: var(--ink-60); max-height: 260px; overflow: auto;
}

@media (max-width: 900px) {
  .pv-bar { flex-wrap: wrap; }
  .insp { padding: 10px; }
}
