/* v3 */
/* 재민신용평가 design system v3 — a modern product app.
   Cool grey ground, white grouped surfaces, filled inputs, one blue accent,
   full-width primary actions, bottom tabs on phones. Tokens first; components through tokens. */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  color-scheme: light;
  --ground: #f4f6f9;
  --surface: #ffffff;
  --text: #1b2330;
  --text-2: #4e5968;
  --muted: #8b95a1;
  --hairline: #e9edf2;
  --fill: #eef1f5;
  --fill-2: #e3e8ee;
  --primary: #2f5bea;
  --primary-hover: #2749c4;
  --primary-soft: #e8eeff;
  --on-primary: #ffffff;
  --coin: #d9a21b;
  --coin-soft: #fff4d6;
  --coin-text: #8a6410;
  --ok: #1e9e6a;
  --ok-soft: #e3f5ec;
  --warn: #d9821b;
  --warn-soft: #fff1e0;
  --danger: #e5484d;
  --danger-soft: #fde8e9;
  --shadow-seg: 0 1px 2px rgba(27, 35, 48, .10), 0 2px 6px rgba(27, 35, 48, .06);
  --r-surface: 20px;
  --r-ctl: 12px;
  --r-btn: 14px;
  --gutter: 16px;
  --w: 600px;
  --w-wide: 1040px;
  --w-narrow: 520px;
  --tab-h: 60px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;

  /* aliases so earlier templates keep resolving */
  --bg: var(--ground); --paper: var(--ground); --panel: var(--surface);
  --ink: var(--text); --ink-2: var(--text-2); --sub: var(--text-2); --slate: var(--muted); --faint: var(--muted);
  --line: var(--hairline); --rule: var(--hairline); --line-2: var(--hairline); --wash: var(--fill);
  --accent: var(--primary); --accent-soft: var(--primary-soft); --accent-ink: var(--on-primary);
  --gold: var(--coin); --gold-soft: var(--coin-soft); --coin-wash: var(--coin-soft); --coin-ink: var(--coin-text);
  --seal: var(--danger); --neg: var(--warn);
  --prose: 36rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0f1216;
    --surface: #171b22;
    --text: #e8ecf1;
    --text-2: #b4bdc9;
    --muted: #7b8594;
    --hairline: #242a33;
    --fill: #222831;
    --fill-2: #2b323d;
    --primary: #6b8cff;
    --primary-hover: #86a1ff;
    --primary-soft: #1b2540;
    --on-primary: #0f1216;
    --coin: #e0b244;
    --coin-soft: #2c2512;
    --coin-text: #e6c76a;
    --ok: #4fc08d;
    --ok-soft: #14291f;
    --warn: #eaa04a;
    --warn-soft: #2e2314;
    --danger: #ff6b70;
    --danger-soft: #3a1c1e;
    --shadow-seg: 0 1px 2px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0f1216;
  --surface: #171b22;
  --text: #e8ecf1;
  --text-2: #b4bdc9;
  --muted: #7b8594;
  --hairline: #242a33;
  --fill: #222831;
  --fill-2: #2b323d;
  --primary: #6b8cff;
  --primary-hover: #86a1ff;
  --primary-soft: #1b2540;
  --on-primary: #0f1216;
  --coin: #e0b244;
  --coin-soft: #2c2512;
  --coin-text: #e6c76a;
  --ok: #4fc08d;
  --ok-soft: #14291f;
  --warn: #eaa04a;
  --warn-soft: #2e2314;
  --danger: #ff6b70;
  --danger-soft: #3a1c1e;
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, .5);
}

/* ---------- reset & type ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%;
  background: var(--ground); color: var(--text);
  font: 400 16px/1.55 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.02em; line-height: 1.25; text-wrap: balance; color: var(--text); }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; }
h3 { font-size: 17px; font-weight: 600; }
@media (min-width: 720px) { h1 { font-size: 32px; } }
p { margin: 0; max-width: var(--prose); }
p + p { margin-top: 8px; }
ul, ol { margin: 0; padding-left: 1.25em; }
li + li { margin-top: 6px; }
strong, b { font-weight: 700; }
code { font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-all; }
hr { border: 0; border-top: 1px solid var(--hairline); margin: 20px 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }
button, input, select, textarea { font: inherit; letter-spacing: inherit; color: inherit; }
.tabular, .pid, .value, .when, .num, time { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.topbar .in {
  max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--gutter);
  height: 56px; display: flex; align-items: center; gap: 8px;
}
main.wrap.wide ~ .foot .in, .topbar.wide .in { max-width: var(--w-wide); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 17px; letter-spacing: -.02em; margin-right: auto; min-height: 44px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; display: block; border-radius: 8px; }
.nav { display: none; align-items: center; gap: 2px; }
.nav a { display: inline-flex; align-items: center; white-space: nowrap; flex: 0 0 auto; min-height: 40px; padding: 0 10px; border-radius: 10px; color: var(--text-2); font-weight: 600; font-size: 15px; }
.nav a:hover { background: var(--fill); text-decoration: none; color: var(--text); }
.nav a.on { color: var(--primary); }
.nav a.quiet { color: var(--muted); font-weight: 500; }
.page-action { display: inline-flex; align-items: center; gap: 6px; }
.page-action a, .page-action button { min-height: 40px; }
@media (min-width: 720px) {
  .nav { display: flex; }
  .page-action .mobile-only { display: none; }
}
.menu { display: none; }
.announce { display: block; background: var(--primary-soft); color: var(--primary); border-top: 1px solid var(--hairline); }
.announce:hover { text-decoration: none; }
.announce .in { max-width: var(--w-wide); margin: 0 auto; padding: 0 var(--gutter); min-height: 40px; display: flex; align-items: center; gap: 10px; font-size: 14px; }
.announce .tag { flex: 0 0 auto; font-size: 11.5px; font-weight: 800; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; background: var(--primary); color: #fff; }
.announce .text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.announce .date { flex: 0 0 auto; color: var(--text-2); font-size: 12.5px; }

/* ---------- bottom tab bar (phones) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .in { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: var(--tab-h); max-width: var(--w); margin: 0 auto; }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: 0; min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a:hover { text-decoration: none; }
.tabbar a svg { width: 24px; height: 24px; display: block; }
.tabbar a.on { color: var(--primary); }
@media (min-width: 720px) { .tabbar { display: none; } }

/* ---------- layout ---------- */
main.wrap {
  max-width: var(--w); margin: 0 auto;
  padding: 20px var(--gutter) 48px;
  display: flex; flex-direction: column; gap: 24px;
}
main.wrap.narrow { max-width: var(--w-narrow); }
main.wrap.wide { max-width: var(--w-wide); }
@media (max-width: 719.98px) {
  body.has-tabbar main.wrap { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 32px); }
}
@media (min-width: 720px) { main.wrap { padding-top: 32px; padding-bottom: 72px; gap: 28px; } }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px 16px; }
.page-head > div:first-child, .page-head .lead { flex: 1 1 280px; min-width: 0; }
.page-head h1 { margin-bottom: 6px; }
.page-head .desc, .page-head .lead p, p.lead { color: var(--text-2); font-size: 15px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.section { display: flex; flex-direction: column; gap: 10px; }
.section + .section { margin-top: 4px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 0 4px; }
.section-head h2 { display: inline-flex; align-items: baseline; gap: 8px; }
.section-head .count, h2 .count { color: var(--primary); font-weight: 700; font-size: 17px; }
.section-head .desc { flex-basis: 100%; min-width: 100%; color: var(--muted); font-size: 14px; margin-top: -4px; }
.section-head a.more { font-size: 14px; font-weight: 600; white-space: nowrap; }
.stack > * + * { margin-top: 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr; } .grid-3.keep { grid-template-columns: repeat(3, 1fr); } }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- surfaces ---------- */
.surface, .card {
  background: var(--surface); border-radius: var(--r-surface); padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.card.flat { background: var(--surface); }
.card.tint, .surface.tint { background: var(--fill); }
.card.hero { padding: 24px; gap: 16px; }
.card.pad-0, .surface.pad-0 { padding: 0; }
.card > .list, .surface > .list { margin: 0 -20px; }
.card.pad-0 > .list, .surface.pad-0 > .list { margin: 0; }
.card h2, .surface h2 { font-size: 19px; }
.card h3, .surface h3 { font-size: 16px; }
.card .hint, .surface .hint { color: var(--muted); font-size: 13px; }
.card > form { display: contents; }

/* ---------- identity ---------- */
.identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 800; font-size: 22px; letter-spacing: -.02em;
}
.avatar.gold { background: var(--coin-soft); color: var(--coin-text); }
.avatar.sm { width: 40px; height: 40px; font-size: 16px; }
.avatar.xs { width: 28px; height: 28px; font-size: 12px; }
.identity .who { min-width: 0; flex: 1; }
.identity .name { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.25; }
.identity .meta { color: var(--text-2); font-size: 14px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 2px 10px; }
.pid { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }

/* avatar chain of introduction */
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar { width: 28px; height: 28px; font-size: 11px; box-shadow: 0 0 0 2px var(--surface); }
.avatars .avatar + .avatar { margin-left: -8px; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; font-size: 14px; color: var(--text-2); }
.chain .node { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-weight: 600; min-height: 34px; }
.chain a.node:hover { text-decoration: none; background: var(--fill-2); color: var(--text); }
.chain .node i { width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: inline-grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; }
.chain .node.root i { background: var(--coin-soft); color: var(--coin-text); }
.chain .node.self { background: var(--primary-soft); color: var(--primary); }
.chain .node.self i { background: var(--primary); color: var(--on-primary); }
.chain .node.end { background: var(--text); color: var(--surface); }
.chain .node.end i { background: var(--surface); color: var(--text); }
.chain .arrow { display: inline-block; width: 14px; height: 14px; flex: 0 0 auto; color: var(--muted);
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat; }
.seal { display: none; }

/* ---------- lists & rows ---------- */
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-surface); overflow: hidden; }
.card .list, .surface .list { border-radius: 0; }
.list > li, .row {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 14px 20px; margin: 0;
}
.list > li + li::before, .row + .row::before {
  content: ""; position: absolute; left: 20px; right: 0; top: 0; border-top: 1px solid var(--hairline);
}
.list .main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.list .title { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; line-height: 1.35; }
.list .sub { color: var(--text-2); font-size: 14px; line-height: 1.45; }
.list .sub.meta { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.list .side { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; color: var(--text-2); font-size: 14px; }
.list .value { font-weight: 600; color: var(--text); }
.list.link > li, .row.link { -webkit-tap-highlight-color: transparent; cursor: pointer; }
.ranking { counter-reset: none; }
.ranking .rank { flex: 0 0 24px; text-align: center; font-weight: 800; font-size: 15px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ranking > li:nth-child(-n+3) .rank { color: var(--primary); }
.ranking > li.mine { background: var(--fill); }
.ranking .hint, .surface > .hint { margin: 12px 4px 0; }
.list.link > li:hover, .row.link:hover { background: var(--fill); }
.list.link > li:active, .row.link:active { background: var(--fill-2); }
.list.link > li::after, .row.link::after, .chev {
  content: ""; flex: 0 0 auto; width: 18px; height: 18px; color: var(--muted); background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E") center/contain no-repeat;
}
.list.link > li.no-chev::after { display: none; }
.list.link > li .side { position: relative; z-index: 1; }
a.cover { color: inherit; }
a.cover::after { content: ""; position: absolute; inset: 0; }
a.cover:hover { text-decoration: none; }
.list.link .title a:not(.cover) { position: relative; z-index: 1; }

.kv { display: grid; grid-template-columns: minmax(84px, max-content) 1fr; gap: 0 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); padding: 10px 0; }
.kv dd { margin: 0; padding: 10px 0; color: var(--text); font-weight: 500; overflow-wrap: anywhere; }
.kv dt + dd + dt, .kv dt + dd + dt + dd { border-top: 1px solid var(--hairline); }

/* ---------- chips, badges, notices ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--fill); color: var(--text-2); border-radius: 999px; padding: 5px 11px; font-size: 13px; font-weight: 600; line-height: 1.3; }
.chip.gold { background: var(--coin-soft); color: var(--coin-text); }
.chip.accent { background: var(--primary-soft); color: var(--primary); }
.chip.plain { background: transparent; color: var(--muted); padding-left: 0; font-weight: 500; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; line-height: 1.5; background: var(--fill); color: var(--text-2); white-space: nowrap; vertical-align: middle; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--primary-soft); color: var(--primary); }
.badge.neutral { background: var(--fill); color: var(--text-2); }
.notice { border-radius: 14px; padding: 14px 16px; font-size: 14.5px; line-height: 1.5; background: var(--fill); color: var(--text-2); }
.notice.info, .notice.accent { background: var(--primary-soft); color: var(--primary); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.flash { margin: 0; }
.empty { color: var(--muted); font-size: 15px; text-align: center; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: none; }
.empty .btn { width: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.ink-2 { color: var(--text-2); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- buttons ---------- */
.btn, button:not([class]) {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 52px; padding: 0 20px; border-radius: var(--r-btn); border: 0;
  font-size: 16px; font-weight: 700; cursor: pointer; white-space: nowrap;
  text-decoration: none !important; transition: background .12s, transform .08s;
  -webkit-tap-highlight-color: transparent; background: var(--primary); color: var(--on-primary);
}
.btn:active, button:not([class]):active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--fill); color: var(--text); }
.btn.secondary:hover { background: var(--fill-2); }
.btn.ghost { background: transparent; color: var(--primary); }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, var(--danger-soft)); }
.btn.sm { width: auto; min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn-row .btn { width: auto; flex: 1 1 auto; }
.btn-row .btn.sm { flex: 0 0 auto; }
.btn-row.end { justify-content: flex-end; }
.btn-row.end .btn { flex: 0 0 auto; }
form.inline { display: inline; margin: 0; }
form.inline .btn { width: auto; }
.actions .btn, .side .btn { width: auto; }
.cta-bar {
  position: sticky; bottom: 0; z-index: 10; margin: 0 calc(-1 * var(--gutter));
  padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--hairline);
}
@media (max-width: 719.98px) { body.has-tabbar .cta-bar { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: 12px; } }
@media (min-width: 720px) { .cta-bar { position: static; margin: 0; padding: 0; background: transparent; border: 0; } }
.cta-bar .btn { width: 100%; }

/* social login */
.sso { display: flex; flex-direction: column; gap: 10px; }
.sso .btn { width: 100%; justify-content: center; position: relative; }
.sso .btn i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; font-style: normal; font-weight: 900; font-size: 12px; }
.sso .kakao { background: #fee500; color: #191919; }
.sso .kakao:hover { background: #f4dc00; }
.sso .kakao i { background: #191919; color: #fee500; }
.sso .naver { background: #03c75a; color: #fff; }
.sso .naver:hover { background: #02b351; }
.sso .naver i { background: #fff; color: #03c75a; }
.sso .google { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--fill-2); }
.sso .google:hover { background: var(--fill); }
.sso .google i { background: #fff; color: #4285f4; box-shadow: inset 0 0 0 1px #dadce0; }

/* ---------- forms ---------- */
form { margin: 0; }
.fields { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, label.lbl { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field > span em { font-style: normal; color: var(--primary); margin-left: 2px; }
.field .hint, .hint { color: var(--muted); font-size: 13px; line-height: 1.45; }
.field .error { color: var(--danger); font-size: 13px; }
input:not([type=checkbox]):not([type=radio]):not([type=hidden]), select, textarea {
  width: 100%; min-height: 52px; padding: 13px 16px;
  border: 0; border-radius: var(--r-ctl); background: var(--fill); color: var(--text);
  font-size: 16px; outline: none; box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow .12s, background .12s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select { appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px; }
textarea { min-height: 108px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--primary); }
input[aria-invalid="true"], .invalid input { box-shadow: 0 0 0 2px var(--danger); }
.form-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.form-foot .hint { margin-right: auto; }
.form-foot .btn { width: auto; }
.form-foot .btn.block { width: 100%; }
.search { display: flex; gap: 8px; align-items: center; }
.search input { flex: 1; padding-left: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px center; background-size: 20px; }
.search .btn { width: auto; min-height: 52px; padding: 0 18px; }
@media (max-width: 480px) { .search .btn { display: none; } }

/* segmented control */
.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; border-radius: var(--r-ctl); background: var(--fill); width: 100%; }
.seg label { position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 9px; font-size: 15px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background .12s, color .12s; }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow-seg); }
.seg input:checked + span.neg { color: var(--warn); }
.seg input:checked + span.pos { color: var(--ok); }
.seg input:focus-visible + span { box-shadow: 0 0 0 2px var(--primary); }
.score-view { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.score-view .cell { text-align: center; padding: 12px 4px; border-radius: 14px; background: var(--fill); display: flex; flex-direction: column; gap: 2px; }
.score-view .cell b { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: var(--text); font-variant-numeric: tabular-nums; }
.score-view .cell b.neg { color: var(--warn); }
.score-view .cell b.pos { color: var(--ok); }
.score-view .cell.none b { color: var(--muted); font-weight: 500; }
.score-view .cell small { color: var(--muted); font-size: 12px; font-weight: 600; }
.score-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 12px 0 0; padding: 10px 4px 0; border-top: 1px solid var(--hairline); font-size: 14px; color: var(--text-2); font-weight: 600; }
.score-total b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.score-total b.neg { color: var(--warn); }
.score-total b.pos { color: var(--ok); }
.score-form { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.score-form .btn.sm { justify-self: end; min-height: 44px; padding: 0 18px; }
.score-form .hint { margin: 0; }
@media (min-width: 640px) {
  .score-form { grid-template-columns: 120px 180px 1fr auto; align-items: end; }
  .score-form .hint { grid-column: 1 / -1; }
}
.score-log .delta { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; min-width: 44px; }
.score-log .delta.neg { color: var(--warn); }
.score-log .delta.pos { color: var(--ok); }

/* disclosure */
details.more { border-radius: 14px; background: var(--fill); }
details.more > summary { list-style: none; cursor: pointer; min-height: 48px; padding: 12px 16px; font-weight: 600; font-size: 15px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; -webkit-tap-highlight-color: transparent; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; width: 18px; height: 18px; color: var(--muted); background: currentColor; transition: transform .15s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center/contain no-repeat; }
details.more[open] > summary::after { transform: rotate(180deg); }
details.more > .body { padding: 4px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
details.more.danger > summary { color: var(--danger); }
details.more.danger { background: transparent; box-shadow: inset 0 0 0 1px var(--hairline); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline > li { display: grid; grid-template-columns: 56px 1fr; gap: 4px 14px; padding: 14px 0; }
.timeline > li + li { border-top: 1px solid var(--hairline); }
.timeline .when { grid-row: 1 / span 3; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.35; padding-top: 2px; }
.timeline .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 15px; }
.timeline .body { font-size: 15px; color: var(--text); max-width: none; }
.timeline .foot { color: var(--muted); font-size: 13px; }
.timeline > li.old { opacity: .55; }
.timeline > li.old .body { text-decoration: line-through; }
.timeline > li.bad .head { color: var(--danger); }
@media (min-width: 560px) { .timeline > li { grid-template-columns: 96px 1fr; } }

/* ---------- home widgets ---------- */
.stats { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface); border-radius: var(--r-surface); padding: 6px 0; }
.stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; color: var(--text); text-decoration: none !important; }
.stat + .stat { border-left: 1px solid var(--hairline); }
.stat b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; }
@media (max-width: 480px) { .stats { grid-auto-flow: row; grid-template-columns: repeat(2, 1fr); } .stat + .stat { border-left: 0; } }
.section > .stats { margin-bottom: 12px; }
table.members tr.muted td { color: var(--muted); }
.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(4, 1fr); } }
.quick a { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 16px; background: var(--surface); color: var(--text); min-height: 44px; -webkit-tap-highlight-color: transparent; }
.quick a:hover { text-decoration: none; background: var(--fill); }
.quick a:active { transform: scale(.98); }
.quick a b { font-size: 15px; font-weight: 700; }
.quick a span { color: var(--muted); font-size: 13px; line-height: 1.4; }
@media (max-width: 480px) { .quick a { padding: 14px 12px; } .quick a span { display: none; } }
.todo { background: var(--surface); border-radius: var(--r-surface); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.todo h2 .count { color: var(--primary); }
.todo .list { margin: 0 -20px; }
.todo .list > li { flex-direction: column; align-items: stretch; gap: 10px; }
.todo .list > li .btn-row .btn { flex: 1 1 auto; min-height: 44px; }

/* ---------- tables ---------- */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-surface); background: var(--surface); }
.card .scroll, .surface .scroll { margin: 0 -20px; border-radius: 0; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; position: sticky; top: 0; background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.members table { min-width: 880px; }
.members td, .log td { white-space: nowrap; }
.members td.name { font-weight: 700; }
.members td.name .badge { margin-left: 8px; }
.members td .contacts { display: grid; gap: 2px; font-size: 13px; color: var(--text-2); }
.members td .btn-row { gap: 6px; flex-wrap: nowrap; }
.log .when { color: var(--muted); font-size: 13px; }
.queue-item .kv { font-size: 14px; }
.queue-item .quote { font-size: 16px; color: var(--text); font-weight: 500; }
.queue-item .who { font-size: 15px; }
.decide { display: grid; gap: 12px; align-items: end; }
@media (min-width: 640px) { .decide { grid-template-columns: 1fr auto; } .decide .btn-row .btn { width: auto; flex: 0 0 auto; } }

/* ---------- landing ---------- */
.hero { padding: 8px 4px 0; display: flex; flex-direction: column; gap: 12px; }
.hero h1 { font-size: 32px; line-height: 1.2; }
@media (min-width: 720px) { .hero h1 { font-size: 40px; } }
.hero .tag { color: var(--text-2); font-size: 16px; }
.hero .wordmark { display: none; }
.three { background: var(--surface); border-radius: var(--r-surface); overflow: hidden; }
.three .q { display: flex; flex-direction: column; gap: 3px; padding: 16px 20px; }
.three .q + .q { border-top: 1px solid var(--hairline); }
.three .q b { font-size: 16px; font-weight: 700; }
.three .q span { color: var(--text-2); font-size: 14px; }
.rules { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--r-surface); overflow: hidden; }
.rules li { margin: 0; padding: 14px 20px; font-size: 15px; color: var(--text); }
.rules li + li { border-top: 1px solid var(--hairline); }

/* ---------- guide ---------- */
.article { display: flex; flex-direction: column; gap: 16px; }
.article section { background: var(--surface); border-radius: var(--r-surface); padding: 20px; display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 72px; }
.article h2 { font-size: 18px; display: flex; align-items: baseline; gap: 8px; }
.article h2 .no { color: var(--primary); font-variant-numeric: tabular-nums; }
.article p { color: var(--text-2); font-size: 15px; max-width: none; }
.article p a { font-weight: 600; }
.toc { background: var(--surface); border-radius: var(--r-surface); padding: 16px 20px; }
.toc b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.toc ol { columns: 2; column-gap: 20px; padding-left: 1.4em; font-size: 14px; }
.toc li { margin: 0 0 6px; break-inside: avoid; }
.toc a { color: var(--text); font-weight: 500; }
@media (max-width: 400px) { .toc ol { columns: 1; } }

/* ---------- footer ---------- */
footer.foot { max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter) 40px; color: var(--muted); font-size: 13px; }
footer.foot .in { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; padding-top: 8px; }
footer.foot a { color: var(--muted); }
footer.foot .op { margin-left: auto; }
@media (max-width: 719.98px) { body.has-tabbar footer.foot { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 24px); } }

/* ---------- notice pages ---------- */
.center { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.center h1 { font-size: 26px; }
.center .lead { color: var(--text-2); font-size: 15px; }
.center .mark { display: none; }
.center .btn-row .btn { flex: 1 1 auto; }
.linkbox { display: flex; flex-direction: column; gap: 10px; background: var(--fill); border-radius: 14px; padding: 14px 16px; }
.linkbox code { font-size: 14px; color: var(--text); word-break: break-all; }
.linkbox .btn { align-self: flex-start; }

/* ---------- graph ---------- */
.gbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.legend i.line { width: 18px; height: 0; border-radius: 0; border-top: 2px solid var(--muted); }
.legend i.line.dash { border-top-style: dashed; }
#gbox { position: relative; height: 68vh; min-height: 380px; border-radius: var(--r-surface); background: var(--surface); overflow: hidden; touch-action: none; }
#gsvg { width: 100%; height: 100%; display: block; cursor: grab; }
#gfallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 16px; text-align: center; }

/* ---- app pages (folded from _v3_extra) ---- */
.row.stack, .list > li.stack { flex-direction: column; align-items: stretch; gap: 10px; }
.row.stack .btn-row .btn, .list > li.stack .btn-row .btn { flex: 1 1 auto; }
.row.stack .notice { margin-top: 8px; }
.row.stack details.more { margin: 0 -16px -14px; }
.sub-h { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 20px 0 8px; }
.section-head + .sub-h { margin-top: 4px; }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; }
.surface.form, form.surface { padding: 20px; }
.surface.form .cta-bar, form.surface .cta-bar { margin: 16px -20px -20px; }
.page-head .chips { margin-top: 12px; }
.page-head .actions { margin-top: 14px; }
.list .side .value { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .avatar, .list > li > .avatar { flex: 0 0 auto; margin-right: 12px; }
.surface > .chain { margin-top: 12px; }
.timeline .foot { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.members td.num, .members th.num { text-align: right; font-variant-numeric: tabular-nums; }
.members td.name { font-weight: 600; white-space: nowrap; }
.members table { min-width: 880px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; font-size: 15px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.row .kv { margin-top: 8px; font-size: 14px; }
.timeline > li { grid-template-columns: 78px 1fr; }
.section-head + .hint { margin: -6px 4px 8px; }
.chip.region::before { content: "\1F4CD\00A0"; }
.sub .region { color: var(--text-2); }
.notice-body { white-space: pre-wrap; padding: 20px; font-size: 16px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.notice-body a { color: var(--primary); font-weight: 600; }
