/* 단지별·구별 관리비 페이지 (src/apt-pages.mjs). 색·글꼴은 /apt/ 정적 화면(apt-src/preview/template.html)과 같아요. */
:root {
  --bg: #fbfcfe; --fg: #18202c; --muted: #5f6b7d; --line: #e3e8f0; --card: #f1f4f9; --paper: #ffffff;
  --accent: #2c5bd6; --up: #c8322b; --down: #16824a; --peer: #c3ccda; --c-ind: #d08a1e; --c-ltrr: #6f7f9c;
  --body: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10141b; --fg: #e4e9f1; --muted: #98a3b4; --line: #262e3a; --card: #171d26; --paper: #19202b;
  --accent: #6f97ff; --up: #ff7b72; --down: #4fd18b; --peer: #445063; --c-ind: #e9b45a; --c-ltrr: #9aa9c4; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #10141b; --fg: #e4e9f1; --muted: #98a3b4; --line: #262e3a; --card: #171d26; --paper: #19202b;
  --accent: #6f97ff; --up: #ff7b72; --down: #4fd18b; --peer: #445063; --c-ind: #e9b45a; --c-ltrr: #9aa9c4; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 15px; line-height: 1.65; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 860px; margin: 0 auto; padding-inline: 16px; }
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding-block: 12px; }
.logo { font-weight: 700; font-size: 18px; color: var(--fg); }
.hub { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; margin-left: auto; }
.top nav a { color: var(--muted); }
main { padding-block: 16px 40px; }
h1, h2 { line-height: 1.3; word-break: keep-all; text-wrap: balance; }
h1 { font-size: 26px; margin: 6px 0 6px; }
h2 { font-size: 19px; margin: 30px 0 10px; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.up { color: var(--up); } .down { color: var(--down); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 4px; }
.crumbs a { color: var(--muted); }
.verdict { border-radius: 14px; padding: 14px 18px; margin: 16px 0; background: var(--card); border-left: 6px solid var(--muted); }
.verdict.over { border-left-color: var(--up); } .verdict.under { border-left-color: var(--down); }
.verdict .big { font-size: 21px; font-weight: 700; margin: 0 0 4px; }
.verdict.over .big { color: var(--up); } .verdict.under .big { color: var(--down); }
.verdict p { margin: 4px 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 16px 0; }
.stat { background: var(--card); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }
.stat strong { font-size: 20px; line-height: 1.25; }
.stat em { font-style: normal; font-size: 12px; color: var(--muted); }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 12px; color: var(--muted); font-weight: 500; }
th:first-child, td:first-child { text-align: left; white-space: normal; word-break: keep-all; }
tr.sum td { font-weight: 700; }
td.bars { width: 26%; text-align: left; }
.bar { display: block; height: 6px; border-radius: 3px; margin: 2px 0; }
.bar.mine, .legend i.mine { background: var(--accent); } .bar.peer, .legend i.peer { background: var(--peer); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--accent); }
.sw.individual { background: var(--c-ind); } .sw.ltrr { background: var(--c-ltrr); }
.cta { background: var(--card); border-radius: 14px; padding: 4px 18px 16px; margin-top: 28px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; color: var(--fg); background: var(--paper); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 24px; }
.split h2 { font-size: 16px; }
ol.top { list-style: none; padding: 0; margin: 0; counter-reset: n; }
ol.top li { counter-increment: n; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
ol.top li::before { content: counter(n); color: var(--muted); font-size: 13px; }
ol.top a { color: var(--fg); font-weight: 500; overflow-wrap: anywhere; }
ol.top .sub { display: block; font-size: 12px; color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding-block: 16px; font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  td.bars, th.bars { display: none; }
  th, td { padding: 6px 4px; }
  h1 { font-size: 23px; }
  .top nav { margin-left: 0; }
}
