/* Pangsuma: mobile-first report ledger, following the owner's reference and the club's navy-gold crest. */
:root {
  color-scheme: light;
  --blue: #285b88;
  --blue-deep: #17334e;
  --blue-soft: #eaf0f7;
  --gold: #b99643;
  --gold-pale: #f6f0df;
  --focus: #795b17;
  --ink: #1b2d3e;
  --muted: #586878;
  --canvas: #f2f4f6;
  --paper: #ffffff;
  --line: #dfe4e8;
  --green: #256447;
  --green-pale: #eaf3ed;
  --red: #913b35;
  --red-pale: #f8eeec;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-soft: 0 8px 22px rgba(23, 51, 78, .07);
  --shadow-float: 0 12px 24px rgba(23, 51, 78, .18);
  --body-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display-font: var(--body-font);
  font-family: var(--body-font);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { min-height: 100vh; margin: 0; color: var(--ink); background: var(--canvas); font: 15px/1.5 var(--body-font); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
button:disabled { cursor: not-allowed; opacity: 1; }
.primary-button:disabled, .secondary-button:disabled { border-color: #d6dce1; color: #596979; background: #e9edf0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.logged-out .skip-link { display: none; }
.skip-link { position: fixed; top: -70px; left: 12px; z-index: 40; padding: 10px 14px; border: 1px solid var(--gold); border-radius: var(--radius-sm); background: var(--paper); color: var(--blue-deep); font-weight: 650; }
.skip-link:focus-visible { top: 12px; }
body.logged-out > header, body.logged-out > .app-shell, body.logged-out > .mobile-nav, body.logged-out > #toast { display: none !important; }

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.brand { display: flex; min-width: 0; align-items: center; gap: 10px; }
.brand img { display: block; width: 42px; height: 42px; flex: none; object-fit: contain; }
.brand-name { color: var(--blue-deep); font-family: var(--display-font); font-size: 19px; font-weight: 720; letter-spacing: -.035em; line-height: 1.15; }
.brand-sub { margin-top: 3px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.demo-label { display: inline-flex; min-height: 30px; align-items: center; padding: 3px 9px; border-radius: 8px; background: var(--gold-pale); color: #594715; font-size: 12px; font-weight: 650; }
.account-meta { display: grid; min-width: 0; gap: 2px; }
.account-name { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.account-detail { display: flex; flex-wrap: wrap; gap: 2px 8px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.account-access strong { color: var(--blue-deep); }
.role-wrap { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.role-wrap select { min-height: 42px; padding: 8px 30px 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: var(--paper); }
.install-button, .primary-button, .secondary-button, .quiet-button, .danger-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 660;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.install-button { border-color: var(--line); color: var(--blue-deep); background: var(--paper); }
.install-button svg { width: 18px; height: 18px; }
.primary-button { color: #fff; background: var(--blue-deep); }
.primary-button:hover { background: #224966; }
.secondary-button, .quiet-button { border-color: #ccd5dc; color: var(--blue-deep); background: var(--paper); }
.secondary-button:hover, .quiet-button:hover, .install-button:hover { border-color: #aebdc8; background: #f5f7f9; }
.danger-button { border-color: #e0c5c1; color: var(--red); background: var(--paper); }
.logout-button { white-space: nowrap; }

.app-shell { display: grid; min-height: calc(100vh - 70px); grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; gap: 22px; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--paper); }
.nav-caption { margin: 0 0 6px; padding: 0 10px; color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.nav-list { display: grid; gap: 5px; }
.nav-button {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  gap: 11px;
  padding: 10px 11px;
  border: 0;
  border-radius: 11px;
  color: #4b5d6c;
  background: transparent;
  text-align: left;
  font-weight: 560;
  transition: background-color .16s ease, color .16s ease;
}
.nav-button svg { width: 20px; height: 20px; flex: none; }
.nav-button:hover { color: var(--blue-deep); background: #f1f4f7; }
.sidebar .nav-button[aria-current="page"] { color: var(--blue-deep); background: var(--blue-soft); font-weight: 700; }
.side-note { margin-top: auto; padding: 13px 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.side-note strong { display: block; margin-bottom: 3px; color: var(--ink); font-size: 13px; }
main { width: 100%; min-width: 0; max-width: 1360px; margin: 0 auto; padding: clamp(22px, 3vw, 40px) clamp(20px, 3.8vw, 52px) 38px; }
.main-inner { width: 100%; max-width: 1120px; margin: 0 auto; }
.notice { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 11px 14px; border: 1px solid #e5d9b6; border-radius: 12px; color: #534a35; background: #faf6e9; font-size: 13px; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.archive-kicker { margin: 0 0 3px; color: #697684; font-size: 12px; font-weight: 680; letter-spacing: .09em; text-transform: uppercase; }
h1, .page-heading h1 { margin: 0; color: var(--blue-deep); font-family: var(--display-font); font-size: clamp(28px, 3.4vw, 36px); font-weight: 750; letter-spacing: -.04em; line-height: 1.15; text-wrap: balance; }
.page-description { max-width: 65ch; margin: 7px 0 0; color: var(--muted); }
.date-label { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.welcome-card {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 15px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.welcome-avatar {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border: 3px solid var(--paper);
  border-radius: 50%;
  outline: 1px solid #c8d0d7;
  color: #fff;
  background: var(--blue-deep);
  font-size: 20px;
  font-weight: 740;
  letter-spacing: .02em;
}
.welcome-copy { min-width: 0; }
.welcome-date { margin: 0 0 3px; color: #697684; font-size: 12px; font-weight: 680; letter-spacing: .09em; text-transform: uppercase; }
.welcome-card h1 { color: #202d49; font-size: clamp(25px, 3vw, 34px); }
.metric-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.metric {
  display: flex;
  min-width: 0;
  min-height: 96px;
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  color: var(--ink);
  background: var(--paper);
  text-align: left;
}
.metric-link { width: 100%; cursor: pointer; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.metric-link:hover { border-color: #c4cfd9; background: #fbfcfd; transform: translateY(-1px); }
.metric-icon { display: grid; width: 42px; height: 42px; flex: none; place-items: center; border-radius: 13px; color: var(--blue-deep); background: var(--blue-soft); }
.metric-icon svg { width: 20px; height: 20px; }
.metric-copy { display: grid; min-width: 0; gap: 2px; }
.metric-label { color: var(--muted); font-size: 12px; line-height: 1.2; }
.metric-value { overflow-wrap: anywhere; color: #202d49; font-size: clamp(17px, 2vw, 24px); font-weight: 750; letter-spacing: -.035em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.metric-link .metric-value { color: var(--blue-deep); }

.guide-card, .ledger-band, .manager-ledger, .manager-queue, .surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.guide-card { margin: 0 0 22px; padding: 18px; }
.guide-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.guide-heading h2, .section-row h2, .ledger-band h2 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 720; letter-spacing: -.02em; line-height: 1.25; }
.guide-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.guide-steps li { display: flex; min-width: 0; min-height: 54px; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 13px; background: #f4f6f8; }
.guide-steps li span { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 10px; color: #fff; background: var(--blue-deep); font-size: 14px; font-weight: 720; }
.guide-steps li strong { color: #445363; font-size: 13px; font-weight: 620; line-height: 1.25; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 21px 0 10px; }
.section-row h2 { font-size: 17px; }
.section-row p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.text-button { min-height: 44px; padding: 8px 5px; border: 0; color: var(--blue-deep); background: transparent; font-weight: 680; text-underline-offset: 3px; }
.text-button:hover { color: #245b84; text-decoration: underline; }

.ledger-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 13px 18px; margin: 0 0 20px; padding: 18px; }
.ledger-band-label { display: grid; gap: 7px; }
.ledger-count { display: flex; align-items: baseline; gap: 7px; color: var(--muted); }
.ledger-count strong { color: var(--blue-deep); font-size: 27px; font-weight: 760; line-height: 1; font-variant-numeric: tabular-nums; }
.ledger-count span { font-size: 13px; }
.ledger-progress { display: flex; grid-column: 1 / -1; align-items: center; gap: 10px; }
.progress-track { height: 8px; flex: 1; overflow: hidden; border-radius: 20px; background: #e8ecef; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--gold); transition: width .2s ease; }
.ledger-percent { color: var(--muted); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.ledger-band > button { grid-column: 2; grid-row: 1; align-self: start; }
.manager-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 14px; }
.manager-ledger, .manager-queue { min-width: 0; padding: 17px; }
.manager-ledger .section-row, .manager-queue .section-row { margin-top: 0; }
.division-list { overflow: hidden; border-top: 1px solid var(--line); }
.division-row { display: grid; min-height: 60px; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #edf0f2; }
.division-row:last-child { border-bottom: 0; }
.division-name { font-weight: 660; }
.division-meta { margin-top: 2px; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; min-height: 28px; align-items: center; justify-content: center; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 660; white-space: nowrap; }
.status-ok { color: #235c43; background: var(--green-pale); }
.status-wait { color: #5a4716; background: var(--gold-pale); }
.status-neutral { color: #495969; background: #edf1f4; }
.list-stack { display: grid; gap: 9px; }
.item-row { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.manager-queue .item-row { background: #f8f9fa; }
.item-title { overflow-wrap: anywhere; color: var(--ink); font-weight: 680; line-height: 1.35; }
.item-meta { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.item-amount { color: var(--blue-deep); font-size: 14px; font-weight: 720; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.item-actions { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 8px; padding-top: 8px; }
.item-actions button { min-height: 44px; }
.empty-state { display: grid; gap: 3px; padding: 22px 18px; color: var(--muted); }
.empty-state strong { color: var(--ink); font-size: 15px; }
.empty-state span { font-size: 13px; }

.surface-pad { padding: 18px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); align-items: start; gap: 18px; }
.form-card { width: 100%; max-width: 820px; padding: clamp(18px, 3vw, 28px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field { display: grid; min-width: 0; gap: 7px; }
.field-full { grid-column: 1 / -1; }
.field label { color: #34495b; font-size: 13px; font-weight: 650; }
.field input, .field select, .field textarea, .archive-year select {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #cbd4dc;
  border-radius: 13px;
  color: var(--ink);
  background-color: var(--paper);
}
.field input::placeholder, .archive-search input::placeholder { color: #647281; opacity: 1; }
.field textarea { min-height: 100px; resize: vertical; }
.field-help { color: var(--muted); font-size: 12px; }
.form-note { margin: 16px 0; padding: 12px 14px; border-radius: 12px; color: #465767; background: #f2f5f7; font-size: 13px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }

.archive-controls { display: grid; gap: 11px; margin-bottom: 20px; }
.archive-search { display: flex; min-height: 54px; align-items: center; gap: 11px; padding: 0 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.archive-search svg { width: 21px; height: 21px; flex: none; color: #718091; }
.archive-search input { width: 100%; min-width: 0; min-height: 50px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.archive-search input:focus-visible { outline: 0; }
.archive-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.archive-filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chip { min-height: 42px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; color: #536273; background: var(--paper); font-weight: 620; }
.filter-chip:hover { border-color: #bbc7d0; background: #f8fafb; }
.filter-chip[aria-pressed="true"] { border-color: var(--blue-deep); color: #fff; background: var(--blue-deep); }
.archive-year select { min-height: 50px; border-radius: 13px; color: var(--ink); background: var(--paper); }
.archive-type { margin-top: 18px; }
.archive-type .section-row { margin-top: 0; }
.archive-total { color: var(--muted); font-size: 13px; white-space: nowrap; }
.archive-month-list { display: grid; gap: 10px; }
.archive-month { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: var(--paper); }
.archive-month summary { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.archive-month summary::-webkit-details-marker { display: none; }
.archive-month summary:hover { background: #fbfcfd; }
.archive-month-copy { display: grid; gap: 4px; }
.archive-month-copy strong { color: var(--blue-deep); font-size: 20px; font-weight: 720; letter-spacing: -.025em; }
.archive-month-copy small { color: var(--muted); font-size: 13px; }
.archive-chevron { width: 10px; height: 10px; flex: none; transform: rotate(45deg); border-right: 2px solid #8996a3; border-bottom: 2px solid #8996a3; transition: transform .16s ease; }
.archive-month[open] .archive-chevron { transform: rotate(225deg); }
.archive-month-content { padding: 0 13px 13px; }
.archive-month-content .item-row { background: #f8f9fa; }

.report-choice { width: min(560px, calc(100% - 28px)); max-width: 560px; max-height: min(90dvh, 680px); overflow: auto; padding: 0; border: 1px solid rgba(255,255,255,.8); border-radius: 24px; color: var(--ink); background: var(--paper); box-shadow: var(--shadow-float); overscroll-behavior: contain; }
.report-choice::backdrop { background: rgba(17, 36, 56, .48); }
.choice-panel { padding: clamp(20px, 4vw, 30px); }
.choice-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.choice-kicker { margin: 0 0 4px; color: #64717f; font-size: 12px; font-weight: 680; letter-spacing: .08em; text-transform: uppercase; }
.choice-heading h2 { margin: 0; color: var(--ink); font-size: clamp(22px, 5vw, 27px); letter-spacing: -.03em; line-height: 1.2; }
.choice-close { display: grid; width: 44px; height: 44px; flex: none; place-items: center; border: 0; border-radius: 50%; color: #5f6c7a; background: transparent; font-size: 25px; line-height: 1; }
.choice-close:hover { background: #f1f3f5; }
.choice-description { margin: 12px 0 17px; color: var(--muted); }
.choice-options { display: grid; gap: 9px; }
.choice-option { display: grid; min-height: 84px; grid-template-columns: 52px minmax(0, 1fr) 14px; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--paper); text-align: left; transition: border-color .16s ease, background-color .16s ease; }
.choice-option:hover { border-color: #bac8d3; background: #f9fbfc; }
.choice-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 15px; color: var(--blue-deep); background: var(--blue-soft); }
.choice-icon svg { width: 23px; height: 23px; }
.choice-copy { display: grid; min-width: 0; gap: 3px; }
.choice-copy strong { color: #202d49; font-size: 15px; font-weight: 720; }
.choice-copy small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.choice-chevron { color: #8a96a2; font-size: 23px; line-height: 1; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 14px; border-bottom: 1px solid #e8ecef; vertical-align: middle; }
th { color: #526273; background: #f6f8fa; font-size: 12px; font-weight: 650; white-space: nowrap; }
td { font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.user-initial { display: inline-grid; width: 34px; height: 34px; place-items: center; margin-right: 8px; border-radius: 50%; color: var(--blue-deep); background: var(--blue-soft); font-weight: 700; vertical-align: middle; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 25px; padding: 19px 0 30px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.page-footer details { max-width: 700px; }
.page-footer summary { min-height: 40px; color: var(--blue-deep); cursor: pointer; font-weight: 650; }
.page-footer details p { margin: 5px 0; }
.mobile-nav { display: none; }
.toast { position: fixed; z-index: 30; bottom: 25px; left: 50%; width: max-content; max-width: min(92vw, 530px); padding: 12px 16px; transform: translate(-50%, 16px); border-radius: 13px; color: #fff; background: var(--blue-deep); box-shadow: var(--shadow-float); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.login-screen { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; overflow-y: auto; padding: clamp(16px, 5vw, 56px); background: var(--canvas); }
.login-panel { display: grid; width: min(100%, 930px); min-height: 510px; grid-template-columns: .88fr 1.12fr; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-soft); }
.login-intro { display: flex; min-height: 510px; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 36px; color: #fff; background: var(--blue-deep); text-align: center; }
.login-crest { display: block; width: 150px; height: 150px; flex: none; object-fit: contain; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.login-brand strong { color: #fff; font-family: var(--display-font); font-size: 27px; font-weight: 700; letter-spacing: -.025em; }
.login-brand span { margin-top: 0; color: #d6e0e8; font-size: 13px; }
.login-form-panel { display: grid; align-items: center; padding: clamp(28px, 5vw, 58px); }
.login-form-content { width: 100%; max-width: 390px; margin-inline: auto; }
.login-form-content h1 { margin: 0; color: var(--blue-deep); font-size: clamp(31px, 4vw, 40px); font-weight: 750; letter-spacing: -.04em; }
.login-form { display: grid; gap: 16px; margin-top: 25px; }
.login-field { display: grid; gap: 7px; }
.login-field label { color: #34495b; font-size: 13px; font-weight: 650; }
.login-field input { width: 100%; min-height: 48px; padding: 11px 13px; border: 1px solid #cbd4dc; border-radius: 13px; color: var(--ink); background: var(--paper); }
.login-field input::placeholder { color: #647281; opacity: 1; }
.login-submit { width: 100%; min-height: 49px; margin-top: 4px; }
.login-error { margin: 0; padding: 10px 12px; border: 1px solid #dfc5c0; border-radius: 12px; color: #762e2a; background: var(--red-pale); font-size: 13px; }
.login-footnote { margin-top: 22px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.login-footnote strong { color: var(--blue-deep); }

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 194px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  main { padding-inline: 25px; }
  .manager-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 760px) {
  body { display: flex; height: 100dvh; min-height: 0; flex-direction: column; overflow: hidden; }
  .topbar { min-height: 62px; flex: none; padding: 7px 14px; gap: 8px; }
  .brand { gap: 8px; }
  .brand img { width: 38px; height: 38px; }
  .brand-name { font-size: 17px; }
  .brand-sub, .demo-label, .account-meta, .install-button { display: none; }
  .top-actions { flex: none; gap: 0; }
  .logout-button { min-height: 42px; padding: 7px 12px; border-radius: 12px; font-size: 13px; }
  .app-shell { display: block; min-height: 0; flex: 1; overflow: hidden; }
  .sidebar { display: none; }
  main { width: 100%; height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 17px 16px 24px; }
  .main-inner { max-width: none; }
  .page-heading { align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .page-heading h1 { font-size: clamp(27px, 7vw, 34px); }
  .date-label { max-width: 44%; text-align: right; white-space: normal; font-size: 12px; }
  .welcome-card { grid-template-columns: 60px minmax(0, 1fr); gap: 13px; margin-bottom: 12px; padding: 16px; border-radius: 20px; }
  .welcome-avatar { width: 60px; height: 60px; font-size: 18px; }
  .welcome-date { font-size: 11px; }
  .welcome-card h1 { font-size: clamp(23px, 6.4vw, 29px); }
  .metric-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 15px; }
  .metric-row > .metric:last-child:nth-child(odd) { grid-column: auto; }
  .metric { min-height: 82px; gap: 8px; padding: 10px 9px; border-radius: 16px; }
  .metric-icon { width: 34px; height: 34px; border-radius: 11px; }
  .metric-icon svg { width: 18px; height: 18px; }
  .metric-label { font-size: 11px; }
  .metric-value { font-size: clamp(14px, 4vw, 19px); }
  .guide-card { margin-bottom: 18px; padding: 15px; border-radius: 19px; }
  .guide-heading { margin-bottom: 11px; }
  .guide-heading h2 { font-size: 17px; }
  .guide-steps { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .guide-steps li { min-height: 48px; padding: 7px 10px; border-radius: 13px; }
  .guide-steps li span { width: 32px; height: 32px; }
  .home-report-cta { display: none; }
  .section-row { margin: 18px 0 9px; }
  .section-row h2 { font-size: 16px; }
  .ledger-band { grid-template-columns: minmax(0, 1fr) auto; gap: 11px 10px; margin-bottom: 15px; padding: 15px; border-radius: 19px; }
  .ledger-band h2 { font-size: 17px; }
  .ledger-count strong { font-size: 25px; }
  .ledger-count span { font-size: 12px; }
  .ledger-progress { gap: 8px; }
  .ledger-band > button { grid-column: 2; grid-row: 1; min-height: 42px; align-self: center; padding-inline: 11px; font-size: 12px; }
  .manager-layout { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .manager-ledger, .manager-queue { padding: 14px; border-radius: 19px; }
  .division-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; padding: 10px 1px; }
  .division-row .status { grid-column: 2; grid-row: 1 / 3; }
  .division-row .text-button { grid-column: 1; grid-row: 2; justify-self: start; min-height: 40px; padding: 3px 0; }
  .division-row > span:last-child { display: none; }
  .item-row { gap: 8px 10px; padding: 12px; border-radius: 14px; }
  .manager-queue .item-row { padding: 11px; }
  .item-title { font-size: 14px; }
  .item-meta { font-size: 11px; }
  .item-amount { font-size: 12px; }
  .item-actions { gap: 7px; }
  .item-actions button { flex: 1 1 135px; padding-inline: 10px; font-size: 12px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .field-full { grid-column: auto; }
  .form-card { padding: 16px; border-radius: 19px; }
  .field input, .field select, .field textarea { min-height: 48px; }
  .form-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .form-actions button { width: 100%; }
  .archive-controls { gap: 10px; margin-bottom: 16px; }
  .archive-search { min-height: 53px; }
  .archive-filter-row { gap: 7px; }
  .filter-chip { min-height: 42px; padding-inline: 12px; font-size: 12px; }
  .archive-type { margin-top: 18px; }
  .archive-month summary { min-height: 78px; padding: 14px 16px; }
  .archive-month-copy strong { font-size: 19px; }
  .archive-month-content { padding: 0 10px 10px; }
  .table-wrap { overflow: visible; border: 0; background: transparent; }
  table, tbody, tr, td { display: block; width: 100%; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
  tbody { display: grid; gap: 8px; }
  tr { padding: 7px 11px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
  td { display: grid; grid-template-columns: minmax(88px, .58fr) minmax(0, 1fr); gap: 9px; padding: 7px 0; border-bottom: 1px solid #e8ecef; overflow-wrap: anywhere; }
  td:last-child { border-bottom: 0; }
  td::before { color: var(--muted); font-size: 11px; content: attr(data-label); }
  .mobile-nav { position: relative; display: grid; min-height: 72px; flex: none; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 8px; overflow: visible; padding: 5px 14px calc(5px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); }
  .mobile-nav .nav-button { display: flex; min-height: 56px; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 3px; border: 0; border-radius: 13px; color: #667381; text-align: center; font-size: 11px; line-height: 1.15; }
  .mobile-nav .nav-button svg { width: 21px; height: 21px; }
  .mobile-nav .nav-button[aria-current="page"] { color: var(--blue-deep); background: #eef2f7; font-weight: 740; }
  .mobile-add { position: relative; top: -12px; display: grid; width: 66px; height: 66px; place-items: center; justify-self: center; border: 4px solid var(--paper); border-radius: 50%; color: #fff; background: var(--blue-deep); box-shadow: var(--shadow-float); transition: transform .16s ease, background-color .16s ease; }
  .mobile-add:hover { transform: translateY(-2px); background: #244967; }
  .mobile-add svg { width: 27px; height: 27px; }
  .mobile-add.is-active { box-shadow: 0 0 0 2px var(--gold), var(--shadow-float); }
  .mobile-nav.is-manager { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .mobile-nav.is-manager .nav-button { min-height: 58px; font-size: 10px; }
  .page-footer { gap: 9px; margin-top: 20px; padding: 16px 0 8px; }
  .login-screen { align-items: center; padding: 14px; }
  .login-panel { width: min(100%, 560px); min-height: 0; grid-template-columns: minmax(0, 1fr); border-radius: 20px; }
  .login-intro { min-height: 0; flex-direction: row; justify-content: flex-start; gap: 13px; padding: 16px 18px; text-align: left; }
  .login-crest { width: 54px; height: 54px; }
  .login-brand { align-items: flex-start; }
  .login-brand strong { font-size: 21px; }
  .login-brand span { font-size: 12px; }
  .login-form-panel { padding: 22px 19px; }
  .login-form-content h1 { font-size: 31px; }
  .login-form { gap: 13px; margin-top: 19px; }
  .login-footnote { margin-top: 18px; padding-top: 13px; }
  .toast { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .report-choice { width: calc(100% - 24px); border-radius: 22px; }
  .choice-panel { padding: 21px 18px; }
  .choice-option { min-height: 78px; grid-template-columns: 46px minmax(0, 1fr) 12px; gap: 11px; padding: 10px 11px; border-radius: 16px; }
  .choice-icon { width: 46px; height: 46px; border-radius: 14px; }
}
@media (max-width: 360px) {
  main { padding-inline: 12px; }
  .topbar { padding-inline: 11px; }
  .brand-name { font-size: 16px; }
  .metric { gap: 6px; padding: 9px 7px; }
  .metric-icon { width: 30px; height: 30px; }
  .metric-label { font-size: 10px; }
  .metric-value { font-size: 12px; letter-spacing: -.04em; }
  .filter-chip { padding-inline: 10px; font-size: 11px; }
  .mobile-nav { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
