/* TossDash 공개 페이지(첫 화면 · 도움말 · 방침 · 약관 · 404 · 500) — 대시보드(app.css)와 같은 색 토큰 · 같은 글꼴.
   어두운 바탕 기본 · 대시보드 설정에서 밝게를 고르면 여기도 밝게(theme.js). 폰 먼저, 넓으면 두 칸. */
:root {
  color-scheme: dark;
  --bg: #090d13; --surface: #10161f; --surface2: #161d27; --track: #1c2531; --line: #1c2531;
  --ink: #e8edf4; --ink2: #b4bfcd; --muted: #98a3b3; --chev: #6b7687;
  --money: #c98500; --up: #2bbd4f; --up-bg: #12301c; --down: #ff7272; --down-bg: #36171a; --flat: #f5a524;
  --primary: #e3a21a; --primary-ink: #090d13; --primary-soft: #2b2412; --primary-soft-ink: #f0b43c;
  --field: #0c1118; --field-line: #2a3442; --wm-toss: #fff3d6; --wm-dash: #f5a524;
  --font: 'IBM Plex Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f2f4f7; --surface: #ffffff; --surface2: #f5f7fa; --track: #e4e8ee; --line: #e6e9ef;
  --ink: #0e1621; --ink2: #455163; --muted: #5f6a7a; --chev: #6b7687;
  --money: #c07a00; --up: #0b6b2b; --up-bg: #e4f3e8; --down: #c22f2f; --down-bg: #fbe7e7; --flat: #f5a524;
  --primary: #9a5f00; --primary-ink: #ffffff; --primary-soft: #fbf1de; --primary-soft-ink: #8a5400;
  --field: #ffffff; --field-line: #c9d0db; --wm-toss: #3b2a20; --wm-dash: #e08a1e;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
svg { flex: none; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
[tabindex='-1']:focus { outline: none; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 10px 14px; border-radius: 10px; background: var(--primary); color: var(--primary-ink); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 720px; }

/* ── 머리 · 바닥 */
.s-hdr .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; min-width: 0; }
.wordmark { font-family: 'Jua', var(--font); line-height: 1; letter-spacing: -0.01em; white-space: nowrap; }
.wordmark .t { color: var(--wm-toss); }
.wordmark .d { color: var(--wm-dash); }
.s-nav { display: flex; align-items: center; gap: 4px; }
.s-nav a { height: 40px; padding: 0 12px; display: inline-flex; align-items: center; border-radius: 10px; text-decoration: none; font-size: 15px; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.s-nav a.s-login { background: var(--surface); color: var(--ink); font-weight: 600; }
.s-ftr { margin-top: 72px; padding: 32px 0 calc(40px + var(--safe-b)); border-top: 1px solid var(--line); font-size: 13px; line-height: 1.7; color: var(--muted); }
.s-ftr .wrap { display: flex; flex-direction: column; gap: 10px; }
.f-links { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 14px; color: var(--ink2); }
.f-links a { text-decoration: none; }
.f-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.page-landing .s-ftr { padding-bottom: calc(112px + var(--safe-b)); }

/* ── 단추 */
.btn {
  height: 56px; border: 0; border-radius: 14px; background: var(--primary); color: var(--primary-ink); font-size: 17px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 28px; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.soft { background: var(--primary-soft); color: var(--primary-soft-ink); }
.text-link { color: var(--primary-soft-ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── 첫 화면 */
.hero { padding: 28px 0 8px; }
.hero-grid { display: grid; gap: 36px; align-items: center; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--primary-soft-ink); margin-bottom: 12px; }
.hero h1 { font-size: 34px; line-height: 1.3; font-weight: 700; letter-spacing: -0.03em; }
.hero .lead { margin-top: 16px; font-size: 17px; line-height: 1.65; color: var(--ink2); max-width: 30em; }
.hero-cta { margin-top: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.hero-cta .btn { display: none; }

/* 예시 화면(대시보드 '오늘' 첫 문장 · 알약 · 숫자 상자) */
.demo { background: var(--surface); border-radius: 28px; padding: 20px 18px 18px; box-shadow: 0 0 0 1px var(--line); max-width: 440px; width: 100%; justify-self: center; }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: var(--ink2); }
.demo-tag { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--track); color: var(--ink2); }
.demo-hl { margin-top: 12px; display: flex; align-items: flex-end; gap: 8px; }
.demo-hl p { flex: 1; min-width: 0; font-size: 25px; line-height: 1.32; font-weight: 700; letter-spacing: -0.02em; }
.demo-hl .line { display: block; white-space: nowrap; }
.demo-chips { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.up { background: var(--up-bg); color: var(--up); }
.chip.base { background: var(--track); color: var(--ink2); font-weight: 500; }
.demo-tiles { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.demo-tiles div { background: var(--surface2); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.demo-tiles span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.demo-tiles b { font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-cap { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }

/* ── 칸 */
.sec { padding-top: 64px; }
.sec h2 { font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; }
.sec .sec-lead { margin-top: 8px; color: var(--ink2); }
.cards { margin-top: 24px; display: grid; gap: 12px; }
.card { background: var(--surface); border-radius: 20px; padding: 18px; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-items: start; }
.card .ic { grid-row: span 2; }
.card h3 { font-size: 17px; line-height: 1.45; font-weight: 700; }
.card p { font-size: 15px; line-height: 1.6; color: var(--ink2); }
.ic { width: 44px; height: 44px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-soft-ink); display: flex; align-items: center; justify-content: center; }

/* 자주 묻는 질문(펼치기) */
.faq { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.faq details { background: var(--surface); border-radius: 16px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 48px 18px 20px; font-size: 16px; font-weight: 600; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 22px; top: 50%; width: 9px; height: 9px; margin-top: -7px; border-right: 2px solid var(--chev); border-bottom: 2px solid var(--chev); transform: rotate(45deg); transition: transform 0.15s; }
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.faq details p { padding: 0 20px 18px; font-size: 15px; color: var(--ink2); }

/* 초대 코드 요청 */
.wait-card { background: var(--surface); border-radius: 28px; padding: 32px 20px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.wait-card h2 { margin-top: 12px; }
.wait-card .lead { margin-top: 6px; color: var(--ink2); }
.form { width: 100%; max-width: 440px; margin-top: 24px; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.field em { font-style: normal; font-weight: 400; color: var(--muted); }
.field input,
.field textarea {
  height: 52px; border-radius: 12px; border: 1.5px solid var(--field-line); background: var(--field); padding: 0 14px; font-size: 16px; font-weight: 400; color: var(--ink); width: 100%;
}
.field textarea { height: auto; min-height: 176px; padding: 12px 14px; font-family: inherit; line-height: 1.6; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: var(--chev); }
.field input:focus,
.field textarea:focus { outline: 2px solid var(--primary); outline-offset: 0; border-color: transparent; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; color: var(--ink); cursor: pointer; position: relative; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--chev); display: flex; align-items: center; justify-content: center; color: transparent; }
.check input:checked + .box { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.check input:focus-visible + .box { outline: 2px solid var(--primary); outline-offset: 2px; }
.consent { margin-top: -8px; font-size: 14px; color: var(--muted); }
.consent summary { cursor: pointer; width: max-content; text-decoration: underline; text-underline-offset: 3px; }
.consent ul { margin-top: 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface2); display: flex; flex-direction: column; gap: 4px; }
.msg { font-size: 14px; color: var(--ink2); }
.msg.bad { color: var(--down); }
.done { margin-top: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.done .done-t { font-size: 20px; font-weight: 700; }
.done p:last-of-type { color: var(--ink2); }
.done .text-link { margin-top: 10px; }

/* 문의하기 */
.contact { padding-top: 32px; }
.wait-card h1 { margin-top: 12px; font-size: 26px; line-height: 1.35; font-weight: 700; letter-spacing: -0.02em; }

/* 아래 긴 단추(폰) — 신청 칸이 보이면 숨긴다 */
.cta-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px calc(16px + var(--safe-b)); background: linear-gradient(to top, var(--bg) 70%, transparent); transition: transform 0.2s, opacity 0.2s; }
.cta-bar .btn { width: 100%; }
.cta-bar.off { transform: translateY(100%); opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .cta-bar { transition: none; } }

/* ── 글 페이지(도움말 · 방침 · 약관) */
.doc { padding-top: 20px; }
.doc h1 { font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: -0.02em; }
.doc .meta { margin-top: 8px; font-size: 14px; color: var(--muted); }
.doc .intro { margin-top: 16px; font-size: 16px; color: var(--ink2); }
.doc h2 { margin-top: 44px; font-size: 22px; line-height: 1.4; font-weight: 700; letter-spacing: -0.01em; scroll-margin-top: 16px; }
.doc h3 { margin-top: 24px; font-size: 17px; line-height: 1.45; font-weight: 700; }
.doc p, .doc li { font-size: 16px; line-height: 1.75; color: var(--ink2); }
.doc p { margin-top: 10px; }
.doc ul, .doc ol { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.doc ul > li { position: relative; padding-left: 16px; }
.doc ul > li::before { content: ''; position: absolute; left: 2px; top: 0.78em; width: 5px; height: 5px; border-radius: 3px; background: var(--chev); }
.doc ol { counter-reset: n; }
.doc ol > li { position: relative; padding-left: 30px; counter-increment: n; }
.doc ol > li::before { content: counter(n); position: absolute; left: 0; top: 0.2em; width: 22px; height: 22px; border-radius: 11px; background: var(--track); color: var(--ink); font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.doc strong, .doc b { color: var(--ink); font-weight: 600; }
.doc a { color: var(--primary-soft-ink); text-underline-offset: 3px; }
.doc .ui { color: var(--ink); font-weight: 600; white-space: nowrap; }
.doc .note { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); font-size: 15px; }
.toc { margin-top: 24px; padding: 18px 20px; border-radius: 18px; background: var(--surface); }
.toc p { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--muted); }
.toc ol { margin: 0; gap: 2px; }
.toc ol > li { padding-left: 28px; }
.toc ol > li::before { background: transparent; color: var(--muted); font-weight: 500; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { text-decoration: underline; }
/* 표 — 폰은 줄마다 카드(칸 이름 = data-label), 넓으면 표 */
.tbl { margin-top: 12px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.6; }
.tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tbl tr { display: block; background: var(--surface); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.tbl td { display: block; color: var(--ink2); padding: 3px 0; }
.tbl td::before { content: attr(data-label); display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.tbl td:first-child { color: var(--ink); font-weight: 700; font-size: 16px; padding-bottom: 6px; }
.tbl td:first-child::before { display: none; }
@media (min-width: 720px) {
  .tbl thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .tbl table { font-size: 14px; }
  .tbl tr { display: table-row; background: none; border-radius: 0; padding: 0; margin: 0; }
  .tbl th, .tbl td { display: table-cell; text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--ink2); font-size: 14px; font-weight: 400; }
  .tbl td::before { display: none; }
  .tbl th { color: var(--ink); font-weight: 600; background: var(--surface); }
  .tbl td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
  .tbl th:last-child, .tbl td:last-child { min-width: 8.5em; }
}
.doc .faq { margin-top: 14px; }

/* ── 오류 페이지(404 · 500) */
.oops { padding: 72px 0 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.oops h1 { margin-top: 8px; font-size: 26px; line-height: 1.35; font-weight: 700; }
.oops p { color: var(--ink2); }
.oops .rid { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.oops .acts { margin-top: 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 360px; }
.oops .acts .btn { width: 100%; }

/* ── 넓은 화면 */
@media (min-width: 720px) {
  .hero { padding: 56px 0 16px; }
  .hero h1 { font-size: 46px; }
  .hero .lead { font-size: 18px; }
  .hero-cta .btn { display: inline-flex; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
  .card .ic { margin-bottom: 4px; }
  .card h3 { font-size: 18px; }
  .cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sec { padding-top: 88px; }
  .sec h2 { font-size: 32px; }
  .wait-card { padding: 48px 40px 40px; }
  .contact { padding-top: 48px; }
  .wait-card h1 { font-size: 32px; }
  .doc { padding-top: 40px; }
  .doc h1 { font-size: 36px; }
  .cta-bar { display: none; }
  .page-landing .s-ftr { padding-bottom: calc(40px + var(--safe-b)); }
}
@media (min-width: 960px) {
  .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; }
  .hero h1 { font-size: 52px; }
  .demo { justify-self: end; }
}
@media (max-width: 380px) {
  .wrap { padding: 0 16px; }
  .hero h1 { font-size: 30px; }
  .demo { padding: 18px 14px 14px; }
  .demo-hl p { font-size: 22px; }
  .demo-tiles b { font-size: 16px; }
  .s-nav a { padding: 0 10px; }
}
