:root {
  --bg: #f2f4f6; --card: #ffffff; --text: #191f28; --sub: #6b7684; --faint: #8b95a1; --line: #e5e8eb;
  --blue: #3182f6; --blue-press: #1b64da; --blue-soft: #e8f3ff; --red: #f04452; --red-soft: #ffeeee;
  --green: #03b26c; --green-soft: #e5f8ef; --grey-btn: #f2f4f6; --radius: 20px;
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; letter-spacing: -0.02em; }
button { font: inherit; letter-spacing: inherit; border: 0; cursor: pointer; background: none; color: inherit; }
input { font: inherit; letter-spacing: inherit; }

.wrap { max-width: 760px; margin: 0 auto; padding: 28px 20px 80px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.brand { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.brand-dot { width: 22px; height: 22px; border-radius: 7px; background: var(--blue); display: inline-block; }
.who { font-size: 14px; color: var(--sub); display: flex; align-items: center; gap: 10px; }
.link { color: var(--sub); font-size: 14px; padding: 6px 10px; border-radius: 10px; }
.link:hover { background: #e9ecef; }

.title { font-size: 26px; font-weight: 700; line-height: 1.35; margin: 8px 0 6px; }
.title.gap { margin-top: 22px; }
.caption { font-size: 15px; color: var(--sub); line-height: 1.55; }

.tabs { display: flex; gap: 6px; background: #e9ecef; padding: 4px; border-radius: 14px; margin: 22px 0 18px; }
.tab { flex: 1; padding: 10px 0; border-radius: 11px; font-size: 15px; font-weight: 600; color: var(--sub); }
.tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06); }

.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin-bottom: 14px; }
.card-title { font-size: 15px; color: var(--sub); font-weight: 600; margin-bottom: 10px; }
.amount { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; }
.amount small { font-size: 17px; color: var(--faint); font-weight: 600; margin-left: 6px; }
.bar { height: 10px; background: var(--bg); border-radius: 6px; margin: 16px 0 10px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 6px; transition: width .4s ease; }
.bar.warn > i { background: var(--red); }
.hint { font-size: 13px; color: var(--faint); line-height: 1.5; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 20px; }
.stat b { display: block; font-size: 24px; font-weight: 700; margin-top: 6px; }
.stat span { font-size: 14px; color: var(--sub); font-weight: 600; }

.list { background: var(--card); border-radius: var(--radius); padding: 8px 0; margin-bottom: 14px; }
.list-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px 6px; }
.list-head h3 { font-size: 17px; font-weight: 700; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px 24px; }
.row + .row { border-top: 1px solid #f2f4f6; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.avatar.off { background: var(--bg); color: var(--faint); }
.avatar.pc { border-radius: 13px; font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.name { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { font-size: 13px; color: var(--faint); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 8px; background: var(--bg); color: var(--sub); }
.chip.blue { background: var(--blue-soft); color: var(--blue); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }

/* 프로그램 안내 */
.body { font-size: 15px; line-height: 1.6; color: var(--text); }
.gap-top { margin-top: 10px; }
.bullets { margin: 0 0 0 20px; font-size: 15px; line-height: 1.6; }
.flow { margin: 0 0 0 22px; }
.flow li + li { margin-top: 14px; }
.flow .name, .kind .name { white-space: normal; flex-wrap: wrap; }
.family { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 18px; }
.family h3 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.kind { margin-top: 16px; }
.ref { display: block; max-width: 560px; margin-top: 12px; text-decoration: none; color: var(--text); background: var(--bg); border-radius: 14px; overflow: hidden; }
.ref img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.ref span { font-size: 14px; line-height: 1.45; padding: 10px 12px 12px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ref:hover { outline: 2px solid var(--blue-soft); }
.empty { text-align: center; color: var(--faint); font-size: 15px; padding: 34px 0; }
.right { text-align: right; font-size: 15px; font-weight: 600; }
.right .meta { text-align: right; }

.btn { height: 52px; border-radius: 14px; font-size: 17px; font-weight: 600; padding: 0 20px; transition: background .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-press); }
.btn.primary:disabled { background: #b8d4fb; cursor: default; }
.btn.grey { background: var(--grey-btn); color: var(--text); }
.btn.danger { background: var(--red); color: #fff; }
.btn.small { height: 38px; font-size: 14px; border-radius: 10px; padding: 0 14px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.more { color: var(--faint); font-size: 22px; width: 36px; height: 36px; border-radius: 10px; flex: none; }
.more:hover { background: var(--bg); }

.switch { position: relative; width: 52px; height: 32px; border-radius: 16px; background: #d1d6db; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); transition: transform .2s; }
.switch.on { background: var(--blue); }
.switch.on::after { transform: translateX(20px); }
.switch:disabled { opacity: .45; cursor: default; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: var(--sub); font-weight: 600; margin-bottom: 8px; }
.field input { width: 100%; height: 54px; border-radius: 14px; border: 1.5px solid var(--line); padding: 0 16px; font-size: 17px; background: #fff; outline: none; transition: border .15s; }
.field input:focus { border-color: var(--blue); }
.error { color: var(--red); font-size: 14px; min-height: 20px; margin: 4px 0 12px; }

.center-link { display: block; margin: 16px auto 0; }
/* 휴대폰 승인 로그인 (phone_approval.py): the QR stays black on white in dark mode too */
.qr { display: block; width: 232px; height: 232px; margin: 4px auto 14px; background: #fff; border-radius: 12px; }
.qr path { fill: #000; }
.warn { background: var(--red-soft); color: var(--red); border-radius: 14px; padding: 12px 14px; font-size: 14px; line-height: 1.5; margin-bottom: 18px; }

.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 420px; background: var(--card); border-radius: 26px; padding: 36px 30px; }
.login .title { font-size: 24px; margin-bottom: 8px; }
.login .caption { margin-bottom: 26px; }

.dim { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: flex; align-items: flex-end; justify-content: center; z-index: 10; }
.sheet { width: 100%; max-width: 520px; background: var(--card); border-radius: 26px 26px 0 0; padding: 30px 24px 26px; animation: up .22s ease; }
@media (min-width: 700px) { .dim { align-items: center; } .sheet { border-radius: 26px; } }
.sheet .title { font-size: 22px; margin: 0 0 8px; }
.sheet .caption { margin-bottom: 22px; }
@keyframes up { from { transform: translateY(24px); } to { transform: none; } }

.toast { position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); background: #333d4b; color: #fff; font-size: 15px; font-weight: 500; padding: 14px 22px; border-radius: 16px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.18); max-width: calc(100% - 40px); }
.day { font-size: 14px; font-weight: 700; color: var(--sub); padding: 16px 24px 4px; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .title { font-size: 23px; }
  .row { padding: 14px 18px; }
  .card { padding: 20px; }
}

/* 에디 홈페이지·블로그 — 기존 관리 화면 안의 읽기 전용 운영 안내 */
.tabs { overflow-x: auto; scrollbar-width: thin; }
.tab { flex: 0 0 auto; padding: 10px 12px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab:focus-visible, .eddy-guide a:focus-visible, .eddy-guide button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
/* 에디 tab, compact (2026-11-19 owner request: about 40% of the former height, every picture kept) */
.eddy-section { scroll-margin-top: 20px; padding: 18px 20px; margin-bottom: 10px; }
.eddy-card-no { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 8px; margin-right: 9px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 14px; font-weight: 800; vertical-align: middle; }
.eddy-section h2 { font-size: 18px; line-height: 1.4; margin-bottom: 10px; letter-spacing: -.035em; text-wrap: balance; }
.eddy-section h3 { font-size: 15px; line-height: 1.4; font-weight: 650; margin-bottom: 2px; }
.eddy-text { font-size: 14px; line-height: 1.55; color: var(--sub); }
.eddy-links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0; }
.eddy-link { color: #1765bb; font-size: 14px; line-height: 1.6; text-underline-offset: 3px; overflow-wrap: anywhere; }
.eddy-link:hover { color: var(--blue-press); }
.eddy-jump { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.eddy-jump a { font-size: 13px; color: var(--sub); text-underline-offset: 3px; }
.eddy-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 10px; }
.eddy-overview dt { font-size: 15px; font-weight: 650; }
.eddy-overview dt span { display: inline-block; font-size: 12px; color: var(--sub); font-weight: 500; margin-left: 8px; }
.eddy-overview dd { font-size: 13px; line-height: 1.5; color: var(--sub); margin-top: 2px; }
.eddy-split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.eddy-split > .eddy-shot { grid-column: 2; grid-row: 1; }
.eddy-split > div { grid-column: 1; grid-row: 1; }
.eddy-split:has(.eddy-shot.open) { grid-template-columns: minmax(0, 1fr); }
.eddy-split:has(.eddy-shot.open) > .eddy-shot { grid-column: 1; grid-row: 2; }
.eddy-shot { margin: 0; }
.eddy-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); cursor: zoom-in; }
.eddy-shot.open img { cursor: zoom-out; }
.eddy-shot figcaption { font-size: 12px; line-height: 1.5; color: var(--sub); margin-top: 4px; }
.eddy-flow { list-style: none; }
.eddy-flow li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 8px; padding-bottom: 9px; }
.eddy-flow li:last-child { padding-bottom: 0; }
.eddy-number { font-size: 12px; font-weight: 650; color: var(--blue-press); font-variant-numeric: tabular-nums; border-top: 2px solid var(--blue); padding-top: 3px; }
.eddy-where { display: inline-block; font-size: 12px; font-weight: 500; color: var(--sub); margin-left: 8px; }
.eddy-callout { font-size: 13px; line-height: 1.55; padding: 8px 12px; margin-bottom: 12px; border-left: 3px solid var(--blue); background: var(--blue-soft); border-radius: 0 8px 8px 0; }
.eddy-sub { margin-top: 12px; }
.eddy-bullets { margin: 4px 0 0 18px; font-size: 13px; line-height: 1.55; color: var(--sub); columns: 2 260px; column-gap: 28px; }
.eddy-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 18px; }
.eddy-copy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.eddy-copy code, .eddy-files code { font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; word-break: break-word; user-select: text; }
.eddy-copy code { flex: 1 1 260px; }
.eddy-files { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 18px; margin-bottom: 8px; }
.eddy-files > div { padding: 6px 0; border-bottom: 1px solid var(--line); }
.eddy-files dt { font-size: 13px; font-weight: 600; }
.eddy-files dd { color: var(--sub); }
@media (max-width: 720px) {
  .eddy-section { padding: 14px; }
  .eddy-split { display: flow-root; }
  .eddy-split > .eddy-shot { float: right; width: 46%; margin: 2px 0 6px 12px; }
  .eddy-split > .eddy-shot.open { float: none; width: 100%; margin: 0 0 10px; }
  .eddy-shot figcaption { font-size: 11px; line-height: 1.35; }
  .eddy-text, .eddy-bullets { font-size: 13px; line-height: 1.5; }
  .eddy-flow li { padding-bottom: 7px; }
  .eddy-files > div { display: flex; flex-wrap: wrap; gap: 0 8px; padding: 4px 0; }
  .eddy-files dt { font-size: 12px; }
  .eddy-copy code, .eddy-files code { font-size: 11px; line-height: 1.5; }
  .eddy-copy { padding: 8px 10px; margin: 8px 0; }
  .eddy-section h2 { font-size: 16px; margin-bottom: 8px; }
  .eddy-card-no { min-width: 24px; height: 24px; font-size: 13px; margin-right: 7px; }
  .eddy-overview { gap: 6px; margin-top: 8px; }
  .eddy-overview dd { font-size: 12.5px; }
  .eddy-links { margin: 6px 0; }
  .eddy-jump { padding: 6px 0; gap: 4px 12px; }
}
@media (prefers-reduced-motion: reduce) { .eddy-guide * { scroll-behavior: auto; } }
