/* 화면 모드 (design/mockups/home-white, C2): 밝게 is the default — white page, ink buttons, gold only as an accent.
   어둡게 (data-theme="dark", set by theme.js from 설정) keeps the earlier dark look with gold buttons. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --panel: #f6f4f0;
  --line: #e8e2d8;
  --field-line: #d6cec0;
  --text: #1a1714;
  --muted: #776d62;
  --gold: #a8761f;
  --accent: #c0603f;
  --btn: #1a1714;
  --on-btn: #ffffff;
  --raised: #ffffff;
  --chip-bg: #efebe4;
  --soft: rgba(26, 23, 20, .04);
  --page: #f3f1ed;
  --bar: rgba(255, 255, 255, .97);
  --footer: #f7f5f1;
  --sheet: #ffffff;
  --sheet-panel: #f6f4f0;
  --sheet-line: #ebe6de;
  --danger: #c8423a;
  --scrim: rgba(20, 16, 10, .45);
  --card-shadow: 0 6px 14px rgba(40, 30, 15, .16);
  --arrow: rgba(255, 255, 255, .95);
  --card-back: url(/images/card-back.svg) center / 100% 100% no-repeat, #1b1915;
  --display: "Paperlogy", "Pretendard Variable", "Apple SD Gothic Neo", sans-serif;
  font-family: "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --panel: #1c1b1a;
  --line: rgba(255, 255, 255, .14);
  --field-line: rgba(255, 255, 255, .28);
  --text: #f2ede4;
  --muted: #a59d90;
  --gold: #e8c27a;
  --accent: #d9846a;
  --btn: #e8c27a;
  --on-btn: #241d10;
  --raised: #2a2826;
  --chip-bg: #2a2826;
  --soft: rgba(255, 255, 255, .06);
  --page: #0a0a0a;
  --bar: rgba(18, 18, 18, .97);
  --footer: #0c0c0c;
  --sheet: #1c1b1a;
  --sheet-panel: #242220;
  --sheet-line: #3a3632;
  --danger: #ff8a80;
  --scrim: rgba(0, 0, 0, .7);
  --card-shadow: 0 6px 14px rgba(0, 0, 0, .45);
  --arrow: rgba(28, 27, 26, .85);
}
/* 밝게 (design/mockups/hero-compare, C): the approved full-width picture fading into the page, as on 어둡게, with a longer,
   softer fade so the white does not wash over it; a white glow behind the title, and the small kicker on a white pill so
   it stays readable over the picture. */
:root:not([data-theme="dark"]) .today-hero-art {
  -webkit-mask-image: linear-gradient(to bottom, #000 48%, rgba(0, 0, 0, .15) 82%, transparent 97%);
  mask-image: linear-gradient(to bottom, #000 48%, rgba(0, 0, 0, .15) 82%, transparent 97%);
}
:root:not([data-theme="dark"]) .today .today-hero h2 { text-shadow: 0 0 14px rgba(255, 255, 255, .9); }
:root:not([data-theme="dark"]) .today-hero .today-kicker { display: inline-block; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .9); text-shadow: none; }
/* 밝게: chips and the card window sit on white with a hairline, not on the grey panel. */
:root:not([data-theme="dark"]) .chip { background: var(--bg); }
:root:not([data-theme="dark"]) .rail-arrow { color: var(--text); border: 1px solid var(--line); }
:root:not([data-theme="dark"]) .modal-body:not(.sheet) { padding: 16px 16px 20px; border-radius: 18px; background: var(--sheet); }
:root:not([data-theme="dark"]) .modal-body:not(.sheet) img { max-height: 60vh; }

* { box-sizing: border-box; }
/* The scrollbar's room is kept on every page, so short pages (로그인) and long ones (홈) centre alike. */
html { scrollbar-gutter: stable; }
/* One app column (430px) on every screen, results included, the darker page around it on a computer. */
/* Korean breaks between words, not inside one (로 / 그인하면); a long unbroken string may still break anywhere. */
body { margin: 0; min-height: 100vh; color: var(--text); background: var(--page); word-break: keep-all; overflow-wrap: break-word; }
#app { min-height: 100vh; margin: 0 auto; padding: 0 16px 96px; max-width: 430px; background: var(--bg); }
/* The page's text sent by the server (server/seo.js pageText), shown only until the script draws the page. */
/* It stays in the page for search engines but out of sight (a slow script showed it as a bare list of links); if the
   script takes over 0.4s, the moon mark shows in its place. Without scripts, index.html's <noscript> shows the text. */
.ssr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
/* A screen still fetching its list (.page-loading: 내 리딩 기록, 문의하기) shows the same mark. */
#app:has(> .ssr)::before, #app:has(.page-loading)::before {
  content: ""; position: fixed; left: 50%; top: 42%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: url(/icons/favicon-small.svg?v=8) center / contain no-repeat; animation: ssr-in .3s .4s backwards, ssr-pulse 1.4s .7s ease-in-out infinite;
}
/* Waiting signs (this pulse, .today-dots, the 해석 중 spinner) move with "reduce motion" too: they only fade in place,
   and a still one reads as a frozen screen. */
@keyframes ssr-in { from { opacity: 0; } }
@keyframes ssr-pulse { 50% { opacity: .35; } }
@media (min-width: 431px) { #app { box-shadow: 1px 0 0 var(--line), -1px 0 0 var(--line); } }
a { color: inherit; }
.muted { color: var(--muted); }
.center { text-align: center; }
.error { color: var(--danger); }

/* The head of every screen but home: ‹ at the left, the screen's buttons at the right, on the page's own background. */
/* Over every card of a result as it scrolls under: a crossing card is stacked at one more than the places (11 for
   켈틱 크로스) and an opened name at 100 (.slot:has(.label.open)). Sheets (#modal, 1000) still cover it. */
.topbar { position: sticky; top: 0; z-index: 120; display: flex; align-items: center; justify-content: space-between; height: 56px; margin: 0 -16px; padding: 0 6px; background: var(--bg); }
.topbar .icon-button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
.topbar .icon-button:hover { background: var(--panel); }
.topbar .icon { width: 22px; height: 22px; }
.topbar-extra { display: flex; }

/* Home: the logo with sign-in apart at the right, 오늘의 카드, topics, spreads, FAQ. */
.site-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; }
.site-head .logo { margin: 0; line-height: 0; }
.site-head .logo a { display: inline-block; }
/* The logo: the tab icon (a violet card with a crescent) beside the name. */
.site-head .logo img { display: block; width: 22px; height: 22px; }
a.head-login { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-weight: 600; font-size: .88rem; text-decoration: none; }
.head-actions { display: flex; align-items: center; gap: 2px; }
.head-actions > :first-child { margin-right: 4px; }
/* 코인 left: the coin and the count, linking to 코인. */
a.head-credits { display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 0 12px 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font-weight: 700; font-size: .92rem; text-decoration: none; font-variant-numeric: tabular-nums; }
a.head-credits[hidden] { display: none; }
.head-credits .coin { width: 20px; height: 20px; }
/* ☰ (menu); 문의하기 lives in the menu and under 자주 묻는 질문. */
.head-icon.icon-button { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--text); }
.head-icon.icon-button:hover { background: var(--panel); }
.head-icon .icon { width: 22px; height: 22px; }

/* ☰ panel (design/mockups/menu-coin, 2): from the right over the page, 내 계정's contents. */
#modal:has(> .menu-panel) { justify-content: flex-end; align-items: stretch; }
#modal > .modal-body.menu-panel { position: relative; border-radius: 0; display: flex; flex-direction: column; width: min(340px, 86vw); max-width: none; height: 100%;
  padding: 52px 18px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom))); overflow-y: auto; background: var(--bg); text-align: left;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .18); animation: slide-in .22s ease-out; }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .modal-body.menu-panel { animation: none; } }
.menu-panel .close { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--text); }
.menu-panel .profile { margin-top: 0; }
.menu-wallet { padding: 14px; border: 1px solid var(--line); border-radius: 16px; }
.menu-wallet:empty { display: none; }
.menu-wallet .bal { display: flex; align-items: center; justify-content: space-between; }
.menu-wallet .bal span { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.menu-wallet .bal .coin { width: 22px; height: 22px; }
.menu-wallet .bal strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.menu-wallet p { margin: 6px 0 12px; color: var(--muted); font-size: .78rem; }
.menu-panel .charge { display: grid; place-items: center; width: 100%; min-height: 46px; padding: 0; border: 0; border-radius: 12px;
  background: var(--btn); color: var(--on-btn); font-weight: 800; text-decoration: none; }
.menu-guest { padding: 16px; border-radius: 16px; background: var(--panel); }
.menu-guest strong { font-size: 1.05rem; }
.menu-guest p { margin: 6px 0 12px; color: var(--muted); font-size: .82rem; line-height: 1.5; }
.menu-wallet .bal + .charge { margin-top: 12px; }
.section-title { margin: 0 0 10px; font-size: 1.12rem; }
/* The logo, home headings and topic names share the display face. */
.section-title, .today h2, .topic strong { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; }
.site-head .logo a { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-family: var(--display); font-size: 1.4rem; font-weight: 700; line-height: 1; letter-spacing: -.03em; text-decoration: none; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; }
.row-head a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-size: .85rem; }
/* 오늘의 카드: before the pick, a card's picture across the width with the title over it; after it, today's card beside
   its keywords. Either way the home's two things to do follow: one gold button and 질문하기. */
.today { position: relative; margin: 4px 0 22px; }
/* The approved mockup's crop (360×300, 18% from the top): the height follows the width, so every screen shows the same part. */
/* Home, first time in a visit (design/mockups/home-motion, 3): the picture comes slightly closer and the parts rise in
   one after another, once. Nothing moves for "reduce motion". The end frames equal the resting styles, so the animations
   fill backwards only and are not held (each held one kept its element on a compositing layer for good). */
@media (prefers-reduced-motion: no-preference) {
  .home.intro > * { animation: home-rise .6s cubic-bezier(.2, .8, .2, 1) backwards; }
  .home.intro > :nth-child(2) { animation-delay: 90ms; }
  .home.intro > :nth-child(3) { animation-delay: 180ms; }
  .home.intro > :nth-child(4) { animation-delay: 270ms; }
  .home.intro > :nth-child(5) { animation-delay: 360ms; }
  .home.intro > :nth-child(n+6) { animation-delay: 450ms; }
  /* The zoom runs on the masked frame, not on the picture inside it: zooming the picture while the hero rises let the
     browser draw the picture and its fade apart, and mid-pixel the picture's last row showed below the fade as a line.
     Scaled from the bottom centre, 1.0893 × the resting 1.12 = the earlier 1.22 start. */
  .home.intro .today-hero-art { animation: home-zoom 1.4s cubic-bezier(.2, .8, .2, 1) backwards; transform-origin: 50% 100%; }
}
@keyframes home-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes home-zoom { from { opacity: .4; transform: scale(1.0893); } to { opacity: 1; transform: none; } }
.today-hero { position: relative; aspect-ratio: 360 / 300; margin: 0 -16px; overflow: hidden; }
/* The picture fades out into the page by its own transparency (a mask), not under a page-coloured layer: the hero's
   height follows the width and often ends mid-pixel, and there a covering layer only partly painted the last pixel row,
   which let the picture show through as a faint line. Fading to transparent leaves nothing there to show. The mask is
   not repeated: drawn a row short of a mid-pixel bottom, a repeated mask started over (opaque) in that last row. Even
   so the browser can leave the last row of a mid-pixel box unmasked (seen while the page comes in), so the picture runs
   6px past the hero, which clips it: the hero's own bottom then falls in the mask's fully transparent end. */
.today-hero-art { display: block; height: calc(100% + 6px);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 96%); mask-image: linear-gradient(to bottom, #000 40%, transparent 96%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; }
.today-hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; transform: scale(1.12); }
.today-hero-text { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 16px; }
.today-kicker { margin: 0; color: var(--gold); font-size: .8rem; font-weight: 700; }
.today-hero .today-kicker { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.today .today-hero h2 { margin: 4px 0 0; font-size: 1.6rem; line-height: 1.22; text-shadow: 0 2px 10px rgba(0, 0, 0, .7); }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.duo > :only-child { grid-column: 1 / -1; }
.duo .primary, .duo .ghost { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 8px; border-radius: 12px; font-weight: 700; text-decoration: none; }
/* a.button.primary's old gold text (below) must not reach the box's main button, a link once today's card is picked. */
.duo .primary, .duo a.button.primary { gap: 6px; border: 0; background: var(--btn); color: var(--on-btn); }
.duo .ghost { border: 1px solid var(--line); background: none; color: var(--text); font-weight: 600; }
.duo .with-sub { flex-direction: column; gap: 1px; padding: 6px 10px; }
.duo .with-sub > span { display: flex; align-items: center; gap: 6px; }
.duo .with-sub small { opacity: .78; font-size: .76rem; font-weight: 600; }
.duo .ghost:hover { border-color: var(--gold); }
.today > .today-kicker, .today > .today-head { margin: 10px 0 12px; }
.today > .today-head { margin-right: -6px; }
/* 오늘의 카드 뽑기: the three backs in their sheet. */
/* Room above the backs for the picked card, grown 1.45 times in the middle (design/mockups/today-motion, 4). */
.today-sheet .today-backs { min-height: 250px; padding: 24px 0 16px; }
.today-sheet > .muted { margin: 2px 0 0; }
.today-backs { display: flex; justify-content: center; align-items: flex-end; gap: 12px; padding-top: 14px; }
button.today-back { width: 86px; height: 147px; padding: 0; border-radius: 8px; border: 1.5px solid var(--gold);
  background: var(--card-back); box-shadow: 0 6px 16px rgba(0, 0, 0, .45); transition: transform .2s, opacity .3s; }
/* The three cards lie fanned out; the one touched or picked rises with a gold glow. */
button.today-back:first-child { transform: rotate(-8deg) translateY(6px); }
button.today-back:last-child { transform: rotate(8deg) translateY(6px); }
button.today-back:hover, button.today-back.picked { transform: translateY(-14px);
  box-shadow: 0 0 24px rgba(232, 194, 122, .45), 0 10px 24px rgba(0, 0, 0, .5); }
/* Picked: to the middle (its place set by pick); the other two shrink away; turned, today's card on it. */
/* Disabled only so a second tap does nothing while the pick plays; not the faded look of other buttons. Before .gone,
   which fades the other two on purpose. */
button.today-back:disabled { opacity: 1; cursor: default; }
button.today-back.centre { position: relative; z-index: 1; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
button.today-back.gone { opacity: 0; transform: scale(.8); }
/* Turned over: the picture alone, without the back's gold edge. */
button.today-back.face { overflow: hidden; border: 0; background: none; }
.today-back.face img { display: block; width: 100%; height: 100%; object-fit: cover; }
.today-back.face img.reversed { transform: rotate(180deg); }
.today-result { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 16px; background: var(--panel); color: inherit; text-decoration: none; }
.today-face { flex: none; width: 92px; border-radius: 6px; background: #fff; }
span.today-face { display: grid; place-items: center; height: 128px; padding: 4px; color: #2a2733; font-size: .75rem; text-align: center; }
.today-face.reversed { transform: rotate(180deg); }
.today-result strong { display: block; }
.today-body { flex: 1; min-width: 0; }
.today-go { flex: none; display: grid; color: var(--muted); }
.today-go .icon { width: 20px; height: 20px; }
.today-result .muted { display: -webkit-box; margin-top: 6px; font-size: .82rem; line-height: 1.5; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* design/mockups/today-auto: the reading written into the box, up to four lines, in the text colour. */
.today-result .today-text.reading { color: var(--text); -webkit-line-clamp: 4; }
.today-error { display: block; margin-top: 6px; color: #b3412e; font-size: .85rem; font-weight: 600; }
:root[data-theme="dark"] .today-error { color: #f08b74; }
.today-dots { display: inline-flex; gap: 4px; margin-left: 4px; vertical-align: middle; }
.today-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold); animation: today-blink 1.2s infinite; }
.today-dots i:nth-child(2) { animation-delay: .2s; }
.today-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes today-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.today-caret { display: inline-block; width: 2px; height: 1em; margin-left: 1px; background: var(--gold); vertical-align: -2px; }
.duo .today-busy:disabled { background: var(--panel); color: var(--muted); opacity: 1; cursor: default; }
/* 접기 sits quietly under the result; folded, a small face-down card and 펼치기 take its place. */
/* The heading with 접기 at its right; the button's tap area overlaps the space around it, not the box below. */
.today-head { display: flex; justify-content: space-between; align-items: center; margin: -2px -6px 2px 0; }
.today-head .today-kicker { margin: 0; }
.today-head button.fold { margin: -10px 0; font-size: .8rem; }
button.fold { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 8px; border: 0; border-radius: 8px; background: none;
  color: var(--muted); font: inherit; font-size: .82rem; }
button.fold:hover { color: var(--text); }
.today.folded { padding-bottom: 16px; }
.today.folded > p { margin-bottom: 12px; }
.folded-body { display: flex; align-items: center; gap: 12px; }
.mini-back { flex: none; width: 34px; height: 58px; border-radius: 5px; border: 1px solid var(--gold); background: var(--card-back); }
.folded-text { flex: 1; font-size: .85rem; line-height: 1.5; }
button.unfold { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px; border: 1px solid var(--gold); border-radius: 999px;
  background: none; color: var(--gold); font: inherit; font-size: .85rem; font-weight: 600; }
button.unfold:hover { background: rgba(232, 194, 122, .12); }
button.fold:focus-visible, button.unfold:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
button.fold .icon, button.unfold .icon { width: 16px; height: 16px; }
/* design/mockups/today-contact, 4–5: after the pick one main button and a quiet 질문하기 line; folded, one thin strip. */
.duo.solo { grid-template-columns: 1fr; }
.today-alt { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: .86rem; }
.today-alt a { color: var(--text); font-weight: 600; text-underline-offset: 3px; }
button.unfold.today-strip { display: flex; width: 100%; gap: 12px; min-height: 0; padding: 10px 14px 10px 10px; border: 0; border-radius: 14px;
  background: var(--panel); color: var(--muted); text-align: left; font-weight: 400; }
button.unfold.today-strip:hover { background: var(--soft); }
.today-strip .mini-back { width: 26px; height: 44px; border-radius: 4px; }
.strip-text { display: flex; flex: 1; flex-direction: column; }
.strip-text strong { color: var(--text); font-size: .92rem; }
.strip-text small { font-size: .78rem; }
.today-strip .icon { width: 20px; height: 20px; }
/* 무엇이 궁금해요?: a row of whole cards that scrolls sideways, each with the topic's name under it. */
.topics { display: flex; gap: 10px; margin: 0 -16px 18px; padding: 2px 16px 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px; scrollbar-width: none; }
.topics::-webkit-scrollbar { display: none; }
.topic { flex: none; display: flex; flex-direction: column; width: 116px; scroll-snap-align: start; color: inherit; text-decoration: none; }
.topic-card { display: none; }
/* The whole picture (240×430); a major card (연애·재회, 질문하기, 올해 운세) is enlarged from the top so its white name
   strip (the bottom 40 rows) falls outside, at the same card size as the others. */
.topic-art.topic-love img, .topic-art.topic-question img, .topic-art.topic-year img { width: 110.3%; height: 110.3%; margin-left: -5.15%; }
.topic-art { display: block; flex: none; width: 116px; aspect-ratio: 240 / 430; overflow: hidden; border-radius: 10px; background: var(--panel); box-shadow: var(--card-shadow); }
.topic-art img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0; transition: transform .2s; }
/* Only with a mouse: a phone would keep the zoom after a tap (design/mockups/topic-hover, A). */
@media (hover: hover) { .topic:hover .topic-art img { transform: scale(1.04); } }
.topic:focus-visible { outline: none; }
.topic:focus-visible .topic-art { outline: 2px solid var(--gold); outline-offset: 2px; }
.topic strong { margin-top: 8px; font-size: .95rem; }
.topic small { margin-top: 2px; color: var(--muted); font-size: .76rem; line-height: 1.35; text-wrap: balance; }
.recent { margin-bottom: 24px; }
/* Sections on the home are parted by their titles and space only, so the last reading has no line under it. */
.recent .history-list li:last-child { border-bottom: 0; }
/* Home, pressing (with the spread tiles' C): a topic's picture sinks a little, a recent reading's row and a question
   take the soft tint, and an answer fades in as it opens. */
.topic, .recent .history-list a, .faq summary { -webkit-tap-highlight-color: transparent; }
.topic-art { transition: transform .12s ease; }
.recent .history-list a { border-radius: 12px; transition: background-color .15s; }
.recent .history-list a:hover, .recent .history-list a:active, .faq summary:active { background: var(--soft); }
@media (prefers-reduced-motion: no-preference) {
  .topic:active .topic-art { transform: scale(.96); }
  .faq details[open] p { animation: faq-open .22s ease-out; }
}
/* Where the browser can, the answers slide open and shut, so switching questions moves both smoothly
   instead of the one above snapping shut and jumping the new one into place. */
@supports (interpolate-size: allow-keywords) {
  @media (prefers-reduced-motion: no-preference) {
    .faq { interpolate-size: allow-keywords; }
    .faq details::details-content { height: 0; overflow: hidden; transition: height .25s ease, content-visibility .25s allow-discrete; }
    .faq details[open]::details-content { height: auto; }
  }
}
@keyframes faq-open { from { opacity: 0; transform: translateY(-4px); } }
/* 자주 묻는 질문: a small gold dot before each question, a gold chevron at the right that turns when it opens. */
.faq { padding-top: 18px; }
.faq details { border-bottom: 1px solid var(--line); }
/* The last question needs no rule: the 문의하기 button below already closes the list. */
.faq details:last-of-type { border-bottom: 0; }
.faq summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 12px 2px; list-style: none; cursor: pointer;
  color: var(--text); font-size: .9rem; font-weight: 500; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: ""; flex: none; width: 4px; height: 4px; border-radius: 50%; background: rgba(232, 194, 122, .6); }
.faq summary span { flex: 1; }
.faq summary .icon { flex: none; width: 16px; height: 16px; color: var(--gold); transition: transform .2s; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { margin: 0 0 14px 14px; font-size: .85rem; line-height: 1.65; }
.faq .ask { display: flex; justify-content: center; margin: 0; padding: 18px 0 4px; }
.faq .ask a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(232, 194, 122, .45);
  color: var(--gold); font-size: .82rem; font-weight: 600; text-decoration: none; }
.faq .ask a:hover { background: rgba(232, 194, 122, .1); }
.faq .ask .icon { width: 15px; height: 15px; }
/* Draw pages: the spread and deck in one line with 바꾸기 (design/mockups/polish-2, 7 B); a topic's example questions to tap in. */
.draw-setup-line { margin: 6px 0 2px; }
/* Right under a spread's title: the row is a 36px button with its text in the middle, so -2px leaves the title and
   the deck name 8px apart, like every title and the line under it (design/mockups/title-spacing). */
.page-title + .draw-setup-line { margin-top: -2px; }
/* A topic's title, intro and 배열 · 덱 line 8px apart, one block (design/mockups/spread-sheet-fix, 7 A): 4px then
   16px made the setup line read as a third, loosely spaced sentence. */
.page-title + .muted.center:has(+ .draw-setup-line) { margin: 8px 0 0; }
.muted.center + .draw-setup-line { margin: -2px 0 8px; }
.setup-line { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; padding: 4px 0; border: 0; background: none;
  color: var(--muted); font: inherit; font-size: .84rem; text-align: left; cursor: pointer; }
.setup-line-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.setup-line-text b { color: var(--text); font-weight: 600; }
.setup-line:hover .setup-change { text-decoration: underline; text-underline-offset: 3px; }
.sheet-menu button small { display: block; margin-top: 1px; color: var(--muted); font-size: .76rem; font-weight: 400; text-align: left; }
.sheet-menu button > span { min-width: 0; text-align: left; }
.setup-change { display: inline-flex; flex: none; align-items: center; gap: 2px; color: var(--gold); }
.setup-change .icon { width: 14px; height: 14px; }
/* Buttons, tabs and menus do not get text-selected by a stray drag; questions, readings and card meanings still can. */
button, nav, .tabs, .tabbar, .topbar, .spread, .card { user-select: none; -webkit-user-select: none; }
/* Screens under the left-aligned title read from the left too; the draw's main button is the one gold button. */
.page-title + .muted.center { text-align: left; }
.stage button.primary { width: 100%; min-height: 52px; border: 0; border-radius: 12px; background: var(--btn); color: var(--on-btn); font-weight: 700; font-size: 1rem; }
.account-links { display: flex; justify-content: center; gap: 8px; }
/* The tab bar at the bottom of every screen; the lit tab is the screen's section. */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: center; max-width: 430px; margin: 0 auto;
  border-top: 1px solid var(--line); background: var(--bar); padding-bottom: var(--safe-bottom, env(safe-area-inset-bottom)); }
.tabbar a { max-width: 170px; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 54px; padding: 8px 0 6px;
  color: var(--muted); font-size: .72rem; text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--gold); }
.tabbar .icon { width: 22px; height: 22px; }
@media print { .tabbar { display: none; } }
.page-title { text-align: left; color: var(--text); font-family: var(--display); font-size: 1.5rem; letter-spacing: -.03em; margin: 4px 0 0; }
/* Every page's line under its title (design/mockups/title-spacing): 8px under the title, 16px before what follows. */
.page-title + .muted { margin: 8px 0 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.chip, button, select, input.question, textarea.question, a.button {
  font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px;
}
a.button { display: inline-block; text-decoration: none; }
/* Lucide icons (icons.js) take the text colour; an icon-only button centres its icon, its name is the tooltip. */
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
a.icon-button, button.icon-button { display: inline-flex; align-items: center; justify-content: center; }
.controls .icon-button { width: 42px; height: 42px; padding: 0; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
.chip.active, button.primary, a.button.primary { border-color: var(--gold); color: var(--gold); }
/* Sign-in buttons in each provider's colours (Kakao yellow, Naver green, Google white). */
/* 로그인: a night-sky welcome with a fan of card backs, three benefits, then full-width buttons. */
/* 로그인: three real cards fanned, one line on what signing in adds, then the buttons. */
/* Lowered toward the middle of tall screens; the tilted outer cards get room above the title. */
.login-head { margin: clamp(10px, 9vh, 88px) 0 20px; text-align: center; }
.login-fan { display: flex; justify-content: center; align-items: flex-end; height: 180px; margin-bottom: 30px; }
/* The Waite cards (966x1712, margin and black line already cut by tools/cut-waite-frame.mjs) show whole. Light shadow
   on the white page, the deeper one stays for 어둡게. */
.login-card { position: relative; flex: none; width: 92px; aspect-ratio: 966 / 1712; overflow: hidden; border-radius: 6px; background: var(--panel); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); will-change: transform; outline: 1px solid transparent; }
.login-card img { display: block; width: 100%; height: 100%; }
:root[data-theme="dark"] .login-card { box-shadow: 0 10px 24px rgba(0, 0, 0, .55); }
.login-card:nth-child(1) { transform: rotate(-9deg) translate(14px, 8px); }
.login-card:nth-child(2) { z-index: 1; transform: translateY(-6px); }
.login-card:nth-child(3) { transform: rotate(9deg) translate(-14px, 8px); }
.login-head h1 { margin: 0; font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: -.03em; }
.login-head p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
a.login-button { position: relative; }
.last-login { position: absolute; top: -9px; left: 14px; padding: 2px 8px; border-radius: 6px; background: var(--text); color: var(--bg); font-size: .7rem; font-weight: 700; }
.login-buttons { display: flex; flex-direction: column; gap: 10px; margin: 0; }
/* Official brand marks just before the label (Kakao: symbol required, radius 12px; Naver: green #03A94D). */
a.login-button { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px; padding: 12px; border-radius: 12px; text-align: center; text-decoration: none; font-size: 1.02rem; font-weight: 600; }
a.login-button img { width: 20px; height: 20px; flex: none; }
a.login-button.kakao { background: #fee500; color: rgba(0, 0, 0, .85); }
a.login-button.naver { background: #03a94d; color: #fff; }
a.login-button.google { background: #fff; color: #1f1f1f; border: 1px solid #747775; }
/* 미니앱 (app.js MINIAPP): 토스 로그인 alone, in Toss blue; Toss's own bar has the back button, so ‹ is hidden. */
button.login-button.toss { width: 100%; min-height: 54px; padding: 12px; border: 0; border-radius: 12px; background: #3182f6; color: #fff; font-size: 1.02rem; font-weight: 600; }
.miniapp .topbar .back { visibility: hidden; }
/* 미니앱, a titled screen: Toss's bar has the back button, so the head takes no row of its own; its buttons (가이드)
   float at the right of the title's line. */
.miniapp .topbar:has(+ .page-title) { position: static; float: right; height: 44px; margin: 12px -10px 0 8px; padding: 0; background: none; }
.miniapp .topbar:has(+ .page-title) .back { display: none; }
/* Padding, not margin: a top margin would collapse out of #app and leave the float above the title's line. */
.miniapp .topbar + .page-title { margin-top: 0; padding-top: 16px; }
.login-note { margin: 16px 4px 0; font-size: .78rem; line-height: 1.6; word-break: keep-all; }
.login-note a { color: var(--text); text-underline-offset: 3px; }
/* 자리 이름: three choices side by side, the chosen one in gold. */
.segmented { display: flex; gap: 4px; margin: 8px 0; padding: 4px; border-radius: 12px; background: var(--panel); }
.segmented button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; padding: 8px 4px; background: none; color: var(--muted); font-size: .9rem; }
.segmented button.on { background: var(--raised); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.setting-choices { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; }
.setting-choices li { margin: 2px 0; }
.member-code { margin-bottom: 2px; }
.member-code strong { letter-spacing: .04em; }
.account-delete { margin-top: 32px; font-size: .85rem; color: var(--muted); }
.rail-arrow {
  display: none; position: absolute; top: 72px; z-index: 2; width: 34px; height: 34px; padding: 0;
  border-radius: 50%; background: var(--arrow);
}
.rail-arrow .icon { width: 20px; height: 20px; }
/* In a light sheet (덱 바꾸기) the arrows are light circles, so they sit lightly on the cards. */
.modal-body.sheet .rail-arrow { background: var(--raised); color: var(--text); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.rail-arrow.prev { left: 0; }
.rail-arrow.next { right: 0; }
/* Arrows only for mouse users; touch screens swipe. Hidden at the end they would scroll toward. */
@media (hover: hover) and (pointer: fine) {
  .rail-arrow { display: flex; align-items: center; justify-content: center; }
  .topic-rail.at-start .rail-arrow.prev, .topic-rail.at-end .rail-arrow.next { display: none; }
  .topics { cursor: grab; }
}
/* 카드 뜻 in the card window: keyword chips over a short paragraph. */
.card-meaning { margin-top: 12px; text-align: left; }
.card-keywords { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 10px; }
.card-keywords span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold); font-size: .8rem; }
/* 무엇이 궁금해요?: the arrows sit at the middle of the card pictures. */
.topic-rail { position: relative; }
.topic-rail .rail-arrow { top: 88px; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.topic-rail .rail-arrow.prev { left: -6px; }
.topic-rail .rail-arrow.next { right: -6px; }
/* While the mouse drags, the row follows it freely (no snapping, no text selection). */
.topics.dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.topics.dragging a { pointer-events: none; }
/* 덱 바꾸기 (design/mockups/deck-picker: style.html 1, header.html D). Small gold text uses --gold-text, a shade
   darker than --gold on the light sheet so it stays readable. */
.deck-picker { --gold-text: #8a5f12; }
:root[data-theme="dark"] .deck-picker { --gold-text: var(--gold); }
/* 자동 (design/mockups/deck-picker/auto.html C): a night card in the card back's black and gold, with a few stars,
   set a little apart from the sheet's title; chosen, it gets the covers' gold ring and check. */
.deck-auto {
  position: relative; display: flex; align-items: center; gap: 16px; width: 100%; min-height: 104px; margin-top: 10px; padding: 16px 18px;
  border: 0; border-radius: 16px; overflow: hidden; text-align: left; color: #f5ecd9;
  background: radial-gradient(120% 140% at 85% 20%, #3a2e1a, #1b1915 60%);
  box-shadow: inset 0 0 0 1px rgba(232, 194, 122, .25), 0 6px 16px rgba(27, 25, 21, .28);
}
.deck-auto::before {
  content: ''; position: absolute; inset: 0; opacity: .7; pointer-events: none;
  background-image: radial-gradient(1px 1px at 18% 22%, #fff, transparent), radial-gradient(1.2px 1.2px at 48% 70%, #f6e2b5, transparent),
    radial-gradient(1px 1px at 63% 18%, #fff, transparent), radial-gradient(1px 1px at 35% 85%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 92% 82%, #f6e2b5, transparent);
}
.deck-auto.active { box-shadow: 0 0 0 2.5px var(--sheet), 0 0 0 4.5px var(--gold), 0 6px 16px rgba(27, 25, 21, .28); }
.deck-auto.active::after {
  content: ''; position: absolute; right: 10px; top: 10px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat;
}
/* The ring needs room above, or the scrolling part would clip it. */
.deck-picker { padding-top: 4px; }
.deck-auto strong { display: block; color: #e8c27a; font-family: var(--display); font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.deck-auto small { display: block; margin-top: 2px; color: #cfc4b0; font-size: .76rem; }
.auto-fan { position: relative; flex: none; width: 92px; height: 82px; }
.auto-back {
  position: absolute; left: 50%; bottom: 0; height: 72px; width: 43px; border-radius: 5px; border: 1.5px solid var(--gold);
  background: var(--card-back); box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transform-origin: 50% 100%;
}
.auto-back:nth-child(1) { transform: translateX(-50%) translateX(-19px) rotate(-13deg); }
.auto-back:nth-child(2) { transform: translateX(-50%) translateY(-4px); z-index: 1; }
.auto-back:nth-child(3) { transform: translateX(-50%) translateX(19px) rotate(13deg); }
/* 타로 / 오라클: a centred title between thin gold rules, with small stars. */
.deck-kind {
  display: flex; align-items: center; gap: 10px; margin: 26px 8px 14px; color: var(--gold-text);
  font-family: var(--display); font-size: .92rem; font-weight: 700; letter-spacing: .08em;
}
.deck-kind::before, .deck-kind::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to right, transparent, currentColor); opacity: .55; }
.deck-kind::after { background: linear-gradient(to left, transparent, currentColor); }
.deck-kind span::before, .deck-kind span::after { content: '✦'; content: '✦' / ''; margin: 0 6px; font-size: .6rem; vertical-align: 2px; }
/* Each deck as one cover card, three a row; the chosen one gets a gold ring and a check. */
.deck-covers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 12px; }
.deck-cover { display: flex; flex-direction: column; gap: 7px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.cover-card {
  position: relative; display: block; aspect-ratio: 5 / 8; border-radius: 9px; overflow: hidden; background: var(--panel);
  box-shadow: 0 4px 12px rgba(40, 30, 15, .22); transition: transform .2s;
}
.cover-card img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-band {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 5px 0 6px; text-align: center; color: #fff;
  font-size: .66rem; font-weight: 700; letter-spacing: .06em;
  background: linear-gradient(to top, rgba(20, 16, 10, .78), rgba(20, 16, 10, .35)); backdrop-filter: blur(3px);
  /* Android Chrome draws a backdrop-filter layer outside the card's rounded clip, squaring its bottom corners. */
  border-bottom-left-radius: inherit; border-bottom-right-radius: inherit;
}
.cover-name { font-size: .8rem; font-weight: 600; line-height: 1.3; word-break: keep-all; }
.cover-name .own { display: block; margin-bottom: 2px; color: var(--gold-text); font-size: .64rem; font-weight: 700; }
.deck-cover > small { color: var(--muted); font-size: .7rem; }
.sheet-menu button.wide { grid-column: 1 / -1; }
/* 자동 looks like the tiles beside it (white with a line) instead of a filled bar. */
.sheet-menu button.wide:not(.on) { background: var(--bg); border: 1px solid var(--line); }
.spread-tiles.spreads-list { margin-top: 16px; }
.sheet-menu button.wide em:not(.recommended) { display: block; margin-top: 2px; font-style: normal; font-size: .75rem; color: var(--muted); font-weight: 400; }
@media (hover: hover) {
  .deck-cover:hover .cover-card { transform: translateY(-2px); }
}
.deck-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin: 12px 0; }
.deck-gallery figure { margin: 0; text-align: center; }
.modal-body .deck-gallery img { width: 100%; max-height: none; border-radius: var(--card-radius, 5px); }
/* Stays at the bottom of the sheet so the choice is reachable from anywhere in a 78-card gallery. */
.deck-select { position: sticky; bottom: -20px; margin: 0 -20px -20px; padding: 12px; text-align: center; background: var(--sheet); border-top: 1px solid var(--line); }
.deck-gallery figcaption { font-size: .7rem; line-height: 1.3; color: var(--muted); }
/* 카드 사전 (/cards): the deck, the suits, then three cards a row with their names. */
/* The browser's own ⌄ sat at the very edge; a drawn one 14px in, about the text's own inset
   (design/mockups/select-and-save, 17). */
.cards-deck { display: block; width: 100%; min-height: 44px; margin-bottom: 12px; padding: 0 40px 0 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); font: inherit; -webkit-appearance: none; appearance: none;
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857d74' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 16px no-repeat; }
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 12px; }
.cards-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; background: none; color: var(--text); font-size: .82rem; font-weight: 600; }
.cards-item img { width: 100%; aspect-ratio: 1 / var(--ratio); object-fit: cover; border: 1px solid var(--line); border-radius: var(--card-radius, 8px); background: var(--panel); }

input.question, textarea.question { display: block; width: 100%; border-radius: 8px; margin: 8px 0; }
input.question[hidden], textarea.question[hidden] { display: none; }
/* The browser's grey hint is 4.2:1 on the panel; --muted passes 4.5:1. */
input.question::placeholder, textarea.question::placeholder { color: var(--muted); }
/* The question grows with its text (app.js questionInput) to show all of it, with no scrolling inside. */
textarea.question { line-height: 1.4; resize: none; word-break: keep-all; overflow-y: hidden; }
/* A draw page's question (design/mockups/draw-redesign, 4): the frame holds the text, then a foot for the microphone.
   Its line is a soft one (ask-border.html, 2): a text-coloured frame was the only hard line on the page. */
.ask-box { margin: 8px 0; padding: 10px 14px 0; border: 1.5px solid var(--field-line); border-radius: 16px; background: var(--bg); cursor: text; }
.ask-box:focus-within { border-color: var(--gold); }
.ask-box textarea.question { margin: 0; padding: 0; border: 0; border-radius: 0; background: none; outline: none; font-size: 1rem; }
/* The foot's right end: the length (near the limit only), then the microphone at the corner. */
.ask-foot { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-height: 40px; margin-right: -8px; }
.question-count { margin: 0; font-size: .76rem; }
button.mic { width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
button.mic .icon { width: 20px; height: 20px; }
button.mic.on { color: var(--accent); animation: listening 1.2s ease-in-out infinite; }
@keyframes listening { 50% { opacity: .4; } }
/* 자리 설정 under the question box: plain text, so the box stays the page's one box. */
button.slot-link { display: inline-flex; align-items: center; gap: 2px; min-height: 36px; margin: -4px 0 0 2px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--muted); font-size: .84rem; }
button.slot-link .icon { width: 14px; height: 14px; transition: transform .15s; }
button.slot-link[aria-expanded="true"] .icon { transform: rotate(90deg); }
/* Position names (one per card) or the A/B pair side by side, like canee's 자리 설정. */
.slot-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0 8px; }
.slot-fields.pair { grid-template-columns: 1fr 1fr; }
.slot-fields[hidden] { display: none; }
/* The same field as the question box (design/mockups/draw-redesign/slot-fields.html): grey stays for the mode tabs. */
.slot-fields input.question { margin: 4px 0; border: 1.5px solid var(--field-line); border-radius: 12px; background: var(--bg); }
.slot-fields input.question:focus { border-color: var(--gold); outline: none; }

.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.menu a, .menu .item {
  display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 10px 14px; text-decoration: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
}
.menu a:hover { border-color: var(--gold); }
/* 배열로 직접 고르기 and 배열 바꾸기: two tiles a row, each spread's shape (as on the home row) over its name. */
.spread-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.spread-tiles > a, .spread-tiles > button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 12px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none; }
.spread-tiles > a:hover, .spread-tiles > button:hover { border-color: var(--gold); }
/* 배열 바꾸기 (design/mockups/spread-picker, 1B): the tiles under 자동 by card count, the one in use in gold. */
/* design/mockups/sheet-contact, 1B: three tiles a row in the home row's tile style. */
/* 배열로 직접 고르기 (.three) shares them, so both lists look alike. */
.sheet-menu .spread-tiles { grid-column: 1 / -1; margin-top: 0; }
.sheet-menu .spread-tiles, .spread-tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sheet-menu .spread-tiles > button, .spread-tiles.three > a { justify-content: flex-start; gap: 0; min-height: 0; padding: 14px 4px 11px; text-align: center; }
.sheet-menu .spread-tiles .spread-tile-shape, .spread-tiles.three .spread-tile-shape { height: 58px; }
.sheet-menu .spread-tiles strong, .spread-tiles.three strong { margin-top: 9px; font-size: .84rem; letter-spacing: -.02em; line-height: 1.25; word-break: keep-all; }
.sheet-menu .spread-tiles small, .spread-tiles.three small { margin-top: 2px; font-size: .72rem; line-height: 1.2; }
.sheet-menu .spread-tiles > button.on { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); color: var(--text); }
.spread-tiles > button.on strong { color: var(--gold); }
/* 추천 on its own line, centred under the name (design/mockups/spread-sheet-fix, 2): inline, a wrapped name left the
   chip shifted by its left margin. */
.spread-tiles .recommended { display: block; width: fit-content; margin: 4px auto 0; }
.spread-tiles > button.on .pick-slot { border-color: var(--gold); color: var(--gold); }
/* Home (design/mockups/spread-home/tiles.html, A): four tiles in one row — shape, short name, card count; 전체 보기 sits in the heading. */
.spread-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 24px; }
.spread-row > a { display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 14px 4px 11px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--text); text-decoration: none; }
.spread-row > a:hover { background: var(--soft); }
.spread-row-shape { display: grid; place-items: center; width: 100%; height: 50px; }
.spread-row-shape .pick-slots.shaped { margin: 0; }
.row-shape .pick-slot, .row-shape .pick-slot.cross { border: 1.6px solid var(--text); border-radius: 2.5px; background: var(--bg); }
.spread-row > a:hover .row-shape .pick-slot { background: color-mix(in srgb, var(--text) 4%, var(--bg)); }
/* design/mockups/spread-press, C: a mouse over lifts the tile (자유's fan opens); pressing sinks it a little, which is all
   a phone shows. "Reduce motion" keeps the colour changes only. */
.spread-row { --lift-shadow: rgba(26, 23, 20, .10); }
:root[data-theme="dark"] .spread-row { --lift-shadow: rgba(0, 0, 0, .45); }
.spread-row > a { -webkit-tap-highlight-color: transparent; transition: transform .12s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s; }
.spread-row > a:active { border-color: var(--gold); }
@media (prefers-reduced-motion: no-preference) {
  .row-fan i { transition: transform .24s ease; }
  .spread-row > a:active { transform: scale(.96); box-shadow: 0 2px 6px var(--lift-shadow); }
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .spread-row > a:hover:not(:active) { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 8px 18px var(--lift-shadow); }
  .spread-row > a:hover .row-fan i:nth-child(1) { transform: rotate(-26deg); }
  .spread-row > a:hover .row-fan i:nth-child(3) { transform: rotate(26deg); }
}
/* 자유 드로우: three fanned cards instead of empty dashed places. */
.row-fan { position: relative; }
.row-fan i { position: absolute; left: calc(50% - var(--card-w) / 2); top: 0; width: var(--card-w); height: 100%; border: 1.6px solid var(--text); border-radius: 2.5px; background: var(--bg); transform-origin: 50% 100%; }
.row-fan i:nth-child(1) { transform: rotate(-16deg); }
.row-fan i:nth-child(3) { transform: rotate(16deg); }
.spread-row strong { margin-top: 9px; font-size: .84rem; letter-spacing: -.02em; white-space: nowrap; }
.spread-row small { margin-top: 1px; color: var(--muted); font-size: .72rem; white-space: nowrap; }
.spread-tiles strong { margin-top: 6px; font-size: .95rem; }
.spread-tiles small { color: var(--muted); font-size: .75rem; }
.spread-tile-shape { display: grid; place-items: center; width: 100%; height: 96px; }
.spread-tile-shape .pick-slots.shaped { margin: 0; }
.menu a small, .menu button small { flex: none; color: var(--muted); font-size: .75rem; white-space: nowrap; }
/* 배열 바꾸기 on a topic page: the spreads as buttons in a sheet, the one in use in gold. */
.sheet-menu { max-height: 60vh; overflow-y: auto; margin-top: 12px; }
.sheet-menu button { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 48px; padding: 10px 12px;
  border-radius: 8px; text-align: left; }
.sheet-menu button.on { border-color: var(--gold); color: var(--gold); }
.recommended { display: inline-block; white-space: nowrap; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(232, 194, 122, .2); color: var(--gold); font-size: .7rem; font-style: normal; font-weight: 700; }
/* 설정 › 배열 순서 (design/mockups/save-settings, 2 A). */
.order-list { margin: 10px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.order-list li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 2px 0 2px 2px; border-bottom: 1px solid var(--line); cursor: grab; }
.order-grip { color: var(--muted); opacity: .6; letter-spacing: -2px; }
.order-no { width: 18px; color: var(--muted); font-size: .76rem; text-align: right; font-variant-numeric: tabular-nums; }
.order-name { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arrows { display: flex; gap: 2px; }
.order-list .arrows .icon-button { padding: 6px; border: 0; background: none; color: var(--muted); box-shadow: none; }
.order-list .arrows .icon-button:disabled { opacity: .25; }
.order-reset { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.edit-help { margin-top: 12px; }

/* 자동·수동: one segmented control; the way in use is the raised half. */
.tabs { display: flex; gap: 4px; margin: 12px 0 10px; padding: 4px; border-radius: 12px; background: var(--panel); }
.tabs a { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: .92rem; }
.tabs a.active { background: var(--raised); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); color: var(--text); font-weight: 700; }
/* 설정 rows (design/mockups/privacy-setting, A): like a phone's settings, no box, rows split by a line, each row's
   short help right under its name and the switch on the right. Off is a white knob on grey, on a dark track. */
.setting-list { border-top: 1px solid var(--line); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.setting-text { flex: 1; min-width: 0; }
.setting-row strong { display: block; font-weight: 600; font-size: .93rem; }
.setting-row p { margin: 2px 0 0; font-size: .78rem; line-height: 1.45; word-break: keep-all; }
.setting-row p a { color: var(--muted); text-underline-offset: 2px; }
button.switch { position: relative; flex: none; width: 46px; height: 28px; padding: 0; border: 0; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 14%, transparent); cursor: pointer; }
button.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: left .15s; }
button.switch[aria-checked="true"] { background: var(--btn); }
button.switch[aria-checked="true"]::after { left: 21px; background: var(--on-btn); }
button.switch:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* 내 계정 (design/mockups/account): the profile card, the gold-ticket card, menu rows in two groups, quiet account actions. */
.profile { display: flex; align-items: center; gap: 14px; margin: 14px 0 12px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; }
.profile .avatar { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--panel); }
.profile .avatar.kakao { background: #fee500; }
.profile .avatar img { width: 26px; height: 26px; }
.profile strong { display: block; font-size: 1.02rem; }
.profile small { display: block; margin-top: 3px; font-size: .8rem; }
.wallet { padding: 16px; border-radius: 16px; background: var(--panel); }
.wallet-head { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.wallet-head .coin { width: 22px; height: 22px; }
.wallet .free { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--bg); }
.wallet .free b { font-size: 1.5rem; }
.wallet .free b small { font-size: .9rem; font-weight: 600; }
.wallet small.of { color: var(--muted); font-size: .8rem; font-weight: 500; }
.wallet .dots { display: flex; gap: 6px; }
.wallet .dots i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold); }
.wallet .dots i.on { background: var(--gold); }
.wallet .nums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.wallet .nums > div { padding: 12px; border-radius: 12px; background: var(--bg); }
.wallet .nums span { display: block; color: var(--muted); font-size: .76rem; }
.wallet .nums b { display: block; margin-top: 3px; font-size: 1.25rem; }
.wallet .nums b small { font-size: .8rem; font-weight: 500; }
.wallet .nums b.gold { color: var(--gold); }
.wallet > p { margin: 10px 2px 0; color: var(--muted); font-size: .8rem; }
.wallet button.buy { display: block; width: 100%; min-height: 48px; margin-top: 12px; border: 0; border-radius: 12px; background: var(--btn); color: var(--on-btn); font-weight: 700; }
.account-menu { display: flex; flex-direction: column; margin-top: 18px; }
/* Group titles look like 내 리딩 기록's date groups (.history-group). */
.account-menu h2 { margin: 0 0 2px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.account-menu > a { display: flex; align-items: center; gap: 12px; min-height: 52px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.account-menu > a:last-child { border-bottom: 0; }
.account-menu > a > span { flex: 1; }
.account-menu .icon { flex: none; width: 20px; height: 20px; color: var(--muted); }
.account-menu .icon:last-child { width: 16px; height: 16px; }
.account-quiet { display: flex; gap: 18px; justify-content: center; margin: 26px 0 8px; }
.account-quiet button { min-height: 40px; padding: 0 6px; border: 0; background: none; color: var(--muted); font-size: .82rem; }
.account-quiet button.danger { color: var(--danger); opacity: .8; }

.sizes { display: flex; flex-direction: column; gap: 4px; margin: 12px 0; }
.sizes button { border-radius: 6px; text-align: left; }
.sizes button.active { border-color: var(--gold); color: var(--gold); }
.sizes small { color: var(--muted); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.center-row { justify-content: center; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 0; }
.pile {
  width: 120px; height: 206px; border-radius: 10px; border: 1.5px solid var(--gold); background: var(--card-back);
  box-shadow: 3px 3px 0 var(--bg), 4.5px 4.5px 0 rgba(232, 194, 122, .55), 7.5px 7.5px 0 var(--bg), 9px 9px 0 rgba(232, 194, 122, .35), 0 12px 24px rgba(0, 0, 0, .5);
}
/* 자동's pile settles in from just above when the screen opens. */
@media (prefers-reduced-motion: no-preference) {
  .pile { animation: pile-in .38s cubic-bezier(.2, .9, .25, 1); }
}
@keyframes pile-in { from { opacity: 0; transform: translateY(-26px); } }
.badge { display: inline-block; min-width: 28px; padding: 2px 8px; border-radius: 999px; background: var(--btn); color: var(--on-btn); text-align: center; }

/* 수동 뽑기: six cards a row (about 50px wide on a phone, easy to tap; 78 fills 13 rows), the count and 선택 완료 held at the bottom. */
.pick-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px 8px; width: 100%; }
.pick { position: relative; aspect-ratio: 7 / 12; min-width: 0; padding: 0; border-radius: 5px; border: 1px solid rgba(232, 194, 122, .55);
  background: var(--card-back); transition: transform .15s; }
.pick:hover { transform: translateY(-3px); }
/* A picked card has flown to its place: an empty dashed cell stays where it was (tapping it puts the card back). */
.pick.picked { transform: none; border: 1.5px dashed var(--line); background: var(--panel); }
/* 수동 › 부채꼴 · 펼쳐 보기 (design/mockups/pick-fan). Picked cards wait in numbered places; over five they shrink and wrap. */
.pick-stage { position: relative; }
.pick-view { margin: 0; }
.pick-view button { flex: none; min-width: 96px; padding: 8px 16px; }
.pick-slots { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: 100%; padding-top: 8px; }
.pick-slots.small { gap: 12px 6px; max-width: 300px; }
.pick-slot { position: relative; width: 56px; aspect-ratio: 7 / 12; padding: 0; border: 1.5px dashed var(--line); border-radius: 6px;
  background: var(--panel); color: var(--muted); font-weight: 700; }
.pick-slots.small .pick-slot { width: 44px; font-size: .8rem; }
.pick-slot.filled { border: 1px solid var(--gold); background: var(--card-back); box-shadow: 0 0 0 2px var(--gold); cursor: pointer; }
.pick-slot.filled span { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); min-width: 20px; padding: 1px 6px;
  border-radius: 999px; background: var(--gold); color: var(--bg); font-size: .72rem; }
.pick-slots.shaped { position: relative; display: block; flex: none; margin-top: 8px; padding: 0; }
.pick-slots.shaped .pick-slot { position: absolute; aspect-ratio: auto; font-size: .78rem; }
.pick-slot:disabled { pointer-events: none; }
/* 켈틱 크로스 2 while empty: an outline only over place 1, its number upright in a pill at the outer end. */
/* Same line as the other places; only see-through, so place 1 and its number show beneath. */
.pick-slot.cross:not(.filled) { background: none; }
/* In the spread pictures (홈, 배열 전체 보기) the crossing card is solid and hides the card beneath, like real cards. */
.spread-row .pick-slot.cross:not(.filled), .spread-tile-shape .pick-slot.cross:not(.filled) { background: var(--bg); }
.spread-row > a:hover .pick-slot.cross:not(.filled) { background: color-mix(in srgb, var(--text) 4%, var(--bg)); }
.pick-slot.cross > i { position: absolute; top: 3px; left: 50%; transform: translateX(-50%) rotate(-90deg); min-width: 18px; padding: 0 5px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--bg); font-style: normal; font-size: .68rem; line-height: 16px; }
.pick-slot.cross.filled span { transform: translateX(-50%) rotate(-90deg); }
.pick-hint { margin: 0; color: var(--muted); font-size: .82rem; text-align: center; }
/* The wheel's centre is 520px below each card's top (the JS FAN_RADIUS); isolation keeps its stacking under the bar.
   Edge to edge across #app's 16px padding, tall enough that the tilted cards at the sides are not cut at the bottom. */
.pick-fan { position: relative; isolation: isolate; width: calc(100% + 32px); margin: 0 -16px; height: 320px; overflow: hidden; touch-action: pan-y; cursor: grab;
  outline: none; user-select: none; -webkit-user-select: none; }
.pick-fan.dragging { cursor: grabbing; }
.pick-fan-card { position: absolute; left: calc(50% - 38px); bottom: 170px; width: 76px; height: 130px; border: 1px solid rgba(232, 194, 122, .55);
  border-radius: 6px; background: var(--card-back); box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
  transform-origin: 50% 520px; transform: rotate(var(--a)) translateY(var(--lift, 0px)); transition: transform .15s; }
.pick-fan.moving .pick-fan-card { transition: none; }
.pick-fan-card.gone { visibility: hidden; }
@media (hover: hover) { .pick-fan:not(.moving) .pick-fan-card:hover { --lift: -14px; } }
.pick-fan:focus-visible .pick-fan-card.center { --lift: -14px; outline: 2px solid var(--gold); outline-offset: 2px; }
.pick-fly { position: absolute; z-index: 6; border: 1px solid var(--gold); border-radius: 6px; background: var(--card-back); pointer-events: none; }
.pick-bar { position: sticky; bottom: calc(62px + var(--safe-bottom, env(safe-area-inset-bottom))); z-index: 5; display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 7px 8px 7px 14px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 -6px 20px rgba(0, 0, 0, .1);
  /* design/mockups/pick-bar: one line, see-through so the fan's lower edge stays in view behind it. */
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pick-bar > div { flex: 1; font-size: .85rem; }
.pick-bar .muted { display: block; font-size: .75rem; }
.stage .pick-bar .primary { flex: none; width: auto; min-height: 42px; padding: 0 20px; }
/* All cards picked: 선택 완료 turns gold with one small pop, so the next step is plain. */
.stage .pick-bar .primary.ready { border-color: var(--gold); background: var(--gold); color: var(--bg); }
@media (prefers-reduced-motion: no-preference) { .stage .pick-bar .primary.ready { animation: ready-pop .32s ease-out; } }
@keyframes ready-pop { 50% { transform: scale(1.06); } }
.pick-bar > div { min-width: 0; }

/* 약어선택: the cards typed so far as name chips, suit tabs, six number keys a row, the submit held at the bottom. */
.pad-stage { align-items: stretch; }
.pad-stage .segmented { margin: 0; }
.pad-typed { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; }
.pad-typed span { padding: 5px 10px; border-radius: 8px; background: var(--chip-bg); font-weight: 700; font-size: .86rem; }
.pad-typed span.r { color: var(--gold); }
.pad-typed span.next { background: none; color: var(--muted); font-weight: 400; }
.pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; width: 100%; }
.pad.oracle { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.pad-key { min-height: 44px; padding: 8px 2px; border: 0; border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 600; font-size: .9rem; }
.pad-key[hidden], .pad-key.pic[hidden], .pad-stage .segmented[hidden] { display: none; }
.pad-key:disabled { opacity: .25; }
/* 내 카드 (design/mockups/own-cards-options, 2 + 3): a note on the deck, a name search, then the cards' pictures five a row. */
.pad-note { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--panel); font-size: .8rem; line-height: 1.5; }
.pad-note b { color: var(--text); }
.pad-search { margin: 0; }
.pad.pictures { grid-template-columns: repeat(5, 1fr); }
.pad-key.pic { display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 0; padding: 0; background: none; font-weight: 400; }
/* A deck's corner (--card-radius) is set for cards about 140 px wide; these are half that. */
.pad-key.pic img { display: block; width: 100%; border-radius: calc(var(--card-radius, 10px) / 2); object-fit: cover; background: var(--panel); }
.pad-key.pic small { overflow: hidden; color: var(--muted); font-size: .68rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.pad-empty { margin: 0; text-align: center; font-size: .85rem; }
.pad-tools { display: flex; gap: 6px; }
.pad-tools .pad-key { flex: 1; background: var(--chip-bg); }
.pad-tools .pad-key.on { background: var(--btn); color: var(--on-btn); }
.stage .pick-bar .primary:only-child { flex: 1; width: 100%; }
.stage .primary:disabled { background: var(--chip-bg); color: var(--muted); }
.pad-alt { align-self: center; font-size: .85rem; }

/* Result head: spread · deck · time in gold, then the question (or title) as the page's heading, left aligned. */
.result-title { margin: 6px 0 0; color: var(--text); font-family: var(--display); font-size: 1.35rem; line-height: 1.35; letter-spacing: -.02em;
  white-space: pre-line; word-break: keep-all; overflow-wrap: anywhere; }
.result-question { margin: 6px 0 0; }
.result-question .shared-question { text-align: left; color: var(--muted); font-weight: 400; }
/* 공유 · 복사 · 다시 하기 as one row of text buttons under the gold button. */
/* design/mockups/result-spacing: the cards, the gold button (or the answer) and this row as three apart blocks. */
.result-actions { display: flex; gap: 8px; margin: 20px 0 0; }
.result-actions > * { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; }
.result-actions .icon { width: 16px; height: 16px; }
.result-actions > [hidden] { display: none; }
/* Where the cards came from, and the question as the viewer of a shared link sees it. */
.draw-meta { margin: 4px 0 0; color: var(--gold); font-size: .78rem; font-weight: 700; }
.draw-meta button.link { color: var(--muted); font-weight: 400; }
button.link { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; }
/* Questions may have line breaks; show them where the whole question is shown. */
.shared-question { margin: 8px 0 0; text-align: center; font-weight: 600; white-space: pre-line; }
.keep-lines { white-space: pre-line; }
.interpret-note { margin: 0 0 8px; font-size: .8rem; }
.result-area { margin: 16px 0; }
.table { position: relative; margin: 0 auto; }
.hide-labels .label { visibility: hidden; }
.slot { position: absolute; display: flex; flex-direction: column; align-items: center; }
.table > .slot { transform: translateX(-50%); }
.slot.static { position: static; }
/* Position label, then the card's name. Custom position names can be long; cut them so they never run off the screen edge. */
.caption { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.slot .label, .slot .card-title { font-size: .75rem; line-height: 18px; white-space: nowrap; max-width: min(9em, 100%); overflow: hidden; text-overflow: ellipsis; }
/* Position names wrap by word to two lines; the card name sits right under its own label, with no gap left to line
   names up across a row. */
.slot .label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; text-align: center; }
.slot.crossing .label, .slot.crossing .card-title { max-width: 9em; line-height: 16px; }
.slot.crossing .label { display: block; -webkit-line-clamp: 1; min-height: 0; white-space: nowrap; }
.slot .label { color: var(--muted); }
/* A name still cut opens in full on tap, over the cards below it (phones have no hover for its title). */
.slot .label.cut, .slot .card-title.cut { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.slot .label.cut:focus-visible, .slot .card-title.cut:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-radius: 4px; }
.slot .caption { position: relative; }
/* The full name: wider than the card's column, over the label, nudged by --shift to stay on screen. */
.label-full { position: absolute; top: -4px; left: 50%; z-index: 1; width: max-content; max-width: min(12em, calc(100vw - 16px)); padding: 4px 8px;
  transform: translateX(calc(-50% + var(--shift, 0px))); border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text);
  font-size: .75rem; line-height: 18px; text-align: center; word-break: keep-all; overflow-wrap: anywhere; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.slot:has(.label.open, .card-title.open) { z-index: 100 !important; }
/* The crossing card's caption sits above the cross on one line, in the gap under the card above. */
.slot.crossing .caption { position: absolute; top: -16px; margin: 0; flex-direction: row; gap: 4px; }
/* The AI's theme for the reading: a subtitle under the title and date lines, set apart from them. */
.reading-theme { margin: 10px auto 12px; max-width: 32em; font-size: 1.1rem; font-weight: 600; line-height: 1.4; color: var(--text); }
/* 설정 (design/mockups/account/settings-structure.html, 3): small gray group titles like 내 리딩 기록's and 내 계정's;
   the switches as line-split rows (.setting-list), the help under the other controls. */
.setting { margin: 16px 0; }
.setting p { margin: 6px 4px 0; font-size: .8rem; line-height: 1.5; }
.setting-title { margin: 24px 2px 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.setting .setting-title + p { margin: 2px 4px 10px; }
.setting-more { margin: 6px 4px 0; font-size: .8rem; }
.setting-more summary { color: var(--gold); cursor: pointer; }
.setting-more .setting-choices { margin-top: 4px; font-size: .8rem; }
.setting .edit-help { margin: 12px 0 0; }
.credit { margin: 16px 0 0; font-size: .7rem; }
.credit a { color: var(--muted); }
/* Footer documents (이용약관 / 개인정보처리방침 / 면책 / 라이선스) and the home footer. */
/* The footer is a darker band across the whole column, down under the tab bar, under a thin gold line; two groups
   (the business, the 고객센터), then the documents and the copyright centred, with room above the tab bar. */
.site-footer { position: relative; margin: 28px -16px -104px; padding: 28px 22px 136px; background: var(--footer);
  color: var(--muted); font-size: .8125rem; line-height: 1.8; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 22px; right: 22px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 194, 122, .55), transparent); }
.site-footer section + section { margin-top: 22px; }
.site-footer h2 { margin: 0 0 6px; color: var(--text); font: 700 .94rem var(--display); letter-spacing: -.02em; }
.site-footer p { margin: 0; }
.site-footer section a { color: var(--text); text-decoration: none; }
.site-footer .note { margin-top: 2px; color: var(--muted); font-size: .75rem; }
/* SNS (design/mockups/sns-footer): 22px marks in the muted colour, 44px targets, centred at the top of the band. */
.site-footer .sns { display: flex; justify-content: center; gap: 6px; margin: -6px 0 14px; }
.site-footer .sns > * { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--muted); transition: color .15s, background .15s; }
.site-footer .sns a:hover { color: var(--text); background: color-mix(in srgb, var(--text) 6%, transparent); }
.site-footer .sns .icon { width: 22px; height: 22px; stroke-width: 1.8; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.footer-links a { color: var(--text); opacity: .8; text-decoration: none; }
.footer-links a:hover { opacity: 1; }
.footer-links a.strong { opacity: 1; font-weight: 700; }
.site-footer .copy { margin-top: 10px; color: var(--muted); font-size: .75rem; text-align: center; }
.legal { font-size: .9rem; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
.review-box { max-width: 360px; margin: 18px auto 0; }
.review-login { display: grid; gap: 8px; padding-bottom: 12px; }
.review-login .contact-send { margin-top: 4px; }
.about { font-size: .9rem; line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
.about h2 { margin: 26px 0 8px; color: var(--text); font: 700 1rem var(--display); letter-spacing: -.02em; }
.about p { margin: 6px 0; }
.about ul { margin: 6px 0; padding-left: 20px; }
/* 회사소개 (/about): the title centred with one line under it, then groups of label · value rows split by a rule. */
.company-group { padding: 26px 0 8px; }
.company-group h2 { margin: 0 0 6px; color: var(--muted); font-size: .9rem; font-weight: 700; }
.company-group dl { margin: 0; }
.company-group dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: .95rem; line-height: 1.6; }
.company-group dl div:last-child { border-bottom: 0; }
.company-group dt { flex: none; color: var(--muted); }
.company-group dd { margin: 0; text-align: right; word-break: keep-all; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.company-group dd a { color: inherit; text-decoration: none; }
/* Documents (design/mockups/terms): opening words centred, sections as rows that open in place, 시행일 centred last. */
.page-title.legal-title { margin-top: 18px; text-align: center; }
/* A document with no opening words (라이선스): its list a little apart from the title. */
.legal-title + .legal > .legal-item:first-child { margin-top: 22px; }
.legal-intro.company-intro { margin-bottom: 8px; }
.setting-lead { margin: 4px 4px 0; font-size: .8rem; }
.legal-intro { margin: 14px 4px 28px; color: var(--muted); font-size: .86rem; line-height: 1.65; text-align: center; }
.legal-intro p { margin: 4px 0; }
.legal-item { border-top: 1px solid var(--line); scroll-margin-top: 72px; }
.legal-item:last-of-type { border-bottom: 1px solid var(--line); }
.legal-item summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 0 2px; list-style: none; cursor: pointer; font-size: .92rem;
  transition: color .2s ease; }
/* The open section (design/mockups/legal-open-color, 금색): its title and arrow in a deeper gold that reads on white
   (about 5.2:1); 어둡게 keeps the light gold. The text comes down a little as it fades in. */
.legal-item[open] summary { color: #8f6418; }
:root[data-theme="dark"] .legal-item[open] summary { color: var(--gold); }
.legal-item[open] .legal-body { animation: legal-open .22s ease; }
@keyframes legal-open { from { opacity: 0; transform: translateY(-4px); } }
.legal-item summary::-webkit-details-marker { display: none; }
.legal-item summary b { margin-right: 6px; font-weight: 600; }
.legal-item summary .icon { flex: none; width: 16px; height: 16px; color: var(--muted); transition: transform .2s ease, color .2s ease; }
.legal-item[open] summary .icon { transform: rotate(90deg); color: inherit; }
@media (prefers-reduced-motion: reduce) {
  .legal-item summary, .legal-item summary .icon { transition: none; }
  .legal-item[open] .legal-body { animation: none; }
}
.legal-body { padding: 0 2px 14px; font-size: .86rem; }
/* `.legal .legal-date`, not `.legal-date`: `.legal p` below would win and leave only 6px above the date. */
.legal .legal-date { margin: 40px 0 8px; color: var(--muted); font-size: .8rem; text-align: center; }
.legal h5 { margin: 14px 0 4px; font-size: .95rem; }
.legal ul { margin: 4px 0; padding-left: 20px; }
.legal p { margin: 6px 0; }
/* Result head: the shared result's logo and badge; the ⋯ sheet's 결과 삭제 in red. */
.topbar-logo { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; color: var(--text); font-family: var(--display); font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.topbar-extra { align-items: center; gap: 4px; }
.shared-badge { padding: 3px 10px; border-radius: 999px; background: rgba(232, 194, 122, .12); color: var(--gold); font-size: .75rem; font-weight: 600; }
.topbar-logo img { width: 18px; height: 18px; }
.sheet-menu button.danger { color: var(--danger); }
button.credit-close { display: block; width: 100%; margin-top: 8px; }
.credits { list-style: none; padding: 0; }
.credits li { margin: 0 0 20px; }
.credits p { margin: 4px 0; font-size: .9rem; word-break: keep-all; overflow-wrap: anywhere; }
.credits a { font-size: .85rem; }
.free-area { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 24px 0 0; }
/* The box only reserves space; the artwork itself carries the corners and shadow, so a card whose
   shape differs slightly from the box shows page background around it instead of a white band. */
.card { flex: none; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: none; cursor: zoom-in; animation: deal .5s ease-out backwards; }
/* Pictures fade in over their box once loaded (app.js fadeImg); a card waits on a light empty card with a slow
   shimmer (design/mockups/card-loading), not its back pattern, which flashed on the light result page. */
img.fade-in { opacity: 0; transition: opacity .3s ease-out; }
img.fade-in.loaded { opacity: 1; }
.card:has(img.fade-in:not(.loaded)) { position: relative; overflow: hidden; border-radius: var(--card-radius, 8px); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.card:has(img.fade-in:not(.loaded))::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%);
  transform: translateX(-100%); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .card:has(img.fade-in:not(.loaded))::after { display: none; } img.fade-in { transition: none; } }
/* The shadow follows the picture's own outline, so a card whose corners are transparent (사주 오라클, 기묘한달) casts
   no square shadow past them. --card-radius: a deck cut to its square frame line (app.js radiusStyle). */
.card img { display: block; max-width: 100%; max-height: 100%; border-radius: var(--card-radius, 8px); filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .28)); }
img.reversed { transform: rotate(180deg); }
@keyframes deal { from { opacity: 0; } }

/* Before an answer there is no box: just a centered gold button. The box opens with the answer. */
/* As wide as 공유 · 다시 하기 under it at every window width (design/mockups/result-spacing). */
.interpret { display: flex; flex-direction: column; align-items: center; width: 100%; margin: 24px 0 0; }
/* The mockup's one gold button: full width, squared like the other buttons. */
button.interpret-cta:not(.again) { width: 100%; min-width: 0; min-height: 52px; padding: 12px; border-radius: 12px; background: var(--btn); box-shadow: none; }
button.interpret-cta {
  min-width: 260px; padding: 14px 28px; border: 0; border-radius: 999px; font-size: 1.05rem; font-weight: 600;
  background: var(--btn); color: var(--on-btn); box-shadow: none;
}
.interpret-cta .icon { margin-right: 6px; }
/* No lift or gold glow under the pointer: on a phone the hover stuck after a tap and blurred the button's edge. */
button.interpret-cta:hover { transform: none; box-shadow: none; }
button.interpret-cta.busy { opacity: 1; cursor: progress; }
/* 해석 중 (design/mockups/busy-toast): no chip, a spinner in the sparkle's place, the words centred and still. */
button.interpret-cta.busy:not(.again) { justify-content: center; }
.interpret-cta.busy .interpret-cost, .interpret-cta.busy .interpret-label .icon { display: none; }
.interpret-cta.busy .interpret-label::before {
  content: ''; flex: none; width: 18px; height: 18px; margin-right: 8px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor; animation: turn .8s linear infinite;
}
@keyframes turn { to { transform: rotate(360deg); } }
/* design/mockups/interpret-busy, 3: dots grow after 해석 중 as the spinner turns, in a fixed 1em so the words stay put. */
.interpret-cta.busy .interpret-label::after {
  content: '…'; display: inline-block; width: 1em; overflow: hidden; text-align: left; animation: busy-dots 1.2s steps(4) infinite;
}
@keyframes busy-dots { from { width: 0; } to { width: 1em; } }
/* Both keep moving with "reduce motion" too: small and in place, and a still one reads as a frozen screen. */
/* After an answer the button shrinks to a quiet link that sits above the box, on the right. */
button.interpret-cta.again {
  order: -1; align-self: flex-end; min-width: 0; padding: 4px 2px; margin-bottom: 6px;
  background: none; box-shadow: none; color: var(--muted); font-size: .85rem; font-weight: 400; text-decoration: underline;
}
.interpret-box[hidden], .save-nudge[hidden] { display: none; }
/* design/mockups/result-actions, B: the label on the left, what it costs as a chip on the right. */
button.interpret-cta:not(.again) { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; }
button.interpret-cta:not(.again):has(.interpret-cost[hidden]) { justify-content: center; }
.interpret-label { display: inline-flex; align-items: center; }
/* Under a guest's answer: sign in to keep the reading. Quiet, a hairline box below the answer box. */
.save-nudge {
  width: 100%; margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--panel); text-align: left;
}
.save-nudge p { margin: 0 0 6px; }
.save-nudge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 10px; }
.save-nudge-actions .button { padding: 8px 16px; }
/* 내 리딩 기록: days left before a guest's result is deleted. */
.history-dday { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(217, 132, 106, .15); color: var(--accent); font-size: .75rem; font-weight: 600; }
button.save-nudge-later { padding: 4px 2px; border: 0; background: none; color: var(--muted); font-size: .85rem; text-decoration: underline; }
.interpret-box {
  position: relative;
  width: 100%; margin-top: 18px; padding: 4px 20px 16px; background: var(--panel); border: 0; border-radius: 14px;
  animation: open .35s ease-out;
}
.interpret-cta.again ~ .interpret-box { margin-top: 0; }
.interpret-box:has(> .interpret-note[hidden]) { padding-top: 16px; }
/* 이미지로 저장's choice (design/mockups/save-image-choice, A): two rows, the picked one outlined in gold. */
.save-options { display: grid; gap: 8px; margin: 4px 0 12px; }
.save-option { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.save-option:has(input:checked) { border-color: var(--gold); background: rgba(232, 194, 122, .12); }
.save-option input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--btn); }
.save-option b { display: block; font-size: .95rem; }
.save-option small { color: var(--muted); font-size: .8rem; line-height: 1.45; }
button.save-go { width: 100%; min-height: 48px; }
.save-buttons { display: flex; gap: 8px; }
/* With an answer, 공유 is in its row, so the row under the cards keeps only 다시 하기. */
/* 어둡게 (design/mockups/dark-theme/refine.html): the answer's box is outlined with the white hairline, as it barely
   stands off the near-black page by colour alone. */
:root[data-theme="dark"] .interpret-box { border: 1px solid var(--line); }
/* Under the button: today's free answers left · 이용권 left. */
.interpret-cost { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 4px 10px; border-radius: 999px;
  background: color-mix(in srgb, var(--on-btn) 16%, transparent); color: var(--on-btn); font-size: .8rem; font-weight: 700; }
.interpret-cost .coin { width: 16px; height: 16px; }
/* The small "다시 해석" link stays a plain link; the quota line next to it still shows the 이용권 left. */
.interpret-cta.again .interpret-cost { display: none; }
.interpret-cost[hidden] { display: none; }
.interpret-quota b { color: var(--gold); font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 60; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  width: max-content; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 999px; background: #2a2826; color: #f2ede6;
  font-size: .85rem; box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
.toast { animation: toast-in .25s ease-out; transition: opacity .3s ease-in; }
.toast.out { opacity: 0; }
@keyframes toast-in { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
}
.toast b { color: #e6c47e; }
.toast .link { padding: 0; border: 0; background: none; color: #e6c47e; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.interpret-quota { margin: 6px 0 0; color: var(--muted); font-size: .78rem; }
.interpret-quota[hidden] { display: none; }
/* After an answer, the 코인 left (left) and 다시 해석 (right) share one line above the box, centred on each other. */
.interpret:has(> .interpret-cta.again) { flex-flow: row wrap; align-items: center; }
/* With an answer, the 코인 line sits close under the cards' names (about 30px, as the gaps above it), not 50px and more. */
.result-area:has(+ .interpret > .interpret-cta.again) { margin-bottom: 0; }
.interpret:has(> .interpret-cta.again) { margin-top: 8px; }
.interpret:has(> .interpret-cta.again) > :not(.interpret-cta, .interpret-quota) { flex-basis: 100%; }
button.interpret-cta.again { align-self: center; margin: 0 0 6px auto; }
.interpret-cta.again ~ .interpret-quota { order: -2; align-self: center; margin: 0 0 6px; }
/* Out of free answers: sign in, or 이용권, in place of the answer. */
.limit-note { padding: 12px 0 4px; }
.limit-note p { margin: 0 0 6px; }

/* 이용권 (in the light sheet): the packs, the payment button, and the payment's outcome. */
.credit-sheet h2 { margin: 0 0 2px; font-size: 1.2rem; }
.credit-sheet > .muted { margin: 0 0 14px; font-size: .88rem; }
button.credit-pay:disabled { opacity: .5; cursor: not-allowed; }
.credit-choice { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 12px; }
.credit-choice button.credit-pay { margin-top: 0; }
button.credit-cancel { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: none; color: var(--text); font-weight: 700; }
button.credit-pay {
  display: block; width: 100%; margin-top: 14px; padding: 13px; border: 0; border-radius: 12px; font-weight: 700;
  background: var(--btn); color: var(--on-btn);
}
.modal-body.sheet .error { color: var(--danger); }
.credit-fine { margin: 10px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.55; }
.credit-mark { display: grid; place-items: center; width: 54px; height: 54px; margin: 6px auto 8px; border-radius: 50%; background: rgba(232, 194, 122, .12); color: var(--gold); }
.credit-mark .icon { width: 28px; height: 28px; }
.credit-mark.failed { background: rgba(255, 143, 143, .1); color: var(--danger); }
/* 코인 사용 확인 (design/mockups/credit-confirm-2): the reading it is for, then 보유 / 사용 side by side. */
.credit-kicker { margin: 0 0 4px; color: var(--muted); font-size: .78rem; font-weight: 600; }
.credit-sheet h2.credit-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0 6px 2px; font-size: 1.12rem; line-height: 1.4; }
.credit-cols { display: grid; grid-template-columns: 1fr 1fr; padding: 12px 0; border-radius: 14px; background: var(--panel); }
.credit-cols div + div { border-left: 1px solid var(--line); }
.credit-cols span { display: block; color: var(--muted); font-size: .76rem; }
.credit-cols b { display: block; margin-top: 2px; font-size: 1.35rem; font-weight: 800; }
.credit-cols b small { margin-left: 1px; color: var(--muted); font-size: .8rem; font-weight: 500; }
.credit-price { margin: 10px 0 0; color: var(--muted); font-size: .78rem; }
button.credit-cancel.soft { border-color: transparent; background: var(--panel); }
.credit-left { margin: 10px auto 0; padding: 10px 14px; max-width: 240px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.credit-left strong { color: var(--gold); font-size: 1.15rem; }

/* 코인 (/pricing, design/mockups/coin-shop, A): the coin and one line, the packs by name as rows, one fine line. */
.coin-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0 18px; text-align: center; }
.coin-hero > .coin { width: 72px; height: 72px; margin-bottom: 6px; }
.coin-hero h1 { margin: 0; font-family: var(--display); font-size: 1.45rem; letter-spacing: -.03em; }
.coin-hero strong { font-size: 1.02rem; }
.coin-hero p { margin: 0; font-size: .85rem; }
.coin-balance { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel); font-size: .82rem; font-weight: 700; }
.coin-balance .coin { width: 16px; height: 16px; }
a.coin-balance.guest-login { color: var(--text); text-decoration: none; }
.coin-packs { border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.coin-pack { display: flex; align-items: center; gap: 12px; min-height: 92px; padding: 18px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
/* design/mockups/coin-ux, 2 A: the whole row shades under the mouse (and while pressed on a phone). */
a.coin-pack { -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
a.coin-pack:hover, a.coin-pack:active { border-radius: 12px; border-bottom-color: transparent; background: var(--panel); }
.coin-pack > div { flex: 1; }
.coin-pack strong { display: flex; align-items: center; font-size: 1.02rem; }
.coin-count { display: block; margin-top: 6px; color: var(--gold); font-size: .84rem; font-weight: 700; }
.coin-count em { color: var(--muted); font-style: normal; font-weight: 600; }
.coin-price { font-size: 1.08rem; font-weight: 800; }
.credits-tag { margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: rgba(232, 194, 122, .18); color: var(--gold);
  font-size: .7rem; font-weight: 700; }
/* 최대 혜택 (design/mockups/coin-pack-140): the accent's hue, darker on white so the small text stays readable. */
.credits-tag.best { background: rgba(192, 96, 63, .12); color: #9c4426; }
:root[data-theme="dark"] .credits-tag.best { background: rgba(217, 132, 106, .16); color: var(--accent); }
.credits-note { margin: 20px 0 0; text-align: center; color: var(--muted); font-size: .84rem; }
/* design/mockups/polish-2, 8-2 B: the notes and their two links all centred, the links a little apart. */
.coin-fine { margin: 14px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.9; word-break: keep-all; text-align: center; }
.coin-fine-links > * { margin: 0 7px; }
.coin-fine .link { padding: 0; border: 0; background: none; color: var(--text); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.coin-fine a { color: var(--text); text-underline-offset: 3px; }
.coin-fine-links { display: block; margin-top: 8px; text-align: center; }
.coin-panel { margin-top: 8px; padding: 2px 14px; border-radius: 12px; background: var(--panel); font-size: .84rem; }
.coin-panel[hidden] { display: none; }
.credits-example { margin: 4px 0 12px; font-size: .84rem; }
.credits-example p { margin: 2px 0; }
.credits-example b { color: var(--gold); font-variant-numeric: tabular-nums; }

/* 결제하기 (/pricing/pay/<pack>, design/mockups/checkout, A): the title in the top bar, one summary card, the check,
   and the 결제 수단 buttons; the tab bar stays off so nothing covers them. */
body:has(#app.checkout) .tabbar { display: none; }
.checkout .topbar { border-bottom: 1px solid var(--line); }
.topbar-title { position: absolute; left: 50%; transform: translateX(-50%); margin: 0; font-size: 1rem; font-weight: 700; }
/* design/mockups/checkout-spacing-v2, B: roomier gaps, near those of 회사소개 and 코인 충전. */
.checkout-title { margin: 28px 0 12px; font-size: .95rem; font-weight: 800; }
.checkout .topbar + .checkout-title { margin-top: 24px; }
.checkout-summary { padding: 20px; border-radius: 16px; background: var(--panel); font-variant-numeric: tabular-nums; }
.checkout-name { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.checkout-name strong { font-size: 1.05rem; }
.checkout-name span { flex: none; font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.checkout-summary .coin-count { display: block; margin-top: 6px; }
.checkout-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 10px 14px; margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: .84rem; }
.checkout-summary dt { color: var(--muted); }
.checkout-summary dd { margin: 0; text-align: right; font-weight: 600; }
.checkout-summary dd .link { font-weight: 500; text-underline-offset: 3px; }
.checkout-rule { margin: 8px 0 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); font-size: .8rem;
  line-height: 1.6; word-break: keep-all; font-variant-numeric: tabular-nums; }
.checkout-rule h3 { margin: 0 0 6px; color: var(--text); font-size: .86rem; }
/* design/mockups/checkout-v2, 3 B: three numbered steps, the number in a small round badge. */
.checkout-rule ol { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.checkout-rule li { display: flex; gap: 8px; counter-increment: rule; }
.checkout-rule li::before { content: counter(rule); display: grid; flex: none; place-items: center; width: 18px; height: 18px; margin-top: 2px;
  border-radius: 50%; background: var(--panel); color: var(--text); font-size: .7rem; font-weight: 700; }
/* design/mockups/checkout-v2, 1 A: the 결제 방법 as boxes to pick, the chosen one outlined. */
.checkout-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.checkout-methods button { min-height: 52px; padding: 8px 6px; border: 1.5px solid var(--line); border-radius: 12px; background: none; color: var(--text);
  font: inherit; font-size: .86rem; font-weight: 600; word-break: keep-all; cursor: pointer; }
.checkout-methods button.on { border-color: var(--text); background: var(--panel); }
.checkout-rule[hidden] { display: none; }
.checkout-agree { display: flex; gap: 10px; align-items: flex-start; margin: 22px 2px 0; word-break: keep-all; color: var(--muted); font-size: .84rem; line-height: 1.55; cursor: pointer; }
.checkout-agree input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--btn); }
.checkout-agree a { color: var(--text); text-underline-offset: 3px; }
.checkout-buttons { display: grid; gap: 10px; margin-top: 14px; }
/* The check and 결제하기 follow the order right under 결제 방법 (a short order leaves no empty gap above them), and
   stick to the bottom of the screen only when a long one (환불 기준 open) would push them out of view. */
#app.checkout { display: flex; flex-direction: column; min-height: 100dvh; padding-bottom: 0; }
.checkout-dock { position: sticky; bottom: 0; z-index: 5; margin: 0 -16px; padding: 6px 16px calc(16px + var(--safe-bottom, env(safe-area-inset-bottom)));
  background: var(--bg); }
#app.checkout > :nth-last-child(2) { margin-bottom: 22px; }
.checkout-dock .checkout-agree { margin-top: 0; }
.checkout-dock .checkout-buttons { margin-top: 12px; }
button.checkout-pay { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px;
  border: 1.5px solid var(--btn); border-radius: 14px; background: var(--btn); color: var(--on-btn); font-size: 1.02rem; font-weight: 700; }
button.checkout-pay.ghost { background: none; color: var(--text); border-color: var(--text); }
button.checkout-pay .icon { width: 20px; height: 20px; }
button.checkout-pay:disabled { opacity: .45; cursor: not-allowed; }
/* design/mockups/coin-ux, 3 A: a payment button pressed before the check marks the check in red. */
.checkout-agree.warn input { outline: 2px solid var(--danger); outline-offset: 2px; }
.checkout-warn { display: flex; align-items: center; gap: 6px; margin: 10px 2px 0; color: var(--danger); font-size: .84rem; font-weight: 600; }
.checkout-warn[hidden] { display: none; }
.checkout-warn .icon { width: 17px; height: 17px; }

/* 내 계정: AI 해석 — free answers, 이용권, orders. */
.account-credits { margin: 12px 0 8px; }
.account-credits h2 { margin: 0 0 6px; font-size: 1rem; }
.credit-row { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.credit-row:first-of-type { border-top: 0; }
.credit-row span:last-child { font-weight: 600; }
@keyframes open { from { opacity: 0; transform: translateY(-6px); } }
.answer { line-height: 1.7; }

#modal { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: center; justify-content: center; z-index: 1000; }
#modal[hidden] { display: none; }
/* A sheet rises from the bottom of the app column, a grip on top, like a phone app's. */
#modal:has(> .sheet) { align-items: flex-end; }
.modal-body { text-align: center; max-width: 90vw; color: var(--text); }
.modal-body img { max-height: 70vh; max-width: 90vw; border-radius: var(--card-radius, 10px); }
/* 카드 창: picture, name, 정·역방향 and the meaning together run past a phone's height, so the window keeps inside the
   screen and scrolls; the picture is smaller so the meaning starts in view. */
.modal-body.card-view { max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
/* #modal: above the light theme's 60vh for the window's pictures. */
#modal .modal-body.card-view img { max-height: 44dvh; }
.modal-body.sheet {
  --panel: var(--sheet-panel); --line: var(--sheet-line);
  position: relative; width: 100%; max-width: 430px; max-height: 86vh; overflow: auto;
  padding: 26px 18px calc(20px + var(--safe-bottom, env(safe-area-inset-bottom))); border-radius: 22px 22px 0 0; background: var(--sheet); color: var(--text); text-align: left; line-height: 1.6;
  border-top: 1px solid var(--sheet-line); box-shadow: 0 -12px 40px rgba(0, 0, 0, .25); animation: rise .32s cubic-bezier(.2, .8, .2, 1);
}
.modal-body.sheet::before { content: ''; position: absolute; top: 10px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--sheet-line); }
/* design/mockups/credit-confirm, 2: a sheet slides all the way up over a darkening scrim; with reduced motion it only
   fades in, which moves nothing. */
#modal:has(> .sheet):not([hidden]) { animation: scrim-in .24s ease-out; }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes sheet-fade { from { opacity: 0; } }
@keyframes scrim-in { from { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .modal-body.sheet { animation: sheet-fade .22s ease-out; } }
/* A sheet with a scrolling part (가이드): the title stays, the rest scrolls with no bar, a fade marks more below. */
.modal-body.sheet:has(> .sheet-scroll) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
/* On wide screens every sheet sits in the middle as a window and grows in a little (a sheet rising from the
   bottom edge of a wide window is far from the pointer); a short dialog is narrower. Phones keep the sheet from the bottom. */
@media (min-width: 768px) {
  #modal:has(> .sheet) { align-items: center; }
  .modal-body.sheet { max-height: 80vh; padding-bottom: 20px; border: 1px solid var(--sheet-line); border-radius: 20px; box-shadow: 0 16px 48px rgba(0, 0, 0, .25); animation: dialog-in .22s cubic-bezier(.2, .8, .2, 1); }
  .modal-body.sheet:has(> .sheet-scroll) { padding-bottom: 0; }
  .modal-body.sheet.dialog { max-width: 380px; }
  .modal-body.sheet::before { display: none; }
}
@keyframes dialog-in { from { transform: scale(.94); opacity: 0; } }
@media (min-width: 768px) and (prefers-reduced-motion: reduce) { .modal-body.sheet { animation: sheet-fade .22s ease-out; } }
.modal-body.sheet:has(> .sheet-scroll) > h2 { flex: none; margin: 0 40px 8px 0; font-family: var(--display); letter-spacing: -.03em; }
.sheet-scroll { flex: 1 1 auto; min-height: 0; margin: 0 -18px; padding: 4px 18px calc(24px + var(--safe-bottom, env(safe-area-inset-bottom))); overflow-y: auto; scrollbar-width: none; }
.sheet-scroll::-webkit-scrollbar { display: none; }
/* 배열 바꾸기 (design/mockups/spread-sheet-fix, 1): its line under the title stays too; the list runs the sheet's height. */
.modal-body.sheet:has(> .sheet-scroll) > p { flex: none; margin: 0 0 6px; }
.sheet-scroll .sheet-menu { max-height: none; overflow: visible; margin-top: 4px; }
.sheet-fade { position: absolute; left: 0; right: 0; bottom: 0; height: 48px; pointer-events: none; background: linear-gradient(transparent, var(--sheet)); transition: opacity .2s; }
.sheet-fade.end { opacity: 0; }
/* 가이드 (design/mockups/guide-spread, B and D): one line on the names, then the places named under each, or the
   picture beside a one-column list; each line kept to one line. */
.guide-lead { margin: 0 0 12px; line-height: 1.5; }
.guide-lead strong, .guide-lead span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.guide-lead strong { font-size: .94rem; }
.guide-lead span { color: var(--muted); font-size: .82rem; }
.guide-shape .pick-slot:not(.cross) { display: grid; place-items: center; }
.guide-captioned { position: relative; margin: 4px auto 4px; }
.guide-captioned .pick-slot { position: absolute; display: grid; place-items: center; aspect-ratio: auto; font-size: .78rem; }
.guide-cap { position: absolute; transform: translateX(-50%); color: var(--text); font-size: .76rem; line-height: 1.3; white-space: nowrap; }
.guide-split { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0; }
.guide-split .guide-shape { flex: none; margin: 0; }
.guide-names { display: grid; gap: 3px; margin: 0; padding: 0; list-style: none; font-size: .88rem; }
.guide-names li { display: flex; gap: 8px; white-space: nowrap; }
.guide-names b { min-width: 20px; color: var(--gold); font-variant-numeric: tabular-nums; }
.guide-tiny { margin: 12px 0 0; color: var(--muted); font-size: .8rem; white-space: nowrap; }
/* 가이드 (design/mockups/polish-2, 5 C): the spread's guide and 뽑는 방식 as two tabs. */
.guide-tabs { display: flex; margin: 0 0 14px; padding: 3px; border-radius: 10px; background: var(--panel); }
.guide-tabs button { flex: 1; min-width: 0; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--muted);
  font: inherit; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guide-tabs button.on { background: var(--sheet); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.guide-ways { display: grid; gap: 8px; }
.guide-ways[hidden], .sheet-scroll > div[hidden] { display: none; }
.guide-way { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: .86rem; line-height: 1.55; }
.guide-way-icon { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--panel); color: var(--gold); }
.guide-way-icon .icon { width: 16px; height: 16px; }
.guide-way strong { display: block; }
.guide-way span { color: var(--muted); word-break: keep-all; }
.guide-more { margin-top: 14px; border-top: 1px solid var(--line); }
.guide-more summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; font-weight: 700; cursor: pointer; list-style: none; }
.guide-more summary::-webkit-details-marker { display: none; }
.guide-more summary::after { content: ''; width: 7px; height: 7px; margin: 0 4px 4px 0; border: solid var(--muted); border-width: 0 2px 2px 0;
  transform: rotate(45deg); transition: transform .2s; }
.guide-more[open] summary::after { margin: 4px 4px 0 0; transform: rotate(-135deg); }
.guide-more ul { margin: 0; padding-left: 20px; }
.guide-more p { margin: 0 0 8px; }
.guide-foot { margin: 16px 0 0; font-size: .84rem; }

/* 문의하기 (design/mockups/spread-contact, 5): the three kinds as rows, 내 문의 내역 with answers under each. */
.contact-types { margin: 12px 0 30px; border-top: 1px solid var(--line); }
.contact-types a { display: flex; align-items: center; gap: 14px; min-height: 78px; padding: 0 2px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.contact-types a > span:nth-child(2) { display: flex; flex: 1; flex-direction: column; gap: 3px; }
.contact-types small { color: var(--muted); font-size: .8rem; }
.contact-types > a > .icon { color: var(--muted); }
.contact-icon { display: grid; flex: none; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--panel); color: var(--gold); }
.contact-icon .icon { width: 20px; height: 20px; }
.contact-empty { padding: 22px 0; border-radius: 12px; background: var(--panel); color: var(--muted); text-align: center; font-size: .9rem; }
.inquiry { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.inquiry-head { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .8rem; }
.inquiry-body { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.6; }
.inquiry-reply { margin-top: 10px; padding: 12px; border-radius: 12px; background: var(--panel); line-height: 1.6; }
.inquiry-reply b { display: block; margin-bottom: 4px; color: var(--gold); font-size: .8rem; }
.inquiry-reply p { margin: 0; white-space: pre-wrap; }
.badge { padding: 2px 8px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: .74rem; font-weight: 700; }
.badge.done, .contact-status.ok { background: rgba(63, 125, 78, .12); color: #3f7d4e; }
.contact-status.fail, .contact-stats b.bad { color: #b3402f; }
.contact-status.fail { background: rgba(179, 64, 47, .1); }
:root[data-theme="dark"] .badge.done, :root[data-theme="dark"] .contact-status.ok { color: #8fcf9d; }
:root[data-theme="dark"] .contact-status.fail, :root[data-theme="dark"] .contact-stats b.bad { color: #f0907f; }
.contact-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 14px 0 6px; border-radius: 14px; background: var(--panel); }
.contact-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 0; }
.contact-stats div + div { border-left: 1px solid var(--line); }
.contact-stats small { color: var(--muted); font-size: .76rem; }
.contact-stats b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.contact-label { display: flex; align-items: baseline; gap: 6px; margin: 20px 0 8px; font-weight: 700; }
.contact-label em { color: #b3402f; font-size: .76rem; font-style: normal; }
.contact-label small { color: var(--muted); font-size: .78rem; font-weight: 400; }
.contact-search, .contact-email, .contact-text { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); font: inherit; font-size: 16px; }
.contact-text { resize: vertical; min-height: 120px; line-height: 1.55; }
.contact-picks { margin: 6px 0 0; padding: 0; list-style: none; }
.contact-picks li { border-bottom: 1px solid var(--line); }
.contact-picks label { display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 6px 4px; cursor: pointer; }
.contact-picks li.on label { border-radius: 10px; background: rgba(168, 118, 31, .08); }
.contact-picks li.off { opacity: .45; }
.contact-picks li.off label { cursor: default; }
.contact-picks input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
.contact-pick-text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.contact-pick-text b { overflow: hidden; font-size: .9rem; white-space: nowrap; text-overflow: ellipsis; }
.contact-pick-text small { color: var(--muted); font-size: .75rem; }
.contact-status { flex: none; padding: 3px 8px; border-radius: 999px; background: var(--panel); color: var(--muted); font-size: .72rem; font-weight: 700; }
.contact-none { padding: 18px 0; color: var(--muted); text-align: center; font-size: .88rem; }
button.contact-more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 46px; border: solid var(--line);
  border-width: 0 0 1px; border-radius: 0; background: none; color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; }
.contact-more[hidden] { display: none; }
.contact-more .icon { width: 16px; height: 16px; }
button.contact-send { width: 100%; min-height: 52px; margin-top: 22px; border: 0; border-radius: 12px; background: var(--btn); color: var(--on-btn);
  font-weight: 700; font-size: 1rem; }

/* AI 해석 on its way: one line saying what is being done, until a new design takes its place. */
.reading-wait { padding: 12px 0 6px; }
.reading-step { margin: 0; color: var(--muted); font-size: .92rem; font-weight: 600; text-align: center; }
.sheet-title { font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -.03em; }
/* ✕ on the sheet's title line: the title starts at the sheet's 26 px padding (a heading without its top margin), so
   the 32 px button centred on a 38 px heading line sits at 29 px. */
.sheet .close { position: absolute; right: 8px; top: 29px; padding: 6px; border: 0; background: none; color: inherit; }
.modal-body.sheet > .close + h2 { margin-top: 0; }
/* 결과 공유: the preview of what the link shows, the note, then round buttons with a caption under each. */
.share-preview { margin: 12px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.share-preview strong { display: block; }
.share-preview p { margin: 6px 0 0; }
.share-note { font-size: .85rem; }
.share-targets { display: flex; justify-content: center; gap: 28px; margin-top: 16px; }
button.share-target { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font-size: .85rem; }
.share-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--panel); font-size: 1.1rem; font-weight: 700; }
button.share-target:hover .share-icon { background: var(--chip-bg); }
.share-status { min-height: 1.6em; margin: 10px 0 0; }
/* Sheet rows (design/mockups/save-settings, 3 A): one row each, an icon in a soft square. */
.more-list { display: flex; flex-direction: column; margin-top: 8px; }
.more-list button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 8px 4px; border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; background: none; box-shadow: none; color: var(--text); font: inherit; font-size: .92rem; text-align: left; }
.more-list button:last-child { border-bottom: 0; }
.more-list button:hover { transform: none; background: none; color: var(--gold); }
.more-icon { display: grid; flex: none; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--panel); color: var(--text); }
.more-icon .icon { width: 18px; height: 18px; }
/* 무엇을 바꿀까요? (design/mockups/spread-sheet-fix, 6 A): those rows, what is in use under each name. */
.change-list button { min-height: 62px; }
.change-list button > span:not(.more-icon) { flex: 1; min-width: 0; }
.change-list small { display: block; margin-top: 1px; color: var(--muted); font-size: .76rem; }
.change-list button > .icon { color: var(--muted); }
/* 카드 방향 in 바꾸기: the row is the switch, its value at the right; both values look alike, neither is "off".
   It stays open after a tap, so the tap's lingering hover must not tint it. */
.change-list em { flex: none; color: var(--text); font-size: .84rem; font-style: normal; }
.change-list [role="switch"]:hover { color: var(--text); }
/* 내 계정's coin card with no daily free answers: the 코인 left, large, with their expiry on the right. */
.wallet .coins-one { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--bg); }
.wallet .coins-one span { display: block; color: var(--muted); font-size: .76rem; }
.wallet .coins-one b { display: block; margin-top: 3px; color: var(--gold); font-size: 1.6rem; }
.wallet .coins-one b small { font-size: .8rem; font-weight: 500; color: var(--muted); }
.wallet .coins-one em { display: block; margin-top: 2px; color: var(--muted); font-size: .76rem; font-style: normal; }
.wallet .coins-one { align-items: center; }
/* 내 계정 (design/mockups/small-fixes, 3B): the account and the 코인 without boxes, split by a line like the menus below. */
#app > .profile { margin-bottom: 0; padding: 8px 0 16px; border: 0; border-radius: 0; }
.wallet.plain { padding: 16px 0 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.wallet.plain .coins-one { align-items: flex-end; margin: 0; padding: 0; background: none; }
.wallet.plain .coins-one span { display: flex; align-items: center; gap: 6px; font-size: .82rem; }
.wallet.plain .coins-one span .coin { width: 22px; height: 22px; }
.wallet.plain .coins-one b { margin-top: 4px; color: var(--text); font-family: var(--display); font-size: 2.3rem; line-height: 1; letter-spacing: -.02em; }
.wallet.plain .coins-one b small { margin-left: 3px; font-size: 1rem; }
.wallet.plain > p { margin: 14px 0 0; }
.wallet .coins-one button.charge { flex: none; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-weight: 700; font-size: .88rem; }
/* 구매 내역 (design/mockups/account-coins, A). */
.purchases { margin-top: 12px; }
.purchase-summary { display: flex; justify-content: space-between; padding: 14px; border-radius: 14px; background: var(--panel); font-size: .9rem; }
.purchase-summary b { color: var(--gold); }
.purchase-list { margin: 10px 0 0; padding: 0; list-style: none; }
.purchase-list li { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.purchase-list .top { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: .95rem; }
.purchase-list .sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 5px; color: var(--muted); font-size: .8rem; }
.purchase-summary { flex-direction: column; gap: 3px; }
.purchase-summary small { color: var(--muted); font-size: .78rem; }
.purchase-list li:has(> .purchase-row) { padding: 0; }
button.purchase-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 10px; width: 100%; padding: 14px 2px;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); font: inherit; text-align: left; }
button.purchase-row .top, button.purchase-row .sub { grid-column: 1; }
button.purchase-row .icon { grid-column: 2; grid-row: 1 / 3; color: var(--muted); }
button.purchase-row:hover { transform: none; background: var(--soft); }
.purchase-group { margin: 22px 2px 0; color: var(--muted); font-size: .8rem; font-weight: 700; }
.purchase-detail { margin: 14px 0 0; }
.purchase-detail > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.purchase-detail dt { color: var(--muted); }
.purchase-detail dd { margin: 0; text-align: right; }
.purchase-detail dd b { color: var(--gold); }
.purchase-detail-note { margin: 12px 0 0; font-size: .8rem; line-height: 1.5; }
button.purchase-refund { width: 100%; min-height: 48px; margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--danger); font-weight: 700; }
.purchase-empty { margin: 18px 2px; }
.purchase-note { margin: 14px 2px 0; font-size: .78rem; line-height: 1.5; }

/* Invite-only deck seen without a code: the card's name on a plain face. */
.card.locked { display: flex; align-items: center; justify-content: center; padding: 6px; background: var(--panel); color: var(--text); border-radius: 6px; }
.card.locked .card-name { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; line-height: 1.3; text-align: center; word-break: keep-all; }
.card.locked small { font-size: .65rem; opacity: .8; }
.locked-note { font-size: .8rem; margin: 4px 0 0; }
/* 내 리딩 기록: one tappable row per result drawn in this browser. */
.history-blank { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 80px 16px; text-align: center; }
.history-blank-icon { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 8px; border-radius: 50%; background: var(--panel); color: var(--text); }
.history-blank button.retry { min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-weight: 600; }
.history-blank p { margin: 0 0 12px; font-size: .85rem; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { margin: 0; border-radius: 0; background: none; border-bottom: 1px solid var(--line); }
.history-empty { padding: 16px; }
/* 내 리딩 기록: a heading over each date group (오늘 · 어제 · 이번 주 · 이번 달 · a month), 이전 기록 더 보기 under the list. */
.history-group { margin: 16px 4px 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.history-group small { margin-left: 6px; font-weight: 400; }
/* 편집 at the right of the first heading, its tap area kept without making the heading taller. */
div.history-group { display: flex; align-items: center; justify-content: space-between; }
.history-group button.history-edit { margin: -12px -6px -12px 0; font-weight: 400; }
button.history-load { display: block; width: 100%; min-height: 46px; margin: 14px 0 0; color: var(--gold); font-size: .9rem; }
button.history-load small { margin-left: 4px; color: var(--muted); font-size: .8rem; }
.history-end { margin: 14px 0 0; font-size: .8rem; }
.history-list a { display: flex; gap: 14px; align-items: center; padding: 12px 14px; color: inherit; text-decoration: none; }
.history-text { min-width: 0; }
.history-list .history-theme { color: var(--muted); font-weight: 500; }
.theme-mark { margin-right: 6px; padding: 1px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--gold); font-size: .7rem; font-weight: 600; vertical-align: 1px; }
.history-list .history-text strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Up to three cards fanned from the bottom; each picture turns inside its holder when reversed. */
.history-fan { position: relative; flex: none; width: 84px; height: 76px; }
.fan-card { position: absolute; left: 22px; bottom: 2px; width: 40px; height: 67px; transform-origin: 50% 100%; }
.fan-card img, .fan-back { display: block; width: 100%; height: 100%; border-radius: 4px; object-fit: cover; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.fan-back { background: var(--card-back); border: 1px solid var(--gold); }
.fan-card img.reversed { transform: rotate(180deg); }
.fan-card.cut { height: auto; aspect-ratio: 966 / 1712; }
.history-fan.n2 .fan-card:nth-child(1) { transform: translateX(-9px) rotate(-8deg); }
.history-fan.n2 .fan-card:nth-child(2) { transform: translateX(9px) rotate(8deg); }
.history-fan.n3 .fan-card:nth-child(1) { transform: translateX(-14px) rotate(-12deg); }
.history-fan.n3 .fan-card:nth-child(2) { z-index: 1; }
.history-fan.n3 .fan-card:nth-child(3) { transform: translateX(14px) rotate(12deg); }
.fan-count { position: absolute; z-index: 2; right: -2px; top: -2px; padding: 1px 6px; border-radius: 999px; background: var(--btn); color: var(--on-btn); font-size: .68rem; font-weight: 700; }
/* 검색 (design/mockups/history-search): one box over the tabs; the searched words marked in the rows. */
.history-search { position: relative; margin: 0 0 10px; }
/* design/mockups/history-title-gap, C: right under the title (signed in, no note) as far as 배열로 직접 고르기's tiles. */
.page-title + .history-search { margin-top: 16px; }
.history-search[hidden] { display: none; }
.history-search > .icon { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.history-search input { width: 100%; height: 46px; margin: 0; padding: 0 44px 0 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--text); font: inherit; font-size: .92rem; -webkit-appearance: none; appearance: none; }
.history-search input::placeholder { color: var(--muted); }
.history-search input::-webkit-search-cancel-button { display: none; }
.history-search input:focus { border-color: var(--gold); background: var(--bg); outline: none; }
/* 밝게 (design/mockups/history-calendar, 1 B): the search box and the unpicked chips on white with a hairline, like the
   home's chips and 카드 사전's deck box. */
:root:not([data-theme="dark"]) .history-search input, :root:not([data-theme="dark"]) .history-chips button:not(.on) { background: var(--bg); }
/* 달력 (design/mockups/history-calendar, D): the week up to today over the list, or the month; one dot on a day with readings
   however many (design/mockups/history-calendar-dot). */
.history-cal { margin: 0 0 4px; }
.history-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.history-day { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: 52px;
  padding: 0; border: 0; border-radius: 12px; background: none; color: var(--text); font: inherit; font-size: .88rem; }
.history-day small { color: var(--muted); font-size: .68rem; }
/* Not .today: that is the home's 오늘의 카드 box, with its own margins. */
.history-day.is-today { color: var(--gold); font-weight: 700; }
.history-day.on { background: var(--text); color: var(--bg); font-weight: 700; }
.history-day.on small { color: inherit; opacity: .7; }
.history-day:disabled { opacity: .35; }
.history-dots { display: flex; justify-content: center; gap: 2px; height: 4px; margin-top: 2px; }
.history-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.history-month { padding: 10px 8px 6px; border: 1px solid var(--line); border-radius: 16px; }
.history-month-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; }
.history-cal-step { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--text); font-size: 1.1rem; }
.history-month-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.history-month-grid .history-day { height: 44px; }
.history-dow { padding-bottom: 4px; color: var(--muted); font-size: .72rem; }
.history-cal-toggle { display: block; width: 100%; min-height: 36px; padding: 6px; border: 0; background: none; color: var(--muted); font: inherit; font-size: .8rem; }
button.history-search-clear { display: none; position: absolute; right: 1px; top: 1px; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); }
.history-search.filled button.history-search-clear { display: grid; place-items: center; }
button.history-search-clear .icon { width: 16px; height: 16px; }
.history-search-count { margin: 0 4px; color: var(--muted); font-size: .8rem; }
.history-search-count b { color: var(--text); font-weight: 600; }
.history-list mark { padding: 0 1px; border-radius: 3px; background: rgba(232, 194, 122, .38); color: inherit; }
.history-match { display: block; margin-top: 4px; color: var(--muted); font-size: .76rem; }
.history-no-match { margin-top: 36px; text-align: center; }
.history-no-match p { margin: 0 0 6px; font-weight: 600; }
.history-no-match small { display: block; margin-bottom: 16px; color: var(--muted); font-size: .82rem; }
.history-no-match button { min-height: 40px; padding: 0 16px; font-size: .86rem; }
/* 전체 · 공유 중: one row of pills. */
.history-chips { display: flex; gap: 8px; margin: 0 -16px 12px; padding: 2px 16px 6px; overflow-x: auto; scrollbar-width: none; }
.history-chips button { flex: none; min-height: 40px; padding: 6px 14px; color: var(--muted); font-size: .88rem; }
.history-chips button small { margin-left: 5px; font-size: .75rem; opacity: .75; }
.history-chips button.on { border-color: var(--gold); background: rgba(232, 194, 122, .16); color: var(--gold); font-weight: 600; }
/* The title from the left edge like every screen's, 편집 at the right. */
button.history-edit { flex: none; min-height: 40px; margin-bottom: 4px; padding: 4px 6px; border: 0; background: none; color: var(--muted); font-size: .88rem; }
.history-list li { display: flex; align-items: center; }
.history-list li > a, .history-list .history-row { flex: 1; min-width: 0; }
button.history-more { flex: none; width: 44px; height: 44px; margin-right: 4px; padding: 0; border: 0; background: none; color: var(--muted); }
.history-list .history-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border: 0; border-radius: 12px; background: none; text-align: left; }
.history-check { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border: 1.5px solid var(--line); border-radius: 50%; color: var(--on-btn); }
/* Picked: the check and a faint gold wash over the row, no outline (design/mockups/history-result-polish, 2). */
.history-list li.picked { background: rgba(232, 194, 122, .14); }
.history-list li.picked .history-check { border-color: var(--btn); background: var(--btn); }
.history-check .icon { width: 16px; height: 16px; }
/* design/mockups/history-edit-sheet, bar B: a thin full-width row, words instead of boxes. While editing it takes the tab
   bar's place (design/mockups/history-edit-bar, 2안), as a phone's photo app does in its select mode. */
/* Fixed, so a short list keeps it at the bottom too; the list's room under it stays clear of it. */
.history-actions { position: fixed; z-index: 50; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; align-items: center; justify-content: space-between; box-sizing: border-box; width: min(100%, 430px);
  padding: 0 8px var(--safe-bottom, env(safe-area-inset-bottom)); min-height: calc(56px + var(--safe-bottom, env(safe-area-inset-bottom)));
  border-top: 1px solid var(--line); background: var(--bg); }
body:has(.history-actions) .tabbar { display: none; }
#app:has(.history-actions) { padding-bottom: calc(96px + var(--safe-bottom, env(safe-area-inset-bottom))); }
.history-actions button { min-height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--text); font-size: .92rem; }
.history-actions button:hover { transform: none; background: none; }
.history-actions button.danger { color: var(--danger); font-weight: 600; }
.history-actions button:disabled { color: var(--muted); opacity: .6; }
.history-picked { color: var(--muted); font-size: .84rem; }
button.danger { color: var(--danger); }
.unsaved-note { width: fit-content; max-width: 100%; margin: 10px auto 0; padding: 8px 14px; border-radius: 10px; background: rgba(194, 90, 106, .12); color: var(--accent); font-size: .85rem; }
.sheet-title { display: block; padding-right: 32px; }
/* 양자택일: the two choices asked before dealing. */
.choice-fields label { display: block; margin: 10px 0 0; color: var(--muted); font-size: .85rem; }
.choice-fields input { display: block; width: 100%; margin-top: 4px; }
.choice-buttons { display: grid; gap: 8px; margin-top: 16px; }
.choice-buttons button { min-height: 48px; }
/* 기록's ⋯ (design/mockups/history-edit-sheet, B): the spread and time over the question's one line. */
.item-menu-head { display: block; padding-right: 36px; }
.item-menu-head strong { display: block; font-size: 1rem; font-weight: 700; }
.item-menu-head span { display: block; margin-top: 2px; overflow: hidden; color: var(--muted); font-size: .86rem; white-space: nowrap; text-overflow: ellipsis; }
.more-list button.danger { color: var(--danger); }
.more-list button.danger .more-icon { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.confirm-buttons { display: flex; gap: 8px; margin: 16px 0 0; }
.confirm-buttons button { flex: 1; min-height: 46px; }
/* 작성 중인 질문이 있어요 (design/mockups/question-draft/center-dialog.html): a small window in the middle on every
   screen, the question as it was left in a quiet box, two lines at most. */
.modal-body.draft-dialog {
  width: calc(100% - 44px); max-width: 340px; padding: 24px 18px 18px; border: 1px solid var(--sheet-line); border-radius: 18px;
  background: var(--sheet); box-shadow: 0 16px 48px rgba(0, 0, 0, .25); line-height: 1.55; animation: dialog-in .22s cubic-bezier(.2, .8, .2, 1);
}
.draft-dialog strong { display: block; font-size: 1.1rem; letter-spacing: -.02em; }
.draft-dialog > p { margin: 8px 0 0; color: var(--muted); font-size: .88rem; word-break: keep-all; }
.draft-dialog .draft-quote { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 14px; color: var(--text); text-align: left; }
.draft-dialog .confirm-buttons { margin-top: 18px; }
@media (prefers-reduced-motion: reduce) { .modal-body.draft-dialog { animation: sheet-fade .22s ease-out; } }
.draft-quote { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--sheet-panel); line-height: 1.55; overflow-wrap: anywhere; }
.modal-body.sheet button.danger { color: var(--danger); }
.history-shared, .history-dday { display: inline-block; white-space: nowrap; }
.history-shared { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(232, 194, 122, .18); color: var(--gold); font-size: .75rem; font-weight: 600; }
.history-list .history-meta { display: flex; align-items: center; flex-wrap: wrap; white-space: pre-wrap; font-size: .75rem; color: var(--muted); margin-bottom: 4px; }
/* Right after the spread's name (and 공유 중 · D-day), not pushed to the row's far end. */
.history-meta .theme-mark { margin: 0 0 0 6px; }
.history-list .history-text { flex: 1; }
.history-list strong { font-weight: 600; word-break: keep-all; overflow-wrap: anywhere; }

/* 운영자 통계 (design/mockups/server-stats) */
/* design/mockups/stats-redesign, A: the same sections, tidied — gold for every bar, numbers and ratios in their own columns. */
.stats { --up: #2f7d4f; --up-bg: rgba(47, 125, 79, .12); --down: var(--danger); --down-bg: rgba(200, 66, 58, .12); }
:root[data-theme="dark"] .stats { --up: #7fcf9c; --up-bg: rgba(127, 207, 156, .14); --down-bg: rgba(255, 138, 128, .14); }
.stats-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.stats-seg { display: flex; padding: 3px; border-radius: 10px; background: var(--panel); }
.stats-seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-size: .85rem; }
.stats-seg button:hover { transform: none; }
.stats-seg button.on { background: var(--raised); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.stats-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.stats-tile { padding: 12px 14px; border-radius: 14px; background: var(--panel); }
.stats-tile small { display: block; color: var(--muted); font-size: .8rem; }
.stats-tile strong { display: block; margin: 2px 0 4px; font-size: 1.6rem; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stats-badge { display: inline-block; padding: 1px 7px; border-radius: 99px; background: var(--chip-bg); color: var(--muted); font-size: .72rem; font-style: normal; }
.stats-badge.up { background: var(--up-bg); color: var(--up); font-weight: 600; }
.stats-badge.down { background: var(--down-bg); color: var(--down); font-weight: 600; }
.stats-note { margin: 8px 2px 0; font-size: .76rem; line-height: 1.5; }
.stats-title { display: flex; justify-content: space-between; align-items: baseline; color: var(--text); font-size: .95rem; font-weight: 700; }
.stats-title small { color: var(--muted); font-size: .76rem; font-weight: 400; }
.stats-funnel { display: grid; grid-template-columns: 70px 1fr 34px 40px; align-items: center; gap: 6px 10px; font-size: .85rem; }
.stats-bar { height: 8px; overflow: hidden; border-radius: 4px; background: var(--panel); }
.stats-bar i { display: block; height: 100%; border-radius: 4px; background: var(--gold); }
.stats-funnel b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-funnel em { color: var(--muted); font-size: .76rem; font-style: normal; text-align: right; }
.stats-funnel .zero, .stats-days b.zero { color: var(--muted); opacity: .6; font-weight: 400; }
.stats-days { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 18px;
  border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 61px) 0 18px / 100% 100% no-repeat; }
.stats-days > div { display: flex; flex: 1; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.stats-days b { margin-bottom: 3px; font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats-days i { display: block; flex: none; width: 60%; max-width: 26px; min-height: 2px; border-radius: 5px 5px 0 0; background: var(--gold); }
.stats-days i.zero { background: var(--line); }
.stats-day-labels { display: flex; gap: 3px; margin-top: 5px; }
.stats-day-labels span { flex: 1; min-width: 0; color: var(--muted); font-size: .68rem; text-align: center; white-space: nowrap; }
.stats-day-labels .today { color: var(--text); font-weight: 700; }
/* design/mockups/stats-signups: 매출 in won is wider than a count; 어디서 왔나요 and 상품팩별 판매 as aligned rows. */
.stats-tile.money strong { font-size: 1.35rem; }
/* 운영자 통계's SNS 자동 답글 */
.sns-status { margin-top: 28px; }
.sns-platforms, .sns-recent { margin: 8px 0 0; padding: 0; list-style: none; }
.sns-platforms li { display: grid; grid-template-columns: 76px 64px 1fr; align-items: baseline; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.sns-platforms b { font-weight: 700; color: var(--up); }
.sns-platforms .warn b { color: var(--down); }
.sns-platforms .off b, .sns-platforms em { color: var(--muted); font-weight: 400; }
.sns-platforms em { font-size: .76rem; font-style: normal; overflow-wrap: anywhere; }
.sns-recent li { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.sns-recent li > div { display: flex; align-items: baseline; gap: 8px; }
.sns-recent li > div b { margin-left: auto; font-size: .76rem; color: var(--muted); }
.sns-recent li.done > div b { color: var(--up); }
.sns-recent li.failed > div b { color: var(--down); }
.sns-recent small { color: var(--muted); font-size: .76rem; }
.sns-tag { padding: 1px 7px; border-radius: 99px; background: var(--chip-bg); font-size: .72rem; }
.sns-recent p { margin: 4px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.sns-reply { color: var(--muted); }
.sns-error { color: var(--down); font-size: .76rem; }
.stats-src, .stats-sales { display: grid; gap: 0 8px; margin: 0; padding: 0; list-style: none; font-size: .85rem; font-variant-numeric: tabular-nums; }
.stats-src { grid-template-columns: 1fr 44px 44px 44px; }
.stats-sales { grid-template-columns: 1fr auto 76px; gap: 0 10px; }
.stats-src li, .stats-sales li { display: contents; }
.stats-src li > *, .stats-sales li > * { padding: 9px 0; border-bottom: 1px solid var(--line); }
.stats-src li.head > * { padding-top: 0; color: var(--muted); font-size: .74rem; font-weight: 400; }
.stats-src li.head > :not(:first-child), .stats-src b, .stats-sales b { text-align: right; font-weight: 600; }
.stats-src .paid { color: #86601a; }
:root[data-theme="dark"] .stats-src .paid { color: var(--gold); }
.stats-src .zero, .stats-sales .zero { color: var(--muted); font-weight: 400; }
.stats-sales em { color: var(--muted); font-style: normal; text-align: right; }
.stats-sales li.total > * { border-bottom: 0; font-weight: 700; }
.stats-rank { margin: 0; padding: 0; list-style: none; }
.stats-rank li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 4px 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.stats-rank li:last-child { border-bottom: 0; }
.stats-rank li.empty { display: block; color: var(--muted); }
.stats-rank-no { color: var(--gold); font-size: .76rem; font-weight: 700; }
.stats-rank .rest .stats-rank-no { color: var(--muted); }
.stats-rank b { text-align: right; font-variant-numeric: tabular-nums; }
.stats-share { grid-column: 2 / 4; height: 4px; overflow: hidden; border-radius: 2px; background: var(--panel); }
.stats-share i { display: block; height: 100%; border-radius: 2px; background: var(--gold); opacity: .35; }
.stats-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats-mini div { padding: 10px 12px; border-radius: 12px; background: var(--panel); }
.stats-mini small { display: block; color: var(--muted); font-size: .72rem; }
.stats-mini strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stats-mini .warn strong { color: var(--danger); }
.stats-kv { margin: 10px 0 0; padding: 0; list-style: none; }
.stats-kv li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.stats-pills { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.stats-pills span { padding: 2px 8px; border-radius: 99px; background: var(--panel); color: var(--muted); font-size: .76rem; }
.stats-pills b { margin-left: 3px; color: var(--text); }
.stats-empty { margin-top: 48px; line-height: 1.6; }
