/* 안전기지 check-up page. Tokens from the 안전기지 design system (tokens.json). */
@font-face { font-family: Pretendard; font-weight: 400; font-display: swap; src: url("/fonts/Pretendard-Regular.subset.woff2") format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 500; font-display: swap; src: url("/fonts/Pretendard-Medium.subset.woff2") format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 600; font-display: swap; src: url("/fonts/Pretendard-SemiBold.subset.woff2") format("woff2"); }
@font-face { font-family: Pretendard; font-weight: 700; font-display: swap; src: url("/fonts/Pretendard-Bold.subset.woff2") format("woff2"); }

:root {
  --paper: #ffffff; --sunk: #f4f5f7; --ink: #191b1f; --ink2: #4e5560; --ink3: #6b7280;
  --line: #eceef1; --line2: #e2e5e9; --idle: #d9dde2; --control: #d5d9de;
  --primary: #191b1f; --on-primary: #ffffff;
  --ember: #f0a646; --ember-strong: #9a5b12; --ember-tint: #fff4df; --ember-band: #fbe2b8;
  --tide: #3a577c; --tide-tint: #eef3fa; --error: #af3d36; --scrim: rgba(25, 27, 31, 0.48);
  --scene: #f4f5f7; --bubble-them: #ffffff; --bubble-them-ink: #191b1f; --bubble-mine: #f0a646; --bubble-mine-ink: #191b1f;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121418; --sunk: #24282e; --ink: #f1f3f5; --ink2: #b0b6bf; --ink3: #8c939d;
    --line: #2a2e35; --line2: #343941; --idle: #3d434c; --control: #4a5059;
    --primary: #f1f3f5; --on-primary: #121418;
    --ember: #e7b369; --ember-strong: #e7b369; --ember-tint: #3a2a14; --ember-band: #5a4220;
    --tide: #9abae4; --tide-tint: #1e2836; --error: #f47b74; --scrim: rgba(0, 0, 0, 0.6);
    --scene: #1c1f24; --bubble-them: #3a3f47; --bubble-them-ink: #f1f3f5; --bubble-mine: #e7b369; --bubble-mine-ink: #121418;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font-family: Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif; word-break: keep-all; overflow-wrap: break-word; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--tide); outline-offset: 2px; }
[hidden] { display: none !important; }
.icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 16px; height: 16px; }

.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.screen { min-height: 100dvh; display: flex; flex-direction: column; animation: enter 220ms var(--ease); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.top { height: 56px; padding: 0 16px 0 8px; display: flex; align-items: center; gap: 8px; flex: none; }
.top.end { justify-content: flex-end; }
.wordmark { padding-left: 16px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.icon-btn { width: 48px; height: 48px; border: 0; background: none; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.body { flex: 1; padding: 20px 24px 24px; display: flex; flex-direction: column; }
.bottom { padding: 12px 24px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; flex: none; }
.bottom.sticky { position: sticky; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); margin-top: auto; }

.display { margin: 0; font-size: 28px; line-height: 38px; font-weight: 700; letter-spacing: -0.02em; white-space: pre-line; }
.title { margin: 20px 0 0; font-size: 24px; line-height: 34px; font-weight: 700; letter-spacing: -0.02em; white-space: pre-line; }
.lede { margin: 12px 0 0; font-size: 17px; line-height: 26px; color: var(--ink2); }
.lede.sm { font-size: 15px; line-height: 22px; margin-top: 8px; }
.trust { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; line-height: 18px; color: var(--ink3); text-align: center; }

.btn { height: 56px; border: 0; border-radius: 16px; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; transition: transform 120ms var(--ease), opacity 120ms; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:disabled { opacity: 0.32; cursor: default; transform: none; }
.btn.quiet { height: 48px; background: none; font-size: 16px; }
.btn.soft { height: 52px; background: var(--sunk); font-size: 15px; border-radius: 14px; }

/* Chat scene: the other person light, me solid amber; times only as centred dividers. */
.scene { background: var(--scene); border-radius: 20px; padding: 18px 16px 18px; display: flex; flex-direction: column; gap: 10px; margin: 4px 0 36px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.me { justify-content: flex-end; }
.bubble { max-width: 78%; padding: 10px 14px; font-size: 15px; line-height: 22px; }
.bubble.them { background: var(--bubble-them); color: var(--bubble-them-ink); border-radius: 4px 18px 18px 18px; }
.bubble.mine { background: var(--bubble-mine); color: var(--bubble-mine-ink); border-radius: 18px 4px 18px 18px; }
.bubble.coach { background: var(--tide-tint); border-radius: 4px 18px 18px 18px; max-width: none; }
.unread { color: var(--ember-strong); font-size: 13px; line-height: 16px; font-weight: 700; transition: opacity 500ms, transform 500ms var(--ease); }
.unread.gone { opacity: 0; transform: scale(0.4); }
.clock { display: inline-block; transition: opacity 260ms; font-variant-numeric: tabular-nums; }
.clock.flip { opacity: 0; }
/* The same message at two moments: 7:12 with its 1, 9:12 without. For still pictures. */
.moments { gap: 0; }
.moment { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 6px 0; }
.moment .when { margin-right: auto; font-size: 12px; line-height: 16px; color: var(--ink3); font-variant-numeric: tabular-nums; }
.moment + .moment { border-top: 1px dashed var(--line2); margin-top: 6px; padding-top: 12px; }
.divider { display: flex; align-items: center; gap: 10px; font-size: 12px; line-height: 16px; color: var(--ink3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line2); }
.scene .divider:first-child { margin-bottom: 4px; }
.scene .divider:last-child { margin-top: 8px; }
/* Options */
.opts { margin-top: 24px; display: flex; flex-direction: column; gap: 8px; }
.opt { min-height: 60px; padding: 16px 16px 16px 18px; border-radius: 16px; border: 2px solid var(--sunk); background: var(--sunk); display: flex; align-items: center; gap: 12px; text-align: left; font-size: 16px; line-height: 24px; font-weight: 500; transition: background 160ms, border-color 160ms; }
.opt > span { flex: 1; }
.opt .mark { flex: none; width: 22px; height: 22px; border-radius: 999px; border: 2px solid var(--control); position: relative; }
.opt[aria-checked="true"] { background: var(--ember-tint); border-color: var(--ember-strong); }
.opt[aria-checked="true"] .mark { border: 0; background: var(--ember-strong); }
.opt[aria-checked="true"] .mark::after { content: ""; position: absolute; left: 7px; top: 4px; width: 6px; height: 11px; border: solid var(--paper); border-width: 0 2.2px 2.2px 0; transform: rotate(45deg); }
@media (hover: hover) { .opt:hover { border-color: var(--control); } }

/* Question */
.segments { flex: 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.segments span { display: block; height: 4px; border-radius: 2px; background: var(--line2); transition: background 200ms; }
.segments span.seg-done { background: var(--ink); }
.segments span.seg-now { background: var(--ember); }
.count { width: 40px; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; }
.qhead { display: flex; align-items: center; justify-content: space-between; height: 36px; }
.tag { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink3); }
.coach-slot { display: block; }
#qvisual .scene { margin: 12px 0 0; padding: 16px; gap: 8px; }
#qvisual .divider { margin-top: 6px; }
.q { margin: 24px 0 0; font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.ask { margin: 6px 0 0; font-size: 15px; line-height: 22px; color: var(--ink2); }
.answers { margin-top: 20px; }
.foot { margin: 0; padding: 8px 24px calc(20px + env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--ink3); }
#qanim { will-change: transform, opacity; }
.opt.pressed { transform: scale(0.985); }
.opt { transition: background 160ms, border-color 160ms, transform 160ms var(--ease); }

/* Gathering */
.gather { margin-top: 40px; display: flex; flex-direction: column; gap: 32px; }
.grow-head { display: flex; align-items: baseline; justify-content: space-between; }
.grow-head b { font-size: 17px; line-height: 24px; font-weight: 600; }
.grow-head span { font-size: 15px; font-weight: 600; color: var(--ink2); }
.grow-head span.hi { color: var(--ember-strong); }
.cells, .cell-labels { margin-top: 12px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.cell-labels { margin-top: 8px; }
.cell { height: 56px; border-radius: 12px; background: var(--sunk); position: relative; overflow: hidden; }
.cell i { position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: var(--fill); transition: height 420ms var(--ease); }
.cell-labels span { font-size: 11px; line-height: 14px; color: var(--ink3); text-align: center; }

/* Report */
.report { animation: none; }
.rhead { padding: 8px 24px 36px; }
.over { display: block; font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ink3); margin-bottom: 10px; }
.band { height: 12px; background: var(--sunk); flex: none; }
.block { padding: 32px 24px 36px; }
.block h2 { margin: 0; font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; }
.block h2.sm { font-size: 17px; line-height: 24px; }
.block h2.gap { margin-top: 28px; }
.muted { font-size: 13px; font-weight: 500; color: var(--ink3); }
.desc { margin: 4px 0 0; font-size: 15px; line-height: 23px; color: var(--ink2); }
.note { margin: 18px 0 0; font-size: 13px; line-height: 19px; color: var(--ink3); }
.note.indent { margin: 14px 0 0 64px; }

.scales { margin-top: 28px; display: flex; flex-direction: column; gap: 28px; }
.scale-head { display: flex; align-items: baseline; justify-content: space-between; }
.scale-head b { font-size: 16px; line-height: 24px; font-weight: 600; }
.scale-head span { font-size: 15px; font-weight: 700; color: var(--ink2); }
.scale-head span.hi { color: var(--ember-strong); }
.track { margin-top: 14px; height: 18px; position: relative; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 10px; border-radius: 999px; background: var(--line); }
.track .range { position: absolute; top: 4px; height: 10px; border-radius: 999px; background: var(--band); }
.track .dot { position: absolute; top: 0; width: 18px; height: 18px; margin-left: -9px; border-radius: 999px; border: 3px solid var(--paper); box-shadow: 0 0 0 1px rgba(25, 27, 31, 0.08), 0 1px 3px rgba(25, 27, 31, 0.18); background: var(--fill); left: 50%; transition: left 700ms var(--ease); }
.ticks { margin-top: 8px; display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink3); }
.quadline { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }
.quadline p { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink2); }
.quadline b { color: var(--ink); white-space: nowrap; }
.quad { flex: none; width: 40px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; }
.quad span { height: 18px; border-radius: 5px; background: var(--line2); }
.quad span.on { background: var(--ember); }

.card { padding: 28px 0; border-bottom: 1px solid var(--line); }
.card:first-child { padding-top: 28px; }
.card:last-child { border-bottom: 0; padding-bottom: 0; }
.card .lab { display: flex; gap: 8px; font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink3); }
.card .lab em { font-style: normal; color: var(--ember-strong); font-variant-numeric: tabular-nums; }
.card h3 { margin: 8px 0 0; font-size: 20px; line-height: 28px; font-weight: 700; letter-spacing: -0.01em; white-space: pre-line; }
.card .cnote { margin: 6px 0 0; font-size: 14px; line-height: 20px; color: var(--ink2); }
.evid { margin-top: 16px; background: var(--sunk); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.evid .row.me .bubble { max-width: 86%; }
.evid { background: var(--scene); }
.evid p { margin: 0; font-size: 13px; line-height: 18px; color: var(--ink3); text-align: right; }
.rows { margin-top: 16px; background: var(--sunk); border-radius: 16px; padding: 6px 16px; }
.rows div { height: 44px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line2); font-size: 15px; }
.rows div:last-child { border-bottom: 0; }
.rows .lvl { display: flex; align-items: center; gap: 10px; }
.rows .dots { display: flex; gap: 4px; }
.rows .dots i { width: 8px; height: 8px; border-radius: 999px; background: var(--idle); }
.rows .dots i.on { background: var(--ember-strong); }
.rows .w { width: 44px; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink3); }
.rows .w.hi { color: var(--ember-strong); }
.fb { margin-top: 16px; display: flex; align-items: center; gap: 8px; }
.fb > span { flex: 1; font-size: 13px; color: var(--ink3); }
.fb button { height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--control); background: var(--paper); font-size: 14px; font-weight: 600; }
.fb button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.pr-tag { font-size: 13px; line-height: 18px; font-weight: 700; color: var(--ink3); }
#practice h2 { margin-top: 8px; white-space: pre-line; }
.steps { margin: 20px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 12px; font-size: 16px; line-height: 24px; counter-increment: s; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.memo { margin-top: 18px; border: 1px solid var(--line2); border-radius: 16px; }
.memo div { display: flex; align-items: center; min-height: 52px; padding: 0 16px; font-size: 15px; }
.memo div + div { border-top: 1px solid var(--line); color: var(--ink2); }
.memo b { width: 64px; flex: none; font-size: 13px; color: var(--ink3); }

.coachrow { display: flex; gap: 12px; align-items: flex-start; }
.coachrow > div { flex: 1; display: flex; flex-direction: column; gap: 6px; padding-top: 2px; }
.coachname { font-size: 14px; line-height: 20px; font-weight: 700; color: var(--tide); }

.safety { margin: 0 24px 28px; padding: 16px; border-radius: 16px; background: var(--tide-tint); font-size: 15px; line-height: 23px; }
.help { margin: 4px 0 0; padding: 0; list-style: none; }
.help a { height: 48px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.help li:last-child a { border-bottom: 0; }
.help b { width: 92px; font-size: 16px; font-variant-numeric: tabular-nums; }
.help span { flex: 1; font-size: 15px; color: var(--ink2); }

.rise { animation: rise 420ms var(--ease) backwards; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.letters .word { display: inline-block; white-space: nowrap; }
.letters .word span { display: inline-block; animation: letter 360ms var(--ease) backwards; }
@keyframes letter { from { opacity: 0; transform: translateY(6px); filter: blur(3px); } }

/* Form */
.field { margin-top: 28px; display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink2); }
.field input { height: 56px; border-radius: 16px; border: 1.5px solid var(--control); background: var(--paper); padding: 0 16px; font-size: 17px; }
.field input:focus { outline: none; border-color: var(--ink); }
.consents { margin-top: 20px; display: flex; flex-direction: column; }
.consent { padding: 10px 0; }
.consent label, label.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 22px; min-height: 28px; }
.consent b { font-weight: 600; }
.consent input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--ember-strong); }
.consent details { margin: 6px 0 0 34px; font-size: 13px; line-height: 19px; color: var(--ink3); }
.consent summary { cursor: pointer; text-decoration: underline; width: max-content; }
.consent details p { margin: 6px 0 0; }
.consent a { color: inherit; }
.human { margin-top: 12px; min-height: 0; }
.formerr { margin: 12px 0 0; font-size: 14px; color: var(--error); }

/* Done */
.done { align-items: center; justify-content: center; text-align: center; padding-bottom: 80px; }
.check { width: 72px; height: 72px; border-radius: 999px; background: var(--ink); display: flex; align-items: center; justify-content: center; }
.check path { fill: none; stroke: var(--paper); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw 420ms 160ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Share sheet */
.scrim { position: fixed; inset: 0; background: var(--scrim); display: flex; align-items: flex-end; justify-content: center; z-index: 10; animation: fade 200ms; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; overflow: auto; background: var(--paper); border-radius: 24px 24px 0 0; padding: 12px 24px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; animation: up 260ms var(--ease); }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
.grab { align-self: center; width: 36px; height: 4px; border-radius: 999px; background: var(--idle); }
.sheet h2 { margin: 20px 0 0; font-size: 20px; line-height: 28px; font-weight: 700; }
.cardimg { margin: 20px auto 24px; width: 216px; aspect-ratio: 4 / 5; border-radius: 14px; background: var(--ember-tint); box-shadow: 0 0 0 1px rgba(154, 91, 18, 0.12); }
.pair { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .btn.quiet { margin-top: 4px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-size: 15px; z-index: 20; animation: fade 200ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}
