/* MoeChat UI: content-first dark. Achromatic surfaces, one rose accent, the artwork does the talking. */
:root {
  --bg: #0c0c0e;
  --bg-2: #111114;
  --surface: #16161a;
  --surface-2: #1d1d22;
  --surface-3: #26262c;
  --card: var(--surface);
  --card-2: var(--surface-2);
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #f1f1f3;
  --text-2: #a6a6b0;
  --text-3: #6f6f7a;
  --accent: #ec5f79;
  --accent-hover: #f17a90;
  --accent-ink: #1a0b10;
  --accent-soft: rgba(236, 95, 121, .12);
  --accent-line: rgba(236, 95, 121, .35);
  --accent-2: var(--accent);
  --accent-grad: var(--accent);
  --good: #4ccf95;
  --warn: #e9b35a;
  --bad: #ef6a6a;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 16px 40px -12px rgba(0, 0, 0, .6);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --topbar-h: 60px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: "Wanted Sans Variable", "Wanted Sans", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 15px; line-height: 1.6; letter-spacing: -.005em; -webkit-font-smoothing: antialiased;
  min-height: 100vh; word-break: keep-all; overflow-wrap: anywhere;
}
body::before { /* film grain, fixed and inert */
  content: ''; position: fixed; inset: 0; z-index: 1000; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.ph, .ph-fill { line-height: 1; vertical-align: -.125em; }
::selection { background: rgba(236, 95, 121, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a2a31; border-radius: 10px; border: 2px solid var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tnum { font-variant-numeric: tabular-nums; }

/* Topbar */
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); background: rgba(12, 12, 14, .82); backdrop-filter: blur(16px) saturate(1.2); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1280px; margin: 0 auto; height: 100%; display: flex; align-items: center; gap: 28px; padding: 0 24px; }
.logo { display: flex; align-items: baseline; font-size: 21px; font-weight: 800; letter-spacing: -.045em; }
.logo i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 2px; font-style: normal; }
.nav { display: flex; gap: 2px; }
.nav a { position: relative; padding: 7px 12px; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: color .15s, background .15s; }
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.search { position: relative; flex: 1; max-width: 300px; margin-left: auto; }
.search::before { content: "\e30c"; font-family: "Phosphor"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 16px; pointer-events: none; }
.search input { width: 100%; height: 38px; border-radius: 999px; background: var(--surface); border: 1px solid transparent; padding: 0 16px 0 38px; outline: none; transition: .15s; }
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--line-2); background: var(--surface-2); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.jelly { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px 0 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; font-variant-numeric: tabular-nums; cursor: pointer; transition: .15s; }
.jelly .ph-fill { color: var(--accent); font-size: 15px; }
.jelly:hover { border-color: var(--line-2); }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; border: 1px solid var(--line-2); cursor: pointer; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; padding: 0; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.bottombar { display: none; }

.app { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; min-height: calc(100vh - var(--topbar-h)); }
.app.full { max-width: none; padding: 0; height: calc(100dvh - var(--topbar-h)); min-height: 0; overflow: hidden; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-weight: 650; cursor: pointer; transition: background .15s, border-color .15s, transform .15s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary, .btn.grad { background: var(--accent); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover, .btn.grad:hover { background: var(--accent-hover); }
.btn.light { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 700; }
.btn.light:hover { background: #fff; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.xs { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.lg { height: 50px; padding: 0 24px; font-size: 16px; }
.btn.block { width: 100%; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 17px; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13.5px; font-weight: 650; color: var(--text-2); }
.field .hint, .hint { font-size: 12.5px; color: var(--text-3); }
.input, .textarea, .select { width: 100%; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 13px; outline: none; transition: .15s; }
.textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.check { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; cursor: pointer; transition: .2s; }
.switch span::after { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s var(--ease); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

/* Common */
.section { margin: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.035em; }
.section-head .sub { margin: 4px 0 0; color: var(--text-3); font-size: 13.5px; }
.section-head .more { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-size: 13.5px; font-weight: 600; transition: color .15s; }
.section-head .more:hover { color: var(--text); }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -.04em; margin: 0 0 6px; }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.chip.accent, .chip.pink { background: var(--accent-soft); color: #f6a3b3; }
.chip.btn-chip { cursor: pointer; border: 1px solid var(--line); background: transparent; transition: .15s; height: 34px; padding: 0 14px; font-size: 13.5px; }
.chip.btn-chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.btn-chip.active { background: var(--text); color: var(--bg); border-color: transparent; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pill b { font-weight: 700; color: var(--text); }
.stat { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.empty { text-align: center; padding: 64px 20px; color: var(--text-3); }
.empty .big { font-size: 40px; margin-bottom: 10px; color: var(--text-3); }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.spinner { width: 26px; height: 26px; border: 2px solid var(--surface-3); border-top-color: var(--text); border-radius: 50%; animation: spin .8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs button { background: none; border: none; padding: 11px 14px; font-weight: 650; color: var(--text-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.segmented button { border: none; background: none; height: 30px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer; transition: .15s; }
.segmented button:hover { color: var(--text); }
.segmented button.active { background: var(--surface-3); color: var(--text); }

/* Scroll reveal (only when JS marks it, so no-JS content stays visible) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* Spotlight hero */
.spot { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 40px; align-items: center; min-height: 460px; padding: 8px 0 28px; isolation: isolate; }
.spot-wash { position: absolute; inset: -28px -24px 0; z-index: -1; overflow: hidden; pointer-events: none; }
.spot-wash img { position: absolute; right: -5%; top: -20%; width: 70%; height: 140%; object-fit: cover; filter: blur(80px) saturate(1.1); opacity: .28; transition: opacity .8s var(--ease); }
.spot-wash::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 25%, transparent 80%), linear-gradient(0deg, var(--bg), transparent 40%); }
.spot-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.spot-world { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: 13.5px; font-weight: 650; color: var(--text-2); transition: color .15s; }
.spot-world:hover { color: var(--text); }
.spot-world .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--wc, var(--accent)); }
.spot-name { margin: 0; font-size: clamp(44px, 6.4vw, 84px); line-height: .98; font-weight: 800; letter-spacing: -.06em; }
.spot-title { margin: 0; font-size: 19px; font-weight: 650; letter-spacing: -.025em; color: var(--text); max-width: 34ch; }
.spot-tagline { margin: 0; color: var(--text-2); font-size: 15.5px; line-height: 1.65; max-width: 46ch; }
.spot-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--text-3); font-size: 13px; }
.spot-meta span { display: inline-flex; align-items: center; gap: 5px; }
.spot-cta { display: flex; gap: 8px; margin-top: 8px; }
.spot-anim > * { animation: rise .6s var(--ease) both; }
.spot-anim > *:nth-child(2) { animation-delay: .04s; } .spot-anim > *:nth-child(3) { animation-delay: .08s; }
.spot-anim > *:nth-child(4) { animation-delay: .12s; } .spot-anim > *:nth-child(5) { animation-delay: .16s; } .spot-anim > *:nth-child(6) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.spot-art { position: relative; justify-self: end; width: min(100%, 440px); }
.spot-frame { position: relative; display: block; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.spot-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .16s var(--ease), transform 1.2s var(--ease); }
.spot-frame:hover img { transform: scale(1.03); }
.spot-frame img.fade { opacity: 0; }
.spot-faces { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 6px; padding: 5px; border-radius: 14px; background: rgba(12, 12, 14, .6); backdrop-filter: blur(12px); }
.spot-faces button { width: 40px; height: 40px; padding: 0; border-radius: 9px; overflow: hidden; border: 1.5px solid transparent; cursor: pointer; background: var(--surface-2); opacity: .7; transition: .15s; }
.spot-faces button:hover, .spot-faces button.on { opacity: 1; border-color: var(--text); }
.spot-faces img { width: 100%; height: 100%; object-fit: cover; }
.spot-picker { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
.spot-pick { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 10px 14px; border: none; background: none; text-align: left; cursor: pointer; color: var(--text-3); min-width: 0; transition: color .2s; }
.spot-pick img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; filter: grayscale(.6); opacity: .7; transition: .2s; }
.spot-pick span { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spot-pick:hover, .spot-pick.on { color: var(--text); }
.spot-pick:hover img, .spot-pick.on img { filter: none; opacity: 1; }
.spot-pick::before, .spot-progress { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 2px; border-radius: 2px; }
.spot-pick::before { background: var(--line-2); }
.spot-progress { background: var(--text); transform-origin: left; transform: scaleX(0); }
.spot-pick.on .spot-progress { animation: progress var(--dur, 7s) linear forwards; }
.spot.paused .spot-pick.on .spot-progress { animation-play-state: paused; }
@keyframes progress { to { transform: scaleX(1); } }

/* Worlds bento */
.bento { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: repeat(2, minmax(200px, auto)); gap: 12px; }
.bento > :first-child { grid-row: span 2; }
.wtile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 24px; border-radius: 18px; overflow: hidden; background: var(--surface); isolation: isolate; min-height: 200px; }
.wtile .bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.wtile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12,12,14,.05) 0%, rgba(12,12,14,.55) 50%, rgba(12,12,14,.94) 100%); }
.wtile:hover .bg { transform: scale(1.04); }
.wtile .count { font-size: 12.5px; font-weight: 650; color: rgba(255,255,255,.72); font-variant-numeric: tabular-nums; }
.wtile h3 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -.035em; }
.bento > :first-child h3 { font-size: 30px; }
.wtile p { margin: 0; max-width: 52ch; color: rgba(255,255,255,.72); font-size: 14px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wtile .faces { position: absolute; right: 18px; top: 18px; display: flex; }
.wtile .faces img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; margin-left: -8px; border: 2px solid rgba(12,12,14,.9); }
.wtile .go { position: absolute; right: 20px; bottom: 22px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); backdrop-filter: blur(8px); transition: .2s var(--ease); }
.wtile:hover .go { background: var(--text); color: var(--bg); }
.wtile p { padding-right: 52px; }

/* Ranking chart */
.chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, auto); grid-auto-flow: column; column-gap: 40px; }
.chart-row { display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 10px; margin: 0 -10px; border-radius: 12px; transition: background .15s; }
.chart-row:hover { background: var(--surface); }
.chart-row .no { font-size: 17px; font-weight: 750; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.chart-row:nth-child(-n+3) .no { color: var(--text); }
.chart-row img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.chart-row .t { font-weight: 650; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-row .s { font-size: 13px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-row .n { display: inline-flex; font-size: 16px; color: var(--text-3); opacity: 0; transform: translate(-4px, 4px); transition: .2s var(--ease); }
.chart-row:hover .n { opacity: 1; transform: none; color: var(--text); }

/* Character cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 28px 16px; }
.ccard { display: flex; flex-direction: column; gap: 4px; cursor: pointer; min-width: 0; }
.ccard .thumb { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface); margin-bottom: 8px; }
.ccard .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), opacity .35s var(--ease); }
.ccard .thumb img.alt { opacity: 0; }
.ccard:hover .thumb img { transform: scale(1.04); }
.ccard:hover .thumb img.alt { opacity: 1; }
.ccard .thumb .rank { position: absolute; left: 10px; bottom: 6px; font-size: 40px; font-weight: 800; line-height: 1; letter-spacing: -.05em; color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,.55); font-variant-numeric: tabular-nums; }
.ccard .world { font-size: 12px; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ccard .title { font-weight: 650; font-size: 15px; line-height: 1.4; letter-spacing: -.02em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccard .tagline { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; }
.ccard .meta { display: flex; align-items: center; gap: 10px; margin-top: 2px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.ccard .meta span { display: inline-flex; align-items: center; gap: 3px; }
.row-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 180px; gap: 16px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.row-cards::-webkit-scrollbar { display: none; }
.row-cards > * { scroll-snap-align: start; }

/* World cards (worlds page) */
.worlds { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.wcard { position: relative; border-radius: 18px; overflow: hidden; padding: 22px; min-height: 200px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; background: var(--surface); cursor: pointer; isolation: isolate; }
.wcard::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 20%, rgba(12,12,14,.92)); }
.wcard .avatars { position: absolute; right: 18px; top: 18px; display: flex; }
.wcard .avatars img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(12,12,14,.9); margin-left: -8px; object-fit: cover; }
.wcard h3 { margin: 0; font-size: 20px; letter-spacing: -.03em; }
.wcard p { margin: 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wcard .chip { background: rgba(0,0,0,.4); backdrop-filter: blur(6px); color: var(--text); }
.wcover { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center; opacity: .75; transition: transform 1s var(--ease); }
.wcard:hover .wcover { transform: scale(1.04); }

/* Character detail */
.detail { position: relative; display: grid; grid-template-columns: 360px 1fr; gap: 44px; align-items: start; }
.detail-img { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-info { display: flex; flex-direction: column; gap: 12px; min-height: 480px; padding-top: 18px; }
.detail-info h1 { margin: 0; font-size: 38px; line-height: 1.18; letter-spacing: -.05em; font-weight: 800; text-wrap: balance; }
.creator { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.creator .av { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--text); overflow: hidden; }
.creator .av img { width: 100%; height: 100%; object-fit: cover; }
.detail-actions { margin-top: auto; display: flex; gap: 10px; }
.detail-actions .btn.grad { flex: 1; }
.desc-box { margin-top: 40px; }
.desc-box h2 { font-size: 19px; margin: 0 0 12px; letter-spacing: -.03em; }
.desc-box .body { white-space: pre-wrap; color: #d6d6dc; line-height: 1.8; max-width: 72ch; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; height: 100%; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); position: relative; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: rgba(12,12,14,.7); backdrop-filter: blur(12px); }
.chat-head .av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.chat-head .name { font-weight: 700; font-size: 15.5px; }
.chat-head .sub { font-size: 12.5px; color: var(--text-3); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 28px 0 30px; scroll-behavior: smooth; }
.chat-inner { max-width: 760px; margin: 0 auto; padding: 0 22px; display: flex; flex-direction: column; gap: 24px; }
.msg { display: flex; gap: 12px; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.msg .av { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex: none; }
.msg .content { min-width: 0; flex: 1; }
.msg .who { font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 5px; }
.msg .bubble { font-size: var(--chat-fs, 15.5px); line-height: var(--chat-lh, 1.85); font-family: var(--chat-ff, inherit); color: #e6e6ea; word-break: keep-all; overflow-wrap: anywhere; }
.msg .bubble p { margin: 0 0 .75em; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg .bubble em.act { font-style: normal; color: #93939d; }
.msg .bubble .dlg { color: #fff; font-weight: 500; }
.msg .bubble blockquote { margin: .6em 0; padding: 8px 12px; border-left: 2px solid var(--line-2); background: var(--surface); border-radius: 0 8px 8px 0; color: var(--text-2); font-size: 14px; }
.msg.user { flex-direction: row-reverse; }
.msg.user .content { display: flex; flex-direction: column; align-items: flex-end; }
.msg.user .bubble { background: var(--surface-2); color: var(--text); padding: 11px 16px; border-radius: 18px 18px 4px 18px; max-width: 85%; }
.msg.user .bubble em.act { color: var(--text-2); }
.msg.user .bubble .dlg { color: #fff; }
.msg-tools { display: flex; gap: 2px; margin-top: 6px; opacity: 0; transition: .15s; }
.msg:hover .msg-tools, .msg.last .msg-tools { opacity: 1; }
.msg-tools button { background: none; border: none; color: var(--text-3); font-size: 12.5px; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.msg-tools button:hover { background: var(--surface-2); color: var(--text); }
.status-card { margin-top: 14px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px 16px; font-size: 13px; }
.status-card .k { color: var(--text-3); font-size: 11.5px; font-weight: 650; }
.status-card .v { color: var(--text); font-weight: 600; }
.status-card .full { grid-column: 1 / -1; }
.gauge { height: 5px; background: rgba(255,255,255,.08); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.gauge > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .6s var(--ease); }
.choices { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.choices button { text-align: left; padding: 11px 15px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 14.5px; transition: .15s; display: flex; gap: 10px; align-items: center; }
.choices button::before { content: "\e13a"; font-family: "Phosphor"; color: var(--text-3); transition: .15s; }
.choices button:hover { background: var(--surface); border-color: var(--accent-line); }
.choices button:hover::before { color: var(--accent); transform: translateX(2px); }
.typing { display: inline-flex; gap: 4px; padding: 8px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.cursor::after { content: '▍'; animation: blink 1s infinite; color: var(--accent); margin-left: 2px; }
.composer { padding: 12px 18px 18px; border-top: 1px solid var(--line); background: var(--bg); }
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer-box { display: flex; gap: 10px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; padding: 7px 7px 7px 18px; transition: .15s; }
.composer-box:focus-within { border-color: rgba(255,255,255,.22); }
.composer-box textarea { flex: 1; background: none; border: none; outline: none; resize: none; max-height: 180px; min-height: 26px; padding: 8px 0; line-height: 1.5; }
.composer-box .send { width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--accent); color: var(--accent-ink); font-size: 18px; cursor: pointer; flex: none; transition: .15s; }
.composer-box .send:hover { background: var(--accent-hover); }
.composer-box .send:disabled { opacity: .35; cursor: not-allowed; }
.composer-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-3); margin-top: 8px; padding: 0 6px; gap: 10px; }
.composer-meta .tip b { color: var(--text-2); }
.model-select { background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; outline: none; }
.chat-side { overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 16px; background: var(--bg-2); }
.chat-side > * { flex-shrink: 0; }
.chat-side .portrait { display: block; border-radius: 16px; overflow: hidden; aspect-ratio: 1; }
.chat-side .portrait img { width: 100%; height: 100%; object-fit: cover; animation: fade .35s ease; }
.side-block { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.side-block h4 { margin: 0 0 10px; font-size: 13px; color: var(--text-2); display: flex; justify-content: space-between; align-items: center; }
.affection-big { font-size: 28px; font-weight: 800; letter-spacing: -.04em; color: var(--text); font-variant-numeric: tabular-nums; }

/* Chat list */
.chat-list { display: flex; flex-direction: column; gap: 2px; }
.chat-item { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.chat-item:hover { background: var(--surface); }
.chat-item img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-item .t { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.chat-item .l { font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Studio */
.studio { display: grid; grid-template-columns: 1fr 300px; gap: 28px; align-items: start; }
.studio .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-bottom: 16px; }
.studio .panel h3 { margin: 0 0 4px; font-size: 17px; letter-spacing: -.02em; }
.studio .panel > .hint { margin: 0 0 18px; }
.studio .sticky { position: sticky; top: calc(var(--topbar-h) + 20px); display: flex; flex-direction: column; gap: 14px; }
.img-upload { position: relative; width: 150px; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1.5px dashed var(--line-2); display: grid; place-items: center; cursor: pointer; background: var(--bg-2); color: var(--text-3); font-size: 13px; text-align: center; }
.img-upload img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.img-upload input { display: none; }
.lore-item, .sf-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 10px; background: var(--bg-2); }
.tag-input { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 7px 9px; }
.tag-input input { flex: 1; min-width: 100px; background: none; border: none; outline: none; padding: 3px; }
.tag-input .chip button { background: none; border: none; color: inherit; cursor: pointer; padding: 0 0 0 3px; opacity: .6; }
.counter { font-size: 11.5px; color: var(--text-3); text-align: right; margin-top: -2px; }

/* Image pack */
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin-top: 8px; }
.pack-slot { display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; }
.pack-img { width: 100%; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); display: grid; place-items: center; font-size: 12px; }
.pack-img img { width: 100%; height: 100%; object-fit: cover; }
.pack-label { font-weight: 700; font-size: 13px; }
.pack-slot .row { flex-wrap: wrap; }
.pack-slot .btn.xs { padding: 0 7px; font-size: 12px; }
.emo-inline { display: none; width: 150px; aspect-ratio: 1; border-radius: 14px; overflow: hidden; margin: 4px 0 10px; animation: fadeUp .3s ease; }
.emo-inline img { width: 100%; height: 100%; object-fit: cover; }

/* Shop */
.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pkg { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; transition: border-color .2s; }
.pkg:hover { border-color: var(--line-2); }
.pkg .jelly-ico { font-size: 30px; color: var(--accent); }
.pkg .amount { font-size: 28px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.pkg .bonus { color: var(--accent); font-weight: 650; font-size: 13.5px; }
.pkg .badge { position: absolute; top: 14px; right: 14px; font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--text); color: var(--bg); }
.pkg .btn { align-self: stretch; margin-top: 8px; }
.checkin { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 28px; }
.checkin .ico { font-size: 32px; color: var(--accent); }

/* Modal & toast */
.modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.66); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow); animation: pop .22s var(--ease); }
.modal.wide { max-width: 640px; }
@keyframes pop { from { transform: translateY(6px) scale(.98); opacity: 0; } }
.modal h2 { margin: 0 0 6px; font-size: 21px; letter-spacing: -.035em; }
.modal-close { float: right; background: none; border: none; color: var(--text-3); font-size: 22px; cursor: pointer; line-height: 1; }
#toast-root { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--surface-3); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow); animation: pop .2s; pointer-events: auto; }
.toast.error { border-color: rgba(239,106,106,.45); color: #ffc2c2; }
.toast.success { border-color: rgba(76,207,149,.4); }

/* Tables (admin/me) */
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--text-3); font-weight: 650; font-size: 12.5px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 26px; }
.stats .card { padding: 16px 18px; }
.stats .n { font-size: 26px; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.plus { color: var(--good); } .minus { color: var(--bad); }

/* Chat extras */
.swipe { display: inline-flex; align-items: center; gap: 2px; margin-right: 4px; font-size: 12.5px; color: var(--text-2); }
.swipe button:disabled { opacity: .3; cursor: default; }
.composer-box .send.stop { background: var(--surface-3); color: var(--text); font-size: 15px; }
.scene-img { display: block; margin-top: 12px; width: 100%; max-width: 560px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; border: none; padding: 0; background: var(--surface); cursor: zoom-in; }
.scene-img img { width: 100%; height: 100%; object-fit: cover; }
.scene-img.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: default; background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sk 1.4s infinite; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; animation: fade .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.lightbox button { position: absolute; top: 14px; right: 18px; background: none; border: none; color: #fff; font-size: 34px; cursor: pointer; }
.stage-up { text-align: center; }
.stage-up .big { font-size: 48px; animation: pop .5s var(--ease); }
.stage-up img { width: 160px; height: 160px; object-fit: cover; border-radius: 18px; margin: 14px auto 0; }
.clamp4 { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* Streak */
.stamps { display: flex; gap: 6px; margin-top: 10px; }
.stamps span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 750; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--text-3); font-variant-numeric: tabular-nums; }
.stamps span.on { background: var(--accent); border: none; color: var(--accent-ink); }
.stamps span.gift { border-color: var(--accent-line); }

/* Album */
.album-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.album-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.album-head img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.album-grid .cell { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: none; cursor: zoom-in; padding: 0; }
.album-grid .cell img { width: 100%; height: 100%; object-fit: cover; }
.album-grid .cell.locked { cursor: default; display: grid; place-items: center; background: var(--bg-2); border: 1px dashed var(--line-2); color: var(--text-3); font-size: 20px; }
.album-grid .cell .lbl { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; font-weight: 650; padding: 3px 6px; background: linear-gradient(transparent, rgba(0,0,0,.7)); text-align: left; color: #fff; }
.album-grid.scenes { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.album-grid.scenes .cell { aspect-ratio: 4 / 3; }
.progress-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }

/* Footer & docs */
.footer { border-top: 1px solid var(--line); margin-top: 40px; }
body.in-chat .footer { display: none; }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 28px 24px 90px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.footer-inner b { color: var(--text-2); }
.footer-links { display: flex; gap: 18px; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }
.doc { max-width: 760px; line-height: 1.8; color: #d6d6dc; }
.doc h2 { margin-top: 30px; font-size: 18px; letter-spacing: -.02em; }
.doc .draft { border: 1px solid rgba(233,179,90,.35); background: rgba(233,179,90,.07); padding: 12px 16px; border-radius: 12px; font-size: 13.5px; }

/* Responsive */
@media (max-width: 1024px) {
  .chat-layout { grid-template-columns: minmax(0, 1fr); }
  .chat-side { display: none; }
  .emo-inline { display: block; }
  .studio { grid-template-columns: 1fr; }
  .studio .sticky { position: static; }
  .spot { grid-template-columns: minmax(0, 1fr) minmax(0, .8fr); gap: 28px; }
  .chart { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; }
}
@media (max-width: 760px) {
  :root { --topbar-h: 54px; }
  .nav, .search { display: none; }
  .topbar-inner { padding: 0 16px; }
  .topbar-right { margin-left: auto; }
  .app { padding: 16px 16px 96px; }
  .section { margin: 44px 0; }
  .section-head h2 { font-size: 20px; }
  .bottombar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; background: rgba(12,12,14,.92); backdrop-filter: blur(16px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .bottombar a { flex: 1; display: flex; flex-direction: column; align-items: center; font-size: 10.5px; color: var(--text-3); gap: 3px; font-weight: 600; padding-top: 2px; }
  .bottombar a i { font-size: 22px; }
  .bottombar a .ph-fill { display: none; }
  .bottombar a.active { color: var(--text); }
  .bottombar a.active .ph { display: none; }
  .bottombar a.active .ph-fill { display: inline-block; }
  body.in-chat .bottombar { display: none; }
  .composer-meta .tip { display: none; }
  .composer { padding: 10px 12px 12px; }
  .spot { grid-template-columns: 1fr; gap: 18px; min-height: 0; padding-top: 0; }
  .spot-art { order: -1; justify-self: stretch; width: 100%; }
  .spot-frame { aspect-ratio: 4 / 3.4; border-radius: 18px; }
  .spot-wash { inset: -16px -16px 0; }
  .spot-name { font-size: 44px; }
  .spot-title { font-size: 17px; }
  .spot-tagline { font-size: 14.5px; }
  .spot-cta .btn { flex: 1; }
  .spot-picker { display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; margin: 0 -16px; padding: 0 12px; }
  .spot-picker::-webkit-scrollbar { display: none; }
  .spot-pick { flex: none; }
  .spot-pick span { display: none; }
  .spot-pick.on span { display: inline; }
  .bento { grid-template-columns: 1fr; grid-template-rows: none; }
  .bento > :first-child { grid-row: auto; min-height: 280px; }
  .bento > :first-child h3 { font-size: 24px; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .row-cards { grid-auto-columns: 150px; margin: 0 -16px; padding: 0 16px 8px; scroll-padding: 0 16px; }
  .detail { grid-template-columns: 1fr; gap: 20px; }
  .detail-img { max-width: 360px; margin: 0 auto; width: 100%; }
  .detail-info { min-height: 0; }
  .detail-actions { position: sticky; bottom: 78px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .chat-inner { padding: 0 14px; }
  .msg .av { width: 32px; height: 32px; }
  .page-title { font-size: 24px; }
  .modal { padding: 22px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .spot-pick.on .spot-progress { transform: scaleX(1); }
}
.studio-ico { display: grid; place-items: center; width: 56px; height: 56px; flex: none; border-radius: 14px; background: var(--surface-2); font-size: 26px; color: var(--text); }
.stage-up .big { color: var(--accent); }
.chip .ph, .chip .ph-fill, .btn .ph, .btn .ph-fill { font-size: 1.05em; }
.side-block .status-card { border: none; background: none; padding: 0; margin-top: 0; }

/* Voice lines: speech bubble over the portrait */
.detail-img img { transition: opacity .16s var(--ease); }
.detail-img img.fade { opacity: 0; }
.detail-img.talkable { cursor: pointer; }
.detail-img.talkable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.line-bubble { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: flex-start; gap: 10px; padding: 12px 12px 12px 16px; border-radius: 16px; background: rgba(12, 12, 14, .72); backdrop-filter: blur(14px) saturate(1.2); border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .6); }
.line-bubble p { margin: 0; flex: 1; font-size: 14.5px; line-height: 1.6; color: var(--text); word-break: keep-all; }
.line-bubble.show { animation: bubbleIn .45s var(--ease) both; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.detail-img.speaking .line-bubble { border-color: var(--accent-line); }
.sound-btn { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255, 255, 255, .1); color: var(--text); cursor: pointer; font-size: 15px; transition: background .15s; }
.sound-btn:hover { background: rgba(255, 255, 255, .18); }
.sound-btn[aria-pressed="false"] { color: var(--text-3); }

/* Start-scenario picker */
.openings { display: flex; flex-direction: column; gap: 8px; }
.opening { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.opening:hover { background: var(--surface-2); border-color: var(--accent-line); }
.opening:disabled { opacity: .5; cursor: wait; }
.opening .no { font-size: 13px; font-weight: 750; color: var(--text-3); font-variant-numeric: tabular-nums; }
.opening b { display: block; font-size: 15px; letter-spacing: -.02em; }
.opening .pv { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.opening > .ph { color: var(--text-3); transition: transform .2s var(--ease), color .2s; }
.opening:hover > .ph { color: var(--accent); transform: translateX(3px); }

/* In-chat listen button */
.msg-tools button.on { color: var(--accent); }

/* Chat depth: composer tools, inner thoughts, events, prefs */
.composer-tools { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.composer-tools::-webkit-scrollbar { display: none; }
.composer-tools .tool { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.composer-tools .tool:hover { color: var(--text); border-color: rgba(255,255,255,.22); }
.composer-tools .tool:disabled { opacity: .5; cursor: wait; }
.composer-tools .tool .cost { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; }
.composer-tools .tool .cost::before { content: "젤리 "; color: var(--text-3); }
.composer-tools .tool.cmd { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--text); background: var(--surface); border-color: transparent; }
.suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.suggests .suggest { text-align: left; max-width: 100%; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 13.5px; line-height: 1.5; cursor: pointer; transition: border-color .15s; }
.suggests .suggest:hover { border-color: var(--accent-line); }
.suggests .suggest em.act { font-style: normal; color: var(--text-2); }
.suggests .suggest-x { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; border: none; background: none; color: var(--text-3); cursor: pointer; }
.cmd-chip { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: 6px; background: rgba(255,255,255,.08); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; font-weight: 600; }
.kind-tag { font-size: 11px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line-2); border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 1px; }
.msg .who .bm { color: var(--accent); font-size: 13px; vertical-align: -1px; }
.msg.is-event .bubble { background: transparent; border: 1px dashed var(--accent-line); }
.msg.flash .content { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { background: var(--accent-soft); border-radius: 12px; } 100% { background: transparent; } }
.inner-card { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border-left: 2px solid var(--accent); animation: fadeUp .3s ease; }
.inner-card .lbl { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #f6a3b3; margin-bottom: 4px; }
.inner-card p { margin: 0; font-size: calc(var(--chat-fs, 15.5px) - 1px); line-height: 1.75; color: var(--text); font-family: var(--chat-ff, inherit); }
.event-card .eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 6px; }
.event-card .situation { color: var(--text-2); line-height: 1.7; margin: 8px 0 18px; }
.event-pick { display: flex; flex-direction: column; gap: 8px; }
.event-pick .btn { height: auto; min-height: 46px; padding: 10px 16px; white-space: normal; line-height: 1.45; }
.menu-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.menu-list .btn { justify-content: flex-start; }
.prefs { margin-top: 12px; }
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pref-row .label { font-size: 14px; font-weight: 650; color: var(--text); }
.pref-row input[type=range] { flex: 1; max-width: 220px; accent-color: var(--accent); }
.segmented label { position: relative; }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label span { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 650; color: var(--text-2); cursor: pointer; transition: .15s; white-space: nowrap; }
.segmented label input:checked + span { background: var(--surface-3); color: var(--text); }
.segmented label input:focus-visible + span { outline: 2px solid var(--accent); }
.view-preview { margin: 14px 0 6px; padding: 14px 16px; border-radius: 12px; background: var(--bg); font-size: var(--chat-fs, 15.5px); line-height: var(--chat-lh, 1.85); font-family: var(--chat-ff, inherit); }
.view-preview p { margin: 0; }
.view-preview em.act { font-style: normal; color: #93939d; }
.view-preview .dlg { color: #fff; }
.pin-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 50vh; overflow-y: auto; }
.pin-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2); font-size: 14px; line-height: 1.5; }
.pin-item > .ph-fill { color: var(--accent); margin-top: 3px; }
.pin-item span { flex: 1; }
.icon-btn.sm { width: 28px; height: 28px; font-size: 14px; border: none; }
.pin-mini { margin: 0; padding-left: 16px; font-size: 13px; color: var(--text-2); line-height: 1.6; }
.saved-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.saved { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-size: 14px; line-height: 1.6; transition: border-color .15s; }
.saved:hover { border-color: var(--line-2); }
.saved .who { font-size: 12px; font-weight: 700; color: var(--text-3); }
.saved.inner { border-left: 2px solid var(--accent); }
.msg-tools button.on { color: var(--accent); }
@media (max-width: 760px) { .msg-tools { opacity: 1; flex-wrap: wrap; } }

/* ── 스튜디오 체크리스트 · 입력 접두어 ── */
.checklist { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 13px; }
.checklist li { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.checklist li i { color: #f5b14c; font-size: 15px; }
.checklist li.ok { color: var(--text); }
.checklist li.ok i { color: #4ade80; }
.input-prefix { display: grid; place-items: center; min-width: 34px; height: 42px; padding: 0 10px; border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); font-weight: 700; color: var(--accent); }
.input-prefix + .input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ── 캐릭터 페이지: 명령어 · 작가 코멘트 ── */
.cmd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cmd-card { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.cmd-card code { font-family: inherit; font-weight: 750; color: var(--accent); font-size: 14.5px; }
.cmd-card span { font-size: 13px; color: var(--text-2); line-height: 1.55; }
.author-note h2 { display: flex; align-items: center; gap: 8px; }
.author-note .body { white-space: pre-wrap; }

/* ═════════ 2차: 탐색 · 소셜 ═════════ */
.av { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; background: var(--surface-3); color: var(--text); font-weight: 800; font-size: 13px; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.clamp1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segmented.sm button { height: 26px; padding: 0 11px; font-size: 12.5px; }
.chip.xs { height: 20px; padding: 0 7px; font-size: 11px; }
a.creator { width: fit-content; border-radius: 999px; padding: 2px 10px 2px 2px; margin-left: -2px; transition: background .15s; }
a.creator:hover { background: var(--surface-2); color: var(--text); }
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line-2); color: var(--text-2); font-size: 13.5px; }

/* 취향 설정 */
.taste { display: flex; flex-direction: column; gap: 18px; max-height: min(62vh, 640px); overflow-y: auto; padding-right: 4px; }
.taste-block h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 750; color: var(--text); }
.taste-block summary { cursor: pointer; list-style: none; }
.taste-block summary::-webkit-details-marker { display: none; }
.taste-block summary::before { content: '▸ '; color: var(--text-3); }
.taste-block[open] summary::before { content: '▾ '; }
.chip.btn-chip.hide { background: transparent; color: var(--text-3); border-style: dashed; text-decoration: line-through; }
.taste-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--surface); }

/* 목록 관리 모달 */
.mlist { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.mrow { display: flex; align-items: center; gap: 12px; padding: 10px 8px; border-radius: var(--radius); color: inherit; }
.mrow:hover { background: var(--surface-2); }
.mrow .grow { min-width: 0; color: inherit; }
.mrow .mav { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: none; }
.quick-links { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 22px; }
.quick-links > * { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .15s; }
.quick-links > *:hover { color: var(--text); border-color: var(--line-2); background: var(--surface); }

/* 작가 프로필 */
.profile-head { display: flex; align-items: flex-start; gap: 22px; flex-wrap: wrap; padding: 28px 0 8px; }
.profile-av { width: 96px; height: 96px; border-radius: 50%; overflow: hidden; background: var(--surface-3); display: grid; place-items: center; font-size: 36px; font-weight: 800; flex: none; }
.profile-av img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: -.02em; }
.profile-head p { margin: 0 0 12px; max-width: 560px; white-space: pre-wrap; }
.profile-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--text-2); }
.profile-stats b { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 3px; }

/* 스와이프 탐색 */
.discover { max-width: 460px; margin: 0 auto; padding: 18px 0 40px; }
.discover-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.discover-head h1 { margin: 0 0 4px; font-size: 24px; letter-spacing: -.02em; }
.discover-head p { margin: 0; }
.deck { position: relative; aspect-ratio: 3 / 4.1; touch-action: pan-y; user-select: none; }
.dcard { position: absolute; inset: 0; border-radius: 24px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.45); transition: transform .26s var(--ease, ease), opacity .26s; cursor: grab; }
.dcard.under { transform: scale(.95) translateY(14px); opacity: .7; pointer-events: none; }
.dcard.top:active { cursor: grabbing; }
.dcard .dimg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; pointer-events: none; }
.dcard::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(8,8,10,.94) 0%, rgba(8,8,10,.55) 34%, transparent 62%); pointer-events: none; }
.dinfo { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 22px 24px; z-index: 1; }
.dworld { font-size: 12.5px; font-weight: 700; color: #f6a3b3; margin-bottom: 4px; }
.dinfo h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.dinfo h2 span { font-size: 18px; font-weight: 500; color: var(--text-2); margin-left: 4px; }
.dtitle { margin: 2px 0 8px; font-weight: 650; color: var(--text); }
.dtag { margin: 0 0 12px; color: var(--text-2); font-size: 13.5px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dinfo .chip { background: rgba(255,255,255,.1); color: var(--text); }
.dstamp { position: absolute; top: 26px; z-index: 2; padding: 6px 14px; border-radius: 10px; border: 3px solid; font-weight: 900; font-size: 20px; letter-spacing: .04em; opacity: 0; transition: opacity .12s; }
.dstamp.like { left: 22px; color: #4ade80; border-color: #4ade80; transform: rotate(-12deg); }
.dstamp.skip { right: 22px; color: #f87171; border-color: #f87171; transform: rotate(12deg); }
.dcard.hint-like .dstamp.like, .dcard.fly-right .dstamp.like, .dcard.hint-skip .dstamp.skip, .dcard.fly-left .dstamp.skip { opacity: 1; }
.dcard.fly-right { transform: translateX(130%) rotate(18deg) !important; opacity: 0; }
.dcard.fly-left { transform: translateX(-130%) rotate(-18deg) !important; opacity: 0; }
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 22px; }
.deck-btn { width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font-size: 26px; cursor: pointer; transition: transform .15s, background .15s; color: var(--text-2); }
.deck-btn:hover { transform: translateY(-2px); background: var(--surface-2); color: var(--text); }
.deck-btn.sm { width: 48px; height: 48px; font-size: 20px; }
.deck-btn.like { color: var(--accent); }
.deck-btn.chat { color: #a5b4fc; }
@media (prefers-reduced-motion: reduce) { .dcard, .dcard.fly-left, .dcard.fly-right { transition: none; } }

/* 공유된 장면 */
.share-page { max-width: 760px; margin: 0 auto; padding: 22px 0 48px; }
.share-head { text-align: center; padding: 10px 0 26px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.share-head h1 { margin: 14px 0 6px; font-size: 26px; letter-spacing: -.02em; }
.share-char { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: inherit; text-align: left; }
.share-char img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.share-char > span { display: flex; flex-direction: column; line-height: 1.3; }
.share-msgs { padding: 0 !important; }
.share-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 34px; }

/* 댓글 */
.comments .section-head { align-items: center; }
.cmt-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.cmt-form .textarea { min-height: 64px; }
.cmt-replies .cmt-form { margin: 6px 0 12px 44px; }
.cmts { display: flex; flex-direction: column; }
.cmt { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.cmt.reply { padding: 10px 0 10px 44px; border-top: none; }
.cmt-av { flex: none; }
.cmt-main { min-width: 0; flex: 1; }
.cmt-meta { display: flex; align-items: center; gap: 7px; font-size: 13px; margin-bottom: 4px; color: inherit; }
.cmt-meta a { color: inherit; }
.cmt-body { font-size: 14.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.cmt-body .spoiler-cover { display: none; }
.cmt-body.spoiler { cursor: pointer; }
.cmt-body.spoiler .spoiler-cover { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.cmt-body.spoiler .txt { display: none; }
.cmt-acts { display: flex; gap: 2px; margin-top: 4px; margin-left: -8px; }
.cmt-acts button { border: none; background: none; color: var(--text-3); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.cmt-acts button:hover { color: var(--text); background: var(--surface-2); }
.cmt-acts button.on { color: var(--accent); }

/* 스튜디오 태그 추천 */
.tag-suggest { margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.tag-suggest .chip.btn-chip { height: 28px; padding: 0 10px; font-size: 12.5px; }
@media (max-width: 640px) {
  .profile-head { gap: 14px; }
  .profile-av { width: 72px; height: 72px; font-size: 28px; }
  .deck-btn { width: 56px; height: 56px; }
}
.comments { max-width: 820px; }
.discover { max-width: 440px; }
.deck { aspect-ratio: auto; height: clamp(420px, calc(100vh - 300px), 600px); }
@media (max-width: 640px) {
  .share-cta { flex-direction: column; align-items: stretch; text-align: center; }
  .share-cta .btn { width: 100%; }
  .deck { height: clamp(380px, calc(100svh - 330px), 560px); }
}

/* ═════════ 3차: 재화 · 창작자 경제 ═════════ */
.wallet { display: grid; grid-template-columns: auto 1fr; gap: 10px 32px; align-items: center; margin: 18px 0 22px; }
.wallet-total { display: flex; flex-direction: column; gap: 2px; }
.wallet-total b { font-size: 34px; font-weight: 800; letter-spacing: -.04em; display: flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.wallet-total b i { color: var(--accent); font-size: 26px; }
.wallet-split { display: flex; gap: 28px; }
.wallet-split > div { display: flex; flex-direction: column; gap: 2px; }
.wallet-split b { font-size: 20px; font-variant-numeric: tabular-nums; }
.wallet-note { grid-column: 1 / -1; line-height: 1.6; }
.expiring { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 6px; color: #f5b14c; }
.pkg .bonus .first { color: #f5b14c; }
.pass-card { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--line-2); background: radial-gradient(120% 140% at 0% 0%, rgba(245,177,76,.14), transparent 55%), var(--surface); }
.pass-card.on { border-color: rgba(245,177,76,.55); }
.pass-title { display: flex; align-items: center; gap: 8px; font-size: 19px; font-weight: 800; margin-bottom: 10px; }
.pass-title i { color: #f5b14c; }
.pass-perks { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 14px; }
.pass-perks i { color: #f5b14c; margin-right: 6px; }
.pass-perks b { color: var(--text); }
.pass-buy { display: flex; flex-direction: column; gap: 8px; min-width: 200px; }
.pass-buy .btn { justify-content: space-between; height: 48px; padding: 0 18px; }
.ref-code { flex: 1; display: grid; place-items: center; height: 42px; border-radius: 10px; border: 1px dashed var(--line-2); font-weight: 800; letter-spacing: .18em; font-size: 16px; }
.only-badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; background: linear-gradient(120deg, #f5b14c, #ec5f79); color: #1a1208; font-size: 11px; font-weight: 900; letter-spacing: .06em; }
.ccard .thumb .only-badge { position: absolute; left: 8px; top: 8px; z-index: 1; }

/* 응원 */
.support { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.support .faces { display: flex; }
.support .faces .av { margin-left: -8px; border: 2px solid var(--surface); }
.support .faces .av:first-child { margin-left: 0; }
.cheer-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cheer { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.cheer b { color: var(--accent); white-space: nowrap; }
.amount-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 14px; }
.amount-pick button { height: 46px; border-radius: 12px; border: 1px solid var(--line-2); background: transparent; font-weight: 750; cursor: pointer; }
.amount-pick button.active { background: var(--text); color: var(--bg); }

/* 창작자 대시보드 */
.dash-top { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; margin: 18px 0 22px; }
.stat-card { display: flex; flex-direction: column; gap: 6px; }
.stat-card .big { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.tier-badge { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-weight: 800; font-size: 13px; width: fit-content; }
.tier-badge.rookie { background: rgba(165,180,252,.15); color: #a5b4fc; }
.tier-badge.prime { background: rgba(74,222,128,.14); color: #4ade80; }
.tier-badge.hyper { background: linear-gradient(120deg, rgba(245,177,76,.25), rgba(236,95,121,.25)); color: #ffd28a; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 8px; }
.bars > span { flex: 1; min-width: 4px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; position: relative; }
.bars > span:hover { opacity: 1; }
.dash-table td b { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .wallet { grid-template-columns: 1fr; }
  .dash-top { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  .pass-buy { width: 100%; }
}
.dash-link { display: flex; gap: 16px; align-items: center; margin-top: 22px; color: inherit; }
@media (max-width: 640px) {
  .packages { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pkg { padding: 16px 14px; }
  .pkg .amount { font-size: 22px; }
  .checkin { flex-wrap: wrap; padding: 18px; }
  .checkin .btn { width: 100%; }
  #hist .section-head { flex-wrap: wrap; gap: 10px; }
}

/* ═════════ 4차: 미션 ═════════ */
.chip.ok { background: rgba(74,222,128,.14); color: #4ade80; }
.chip.warn { background: rgba(245,177,76,.16); color: #f5b14c; }
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.mrow-cards { display: grid; grid-auto-flow: column; grid-auto-columns: 280px; gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
.mrow-cards::-webkit-scrollbar { display: none; }
.mcard { display: flex; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: inherit; transition: border-color .15s, transform .15s var(--ease); }
.mcard:hover { border-color: var(--line-2); transform: translateY(-2px); }
.mthumb { position: relative; width: 88px; flex: none; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.mthumb img { width: 100%; height: 100%; object-fit: cover; }
.mdiff { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; background: rgba(0,0,0,.7); }
.mcard.easy .mdiff { color: #4ade80; } .mcard.normal .mdiff { color: #f5b14c; } .mcard.hard .mdiff { color: #f87171; }
.mclear { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; background: #f5b14c; color: #1a1208; }
.mbody { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mchar { font-size: 12px; font-weight: 700; color: #f6a3b3; }
.mtitle { font-weight: 800; font-size: 15px; letter-spacing: -.01em; }
.msum { font-size: 12.5px; color: var(--text-2); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mmeta { margin-top: auto; display: flex; gap: 10px; font-size: 12px; color: var(--text-3); }
.mmeta span { display: inline-flex; align-items: center; gap: 3px; }
.mdetail { display: grid; grid-template-columns: 340px 1fr; gap: 32px; padding-top: 14px; }
.mdetail-img { border-radius: 22px; overflow: hidden; aspect-ratio: 3 / 4; background: var(--surface); }
.mdetail-img img { width: 100%; height: 100%; object-fit: cover; }
.mdetail-info h1 { margin: 12px 0 10px; font-size: 30px; letter-spacing: -.03em; }
.mdiff-chip.easy { color: #4ade80; } .mdiff-chip.normal { color: #f5b14c; } .mdiff-chip.hard { color: #f87171; }
.mchar-link { display: inline-flex; align-items: center; gap: 10px; color: inherit; margin-bottom: 16px; }
.mchar-link img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.mchar-link > span { display: flex; flex-direction: column; line-height: 1.3; }
.mbox { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 12px; }
.mbox p { margin: 4px 0 0; line-height: 1.7; white-space: pre-wrap; }
.mbox .lbl { font-size: 12px; font-weight: 800; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.mbox.goal { border-color: rgba(236,95,121,.4); }
.mbox ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.8; color: var(--text-2); }
.lboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lboard li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.lboard li.me { background: var(--accent-soft); border-radius: 8px; }
.lboard .rk { width: 26px; text-align: center; font-weight: 800; color: var(--text-3); }
.lboard li:nth-child(-n+3) .rk { color: #f5b14c; }
.lboard a { color: inherit; }
.lboard b { font-variant-numeric: tabular-nums; }
.mission-hud { border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(236,95,121,.08), transparent), var(--bg); }
.mh-toggle { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 18px; border: none; background: none; color: inherit; cursor: pointer; text-align: left; font-size: 14px; }
.mh-toggle > i:first-child { color: var(--accent); }
.mh-toggle .caret { transition: transform .2s; color: var(--text-3); }
.mission-hud.min .caret { transform: rotate(-90deg); }
.mission-hud.min .mh-body { display: none; }
.judging { animation: pulse 1s infinite alternate; }
@keyframes pulse { from { opacity: .4; } to { opacity: 1; } }
.mh-body { padding: 0 18px 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.mh-goal span, .mh-subs span { display: inline-flex; align-items: flex-start; gap: 6px; line-height: 1.5; }
.mh-goal span { font-weight: 700; }
.mh-subs { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--text-2); font-size: 12.5px; }
.mh-goal .done, .mh-subs .done { color: #4ade80; }
.mh-comment { color: var(--text-2); font-size: 12.5px; display: flex; gap: 6px; align-items: center; }
.mh-hint summary { cursor: pointer; color: var(--text-3); font-size: 12.5px; }
.mh-hint { font-size: 13px; color: var(--text-2); }
.mission-result { text-align: center; }
.mission-result .big { font-size: 46px; color: var(--text-3); }
.mission-result.ok .big { color: #f5b14c; }
.mission-result h2 { margin: 6px 0 2px; }
.mr-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 14px; }
.mr-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.mr-stats b { font-size: 20px; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .mdetail { grid-template-columns: 1fr; }
  .mdetail-img { max-width: 260px; }
}

/* ═════════ 5차: 계정 · 운영 ═════════ */
.social-login { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
.btn.social { justify-content: center; gap: 10px; border: none; font-weight: 750; }
.btn.social.kakao { background: #fee500; color: #191600; }
.btn.social.kakao:hover { background: #f5dc00; }
.btn.social.google { background: #fff; color: #1f1f1f; }
.btn.social.google b { font-size: 17px; color: #4285f4; }
.or { display: flex; align-items: center; gap: 10px; margin: 10px 0 2px; color: var(--text-3); font-size: 12.5px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.icon-btn.bell { position: relative; width: 36px; height: 36px; border: none; }
.icon-btn.bell .badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.notice-strip { display: flex; flex-direction: column; gap: 4px; margin: 14px 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.notice-strip a { display: flex; align-items: center; gap: 8px; color: inherit; font-size: 13.5px; min-width: 0; }
.notice-strip a.new { font-weight: 700; }
.notice-strip .dot, .notif.unread::after { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.notif-list { display: flex; flex-direction: column; max-height: 56vh; overflow-y: auto; margin-top: 6px; }
.notif { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 8px; border-radius: 12px; color: inherit; }
.notif:hover { background: var(--surface-2); }
.notif img, .notif .ni { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; background: var(--surface-3); display: grid; place-items: center; font-size: 19px; color: var(--text-2); }
.notif .grow { min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.notif .nb { color: var(--text-2); }
.notif:not(.unread) b { font-weight: 550; color: var(--text-2); }
.notif.unread::after { content: ''; position: absolute; right: 10px; top: 18px; }
.notice-list { display: flex; flex-direction: column; }
.notice-list a { display: flex; align-items: center; gap: 10px; padding: 14px 6px; border-bottom: 1px solid var(--line); color: inherit; }
.notice-list a.pinned { font-weight: 700; }
.notice-list a:hover { background: var(--surface); }
.notice-body { white-space: pre-wrap; line-height: 1.8; }
.faq { border-bottom: 1px solid var(--line); padding: 14px 4px; }
.faq summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: '+'; color: var(--text-3); font-weight: 400; }
.faq[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 0; color: var(--text-2); line-height: 1.75; }
.switch-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row:first-of-type { border-top: none; }
.switch-row .grow { display: flex; flex-direction: column; gap: 2px; }
.switch { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(18px); }
.kind-tag.pro { color: #a5b4fc; display: inline-flex; align-items: center; gap: 3px; }

/* ═════════ 6차: 플레이룸 ═════════ */
.room-faces { display: flex; flex: none; }
.room-faces img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); margin-left: -10px; }
.room-faces img:first-child { margin-left: 0; }
.room-faces.sm img { width: 40px; height: 40px; margin-left: -14px; }
.room-faces.sm img:first-child { margin-left: 0; }
.narration { text-align: center; color: var(--text-2); font-size: 14px; line-height: 1.7; padding: 6px 30px; }
.narration p { margin: 0; }
.composer-tools .tool.who { padding-left: 4px; }
.composer-tools .tool.who img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.composer-tools .tool.who.on { background: var(--accent-soft); border-color: rgba(236,95,121,.5); color: #f6a3b3; }
.room-members { display: flex; flex-direction: column; gap: 8px; }
.room-members .rm { display: flex; gap: 10px; align-items: center; color: inherit; }
.room-members .rm img { width: 38px; height: 38px; border-radius: 12px; object-fit: cover; }
.room-members .rm > span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.pick-sel { display: flex; flex-wrap: wrap; gap: 6px; min-height: 34px; align-items: center; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 42vh; overflow-y: auto; padding: 2px; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; font-size: 12.5px; }
.pick img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.pick.on { border-color: var(--accent); background: var(--accent-soft); }
.lang-pick { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); }
.lang-pick select { background: transparent; border: 1px solid var(--line); color: inherit; border-radius: 8px; height: 28px; padding: 0 6px; font-size: 12.5px; }

/* ═════════ 갤러리 (유료 잠금) ═════════ */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.gitem { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); padding: 0; cursor: pointer; color: inherit; }
.gitem img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.gitem:hover img { transform: scale(1.03); }
.gitem.locked img { filter: saturate(.8) brightness(.75); }
.glock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 26px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.glock b { font-size: 13px; padding: 2px 9px; border-radius: 99px; background: rgba(0,0,0,.55); }
.gtitle { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; font-size: 12.5px; font-weight: 700; text-align: left; background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.gmeta { position: absolute; top: 6px; left: 6px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: rgba(0,0,0,.6); }
.gitem.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-style: dashed; color: var(--text-2); font-size: 13px; }
.gitem.add i { font-size: 26px; }
.gview { text-align: center; }
.gview img { max-width: 100%; max-height: 70vh; border-radius: 14px; }
.gview img.blur { width: 220px; aspect-ratio: 3/4; object-fit: cover; }
.gview h3 { margin: 12px 0 4px; }


/* ───── 캐릭터 상세: 포스터 히어로 · 프로필 카드 · 스토리 · 등장인물 ───── */
.hero-wrap { position: absolute; left: 0; right: 0; top: var(--topbar-h); height: 560px; overflow: hidden; pointer-events: none; z-index: 0; }
.hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center 25%; filter: blur(48px) saturate(1.3) brightness(.55); opacity: .55; }
.hero-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,12,14,.25) 0%, rgba(12,12,14,.7) 60%, var(--bg) 100%); }
.detail, .detail-tabs, .detail ~ section, .detail ~ .notice { position: relative; z-index: 1; }
.detail-img { box-shadow: 0 30px 70px -20px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.06); }
.world-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: -.01em; }
.world-chip:hover { color: var(--accent-hover); }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 0; font-size: 15px; color: var(--text-2); }
.who > * + *::before { content: "·"; margin: 0 8px; color: var(--text-3); }
.who b { color: var(--text); font-weight: 750; }
.hook { margin: 2px 0 4px; font-size: 17px; line-height: 1.6; color: #e4e4ea; font-weight: 500; letter-spacing: -.02em; padding-left: 14px; border-left: 3px solid var(--accent); text-wrap: pretty; }
.feat { display: flex; flex-wrap: wrap; gap: 6px; }
.feat span { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 12.5px; font-weight: 650; color: var(--text-2); }
.feat .ph { color: var(--text); font-size: 14px; }
.detail-tabs { position: sticky; top: var(--topbar-h); z-index: 20; display: flex; gap: 4px; margin: 40px 0 8px; padding: 8px 0; background: rgba(12,12,14,.88); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.detail-tabs::-webkit-scrollbar { display: none; }
.detail-tabs a { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 650; color: var(--text-2); transition: .15s; }
.detail-tabs a:hover { color: var(--text); }
.detail-tabs a.active { color: var(--text); background: var(--surface-2); }
.about { display: grid; grid-template-columns: 1fr; gap: 32px; margin-top: 32px; }
.about.has-profile { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.about .desc-box { margin-top: 0; }
.profile-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; position: sticky; top: calc(var(--topbar-h) + 70px); }
.pc-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 6px; border-bottom: 1px solid var(--line); }
.pc-head img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.pc-head b { display: block; font-size: 16px; }
.pc-head span { font-size: 12.5px; color: var(--text-3); }
.profile-card dl { margin: 0; display: flex; flex-direction: column; }
.profile-card dl > div { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.profile-card dl > div:last-child { border-bottom: 0; }
.profile-card dt { color: var(--text-3); font-weight: 600; }
.profile-card dd { margin: 0; color: var(--text); line-height: 1.5; word-break: keep-all; }
.synopsis { margin: -4px 0 18px; font-size: 15.5px; line-height: 1.75; color: #d6d6dc; max-width: 72ch; white-space: pre-wrap; }
.chapters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0; position: relative; }
.chapters::before { content: ""; position: absolute; left: 19px; top: 20px; bottom: 20px; width: 2px; background: var(--line-2); }
.chapter { position: relative; display: grid; grid-template-columns: 40px 1fr auto; gap: 16px; align-items: center; padding: 12px 0; }
.ch-no { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; font-weight: 800; color: var(--text-2); font-variant-numeric: tabular-nums; z-index: 1; }
.chapter.done .ch-no { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.ch-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ch-body b { font-size: 15.5px; letter-spacing: -.02em; }
.ch-body span { font-size: 13.5px; color: var(--text-2); line-height: 1.5; }
.ch-body em { font-style: normal; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); }
.ch-cg { width: 64px; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--text-3); }
.ch-cg img { width: 100%; height: 100%; object-fit: cover; }
.ch-cg.locked { background: repeating-linear-gradient(135deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); }
.open-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.open-card { display: flex; flex-direction: column; gap: 6px; text-align: left; padding: 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, transform .2s var(--ease); }
.open-card:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.open-card:disabled { opacity: .5; cursor: wait; }
.open-card .no { font-size: 12px; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.open-card b { font-size: 16px; letter-spacing: -.02em; }
.open-card .role, .opening .role { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; font-size: 12.5px; font-weight: 650; color: var(--text); background: var(--accent-soft); border: 1px solid var(--accent-line); padding: 3px 9px; border-radius: 6px; }
.opening .role { margin-top: 4px; }
.open-card .pv { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13.5px; line-height: 1.6; color: var(--text-2); }
.open-card .go { margin-top: auto; padding-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-3); display: inline-flex; align-items: center; gap: 4px; }
.open-card:hover .go { color: var(--accent); }
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.cast-card { display: grid; grid-template-columns: 72px 1fr; gap: 14px; padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.cast-av { width: 72px; height: 96px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.cast-av.ph-av { display: grid; place-items: center; font-size: 26px; font-weight: 800; color: var(--text-2); }
.cast-card b { font-size: 15.5px; }
.cast-card .role { display: block; font-size: 12.5px; color: var(--accent); font-weight: 650; margin-top: 2px; }
.cast-card p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.6; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.img-upload.mini { display: inline-grid; width: 96px; aspect-ratio: 3 / 4; margin-right: 8px; vertical-align: top; }
.poster-input .img-upload { aspect-ratio: 3 / 4; max-width: 220px; }
@media (max-width: 760px) {
  .hero-wrap { height: 420px; }
  .detail-img { max-width: 300px; }
  .detail-info { padding-top: 0; }
  .detail-info h1 { font-size: 28px; }
  .about.has-profile { grid-template-columns: 1fr; }
  .profile-card { position: static; }
  .detail-tabs { margin: 24px -16px 8px; padding: 8px 16px; }
  .chapter { grid-template-columns: 40px 1fr; }
  .ch-cg { grid-column: 2; width: 80px; }
  .cast-grid, .open-grid { grid-template-columns: 1fr; }
}

/* 대화 화면: 메인 스토리 진행 바 · 챕터 클리어 */
.story-bar { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(90deg, var(--accent-soft), transparent 70%); font-size: 13px; color: var(--text-2); min-width: 0; }
.story-bar > .ph-fill { color: var(--accent); font-size: 16px; flex: none; }
.story-bar .no { font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; flex: none; }
.story-bar .grow { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-bar b { color: var(--text); }
.story-bar .dots { display: flex; gap: 4px; flex: none; }
.story-bar .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); }
.story-bar .dots i.on { background: var(--accent); }
.story-bar .dots i.cur { background: transparent; box-shadow: inset 0 0 0 1.5px var(--accent); }
.story-up { text-align: center; }
.story-up .cg { margin: -8px -8px 18px; border-radius: 14px; overflow: hidden; aspect-ratio: 3 / 4; max-height: 52vh; }
.story-up .cg img { width: 100%; height: 100%; object-fit: cover; animation: cgIn 1.2s var(--ease) both; }
@keyframes cgIn { from { opacity: 0; transform: scale(1.06); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }
.story-up .kicker { font-size: 11.5px; font-weight: 800; letter-spacing: .18em; color: var(--accent); }
.story-up h2 { margin: 6px 0 8px; font-size: 24px; letter-spacing: -.04em; }
.story-up .next { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--surface-2); text-align: left; font-size: 13.5px; color: var(--text-2); }
.story-up .next b { color: var(--text); font-size: 15px; }

/* 카드: 세로 3:4 포스터형 */
.ccard .thumb { aspect-ratio: 3 / 4; }
.ccard .thumb::after { content: ""; position: absolute; inset: auto 0 0 0; height: 35%; background: linear-gradient(transparent, rgba(0,0,0,.45)); pointer-events: none; }
.ccard .thumb .rank { z-index: 1; }
.chat-head .role-tag { color: var(--accent); font-weight: 600; }
.style-row { padding: 12px; border-radius: 12px; border: 1px solid var(--line); margin-bottom: 10px; }
.style-row.cur { border-color: var(--accent-line); background: var(--accent-soft); }
.style-imgs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.style-imgs img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.world-styles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px 20px; margin-top: 10px; }
.style-imgs { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ───── 홈 개편 (2026-10): 피드 탭 · 이어서 대화 · 키워드 · TOP10 · 감성 큐레이션 · 세계관 줄 ───── */
.feed-tabs { position: sticky; top: var(--topbar-h); z-index: 40; display: flex; gap: 22px; margin: -28px -24px 20px; padding: 0 24px; height: 48px; align-items: stretch; background: rgba(12, 12, 14, .86); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.feed-tabs button { position: relative; border: 0; background: none; padding: 0 2px; color: var(--text-3); font: inherit; font-size: 15.5px; font-weight: 700; letter-spacing: -.02em; cursor: pointer; transition: color .15s; }
.feed-tabs button:hover { color: var(--text-2); }
.feed-tabs button.on { color: var(--text); }
.feed-tabs button.on::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--text); }
#home-body { transition: opacity .2s var(--ease); }
#home-body.loading { opacity: .45; pointer-events: none; }
.section.tight { margin: 36px 0; }

/* 이어서 대화하기 */
.cont-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 10px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.cont-row::-webkit-scrollbar { display: none; }
.cont { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); scroll-snap-align: start; transition: border-color .15s, background .15s; }
.cont:hover { border-color: var(--line-2); background: var(--surface-2); }
.cont .cont-av { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.cont-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cont-body b { font-size: 14.5px; font-weight: 700; }
.cont-last { font-size: 12.5px; color: var(--text-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.cont-go { font-size: 24px; color: var(--text-3); transition: color .15s; }
.cont:hover .cont-go { color: var(--accent); }

/* 키워드 */
.kw-row { display: flex; flex-wrap: wrap; gap: 8px; }
.kw { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: .15s; }
.kw span { font-size: 11.5px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.kw:hover { border-color: var(--accent-line); background: var(--accent-soft); color: #f6a3b3; }

/* TOP 10 */
.t10-row { display: grid; grid-auto-flow: column; grid-auto-columns: 232px; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.t10-row::-webkit-scrollbar { display: none; }
.t10 { position: relative; display: flex; align-items: flex-end; scroll-snap-align: start; }
.t10-no { flex: none; width: 92px; margin-right: -14px; font-size: 132px; line-height: .78; font-weight: 900; letter-spacing: -.08em; color: var(--bg); -webkit-text-stroke: 2px rgba(255, 255, 255, .55); text-align: right; z-index: 0; user-select: none; }
.t10:nth-child(n+10) .t10-no { letter-spacing: -.12em; font-size: 104px; }
.t10-art { position: relative; z-index: 1; width: 140px; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.t10-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.t10:hover .t10-art img { transform: scale(1.05); }
.t10-cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 1px; padding: 28px 10px 9px; background: linear-gradient(180deg, transparent, rgba(8, 8, 10, .92)); }
.t10-cap b { font-size: 14px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t10-cap span { font-size: 11.5px; color: rgba(255, 255, 255, .66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 감성 큐레이션 */
.melo-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 340px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.melo-row::-webkit-scrollbar { display: none; }
.melo { position: relative; display: flex; align-items: flex-end; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--surface); isolation: isolate; scroll-snap-align: start; }
.melo .melo-bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; filter: saturate(.85); transition: transform 1s var(--ease), filter .6s; }
.melo::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 10, 14, 0) 35%, rgba(10, 10, 14, .55) 60%, rgba(10, 10, 14, .95) 100%); }
.melo:hover .melo-bg { transform: scale(1.04); filter: saturate(1); }
.melo-copy { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 20px; }
.melo-line { font-size: 16px; line-height: 1.55; font-weight: 600; letter-spacing: -.02em; color: #fff; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; }
.melo-who { font-size: 12.5px; color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.melo-who b { color: rgba(255, 255, 255, .92); font-weight: 700; }

/* 세계관 줄 */
.wmini-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(220px, 260px); gap: 12px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.wmini-row::-webkit-scrollbar { display: none; }
.wmini { position: relative; display: flex; align-items: flex-end; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: var(--surface); isolation: isolate; scroll-snap-align: start; }
.wmini .bg { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.wmini::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 30%, rgba(10, 10, 14, .9)); }
.wmini::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wc, var(--accent)); z-index: 1; }
.wmini:hover .bg { transform: scale(1.05); }
.wmini-copy { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; }
.wmini-copy b { font-size: 16px; font-weight: 750; letter-spacing: -.03em; }
.wmini-copy span { font-size: 12px; color: rgba(255, 255, 255, .66); }

@media (max-width: 760px) {
  .feed-tabs { margin: -16px -16px 14px; padding: 0 16px; height: 46px; gap: 20px; }
  .section.tight { margin: 28px 0; }
  .cont-row, .t10-row, .melo-row, .wmini-row { margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding: 0 16px; }
  .cont-row { grid-auto-columns: 78%; }
  .kw-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 4px; }
  .kw-row::-webkit-scrollbar { display: none; }
  .kw { flex: none; padding: 8px 13px; font-size: 13.5px; }
  .t10-row { grid-auto-columns: 184px; gap: 8px; }
  .t10-no { width: 72px; margin-right: -10px; font-size: 104px; }
  .t10:nth-child(n+10) .t10-no { font-size: 80px; }
  .t10-art { width: 116px; }
  .melo-row { grid-auto-columns: 64%; }
  .melo { aspect-ratio: 3 / 4; }
  .melo-line { font-size: 15px; }
  .wmini-row { grid-auto-columns: 62%; }
  /* 히어로는 모바일에서 한 화면을 다 차지하지 않게 */
  .spot-frame { aspect-ratio: 1 / 1; }
  .spot-name { font-size: 36px; }
  .spot-meta { display: none; }
  .spot-tagline { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* 사업자 정보 · 결제 안내 */
.footer-biz { flex-basis: 100%; font-size: 12px; line-height: 1.7; color: var(--text-3); }
.footer-biz:empty { display: none; }
.buy-notice { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); line-height: 1.65; }
.buy-notice p { margin: 0 0 6px; } .buy-notice p:last-child { margin: 0; }
.buy-notice b { color: var(--text-2); margin-right: 4px; }
.buy-notice a { color: var(--text-2); text-decoration: underline; }

/* 가로 스크롤 줄 보조 (화살표 · 끌기) */
.hs-wrap { position: relative; }
.hs-btn { position: absolute; top: calc(50% - 24px); z-index: 5; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(20, 20, 24, .88); backdrop-filter: blur(10px); color: var(--text); font-size: 18px; cursor: pointer; opacity: 0; transition: opacity .2s, background .15s; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.hs-btn.prev { left: -14px; } .hs-btn.next { right: -14px; }
.hs-btn:hover { background: var(--text); color: var(--bg); }
.hs-wrap:hover .hs-btn, .hs-btn:focus-visible { opacity: 1; }
.hs-btn[hidden] { display: none; }
.hs-wrap > .dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.hs-wrap > .dragging * { pointer-events: none; }
@media (hover: none) { .hs-btn { display: none; } }
@media (max-width: 760px) { .hs-btn.prev { left: -6px; } .hs-btn.next { right: -6px; } }

/* 홈 지연 로딩 자리표시 */
.lazy-slot { margin: 56px 0; }
.skel-head { width: 220px; height: 22px; border-radius: 8px; margin-bottom: 18px; }
.skel-row { height: 240px; border-radius: 16px; }
.skel-head, .skel-row { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: skel 1.4s ease-in-out infinite; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-head, .skel-row { animation: none; } }
@media (max-width: 760px) { .lazy-slot { margin: 44px 0; } .skel-row { height: 200px; } }

/* ═════════ DEEPIE 레이아웃 (2026-10 가안) ═════════ */
.sidebar { display: none; }
.logo { font-weight: 900; letter-spacing: .02em; font-size: 19px; }
@media (min-width: 1025px) {
  :root { --side-w: 228px; }
  .sidebar { display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); padding: 20px 14px; z-index: 60; background: var(--bg); border-right: 1px solid var(--line); overflow-y: auto; }
  .sidebar-logo { font-size: 20px; font-weight: 900; letter-spacing: .03em; padding: 6px 14px 28px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 14.5px; transition: background .15s, color .15s; }
  .side-nav a i { font-size: 20px; }
  .side-nav a:hover { color: var(--text); background: var(--surface); }
  .side-nav a.active { color: var(--text); background: var(--surface-2); }
  .side-nav.sub a { font-size: 13.5px; padding: 8px 14px; color: var(--text-3); }
  .side-nav.sub a i { font-size: 18px; }
  .side-nav.sub a.active, .side-nav.sub a:hover { color: var(--text); }
  .side-sep { height: 1px; background: var(--line); margin: 14px 12px; }
  .topbar, .app, .footer { margin-left: var(--side-w); }
  .topbar .logo, .topbar .nav { display: none; }
  .topbar-inner { max-width: none; padding: 0 28px; }
  .topbar .search { margin: 0 auto; max-width: 460px; }
  .topbar { border-bottom-color: transparent; background: radial-gradient(50% 160% at 50% -60%, rgba(158, 60, 210, .38), transparent 72%), rgba(12, 12, 14, .86); }
  /* 사이드바를 뺀 나머지 영역에서 가운데 정렬 (스크롤바 폭 제외: 100% 대신 html 폭 기준) */
  .app { max-width: 1240px; margin-left: calc(var(--side-w) + max(0px, (100vw - var(--scrollbar-w, 0px) - var(--side-w) - 1240px) / 2)); }
  .app.full { margin-left: var(--side-w); }
}
.topbar .search input { border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); }

/* 홈 상단 탭 */
.home-tabs { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; font-size: 16px; font-weight: 700; }
.home-tabs a { color: var(--text-3); transition: color .15s; }
.home-tabs a:hover, .home-tabs a.on { color: var(--text); }
.home-tabs .sep { width: 1px; height: 14px; background: var(--line-2); }

/* 곡면 캐러셀 */
.cf { position: relative; margin: 0 0 30px; }
.cf-stage { position: relative; height: clamp(220px, 28vw, 380px); overflow: hidden; }
.cf-slide { position: absolute; top: 0; left: 50%; width: 44%; height: 100%; margin-left: -22%; border-radius: 14px; overflow: hidden; background: var(--surface); transition: transform .65s cubic-bezier(.2, .8, .2, 1), opacity .5s, filter .5s; will-change: transform; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.cf-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; transition: transform .65s cubic-bezier(.2, .8, .2, 1); }
.cf-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; opacity: 0; transition: opacity .6s; }
.cf-slide.playing .cf-motion { opacity: 1; }
.cf-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(8, 8, 12, .85)); }
.cf-copy { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: flex; flex-direction: column; gap: 4px; }
.cf-copy b { font-size: clamp(16px, 1.6vw, 20px); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-copy span { font-size: 12.5px; color: rgba(255, 255, 255, .72); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 곡면: 옆 카드는 평면 그대로 두고, 안쪽 가장자리는 높게·바깥쪽은 위아래가 곡선으로 줄어드는 모양(마스크)으로 */
.cf-slide[data-pos="0"] { transform: none; z-index: 3; border-radius: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%202.2%20Q0%201.6%201%201.5%20Q50%20-2.2%2099%201.5%20Q100%201.6%20100%202.2%20L100%2097.8%20Q100%2098.4%2099%2098.5%20Q50%20102.2%201%2098.5%20Q0%2098.4%200%2097.8%20Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%202.2%20Q0%201.6%201%201.5%20Q50%20-2.2%2099%201.5%20Q100%201.6%20100%202.2%20L100%2097.8%20Q100%2098.4%2099%2098.5%20Q50%20102.2%201%2098.5%20Q0%2098.4%200%2097.8%20Z' fill='black'/%3E%3C/svg%3E"); }
/* 피그마: 곁 카드는 가운데 대비 높이 92%·폭 66%, 간격 ~3%, 바깥쪽으로 갈수록 낮아지는 곡면 */
.cf-slide[data-pos="1"] { transform: translateX(99.1%) scale(.923); z-index: 2; filter: brightness(.72); border-radius: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%200%20C24%203.4%2048%208.4%2072%2014.2%20L72%2086.9%20C48%2092.4%2024%2096.8%200%20100%20Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%200%20C24%203.4%2048%208.4%2072%2014.2%20L72%2086.9%20C48%2092.4%2024%2096.8%200%20100%20Z' fill='black'/%3E%3C/svg%3E"); }
.cf-slide[data-pos="1"] img, .cf-slide[data-pos="2"] img { transform: translateX(-14%); }
.cf-slide[data-pos="-1"] img, .cf-slide[data-pos="-2"] img { transform: translateX(14%); }
.cf-slide[data-pos="-1"] { transform: translateX(-99.1%) scale(.923); z-index: 2; filter: brightness(.72); border-radius: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100%200%20C76%203.4%2052%208.4%2028%2014.2%20L28%2086.9%20C52%2092.4%2076%2096.8%20100%20100%20Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100%200%20C76%203.4%2052%208.4%2028%2014.2%20L28%2086.9%20C52%2092.4%2076%2096.8%20100%20100%20Z' fill='black'/%3E%3C/svg%3E"); }
.cf-slide[data-pos="2"] { transform: translateX(190%) scale(.85); z-index: 1; opacity: 0; border-radius: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%200%20C24%203.4%2048%208.4%2072%2014.2%20L72%2086.9%20C48%2092.4%2024%2096.8%200%20100%20Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0%200%20C24%203.4%2048%208.4%2072%2014.2%20L72%2086.9%20C48%2092.4%2024%2096.8%200%20100%20Z' fill='black'/%3E%3C/svg%3E"); }
.cf-slide[data-pos="-2"] { transform: translateX(-190%) scale(.85); z-index: 1; opacity: 0; border-radius: 0; -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100%200%20C76%203.4%2052%208.4%2028%2014.2%20L28%2086.9%20C52%2092.4%2076%2096.8%20100%20100%20Z' fill='black'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M100%200%20C76%203.4%2052%208.4%2028%2014.2%20L28%2086.9%20C52%2092.4%2076%2096.8%20100%20100%20Z' fill='black'/%3E%3C/svg%3E"); }
.cf-slide[data-pos="far"] { opacity: 0; pointer-events: none; transform: scale(.6); }
.cf-slide:not([data-pos="0"]) .cf-copy { opacity: 0; }
.cf-slide:not([data-pos="0"]) { cursor: pointer; }
.cf-dots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.cf-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: var(--line-2); cursor: pointer; transition: width .3s, background .3s; }
.cf-dots button.on { width: 18px; background: var(--text); }
@media (prefers-reduced-motion: reduce) { .cf-slide { transition: none; } }

/* 진행 중인 채팅 */
.ongoing { margin: 0 0 30px; }
.ongoing-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; margin-bottom: 12px; }
.ongoing-head i { margin-left: auto; color: var(--text-3); transition: transform .2s; }
.ongoing.closed .ongoing-head i { transform: rotate(180deg); }
.ongoing.closed .ongoing-row { display: none; }
.ongoing-row { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.ongoing-row::-webkit-scrollbar { display: none; }
.chat-chip { flex: none; display: flex; align-items: center; gap: 10px; width: 230px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: background .15s, border-color .15s; }
.chat-chip:hover { background: var(--surface-2); border-color: var(--line-2); }
.chat-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.chat-chip > span { display: flex; flex-direction: column; min-width: 0; }
.chat-chip b { font-size: 13.5px; }
.chat-chip span span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 정렬 알약 · 성향 · 장르 칩 */
.feed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sort-pills, .target-seg, .genre-chips { display: flex; gap: 6px; }
.sort-pills button { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; transition: .15s; }
.sort-pills button:hover { color: var(--text); }
.sort-pills button.on { background: var(--accent); border-color: transparent; color: #fff; }
.target-seg { padding: 3px; border-radius: 10px; background: var(--surface); }
.target-seg button { padding: 5px 11px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.target-seg button.on { background: var(--surface-2); color: var(--text); }
.genre-chips { overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; padding-bottom: 2px; }
.genre-chips::-webkit-scrollbar { display: none; }
.genre-chips button { flex: none; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; }
.genre-chips button:hover { color: var(--text); border-color: var(--text-3); }
.genre-chips button.on { background: var(--text); color: var(--bg); border-color: transparent; }

/* 6열 카드 그리드 */
.ggrid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 12px; }
.gcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gcard-img { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--surface); margin-bottom: 6px; }
.gcard-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.gcard:hover .gcard-img img { transform: scale(1.04); }
.gcard-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-desc { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gcard-tag { align-self: flex-start; margin-top: 2px; padding: 2px 7px; border-radius: 5px; background: var(--surface-2); color: var(--text-2); font-size: 11px; font-weight: 600; }
.ggrid-end { display: flex; justify-content: center; padding: 30px 0; }
@media (max-width: 1280px) { .ggrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .ggrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .ggrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
  .cf-stage { height: 56vw; }
  .cf-slide { width: 72%; margin-left: -36%; }
  .cf-slide[data-pos="1"] { transform: translateX(99.1%) scale(.923); }
  .cf-slide[data-pos="-1"] { transform: translateX(-99.1%) scale(.923); }
  .feed-bar { flex-direction: column; align-items: stretch; }
  .sort-pills { overflow-x: auto; scrollbar-width: none; }
  .sort-pills button { flex: none; }
  .target-seg { align-self: flex-start; }
  .home-tabs { font-size: 15px; gap: 14px; }
}

/* 로고 이미지 */
.logo img { height: 24px; width: auto; display: block; }
.sidebar-logo img { height: 29px; width: auto; display: block; }
:root[data-theme="light"] .logo img, :root[data-theme="light"] .sidebar-logo img { content: url(/assets/logo-red.png); }

/* 함께하는 방 */
.room-people { display: grid; gap: 6px; }
.room-people .rp { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.rp-av { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2, #222); font-weight: 700; flex: none; }
.rp-av img { width: 100%; height: 100%; object-fit: cover; }
.invite-box { margin-top: 10px; }
.msg.peer .peer-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #c02750, #6b2bd9); color: #fff; font-weight: 800; flex: none; }
.msg.peer .bubble { background: rgba(192, 39, 80, .14); border: 1px solid rgba(192, 39, 80, .3); }
.room-busy { padding: 6px 16px; font-size: 12px; color: var(--text-3); }
.spectate-note { text-align: center; color: var(--text-3); font-size: 13px; padding: 10px; }
.join-room { max-width: 520px; margin: 40px auto; text-align: center; padding: 28px; }
.room-faces.lg img { width: 64px; height: 64px; }

/* 안전: 위기 안내 카드 · AI 배지 */
.ai-badge { display: inline-flex; align-items: center; height: 16px; padding: 0 5px; border-radius: 4px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--text-2); border: 1px solid var(--line, rgba(255,255,255,.18)); vertical-align: middle; }
.safety-card { max-width: 760px; margin: 12px auto 20px; padding: 14px 16px; border-radius: 14px; background: rgba(255, 196, 120, .08); border: 1px solid rgba(255, 196, 120, .35); font-size: 14px; }
.safety-card .sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.safety-card .sc-head b { flex: 1; }
.safety-card .sc-head .ph-hand-heart { color: #ffc478; font-size: 18px; }
.safety-card p { margin: 4px 0 10px; }
.safety-card .sc-list { display: grid; gap: 6px; margin-bottom: 8px; }
.safety-card .sc-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,.05); color: inherit; text-decoration: none; }
.safety-card .sc-item span { flex: 1; }
.safety-card .sc-item small { color: var(--text-3); }
.msg-tools .msg-model { font-size: 11px; color: var(--text-3); padding: 0 4px; opacity: .8; }
.lightbox .lb-ai { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: 12px; color: rgba(255,255,255,.75); background: rgba(0,0,0,.45); padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.doc-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.doc-nav a { padding: 5px 11px; border-radius: 999px; font-size: 13px; color: var(--text-2); border: 1px solid var(--line, rgba(255,255,255,.14)); text-decoration: none; }
.doc-nav a.on { color: var(--text-1, #fff); border-color: var(--accent, #ec5f79); }
.doc .tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0 18px; }
.doc .tbl th, .doc .tbl td { border-bottom: 1px solid var(--line, rgba(255,255,255,.1)); padding: 8px 6px; text-align: left; vertical-align: top; }
.memo-mini { margin: 0; font-size: 12.5px; }
.memo-mini dt { color: var(--text-3); margin-top: 6px; }
.memo-mini dd { margin: 2px 0 0; color: var(--text-2); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.char-update-bar { display: flex; align-items: center; gap: 8px; padding: 8px 16px; font-size: 12.5px; color: var(--text-2); background: rgba(124,108,255,.08); border-bottom: 1px solid var(--line, rgba(255,255,255,.08)); }
.bubble.rewriting { opacity: .45; transition: opacity .3s; }
.composer-tools .tool.on { border-color: var(--accent, #ec5f79); color: var(--text-1, #fff); background: rgba(236,95,121,.14); }
.composer-tools .tool.on .ph-microphone { animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 50% { opacity: .35; } }
#t .tbl { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
#t .tbl th, #t .tbl td { border-bottom: 1px solid var(--line, rgba(255,255,255,.1)); padding: 8px 10px; text-align: left; }
#t .tbl th { color: var(--text-3); font-weight: 600; }

/* ───────── 기능 명세서 v0.1 (2026-10-12) ───────── */
/* 채팅 배경 레이어 (CH-02) · 인트로 영상 (CH-01) */
.chat-bg { position: absolute; inset: 0; z-index: 0; background-size: cover; background-position: center; opacity: 0; transition: opacity .35s var(--ease); pointer-events: none; }
.chat-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,12,14,.72), rgba(12,12,14,.86) 60%, var(--bg)); }
.chat-bg.on { opacity: 1; }
.chat-bg.swap { opacity: .25; }
.chat-main > :not(.chat-bg):not(.intro-overlay) { position: relative; z-index: 1; }
.chat-main:has(.chat-bg.on) .chat-head { background: rgba(12,12,14,.6); backdrop-filter: blur(10px); }
.intro-overlay { position: absolute; inset: 0; z-index: 30; background: #000; display: grid; place-items: center; animation: pop .25s var(--ease); transition: opacity .4s; }
.intro-overlay.out { opacity: 0; }
.intro-overlay video { width: 100%; height: 100%; object-fit: contain; }
.intro-cap { position: absolute; left: 24px; bottom: 28px; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 2px 12px #000; }
.intro-cap b { font-size: 22px; } .intro-cap span { color: var(--text-2); }
.intro-skip { position: absolute; right: 18px; top: 18px; background: rgba(0,0,0,.5); }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }
.bg-opt { position: relative; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; border: 2px solid transparent; background: var(--surface-2); padding: 0; cursor: pointer; color: var(--text); }
.bg-opt img { width: 100%; height: 100%; object-fit: cover; }
.bg-opt span { position: absolute; left: 6px; bottom: 4px; font-size: 12px; text-shadow: 0 1px 4px #000; }
.bg-opt.on { border-color: var(--accent); }
.bg-opt.none { display: grid; place-items: center; font-size: 22px; color: var(--text-3); }
/* 대화 목록 안 읽음 (CH-08) */
.unread-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 800; margin-top: 4px; }
/* 캐릭터 상세 영상 (CD-01) */
.detail-motion { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
/* 홈 운영 배너 (OP-05) */
.op-banners { display: flex; gap: 10px; overflow-x: auto; margin: 6px 0 18px; scrollbar-width: none; }
.op-banner { position: relative; flex: 0 0 min(420px, 86%); height: 110px; border-radius: 14px; overflow: hidden; background: linear-gradient(120deg, var(--accent-soft), var(--surface-2)); border: 1px solid var(--line); display: flex; align-items: flex-end; }
.op-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .6; }
.ob-txt { position: relative; padding: 12px 14px; display: flex; flex-direction: column; text-shadow: 0 1px 6px #000; }
.ob-txt span { color: var(--text-2); font-size: 13px; }
/* 결제 유도 시트 (PY-07) */
.modal.sheet { max-width: 480px; }
@media (max-width: 760px) { .modal-bg:has(.modal.sheet) { align-items: flex-end; padding: 0; } .modal.sheet { border-radius: 20px 20px 0 0; max-height: 86vh; animation: sheetUp .26s var(--ease); } }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.pw-head { display: flex; gap: 12px; align-items: center; } .pw-head > i { font-size: 34px; color: var(--accent); } .pw-head h2 { margin: 0; }
.pw-list { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 12px; }
.pw-item { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text); cursor: pointer; text-align: left; }
.pw-item.hot { border-color: var(--accent-line); background: var(--accent-soft); }
.pw-item .price { font-weight: 800; }
.pw-free { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .pw-free a { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 4px; align-items: center; }
/* 소개·시작 (MK-01, ON-01/02) */
.landing { max-width: 1100px; margin: 0 auto; }
.ld-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; padding: 30px 0; }
.ld-hero h1 { font-size: clamp(28px, 4vw, 44px); line-height: 1.25; margin: 12px 0; }
.ld-faces { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ld-faces img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; animation: pop .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); }
.ld-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 20px 0; }
.ld-feats i { font-size: 26px; color: var(--accent); } .ld-feats h3 { margin: 8px 0 4px; }
.ld-prereg { margin: 24px 0 40px; }
@media (max-width: 760px) { .ld-hero { grid-template-columns: 1fr; } }
.start { max-width: 1000px; margin: 0 auto; }
.genre-chips button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.start-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 18px; }
.sp-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.sp-media { aspect-ratio: 4 / 3; background: var(--surface-2); } .sp-media img, .sp-media video { width: 100%; height: 100%; object-fit: cover; }
.sp-body { padding: 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sp-preview { font-size: 13.5px; color: var(--text-2); white-space: pre-wrap; line-height: 1.7; flex: 1; margin: 8px 0 12px; max-height: 9.5em; overflow: hidden; }
/* 세계관 관계도 (WD-03) */
.wgraph svg { width: 100%; height: auto; max-height: 460px; }
.wgraph line { stroke: var(--accent-line); stroke-width: 1.5; }
.wgraph .ring { fill: none; stroke: var(--line-2); stroke-width: 2; }
.wgraph text { fill: var(--text); font-size: 13px; text-anchor: middle; } .wgraph .el { fill: var(--text-2); font-size: 11.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
/* 운영 콘솔 */
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 6px; }
.mini-bars .mb { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.mini-bars i { display: block; width: 100%; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; opacity: .85; }
.mini-bars span { font-size: 10px; color: var(--text-3); }
.funnel-row { display: grid; grid-template-columns: 140px 1fr 60px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.funnel-row .bar { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; } .funnel-row .bar i { display: block; height: 100%; background: var(--accent); }
.ctx-log { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ctx-msg { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13.5px; } .ctx-msg p { margin: 4px 0 0; white-space: pre-wrap; }
.ctx-msg.user { background: var(--surface-3); } .ctx-msg.hit { outline: 2px solid var(--bad); }
.bn-thumb { width: 96px; height: 54px; object-fit: cover; border-radius: 8px; flex: none; background: var(--surface-2); }
.av-xs { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.card.warn { border-color: rgba(233,179,90,.4); }
