:root {
  --bg: #f3f5f3;
  --surface: #ffffff;
  --surface-2: #f8faf8;
  --ink: #16241d;
  --ink-2: #44534b;
  --muted: #74817a;
  --line: #e2e7e3;
  --line-strong: #cfd7d1;
  --brand: #123f31;
  --brand-2: #1b5a45;
  --accent: #0d6e57;
  --accent-soft: #e4f2ed;
  --buna: #008f7a;
  --buna-soft: #e0f3ef;
  --akiba: #c2410c;
  --akiba-soft: #fcebe2;
  --neg: #b42318;
  --neg-soft: #fdecea;
  --warn: #8a5a00;
  --warn-soft: #fff4d6;
  --ok: #17663f;
  --ok-soft: #e5f4ea;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 36, 29, 0.06), 0 2px 8px rgba(16, 36, 29, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font-family: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--brand-2); }

.icon { flex: none; vertical-align: -3px; }

/* ---------- header ---------- */

header.top {
  background: linear-gradient(180deg, var(--brand) 0%, #0f382b 100%);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}
.top-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px 20px;
  min-height: 60px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}
.brand:hover { color: #fff; }
.brand small { display: block; font-weight: 500; font-size: 11px; opacity: 0.7; letter-spacing: 0.04em; }
header nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; justify-content: center; }
header nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
}
header nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
header nav a.active { color: #fff; background: rgba(255, 255, 255, 0.15); font-weight: 600; }
.who { display: flex; align-items: center; gap: 6px; font-size: 14px; white-space: nowrap; }
.who-name { margin-right: 4px; }
.who .club-badge { box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.6); }

main { max-width: 1200px; margin: 0 auto; padding: 24px 16px 72px; }

/* ---------- typography & page head ---------- */

h1 { font-size: 24px; line-height: 1.3; margin: 0; letter-spacing: 0.01em; }
h2 { font-size: 16px; margin: 0; }
h3 { font-size: 14px; margin: 18px 0 8px; color: var(--ink-2); }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.page-head-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.eyebrow { color: var(--muted); font-size: 13px; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.lead { color: var(--ink-2); margin: 0 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.neg { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; margin-bottom: 10px; text-decoration: none; }
.spaced { margin-top: 18px; }

/* ---------- cards & grids ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.section-head { margin: 28px 0 12px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; text-decoration: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.grid-entry { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.narrow { max-width: 680px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line-strong); }
.kpi.accent-buna::before { background: var(--buna); }
.kpi.accent-akiba::before { background: var(--akiba); }
.kpi-label { color: var(--muted); font-size: 12.5px; }
.kpi-value { font-size: 26px; font-weight: 700; line-height: 1.35; letter-spacing: 0.01em; }
.kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.kpi-sub { color: var(--muted); font-size: 12.5px; }
.small-kpis .kpi-value { font-size: 20px; }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: -6px 0 18px; }

.empty {
  color: var(--muted);
  text-align: center;
  padding: 22px 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 14px;
}

/* ---------- controls ---------- */

input, select, button, .button {
  font: inherit;
  font-size: 14.5px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 40px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--ink-2); }
button, .button {
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
button:hover, .button:hover { background: var(--surface-2); border-color: var(--muted); color: var(--ink); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover, .button.primary:hover { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
button.danger { background: var(--neg); border-color: var(--neg); color: #fff; }
button.link { background: none; border: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-weight: 400; }
button.block { width: 100%; }
form.inline { display: inline; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink-2);
}
.icon-btn.light { background: transparent; border-color: transparent; color: rgba(255, 255, 255, 0.85); }
.icon-btn.light:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; }

.form label { display: block; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); font-weight: 500; }
.form label input, .form label select { display: block; width: 100%; margin-top: 5px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 400; font-size: 14px; }
.form label.check input { width: 18px; height: 18px; min-height: 0; margin: 0; }
.form button { margin-top: 4px; }
.field-static { margin-bottom: 14px; display: flex; align-items: center; gap: 6px; }

.input-icon { position: relative; display: block; margin-top: 5px; }
.input-icon .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 34px; width: 100%; margin-top: 0 !important; }
.toolbar .input-icon, .toolbar-form .input-icon { margin-top: 0; }
.input-suffix { position: relative; display: block; margin-top: 5px; }
.input-suffix input { margin-top: 0 !important; padding-right: 36px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-suffix input::placeholder { font-weight: 400; color: #b3bcb7; }
input::placeholder { color: #a3ada8; }
.input-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.balance-hint {
  margin: -6px 0 14px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  font-weight: 600;
  font-size: 14px;
}
.balance-hint.warn { background: var(--warn-soft); color: var(--warn); }
.balance-hint.neg { background: var(--neg-soft); color: var(--neg); }

.toolbar, .toolbar-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar { margin-bottom: 14px; }
.grow { flex: 1; min-width: 200px; }

.segmented {
  display: inline-flex;
  background: #e7ece8;
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 14px;
}
.toolbar .segmented, .toolbar-form .segmented { margin-bottom: 0; }
.segmented a {
  padding: 6px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}
.segmented a.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }

/* month navigator */
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-form { margin: 0; }
.month-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  font-weight: 600;
  cursor: pointer;
  min-width: 150px;
  justify-content: center;
}
.month-label input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; min-height: 0; }
.today-link { font-size: 13px; margin-left: 4px; }

/* ---------- flash & notices ---------- */

.flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 18px;
  font-size: 14.5px;
}
.flash .icon { margin-top: 2px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid #c7e6d2; }
.flash.error { background: var(--neg-soft); color: var(--neg); border: 1px solid #f5c6c1; }
.notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid #f0dca8;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
}
.notice .icon { margin-top: 3px; }
.notice.subtle { background: var(--ok-soft); color: var(--ok); border-color: #c7e6d2; }

/* ---------- tables ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
thead th {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: #fafcfa; }
tfoot th { color: var(--ink); border-top: 2px solid var(--line-strong); border-bottom: none; background: var(--surface-2); }
th.r, td.r { text-align: right; }
td.note { color: var(--ink-2); font-size: 14px; max-width: 280px; }
tr.inactive td { color: var(--muted); }
tr.reversed td { color: var(--muted); }
tr.reversed td .num { text-decoration: line-through; }
tr.selected td { background: var(--accent-soft); }

table.compact th, table.compact td { padding: 8px 6px; font-size: 14px; }
table.compact thead th { background: none; }
table.compact tr:last-child td { border-bottom: none; }
table.compact tbody tr:hover td { background: none; }

/* chips */
.kind, .pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-weight: 600; line-height: 1.6; }
.kind.deposit { background: #e3eefb; color: #1d5a8c; }
.kind.usage { background: #eef0ee; color: #3d4a43; }
.kind.reversal { background: var(--neg-soft); color: var(--neg); }
.kind.none { background: transparent; color: var(--muted); }
.pill { background: #eef0ee; color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }

.club-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 6px;
  color: #fff;
  margin-right: 6px;
  white-space: nowrap;
  line-height: 1.6;
  vertical-align: 1px;
}
.club-badge.buna { background: var(--buna); }
.club-badge.akiba { background: var(--akiba); }
.club-badge.system { background: #3d4a43; }
.notice.danger { background: var(--neg-soft); color: var(--neg); border-color: #f5c6c1; }
.ok-text { display: inline-flex; align-items: center; gap: 4px; }

/* ---------- settlement ---------- */

.settle-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin: 4px 0 6px; font-size: 15px; }
.settle-line .club-badge { font-size: 13px; padding: 3px 10px; }
.settle-arrow { color: var(--muted); display: inline-flex; margin: 0 6px 0 0; }
.settle-amount { font-size: 26px; font-weight: 700; margin-left: 10px; }
.settle-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.settle-grid h2 { margin-bottom: 10px; }
.settle-result { margin-top: 12px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.settlement { margin-bottom: 8px; }
.settlement > .muted { margin: 14px 0 0; }

.steps { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; counter-reset: step; }
.steps li { position: relative; text-align: center; padding-top: 34px; font-size: 13px; }
.steps li::before {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 16px);
  right: calc(50% + 16px);
  height: 2px;
  background: var(--line-strong);
}
.steps li:first-child::before { display: none; }
.steps li.done::before { background: var(--accent); }
.step-dot {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.steps li.done .step-dot { background: var(--accent); border-color: var(--accent); }
.step-label { display: block; font-weight: 600; }
.step-sub { display: block; color: var(--muted); font-size: 11.5px; }

.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-label { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }

.dash-settlement { margin-bottom: 16px; }
.dash-settlement .settle-grid { align-items: center; }
.dash-settlement .steps { margin: 0; }

/* ---------- member ---------- */

.member-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-top: 4px solid var(--line-strong);
}
.member-head.accent-buna { border-top-color: var(--buna); }
.member-head.accent-akiba { border-top-color: var(--akiba); }
.member-head h1 { margin: 2px 0 4px; }
.member-head .kana { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.member-head .balance { text-align: right; }
.member-head .balance .num { font-size: 32px; font-weight: 700; }

details.reverse summary { cursor: pointer; color: var(--neg); font-size: 13px; }
details.reverse form { display: flex; gap: 6px; margin-top: 6px; min-width: 260px; }
details.reverse input { flex: 1; }

/* ---------- login stages ---------- */

.stage-title { display: flex; align-items: center; gap: 6px; font-size: 18px; margin-bottom: 10px; }
.code-input { font-size: 24px; letter-spacing: 0.3em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: flex; justify-content: center; margin: 10px 0; }
.qr svg { width: 200px; height: 200px; border: 1px solid var(--line); border-radius: 8px; }
.totp-secret { display: block; margin-top: 6px; padding: 8px; background: var(--surface-2); border-radius: 6px; font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.08em; word-break: break-all; }
.setup-steps { padding-left: 20px; color: var(--ink-2); }
.stage-cancel { text-align: center; margin-top: 12px; }

/* ---------- help & manual ---------- */

.help-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  margin-right: 8px;
}
.help-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }

.help-panel {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 0;
  width: min(480px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border: none;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: -8px 0 32px rgba(16, 36, 29, 0.18);
  flex-direction: column;
}
.help-panel[open] { display: flex; animation: help-in 0.18s ease-out; }
.help-panel::backdrop { background: rgba(16, 36, 29, 0.35); }
@keyframes help-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.help-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.help-head h2 { font-size: 19px; }
.help-body { overflow-y: auto; padding: 4px 20px 20px; flex: 1; }
.help-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); }
.help-section h3 { color: var(--accent); font-size: 15px; margin: 18px 0 6px; }
.help-section p, .help-section li { font-size: 14px; color: var(--ink-2); }
.help-section p { margin: 0 0 8px; }
.help-section ol, .help-section ul { padding-left: 20px; margin: 0 0 8px; }
.help-section li { margin-bottom: 4px; }
.help-section strong { color: var(--ink); }
.help-section table.compact td { vertical-align: top; font-size: 13.5px; }

.manual { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.manual-toc { position: sticky; top: 80px; padding: 14px 16px; }
.manual-toc ol { padding-left: 20px; margin: 6px 0 0; font-size: 14px; }
.manual-toc li { margin-bottom: 4px; }
.manual-body { display: grid; gap: 16px; }
.manual-chapter { scroll-margin-top: 80px; }
.manual-chapter > h2 { font-size: 19px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft); }
.manual-chapter:target { outline: 2px solid var(--accent); }

@media (max-width: 900px) {
  .manual { grid-template-columns: 1fr; }
  .manual-toc { position: static; }
  .help-btn span { display: none; }
}

/* ---------- import ---------- */

.dropzone {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 26px 16px;
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  color: var(--ink-2);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--accent); }
.dropzone input { border: none; background: transparent; text-align: center; }
.tips { padding-left: 18px; color: var(--ink-2); }

/* ---------- login ---------- */

body.guest {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(0, 143, 122, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(194, 65, 12, 0.12), transparent 60%),
    var(--bg);
  min-height: 100vh;
}
.login { max-width: 400px; margin: 9vh auto 0; }
.login-brand { display: flex; align-items: center; gap: 12px; justify-content: center; font-weight: 700; font-size: 19px; color: var(--brand); margin-bottom: 20px; line-height: 1.3; }
.login-brand small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.login-card { padding: 26px 26px 20px; }

/* ---------- responsive ---------- */

@media (max-width: 1600px) {
  .who-name { display: none; }
  header nav a { padding: 7px 9px; }
  .top-inner { gap: 8px 14px; }
}
@media (max-width: 1340px) {
  .brand small { display: none; }
  .help-btn span { display: none; }
}
@media (max-width: 1200px) {
  .brand small { display: none; }
  header nav a span { display: none; }
}
@media (max-width: 900px) {
  .grid-2, .grid-entry, .settle-grid { grid-template-columns: 1fr; }
  header nav a span { display: none; }
  header nav a { padding: 8px 10px; }
}
@media (max-width: 600px) {
  .form .row { grid-template-columns: 1fr; }
  .who-name { display: none; }
  h1 { font-size: 21px; }
  .kpi-value { font-size: 22px; }
  .steps li { font-size: 12px; }
  .month-label { min-width: 0; }
}

/* ---------- settlement statement (精算書・A4) ---------- */

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: 0.04em; }
.statement-body { background: #e9ece9; }
.statement-toolbar {
  max-width: 210mm;
  margin: 16px auto 0;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 0 4px;
}
.statement-toolbar .notice { margin: 0; flex: 1; }
.statement {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  margin: 12px auto 32px;
  padding: 16mm 15mm;
  background: #fff;
  color: #111;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
  font-size: 10.5pt;
  line-height: 1.55;
  position: relative;
}
.statement.invalid::after {
  content: "無効";
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-24deg);
  font-size: 120pt;
  font-weight: 800;
  color: rgba(180, 35, 24, 0.14);
  pointer-events: none;
}
.st-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; border-bottom: 2px solid #111; padding-bottom: 10px; margin-bottom: 14px; }
.st-head h1 { font-size: 20pt; margin: 2px 0; letter-spacing: 0.2em; }
.st-sub { font-size: 9pt; color: #444; }
.st-month { font-size: 13pt; font-weight: 700; }
.st-meta { width: auto; font-size: 9pt; }
.st-meta th, .st-meta td { padding: 1px 0 1px 10px; border: none; background: none; text-align: left; white-space: nowrap; }
.st-meta th { color: #555; font-weight: 500; }
.st-section { margin-bottom: 12px; break-inside: avoid; }
.st-section h2 { font-size: 11.5pt; margin: 0 0 6px; padding-left: 8px; border-left: 4px solid #111; }
.st-section h3 { font-size: 10pt; margin: 10px 0 4px; color: #111; }
.st-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.st-table th, .st-table td { border: 1px solid #999; padding: 4px 7px; background: none; color: #111; }
.st-table thead th, .st-table tfoot th { background: #f0f2f0; font-weight: 600; font-size: 9pt; }
.st-table tbody tr:hover td { background: none; }
.st-table tbody tr:last-child td { border-bottom: 1px solid #999; }
.st-kv th { width: 26%; background: #f6f7f6; text-align: left; font-weight: 500; }
.st-sums td:first-child { width: 72%; }
.st-total td { font-weight: 700; font-size: 12pt; background: #f0f2f0; }
.st-note { font-size: 8.5pt; color: #444; margin: 4px 0 0; }
.center { text-align: center; }
.st-approvals tbody th { background: #f6f7f6; text-align: left; font-weight: 600; width: 30%; }
table.approvals { margin: 0 0 10px; }
.reopen { margin: 8px 0; }
.reopen-ops { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.reopen-ops form { margin: 0; }
.demo-badge { background: #f5c242; color: #3d2c00; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
details.demo-approve { width: 100%; margin-top: 6px; }
details.demo-approve summary { list-style: none; border-style: dashed; color: var(--warn); }
details.demo-approve summary::-webkit-details-marker { display: none; }
details.demo-approve form { margin-top: 10px; padding: 12px; border: 1px dashed #e0c36a; border-radius: 10px; background: var(--warn-soft); max-width: 460px; }
details.reopen-request { margin: 10px 0 4px; }
details.reopen-request summary { cursor: pointer; color: var(--neg); border-color: #f0b4ad; list-style: none; }
details.reopen-request summary::-webkit-details-marker { display: none; }
details.reopen-request[open] summary { background: var(--neg-soft); }
details.reopen-request form { margin-top: 10px; max-width: 460px; }
table.approvals td, table.approvals th { padding: 6px; vertical-align: top; }
.st-details { break-before: auto; }
.st-details .st-table { break-inside: auto; }
.st-details tr { break-inside: avoid; }
.st-foot { margin-top: 14px; padding-top: 8px; border-top: 1px solid #999; font-size: 8pt; color: #444; }

@media screen and (max-width: 820px) {
  .statement { padding: 18px; min-height: 0; }
  .st-head { flex-direction: column; }
}

/* ---------- print ---------- */

.print-only { display: none; }
@media print {
  body, html { background: #fff; }
  header.top, .no-print, .quick-actions, .month-nav, .flash, details.reverse, .segmented, .back { display: none !important; }
  .print-only { display: block; }
  .print-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
  main { padding: 0; max-width: none; }
  .card, .kpi, .table-wrap { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .statement-body { background: #fff; }
  .statement-toolbar { display: none !important; }
  .statement { width: auto; min-height: 0; margin: 0; padding: 0; box-shadow: none; }
}
@page { size: A4; margin: 14mm 13mm; }
