/* 페이퍼로지(Paperlogy) — 사이트에 함께 넣어 둔 글꼴 */
@font-face { font-family: 'Paperlogy'; src: url('Paperlogy-4Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Paperlogy'; src: url('Paperlogy-5Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Paperlogy'; src: url('Paperlogy-7Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Paperlogy'; src: url('Paperlogy-8ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  /* 로고 색: 핫핑크 + 밀키 화이트 */
  --bg: #FFF4F8;
  --surface: #FFFFFF;
  --surface-2: #FFF0F6;
  --line: #F8D6E5;
  --line-strong: #F3AECB;
  --text: #2B1621;
  --text-2: #5A3A4A;
  --muted: #86647A;
  --faint: #957083;
  --violet: #E01A72;        /* 주 버튼 · 선택 (로고 진분홍) */
  --violet-soft: #FF7AB3;   /* 막대 그래프 */
  --violet-ink: #C8135F;    /* 링크 · 강조 글씨 */
  --gold: #E01A72;          /* 알림 · 약속 강조 */
  --gold-line: #F5A3C6;
  --gold-bg: #FFE4EF;
  --danger: #C0304C;
  --radius: 22px;
  --shadow: 0 6px 22px rgba(224, 26, 114, .08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; color: var(--text);
  background: linear-gradient(180deg, #FFE1EE 0, var(--bg) 320px) no-repeat, var(--bg);
  font-family: 'Paperlogy', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: 15px; line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--violet-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #FF9CC6; outline-offset: 2px; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.01em; }

.page { max-width: 520px; margin: 0 auto; padding: 24px 20px calc(110px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.head h1 { margin: 0; font-size: 23px; }
.sub { font-size: 13px; color: var(--muted); margin: 0; }
.muted { color: var(--muted); font-size: 13px; }
.faint { color: var(--faint); font-size: 12px; }
.center { text-align: center; }
.empty { color: var(--muted); text-align: center; padding: 24px 0; margin: 0; font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.card.strong { border-color: var(--line-strong); }
.card h2 { margin: 0; font-size: 16px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); }
.stat b { font-size: 17px; color: var(--text); font-weight: 800; }

.btn { min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--text); }
.btn.primary { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 700; box-shadow: 0 4px 12px rgba(224, 26, 114, .25); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn.danger { border-color: #F1B8C4; color: var(--danger); }
.btn.gold { border-color: var(--gold-line); color: var(--violet-ink); background: var(--gold-bg); }
.btn.gold.on { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 700; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.link { background: none; border: 0; color: var(--violet-ink); text-decoration: underline; cursor: pointer; padding: 4px; font-weight: 700; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip.on { background: var(--violet); border-color: var(--violet); color: #fff; font-weight: 700; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
input, select, textarea { min-height: 46px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 14px; font-size: 15px; color: var(--text); width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--violet-soft); outline: none; box-shadow: 0 0 0 3px #FFE0EE; }
textarea { padding: 12px 14px; line-height: 1.6; resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: #B9A0AD; }

.bar { height: 12px; border-radius: 999px; background: #FCE3EE; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #FF8FC0, #FF4F9A); }
.bar.gold > i { background: linear-gradient(90deg, #FF4F9A, #E01A72); }

.alert { display: flex; align-items: center; gap: 12px; background: var(--gold-bg); border: 1.5px solid var(--gold-line); border-radius: 18px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.alert .ico { color: var(--violet); }
.alert b { font-size: 14px; }
.alert span { font-size: 12px; color: var(--text-2); }
.calc { background: var(--surface-2); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.calc .row span:first-child { color: var(--muted); }
.calc .row span:last-child { white-space: nowrap; }
.calc hr { border: 0; border-top: 1.5px dashed var(--line-strong); margin: 2px 0; width: 100%; }
.calc .total { font-size: 17px; font-weight: 800; }
.calc .total span:last-child { color: var(--violet); }

/* 달력 */
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { text-align: center; font-size: 12px; color: var(--faint); font-weight: 500; }
.day { height: 52px; border-radius: 14px; border: 1.5px solid transparent; background: transparent; color: var(--faint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; padding: 0; }
.day small { font-size: 10px; color: var(--violet-ink); min-height: 14px; font-weight: 700; }
.day.has { background: var(--surface); border-color: var(--line-strong); color: var(--text); font-weight: 700; }
.day.today { border-color: var(--violet-soft); }
.day.sel { background: var(--violet); border-color: var(--violet); color: #fff; }
.day.sel small { color: #fff; }
.iconbtn { width: 44px; height: 44px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }

.item { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow); }
.card .item { background: var(--surface-2); box-shadow: none; }
.item .msg { font-size: 14px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.amount { color: var(--violet); font-weight: 800; }
.nick { background: none; border: 0; padding: 0; color: var(--violet-ink); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; height: 120px; }
.bars div { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; font-size: 10px; color: var(--text-2); }
.bars i { width: 100%; border-radius: 8px 8px 3px 3px; background: var(--violet-soft); min-height: 2px; }
.bars div.today i { background: var(--violet); }
.rank { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.rank em { font-style: normal; width: 26px; height: 26px; border-radius: 999px; background: var(--gold-bg); color: var(--violet); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rank span { flex: 1; }

/* 팬 */
.fan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fan { min-height: 80px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1.5px solid var(--line); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.fan.on { background: var(--gold-bg); border-color: var(--violet); }
.fan b { font-size: 14px; }
.fan span { font-size: 12px; color: var(--text-2); }
.fan .due { font-size: 11px; font-weight: 700; color: var(--violet); }
.fan .due.none { color: var(--faint); }
.promise { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 8px 12px; }
.check { width: 28px; height: 28px; flex: none; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); display: flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; font-weight: 800; }
.check.on { background: var(--violet); border-color: var(--violet); }
.promise .txt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.promise .txt small { font-size: 11px; color: var(--muted); }
.promise.done .txt > span { color: var(--faint); text-decoration: line-through; }

/* 제휴 */
.post { gap: 10px; }
.post.pinned { border-color: var(--violet-soft); border-width: 1.5px; }
.post img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; background: var(--surface-2); }
.post h3 { margin: 0; font-size: 17px; }
.post p { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.tag { font-size: 11px; font-weight: 800; color: #fff; background: var(--violet); border-radius: 999px; padding: 2px 9px; }
.benefit { font-size: 12px; font-weight: 700; color: var(--violet-ink); background: var(--gold-bg); border-radius: 999px; padding: 4px 10px; }

/* 로그인 */
.login { min-height: 100vh; justify-content: center; padding-bottom: 40px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; margin-bottom: 8px; }
.brand .logo-img { width: 132px; height: 132px; filter: drop-shadow(0 10px 20px rgba(224, 26, 114, .25)); }
.brand .lead { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.4; }

/* 하단 메뉴 */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 8px 4px calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 10; box-shadow: 0 -4px 18px rgba(224, 26, 114, .06); }
#tabs[hidden] { display: none; }
#tabs a { min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 500; color: var(--faint); text-decoration: none; }
#tabs a[aria-current="page"] { color: var(--violet); font-weight: 800; }
#tabs svg, .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

#toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 40px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* 약관·방침 문서 */
.doc { max-width: 720px; margin: 0 auto; padding: 32px 20px 64px; line-height: 1.75; }
.doc h1 { font-size: 26px; margin: 0 0 6px; }
.doc h2 { font-size: 17px; margin: 32px 0 8px; }
.doc p, .doc li { font-size: 15px; color: var(--text-2); }
.doc ul, .doc ol { padding-left: 22px; }
.doc .table { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; background: var(--surface); }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; color: var(--text-2); }
.doc th { background: var(--surface-2); color: var(--text); }
.legal-links { display: flex; justify-content: center; gap: 16px; font-size: 12px; flex-wrap: wrap; }
.legal-links a { color: var(--faint); }
