/* 월세 도장 장부 — 기기 기본 글꼴만 쓴다. 외부 자원 없음. */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #111111;
  --muted: #333333;
  --paper: #ffffff;
  --soft: #f3f1ea;
  --line: #8a8579;
  --brand: #8b1a1a;
  --brand-ink: #ffffff;
  --ok: #0b5d1e;
  --late: #a10000;
  --late-bg: #fff0ee;
  --focus: #1846c7;
}

html { font-size: 18px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--brand); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 0.6rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 0.8rem; }

/* ---------- 맨 위 줄 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 0.5rem 1rem;
}
.topbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  min-width: 44px;
  color: var(--brand);
  font-weight: 800;
  font-size: 1.2rem;
  text-decoration: none;
}
.logo-mark { flex: none; }
.demo-flag {
  margin-left: auto;
  padding: 0.15rem 0.6rem;
  border: 2px solid var(--brand);
  border-radius: 999px;
  color: var(--brand);
  font-weight: 700;
}

.btn, .tab, .cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 44px;
  padding: 0.4rem 1rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn {
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
}
.btn-reset { background: var(--soft); }
.topbar-actions { margin-top: 0.4rem; }

.summary {
  margin: 0.5rem 0;
  font-size: 1.15rem;
  font-weight: 800;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.tab {
  border: 2px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.15rem;
}
.tab.is-active {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 본문 ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
}

.hero { padding: 1rem 0 1.5rem; }
.headline { font-size: 1.8rem; }
.lead { font-size: 1.15rem; color: var(--muted); }

.badges {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  padding: 0.3rem 0.8rem;
  border: 2px solid var(--ok);
  border-radius: 999px;
  color: var(--ok);
  font-weight: 700;
  background: #effaf1;
}

.cta {
  min-height: 60px;
  width: 100%;
  margin: 0.5rem 0;
  background: var(--brand);
  color: var(--brand-ink);
  border: 2px solid var(--brand);
  font-size: 1.3rem;
}
.cta-secondary { margin-top: 1rem; }

.features, .plans { padding: 1.5rem 0; border-top: 1px solid var(--line); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.feature {
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.feature p { margin: 0; }

.note { color: var(--muted); }

.table-wrap { overflow-x: auto; }
.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}
.plan-table th, .plan-table td {
  border: 1px solid var(--line);
  padding: 0.6rem;
  text-align: left;
  vertical-align: top;
}
.plan-table thead th { background: var(--soft); }

.footer {
  border-top: 2px solid var(--ink);
  padding: 1rem;
  background: var(--soft);
}
.notice { max-width: 1100px; margin: 0 auto; font-weight: 700; }

/* ---------- 데모: 건물 ---------- */
.month { font-size: 1.1rem; color: var(--muted); font-weight: 700; }
.floor { margin: 1rem 0 1.5rem; }
.floor-title { border-left: 6px solid var(--ink); padding-left: 0.5rem; }
.room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.room-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  min-height: 150px;
  padding: 0.8rem;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.room-card.is-unpaid { border-style: dashed; }
.room-card.is-paid { background: #effaf1; border-color: var(--ok); }
.room-no { font-size: 1.4rem; font-weight: 800; }
.room-tenant { font-weight: 700; }
.room-rent { font-size: 1rem; }
.room-state { font-weight: 800; }
.room-state.is-late { color: var(--late); }
.room-hint { font-size: 1rem; color: var(--muted); }
.stamp {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--brand);
  border-radius: 50%;
  color: var(--brand);
  font-weight: 900;
  font-size: 1.1rem;
  transform: rotate(-14deg);
  background: rgba(255, 255, 255, 0.85);
}
.is-paid .room-state { color: var(--ok); }
.is-paid .room-no, .is-paid .room-tenant { padding-right: 72px; }

/* ---------- 데모: 돈 · 관리 ---------- */
.money-total {
  font-size: 1.25rem;
  font-weight: 800;
  padding: 0.8rem;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--soft);
}
.due-list, .manage-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }
.due-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 0.8rem;
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 10px;
}
.due-item.is-late { border-color: var(--late); background: var(--late-bg); }
.due-item.is-done { display: block; border-color: var(--ok); color: var(--ok); font-weight: 700; }
.due-date { font-weight: 800; }
.due-room { font-weight: 700; }
.due-tag { font-weight: 800; }
.is-late .due-tag { color: var(--late); }

.manage-item {
  padding: 0.7rem 0.8rem;
  border: 2px solid var(--line);
  border-radius: 10px;
}
.manage-item.is-soon { border-color: var(--late); }
.manage-head { display: flex; flex-wrap: wrap; gap: 0.2rem 0.8rem; font-weight: 800; }
.is-soon .manage-end { color: var(--late); }
.manage-item p { margin: 0.2rem 0 0; }

/* ---------- 화면 폭 ---------- */
@media (max-width: 420px) {
  .headline { font-size: 1.55rem; }
  .topbar-actions .btn { flex: 1 1 auto; }
  .demo-flag { margin-left: 0; }
}

@media (min-width: 768px) {
  .headline { font-size: 2.4rem; }
  .cta { width: auto; padding: 0.6rem 2rem; }
  .feature-list { grid-template-columns: repeat(3, 1fr); }
  .room-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .due-item { grid-template-columns: 7rem 1fr 9rem 7rem; align-items: center; }
  .topbar { padding: 0.6rem 2rem; }
  .demo-topbar .topbar-row { display: inline-flex; vertical-align: middle; margin-right: 1rem; }
  .topbar-actions { margin-top: 0; }
  .tabs { max-width: 600px; }
}
