/* =====================================================================
   Premier Welfare — design system
   Mobile-first · light & dark · no framework
   ===================================================================== */

:root {
  --brand: #C8102E;
  --brand-ink: #fff;
  --brand-600: color-mix(in oklab, var(--brand) 86%, #000);
  --brand-700: color-mix(in oklab, var(--brand) 70%, #000);
  --brand-soft: color-mix(in oklab, var(--brand) 9%, var(--surface));
  --brand-soft-2: color-mix(in oklab, var(--brand) 16%, var(--surface));

  --bg: #F5F4F1;
  --surface: #FFFFFF;
  --surface-2: #FAF9F7;
  --surface-3: #F1EFEB;
  --border: #E7E4DF;
  --border-2: #D9D5CE;
  --text: #15171C;
  --text-2: #4C515A;
  --text-3: #858A93;

  --success: #0E7D55; --success-soft: #E4F5EC;
  --warning: #A86600; --warning-soft: #FDF1DC;
  --danger:  #C62828; --danger-soft:  #FDE8E6;
  --info:    #2563C9; --info-soft:    #E6EEFB;
  --gold: #B8860B;

  --s1: #2a78d6; --s1-track: #cde2fb; --s2: #eb6834;
  --grid: #ECE9E4;

  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --shadow-sm: 0 1px 2px rgba(20, 16, 10, .05);
  --shadow: 0 1px 2px rgba(20, 16, 10, .04), 0 4px 16px -6px rgba(20, 16, 10, .10);
  --shadow-lg: 0 10px 40px -10px rgba(20, 16, 10, .25);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D0E11; --surface: #16181D; --surface-2: #1C1F25; --surface-3: #23262D;
    --border: #282C34; --border-2: #343944;
    --text: #F2F3F5; --text-2: #B3B8C2; --text-3: #7B818C;
    --success: #3CC48A; --success-soft: #11291F;
    --warning: #E8A73A; --warning-soft: #2C2210;
    --danger: #F2685E; --danger-soft: #331716;
    --info: #6FA1F5; --info-soft: #14223A;
    --s1: #3987e5; --s1-track: #1d3556; --s2: #d95926; --grid: #262A31;
    --brand-soft: color-mix(in oklab, var(--brand) 18%, var(--surface));
    --brand-soft-2: color-mix(in oklab, var(--brand) 28%, var(--surface));
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -8px rgba(0,0,0,.5);
    --shadow-lg: 0 10px 40px -10px rgba(0,0,0,.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0D0E11; --surface: #16181D; --surface-2: #1C1F25; --surface-3: #23262D;
  --border: #282C34; --border-2: #343944;
  --text: #F2F3F5; --text-2: #B3B8C2; --text-3: #7B818C;
  --success: #3CC48A; --success-soft: #11291F;
  --warning: #E8A73A; --warning-soft: #2C2210;
  --danger: #F2685E; --danger-soft: #331716;
  --info: #6FA1F5; --info-soft: #14223A;
  --s1: #3987e5; --s1-track: #1d3556; --s2: #d95926; --grid: #262A31;
  --brand-soft: color-mix(in oklab, var(--brand) 18%, var(--surface));
  --brand-soft-2: color-mix(in oklab, var(--brand) 28%, var(--surface));
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px -8px rgba(0,0,0,.5);
  --shadow-lg: 0 10px 40px -10px rgba(0,0,0,.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0 0 .75em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
small { font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
.i { width: 20px; height: 20px; flex: none; }
.muted { color: var(--text-3); }
.text-2 { color: var(--text-2); }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.hide-sm { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2.5px solid color-mix(in oklab, var(--brand) 70%, transparent); outline-offset: 2px; border-radius: 6px; }
.only-dark { display: none; }
:root[data-theme="dark"] .only-dark { display: block; } :root[data-theme="dark"] .only-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .only-dark { display: block; } :root:not([data-theme="light"]) .only-light { display: none; } }

/* ------------------------------------------------------------ shell */
.app { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 12px 10px 12px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 18px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title p { margin: 0; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 4px; flex: none; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  color: var(--text-2); background: transparent; border: 0; cursor: pointer; transition: background .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.back-btn { background: var(--surface); box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.dot-badge { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.avatar-btn { margin-left: 2px; border-radius: 99px; }
.brand-mini { display: flex; }
.brand-mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; box-shadow: 0 6px 16px -6px color-mix(in oklab, var(--brand) 70%, transparent); }
.brand-mark svg { width: 26px; height: 26px; color: #fff; --brand-ink: var(--brand); }
.brand-mark.sm { width: 36px; height: 36px; border-radius: 11px; }
.brand-mark.sm svg { width: 22px; height: 22px; }
.mode-switch {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; margin-right: 2px; border-radius: 99px;
  font-size: 12.5px; font-weight: 650; color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in oklab, var(--brand) 20%, transparent);
}
.mode-switch .i { width: 16px; height: 16px; }
.mode-switch span { display: none; }
@media (min-width: 400px) { .mode-switch span { display: inline; } }
.is-committee .topbar { background: color-mix(in oklab, var(--bg) 82%, transparent); }

.content { padding: 8px 16px calc(var(--tabbar-h) + var(--safe-b) + 28px); max-width: 1120px; margin: 0 auto; }
.content.wide { max-width: 1400px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: color-mix(in oklab, var(--surface) 90%, transparent);
  backdrop-filter: saturate(1.8) blur(18px); -webkit-backdrop-filter: saturate(1.8) blur(18px);
  border-top: 1px solid var(--border);
}
.tab {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .01em;
}
.tab .i { width: 23px; height: 23px; transition: transform .2s; }
.tab.active { color: var(--brand); }
.tab.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
.tab:active .i { transform: scale(.88); }
.tab-badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10px; display: grid; place-items: center; border: 2px solid var(--surface); }

@media (min-width: 1024px) {
  .hide-sm { display: revert !important; }
  .hide-lg { display: none !important; }
  .app { display: grid; grid-template-columns: 272px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow: hidden;
    background: var(--surface); border-right: 1px solid var(--border);
  }
  .brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; }
  .brand-text { display: flex; flex-direction: column; min-width: 0; }
  .brand-text strong { font-size: 15px; font-weight: 750; line-height: 1.2; }
  .brand-text small { color: var(--text-3); font-style: italic; }
  .side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 16px; scrollbar-width: thin; }
  .side-group { margin-top: 14px; }
  .side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); padding: 0 10px 6px; }
  .side-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-weight: 550; font-size: 14px; transition: background .12s, color .12s; }
  .side-link .i { width: 19px; height: 19px; color: var(--text-3); }
  .side-link:hover { background: var(--surface-3); color: var(--text); }
  .side-link.active { background: var(--brand-soft); color: var(--brand); }
  .side-link.active .i { color: var(--brand); }
  .side-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
  .side-user { display: flex; align-items: center; gap: 10px; margin: 8px 12px 14px; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
  .side-user > span:not(.avatar) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .side-user strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-user small { color: var(--text-3); }
  .side-user > .i { color: var(--text-3); width: 18px; }
  .tabbar { display: none; }
  .topbar { padding: 16px 32px; }
  .topbar-title h1 { font-size: 22px; }
  .brand-mini { display: none; }
  .avatar-btn { display: none; }
  .content { padding: 8px 32px 48px; }
}

/* ------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card + .card, .card + .section, .section + .card, .grid + .card, .card + .grid { margin-top: 16px; }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 700; }
.card-head .sub { font-size: 12.5px; color: var(--text-3); }
.card-body { padding: 14px 18px 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.card.flush .li { padding-left: 18px; padding-right: 18px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 2px 10px; }
.section-head h2 { font-size: 16px; font-weight: 750; }
.section-head a { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; font-weight: 650; color: var(--brand); }
.section-head a .i { width: 16px; height: 16px; }
.grid { display: grid; gap: 12px; }
.g2, .g3, .g4 { grid-template-columns: 1fr; }
.g2-sm { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .g2 { grid-template-columns: 1fr 1fr; } .g3 { grid-template-columns: repeat(2, 1fr); } .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .g3 { grid-template-columns: repeat(3, 1fr); } .g4 { grid-template-columns: repeat(4, 1fr); } .grid { gap: 16px; } .split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; } .split > .card + .card { margin-top: 0; } }
.stack > * + * { margin-top: 16px; }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 20px; color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--brand) 55%, #ff9a6b) 0%, transparent 55%),
    linear-gradient(145deg, var(--brand) 0%, var(--brand-700) 100%);
  box-shadow: 0 18px 40px -18px color-mix(in oklab, var(--brand) 80%, transparent);
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 200px; height: 200px; border-radius: 50%; border: 28px solid rgba(255,255,255,.07); }
.hero .hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.hero-label { font-size: 13px; font-weight: 600; opacity: .85; }
.hero-amount { font-size: 38px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 8px 0 4px; position: relative; z-index: 1; }
.hero-amount small { font-size: 16px; font-weight: 600; opacity: .8; margin-right: 4px; }
.hero-sub { font-size: 13.5px; opacity: .9; position: relative; z-index: 1; }
.hero .btn-row { margin-top: 18px; position: relative; z-index: 1; }
.hero .btn { background: #fff; color: var(--brand-700); border-color: #fff; }
.hero .btn.glass { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }
.pill-glass { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.25); }
.pill-glass .i { width: 14px; height: 14px; }
.hero.calm { background: linear-gradient(145deg, #1e5b45, #0f3a2c); box-shadow: 0 18px 40px -18px rgba(14, 90, 60, .7); }
.hero.warn { background: linear-gradient(145deg, #b35c00, #7a3a00); }

.greet { margin: 6px 2px 16px; }
.greet h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.greet p { margin: 2px 0 0; color: var(--text-3); font-size: 13.5px; }
@media (min-width: 1024px) { .greet { display: none; } }

/* stats */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } .stats.s3 { grid-template-columns: repeat(3, 1fr); } }
.stat { position: relative; display: block; padding: 14px 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
a.stat:hover { border-color: var(--border-2); }
.stat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); margin-bottom: 10px; }
.stat-icon .i { width: 18px; height: 18px; }
.stat-label { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.stat.brand .stat-icon { background: var(--brand-soft); color: var(--brand); }
.stat.success .stat-icon { background: var(--success-soft); color: var(--success); }
.stat.warning .stat-icon { background: var(--warning-soft); color: var(--warning); }
.stat.danger .stat-icon { background: var(--danger-soft); color: var(--danger); }
.stat.info .stat-icon { background: var(--info-soft); color: var(--info); }

/* ------------------------------------------------------------ buttons */
.btn {
  --bb: var(--brand); --bc: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--bb);
  background: var(--bb); color: var(--bc); font: 650 14.5px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: transform .08s, filter .15s, background .15s; text-decoration: none; user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.98); }
.btn .i { width: 18px; height: 18px; }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--border-2); }
.btn.ghost:hover { background: var(--surface-3); filter: none; }
.btn.soft { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.btn.danger { --bb: var(--danger); }
.btn.success { --bb: var(--success); }
.btn.dark { --bb: var(--text); --bc: var(--surface); }
.btn.wa { --bb: #1FAF5A; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.xs { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 9px; gap: 5px; }
.btn.xs .i { width: 15px; height: 15px; }
.btn.lg { height: 52px; font-size: 16px; border-radius: 14px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row.end { justify-content: flex-end; }
.btn-row > .btn.grow { flex: 1; }
.link { color: var(--brand); font-weight: 650; }
.link:hover { text-decoration: underline; }

/* badges & chips */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 23px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.badge .i { width: 13px; height: 13px; }
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.muted { background: var(--surface-3); color: var(--text-3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--border-2); background: var(--surface); font-size: 13.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.chip.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.chip .count { font-size: 11.5px; opacity: .7; }
@media (min-width: 1024px) { .chips { margin: 0; padding-left: 0; padding-right: 0; flex-wrap: wrap; } }

/* avatar */
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; overflow: hidden; font-weight: 700; letter-spacing: .02em;
  color: hsl(var(--h) 45% 32%); background: hsl(var(--h) 60% 90%); }
:root[data-theme="dark"] .avatar { color: hsl(var(--h) 60% 82%); background: hsl(var(--h) 30% 22%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .avatar { color: hsl(var(--h) 60% 82%); background: hsl(var(--h) 30% 22%); } }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ------------------------------------------------------------ lists */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.list.plain { background: none; border: 0; box-shadow: none; border-radius: 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; position: relative; }
.li + .li::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--border); }
.list.plain .li { padding-left: 0; padding-right: 0; }
.list.plain .li + .li::before { left: 48px; }
a.li { transition: background .12s; }
a.li:hover { background: var(--surface-2); }
a.li:active { background: var(--surface-3); }
.li-lead { flex: none; display: flex; }
.li-body { flex: 1; min-width: 0; }
.li-title { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub { font-size: 12.8px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-sub.wrap, .li-title.wrap { white-space: normal; }
.li-trail { flex: none; text-align: right; font-size: 13px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.li-trail strong { font-size: 14.5px; }
.li-trail.chev { color: var(--text-3); }
.li-trail.chev .i { width: 18px; }
.li-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.li-icon .i { width: 20px; height: 20px; }
.li-icon.brand { background: var(--brand-soft); color: var(--brand); }
.li-icon.success { background: var(--success-soft); color: var(--success); }
.li-icon.warning { background: var(--warning-soft); color: var(--warning); }
.li-icon.danger { background: var(--danger-soft); color: var(--danger); }
.li-icon.info { background: var(--info-soft); color: var(--info); }
.li-icon.gold { background: color-mix(in oklab, var(--gold) 16%, var(--surface)); color: var(--gold); }
.li.unread .li-title::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 8px; vertical-align: middle; }

/* key-value rows */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; font-size: 14px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

/* quick actions */
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 12px; font-weight: 600; color: var(--text-2); position: relative; }
.qa-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); color: var(--brand); transition: transform .12s; }
.qa-icon .i { width: 24px; height: 24px; }
.qa:active .qa-icon { transform: scale(.93); }
.qa .tab-badge { top: -4px; left: calc(50% + 14px); }
@media (min-width: 1024px) { .quick { grid-template-columns: repeat(4, 1fr); max-width: 520px; } }

/* ------------------------------------------------------------ forms */
form { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; min-width: 0; }
.field label { font-size: 13.5px; font-weight: 650; color: var(--text-2); }
.field label em { font-style: normal; font-weight: 500; color: var(--text-3); font-size: 12px; margin-left: 4px; }
.field .hint { color: var(--text-3); font-size: 12.5px; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=month], input[type=search], input[type=url], textarea, select {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--text); font: 500 16px/1.35 var(--font); appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 96px; }
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 14%, transparent); }
input[type=date], input[type=datetime-local], input[type=month] { min-height: 48px; }
.select { position: relative; }
.select select { padding-right: 40px; }
.select .i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-3); }
.input-affix { display: flex; align-items: stretch; border: 1.5px solid var(--border-2); border-radius: 12px; background: var(--surface); overflow: hidden; }
.input-affix:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 14%, transparent); }
.input-affix span { display: grid; place-items: center; padding: 0 12px; background: var(--surface-3); color: var(--text-2); font-weight: 650; font-size: 14px; }
.input-affix input { border: 0; box-shadow: none !important; border-radius: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row strong { font-size: 14.5px; font-weight: 650; }
.toggle-row small { color: var(--text-3); }
.switch { appearance: none; -webkit-appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--border-2); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(20px); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--brand); margin: 1px 0 0; flex: none; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.form-actions .btn { flex: 1; }
@media (min-width: 640px) { .form-actions { justify-content: flex-end; } .form-actions .btn { flex: none; min-width: 140px; } }
.sticky-actions { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 5; padding: 10px; margin: 16px -10px 0; border-radius: 16px; background: color-mix(in oklab, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
@media (min-width: 1024px) { .sticky-actions { bottom: 12px; } }
.search { position: relative; }
.search .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 18px; }
.search input { padding-left: 42px; border-radius: 99px; min-height: 44px; background: var(--surface); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 200px; }

/* option cards (radio) */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 720px) { .options { grid-template-columns: repeat(3, 1fr); } }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.opt-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 14px; border-radius: 16px; border: 1.5px solid var(--border); background: var(--surface); transition: border-color .15s, background .15s, transform .1s; }
.opt-card .li-icon { width: 42px; height: 42px; }
.opt-card strong { font-size: 14px; line-height: 1.3; }
.opt-card small { color: var(--text-3); line-height: 1.35; }
.opt-card .amt { font-weight: 800; font-size: 15px; color: var(--text); margin-top: auto; }
.opt input:checked + .opt-card { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 14%, transparent); }
.opt input:focus-visible + .opt-card { outline: 2.5px solid var(--brand); outline-offset: 2px; }
.opt:active .opt-card { transform: scale(.98); }
.opt.row .opt-card { flex-direction: row; align-items: center; }

/* segmented */
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-3); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { flex: 1 0 auto; text-align: center; padding: 8px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 650; color: var(--text-2); white-space: nowrap; border: 0; background: none; cursor: pointer; font-family: inherit; }
.seg a.on, .seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .count { font-size: 11.5px; margin-left: 4px; padding: 1px 6px; border-radius: 99px; background: var(--brand); color: #fff; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: var(--surface-2); }
.t .num, .t td.num, .t th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.t tfoot td { font-weight: 750; background: var(--surface-2); border-top: 1px solid var(--border); }
.t .in { color: var(--success); } .t .out { color: var(--danger); }

/* contribution matrix */
.matrix-wrap { overflow: auto; max-height: 72vh; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); -webkit-overflow-scrolling: touch; }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.matrix th, .matrix td { padding: 6px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .03em; padding: 10px 6px; }
.matrix .mcol { position: sticky; left: 0; z-index: 1; background: var(--surface); text-align: left; padding: 8px 12px; min-width: 170px; max-width: 200px; border-right: 1px solid var(--border); }
.matrix thead .mcol { z-index: 3; background: var(--surface-2); }
.matrix .mcol a { display: flex; align-items: center; gap: 8px; font-weight: 650; overflow: hidden; }
.matrix .mcol a span { overflow: hidden; text-overflow: ellipsis; }
.matrix tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 750; font-size: 12px; border-top: 1px solid var(--border); }
.matrix tfoot .mcol { z-index: 2; background: var(--surface-2); }
.cell { display: inline-grid; place-items: center; width: 34px; height: 30px; border-radius: 8px; font-size: 11px; font-weight: 750; border: 0; cursor: default; font-family: inherit; }
button.cell { cursor: pointer; }
.cell .i { width: 15px; height: 15px; }
.cell.paid { background: var(--success-soft); color: var(--success); }
.cell.partial { background: var(--warning-soft); color: var(--warning); }
.cell.unpaid { background: var(--danger-soft); color: var(--danger); }
.cell.due { background: transparent; color: var(--text-3); box-shadow: inset 0 0 0 1.5px var(--border-2); }
.cell.na, .cell.future { background: transparent; color: var(--border-2); }
.cell.waived { background: var(--info-soft); color: var(--info); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--text-2); margin: 10px 2px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 22px; height: 18px; }
.legend .key { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* my months strip */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.month { border-radius: 12px; padding: 10px 6px; text-align: center; border: 1.5px solid var(--border); background: var(--surface); }
.month b { display: block; font-size: 13px; }
.month small { font-size: 11px; color: var(--text-3); }
.month .i { width: 16px; height: 16px; margin: 4px auto 0; }
.month.paid { background: var(--success-soft); border-color: transparent; color: var(--success); }
.month.paid small { color: var(--success); opacity: .8; }
.month.partial { background: var(--warning-soft); border-color: transparent; color: var(--warning); }
.month.unpaid { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.month.due { border-style: dashed; }
.month.waived { background: var(--info-soft); border-color: transparent; color: var(--info); }

/* ------------------------------------------------------------ misc widgets */
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--brand); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.progress.success span { background: var(--success); }
.progress.warning span { background: var(--warning); }
.progress.danger span { background: var(--danger); }
.progress.info span { background: var(--s1); }
.hero .progress { background: rgba(255,255,255,.2); } .hero .progress span { background: #fff; }
.donut { position: relative; display: inline-grid; place-items: center; flex: none; }
.donut svg { position: absolute; inset: 0; }
.donut circle { fill: none; stroke-width: 10; }
.donut-track { stroke: var(--surface-3); }
.donut-fill { stroke: var(--success); stroke-linecap: round; transition: stroke-dasharray .8s; }
.donut span { font-weight: 800; font-size: 18px; position: relative; }

.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--info-soft); color: var(--text); font-size: 14px; }
.callout > .i { color: var(--info); margin-top: 1px; }
.callout.warning { background: var(--warning-soft); } .callout.warning > .i { color: var(--warning); }
.callout.danger { background: var(--danger-soft); } .callout.danger > .i { color: var(--danger); }
.callout.success { background: var(--success-soft); } .callout.success > .i { color: var(--success); }
.callout.brand { background: var(--brand-soft); } .callout.brand > .i { color: var(--brand); }
.callout p { margin: 0; }
.callout strong { display: block; margin-bottom: 2px; }
.callout + .callout, .callout + .card, .card + .callout { margin-top: 12px; }

.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.checks li:last-child { border-bottom: 0; }
.checks .ck { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.checks .ck .i { width: 15px; height: 15px; }
.checks .pass .ck { background: var(--success-soft); color: var(--success); }
.checks .warn .ck { background: var(--warning-soft); color: var(--warning); }
.checks .fail .ck { background: var(--danger-soft); color: var(--danger); }
.checks strong { display: block; font-weight: 650; }
.checks small { color: var(--text-3); font-size: 13px; }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 30px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { position: absolute; left: 0; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border-2); display: grid; place-items: center; }
.timeline .done .dot { background: var(--success); border-color: var(--success); }
.timeline .done .dot::after { content: ""; width: 6px; height: 6px; background: #fff; border-radius: 50%; }
.timeline .current .dot { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline strong { display: block; font-weight: 650; }
.timeline small { color: var(--text-3); }

.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps span { flex: 1; height: 4px; border-radius: 99px; background: var(--border); }
.steps span.on { background: var(--brand); }

.empty { text-align: center; padding: 40px 20px; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.empty-icon .i { width: 28px; height: 28px; }
.empty h3 { font-size: 17px; font-weight: 750; margin-bottom: 6px; }
.empty p { color: var(--text-3); max-width: 360px; margin: 0 auto 16px; font-size: 14px; }

.prose { font-size: 15px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.prose p { margin: 0 0 .9em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prose a { color: var(--brand); text-decoration: underline; }
.prose p:last-child { margin-bottom: 0; }

.copy-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-2); }
.copy-row span { display: flex; flex-direction: column; }
.copy-row small { color: var(--text-3); font-weight: 600; }
.copy-row strong { font-size: 22px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.announce { border-left: 4px solid var(--brand); }
.announce.bereavement { border-left-color: #5a5f6b; }
.announce.celebration { border-left-color: var(--gold); }
.announce.finance { border-left-color: var(--success); }
.announce.meeting { border-left-color: var(--info); }
.announce.urgent { border-left-color: var(--danger); }

.date-tile { width: 48px; flex: none; border-radius: 12px; overflow: hidden; text-align: center; border: 1px solid var(--border); background: var(--surface); }
.date-tile small { display: block; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; padding: 2px 0; }
.date-tile b { display: block; font-size: 19px; font-weight: 800; padding: 3px 0 4px; }

.vote-opt { position: relative; display: block; border: 1.5px solid var(--border); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; overflow: hidden; background: var(--surface); }
.vote-opt input { position: absolute; opacity: 0; }
.vote-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.vote-opt .row { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.vote-opt .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-2); flex: none; display: grid; place-items: center; }
.vote-opt:has(input:checked) .radio { border-color: var(--brand); }
.vote-opt:has(input:checked) .radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand); }
.result { margin-bottom: 14px; }
.result .top { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; gap: 10px; }
.result .top strong { font-weight: 650; }
.result.win .progress span { background: var(--success); }

.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h2 { font-size: 20px; font-weight: 800; }
.profile-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13.5px; }

.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
.menu-tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); position: relative; }
.menu-tile strong { font-size: 14.5px; }
.menu-tile small { color: var(--text-3); line-height: 1.35; }
.menu-tile .side-badge, .menu-tile .tab-badge { position: absolute; top: 12px; right: 12px; left: auto; }
.menu-tile:active { transform: scale(.98); }

/* ------------------------------------------------------------ charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .bar { fill: var(--s1); }
.chart .bar.s2 { fill: var(--s2); }
.chart .track { fill: var(--s1-track); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover { fill: color-mix(in oklab, var(--text) 5%, transparent); }
.spark { width: 120px; height: 36px; overflow: visible; }
.spark polyline { fill: none; stroke: #fff; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; opacity: .9; }
.spark circle { fill: #fff; stroke: color-mix(in oklab, var(--brand) 80%, #000); stroke-width: 2; }
.tip { position: fixed; z-index: 90; pointer-events: none; padding: 7px 10px; border-radius: 9px; background: var(--text); color: var(--surface); font-size: 12.5px; font-weight: 600; white-space: pre-line; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; max-width: 240px; box-shadow: var(--shadow-lg); }
.tip.show { opacity: 1; transform: none; }

/* ------------------------------------------------------------ dialogs & toasts */
dialog { border: 0; padding: 0; background: transparent; color: var(--text); max-width: 100vw; max-height: 100dvh; }
dialog::backdrop { background: rgba(10, 10, 14, .45); backdrop-filter: blur(3px); }
dialog.sheet-dialog[open] { display: flex; align-items: flex-end; justify-content: center; position: fixed; inset: 0; width: 100vw; height: 100dvh; max-height: none; margin: 0; }
@media (min-width: 640px) { dialog.sheet-dialog[open] { align-items: center; padding: 24px; } }
.sheet {
  margin: 0; width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 20px calc(20px + var(--safe-b));
  animation: sheetUp .28s cubic-bezier(.2,.8,.2,1);
}
.sheet::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 99px; background: var(--border-2); margin: 4px auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-head h3 { font-size: 18px; font-weight: 800; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .sheet { border-radius: 24px; padding: 20px 24px 24px; }
  .sheet::before { display: none; }
}
.confirm-dialog { margin: auto; width: calc(100% - 32px); max-width: 400px; }
.confirm-inner { background: var(--surface); border-radius: 22px; padding: 24px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.confirm-icon { width: 52px; height: 52px; border-radius: 16px; background: var(--warning-soft); color: var(--warning); display: grid; place-items: center; margin: 0 auto 12px; }
.confirm-inner h3 { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.confirm-inner p { color: var(--text-2); font-size: 14px; }
.confirm-inner .btn-row { margin-top: 18px; }
.confirm-inner .btn { flex: 1; }
@keyframes pop { from { transform: scale(.95); opacity: 0; } to { transform: none; opacity: 1; } }
.toast-stack { position: fixed; z-index: 100; left: 12px; right: 12px; top: calc(env(safe-area-inset-top, 0px) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 460px; width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; pointer-events: auto; animation: toastIn .3s cubic-bezier(.2,.8,.2,1); }
.toast .i { width: 20px; height: 20px; flex: none; }
.toast.success .i { color: #4ade80; } .toast.error .i { color: #f87171; } .toast.warning .i { color: #fbbf24; } .toast.info .i { color: #93c5fd; }
.toast.out { opacity: 0; transform: translateY(-10px); transition: .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
@media (min-width: 1024px) { .toast-stack { left: auto; right: 24px; top: 20px; align-items: flex-end; } }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; font-size: 13.5px; color: var(--text-3); }

/* ------------------------------------------------------------ auth */
body.bare { background: var(--bg); }
.auth-wrap { min-height: 100dvh; display: flex; flex-direction: column; }
.auth-top {
  position: relative; overflow: hidden; color: #fff; padding: calc(env(safe-area-inset-top, 0px) + 36px) 24px 64px;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in oklab, var(--brand) 55%, #ff9a6b) 0%, transparent 55%), linear-gradient(160deg, var(--brand), var(--brand-700));
}
.auth-top::after { content: ""; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; border: 36px solid rgba(255,255,255,.07); }
.auth-top .brand-mark { background: #fff; width: 52px; height: 52px; border-radius: 16px; }
.auth-top .brand-mark svg { color: var(--brand); --brand-ink: #fff; width: 32px; height: 32px; }
.auth-top h1 { font-size: 28px; font-weight: 800; margin-top: 20px; letter-spacing: -.02em; }
.auth-top p { opacity: .88; margin: 6px 0 0; font-size: 15px; }
.auth-card { position: relative; z-index: 2; margin: -36px 16px 24px; padding: 24px 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow-lg); }
.auth-foot { text-align: center; font-size: 13px; color: var(--text-3); padding: 0 16px 32px; margin-top: auto; }
.auth-foot em { color: var(--brand); font-weight: 650; }
.pin-input { letter-spacing: .5em; font-size: 22px !important; font-weight: 800 !important; text-align: center; }
@media (min-width: 720px) {
  .auth-wrap { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
  .auth-top { display: flex; flex-direction: column; justify-content: center; padding: 64px; }
  .auth-top h1 { font-size: 40px; }
  .auth-card { margin: auto; width: 100%; max-width: 440px; box-shadow: none; background: transparent; padding: 32px; }
  .auth-foot { grid-column: 2; }
  .auth-side { display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
}
.auth-points { list-style: none; padding: 0; margin: 28px 0 0; display: none; }
.auth-points li { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; font-weight: 600; }
.auth-points .i { width: 20px; height: 20px; padding: 4px; box-sizing: content-box; border-radius: 8px; background: rgba(255,255,255,.16); }
@media (min-width: 720px) { .auth-points { display: block; } }

/* ------------------------------------------------------------ print */
@media print {
  body { background: #fff; color: #000; font-size: 12px; }
  .sidebar, .topbar, .tabbar, .page-actions, .no-print, .toast-stack, .btn { display: none !important; }
  .app { display: block; }
  .content { padding: 0; max-width: none; }
  .card, .list, .table-wrap { box-shadow: none; border-color: #ccc; break-inside: avoid; }
  .print-only { display: block !important; }
  .t th { background: #f2f2f2 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.print-only { display: none; }
.statement-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding-bottom: 16px; border-bottom: 2px solid var(--brand); margin-bottom: 16px; }
.statement-head h2 { font-size: 20px; font-weight: 800; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
[data-search] + [data-search] > .li::before, [data-cat] + [data-cat] > .li::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; border-top: 1px solid var(--border); }

/* HTML charts */
.hchart { display: grid; grid-template-columns: auto 1fr; gap: 10px; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hc-y { display: flex; flex-direction: column; justify-content: space-between; height: var(--h); text-align: right; }
.hc-y span { line-height: 0; white-space: nowrap; }
.hc-plot { position: relative; min-width: 0; }
.hc-grid { position: absolute; inset: 0 0 auto 0; height: var(--h); display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.hc-grid i { display: block; border-top: 1px solid var(--grid); height: 0; }
.hc-cols { position: relative; display: flex; height: var(--h); }
.hc-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; height: 100%; cursor: pointer; border-radius: 6px 6px 0 0; outline-offset: -2px; }
.hc-col:hover, .hc-col:focus-visible { background: color-mix(in oklab, var(--text) 5%, transparent); }
.hc-stack { position: relative; width: min(24px, 46%); height: 100%; }
.hc-stack span { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 4px 4px 0 0; }
.hc-stack .track { background: var(--s1-track); }
.hc-stack .bar { background: var(--s1); }
.hc-bar { width: min(14px, 30%); border-radius: 4px 4px 0 0; }
.hc-bar.s1 { background: var(--s1); } .hc-bar.s2 { background: var(--s2); }
.hc-x { display: flex; margin-top: 6px; }
.hc-x span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; }
@media (max-width: 640px) { .matrix .mcol { min-width: 128px; max-width: 140px; padding: 8px; } .matrix .mcol .avatar { display: none; } .matrix .mcol small { margin-left: 0 !important; } }
