:root {
  --paper: #faf3e7;   /* 2026-11-21: 더 밝고 부드러운 바탕(이전 #e9dcc8) */
  --paper-deep: #eadcc4;
  --ink: #1a1410;
  --ink-soft: #4a3c32;
  --muted: #7d6e5e;
  --coral: #a43c2c;
  --coral-d: #7e2e22;
  --coral-s: #e8cfc4;
  --gold: #c4924a;
  --cream: #f4ead8;
  --panel: #f7f0e2;
  --kakao: #fee500;
  --line: #1a1410;
  --ok: #3d6b4f;
  --wood: #2f6d45;
  --fire: #c4452f;
  --earth: #c4a035;
  --metal: #7a7468;
  --water: #2c4d6e;
  --sans: "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", "Malgun Gothic", "Gothic A1", sans-serif;
  --serif: "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", "Batang", "Songti SC", serif;
  --shadow: 4px 4px 0 #1a1410;
  --radius: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100%;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
}
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(196,146,74,.16), transparent 55%),
    radial-gradient(circle at 1px 1px, rgba(26,20,16,.07) 1px, transparent 0);
  background-size: auto, 16px 16px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { width: min(430px, 100%); margin: 0 auto; padding: 0 16px 64px; }
.hidden { display: none !important; }

/* top bar */
.topbar {
  width: min(430px, 100%);
  margin: 0 auto;
  padding: 14px 16px 10px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 20;
  background: rgba(250,243,231,.94);
  backdrop-filter: blur(8px);
}
.logo {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; color: inherit; cursor: pointer;
}
.logo-mark {
  width: 36px; height: 36px;
  border: 2.5px solid var(--ink);
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
  display: grid; place-items: center;
  font-family: var(--serif);
  font-weight: 800; font-size: 13px;
  transform: rotate(-4deg);
}
.logo-name { font-family: var(--serif); font-weight: 800; font-size: 18px; letter-spacing: .04em; }
.demo-badge {
  font-size: 10px; font-weight: 700;
  border: 1.5px solid var(--ink);
  padding: 3px 7px; border-radius: 999px;
  background: #fff3bf;
}

/* typography */
h1 { font-family: var(--serif); font-weight: 800; line-height: 1.3; letter-spacing: -.02em; }
h2 { font-family: var(--serif); font-weight: 800; font-size: 20px; margin-bottom: 10px; }
.lead { color: var(--ink-soft); font-size: 14px; line-height: 1.65; }

/* hero */
.hero { padding: 8px 0 18px; }
.hero-panel {
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 16px;
}
.hero-panel img { width: 100%; display: block; aspect-ratio: 3/3.2; object-fit: cover; object-position: top; }
.hero h1 { font-size: 28px; margin: 4px 0 8px; }
.hero h1 em { font-style: normal; color: var(--coral-d); }

.free-banner {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .08em;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 3px 9px;
  margin-bottom: 8px;
}
/* topic cards */
.topics { display: grid; gap: 12px; margin: 18px 0; }
.topic {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  align-items: center;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px 14px;
  text-align: left;
}
.topic b { display: block; font-family: var(--serif); font-size: 18px; }
.topic span { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 4px; }
.free-chip {
  font-style: normal; font-size: 11px; font-weight: 800;
  white-space: nowrap;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 6px 8px;
}
.price { font-weight: 800; font-size: 16px; color: var(--coral-d); }
.price small { display: block; font-weight: 600; font-size: 10px; color: var(--muted); }

.free-sheet {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  margin: 0 0 16px;
  overflow: hidden;
}
.free-sheet h3 {
  font-family: var(--serif); font-size: 16px;
  padding: 12px 12px 0;
}
.free-sheet .sum {
  font-size: 14px; line-height: 1.65;
  padding: 8px 12px 4px;
}
.free-sheet .board { margin-top: 8px; }
.free-label {
  font-size: 10px; font-weight: 800; letter-spacing: .1em;
  color: var(--muted); padding: 10px 12px 0;
}

.locked-list { display: grid; gap: 10px; margin: 8px 0 12px; }
.locked-item {
  border: 3px solid var(--ink);
  background: var(--panel);
  overflow: hidden;
}
.locked-title {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: var(--cream);
  border-bottom: 2px solid var(--ink);
  font-size: 13px; font-weight: 800;
}
.locked-title span {
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  border: 1.5px solid var(--ink);
  padding: 2px 6px;
  background: #fff3bf;
  white-space: nowrap;
}
.locked-peek {
  filter: blur(6px);
  opacity: .5;
  pointer-events: none;
  user-select: none;
  max-height: 120px;
  overflow: hidden;
}
.locked-peek .art { aspect-ratio: 3/1.1; object-position: top; }
.locked-peek .bubbles, .locked-peek .quote, .locked-peek .board, .locked-peek .bars { display: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 2.5px solid var(--ink);
  background: var(--coral); color: #fff;
  font-weight: 800; font-size: 15px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
}
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
.btn.ink { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: var(--cream); color: var(--ink); }
.btn.kakao { background: var(--kakao); color: #191919; }
.btn.kakao .ico {
  width: 18px; height: 18px; border-radius: 50%;
  background: #191919; color: var(--kakao);
  display: grid; place-items: center; font-size: 11px; font-weight: 900;
}
.hint { font-size: 11px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.5; }

/* theory */
.theory { margin: 36px 0 20px; }
.theory-card {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px 16px 8px;
}
.theory h2 { font-size: 18px; }
.theory .lead { margin-bottom: 14px; font-size: 13px; }
.classic-list { list-style: none; display: grid; gap: 10px; margin-bottom: 16px; }
.classic-list li {
  border-top: 1px dashed rgba(27,21,18,.2);
  padding-top: 10px;
}
.classic-list li:first-child { border-top: 0; padding-top: 0; }
.classic-list .han {
  font-family: var(--serif); font-weight: 800; font-size: 15px;
}
.classic-list .han small { font-weight: 700; font-size: 12px; color: var(--coral-d); margin-left: 6px; }
.classic-list p { font-size: 12px; color: var(--ink-soft); line-height: 1.55; margin-top: 2px; }
.sys-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 16px; }
.sys-grid i {
  font-style: normal; font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--ink); padding: 4px 8px;
  background: #fff; border-radius: 999px;
}
.note {
  font-size: 11px; color: var(--muted); line-height: 1.55;
  margin: 0 -16px 0; padding: 10px 16px;
  background: #efe3d2; border-top: 1.5px solid var(--ink);
}

/* footer */
footer.app {
  margin-top: 28px; padding-top: 16px;
  border-top: 2px solid var(--ink);
  font-size: 11px; color: var(--muted); line-height: 1.65;
}

/* form */
.form-card, .read-head {
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px;
  margin: 8px 0 16px;
}
.form-card h2 { font-size: 18px; }
.field { margin: 12px 0; }
.field label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field select {
  width: 100%; border: 2px solid var(--ink);
  background: #fff; padding: 10px 12px; border-radius: 0;
}
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button, .chip {
  border: 2px solid var(--ink); background: #fff;
  padding: 8px 12px; font-size: 13px; font-weight: 700;
}
.seg button.on, .chip.on { background: var(--ink); color: #fff; }
.row3 { display: grid; grid-template-columns: 1.2fr .8fr .8fr; gap: 6px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.place-pick { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 560px) { .place-pick { grid-template-columns: .8fr 1.2fr; } }
.field select:disabled { opacity: 1; color: #555; background: #f4efe4; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }
.form-err { color: var(--coral-d); font-size: 12px; min-height: 1em; margin: 8px 0; }
.adv { font-size: 12px; color: var(--ink-soft); line-height: 1.5; margin-top: 4px; }

/* comic */
.webtoon { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.cut {
  background: var(--panel);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.cut .cut-no {
  font-size: 10px; font-weight: 800; letter-spacing: .12em;
  padding: 6px 10px 0; color: var(--muted);
}
.cut .art {
  width: 100%; aspect-ratio: 3/3.15;
  object-fit: cover; object-position: top;
  display: block; background: #f6efe4;
}
.bubbles { padding: 10px 12px 14px; display: grid; gap: 8px; }
.bubble {
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px 16px 16px 4px;
  padding: 10px 12px;
  font-size: 14px; line-height: 1.65;
  position: relative;
}
.bubble strong { color: var(--coral-d); }

.bubble-wrap { display: block; }
.bubble.bubble-explainable {
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.bubble.bubble-explainable:hover,
.bubble-wrap.is-open .bubble.bubble-explainable {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px var(--coral-s);
}
.easy-hint {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--coral-d);
  opacity: .82;
  display: flex;
  align-items: center;
  gap: 4px;
}
.easy-caret {
  display: inline-block;
  transition: transform .25s ease;
}
.bubble-wrap.is-open .easy-caret { transform: rotate(180deg); }
.easy-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .28s ease;
}
.bubble-wrap.is-open .easy-panel { grid-template-rows: 1fr; }
.easy-panel-inner { overflow: hidden; min-height: 0; }
.easy-box {
  margin-top: 6px;
  padding: 10px 12px 12px;
  border-radius: 12px 12px 12px 4px;
  border: 1.5px solid var(--coral);
  background: var(--coral-s);
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
}
.easy-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  color: var(--coral-d);
  margin-bottom: 8px;
}
.easy-terms { margin: 0 0 8px; padding: 0; }
.easy-terms div { margin: 0 0 8px; }
.easy-terms dt {
  display: inline;
  font-weight: 800;
  font-size: 12px;
  color: var(--coral-d);
  background: #fff;
  border: 1px solid var(--coral);
  border-radius: 8px;
  padding: 1px 7px;
  margin-right: 6px;
  white-space: nowrap;
}
.easy-terms dd {
  display: inline;
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.easy-for-you {
  margin: 0;
  padding-top: 8px;
  border-top: 1px dashed var(--coral);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink);
}

.quote {
  margin: 0 12px 12px;
  padding: 10px 12px;
  background: #f4efe4;
  border-left: 4px solid var(--coral);
  font-size: 12px; line-height: 1.6;
}
.quote .orig { font-family: var(--serif); font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.quote .src { color: var(--muted); font-size: 10px; margin-top: 4px; }

/* pillar board */
.board {
  margin: 0 12px 12px;
  background: #1b1512; color: var(--cream);
  padding: 10px 8px 12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px; text-align: center;
}
.board.cols-3 { grid-template-columns: repeat(3, 1fr); }
.board .col .role { font-size: 10px; color: #c9a15b; margin-bottom: 4px; }
.board .char { padding: 4px 0; }
.board .han { font-family: var(--serif); font-size: 22px; font-weight: 800; line-height: 1; }
.board .ko { font-size: 11px; opacity: .85; }
.board .god { font-size: 10px; color: #e8b0a4; }
.el-wood .han { color: #8fd4a8; } .el-fire .han { color: #f3a394; }
.el-earth .han { color: #ecd37a; } .el-metal .han { color: #d9d4cc; }
.el-water .han { color: #9ec0e0; }

.meta-line { font-size: 11px; color: var(--muted); padding: 0 12px 10px; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 12px; }
.tags i {
  font-style: normal; font-size: 11px; font-weight: 700;
  border: 1.5px solid var(--ink); padding: 3px 8px; background: #fff;
}

/* paywall */
.paywall {
  position: relative;
  margin-top: 4px;
}
.locked-preview { filter: blur(7px); user-select: none; pointer-events: none; opacity: .55; }
.pay-cta {
  position: sticky; bottom: 12px;
  margin: -80px 8px 12px;
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 16px;
  z-index: 5;
}
.pay-cta h3 { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.pay-cta p { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; line-height: 1.55; }
.pay-cta .btn + .btn { margin-top: 8px; }
.pay-cta .price-lg { font-weight: 800; font-size: 20px; color: var(--coral-d); margin: 0 0 10px; }

/* modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(27,21,18,.55);
  display: grid; place-items: end center;
  z-index: 40; padding: 16px;
}
.modal {
  width: min(400px, 100%);
  background: var(--cream);
  border: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px 16px 16px;
}
.modal h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.modal .warn {
  display: inline-block; font-size: 10px; font-weight: 800;
  background: #fff3bf; border: 1.5px solid var(--ink);
  padding: 2px 7px; margin-bottom: 8px;
}
.pay-row {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1.5px dashed rgba(27,21,18,.25);
  padding: 8px 0; font-size: 14px;
}
.pay-row b { font-size: 20px; color: var(--coral-d); }
.pay-methods { display: grid; gap: 8px; margin: 12px 0; }

.bars { padding: 0 12px 12px; display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 24px 1fr 20px; gap: 8px; align-items: center; font-size: 12px; }
.bar-track { height: 8px; background: #efe3d2; border: 1px solid var(--ink); }
.bar-fill { height: 100%; }

.back {
  border: 0; background: none; font-size: 13px; font-weight: 700;
  margin: 4px 0 8px; text-decoration: underline; cursor: pointer;
}

/* ---- visual-novel intro (original frame; not a copy) ---- */
body.intro-on {
  overflow: hidden;
}
#screen-intro {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050403;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
#screen-intro.hidden { display: none !important; }
.intro-col {
  position: relative;
  width: min(430px, 100%);
  height: 100%;
  height: 100dvh;
  background: #050403;
  overflow: hidden;
  touch-action: manipulation;
}
.intro-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050403;
}
.intro-art {
  position: absolute;
  inset: -10% -8%;
  width: 116%;
  height: 120%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0;
  transform: scale(1);
  will-change: transform, opacity;
}
.intro-art.show { opacity: 1; }
.intro-art.ken-a {
  animation: introKenA 16s ease-out forwards;
}
.intro-art.ken-b {
  animation: introKenB 16s ease-out forwards;
}
@keyframes introKenA {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.07) translate(-1.4%, -1.2%); }
}
@keyframes introKenB {
  from { transform: scale(1.06) translate(-1%, 0); }
  to { transform: scale(1) translate(0.6%, -1.5%); }
}
.intro-veil {
  position: absolute;
  inset: 0;
  background: #050403;
  opacity: 1;
  pointer-events: none;
  transition: opacity .48s ease;
  z-index: 2;
}
.intro-veil.clear { opacity: 0; }
.intro-dock {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  padding: 0 14px calc(18px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: linear-gradient(to top, rgba(5,4,3,.72) 0%, rgba(5,4,3,.25) 55%, transparent 100%);
  pointer-events: none;
  max-height: calc(100dvh - 8px);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.intro-dock > * { pointer-events: auto; }

/* original dialogue frame: hanji, ink double-border, dancheong corners */
.intro-box {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgba(26,20,16,.035) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(0deg, rgba(26,20,16,.03) 0 1px, transparent 1px 11px),
    linear-gradient(180deg, #f6edd8 0%, #ead9bc 100%);
  border: 2px solid #1a1410;
  box-shadow:
    0 0 0 3px #ead9bc,
    0 0 0 5px #1a1410,
    0 10px 24px rgba(0,0,0,.45);
  min-height: 118px;
  padding: 18px 16px 16px 16px;
}
.intro-box::before,
.intro-box::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.intro-box::before {
  top: -2px; left: -2px;
  border-top: 3px solid #a43c2c;
  border-left: 3px solid #2c5a4e;
  box-shadow: 3px 3px 0 #c4924a;
}
.intro-box::after {
  bottom: -2px; right: -2px;
  border-bottom: 3px solid #a43c2c;
  border-right: 3px solid #2c5a4e;
  box-shadow: -3px -3px 0 #c4924a;
}
.intro-box-inner { position: relative; }
.intro-speaker {
  position: absolute;
  top: -30px;
  left: 8px;
  background: #1a1410;
  color: #f4ead8;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .12em;
  padding: 3px 11px 4px;
  border: 1px solid #c4924a;
  box-shadow: 2px 2px 0 #a43c2c;
}
.intro-line {
  font-family: var(--serif);
  font-size: 16.5px;
  line-height: 1.65;
  color: #1a1410;
  min-height: 2.6em;
  word-break: keep-all;
}
.intro-caret {
  position: absolute;
  right: 6px;
  bottom: -2px;
  color: #a43c2c;
  font-size: 12px;
  animation: introBlink 1s steps(1) infinite;
}
.intro-caret.hidden { display: none; }
@keyframes introBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}
.intro-prompt { margin-top: 10px; position: relative; z-index: 5; }
.intro-box {
  max-height: none;
}
.intro-prompt.hidden { display: none !important; }
.intro-err {
  color: #a43c2c;
  font-size: 12px;
  margin-top: 6px;
  font-weight: 700;
  min-height: 0;
}
.intro-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.intro-row input[type="text"],
.intro-row select,
.intro-grid select {
  flex: 1;
  min-width: 0;
  background: #fbf6ea;
  border: 1px solid #1a1410;
  color: #1a1410;
  padding: 8px 10px;
  font-size: 15px;
  border-radius: 0;
}
.intro-grid {
  display: grid;
  grid-template-columns: 1.2fr .9fr .9fr;
  gap: 6px;
  width: 100%;
}
.intro-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.intro-chip, .intro-next {
  appearance: none;
  border: 1px solid #1a1410;
  background: #fbf6ea;
  color: #1a1410;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--sans);
}
.intro-chip.on, .intro-next {
  background: #1a1410;
  color: #f4ead8;
}
.intro-next { min-width: 72px; }
.intro-chip:active, .intro-next:active { transform: translate(1px, 1px); }
.intro-note {
  font-size: 11px;
  color: #5a4c40;
  margin-top: 6px;
  line-height: 1.45;
}
.intro-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  margin-top: 6px;
}
.intro-skip {
  align-self: center;
  border: 0;
  background: none;
  color: rgba(244,234,216,.72);
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  padding: 4px 8px;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.intro-skip:hover { color: #f4ead8; }
.intro-skip.hidden { display: none !important; }


/* ---- per-topic palettes ---- */
body.theme-health {
  --paper: #e8efe4;
  --paper-deep: #cfdcc8;
  --ink: #24352a;
  --ink-soft: #3d5346;
  --muted: #6d7f72;
  --coral: #3f6d54;
  --coral-d: #2c5240;
  --coral-s: #d5e4d6;
  --gold: #8aa67a;
  --cream: #f3f7f0;
  --panel: #f7faf5;
  --line: #24352a;
  --shadow: 4px 4px 0 #24352a;
}
body.theme-health { background-color: var(--paper); }
body.theme-wealth {
  --paper: #f3e6c0;
  --paper-deep: #e2cd90;
  --ink: #3a2a10;
  --ink-soft: #5c4318;
  --muted: #8a7040;
  --coral: #c9a227;
  --coral-d: #9a7a14;
  --coral-s: #f3e4a8;
  --gold: #e6c35c;
  --cream: #fff6d6;
  --panel: #fff9e8;
  --line: #3a2a10;
  --shadow: 4px 4px 0 #3a2a10;
}
body.theme-love {
  --paper: #f8e4e8;
  --paper-deep: #edc9d0;
  --ink: #4a2430;
  --ink-soft: #6a3a48;
  --muted: #9a6a76;
  --coral: #c45c6a;
  --coral-d: #9a3d4c;
  --coral-s: #f3d0d6;
  --gold: #e8a0b0;
  --cream: #fff0f3;
  --panel: #fff7f8;
  --line: #4a2430;
  --shadow: 4px 4px 0 #4a2430;
}
body.theme-career {
  --paper: #e4e8f0;
  --paper-deep: #c5cddc;
  --ink: #0e1a2e;
  --ink-soft: #2a3b55;
  --muted: #6a778c;
  --coral: #2c4a7a;
  --coral-d: #1a3160;
  --coral-s: #cfd8e8;
  --gold: #a8b4c4;
  --cream: #eef2f7;
  --panel: #f4f6fa;
  --line: #0e1a2e;
  --shadow: 4px 4px 0 #0e1a2e;
}

.topic-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 60px;
  gap: 8px;
  width: 100%;
  margin: 10px 0 16px;
}
.topic-tabs button {
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px solid #1a1410;
  border-radius: 16px;
  background: #3a332c;
  color: #e8dcc8;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding: 0 6px;
  white-space: nowrap;
  box-shadow: 2px 2px 0 #1a1410;
}
.topic-tabs button.on {
  font-weight: 800;
  box-shadow: 3px 3px 0 #1a1410;
}
.topic-tabs button[data-filter="all"].on {
  background: #a43c2c;
  color: #fff8f0;
}
.topic-tabs button[data-filter="general"].on {
  background: #1a1410;
  color: #f4ead8;
  box-shadow: 3px 3px 0 #c4924a;
}
.topic-tabs button[data-filter="health"].on {
  background: #3f6d54;
  color: #f3f7f0;
}
.topic-tabs button[data-filter="wealth"].on {
  background: #c9a227;
  color: #1a1410;
}
.topic-tabs button[data-filter="love"].on {
  background: #c45c6a;
  color: #fff7f8;
}
.topic-tabs button[data-filter="career"].on {
  background: #2c4a7a;
  color: #e8eef6;
}
.topic.card-health { box-shadow: 3px 3px 0 #3f6d54; }
.topic.card-wealth { box-shadow: 3px 3px 0 #c9a227; }
.topic.card-love { box-shadow: 3px 3px 0 #c45c6a; }
.topic.card-career { box-shadow: 3px 3px 0 #2c4a7a; }
.topic .who {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 700;
}
.disclaimer-med {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
  background: var(--coral-s);
  border: 1px solid var(--ink);
  padding: 8px 10px;
  margin: 8px 0 12px;
}
.legal-page { padding: 8px 0 40px; }
.legal-page h1 { font-family: var(--serif); font-size: 22px; margin: 8px 0 12px; }
.legal-page h2 { font-family: var(--serif); font-size: 16px; margin: 18px 0 6px; }
.legal-page p, .legal-page li { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.legal-page ul { padding-left: 18px; }
.legal-page .ph { background: #fff3b0; padding: 0 3px; }
footer.app a { color: inherit; font-weight: 700; }
.partner-box {
  border: 1px dashed var(--ink);
  background: var(--cream);
  padding: 10px;
  margin: 10px 0;
}
#toss-widget, #toss-agreement { margin-top: 10px; }
.pay-test-note { font-size: 12px; color: var(--ink-soft); margin: 8px 0; }

.pay-cta .pay-sub{margin:4px 0 6px;font-size:14px;opacity:.8}
.btn.kakaopay{background:#FEE500;color:#191919;border-color:#191919}
.btn.naverpay{background:#03C75A;color:#fff;border-color:#191919}
.btn.kakaopay .ico,.btn.naverpay .ico{display:inline-block;margin-right:6px;font-weight:900}


/* sound toggle — fixed, above the intro overlay */
.sound-toggle {
  position: fixed;
  z-index: 90;
  top: calc(54px + env(safe-area-inset-top, 0px));
  right: max(12px, calc(50% - min(215px, 50vw) + 16px));
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--ink);
  background: var(--cream);
  box-shadow: 2px 2px 0 var(--ink);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 17px;
  line-height: 1;
  touch-action: manipulation;
}
body.intro-on .sound-toggle {
  background: #f4ead8;
  color: #1a1410;
  border-color: #1a1410;
  box-shadow: 2px 2px 0 #1a1410;
}
.sound-toggle .sound-icon {
  position: relative;
  display: inline-block;
  font-style: normal;
  font-weight: 700;
}
.sound-toggle.is-off .sound-icon,
.sound-toggle[aria-pressed="false"] .sound-icon {
  opacity: .55;
}
.sound-toggle.is-off .sound-icon::after,
.sound-toggle[aria-pressed="false"] .sound-icon::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  top: 50%;
  height: 2px;
  background: #a43c2c;
  transform: rotate(-28deg);
}


/* back to topic picker — fixed, mirrors the sound toggle */
.back-topics {
  position: fixed;
  z-index: 90;
  top: calc(54px + env(safe-area-inset-top, 0px));
  left: max(12px, calc(50% - min(215px, 50vw) + 16px));
  border: 2px solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding: 8px 11px;
  border-radius: 999px;
  white-space: nowrap;
  touch-action: manipulation;
}
body.intro-on .back-topics {
  background: #f4ead8;
  color: #1a1410;
  border-color: #1a1410;
  box-shadow: 2px 2px 0 #1a1410;
}

#screen-reading #back-input {
  margin-top: 44px; /* sit below the fixed ← 주제 선택 control */
}

.pay-cta.beta-cta .btn { width: 100%; }
.beta-unlock-note {
  margin: 8px 8px 16px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  background: #f4efe4;
  border: 1.5px dashed var(--ink);
  text-align: center;
}

/* ---- 회원가입 / 로그인 (베타 1인 1주제) ---- */
.auth-box { display: flex; align-items: center; gap: 6px; }
.auth-link {
  font-size: 11px; font-weight: 700; color: var(--ink);
  background: var(--cream); border: 1.5px solid var(--ink);
  padding: 3px 8px; border-radius: 999px; cursor: pointer;
}
.demo-badge.member { background: #d8f5e1; }
.modal.signup-modal { position: relative; max-height: calc(100vh - 32px); overflow-y: auto; }
.signup-x {
  position: absolute; top: 8px; right: 10px;
  width: 32px; height: 32px; border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: var(--ink); cursor: pointer;
}
.signup-kicker {
  display: inline-block; font-size: 11px; font-weight: 800;
  border: 1.5px solid var(--ink); background: #fff3bf;
  padding: 2px 8px; border-radius: 999px; margin-bottom: 8px;
}
.signup-lead { margin: 6px 0 14px; }
.signup-methods { display: grid; gap: 8px; }
.signup-btn { position: relative; font-size: 14px; padding: 12px 14px; }
.btn.naver { background: #03C75A; color: #fff; }
.btn.naver .ico { font-weight: 900; }
.signup-btn .ico { width: 18px; text-align: center; }
.signup-btn .soon {
  font-size: 10px; font-weight: 800; margin-left: 6px;
  background: rgba(0,0,0,.72); color: #fff; padding: 2px 6px; border-radius: 999px;
}
.signup-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }
.signup-phone { margin-top: 12px; display: grid; gap: 6px; }
.signup-phone label { font-size: 12px; font-weight: 700; }
.signup-row { display: flex; gap: 6px; }
.signup-row input {
  flex: 1; min-width: 0; font-size: 16px; padding: 10px 10px;
  border: 2px solid var(--ink); background: #fff; color: var(--ink);
}
.signup-row .btn { width: auto; white-space: nowrap; font-size: 13px; padding: 10px 12px; box-shadow: none; }
.signup-row .btn:disabled { opacity: .5; }
.signup-timer { font-size: 12px; color: var(--ink-soft); min-height: 16px; }
.signup-msg { font-size: 13px; font-weight: 700; color: #b23b2a; min-height: 18px; margin-top: 10px; }
.signup-msg.ok { color: #1f7a3d; }
.signup-note { font-size: 11px; color: var(--ink-soft); line-height: 1.55; margin-top: 8px; }
.signup-note a { color: inherit; }
.beta-limit-note { font-size: 12px; color: var(--ink-soft); margin-top: 8px; line-height: 1.5; }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 200;
  width: min(398px, calc(100% - 32px));
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 12px 14px; border-radius: 10px; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
}
#modal-signup { z-index: 120; }
/* 결제창: 토스 위젯이 들어가 화면보다 길어지므로 창 안에서 스크롤, 뒤로 가기 버튼보다 위에 표시 */
#modal-pay { z-index: 120; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; place-items: start center; }
#modal-pay .modal { margin: auto 0; }

/* 베타: 주제 탭 라벨 (종합 무료 / 회원 전용) */
.topic-tabs button { flex-direction: column; gap: 3px; line-height: 1.15; }
.topic-tabs .tab-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding: 1px 6px;
  border-radius: 999px;
  line-height: 1.4;
  white-space: nowrap;
}
.topic-tabs .tab-tag.free { background: #f2d36b; color: #2a1d0e; }
.topic-tabs .tab-tag.member { background: rgba(232, 220, 200, 0.16); color: #e8dcc8; border: 1px solid rgba(232, 220, 200, 0.45); }
.topic-tabs button.on .tab-tag.member { background: rgba(255, 248, 240, 0.22); color: #fff8f0; }
.member-half-note {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #a43c2c;
}
footer.app .biz-info { display: inline-block; margin: 6px 0; font-size: 11px; line-height: 1.6; word-break: keep-all; }
footer.app .biz-info a { color: inherit; }
#modal-account { z-index: 120; }
.account-modal .btn.danger { color: #a43c2c; border-color: #a43c2c; }
.account-modal .btn.danger-fill { background: #a43c2c; border-color: #a43c2c; color: #fff8f0; }
.delete-confirm { margin-top: 10px; padding: 10px; border: 2px dashed #a43c2c; border-radius: 12px; }
.result-disclaimer { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: #6b5a48; background: rgba(255, 248, 235, 0.7); border-left: 3px solid #a43c2c; padding: 6px 10px; }
.pay-refund-box { margin: 10px 0 4px; padding: 8px 10px; font-size: 12px; line-height: 1.6; background: #fff8ec; border: 1.5px solid #c9b79c; border-radius: 10px; text-align: left; }
.pay-refund-box ul { margin: 4px 0 0; padding-left: 16px; }

/* ===== 2026-11-21 개편: 첫 화면 · 한눈에 보기 · 한 줄 정리 · 다음 이야기 · 묶음 결제 ===== */
.hero-v2 { padding: 10px 0 14px; }
.hero-row { display: flex; gap: 14px; align-items: center; }
.hero-copy { flex: 1 1 auto; min-width: 0; }
.hero-v2 h1 { font-size: 27px; line-height: 1.25; }
.hero-v2 .lead { font-size: 15px; }
.hero-panel-sm { flex: 0 0 120px; width: 120px; border-radius: 50%; overflow: hidden; }
.hero-panel-sm img { aspect-ratio: 1/1; }
.hero-cta { width: 100%; margin-top: 14px; padding: 16px 12px; font-size: 18px; font-weight: 800; border-radius: 16px; }
.hero-sub { margin-top: 8px; text-align: center; font-size: 13px; color: var(--muted); }

.sample { margin: 10px 0 18px; }
.sample-label { font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 0 0 8px; }
.sample-label span { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--coral-s); color: var(--coral-d); margin-left: 4px; }

.summary-card {
  background: var(--panel); border: 2.5px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 16px;
}
.summary-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.summary-tag { font-size: 12px; font-weight: 800; background: var(--ink); color: var(--cream); padding: 4px 10px; border-radius: 999px; }
.summary-name { font-size: 13px; color: var(--muted); font-weight: 700; }
.summary-who { font-size: 15px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 10px; }
.summary-who strong { font-size: 20px; color: var(--ink); }
.summary-kw { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.summary-kw span { font-size: 15px; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--coral-s); color: var(--coral-d); }
.summary-year { font-size: 15px; font-weight: 700; margin: 0 0 12px; line-height: 1.55; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.summary-grid div { background: var(--cream); border: 1.5px solid var(--paper-deep); border-radius: 12px; padding: 8px; min-width: 0; }
.summary-grid b { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.summary-grid span { font-size: 15px; font-weight: 800; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.summary-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.2); }
.summary-share { width: 100%; margin-top: 12px; }
.summary-note { margin-top: 8px; font-size: 11px; color: var(--muted); text-align: center; }

.teachers h2 { font-size: 18px; margin: 4px 0 10px; }
.teacher-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.teacher-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 12px 8px; box-shadow: 3px 3px 0 var(--line);
}
.teacher-card:first-child { grid-column: span 2; flex-direction: row; text-align: left; gap: 12px; padding: 12px 14px; }
.teacher-card img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--line); background: var(--cream); }
.teacher-card b { font-size: 15px; }
.teacher-card span { font-size: 12px; color: var(--muted); }
.teacher-card:first-child b, .teacher-card:first-child span { display: block; white-space: nowrap; }
.teacher-tag { font-style: normal; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); margin-top: 4px; }
.teacher-tag.open { background: #dff0e2; color: #2c5d3c; }
.teacher-card:first-child .teacher-tag { margin-left: auto; align-self: center; }

.theory-more > summary, .sheet-more > summary, .cut-more > summary, .intro-place > summary, .extra-info summary {
  cursor: pointer; list-style: none; font-weight: 700; font-size: 14px; color: var(--ink-soft);
}
.theory-more > summary::-webkit-details-marker, .sheet-more > summary::-webkit-details-marker, .cut-more > summary::-webkit-details-marker, .intro-place > summary::-webkit-details-marker, .extra-info summary::-webkit-details-marker { display: none; }
.theory-more > summary::after, .sheet-more > summary::after, .cut-more > summary::after, .extra-info summary::after { content: " ▾"; }
.theory-more[open] > summary::after, .sheet-more[open] > summary::after, .cut-more[open] > summary::after, .extra-info details[open] summary::after { content: " ▴"; }
.theory-more > summary { padding: 4px 0; }
.theory-more[open] > summary { margin-bottom: 10px; }
.sheet-more > summary { padding: 2px 0; }
.sheet-more[open] > summary { margin-bottom: 8px; }

.cut-lead { margin: 12px 14px 4px; padding: 12px 14px; background: var(--cream); border: 2px solid var(--line); border-radius: 14px; }
.cut-lead-tag { display: inline-block; font-size: 11px; font-weight: 800; color: var(--coral-d); background: var(--coral-s); padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.cut-lead-text { font-size: 17px; font-weight: 700; line-height: 1.6; color: var(--ink); margin: 0; }
.cut-more { margin: 8px 14px 12px; }
.cut-more > summary { font-size: 13px; padding: 6px 0; color: var(--muted); }
.cut-more[open] > summary { margin-bottom: 6px; }

.locked-tease { margin: 6px 12px 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.locked-blur { filter: blur(4px); user-select: none; color: var(--muted); }

.pay-option { width: 100%; margin-top: 10px; flex-direction: column; gap: 2px; position: relative; }
.pay-option small { font-size: 11px; font-weight: 400; opacity: .85; }
.pay-badge { position: absolute; top: -10px; left: 12px; background: var(--coral); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }

.hooks { margin: 18px 0 8px; }
.hooks h3 { font-size: 18px; margin-bottom: 4px; }
.hooks-sub { font-size: 13px; color: var(--muted); margin-bottom: 10px; line-height: 1.55; }
.hook-card {
  width: 100%; display: flex; flex-direction: column; gap: 4px; text-align: left; margin-bottom: 10px;
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: 3px 3px 0 var(--line);
}
.hook-who { font-size: 12px; font-weight: 800; color: var(--coral-d); }
.hook-line { font-size: 15px; font-weight: 700; line-height: 1.55; }
.hook-go { font-size: 13px; font-weight: 800; color: var(--ink-soft); align-self: flex-end; }

.extra-info { margin: 14px 0 4px; padding: 12px 14px; border: 1.5px dashed var(--paper-deep); border-radius: 14px; background: var(--cream); }
.extra-label { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; }
.extra-info .intro-chip { color: var(--ink); background: var(--panel); border-color: var(--line); }
.extra-info .intro-chip.on { background: var(--ink); color: var(--cream); }
.intro-place { margin-top: 8px; font-size: 13px; }
.intro-place > summary { font-size: 13px; color: inherit; opacity: .85; }
.reading-loading { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0; }
