/* 아하브 서재 앱 공통 디자인 (스캐너·숙면·습관·마음일기·사진·녹음). 색은 각 앱 index.html 의 :root 변수로 정해요. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.65; -webkit-text-size-adjust: 100%; padding-bottom: calc(80px + env(safe-area-inset-bottom)); word-break: keep-all; overflow-wrap: anywhere; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; }
header.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 8px; }
header.top h1 { font-size: 17px; margin: 0; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; }
header.top h1 a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
header.top h1 img { border-radius: 8px; }
.hright { display: flex; align-items: center; gap: 10px; }
.streak { font-size: 14px; font-weight: 700; color: var(--new); white-space: nowrap; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs .wrap { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 4px; }
nav.tabs button { position: relative; background: none; border: 0; padding: 9px 0 11px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 3px; }
nav.tabs button svg { width: 24px; height: 24px; }
nav.tabs button[aria-selected="true"] { color: var(--accent); font-weight: 700; }
nav.tabs button.dot::after { content: ""; position: absolute; top: 7px; left: calc(50% + 10px); width: 8px; height: 8px; border-radius: 50%; background: var(--new); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.intro { margin-top: 16px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.h2 { font-size: 22px; margin: 0 0 6px; line-height: 1.38; letter-spacing: -0.02em; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.chips.center { justify-content: center; }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.chip.lv { background: var(--accent-soft); color: var(--accent); }
.chip.ok { background: var(--ok); color: #fff; }
.chip.new { background: var(--new); color: #fff; }
.back { background: none; border: 0; color: var(--accent); font-weight: 700; padding: 14px 0 8px; font-size: 15px; }
.lock { text-align: center; padding: 28px 18px; }
.lockicon { font-size: 36px; line-height: 1; margin-bottom: 10px; }
.lock .acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 16px; font-weight: 700; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; text-decoration: none; color: inherit; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.btn.small { padding: 5px 12px; font-size: 13px; border-radius: 9px; }
.disclaimer { font-size: 12px; color: var(--muted); text-align: center; margin: 12px 0 20px; }
.toast { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; }
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(10,8,30,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-bg[hidden] { display: none; }
.sheet { background: var(--surface); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(0,0,0,.2); }
@media (min-width: 600px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; } }
.sheet-top { display: flex; align-items: center; gap: 12px; }
.sheet-top img { border-radius: 14px; }
.sheet-name { font-weight: 800; font-size: 17px; }
.sheet h2 { font-size: 19px; margin: 16px 0 8px; }
.sheet ol { margin: 8px 0 0; padding-left: 20px; } .sheet li { margin: 6px 0; }
.sheet ul.perks { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.sheet-acts { display: flex; gap: 8px; margin-top: 18px; } .sheet-acts .btn { flex: 1; justify-content: center; padding: 12px; }
.note { font-size: 13px; color: var(--muted); }
.sec-h { font-size: 17px; margin: 22px 2px 10px; font-weight: 800; letter-spacing: -0.01em; }
.sec-h span { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.arrow { font-size: 24px; color: var(--muted); }
.date { font-size: 12px; color: var(--muted); font-weight: 600; }
h3.sec { font-size: 14px; margin: 0 0 12px; color: var(--accent); font-weight: 800; letter-spacing: .02em; }
.warn { background: var(--hl); border-radius: 14px; padding: 12px 14px; font-size: 14px; margin: 0 0 12px; }
.search { width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--bg); font-size: 16px; }

/* 홈 */
.hero { margin: 16px 0 8px; padding: 20px 20px 18px; border-radius: 24px; color: #fff; background: var(--hero); box-shadow: var(--hero-shadow); }
.hero .eyebrow { color: rgba(255,255,255,.8); }
.hero-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hero-k { font-size: 13px; color: rgba(255,255,255,.8); }
.hero-big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; margin: 2px 0 12px; font-variant-numeric: tabular-nums; }
.hero-big.minus { color: #FFC2B8; }
.hero-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hero-two div { background: rgba(255,255,255,.1); border-radius: 12px; padding: 8px 12px; display: flex; flex-direction: column; }
.hero-two span { font-size: 12px; color: rgba(255,255,255,.75); } .hero-two b { font-size: 17px; font-variant-numeric: tabular-nums; }
.hbar { height: 8px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.hbar i { display: block; height: 100%; background: #FFD66B; border-radius: 4px; }
.hbar.over i { background: #FF8A7A; }
.hnote { font-size: 12px; color: rgba(255,255,255,.8); margin-top: 6px; }
.hero .btn.add { margin-top: 14px; width: 100%; justify-content: center; background: #fff; color: var(--hero-ink); border: 0; padding: 12px; font-size: 16px; }
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .tools { grid-template-columns: repeat(4, 1fr); } }
.tool { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); position: relative; }
.tool .ti { font-size: 24px; line-height: 1; } .tool b { font-size: 15px; } .tool small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.tool .lk { position: absolute; top: 10px; right: 10px; font-size: 12px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 104px 1fr auto; gap: 10px; align-items: center; font-size: 14px; }
.bar .bt { display: flex; gap: 6px; align-items: center; white-space: nowrap; overflow: hidden; }
.bar .bb { height: 10px; background: var(--sunk); border-radius: 5px; overflow: hidden; }
.bar .bb i { display: block; height: 100%; border-radius: 5px; background: var(--c, var(--accent)); }
.bar .bv { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; }
.tip { background: var(--hl); border-radius: 16px; padding: 14px 16px; font-size: 14.5px; margin-bottom: 12px; }
.tip b { display: block; font-size: 12px; letter-spacing: .08em; color: #9A6B00; margin-bottom: 4px; }
/* 공통 폼 */
label.f { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 6px; }
label.f:first-child { margin-top: 0; }
.in { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; background: var(--bg); font-size: 16px; }
.in.money { font-size: 24px; font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; padding: 10px 14px; }
.in:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.unit { display: flex; align-items: center; gap: 8px; } .unit .in { flex: 1; } .unit span { font-weight: 700; color: var(--muted); white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--sunk); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: 14.5px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.seg.io button.on[data-v="out"] { color: var(--out); } .seg.io button.on[data-v="in"] { color: var(--in); }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cats button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 2px 6px; font-size: 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cats button span { font-size: 20px; line-height: 1.1; }
.cats button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.save { width: 100%; justify-content: center; margin-top: 14px; padding: 13px; font-size: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 7px 13px; font-size: 14px; font-weight: 600; }
.pills button.on { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
/* 가계부 */
.month { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 10px; }
.month b { font-size: 19px; }
.month button { border: 1px solid var(--line); background: var(--surface); width: 38px; height: 38px; border-radius: 12px; font-size: 18px; }
.sum3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.sum3 div { display: flex; flex-direction: column; } .sum3 span { font-size: 12px; color: var(--muted); }
.sum3 b { font-size: 16px; font-variant-numeric: tabular-nums; }
.c-in { color: var(--in); } .c-out { color: var(--out); }
.day { font-size: 13px; font-weight: 800; color: var(--muted); margin: 14px 0 2px; display: flex; justify-content: space-between; }
.day:first-child { margin-top: 0; }
.ent { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.day + .ent { border-top: 0; }
.ent .ei { font-size: 20px; text-align: center; } .ent .et { display: flex; flex-direction: column; font-size: 15px; line-height: 1.35; min-width: 0; }
.ent .et small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent .ev { font-weight: 800; font-variant-numeric: tabular-nums; }
.del { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px; border-radius: 8px; }
.del.sure { background: var(--bad); color: #fff; font-weight: 700; }
.trend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; height: 150px; padding-top: 10px; }
.trend div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 11px; color: var(--muted); }
.trend i { display: block; width: 70%; max-width: 34px; background: var(--out); border-radius: 6px 6px 2px 2px; min-height: 2px; opacity: .85; }
.trend div.cur i { opacity: 1; background: var(--accent); }
.trend em { font-style: normal; font-weight: 700; color: var(--ink); font-size: 10.5px; }
.empty { text-align: center; color: var(--muted); padding: 18px 8px; font-size: 14px; }
/* 계산기 */
.calcnav { display: flex; gap: 6px; overflow-x: auto; padding: 14px 0 6px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.calcnav::-webkit-scrollbar { display: none; }
.calcnav button { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.calcnav button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.result { background: var(--hero); color: #fff; border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--hero-shadow); }
.result .rk { font-size: 13px; color: rgba(255,255,255,.8); }
.result .rv { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.2; margin: 2px 0 4px; }
.result .rs { font-size: 13.5px; color: rgba(255,255,255,.85); }
table.tb { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.tb td { padding: 8px 0; border-top: 1px solid var(--line); } table.tb tr:first-child td { border-top: 0; }
table.tb td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
table.tb tr.tot td { border-top: 2px solid var(--ink); font-weight: 800; }
.ctitle { display: flex; gap: 12px; align-items: center; margin: 6px 0 12px; }
.ctitle .ci { width: 46px; height: 46px; border-radius: 14px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 24px; flex: none; }
.ctitle h2 { font-size: 20px; margin: 0; line-height: 1.3; } .ctitle p { margin: 0; font-size: 13.5px; color: var(--muted); }
/* 혜택 */
.ben { display: flex; flex-direction: column; gap: 6px; }
.ben .bh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ben h3 { font-size: 17px; margin: 0; }
.ben .amt { font-weight: 800; color: var(--accent); font-size: 15px; }
.ben p { margin: 0; font-size: 14.5px; }
.ben .how { font-size: 13.5px; background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.ben.locked { opacity: .92; }
.ben.locked .lkline { font-size: 13px; color: var(--muted); }
.chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--sunk); color: var(--muted); }
.chip.acc { background: var(--accent-soft); color: var(--accent); }
.cnt { font-size: 15px; margin: 0 0 10px; } .cnt b { color: var(--accent); font-size: 20px; }
.eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 800; letter-spacing: .14em; color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.lock { text-align: center; padding: 24px 18px; }
.lock h3 { margin: 4px 0 6px; font-size: 18px; }
.lock p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 400px) { header.top h1 .sub { display: none; } .hero-big { font-size: 30px; } .bar { grid-template-columns: 96px 1fr auto; } }

/* 생활비서 */
.feat { display: grid; gap: 10px; }
@media (min-width: 560px) { .feat { grid-template-columns: repeat(3, 1fr); } }
.feat .tool b { font-size: 16px; }
.hero-h { font-size: 24px; line-height: 1.3; margin: 2px 0 8px; font-weight: 800; letter-spacing: -0.02em; }
.hero-p { margin: 0; font-size: 14px; color: rgba(255,255,255,.85); }
.upl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.upl label { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1.5px dashed var(--accent); border-radius: 14px; padding: 16px 8px; color: var(--accent); font-weight: 800; cursor: pointer; background: var(--accent-soft); text-align: center; }
.upl label span { font-size: 26px; line-height: 1; }
.upl input { display: none; }
.prev { position: relative; margin-top: 10px; }
.prev img { width: 100%; max-height: 320px; object-fit: contain; border-radius: 12px; background: var(--sunk); display: block; }
.prev button { position: absolute; top: 8px; right: 8px; }
textarea.in { min-height: 120px; resize: vertical; line-height: 1.55; font-family: var(--font-ui); }
.or { text-align: center; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.busy { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px; color: var(--muted); font-weight: 700; }
.spin { width: 22px; height: 22px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.sample { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .1em; color: #fff; background: var(--new); border-radius: 6px; padding: 2px 8px; margin-bottom: 8px; }
.rh { font-size: 13px; font-weight: 800; color: var(--accent); margin: 14px 0 6px; }
.rh:first-of-type { margin-top: 0; }
ul.rl { margin: 0; padding-left: 20px; } ul.rl li { margin: 4px 0; }
.todoitem { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.todoitem:first-child { border-top: 0; }
.due { font-size: 12.5px; font-weight: 800; color: var(--out); white-space: nowrap; }
.scam { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: 12px; padding: 10px 12px; font-size: 14.5px; margin-top: 12px; }
.scam b { color: var(--bad); }
dl.words { margin: 0; display: grid; gap: 6px; } dl.words div { background: var(--sunk); border-radius: 10px; padding: 8px 10px; font-size: 14px; } dl.words dt { font-weight: 800; display: inline; } dl.words dt::after { content: " · "; color: var(--muted); } dl.words dd { display: inline; margin: 0; }
.draft { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 10px; }
.draft .dh { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 8px 14px; background: var(--sunk); font-weight: 800; font-size: 14px; }
.draft p { margin: 0; padding: 12px 14px; white-space: pre-wrap; font-size: 15.5px; line-height: 1.65; }
.tpl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
@media (max-width: 400px) { .tpl { grid-template-columns: repeat(3, 1fr); } }
.tpl button { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 8px 2px 6px; font-size: 12.5px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tpl button span { font-size: 20px; line-height: 1.1; }
.tpl button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.task { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.tgrp + .task, .card > .task:first-child { border-top: 0; }
.task .ck { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--accent); background: var(--surface); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; padding: 0; }
.task.done .ck { background: var(--accent); }
.task.done .tt { text-decoration: line-through; color: var(--muted); }
.task .tt { display: flex; flex-direction: column; font-size: 15.5px; line-height: 1.4; min-width: 0; }
.task .tt small { font-size: 12.5px; color: var(--muted); }
.task .tt small.late { color: var(--bad); font-weight: 700; }
.tgrp { font-size: 13px; font-weight: 800; color: var(--muted); margin: 14px 0 2px; }
.tgrp:first-child { margin-top: 0; }
.addrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.opts3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
select.in { appearance: auto; }

