:root {
  --bg: #0a0e20;
  --bg-2: #0e1330;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.1);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f6fc;
  --muted: rgba(228, 234, 255, 0.7);
  --faint: rgba(228, 234, 255, 0.46);
  --accent: #ffd38a;
  --accent-ink: #1d1606;
  --healthy: #8fe3b0;
  --danger: #ff8f8f;
  --radius: 18px;
  --sans: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --serif: 'Gowun Batang', 'Nanum Myeongjo', serif;
  --hand: 'Gaegu', 'Nanum Pen Script', cursive;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, canvas { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: #000; padding: 8px 12px; }

/* ───────── 버튼 공통 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 16px; letter-spacing: -0.01em;
  transition: transform .15s ease, background .2s ease, box-shadow .2s ease, opacity .2s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 28px -10px var(--accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.secondary { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); color: var(--text); }
.btn.secondary:hover { background: rgba(255,255,255,.16); }
.btn.big { width: 100%; min-height: 56px; font-size: 17px; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.danger { background: #ff8f8f; color: #2a0b0b; }
.btn.danger:hover { filter: brightness(1.05); }
.link-btn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 10px; font-size: 15px; }
.link-btn:hover { color: var(--text); }
.ghost-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--text); backdrop-filter: blur(8px); }
.chip-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255,255,255,.06);
  color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; font-weight: 600;
}
.chip-btn svg { width: 15px; height: 15px; }
.chip-btn:hover { background: rgba(255,255,255,.12); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center { justify-content: center; }

/* ───────── 히어로 (풍경 캔버스 위에 내용) */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center;
  padding: 0 16px max(20px, env(safe-area-inset-bottom));
  overflow: hidden;
  isolation: isolate;
  /* 캔버스가 그려지기 전에 보이는 첫 화면 밤하늘 (scene.js 자정 색과 맞춤) */
  background: linear-gradient(#060a1c, #0c122d 40%, #141c3c 62%, #192345 74%, #111830 85%, #070b16);
}
#sky { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.topbar {
  width: 100%; max-width: 1100px; display: flex; justify-content: space-between; align-items: center;
  padding: max(14px, env(safe-area-inset-top)) 0 6px; min-height: 56px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; font-size: 17px; text-shadow: 0 1px 8px rgba(0,0,0,.3); }
.brand svg { width: 22px; height: 22px; }

.panel { width: 100%; max-width: 460px; margin: auto 0; padding: 12px 0 28px; animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.panel > .eyebrow, .panel > h1, .panel > h2, .panel > .lead, .guess-readout { text-shadow: 0 1px 14px rgba(5,8,25,.65); }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.intro h1, .guess h2 { margin: 0 0 12px; font-size: clamp(32px, 8.5vw, 46px); line-height: 1.18; letter-spacing: -0.035em; font-weight: 800; }
.guess h2 { font-size: clamp(28px, 7vw, 38px); }
.lead { margin: 0 0 22px; color: var(--muted); font-size: 16px; }
.br-wide { display: none; }
@media (min-width: 520px) { .br-wide { display: inline; } }


form {
  background: rgba(10, 14, 34, .55); border: 1px solid rgba(255,255,255,.12); border-radius: 22px;
  padding: 20px 18px 16px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px -30px rgba(0,0,0,.6);
}
.field { display: block; border: 0; padding: 0; margin: 0 0 16px; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; padding: 0; }
.field input[type=text], .field select, textarea, .input {
  width: 100%; min-height: 50px; border-radius: 14px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07); padding: 0 14px; font-size: 18px; outline: none; transition: border-color .2s, background .2s;
}
.field select { font-size: 16px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.field select option { background: #141a3a; color: #fff; }
.field input:focus, .field select:focus, textarea:focus, .input:focus { border-color: var(--accent); background: rgba(255,255,255,.1); }
#birth { letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.field-hint { display: block; margin-top: 6px; color: var(--faint); font-size: 13px; }
.field-hint.ok { color: var(--healthy); }
.field-hint.err { color: var(--danger); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: rgba(255,255,255,.06); border-radius: 14px; padding: 4px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 10px 4px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 14.5px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.form-error { min-height: 0; margin: 0 0 8px; color: var(--danger); font-size: 14px; }
.form-error:empty { display: none; }
.fine { margin: 10px 0 0; text-align: center; color: var(--faint); font-size: 12.5px; }
#btn-last { display: block; margin: 12px auto 0; }

/* 추측 */
.guess { text-align: center; }
.guess .lead { margin-bottom: 10px; }
.dial-wrap { position: relative; aspect-ratio: 1; border-radius: 50%; }
.dial-wrap canvas { width: 100%; height: 100%; }
.guess-dial { width: min(78vw, 46svh, 340px); margin: 6px auto 4px; touch-action: none; cursor: grab;
  background: rgba(8,12,30,.35); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.guess-dial:active { cursor: grabbing; }
.guess-readout { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 16px; font-variant-numeric: tabular-nums; }

/* 시계 영역 */
.clock-zone { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 620px; padding-top: 2px; animation: fade .6s ease both; }
.main-dial {
  width: min(56vw, 30svh, 290px);
  background: rgba(8,12,30,.22);
  backdrop-filter: blur(6px) saturate(1.2); -webkit-backdrop-filter: blur(6px) saturate(1.2);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 20px 60px -30px rgba(0,0,0,.5);
}
.time-block { text-align: center; margin-top: 10px; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.time-label { margin: 0; font-size: 15px; color: rgba(255,255,255,.86); font-weight: 600; min-height: 1.6em; }
.time-big { margin: 0; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; font-size: clamp(48px, 13vw, 76px); font-variant-numeric: tabular-nums; }
.time-big .ap { font-size: .42em; margin-right: .22em; letter-spacing: -0.02em; vertical-align: .55em; font-weight: 700; opacity: .9; }
.time-sub { margin: 6px 0 0; font-size: 13.5px; color: rgba(255,255,255,.78); min-height: 1.4em; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.chips:empty { display: none; }
.chip { font-size: 13px; padding: 5px 11px; border-radius: 999px; background: rgba(8,12,30,.45); border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(8px); text-shadow: none; }
.chip b { color: var(--accent); }
.chip.guess-chip b { color: #9ad0ff; }

.stage { flex: 1 1 auto; width: 100%; min-height: 110px; }
body[data-phase=intro] .stage, body[data-phase=guess] .stage { flex: 0 0 auto; min-height: 60px; }

.skip-anim { position: absolute; right: 16px; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 3; background: rgba(8,12,30,.45); border: 1px solid rgba(255,255,255,.2); color: #fff; border-radius: 999px; padding: 8px 16px; font-size: 14px; backdrop-filter: blur(6px); }

/* 결과 카드 (전경 언덕 위) */
.result-card { width: 100%; max-width: 620px; display: grid; gap: 10px; }
.result-card.pending { visibility: hidden; }
.result-card.reveal > * { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.result-card.reveal > *:nth-child(2) { animation-delay: .12s; }
.result-card.reveal > *:nth-child(3) { animation-delay: .24s; }
.result-card.reveal > *:nth-child(4) { animation-delay: .34s; }
.msg-card, .stat-card {
  background: rgba(8, 11, 28, .62); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius);
  padding: 16px 18px 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.msg-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.tag { font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); letter-spacing: .02em; }
.tag[data-type=cheer] { background: #ffb3a0; }
.tag[data-type=comfort] { background: #b9c8ff; }
.hour-name { font-size: 13px; color: var(--muted); }
.msg { margin: 0; font-family: var(--serif); font-size: 18px; line-height: 1.75; letter-spacing: -0.01em; min-height: 3.5em; }
.msg.swap { animation: msgswap .45s ease; }
@keyframes msgswap { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.msg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.msg-dots { display: inline-flex; gap: 6px; }
.msg-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.25); transition: background .3s, transform .3s; }
.msg-dots i.on { background: var(--accent); transform: scale(1.25); }
.stat-card { padding: 13px 18px; }
.stat-kicker { margin: 0 0 2px; font-size: 12px; font-weight: 800; color: var(--healthy); letter-spacing: .04em; }
.stat-text { margin: 0 0 8px; font-size: 14.5px; color: rgba(255,255,255,.9); line-height: 1.6; min-height: 3.2em; }
.stat-text b { color: var(--accent); font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.milestone { margin: 2px 0 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.milestone b { color: var(--text); }
.scroll-cue { margin-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 13px; text-decoration: none; animation: bob 2.4s ease-in-out infinite; }
.scroll-cue svg { width: 20px; height: 20px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }

@media (min-width: 760px) {
  .result-card { grid-template-columns: 1.35fr 1fr; max-width: 900px; align-items: stretch; }
  .msg-card { grid-row: span 2; display: flex; flex-direction: column; }
  .msg { flex: 1; font-size: 19.5px; }
  .actions, .milestone { grid-column: 1 / -1; }
  .actions { max-width: 520px; margin: 0 auto; width: 100%; }
}

/* ───────── 하위 내비 */
.subnav { position: sticky; top: 0; z-index: 20; background: rgba(10,14,32,.82); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.subnav-inner { display: flex; gap: 4px; overflow-x: auto; padding: 8px 12px; max-width: 1000px; margin: 0 auto; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a { flex: none; text-decoration: none; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; color: var(--muted); white-space: nowrap; }
.subnav a:hover, .subnav a.on { background: rgba(255,255,255,.1); color: var(--text); }

/* ───────── 섹션 */
main { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.sec { padding: 64px 16px; border-top: 1px solid rgba(255,255,255,.05); }
.sec-inner { max-width: 960px; margin: 0 auto; }
.sec-kicker { margin: 0 0 4px; color: var(--accent); font-size: 13.5px; font-weight: 800; letter-spacing: .03em; }
.sec h2 { margin: 0 0 10px; font-size: clamp(24px, 5.6vw, 34px); line-height: 1.3; letter-spacing: -0.03em; }
.sec-lead { margin: 0 0 22px; color: var(--muted); max-width: 680px; }
.footnote { margin: 16px 0 0; font-size: 12.5px; color: var(--faint); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }

/* 인생시계 보는 법 */
.scale-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .scale-grid { grid-template-columns: repeat(4, 1fr); } }
.scale-item { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.scale-item .k { margin: 0; font-size: 13px; color: var(--muted); }
.scale-item .v { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.scale-item .d { margin: 2px 0 0; font-size: 12.5px; color: var(--faint); }
.lifebar { margin: 26px 0 6px; }
.lifebar-track { position: relative; height: 18px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; display: flex; }
.lifebar-track span { display: block; height: 100%; }
.lifebar-track .past { background: var(--accent); }
.lifebar-track .healthy { background: repeating-linear-gradient(90deg, rgba(143,227,176,.55) 0 6px, rgba(143,227,176,.35) 6px 12px); }
.lifebar-track .later { background: rgba(255,255,255,.1); }
.lifebar-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 6px; font-variant-numeric: tabular-nums; }
.lifebar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.lifebar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.live-tick { margin: 18px 0 0; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px dashed rgba(255,255,255,.14); font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.live-tick b { color: var(--text); }
.crowd { margin-top: 18px; }
.crowd-bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; margin-top: 10px; }
.crowd-bars span { flex: 1; background: rgba(255,255,255,.16); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.crowd-bars span.me { background: var(--accent); }
.crowd-axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.crowd p { margin: 0; font-size: 14.5px; }
.crowd p b { color: var(--accent); }

/* 남은 것들 */
.remain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.remain { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 12px; position: relative; overflow: hidden; }
.remain .ico { font-size: 24px; line-height: 1; }
.remain .val { margin: 10px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.remain .val.long { font-size: 21px; }
.remain .val small { font-size: 14px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.remain .lbl { margin: 2px 0 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.remain .note { margin: 6px 0 0; font-size: 12px; color: var(--faint); line-height: 1.45; }
.remain.wide { grid-column: span 2; }
.remain.highlight { border-color: rgba(143,227,176,.4); background: rgba(143,227,176,.07); }
.interactive-grid { display: grid; gap: 10px; margin-top: 10px; }
@media (min-width: 760px) { .interactive-grid { grid-template-columns: 1.3fr 1fr; } }
.card h3 { margin: 0 0 6px; font-size: 18px; letter-spacing: -0.02em; }
.card p { margin: 0 0 10px; color: var(--muted); font-size: 14.5px; }
.inline-inputs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 12px; font-size: 15px; }
.inline-inputs .input { width: auto; min-height: 40px; font-size: 16px; padding: 0 10px; }
.inline-inputs input[type=number] { width: 84px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.pill { border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; color: var(--muted); }
.pill.on { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 700; }
.big-answer { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 2px; }
.big-answer small { font-size: 15px; color: var(--muted); font-weight: 600; }
.parents-bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; display: flex; margin: 10px 0 6px; }
.parents-bar span:first-child { background: rgba(255,255,255,.35); }
.parents-bar span:last-child { background: #ffb3a0; }
.range { width: 100%; accent-color: var(--accent); }

/* 주 단위 */
.weeks-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.weeks-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.weeks-wrap { position: relative; }
#weeks { width: 100%; touch-action: pan-y; }
.weeks-tip { position: absolute; pointer-events: none; transform: translate(-50%, -120%); background: #fff; color: #111; font-size: 12.5px; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; box-shadow: 0 6px 20px rgba(0,0,0,.3); }

/* 같은 시각의 사람들 */
.notes-nav { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.notes-nav .cur { min-width: 150px; text-align: center; }
.notes-nav .cur strong { display: block; font-size: 28px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.notes-nav .cur small { color: var(--muted); font-size: 12.5px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.06); display: grid; place-items: center; font-size: 18px; }
.round-btn:hover { background: rgba(255,255,255,.12); }
.notes-jump { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-bottom: 16px; }
.density { display: flex; gap: 2px; align-items: flex-end; height: 44px; margin: 0 0 4px; }
.density button { flex: 1; border: 0; padding: 0; background: rgba(255,255,255,.14); border-radius: 2px 2px 0 0; min-height: 3px; }
.density button.me { background: var(--accent); }
.density button.view { outline: 1px solid #fff; }
.density-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-bottom: 16px; }
.note-list { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.note-list .note { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.note-list .note p { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.65; white-space: pre-wrap; }
.note-list .note footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--faint); }
.note-list .report { background: none; border: 0; color: var(--faint); font-size: 12px; padding: 0; }
.note-list .report:hover { color: var(--danger); }
.note-list .note.mine { border-color: rgba(255,211,138,.4); }
.notes-empty { text-align: center; padding: 22px 12px; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; margin-bottom: 16px; }
.note-form { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.note-form label { display: block; font-weight: 700; font-size: 14.5px; margin-bottom: 8px; }
textarea { min-height: 96px; padding: 12px 14px; font-size: 16px; resize: vertical; line-height: 1.6; font-family: var(--serif); }
.note-form .row { justify-content: space-between; margin-top: 8px; }
.note-form .count { font-size: 12.5px; color: var(--faint); }
.offline { font-size: 13px; color: var(--faint); text-align: center; margin: 0 0 12px; }

/* 인생 계획표 */
.planner-layout { display: grid; gap: 18px; }
@media (min-width: 860px) { .planner-layout { grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); align-items: start; } }
.paper {
  background: #fbf6ea; color: #2b2a33; border-radius: 18px; padding: 16px 16px 12px; position: relative;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.6);
  background-image: radial-gradient(rgba(0,0,0,.035) 1px, transparent 1px); background-size: 14px 14px;
}
.paper-title { font-family: var(--hand); font-size: 26px; text-align: center; margin: 0 0 2px; line-height: 1.2; }
.paper-title input { font: inherit; color: inherit; border: 0; border-bottom: 2px dashed rgba(0,0,0,.2); background: transparent; width: 6.5em; text-align: center; padding: 0; }
.paper-sub { text-align: center; font-size: 13px; color: #6b6876; margin: 0 0 6px; }
#plan-canvas { width: 100%; aspect-ratio: 1; touch-action: none; cursor: crosshair; }
.plan-hint { text-align: center; font-size: 12.5px; color: #77737f; margin: 2px 0 0; }
.plan-side h3 { margin: 0 0 8px; font-size: 17px; }
.plan-form { display: grid; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.plan-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.plan-form label { font-size: 12.5px; color: var(--muted); display: grid; gap: 4px; }
.plan-form .input { min-height: 44px; font-size: 16px; }
.plan-form .conv { font-size: 13px; color: var(--accent); min-height: 1.4em; margin: 0; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatches button { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; }
.swatches button.on { border-color: #fff; transform: scale(1.1); }
.templates { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.plan-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.plan-list li { display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; font-size: 14px; }
.plan-list li i { width: 12px; height: 12px; border-radius: 3px; }
.plan-list li small { display: block; color: var(--faint); font-size: 12px; }
.plan-list li button { background: none; border: 0; color: var(--faint); font-size: 18px; padding: 2px 6px; }
.plan-list li button:hover { color: var(--danger); }
.plan-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* 미래의 나에게 */
.capsule-layout { display: grid; gap: 14px; }
@media (min-width: 820px) { .capsule-layout { grid-template-columns: 1fr 1fr; } }
.capsule-target { font-size: 15px; color: var(--muted); }
.capsule-target strong { display: block; font-size: 26px; color: var(--text); letter-spacing: -0.02em; }
.letters { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.letters li { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.letters li header { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.letters li p { margin: 6px 0 8px; font-family: var(--serif); white-space: pre-wrap; }
.letters li.sealed p { filter: blur(5px); user-select: none; }
.letters .row { gap: 6px; }

/* 비교 */
.compare-list { display: grid; gap: 8px; }
.cmp { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.cmp canvas { width: 56px; height: 56px; }
.cmp .name { font-weight: 700; font-size: 15px; }
.cmp .meta { font-size: 12.5px; color: var(--faint); }
.cmp .t { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -0.02em; }
.cmp .t small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.cmp.me { border-color: rgba(255,211,138,.5); background: rgba(255,211,138,.07); }
.cmp-note { margin-top: 14px; font-size: 14.5px; color: var(--muted); }

/* 오늘의 미션 */
.mission-card { background: linear-gradient(135deg, rgba(255,211,138,.14), rgba(185,200,255,.1)); border: 1px solid rgba(255,211,138,.3); border-radius: 20px; padding: 20px; }
.mission-card .sec-sub { color: var(--muted); margin: 0 0 6px; font-size: 14.5px; }
.mission-card .task { font-family: var(--serif); font-size: 21px; line-height: 1.6; margin: 0 0 14px; }
.streak { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 14px; font-size: 14px; color: var(--muted); }
.streak b { color: var(--text); font-size: 18px; }
.days { display: flex; gap: 5px; margin-top: 12px; }
.days span { width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.07); display: grid; place-items: center; font-size: 11px; color: var(--faint); }
.days span.done { background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.burst { animation: burst .6s ease; }
@keyframes burst { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }

/* 푸터 */
.site-footer { padding: 40px 16px 60px; color: var(--faint); font-size: 12.5px; border-top: 1px solid rgba(255,255,255,.05); background: var(--bg-2); }
.site-footer p { margin: 0 0 6px; }
.site-footer strong { color: var(--muted); }

/* ───────── 페이지 안 확인 창 (window.confirm 대신) */
.confirm-layer { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.confirm-body {
  position: relative; width: 100%; max-width: 360px; background: #121735; border: 1px solid var(--line);
  border-radius: 18px; padding: 20px 18px 16px; box-shadow: 0 24px 60px -20px rgba(0,0,0,.7); animation: up .25s cubic-bezier(.2,.8,.2,1);
}
.confirm-msg { margin: 0 0 16px; font-size: 15.5px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ───────── 시트 */
.sheet { position: fixed; inset: 0; z-index: 50; display: grid; align-items: end; justify-items: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2,4,14,.6); animation: fade .25s ease; }
.sheet-body {
  position: relative; width: 100%; max-width: 520px; max-height: 92svh; overflow: auto;
  background: #121735; border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 20px 18px max(20px, env(safe-area-inset-bottom));
  animation: up .35s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .sheet { align-items: center; } .sheet-body { border-radius: 22px; } }
.sheet h3 { margin: 0 0 6px; font-size: 19px; }
.sheet-lead { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.sheet-close { position: absolute; right: 12px; top: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); font-size: 22px; line-height: 1; }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; }
.share-opt { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.05); font-size: 13px; font-weight: 600; }
.share-opt:hover { background: rgba(255,255,255,.1); }
.share-opt .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; }
.share-opt .ic svg { width: 20px; height: 20px; }
.wall-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; align-items: end; }
.wall-opt { display: grid; justify-items: center; gap: 4px; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.wall-opt:hover { background: rgba(255,255,255,.1); border-color: var(--accent); }
.wall-opt small { color: var(--faint); font-size: 12px; }
.wall-thumb { display: block; border-radius: 10px; overflow: hidden; background: #1a2045; box-shadow: 0 10px 30px -12px rgba(0,0,0,.7); margin-bottom: 6px; }
.wall-thumb.mobile { width: 92px; aspect-ratio: 9 / 19.5; }
.wall-thumb.pc { width: 100%; aspect-ratio: 16 / 9; }
.wall-thumb img { width: 100%; height: 100%; object-fit: cover; }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 60;
  background: #fff; color: #111; padding: 10px 16px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; box-shadow: 0 10px 30px rgba(0,0,0,.35); max-width: calc(100vw - 32px); text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
