/* 체인지 — 바비그라운드 톤앤매너: 따뜻한 종이 바탕, 에스프레소 글씨, 보도니·명조 제목, 거의 각진 타일 */
:root {
  --paper: #F8F5EF;
  --paper-2: #F1EBE2;
  --surface: #FDFBF7;
  --ink: #302219;
  --muted: #7A6A5D;
  --line: #D4C9BD;
  --line-soft: #E0D6CA;
  --latte: #E7DCD0;
  --s1: #E9DFD3;
  --s2: #665044;
  --s2-ink: #FFFAF2;
  --s3: #EEE5DA;
  --s4: #DED0C1;
  --s5: #B8A08A;
  --ok: #4E7A5C;
  --ok-soft: #E6EEE5;
  --ok-ink: #FFFFFF;
  --warn: #A2472A;
  --warn-soft: #F6E6DE;
  --kakao: #FEE500;
  --kakao-ink: #191600;
  --btn: #302219;
  --btn-ink: #F8F5EF;
  --serif: 'Bodoni Moda', 'Times New Roman', serif;
  --ko-serif: 'Noto Serif KR', 'Batang', serif;
  --sans: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', Arial, sans-serif;
  --r: 4px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #1C1612; --paper-2: #241C17; --surface: #2A211B; --ink: #F3EBE1; --muted: #B9A898;
    --line: #4A3C32; --line-soft: #3A2F27; --latte: #33281F; --s1: #31261E; --s2: #8C6F5D; --s2-ink: #FFFAF2;
    --s3: #2E241D; --s4: #3B2F26; --s5: #5A4636; --ok: #7FAE8C; --ok-soft: #22302A; --ok-ink: #10180F; --warn: #E08A6B; --warn-soft: #3A2620;
    --btn: #F3EBE1; --btn-ink: #1C1612; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #1C1612; --paper-2: #241C17; --surface: #2A211B; --ink: #F3EBE1; --muted: #B9A898;
  --line: #4A3C32; --line-soft: #3A2F27; --latte: #33281F; --s1: #31261E; --s2: #8C6F5D; --s2-ink: #FFFAF2;
  --s3: #2E241D; --s4: #3B2F26; --s5: #5A4636; --ok: #7FAE8C; --ok-soft: #22302A; --ok-ink: #10180F; --warn: #E08A6B; --warn-soft: #3A2620;
  --btn: #F3EBE1; --btn-ink: #1C1612; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--paper); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--s2); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.shell { max-width: 480px; min-height: 100vh; margin: 0 auto; background: var(--paper); display: flex; flex-direction: column; }
.pad { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }

/* 머리글 */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: left; min-height: 44px; }
.mark { position: relative; width: 42px; height: 34px; flex-shrink: 0; }
.mark i { position: absolute; top: 7px; width: 28px; height: 18px; border-radius: 2px; }
.mark i:first-child { left: 0; border: 1.5px solid var(--ink); transform: rotate(-10deg); }
.mark i:last-child { left: 11px; background: var(--s2); transform: rotate(6deg); }
.brand-name { font-family: var(--ko-serif); font-size: 19px; font-weight: 500; line-height: 1; display: block; }
.brand-sub { font-size: 9px; letter-spacing: 3px; color: var(--muted); display: block; margin-top: 4px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: none; border-radius: 999px; cursor: pointer; color: var(--ink); }
.link-btn { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; font-weight: 600; cursor: pointer; }

/* 버튼 */
.btn { min-height: 52px; border-radius: 999px; border: 1px solid var(--btn); background: var(--btn); color: var(--btn-ink); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 22px; cursor: pointer; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.kakao { background: var(--kakao); color: var(--kakao-ink); border-color: var(--kakao); font-weight: 700; }
.btn.box { border-radius: var(--r); min-height: 48px; background: var(--surface); color: var(--ink); border-color: var(--line); font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn.full { width: 100%; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.arrow { width: 44px; height: 44px; border-radius: 999px; border: 1px solid currentColor; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: transparent; cursor: pointer; color: inherit; text-decoration: none; }

/* 홈 */
.hero { padding-block: 36px 28px; display: flex; flex-direction: column; gap: 18px; }
.eyebrow { font-family: var(--serif); font-size: 14px; letter-spacing: 3px; color: var(--muted); }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.h-display { font-family: var(--ko-serif); font-weight: 500; font-size: 32px; line-height: 1.38; }
.lead { color: var(--muted); margin: 0; max-width: 34em; }
.hero-art { background: var(--latte); border-radius: 2px; height: 168px; position: relative; overflow: hidden; }
.hero-art .c1, .hero-art .c2 { position: absolute; width: 168px; height: 100px; border-radius: 3px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-art .c1 { left: 12%; top: 30px; background: var(--surface); border: 1px solid var(--line); transform: rotate(-8deg); }
.hero-art .c2 { left: 40%; top: 36px; background: var(--s2); color: var(--s2-ink); transform: rotate(5deg); box-shadow: 0 14px 28px rgba(48, 34, 25, .18); }
.mini-name { font-family: var(--ko-serif); font-size: 18px; }
.mini-sub { font-size: 10px; letter-spacing: 1px; opacity: .8; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tile { border-radius: 2px; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--s1); }
.tile.dark { background: var(--s2); color: var(--s2-ink); }
.tile.alt { background: var(--s4); }
.num { font-family: var(--serif); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.tile small { font-size: 12px; opacity: .85; line-height: 1.4; }
.section { padding-block: 28px 0; display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.sec-head .num { font-size: 22px; }
.sec-head h2 { font-size: 17px; font-weight: 600; }
.sec-head .aside { margin-left: auto; font-size: 12px; color: var(--muted); }
.ex-row { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 2px; background: var(--surface); cursor: pointer; text-align: left; width: 100%; }
.ex-row b { display: block; font-size: 15px; font-weight: 600; }
.ex-row span { display: block; font-size: 13px; color: var(--muted); }
.foot { padding-block: 40px 32px; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }

/* 단계 */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 20px; }
.step { background: var(--s1); color: var(--s2); border-radius: 2px; padding: 10px 12px; font-size: 12px; }
.step .num { font-size: 20px; display: block; margin-bottom: 4px; }
.step.on { background: var(--s2); color: var(--s2-ink); }
.step.done { background: var(--s4); color: var(--ink); }
.page-title { padding-top: 26px; display: flex; flex-direction: column; gap: 8px; }
.page-title h1 { font-family: var(--ko-serif); font-weight: 500; font-size: 26px; line-height: 1.45; }
.page-title p { margin: 0; color: var(--muted); font-size: 14px; }

/* 종류 고르기 */
.types { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; }
.type { display: flex; flex-direction: column; gap: 12px; padding: 20px 18px; border-radius: 2px; background: var(--s3); border: 1px solid transparent; cursor: pointer; text-align: left; width: 100%; color: var(--ink); }
.type.on { background: var(--s2); color: var(--s2-ink); }
.type[disabled] { cursor: not-allowed; opacity: .6; }
.type .head { display: flex; align-items: center; gap: 12px; }
.type .num { font-size: 34px; }
.type .t { font-size: 18px; font-weight: 600; display: block; }
.type .s { font-size: 13px; opacity: .8; display: block; }
.type .has { font-size: 13px; border-top: 1px solid currentColor; padding-top: 12px; opacity: .8; }
.badge-soon { margin-left: auto; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--paper); color: var(--muted); }

/* 폼 */
.form { display: flex; flex-direction: column; gap: 18px; padding-top: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.hint { font-size: 12px; color: var(--muted); }
.hint.ok { color: var(--ok); font-weight: 600; }
.hint.bad { color: var(--warn); font-weight: 600; }
.input, .select, .textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding: 0 14px; font-size: 16px; }
.textarea { padding: 12px 14px; resize: vertical; min-height: 84px; line-height: 1.5; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); padding-left: 14px; }
.prefix span { color: var(--muted); font-size: 15px; white-space: nowrap; }
.prefix .input { border: 0; padding-left: 2px; font-weight: 600; background: transparent; }
.group { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.group .line { display: flex; align-items: center; gap: 10px; padding: 4px 14px; border-bottom: 1px solid var(--line-soft); }
.group .line:last-child { border-bottom: 0; }
.group .line label { width: 78px; flex-shrink: 0; font-size: 14px; font-weight: 600; }
.group .line .input { border: 0; padding: 0; min-width: 0; background: transparent; font-size: 15px; }
.photo-row { display: flex; gap: 16px; align-items: center; }
.photo { width: 96px; height: 96px; border-radius: 38%; border: 1px dashed var(--line); background: var(--paper-2); color: var(--muted); font-size: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; flex-shrink: 0; overflow: hidden; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--s2); border-color: var(--s2); color: var(--s2-ink); }
.add-row { display: flex; gap: 8px; }
.add-row .input { min-height: 44px; }
.add-row .btn { min-height: 44px; border-radius: var(--r); padding: 0 16px; font-size: 14px; flex-shrink: 0; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 8px 12px 16px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); }
.item .t { font-size: 15px; font-weight: 600; }
.item .s { font-size: 12px; color: var(--muted); }
.sub-box { border: 1px dashed var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.file-btn { position: relative; min-height: 44px; border: 1px dashed var(--line); border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 12px; text-align: center; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.pr-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.note { padding: 14px 16px; border-radius: 2px; background: var(--ok-soft); font-size: 13px; line-height: 1.7; }
.radio { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--s2); }
.radio input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--s2); flex-shrink: 0; }
.radio b { display: block; font-size: 15px; font-weight: 600; }
.radio span span { display: block; font-size: 13px; color: var(--muted); }
.actions { margin-top: auto; padding-block: 32px 28px; display: flex; gap: 10px; }
.actions .btn:last-child { flex: 1; }
.err { font-size: 13px; color: var(--warn); font-weight: 600; }

/* 공유 */
.share { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); }
.qr { width: 132px; height: 132px; flex-shrink: 0; background: #FFFFFF; padding: 6px; border-radius: 2px; display: flex; align-items: center; justify-content: center; }
.qr img, .qr canvas { width: 120px !important; height: 120px !important; }
.qr-fallback { font-size: 11px; color: #7A6A5D; text-align: center; }
.url { font-family: var(--serif); font-size: 15px; word-break: keep-all; overflow-wrap: anywhere; }

/* 명함 */
.ex-flag { margin-top: 16px; font-size: 12px; font-weight: 600; color: var(--warn); background: var(--warn-soft); padding: 6px 12px; border-radius: 2px; }
.card-hero { margin-top: 16px; background: var(--latte); border-radius: 2px; padding: 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.card-hero.member { background: var(--s3); }
.who { display: flex; gap: 16px; align-items: flex-end; }
.avatar { width: 104px; height: 132px; border-radius: 2px; background: var(--paper-2); border: 1px solid var(--line); flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-family: var(--ko-serif); font-size: 40px; color: var(--muted); }
.avatar.round { width: 92px; height: 92px; border-radius: 999px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.who-meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.who-meta .r { font-size: 12px; color: var(--s2); letter-spacing: .5px; }
.who-meta .n { font-family: var(--ko-serif); font-size: 30px; font-weight: 500; line-height: 1.15; word-break: keep-all; }
.bio { font-family: var(--ko-serif); font-size: 17px; line-height: 1.65; margin: 0; white-space: pre-line; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface); }
.pill.ok { background: var(--ok); color: var(--ok-ink); }
.tag { font-size: 14px; background: var(--surface); border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; }
.list-row { padding: 12px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row .t { font-size: 15px; font-weight: 600; }
.list-row .s { font-size: 12px; color: var(--muted); }
.st { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; flex-shrink: 0; }
.st.ok { color: var(--ok); background: var(--ok-soft); }
.st.wait { color: var(--s2); background: var(--s3); }
.st.need { color: var(--warn); background: var(--warn-soft); }
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline > div { display: flex; gap: 14px; }
.timeline .p { font-size: 12px; color: var(--muted); width: 88px; flex-shrink: 0; }
.goal { background: var(--s2); color: var(--s2-ink); border-radius: 2px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 250, 242, .3); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--s2-ink); }
.empty { padding: 24px 16px; text-align: center; border: 1px dashed var(--line); border-radius: 2px; color: var(--muted); font-size: 14px; }
.confirm { display: flex; gap: 8px; align-items: center; font-size: 13px; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--btn); color: var(--btn-ink); padding: 12px 18px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: calc(100% - 32px); text-align: center; }

/* ---------- 2차 구성: 리포트·대시보드·매칭 ---------- */
.top-nav { display: flex; gap: 6px; }
.title-line { font-size: 13px; font-weight: 600; color: var(--s2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dday { font-family: var(--serif); font-size: 13px; font-weight: 500; background: var(--btn); color: var(--btn-ink); padding: 2px 10px; border-radius: 999px; letter-spacing: .5px; }
.report { border: 1px solid var(--line); border-radius: 2px; background: var(--surface); display: flex; flex-direction: column; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.report-head b { font-size: 14px; font-weight: 600; }
.report-head span { font-size: 11px; color: var(--muted); }
.report-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.big-stat { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.big-stat .num { font-size: 52px; }
.big-stat .unit { font-family: var(--serif); font-size: 18px; }
.grade { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.grade b { font-family: var(--ko-serif); font-size: 20px; font-weight: 500; }
.grade span { font-size: 11px; color: var(--muted); }
.lift { display: grid; grid-template-columns: 76px minmax(0, 1fr) 78px; align-items: center; gap: 10px; font-size: 13px; }
.lift .track { height: 8px; background: var(--s1); border-radius: 1px; overflow: hidden; }
.lift .track i { display: block; height: 100%; background: var(--s2); }
.lift .v { text-align: right; font-variant-numeric: tabular-nums; }
.lift .v small { display: block; color: var(--muted); font-size: 11px; }
.kv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); }
.kv > div { background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv small { font-size: 11px; color: var(--muted); }
.kv b { font-family: var(--serif); font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kv b em { font-style: normal; font-family: var(--sans); font-size: 11px; color: var(--muted); margin-left: 2px; }
.caption { font-size: 11px; color: var(--muted); line-height: 1.6; }
.trend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trend > div { border: 1px solid var(--line-soft); background: var(--surface); padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.trend small { font-size: 11px; color: var(--muted); }
.trend b { font-family: var(--serif); font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.trend .delta { font-size: 11px; font-weight: 600; }
.spark { width: 100%; height: 40px; color: var(--s2); display: block; }
.switch-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); }
.switch-row b { display: block; font-size: 15px; font-weight: 600; }
.switch-row span span { display: block; font-size: 13px; color: var(--muted); }
.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--s4); transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 999px; background: var(--surface); transition: transform .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--s2); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--s2); outline-offset: 2px; }
.person { border: 1px solid var(--line-soft); background: var(--surface); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.person .top-row { display: flex; gap: 12px; align-items: center; }
.person .av { width: 44px; height: 44px; border-radius: 999px; background: var(--latte); display: flex; align-items: center; justify-content: center; font-family: var(--ko-serif); font-size: 18px; flex-shrink: 0; overflow: hidden; }
.person .av img { width: 100%; height: 100%; object-fit: cover; }
.score { margin-left: auto; text-align: right; flex-shrink: 0; }
.score b { font-family: var(--serif); font-size: 22px; font-weight: 500; display: block; line-height: 1; }
.score span { font-size: 11px; color: var(--muted); }
.reason { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--s3); color: var(--s2); }
.offer { border: 1px solid var(--line); border-radius: 2px; background: var(--surface); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.offer .kind { font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.offer h3 { font-family: var(--ko-serif); font-size: 18px; font-weight: 500; line-height: 1.45; }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 8px; border-radius: 1px; background: var(--s1); }
.meter i.on { background: var(--s2); }
.pillar { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px; border-radius: 2px; background: var(--s1); }
.pillar.dark { background: var(--s2); color: var(--s2-ink); }
.pillar.alt { background: var(--s4); }
.pillar h3 { font-family: var(--ko-serif); font-size: 20px; font-weight: 500; line-height: 1.4; }
.pillar p { margin: 0; font-size: 14px; opacity: .85; }
.pillar .chips .chip { min-height: 32px; font-size: 13px; cursor: default; }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(28, 22, 18, .72); display: flex; align-items: center; justify-content: center; padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.modal-box { background: var(--paper); border-radius: 4px; padding: 16px; max-width: 420px; width: 100%; max-height: 100%; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.modal-box img { width: 100%; height: auto; border: 1px solid var(--line); }
.history { display: flex; flex-direction: column; }
.history .h-row { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.history .h-row:last-child { border-bottom: 0; }
.history .d { font-family: var(--serif); width: 88px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.history .vals { flex: 1; min-width: 0; color: var(--muted); }
.history .vals b { color: var(--ink); font-weight: 600; }

/* ---------- 소개 페이지 ---------- */
.top-nav .link-btn { padding: 0 12px; }
.about-hero { padding-block: 36px 8px; display: flex; flex-direction: column; gap: 18px; }
.about-hero .h-display { font-size: 30px; }
.compare { border: 1px solid var(--line); background: var(--surface); border-radius: 2px; overflow-x: auto; }
.compare table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 340px; }
.compare th, .compare td { padding: 12px 8px; text-align: center; border-bottom: 1px solid var(--line-soft); }
.compare th:first-child, .compare td:first-child { text-align: left; padding-left: 14px; }
.compare thead th { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--paper-2); }
.compare tr:last-child td { border-bottom: 0; }
.compare tr.us td { background: var(--s2); color: var(--s2-ink); font-weight: 600; }
.compare .y { font-family: var(--serif); font-size: 18px; }
.compare .n { color: var(--muted); opacity: .6; }
.compare tr.us .n { color: var(--s2-ink); }
.who-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.who-grid .tile { padding: 16px 12px; }
.who-grid b { font-family: var(--ko-serif); font-weight: 500; font-size: 17px; }
.who-grid small { font-size: 12px; line-height: 1.55; }
@media (max-width: 440px) { .who-grid { grid-template-columns: minmax(0, 1fr); } }
.diff { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-soft); }
.diff:last-child { border-bottom: 0; }
.diff .num { font-size: 26px; width: 34px; flex-shrink: 0; }
.diff b { display: block; font-family: var(--ko-serif); font-weight: 500; font-size: 18px; line-height: 1.45; margin-bottom: 4px; }
.diff p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.7; }
.lvl { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 14px 16px; border-radius: 2px; background: var(--s1); }
.lvl.dark { background: var(--s2); color: var(--s2-ink); }
.lvl.alt { background: var(--s4); }
.lvl .num { font-size: 13px; letter-spacing: 1.5px; }
.lvl b { display: block; font-size: 15px; font-weight: 600; }
.lvl span { font-size: 13px; opacity: .85; }
.maker { background: var(--latte); border-radius: 2px; padding: 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.maker q { font-family: var(--ko-serif); font-size: 18px; line-height: 1.65; quotes: none; }

/* ---------- 단계 (입문 → 최상급) ---------- */
.lv0 { background: var(--s1); color: var(--ink); }
.lv1 { background: var(--s4); color: var(--ink); }
.lv2 { background: var(--s5); color: var(--ink); }
.lv3 { background: var(--s2); color: var(--s2-ink); }
.lv4 { background: var(--ink); color: var(--paper); }
.lvbox { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 12px 14px; border: 0; border-radius: 2px; text-align: left; cursor: pointer; font-family: inherit; min-height: 64px; }
.lvbox .lv-name { font-family: var(--ko-serif); font-weight: 500; font-size: 22px; line-height: 1; white-space: nowrap; }
.lvbox .lv-meta b { display: block; font-size: 14px; font-weight: 600; }
.lvbox .lv-meta span { display: block; font-size: 12px; opacity: .85; }
.lvbox .lv-tag { font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; }
.lvbox .lv-tag.ok { background: var(--ok); color: var(--ok-ink); }
.ladder { display: flex; flex-direction: column; gap: 6px; }
.rung { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 2px; font-size: 13px; }
.rung b { font-family: var(--ko-serif); font-weight: 500; font-size: 17px; }
.rung span { opacity: .85; }
.rung .r { font-family: var(--serif); font-size: 15px; text-align: right; opacity: 1; font-variant-numeric: tabular-nums; }
.lvnote { font-size: 13px; line-height: 1.7; color: var(--muted); }
.lvnote b { color: var(--ink); font-weight: 600; }
.chip[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- 홈: 내 명함이 주인공 ---------- */
.home { display: flex; flex-direction: column; gap: 22px; padding-block: 22px 28px; }
.home-hero { display: flex; flex-direction: column; gap: 16px; }
.home-hero .h-display { font-size: 30px; }
.home-hero .lead { margin-top: -6px; }
.hello { margin: 0; font-size: 14px; color: var(--muted); }
.cf-link { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.q { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.home-rows { display: flex; flex-direction: column; gap: 8px; }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--ink); }
.row-link > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.row-link small { font-size: 12px; color: var(--muted); }
.row-link b { font-size: 15px; font-weight: 600; }
.row-link .arrow { width: 36px; height: 36px; }
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.three div { background: var(--s1); border-radius: 2px; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.three b { font-family: var(--ko-serif); font-weight: 500; font-size: 17px; }
.three span { font-size: 12px; color: var(--muted); }
.home-sub { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.text-btn { border: 0; background: none; padding: 8px 2px; min-height: 36px; font: inherit; color: var(--s2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- 하단 탭 ---------- */
.shell.has-tabs { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; background: var(--paper); border-top: 1px solid var(--line-soft); padding-bottom: env(safe-area-inset-bottom, 0px); }
.tabs { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tab { min-height: 60px; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font: inherit; font-size: 11px; color: var(--muted); cursor: pointer; }
.tab[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tab[aria-current="page"] svg { stroke-width: 2.2; }
.toast { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

/* 카카오톡 공유 시트 */
.modal-box.sheet { gap: 12px; }
.sheet-eyebrow { margin: 0; font-size: 13px; font-weight: 700; color: var(--ok); }
.sheet-title { font-family: var(--serif, 'Noto Serif KR', serif); font-weight: 500; font-size: 22px; }
.kbubble { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.06); border: 1px solid #E5E1DA; max-width: 270px; }
.kchat { background: #B2C7D9; border-radius: 4px; padding: 14px 14px 14px 16px; }
.kb-img { aspect-ratio: 2 / 1; background: var(--latte); }
.kb-img img { display: block; width: 100%; height: 100%; object-fit: cover; border: 0 !important; }
.kb-body { padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 3px; color: #1E1E1E; }
.kb-body b { font-size: 14px; font-weight: 700; }
.kb-body span { font-size: 12px; color: #6B6B6B; line-height: 1.45; }
.kb-btn { margin: 4px 10px 10px; background: #F3F3F3; border-radius: 4px; text-align: center; font-size: 13px; padding: 8px; color: #1E1E1E; }

/* 주간 운동 도장 */
.stamp { border: 1px solid var(--line-soft); background: var(--surface); border-radius: var(--r); padding: 18px 16px 14px; display: flex; flex-direction: column; gap: 12px; }
.stamp-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.stamp-head b { font-family: var(--ko-serif); font-weight: 500; font-size: 19px; }
.stamp-head .num { font-family: var(--serif); font-size: 16px; color: var(--muted); }
.stamp-head .num em { font-style: normal; font-size: 28px; color: var(--ink); }
.stamp-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.sd i { display: flex; align-items: center; justify-content: center; width: 100%; max-width: 40px; aspect-ratio: 1; margin: 0 auto; border-radius: 50%; border: 1.5px dashed var(--line); color: var(--s2-ink); }
.sd.future i { border-color: var(--line-soft); }
.sd.today i { border: 1.5px solid var(--ink); }
.sd.on i { background: var(--s2); border: 1.5px solid var(--s2); transform: rotate(-8deg); box-shadow: inset 0 0 0 2.5px var(--s2), inset 0 0 0 3.5px rgba(255, 250, 242, .45); }
.sd small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); }
.sd.today small { color: var(--ink); font-weight: 700; }
.stamp-msg { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.stamp .btn svg { margin-right: 6px; }
.stamp-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.wk { display: inline-flex; align-items: center; gap: 3px; }
.wk i { width: 9px; height: 9px; border-radius: 2px; background: var(--s1); }
.wk i.part { background: var(--s4); }
.wk i.ok { background: var(--s2); }
.wk span { margin-left: 6px; }
.goal-seg { display: inline-flex; align-items: center; gap: 4px; }
.goal-seg button { min-width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.goal-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }

/* 업적 배지 */
.seal { flex-shrink: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--s2); color: var(--s2-ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 18px; letter-spacing: -.02em; box-shadow: inset 0 0 0 3px var(--s2), inset 0 0 0 4.5px rgba(255, 250, 242, .5); transform: rotate(-6deg); }
.seal.lock { background: transparent; color: var(--muted); box-shadow: none; border: 1.5px dashed var(--line); transform: none; }
.seal.xs { width: 30px; height: 30px; font-size: 10px; box-shadow: inset 0 0 0 2px var(--s2), inset 0 0 0 3px rgba(255, 250, 242, .5); }
.seal-stack { display: inline-flex; }
.seal-stack .seal + .seal { margin-left: -8px; }
.badge-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bd { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center; padding: 12px 4px 10px; border: 1px solid transparent; border-radius: var(--r); background: none; font: inherit; color: var(--ink); }
button.bd { cursor: pointer; }
.bd b { font-size: 13px; font-weight: 600; line-height: 1.35; }
.bd small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.bd.lock b { color: var(--muted); font-weight: 500; }
.bd[aria-pressed="true"] { background: var(--s3); border-color: var(--line-soft); }
.bd .pin { position: absolute; top: 6px; right: 6px; font-size: 10px; font-weight: 700; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 1px 6px; }
.bd .mini { width: 64%; height: 4px; background: var(--s1); border-radius: 2px; overflow: hidden; }
.bd .mini i { display: block; height: 100%; background: var(--s5); }
.cf-preview { padding: 4px 0 8px; }

/* 지난달의 나 */
.month-hero { margin-top: 8px; background: var(--s2); color: var(--s2-ink); border-radius: var(--r); padding: 22px 20px; display: flex; flex-direction: column; gap: 6px; }
.month-hero > small { font-size: 13px; opacity: .8; }
.month-hero > b { font-family: var(--ko-serif); font-weight: 500; font-size: 26px; line-height: 1.35; }
.month-hero .kv2 { display: flex; gap: 22px; margin-top: 10px; font-size: 12px; opacity: .95; }
.month-hero .kv2 b { display: block; font-family: var(--serif); font-weight: 400; font-size: 30px; line-height: 1.1; }
.month-hero .kv2 em { font-style: normal; font-family: var(--sans); font-size: 13px; margin-left: 2px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); align-items: center; }
.cmp-row .l { font-size: 14px; font-weight: 600; }
.cmp-row .v { grid-column: 1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cmp-row .v b { color: var(--ink); font-weight: 600; }
.cmp-row .d { grid-column: 2; grid-row: 1 / span 2; font-size: 15px; font-weight: 600; text-align: right; color: var(--muted); }
.cmp-row .d.up { color: var(--ok); }

/* 명함 뒤집기 */
.flip { perspective: 1400px; touch-action: pan-y; -webkit-user-select: none; user-select: none; --rest: 0deg; --flip: 180deg; }
.flip-inner { display: grid; transform-style: preserve-3d; transform: rotateY(var(--rest)); transition: transform .7s cubic-bezier(.2, .8, .2, 1); }
.flip.is-flipped .flip-inner { transform: rotateY(var(--flip)); }
.flip.dragging .flip-inner { transition: none; }
.flip-face { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; display: flex; }
.flip-face > * { flex: 1; }
.flip-back { transform: rotateY(180deg); cursor: pointer; }
.flip-front .cf-link { display: flex; }
.flip-front .cf-link > .cface { flex: 1; }
.flip-hint { align-self: center; display: inline-flex; align-items: center; gap: 6px; margin-top: -4px; padding: 8px 12px; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .flip-inner { transition: none; } }

.link-btn.kakao-link { background: var(--kakao); color: var(--kakao-ink); border-color: var(--kakao); font-weight: 700; }

/* ---------- 실제 명함 (90×50mm 비율) ---------- */
.cface { position: relative; container-type: inline-size; aspect-ratio: 1.75 / 1; width: 100%; border-radius: 10px; background: var(--latte); color: var(--ink); overflow: hidden; box-shadow: 0 18px 36px rgba(48, 34, 25, .16), 0 2px 4px rgba(48, 34, 25, .08), 0 1px 0 rgba(255, 255, 255, .4) inset; }
.cface::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 45%); pointer-events: none; }
.cface.coach { background: var(--s2); color: var(--s2-ink); }
.cface.sample { transform: rotate(-1.5deg); margin: 6px 4px; width: calc(100% - 8px); }
.cf-in { position: absolute; inset: 0; padding: 5.5cqw 6cqw 4.4cqw; display: flex; flex-direction: column; }
.cf-head { display: flex; align-items: flex-start; gap: 4cqw; }
.cf-photo { width: 17.5cqw; height: 17.5cqw; flex-shrink: 0; border-radius: 38%; overflow: hidden; background: var(--paper-2); display: flex; align-items: center; justify-content: center; font-family: var(--ko-serif); font-size: 8cqw; color: var(--muted); box-shadow: 0 0 0 .6cqw rgba(255, 250, 242, .8); }
.cface.coach .cf-photo { background: rgba(255, 250, 242, .14); color: var(--s2-ink); box-shadow: 0 0 0 .6cqw rgba(255, 250, 242, .35); }
.cf-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.cf-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1cqw; padding-top: 1.6cqw; }
.cf-name b { font-family: var(--ko-serif); font-weight: 500; font-size: 7.4cqw; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-name small { font-size: 3.5cqw; opacity: .78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2.2cqw; flex-shrink: 0; }
.cf-brand { display: flex; align-items: center; gap: 1.6cqw; font-family: var(--ko-serif); font-size: 3.6cqw; white-space: nowrap; }
.cf-brand .mark { width: 8cqw; height: 6cqw; }
.cf-brand .mark i { top: 1.2cqw; width: 5.2cqw; height: 3.3cqw; border-width: .35cqw; }
.cf-brand .mark i:last-child { left: 2.2cqw; }
.cface.coach .cf-brand .mark i:first-child { border-color: var(--s2-ink); }
.cface.coach .cf-brand .mark i:last-child { background: var(--s4); }
.cf-lv { font-size: 3.2cqw; font-weight: 600; padding: 1.1cqw 2.6cqw; border-radius: 999px; white-space: nowrap; }
.cf-lv.ok { background: var(--ok); color: var(--ok-ink); }
.cf-bottom { margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 3cqw; padding-top: 2.6cqw; border-top: 1px solid rgba(48, 34, 25, .15); }
.cface.coach .cf-bottom { border-top-color: rgba(255, 250, 242, .25); }
.cf-rec { display: flex; flex-direction: column; gap: .6cqw; min-width: 0; }
.cf-rec small { font-size: 3.2cqw; opacity: .75; }
.cf-rec b { font-family: var(--serif); font-weight: 400; font-size: 10cqw; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-rec b em { font-style: normal; font-family: var(--sans); font-size: 4.2cqw; margin-left: 1cqw; }
.cf-rec span { font-size: 3.4cqw; opacity: .8; padding-bottom: 1cqw; }
.cf-seals { display: flex; gap: 1.2cqw; flex-shrink: 0; }
.cf-seals i { font-style: normal; width: 8.6cqw; height: 8.6cqw; border-radius: 50%; background: var(--s2); color: var(--s2-ink); display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2.9cqw; letter-spacing: -.03em; box-shadow: inset 0 0 0 .6cqw var(--s2), inset 0 0 0 .9cqw rgba(255, 250, 242, .5); transform: rotate(-6deg); }
.cf-tags { font-size: 3.2cqw; opacity: .8; text-align: right; padding-bottom: 1cqw; }
.cf-foot { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; margin-top: 2.4cqw; font-family: var(--serif); font-size: 3.2cqw; }
.cf-foot > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .8; }
.cf-dd { background: var(--ink); color: var(--paper); padding: .5cqw 2.4cqw; border-radius: 999px; white-space: nowrap; }
.cface.coach .cf-dd { background: var(--s2-ink); color: var(--s2); }
.cf-sample { font-family: var(--sans); font-size: 3cqw; font-weight: 600; padding: .4cqw 2.2cqw; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }

/* 뒷면 */
.cback { background: var(--s2); color: var(--s2-ink); }
.cback.coach { background: var(--latte); color: var(--ink); }
.cback .cf-brand .mark i:first-child { border-color: currentColor; }
.cback .cf-brand .mark i:last-child { background: #DED0C1; }
.cback.coach .cf-brand .mark i:last-child { background: var(--s2); }
.cb-top { display: flex; justify-content: space-between; align-items: center; gap: 3cqw; }
.cb-who { font-size: 3.4cqw; font-weight: 600; opacity: .9; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4cqw; align-items: start; margin-top: 2.4cqw; padding-top: 2.4cqw; border-top: 1px solid rgba(255, 250, 242, .22); }
.cback.coach .cb-body { border-top-color: rgba(48, 34, 25, .14); }
.cb-label { display: block; font-size: 3cqw; opacity: .72; margin-bottom: 1cqw; }
.cb-recs { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.4cqw 3cqw; }
.cb-recs dt { font-size: 3cqw; opacity: .8; }
.cb-recs dd { margin: .2cqw 0 0; font-family: var(--serif); font-size: 5.4cqw; line-height: 1.05; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cb-recs dd em { font-style: normal; font-family: var(--sans); font-size: 3cqw; margin-left: .6cqw; }
.cb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1.6cqw; font-size: 3.4cqw; font-weight: 600; line-height: 1.35; }
.cb-list .ok { color: var(--ok); margin-right: 1.4cqw; }
.cb-empty { margin: 0; font-size: 3.4cqw; opacity: .8; line-height: 1.5; }
.cb-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 1.2cqw; }
.cb-qr { width: 20cqw; height: 20cqw; padding: 1.4cqw; background: #FFFFFF; border-radius: 1.2cqw; }
.cb-qr img, .cb-qr canvas { display: block; width: 100% !important; height: 100% !important; }
.cb-qr-wrap small { font-size: 2.5cqw; opacity: .75; white-space: nowrap; }
.cb-meta { font-family: var(--sans); font-size: 3cqw; opacity: .8; white-space: nowrap; }

/* 공유 모양 고르기 · 글자 명함 말풍선 (리멤버 방식) */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--s1); }
.seg button { min-height: 40px; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(48, 34, 25, .15); }
.kbubble.ktext { max-width: 290px; padding: 14px 14px 10px; border-radius: 14px; }
.ktext p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.55; color: #1E1E1E; word-break: break-all; }
.ktext u { color: #3B73C9; text-underline-offset: 2px; }
.ktext .kb-btn { margin: 0 0 10px; padding: 11px; border-radius: 8px; font-size: 13px; }
.ktext .kb-foot { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #6B6B6B; }
.ktext .kb-foot .mark { width: 22px; height: 18px; }
.ktext .kb-foot .mark i { top: 4px; width: 14px; height: 9px; }
.ktext .kb-foot .mark i:first-child { border-color: #302219; }
.ktext .kb-foot .mark i:last-child { left: 6px; background: #665044; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(48, 34, 25, .35); } 50% { box-shadow: 0 0 0 8px rgba(48, 34, 25, 0); } }
.btn.pulse { animation: pulse 1.6s ease-in-out 3; }

/* ---------- 움직임 ---------- */
:root { --ease-out: cubic-bezier(.2, .8, .2, 1); --ease-spring: cubic-bezier(.34, 1.56, .64, 1); }
/* 화면 전환: 앞으로 가면 오른쪽에서, 뒤로 가면 왼쪽에서 */
@keyframes enterFwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes enterBack { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
@keyframes enterFade { from { opacity: 0; } to { opacity: 1; } }
main.enter-fwd { animation: enterFwd .38s var(--ease-out) both; }
main.enter-back { animation: enterBack .38s var(--ease-out) both; }
main.enter-fade { animation: enterFade .4s ease both; }
/* 내용이 차례로 떠오르기 */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 60ms); }
/* 홈의 명함이 놓이는 느낌 */
@keyframes cardIn { from { opacity: 0; transform: perspective(900px) rotateX(18deg) translateY(22px) scale(.96); } to { opacity: 1; transform: none; } }
main.enter .flip { animation: cardIn .8s var(--ease-out) .08s both; }
/* 진행 막대가 차오르기 */
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
main.enter .bar > i, main.enter .mini > i, main.enter .track > i { transform-origin: left center; animation: grow .9s var(--ease-out) .35s both; }
main.enter .meter > i.on, main.enter .wk > i { animation: rise .45s var(--ease-out) both; }
main.enter .wk > i:nth-child(n) { animation-delay: calc(.3s + var(--n, 0) * 40ms); }
/* 도장 쾅 */
@keyframes stampIn { 0% { transform: scale(1.8) rotate(-24deg); opacity: 0; } 55% { transform: scale(.9) rotate(-6deg); opacity: 1; } 100% { transform: scale(1) rotate(-8deg); } }
.sd.pop i { animation: stampIn .55s var(--ease-spring) both; }
main.enter .sd.on i { animation: stampIn .5s var(--ease-spring) both; animation-delay: .35s; }
/* 새 배지 */
@keyframes sealPop { 0% { transform: scale(.4) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.15) rotate(-2deg); opacity: 1; } 100% { transform: rotate(-6deg); } }
.seal.pop { animation: sealPop .7s var(--ease-spring) both; }
/* 창: 배경은 서서히, 상자는 아래에서 위로 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheetUp { from { opacity: 0; transform: translateY(40px) scale(.98); } to { opacity: 1; transform: none; } }
.modal.modal-in { animation: fadeIn .25s ease both; }
.modal.modal-in .modal-box { animation: sheetUp .42s var(--ease-out) both; }
/* 알림 */
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.toast-in { animation: toastIn .3s var(--ease-out) both; }
/* 하단 탭: 고른 탭 아이콘이 톡 튀기 */
@keyframes tabPop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
.entering .tab[aria-current="page"] svg { animation: tabPop .4s var(--ease-spring); }
/* 누르는 느낌 */
.btn, .q, .row-link, .link-btn, .text-btn, .bd, .seg button, .goal-seg button, .chip, .tab, .flip-hint, .icon-btn { transition: transform .16s var(--ease-out), background-color .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease; }
.btn:active, .q:active, .row-link:active, .link-btn:active, .bd:active, .seg button:active, .goal-seg button:active, .chip:active, .icon-btn:active { transform: scale(.97); }
.tab:active svg { transform: scale(.88); }
.row-link .arrow { transition: transform .25s var(--ease-out), background-color .2s ease; }
.row-link:hover .arrow, .row-link:focus-visible .arrow { transform: translateX(3px); }
@media (hover: hover) { .q:hover, .row-link:hover { border-color: var(--line); background: var(--paper); } }
.flip-hint svg { transition: transform .5s var(--ease-out); }
.flip-hint[aria-pressed="true"] svg { transform: rotate(180deg); }
/* 움직임 줄이기를 켠 사람에게는 모두 끔 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- 운동 일지 ---------- */
.w-items { display: flex; flex-direction: column; gap: 10px; }
.w-item { border: 1px solid var(--line-soft); background: var(--surface); border-radius: var(--r); padding: 14px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.w-item-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.w-item-head > span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.w-item-head b { font-size: 16px; font-weight: 700; }
.w-item-head small { font-size: 12px; color: var(--muted); line-height: 1.5; }
.w-item .field { gap: 4px; }
.w-pick { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--s3); }
.w-tabs { background: var(--surface); }
.w-tabs button { min-height: 36px; font-size: 13px; }
.w-custom { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.w-custom b { font-weight: 700; }
.wlog button[disabled] { opacity: .45; cursor: default; }
.ex-list { display: flex; flex-direction: column; }
.ex-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.ex-row:last-child { border-bottom: 0; }
.ex-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-n b { font-size: 15px; font-weight: 600; }
.ex-n small { font-size: 12px; color: var(--muted); }
.ex-v { text-align: right; font-family: var(--serif); font-size: 19px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ex-v small { display: block; font-family: var(--sans); font-size: 11px; color: var(--muted); }
.w-day { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.w-day .d { font-family: var(--serif); font-size: 14px; color: var(--muted); padding-top: 10px; }
.w-day-list { display: flex; flex-direction: column; }
.w-ent { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 14px; }
.w-ent b { font-weight: 600; }

[hidden] { display: none !important; }

/* ---------- 측정 항목 고르기 ---------- */
.lv-tag { font-style: normal; font-size: 10px; font-weight: 700; margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: var(--s2); color: var(--s2-ink); vertical-align: 1px; }
.chip[aria-pressed="true"] .lv-tag { background: var(--s2-ink); color: var(--s2); }
.m-pick { gap: 12px; }
.m-group { display: flex; flex-direction: column; gap: 6px; }
.m-new { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--r); background: var(--s3); }
.m-down { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.m-list { display: flex; flex-direction: column; gap: 10px; }
.m-in { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: var(--r); background: var(--surface); }
.m-in label { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.m-in label b { font-size: 15px; font-weight: 600; }
.m-in label span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.m-box { position: relative; }
.m-box .input { padding-right: 40px; text-align: right; }
.m-box em { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 12px; color: var(--muted); pointer-events: none; }
.m-inline { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 14px; border-radius: var(--r); background: var(--s3); }

/* ---------- 기록 탭: 입체 타일 메뉴 ---------- */
.lbl { font-size: 12px; color: var(--muted); }
.rec-home { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; }
.rsum { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink); cursor: pointer; box-shadow: 0 1px 0 #fff inset, 0 6px 14px rgba(48, 34, 25, .08); }
.rsum .lbl { flex: 1; text-align: left; font-size: 13px; }
.rsum .lbl b { font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ink); margin: 0 2px 0 4px; }
.rdots { display: flex; gap: 5px; }
.rdots i { width: 16px; height: 16px; border-radius: 50%; border: 1.5px dashed var(--line); }
.rdots i.today { border-style: solid; border-color: var(--ink); }
.rdots i.on { background: var(--s2); border: 0; box-shadow: inset 0 0 0 2px var(--s2), inset 0 0 0 3px rgba(255, 250, 242, .5); }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rtile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 152px; padding: 16px; border: 0; border-radius: 18px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, #F3EADF 0%, #E3D6C8 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -3px 0 rgba(102, 80, 68, .12) inset, 0 10px 18px rgba(48, 34, 25, .14), 0 2px 4px rgba(48, 34, 25, .08);
  transition: transform .16s var(--ease-out, ease), box-shadow .16s ease; }
.rtile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -1px 0 rgba(102, 80, 68, .12) inset, 0 3px 6px rgba(48, 34, 25, .14); }
.rtile svg { filter: drop-shadow(0 8px 8px rgba(48, 34, 25, .22)); flex-shrink: 0; }
.rtile.dark { color: var(--s2-ink); background: linear-gradient(160deg, #7A6052 0%, #5A4538 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -4px 0 rgba(0, 0, 0, .18) inset, 0 14px 24px rgba(48, 34, 25, .28), 0 2px 4px rgba(48, 34, 25, .15); }
.rtile.dark:active { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -1px 0 rgba(0, 0, 0, .18) inset, 0 4px 8px rgba(48, 34, 25, .28); }
.rtile.wide { grid-column: span 2; flex-direction: row; align-items: center; min-height: 168px; }
.rt-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.rt-t b { font-size: 17px; font-weight: 700; }
.rtile.wide .rt-t b { font-size: 20px; }
.rt-t > span { font-size: 12px; opacity: .78; line-height: 1.5; }
.rt-pill { margin-top: 8px; align-self: flex-start; padding: 5px 11px; border-radius: 999px; background: rgba(255, 250, 242, .18); font-size: 12px; font-weight: 600; opacity: 1 !important; }

/* 하위 화면 */
.rec-sub { display: flex; flex-direction: column; gap: 12px; padding-bottom: 32px; }
.rdate { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--s3); font-size: 13px; color: var(--muted); }
.rdate input { border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); font-family: var(--serif); }
.how { padding: 12px 14px; border-radius: 12px; background: var(--s3); font-size: 13px; line-height: 1.6; color: var(--s2); }
.how b { color: var(--ink); }
.mrows { display: flex; flex-direction: column; gap: 8px; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; background: var(--surface); font: inherit; color: var(--ink); text-align: left; cursor: pointer; box-shadow: 0 1px 0 #fff inset, 0 6px 14px rgba(48, 34, 25, .08); transition: transform .16s ease; }
.mrow:active { transform: scale(.98); }
.mrow.hl { background: linear-gradient(160deg, #F3EADF, #E3D6C8); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 10px 18px rgba(48, 34, 25, .12); }
.mr-n { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mr-n b { font-size: 15px; font-weight: 700; }
.mr-n small { font-size: 12px; color: var(--muted); line-height: 1.45; }
.mr-v { font-family: var(--serif); font-size: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-v small { font-family: var(--sans); font-size: 12px; margin-left: 2px; color: var(--muted); }
.mr-go { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.add-dash { width: 100%; padding: 13px; border: 1.5px dashed var(--line); border-radius: 14px; background: transparent; font: inherit; font-size: 14px; color: var(--muted); cursor: pointer; }
.big-in { position: relative; }
.big-in .input { height: 72px; padding-right: 64px; text-align: right; font-family: var(--serif); font-size: 36px; border-width: 2px; border-color: var(--ink); }
.big-in em { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 15px; color: var(--muted); }
.input.big { height: 56px; text-align: center; font-family: var(--serif); font-size: 22px; }
.rchart { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: 0 1px 0 #fff inset, 0 6px 14px rgba(48, 34, 25, .06); color: var(--s2); }
.rchart .spark { width: 100%; height: 90px; }
.rbest { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 16px; background: linear-gradient(160deg, #7A6052, #5A4538); color: var(--s2-ink); }
.rbest .lbl { color: rgba(255, 250, 242, .78); }
.rbest b { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; }
.ex-act { display: flex; align-items: center; gap: 4px; }
.pr-tag { font-style: normal; font-size: 11px; font-weight: 700; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 999px; }
/* 아래에서 올라오는 입력 창 */
.bsheet-dim { position: fixed; inset: 0; z-index: 40; background: rgba(28, 22, 18, .45); animation: fadeIn .2s ease both; }
.bsheet { position: fixed; left: 50%; bottom: 0; z-index: 41; width: min(100%, 480px); transform: translateX(-50%); display: flex; flex-direction: column; gap: 12px; padding: 12px 18px calc(18px + env(safe-area-inset-bottom, 0px)); border-radius: 20px 20px 0 0; background: var(--paper); box-shadow: 0 -10px 30px rgba(48, 34, 25, .25); animation: bsUp .32s var(--ease-out, ease) both; }
@keyframes bsUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.bsheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); align-self: center; }
.bs-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bs-head b { font-size: 19px; }
.bs-head span { font-size: 12px; color: var(--muted); text-align: right; }
.inrow { display: grid; gap: 8px; }
.inp-cell { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.inp-cell .input { height: 60px; text-align: center; font-family: var(--serif); font-size: 24px; }
.inp-cell small { font-size: 11px; color: var(--muted); }

/* 기록 탭의 밝은 카드: 다크 모드에서도 흰 배경 + 브라운 글씨로 고정 */
.rtile:not(.dark), .mrow, .rsum, .rchart, .rec-sub .history, .rec-sub .ex-list { --ink: #302219; --muted: #7A6A5D; --s2: #665044; color: #302219; }
.mrow, .rsum, .rchart { background: #FDFBF7; }
.mrow.hl { background: linear-gradient(160deg, #F3EADF, #E3D6C8); }
.mr-n b, .mr-v, .rsum .lbl b { color: #302219; }
.mr-n small, .mr-v small, .mr-go, .rsum .lbl, .rtile:not(.dark) .rt-t > span { color: #7A6A5D; opacity: 1; }
.rchart, .rchart .lbl { color: #665044; }
.how { background: #EEE5DA; color: #665044; }
.how b { color: #302219; }
.rdate { background: #EEE5DA; color: #7A6A5D; }
.rdate input { color: #302219; color-scheme: light; }
.mrow .lv-tag { background: #665044; color: #FFFAF2; }
.rec-sub .history, .rec-sub .ex-list { background: #FDFBF7; border-radius: 14px; padding: 2px 14px; box-shadow: 0 1px 0 #fff inset, 0 6px 14px rgba(48, 34, 25, .06); --line-soft: #E0D6CA; --surface: #FDFBF7; }
.rec-sub .history .d { color: #7A6A5D; }
.rec-sub .history .icon-btn, .rec-sub .ex-list .icon-btn { color: #665044; }
.rec-sub .history .h-row:last-child, .rec-sub .history .w-day:last-child { border-bottom: 0; }
.big-in .input, .input.big, .inp-cell .input, .rec-sub .w-pick .input { background: #FDFBF7; color: #302219; border-color: #302219; color-scheme: light; }
.big-in .input::placeholder, .input.big::placeholder, .inp-cell .input::placeholder { color: #B8A08A; }
.big-in em { color: #7A6A5D; }

/* ---------- 기록 탭 전체 입체 질감 ---------- */
.rec-sub, .bsheet {
  --raise-bg: linear-gradient(160deg, #FFFDF9 0%, #F1E8DD 100%);
  --raise-sh: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -2px 0 rgba(102, 80, 68, .10) inset, 0 8px 16px rgba(48, 34, 25, .12), 0 2px 3px rgba(48, 34, 25, .08);
  --raise-sh-low: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -1px 0 rgba(102, 80, 68, .10) inset, 0 3px 6px rgba(48, 34, 25, .12);
  --sink-bg: #F2EADF;
  --sink-sh: inset 0 2px 5px rgba(48, 34, 25, .16), inset 0 -1px 0 rgba(255, 255, 255, .9);
}
/* 솟은 카드: 목록 한 줄 한 줄을 각각 카드로 */
.rec-sub .history, .rec-sub .ex-list { display: flex; flex-direction: column; gap: 10px; padding: 0; background: none; box-shadow: none; }
.rec-sub .h-row, .rec-sub .w-day, .rec-sub .ex-row { padding: 12px 12px 12px 16px; border: 0; border-radius: 14px; background: var(--raise-bg); box-shadow: var(--raise-sh); color: #302219; }
.rec-sub .w-day { grid-template-columns: 70px minmax(0, 1fr); }
.rec-sub .w-day .d { padding-top: 9px; }
.rec-sub .w-ent + .w-ent { border-top: 1px dashed #E0D6CA; }
.rec-sub .w-ent { padding: 4px 0; }
.mrow, .rchart { background: var(--raise-bg); box-shadow: var(--raise-sh); }
.mrow.hl { background: linear-gradient(160deg, #F3EADF 0%, #E3D6C8 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 -3px 0 rgba(102, 80, 68, .14) inset, 0 12px 20px rgba(48, 34, 25, .16), 0 2px 4px rgba(48, 34, 25, .08); }
.mrow:active, .rec-sub .h-row:active { transform: translateY(2px); box-shadow: var(--raise-sh-low); }
.how { background: linear-gradient(160deg, #F3EADF, #E8DCCF); box-shadow: var(--raise-sh); border-left: 4px solid #665044; }
.rbest { box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 -4px 0 rgba(0, 0, 0, .18) inset, 0 14px 24px rgba(48, 34, 25, .28); }
.w-pick { background: linear-gradient(160deg, #F3EADF, #E6DACC); box-shadow: var(--raise-sh); border-radius: 18px; }
/* 작은 동그란 지우기 버튼도 솟게 */
.rec-sub .icon-btn { width: 34px; height: 34px; min-height: 34px; border-radius: 50%; background: var(--raise-bg); box-shadow: var(--raise-sh-low); color: #665044; }
.rec-sub .icon-btn:active { box-shadow: var(--sink-sh); transform: none; }
/* 눌려 들어간 입력 칸 */
.rec-sub .input, .bsheet .input, .big-in .input, .input.big, .inp-cell .input { background: var(--sink-bg); border: 0; box-shadow: var(--sink-sh); color: #302219; color-scheme: light; border-radius: 14px; }
.rec-sub .input:focus, .bsheet .input:focus { outline: 2px solid #665044; outline-offset: 2px; }
.big-in .input { height: 80px; box-shadow: inset 0 3px 8px rgba(48, 34, 25, .2), inset 0 -1px 0 rgba(255, 255, 255, .9); }
.rdate { background: var(--sink-bg); box-shadow: var(--sink-sh); border-radius: 14px; }
.rec-sub .field .hint { color: var(--muted); }
/* 칩: 솟은 알약 · 고르면 눌림 */
.rec-sub .chip, .bsheet .chip { border: 0; background: var(--raise-bg); box-shadow: var(--raise-sh-low); color: #302219; }
.rec-sub .chip[aria-pressed="true"] { background: linear-gradient(180deg, #5A4538, #7A6052); color: #FFFAF2; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3); }
.rec-sub .chip:active { transform: translateY(1px); box-shadow: var(--sink-sh); }
/* 분류 탭: 눌린 홈 안에 고른 탭만 솟게 */
.rec-sub .seg { background: var(--sink-bg); box-shadow: var(--sink-sh); }
.rec-sub .seg button { color: #7A6A5D; }
.rec-sub .seg button[aria-pressed="true"] { background: var(--raise-bg); color: #302219; box-shadow: var(--raise-sh-low); }
/* 버튼: 두께감 있는 진한 버튼 */
.rec-sub .btn:not(.ghost):not(.box), .bsheet .btn { border: 0; background: linear-gradient(180deg, #4A372C 0%, #302219 100%); color: #FFFAF2; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -3px 0 rgba(0, 0, 0, .35) inset, 0 8px 16px rgba(48, 34, 25, .28); }
.rec-sub .btn:not(.ghost):not(.box):active, .bsheet .btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -1px 0 rgba(0, 0, 0, .35) inset, 0 3px 6px rgba(48, 34, 25, .28); }
.add-dash { background: var(--sink-bg); box-shadow: var(--sink-sh); border: 1.5px dashed #C9B7A4; color: #7A6A5D; }
.pr-tag { box-shadow: 0 1px 0 rgba(255, 255, 255, .8) inset, 0 2px 4px rgba(78, 122, 92, .25); }
/* 아래에서 올라오는 입력 창 */
.bsheet { background: linear-gradient(180deg, #FFFDF9 0%, #F3EADF 100%); color: #302219; box-shadow: 0 -1px 0 rgba(255, 255, 255, .9) inset, 0 -14px 34px rgba(48, 34, 25, .3); }
.bsheet .bs-head span, .bsheet .lbl, .inp-cell small { color: #7A6A5D; }
.bsheet .text-btn { color: #665044; }
.inp-cell .input { height: 64px; }
/* 섹션 제목도 같은 톤으로 */
.rec-sub .sec-head { border-bottom: 0; }
.rec-sub .sec-head h2 { color: inherit; }
.rec-sub .empty { background: var(--sink-bg); box-shadow: var(--sink-sh); border: 0; border-radius: 14px; color: #7A6A5D; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rec-sub .btn:not(.ghost):not(.box), :root:not([data-theme="light"]) .rbest { background: linear-gradient(180deg, #8C6F5D 0%, #665044 100%); } }
:root[data-theme="dark"] .rec-sub .btn:not(.ghost):not(.box), :root[data-theme="dark"] .rbest { background: linear-gradient(180deg, #8C6F5D 0%, #665044 100%); }

/* ---------- 상단: 설정 버튼 · 홈으로 가는 작은 로고 ---------- */
.gear-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(160deg, #FFFDF9, #F1E8DD); color: #302219; box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -2px 0 rgba(102, 80, 68, .1) inset, 0 4px 10px rgba(48, 34, 25, .14); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.gear-btn:active { transform: translateY(1px); box-shadow: inset 0 2px 5px rgba(48, 34, 25, .16); }
.mini-brand { width: 44px; height: 44px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; }
.mini-brand .mark { width: 34px; height: 26px; }
.mini-brand .mark i { top: 5px; width: 22px; height: 14px; }
.mini-brand .mark i:last-child { left: 9px; }
.mini-brand:active { background: var(--s3); }

/* ---------- 설정 화면 ---------- */
.settings { gap: 22px; }
.set-group { display: flex; flex-direction: column; gap: 8px; }
.set-group > .lbl { padding-left: 4px; color: var(--muted); }
.theme-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px; border: 0; border-radius: 16px; font: inherit; color: #302219; cursor: pointer; background: linear-gradient(160deg, #FFFDF9 0%, #F1E8DD 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -2px 0 rgba(102, 80, 68, .1) inset, 0 8px 16px rgba(48, 34, 25, .12); transition: transform .16s ease; }
.theme-opt b { font-size: 14px; }
.theme-opt small { font-size: 11px; color: #7A6A5D; }
.theme-opt[aria-pressed="true"] { outline: 2.5px solid #665044; outline-offset: 2px; }
.theme-opt:active { transform: translateY(2px); }
.theme-prev { width: 58px; height: 58px; border-radius: 16px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 2px 5px rgba(48, 34, 25, .18); }
.theme-prev.light { background: #F8F5EF; color: #C08A2E; }
.theme-prev.dark { background: #1C1612; color: #F3EBE1; }
.theme-prev.system { background: linear-gradient(90deg, #F8F5EF 50%, #1C1612 50%); color: #8C6F5D; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 16px; border: 0; border-radius: 14px; font: inherit; text-align: left; cursor: pointer; color: #302219; background: linear-gradient(160deg, #FFFDF9 0%, #F1E8DD 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -2px 0 rgba(102, 80, 68, .1) inset, 0 6px 12px rgba(48, 34, 25, .1); }
.set-row > span:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-row b { font-size: 15px; font-weight: 600; }
.set-row small { font-size: 12px; color: #7A6A5D; line-height: 1.45; }
.set-row .arrow { width: 34px; height: 34px; color: #665044; }
.set-row.static { cursor: default; }
.set-row.danger b { color: #A2472A; }
button.set-row:active, label.set-row:active { transform: translateY(2px); }
.set-row .goal-seg button { background: #F2EADF; border: 0; box-shadow: inset 0 2px 4px rgba(48, 34, 25, .14); color: #302219; }
.set-row .goal-seg button[aria-pressed="true"] { background: linear-gradient(180deg, #4A372C, #302219); color: #FFFAF2; box-shadow: 0 3px 6px rgba(48, 34, 25, .25); }
.set-row .goal-seg.wide button { min-width: 52px; }
.set-row .switch { flex-shrink: 0; }
/* 움직임 줄이기 */
html.calm *, html.calm *::before, html.calm *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
.set-row .switch i { background: #DED0C1; box-shadow: inset 0 2px 4px rgba(48, 34, 25, .18); }
.set-row .switch i::after { background: #FFFDF9; box-shadow: 0 2px 4px rgba(48, 34, 25, .3); }
.set-row .switch input:checked + i { background: #665044; }

/* ---------- 확인 팝업 ---------- */
.set-row[data-danger] b { color: #A2472A; }
.cf-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(28, 22, 18, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.cf-modal.out { animation: fadeIn .16s ease reverse both; }
.cf-box { width: min(100%, 340px); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 22px 20px; border-radius: 22px; text-align: center; color: #302219;
  background: linear-gradient(170deg, #FFFDF9 0%, #F1E8DD 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -3px 0 rgba(102, 80, 68, .12) inset, 0 24px 48px rgba(28, 22, 18, .35), 0 4px 10px rgba(28, 22, 18, .2);
  animation: cfPop .32s var(--ease-spring, ease) both; }
.cf-modal.out .cf-box { animation: cfPop .16s ease reverse both; }
@keyframes cfPop { from { opacity: 0; transform: scale(.88) translateY(10px); } to { opacity: 1; transform: none; } }
.cf-icon { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #665044; background: linear-gradient(160deg, #F3EADF, #E3D6C8); box-shadow: 0 1px 0 #fff inset, 0 6px 12px rgba(48, 34, 25, .16); margin-bottom: 2px; }
.cf-icon.danger { color: #A2472A; background: linear-gradient(160deg, #FBEDE6, #F2D9CD); }
.cf-box b { font-family: var(--ko-serif); font-weight: 500; font-size: 20px; line-height: 1.4; }
.cf-box p { margin: 0; font-size: 14px; line-height: 1.6; color: #665044; }
.cf-detail { width: 100%; padding: 10px 12px; border-radius: 12px; background: #F2EADF; box-shadow: inset 0 2px 4px rgba(48, 34, 25, .12); font-size: 13px; color: #302219; line-height: 1.5; }
.cf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 8px; }
.cf-btn { min-height: 50px; border: 0; border-radius: 999px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer; transition: transform .14s ease; }
.cf-btn:active { transform: translateY(2px); }
.cf-btn.cancel { color: #302219; background: linear-gradient(160deg, #FFFDF9, #EDE3D7); box-shadow: 0 1px 0 #fff inset, 0 -2px 0 rgba(102, 80, 68, .12) inset, 0 4px 10px rgba(48, 34, 25, .14); }
.cf-btn.ok { color: #FFFAF2; background: linear-gradient(180deg, #4A372C, #302219); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -3px 0 rgba(0, 0, 0, .35) inset, 0 6px 14px rgba(48, 34, 25, .3); }
.cf-btn.ok.danger { background: linear-gradient(180deg, #B85A3C, #8E3B22); }
.cf-btn:focus-visible { outline: 2.5px solid #665044; outline-offset: 2px; }
.home-edit { align-self: center; margin-top: -4px; }
.rec-home .stamp { background: linear-gradient(160deg, #FFFDF9 0%, #F1E8DD 100%); border: 0; border-radius: 18px; color: #302219; --ink: #302219; --muted: #7A6A5D; --line: #D4C9BD; --line-soft: #E0D6CA; box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 -2px 0 rgba(102, 80, 68, .1) inset, 0 10px 18px rgba(48, 34, 25, .12); }
.rec-home .stamp .btn.full { border: 0; background: linear-gradient(180deg, #4A372C, #302219); color: #FFFAF2; box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 -3px 0 rgba(0, 0, 0, .35) inset, 0 6px 14px rgba(48, 34, 25, .28); }
.rec-home .stamp .btn.box { border: 0; background: linear-gradient(160deg, #FFFDF9, #EDE3D7); color: #302219; box-shadow: 0 1px 0 #fff inset, 0 -2px 0 rgba(102, 80, 68, .12) inset, 0 4px 10px rgba(48, 34, 25, .14); }
.rec-home .stamp .goal-seg button { background: #F2EADF; border: 0; box-shadow: inset 0 2px 4px rgba(48, 34, 25, .14); color: #302219; }
.rec-home .stamp .goal-seg button[aria-pressed="true"] { background: linear-gradient(180deg, #4A372C, #302219); color: #FFFAF2; box-shadow: 0 3px 6px rgba(48, 34, 25, .25); }
.rec-home .stamp .text-btn { color: #665044; }

/* ---------- 사진 위치 맞추기 ---------- */
.photo-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.photo-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.photo-acts .link-btn { min-height: 36px; }
.crop-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(28, 22, 18, .6); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.crop-box { width: min(100%, 360px); display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 20px 18px; border-radius: 22px; color: #302219; text-align: center; background: linear-gradient(170deg, #FFFDF9 0%, #F1E8DD 100%); box-shadow: 0 1px 0 rgba(255, 255, 255, .95) inset, 0 24px 48px rgba(28, 22, 18, .35); animation: cfPop .3s var(--ease-spring, ease) both; }
.crop-box b { font-family: var(--ko-serif); font-weight: 500; font-size: 20px; }
.crop-box p { margin: 0; font-size: 13px; color: #665044; line-height: 1.5; }
.crop-stage { position: relative; padding: 10px; border-radius: 22px; background: #2A211B; box-shadow: inset 0 3px 10px rgba(0, 0, 0, .4); }
.crop-frame { position: relative; overflow: hidden; border-radius: 38%; cursor: grab; touch-action: none; background: #1C1612; box-shadow: 0 0 0 3px rgba(255, 250, 242, .85); }
.crop-frame:active { cursor: grabbing; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crop-grid { position: absolute; inset: 10px; border-radius: 38%; pointer-events: none; background-image: linear-gradient(rgba(255, 255, 255, .25) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .25) 1px, transparent 1px); background-size: 33.33% 33.33%; background-position: -1px -1px; }
.crop-zoom { display: flex; align-items: center; gap: 10px; width: 100%; color: #665044; font-weight: 700; }
.crop-zoom input { flex: 1; accent-color: #665044; }
.crop-prev { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 8px 12px; border-radius: 14px; background: #F2EADF; box-shadow: inset 0 2px 4px rgba(48, 34, 25, .12); }
.crop-mini canvas { width: 48px; height: 48px; border-radius: 38%; display: block; box-shadow: 0 0 0 2px #fff, 0 3px 6px rgba(48, 34, 25, .2); }

/* ---------- 태블릿 · 컴퓨터: 휴대폰 화면 구성 그대로, 화면 폭에 맞춰 통째로 키우기 ---------- */
/* --z 값은 app.js가 화면 폭을 보고 정해요 (휴대폰 1, 태블릿 약 1.6~1.7, 컴퓨터 최대 2.2) */
body { zoom: var(--z, 1); }
.shell { min-height: calc(100vh / var(--z, 1)); }
