/* 传奇世界 · 商人账簿。玄铁、铸铜、朱砂与玉色；金额始终保持平直清晰。 */
@font-face {
  font-family: "Guild Serif";
  src: url("assets/guild-serif.woff2") format("woff2");
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --canvas: #111715;
  --surface: #222824;
  --surface-quiet: #1a211e;
  --ink: #eee5ce;
  --muted: #b7b6a5;
  --line: #454b40;
  --line-strong: #877655;
  --green: #ddbf7f;
  --green-hover: #f1d69a;
  --green-soft: #393323;
  --red: #f09b88;
  --red-soft: #3e2421;
  --amber: #e5c17d;
  --amber-soft: #352c1d;
  --radius: 2px;
  --focus: 0 0 0 3px #ddbf7f36;
  --merchant-surface: #1a2521;
  --merchant-ink: #f5e8c9;
  --merchant-muted: #bdbea6;
  --merchant-line: #6e6546;
  --guild-serif: "Guild Serif", "Noto Serif SC", "Source Han Serif SC", serif;
  --jade: #a8cdb6;
  --jade-soft: #20372d;
  --bronze: #a88b55;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  letter-spacing: .005em;
  background: var(--canvas);
}
body { color: var(--ink); background: var(--canvas); }
[hidden], .hidden { display: none !important; }
button, input, select, textarea { border-radius: 2px; }
button { touch-action: manipulation; }
button:disabled, input:disabled, select:disabled, textarea:disabled { opacity: .48; cursor: not-allowed; }
input, textarea { caret-color: #e2c586; }
button:focus-visible, a:focus-visible, summary:focus-visible, label[role="button"]:focus-visible { outline: 2px solid #f0d79b; outline-offset: 4px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #d2b574; outline-offset: 2px; border-color: #dfbf79; box-shadow: none; }
::selection { color: #191d17; background: #dbc18c; }
* { scrollbar-color: #756340 #151c18; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #151c18; }
::-webkit-scrollbar-thumb { border-radius: 1px; background: #756340; }
::-webkit-scrollbar-thumb:hover { background: #ac8e56; }
a { color: var(--green); text-underline-offset: 4px; text-decoration-thickness: 1px; }
h1, h2, h3, .brand-name { font-family: var(--guild-serif); }
h1 { font-size: 28px; font-weight: 700; line-height: 1.3; letter-spacing: .06em; color: #f2dfb6; }
h2 { font-size: 19px; letter-spacing: .035em; font-weight: 700; }
h3 { font-size: 17px; letter-spacing: .02em; }
.money, .numeric, input[inputmode="decimal"] { font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; text-shadow: none; }
.muted, .subtle { color: var(--muted); }

/* A narrow, forged-metal tool rail, with the current destination seated into it. */
.app-shell { grid-template-columns: 232px minmax(0, 1fr); }
.sidebar {
  width: 232px; padding: 27px 18px 24px;
  border-right: 1px solid #82704b;
  background: linear-gradient(90deg, #161e1a 0%, #202620 90%, #151b16 100%);
}
.brand { gap: 10px; padding: 0 2px 22px; border-bottom: 1px solid #695b3d; }
.brand > svg { width: 40px; height: 44px; padding: 8px; color: #e0c18a; border: 1px solid #9b8050; border-radius: 1px; background: linear-gradient(#403a28, #24291f); box-shadow: inset 0 0 0 3px #1c221b; stroke-width: 1.6; }
.brand > img { width: 43px; height: 48px; object-fit: contain; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: .09em; color: #eddaad; }
.brand-note { margin-top: 5px; color: #b8ab8c; font-size: 12px; letter-spacing: .015em; }
.book-control { gap: 8px; margin: 22px 0 0; }
.book-control label { color: #b6aa8c; font-size: 12px; letter-spacing: .08em; }
.book-control select { height: 39px; color: #e6d9b8; border: 1px solid #796440; border-radius: 1px; background: #111a15; }
.sidebar-actions { margin: 10px 0 0; gap: 7px; }
.sidebar-actions .button { border-radius: 1px; min-height: 37px; }
.sidebar-actions .button.secondary { background: linear-gradient(#383a2e, #252e24); border-color: #716341; }
.sidebar-actions [data-action="enable-reserves"] { background: transparent; font-size: 12px; }
.nav-list { margin-top: 25px; gap: 5px; }
.nav-item { position: relative; min-height: 44px; padding: 10px 12px; gap: 12px; border: 1px solid #484735; border-radius: 1px; background: #1a231c; color: #c3b89b; font-size: 13px; }
.nav-item svg { color: #b09b6b; width: 18px; height: 18px; stroke-width: 1.6; }
.nav-item:hover, .nav-more > summary:hover { color: #eed7a3; border-color: #977c4c; background: #343627; }
.nav-item[aria-current="page"] { color: #ffe3a7; border-color: #b99859; background: linear-gradient(90deg, #53432a, #323326); box-shadow: inset 0 0 0 2px #1f271e; font-weight: 700; }
.nav-item[aria-current="page"]::after { content: ""; width: 6px; height: 6px; margin-left: auto; flex-shrink: 0; border: 1px solid #d8bc7d; background: #8a6a35; transform: rotate(45deg); }
.nav-item[aria-current="page"] svg { color: #e3c489; }
.nav-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid #4d4933; }
.nav-more > summary { min-height: 38px; padding: 8px 12px; border: 1px solid transparent; color: #b7aa87; border-radius: 1px; font-size: 12px; }
.nav-more .nav-item { font-size: 12px; padding-left: 25px; min-height: 40px; margin-top: 4px; }
.sidebar-foot { padding: 25px 4px 0; }
.save-state { color: #b7c5a7; font-size: 12px; }
.save-state::before { width: 5px; height: 5px; border-radius: 1px; background: #9cba92; }
.save-state.error { color: var(--red); }
.save-state.error::before { background: var(--red); }
.storage-note { color: #aaa78d; font-size: 12px; line-height: 1.8; }
.sidebar-foot > .button { background: #242c23; border-color: #6f6446; border-radius: 1px; }

.main, body[data-page="overview"] .main { max-width: 1500px; padding: 22px 32px 34px; }
.legend-masthead { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: center; min-height: 180px; height: 180px; margin-bottom: 22px; border: 1px solid #a18550; background: #151c18; }
.legend-masthead::after { content: ""; position: absolute; inset: 5px; border: 1px solid #c0a36b55; pointer-events: none; }
.legend-hero-art { position: absolute; z-index: -2; inset: 0 0 0 22%; background: url("assets/zhongzhou-landscape.jpg") center 57% / cover no-repeat; }
.legend-masthead::before { content: ""; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #111a16 0%, #111a16ed 19%, #111a1699 42%, #111a1620 67%, #111a1630 100%); }
.legend-identity { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 25px; max-width: 68%; }
.legend-game-logo { flex-shrink: 0; width: 112px; height: 112px; object-fit: contain; }
.legend-title-block { border-left: 1px solid #a58b5566; padding: 10px 0 10px 20px; }
.legend-tool-title { color: #f2dfad; font-family: var(--guild-serif); font-weight: 700; font-size: 31px; line-height: 1.3; letter-spacing: .12em; white-space: nowrap; }
.legend-tool-subtitle { color: #d4c9a9; font-size: 12px; line-height: 1.8; margin-top: 10px; white-space: nowrap; }
body:not([data-page="overview"]) .legend-masthead { min-height: 120px; height: 120px; }
body:not([data-page="overview"]) .legend-game-logo { width: 88px; height: 88px; }
body:not([data-page="overview"]) .legend-tool-title { font-size: 25px; }
body:not([data-page="overview"]) .legend-tool-subtitle { margin-top: 5px; }
.topbar, body[data-page="overview"] .topbar { display: flex; margin-bottom: 22px; padding: 0 0 16px; border-bottom: 1px solid #7b6943; align-items: end; }
.page-title > p, body[data-page="overview"] .page-title > p { margin-top: 7px; color: var(--muted); font-size: 12px; }
.page, #view-overview { gap: 18px; }
.section-heading { margin-bottom: 18px; }
.panel, .entry-panel, .wallet-panel, .table-panel, .settings-card { border: 1px solid #716144; border-radius: 2px; background: #222824; }
.panel, .entry-panel, .wallet-panel, .settings-card { padding: 23px; }
.panel > .section-heading:first-child, .wallet-panel > .section-heading:first-child { margin: -23px -23px 20px; padding: 14px 22px 12px; border-bottom: 1px solid #74613d; background: linear-gradient(180deg, #37392d, #292e24); }
.panel > .section-heading h2, .wallet-panel > .section-heading h2 { color: #ead5a7; }
.section-heading > div > p, .section-heading > p { color: var(--muted); line-height: 1.7; }
.main-footer { border-top-color: #63573d; color: #aaa48e; font-size: 12px; }

/* Forged red action plates; financial signs use quiet jade and cinnabar. */
.button { border: 1px solid #8f784c; border-radius: 2px; background: linear-gradient(180deg, #3d3d2d, #293024); color: #e5d8b4; font-size: 12px; font-weight: 600; box-shadow: inset 0 1px #ba9b522e, inset 0 -1px #111a15; transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease; }
.button:hover:not(:disabled) { color: #fff0c9; border-color: #d5b577; background: #48442d; }
.button.primary { border-color: #c39455; background: linear-gradient(180deg, #9a4935, #682e25); background-color: #682e25; color: #fff0cf; box-shadow: inset 0 1px #d69b69a6, inset 0 -2px #461c17; }
.button.primary:hover:not(:disabled) { border-color: #e4bc7b; background: linear-gradient(180deg, #a6523b, #813b2c); background-color: #813b2c; }
.button.secondary { background: linear-gradient(180deg, #383e30, #262e24); }
.button.text { color: #dfc489; border-color: transparent; background: transparent; box-shadow: none; }
.button.text:hover:not(:disabled) { color: #ffdda0; border-color: transparent; background: #3c3725; }
.button.danger { color: #f0ac9b; border-color: #945747; background: #382620; }
.button.danger:hover:not(:disabled) { color: #ffd4bf; background: #552c24; border-color: #cc8c69; }
.button.text.danger { border-color: transparent; background: transparent; box-shadow: none; }
.button.small { min-height: 32px; }
.button svg { stroke-width: 1.7; }
.money.positive, .metric-value.positive, .success { color: #a8cdb6; }
.money.negative, .metric-value.negative { color: #f09b88; }
.money { text-shadow: none !important; }

/* The merchant's cash compartment has an inset frame, like the inventory window. */
.funds-summary { gap: 14px; }
.funds-summary > .funds-group, .personal-flow-summary { border-radius: 2px; }
.funds-summary > .merchant-funds { position: relative; padding: 24px 27px; border: 1px solid #b49b62; border-radius: 2px; background: linear-gradient(130deg, #26352d, #17261f 62%, #1e2d23); color: var(--merchant-ink); min-height: 256px; }
.merchant-funds::before { content: ""; pointer-events: none; position: absolute; inset: 7px; border: 1px solid #9a855a55; border-radius: 1px; }
.merchant-funds::after { content: ""; position: absolute; top: -1px; right: -1px; width: 26px; height: 26px; border-top: 3px solid #d0b67c; border-right: 3px solid #d0b67c; pointer-events: none; }
.funds-heading > h2 { font-family: var(--guild-serif); font-size: 16px; font-weight: 700; letter-spacing: .04em; color: #e9d6ac; }
.merchant-funds .funds-heading > h2 { font-size: 18px; color: #ebd7a7; }
.merchant-funds .funds-heading svg { color: #d1b779; stroke-width: 1.5; }
.merchant-balance-row { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 18px 28px; margin: 13px 0 25px; }
.merchant-funds .funds-value { font-size: clamp(35px, 3.4vw, 47px); line-height: 1.15; color: #f8edcf; font-weight: 600; letter-spacing: -.03em; }
.merchant-funds .funds-note { color: #b7bca4; font-size: 12px; margin-top: 7px; }
.merchant-funds .funds-wallets { gap: 11px 20px; font-size: 12px; padding-left: 24px; border-left: 1px solid #756b4c; }
.merchant-funds .funds-wallets dt { color: #b7bca4; }
.merchant-funds .funds-wallets dd { font-size: 15px; color: #f0e5c6; }
.merchant-funds .overview-trade-summary { border-top: 1px solid #756b4c; gap: 13px 22px; padding-top: 18px; }
.merchant-funds .trade-points-line > span { color: #bdc1ab; font-size: 12px; }
.merchant-funds .trade-points-line > strong { margin-top: 3px; font-size: 22px; color: #ebd7a3; font-weight: 500; }
.merchant-funds .overview-trade-summary p { color: #bdc1ab; font-size: 12px; }
.merchant-funds .overview-trade-summary p > strong { color: #e1dfc8; font-size: 12px; }
.merchant-funds .trade-missing { color: #ebcb85; }
.merchant-funds .trade-missing:hover { color: #ffe5ab; background: #3d3e2a; }
.merchant-funds .money.positive { color: #b8d6bb; }
.merchant-funds .money.negative { color: #f1ad95; }
.funds-summary > .own-funds { padding: 16px 20px; background: #242c25; border-color: #877149; }
.own-balance-row { margin-top: 8px; }
.own-balance-row .funds-value { font-size: 27px; font-weight: 550; }
.funds-heading > .button { font-size: 12px; }
.funds-wallets { font-size: 12px; gap: 5px 12px; }
.funds-wallets dd { font-weight: 500; }
.funds-note, .funds-source-details { font-size: 12px; color: var(--muted); }
.funds-source-details summary { text-underline-offset: 4px; }
.personal-flow-summary { background: #202820; border-color: #6d6143; }
.personal-flow-summary > .funds-group { padding: 15px 18px; }
.personal-flow-summary > .funds-group + .funds-group { border-left-color: #61583f; }
.personal-flow-summary .funds-heading > h2 { font-family: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.personal-flow-summary .funds-value { font-size: 23px; margin-top: 5px; font-weight: 550; }
.personal-income .funds-heading svg { color: #9dbea5; }
.personal-spending .funds-heading svg { color: #d9977d; }
.personal-flow-summary .funds-wallets { gap: 4px 8px; }
.overview-ledger-totals { border-radius: 2px; border-color: #7c6945; background: #1b241e; }
.overview-ledger-totals > div { padding: 13px 22px 16px; }
.overview-ledger-totals > div + div { border-left-color: #655b40; }
.overview-ledger-totals .overview-stat-heading > span { color: #c1b38f; font-size: 12px; }
.overview-ledger-totals .overview-stat-heading > .button { font-size: 12px; }
.overview-ledger-totals .overview-stat-heading svg { color: #b49a65; }
.overview-ledger-totals > div > strong { margin-top: 4px; font-size: 25px; font-weight: 550; }
.ledger-combined { gap: 12px; }
.ledger-combined dt { font-size: 12px; color: #c1b38f; }
.ledger-combined dd { margin-top: 6px; font-size: 20px; font-weight: 550; }
.overview-cash-notes { margin-top: -8px; padding: 0 1px; color: #b2ad95; font-size: 12px; }
.wallet-breakdown-grid { border-radius: 2px; border-color: #756341; background: #222a22; }
.wallet-breakdown-item { padding: 13px 18px; }

/* Brass title rails and recessed input slots make the daily controls feel native. */
#view-overview .simple-work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; }
#view-overview .panel { padding: 22px; }
#view-overview .entry-panel { border-color: #b29258; background: #232b24; }
#view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { margin: -22px -22px 19px; padding: 14px 20px 12px; border-bottom: 1px solid #8e7448; background: linear-gradient(#3f4030, #2b3025); }
#view-overview .simple-entry-fields { gap: 13px; }
.field > label, .field > .field-label { color: #c8b992; font-size: 12px; font-weight: 500; }
.field { gap: 6px; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { border: 1px solid #7a6845; border-radius: 1px; background: #101b15; color: #f0e4c7; padding-inline: 10px; box-shadow: inset 0 2px 4px #00000038; }
.field input:not([type="checkbox"]):not([type="radio"]):hover, .field select:hover, .field textarea:hover { border-color: #b59a61; }
.field input::placeholder, .field textarea::placeholder { color: #a39f89; opacity: 1; }
.field input[readonly] { background: #292e25; color: #b7ae92; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #e29e7e; background: #33231e; }
.field input[type="file"]::file-selector-button { border: 1px solid #91794b; border-radius: 1px; background: #393a29; color: #e5d3a2; }
.field-help { color: #b9ae90; font-size: 12px; line-height: 1.65; }
#view-overview .simple-entry-fields #tx-amount { font-size: 18px; background: #1b251a; border-color: #b59b5d; font-weight: 600; }
.checkbox-label { font-size: 12px; color: #c5b897; }
input[type="checkbox"], input[type="radio"] { accent-color: #bc9b5b; }
.sale-conversion-row { color: #b6af96; font-size: 12px; line-height: 1.75; }
.more-fields > summary, .stock-options > summary { color: #d1b57d; font-size: 12px; font-weight: 500; }
.more-fields[open] > summary { margin-bottom: 13px; }
.simple-work-grid .stock-options { border-top-color: #60573c; }
#view-overview .simple-work-grid .form-footer { margin-top: 17px; padding-top: 16px; border-top: 1px solid #75613d; }
.live-effect { color: #beb297; font-size: 12px; }
.form-error { background: #3b241e; border: 1px solid #a4674c; border-radius: 1px; color: #ffc2aa; }
.entry-day input { border: 1px solid #7a6845; border-radius: 1px; background: #101b15; color: #eee5ce; }
.simple-recent-panel { background: #202820; }
.simple-recent-panel > .section-heading { margin-bottom: 4px; }
.simple-recent-panel > .recent-heading { margin-bottom: 7px; gap: 7px; }
.recent-heading > h2 { font-size: 18px; }
.recent-heading .subtle { font-family: "Microsoft YaHei", sans-serif; font-weight: 400; }
.recent-wallet-filter { border-color: #8b764a; border-radius: 1px; background: #172019; padding: 2px; }
.recent-wallet-filter > button { border-radius: 1px; color: #c6b792; font-size: 12px; min-height: 27px; padding-inline: 7px; }
.recent-wallet-filter > button:hover { background: #443e28; color: #f1d69c; }
.recent-wallet-filter > button[aria-pressed="true"] { color: #f9dfac; background: #59472a; }
.button.text.recent-sort { border-color: #887148; background: #2d3427; font-size: 12px; border-radius: 1px; }
.button.text.recent-sort:hover { border-color: #c1a268; background: #45412c; }
.recent-all { font-size: 12px; }
#view-overview .simple-recent-row { padding-top: 11px; padding-bottom: 11px; border-bottom-color: #504d36; }
.record-open { border-radius: 1px; }
.record-open > strong { font-size: 12px; font-weight: 500; text-decoration-color: transparent; }
.record-open:hover > strong { color: #f3d392; text-decoration-color: #bb9c5f; }
#view-overview .simple-recent-row small { margin-top: 4px; font-size: 12px; color: #b3aa8d; line-height: 1.55; }
.simple-recent-row > strong { font-size: 14px; font-weight: 600; }
.simple-recent-row .button { color: #cfbd92; }
.recent-pagination { margin-top: 15px; padding-top: 13px; border-top-style: double; border-top-width: 3px; border-top-color: #74613e; }
.recent-pagination .subtle { font-size: 12px; }
.simple-recent-list > .empty-state { min-height: 240px; }
.empty-state > svg { color: #b7a06b; stroke-width: 1.4; }
.empty-state > h3 { font-family: var(--guild-serif); color: #d7c38f; font-size: 18px; }
.empty-state > p { font-size: 12px; color: #b7ad90; max-width: 65ch; }

/* Every other ledger view uses the same iron-and-brass window furniture. */
.table-panel { border-radius: 2px; }
.panel.table-panel { padding: 0; }
.panel.table-panel > .section-heading { margin: 0; padding: 16px 22px; }
.toolbar { background: #1a231d; border-bottom-color: #6e5d3c; }
.ledger-table th { color: #dec895; background: #343829; border-bottom-color: #9b7d48; font-size: 12px; font-weight: 500; }
.ledger-table td { border-bottom-color: #4b4a34; font-size: 12px; }
.ledger-table tbody tr:hover { background: #303526; }
.ledger-table tbody tr.voided, .ledger-table tr.void-row { color: #aaa58d; background: #20261f; }
.ledger-table tbody tr.voided .money, .ledger-table tr.void-row .money { color: #aaa58d; }
.ledger-table tr.void-row:hover { background: #2a3025; }
.table-scroll { scrollbar-gutter: stable; }
.tag, .badge, .status-pill { border-radius: 1px; border: 1px solid #635c40; background: #303425; color: #d0bf95; font-size: 12px; font-weight: 500; }
.tag.income, .status-pill.ok { border-color: #49634d; background: #243c2e; color: #b7d8bc; }
.tag.expense { border-color: #805344; background: #3e2a22; color: #f1ad96; }
.tag.neutral { background: #2c3329; color: #c5bea2; }
.tag.void { background: #292e24; color: #b5ae91; }
.tag.excluded, .status-pill.diff { border-color: #886a3b; background: #463921; color: #efcf8f; }
.setup-banner { border-color: #927847; border-radius: 2px; background: #38331f; }
.setup-banner p, .setup-banner p strong { color: #dec68f; }
.callout { border-radius: 2px; color: #c9b995; background: #292d20; border-color: #6f6240; }
.callout.warning { border-color: #9b7b43; background: #352c1d; color: #e5cd9a; }
.callout.success { border-color: #68805a; background: #26362a; color: #bad1a8; }
.callout.success .success { color: #bad1a8; }
.wallet-symbol { border-radius: 2px; background: #393c27; color: #d5bd80; }
.wallet-symbol.wechat { background: #2b3c29; color: #b1cc9e; }
.wallet-symbol.alipay { background: #263a38; color: #a9cdc5; }
.wallet-symbol.other { background: #3a3627; color: #cfbd94; }
.wallet-explanation svg, .section-icon { color: #c1a366; }
.rules-list strong { color: #ddc38d; }
.reconcile-result { border-radius: 2px; background: #2c3425; }
.tabs { border-radius: 1px; border-color: #8d7447; background: #17221a; gap: 4px; }
.tab { border-radius: 1px; color: #cbb98f; }
.tab:hover { color: #f0d49a; background: #393b29; }
.tab[aria-selected="true"] { color: #f9dfaa; background: #55482c; box-shadow: inset 0 0 0 1px #a58a50; }
.report-strip { border-radius: 2px; background: #252f23; border-color: #766440; }
#filtered-stats { background: #293021; }
.pagination { background: #20291f; border-top-color: #5c543b; font-size: 12px; }
.merchant-board { --merchant-wheat: #ded09b; --merchant-receipt: #a8cbb9; --merchant-buyback: #dac28b; --merchant-profit: #e6b7a0; --merchant-line: #756742; background: #1d2a21; border: 1px solid #9a8050; border-radius: 2px; }
.merchant-board .merchant-board-header h2 { font-size: 20px; color: #eedab0; }
.merchant-board .merchant-metric strong.money { font-weight: 500; }
.dashboard-wallet-strip { background: #222c23; border-radius: 2px; border-color: #796644; }
.trade-missing:hover { background: #493d25; color: #ffe0a0; }
.trade-point-choices .button[aria-pressed="true"] { color: #ffedc6; background: #5a4828; border-color: #d3b675; }

/* Focused game windows preserve native dialog behavior and keyboard access. */
html:has(dialog[open]) { overflow: hidden; }
dialog.app-dialog { border-radius: 2px; border: 1px solid #b49a61; background: #222a23; color: #eee5ce; box-shadow: 0 22px 80px #000000a6; }
dialog.app-dialog::backdrop { background: #080e0bd9; }
.dialog-header { border-bottom: 1px solid #a98a51; background: linear-gradient(#44402c, #2c3225); padding: 20px 25px; }
.dialog-header h2 { color: #eed5a0; font-size: 22px; letter-spacing: .05em; }
.dialog-body { padding: 25px; }
.dialog-body > p { color: #c1b495; }
.dialog-footer { border-top-color: #8b7044; background: #1b261d; padding: 17px 25px; }
.app-dialog[data-mode="wechat-import"] .dialog-header, .app-dialog[data-mode="points-backfill"] .dialog-header, .app-dialog[data-read-only="true"] .dialog-header { background: linear-gradient(#44402c, #2c3225); }
.transaction-detail { line-height: 1.75; }
.transaction-detail dt { color: #c6b48c; }
.toast { left: calc(50% + 116px); color: #fae8bc; border: 1px solid #bd9b5c; background: #323a28; border-radius: 1px; box-shadow: 0 8px 28px #00000070; }
.toast.error { color: #ffe0cb; border-color: #cc9971; background: #6e3428; }

@media (min-width: 1700px) {
  .main, body[data-page="overview"] .main { padding-top: 30px; padding-inline: 44px; }
  .funds-summary > .merchant-funds { min-height: 280px; padding: 30px; }
}
@media (min-width: 1051px) and (max-height: 820px) {
  .main, body[data-page="overview"] .main { padding-top: 18px; padding-bottom: 28px; }
  body[data-page="overview"] .topbar { margin-bottom: 18px; padding-bottom: 14px; }
  body[data-page="overview"] h1 { font-size: 26px; }
  #view-overview { gap: 16px; }
  .funds-summary > .merchant-funds { padding: 24px 26px; }
  .merchant-balance-row { margin-top: 12px; margin-bottom: 23px; }
  .merchant-funds .funds-value { font-size: 43px; }
  .merchant-funds .overview-trade-summary { padding-top: 16px; }
  .funds-summary > .own-funds { padding: 15px 19px; }
  .personal-flow-summary > .funds-group { padding: 14px 17px; }
  .personal-flow-summary .funds-value { font-size: 22px; margin-top: 5px; line-height: 1.3; }
  .personal-flow-summary .funds-note { font-size: 12px; line-height: 1.5; }
  .overview-ledger-totals > div { padding: 11px 21px 14px; }
  #view-overview .panel { padding: 21px; }
  #view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { margin: -21px -21px 17px; }
  #view-overview .simple-recent-row { padding-top: 10px; padding-bottom: 10px; }
}
@media (max-width: 1250px) and (min-width: 901px) {
  .main, body[data-page="overview"] .main { padding-inline: 25px; }
  .funds-summary > .merchant-funds { padding: 24px; min-height: 282px; }
  .merchant-balance-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .merchant-funds .funds-value { font-size: 41px; }
  .merchant-funds .funds-wallets { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); padding-left: 0; border-left: 0; gap: 6px 12px; }
  .merchant-funds .funds-wallets dd { font-size: 13px; }
  .merchant-funds .trade-points-line > strong { font-size: 19px; }
  .own-balance-row { grid-template-columns: minmax(0, 1fr); }
  .ledger-combined dd { margin-top: 0; font-size: 17px; }
  .personal-flow-summary > .funds-group { padding-inline: 12px; }
}
@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 196px minmax(0, 1fr); }
  .sidebar { width: 196px; padding: 25px 14px 22px; }
  .brand { gap: 8px; padding-bottom: 21px; }
  .brand > svg { width: 34px; height: 39px; padding: 6px; }
  .brand-name { font-size: 19px; }
  .brand-note { font-size: 12px; letter-spacing: 0; }
  .main, body[data-page="overview"] .main { padding: 23px 22px 36px; }
  .legend-identity { padding-inline: 20px; gap: 9px; max-width: 80%; }
  .legend-game-logo { width: 94px; height: 94px; }
  .legend-title-block { padding-left: 15px; }
  .legend-tool-title { font-size: 27px; }
  .legend-tool-subtitle { letter-spacing: 0; }
  .toast { left: calc(50% + 98px); }
  .personal-flow-summary .funds-heading > h2 { font-size: 12px; }
  .simple-recent-panel > .recent-heading { grid-template-columns: minmax(0, 1fr) auto auto; }
  .recent-heading > h2 { grid-column: 1; grid-row: 1; }
  .recent-heading > .recent-sort { grid-column: 2; grid-row: 1; }
  .recent-heading > .recent-all { grid-column: 3; grid-row: 1; }
  .recent-heading > .recent-wallet-filter { grid-column: 1 / -1; grid-row: 2; max-width: 100%; flex-wrap: wrap; }
}
@media (max-width: 900px) {
  #view-overview .simple-work-grid { grid-template-columns: minmax(0, 1fr); }
  .funds-summary > .merchant-funds { min-height: 256px; padding: 25px; }
  .merchant-balance-row { margin-bottom: 25px; }
  .merchant-funds .funds-value { font-size: 42px; }
  .funds-summary > .own-funds { padding: 18px; }
  .personal-flow-summary > .funds-group { padding: 17px 15px; }
  .overview-ledger-totals > div { padding: 12px 16px 15px; }
  .ledger-combined dd { font-size: 17px; margin-top: 0; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar, body[data-page="overview"] .sidebar { position: static; width: 100%; height: auto; padding: 18px 19px 0; border-right: 0; border-bottom: 1px solid #877247; background: #1c251e; }
  .brand { gap: 10px; padding: 0; border: 0; }
  .brand > svg { width: 35px; height: 39px; padding: 7px; }
  .brand-name { font-size: 21px; }
  .brand-note { font-size: 12px; letter-spacing: .025em; margin-top: 3px; }
  .book-control { grid-template-columns: auto minmax(0, 1fr); margin-top: 17px; gap: 14px; }
  .book-control select { height: 38px; min-height: 38px; font-size: 12px; }
  .sidebar-actions { margin-top: 9px; gap: 8px; }
  .sidebar-actions .button { min-height: 39px; }
  .sidebar-actions [data-action="enable-reserves"] { min-height: 32px; }
  .nav-list { margin: 14px -19px 0; padding: 0 19px 11px; gap: 7px; scrollbar-width: thin; scrollbar-color: #9d844f transparent; }
  .nav-list::-webkit-scrollbar { display: block; height: 3px; }
  .nav-list::-webkit-scrollbar-track { background: transparent; }
  .nav-item { width: auto; flex-shrink: 0; min-height: 40px; padding: 9px 11px; font-size: 12px; border-radius: 1px; }
  .nav-item svg { width: 16px; height: 16px; }
  .nav-item[aria-current="page"]::after { display: none; }
  .nav-more { margin: 0 -19px; padding: 0 19px; border-top: 1px solid #504b34; }
  .nav-more > summary { min-height: 35px; padding: 7px 0; font-size: 12px; }
  .nav-more[open] { padding-bottom: 12px; }
  .nav-more .nav-item { width: 100%; justify-content: start; min-height: 39px; }
  .sidebar-foot { display: none; }
  .main, body[data-page="overview"] .main { padding: 20px 17px calc(30px + env(safe-area-inset-bottom, 0px)); }
  .legend-masthead { min-height: 140px; height: 140px; margin-bottom: 20px; }
  .legend-hero-art { left: 5%; background-position: 57% 56%; }
  .legend-masthead::before { background: linear-gradient(90deg, #111a16f5, #111a16cc 35%, #111a1655 72%, #111a1640); }
  .legend-identity { gap: 4px; padding: 12px 12px; max-width: 100%; }
  .legend-game-logo { width: 90px; height: 90px; }
  .legend-title-block { padding: 6px 0 6px 12px; }
  .legend-tool-title { font-size: 27px; letter-spacing: .1em; }
  .legend-tool-subtitle { max-width: 190px; font-size: 12px; white-space: normal; line-height: 1.75; margin-top: 7px; }
  body:not([data-page="overview"]) .legend-masthead { min-height: 100px; height: 100px; }
  body:not([data-page="overview"]) .legend-game-logo { width: 72px; height: 72px; }
  body:not([data-page="overview"]) .legend-tool-title { font-size: 24px; }
  .topbar, body[data-page="overview"] .topbar { margin-bottom: 20px; padding-bottom: 15px; }
  h1, body[data-page="overview"] h1 { font-size: 26px; }
  h2 { font-size: 19px; }
  .page, #view-overview { gap: 17px; }
  .funds-summary { gap: 12px; }
  .funds-summary > .merchant-funds { min-height: 0; padding: 25px 23px; }
  .merchant-balance-row { grid-template-columns: minmax(0, 1fr); margin: 14px 0 22px; gap: 18px; }
  .merchant-funds .funds-value { font-size: 39px; }
  .merchant-funds .funds-wallets { grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); padding: 0; border: 0; gap: 6px 12px; font-size: 12px; }
  .merchant-funds .funds-wallets dd { font-size: 13px; }
  .merchant-funds .overview-trade-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-top: 18px; }
  .merchant-funds .trade-points-line > strong { font-size: 22px; }
  .merchant-funds .overview-trade-summary > div:last-child { padding-top: 13px; border-top: 1px solid #756b4c; }
  .merchant-funds .overview-trade-summary > div:last-child .trade-points-line { justify-content: space-between; flex: 1; }
  .funds-summary > .own-funds { padding: 18px 20px; }
  .own-balance-row { margin-top: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .own-balance-row .funds-value { font-size: 26px; }
  .personal-flow-summary > .funds-group { padding: 18px 20px; }
  .personal-flow-summary .funds-heading > h2 { font-size: 12px; }
  .personal-flow-summary .funds-value { font-size: 25px; margin-top: 7px; }
  .overview-ledger-totals > div { padding: 12px 18px 16px; }
  .overview-ledger-totals > div > strong { font-size: 24px; }
  .overview-ledger-totals > .wallet-total-module { padding: 15px 18px; }
  .ledger-combined dd { margin-top: 5px; font-size: 19px; }
  .overview-cash-notes { margin-top: -6px; font-size: 12px; line-height: 1.7; }
  #view-overview .panel, .panel, .entry-panel, .wallet-panel, .settings-card { padding: 21px 19px; }
  .panel > .section-heading:first-child, .wallet-panel > .section-heading:first-child { margin: -21px -19px 20px; padding: 14px 18px 12px; }
  #view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { margin: -21px -19px 19px; padding: 14px 17px 12px; }
  .panel.table-panel { padding: 0; }
  .panel.table-panel > .section-heading { margin: 0; padding: 14px 18px; }
  #view-overview .simple-entry-fields { gap: 16px 12px; }
  #view-overview .simple-entry-fields input, #view-overview .simple-entry-fields select { height: 44px; font-size: 16px; }
  #view-overview .simple-entry-fields #tx-amount { height: 46px; font-size: 20px; }
  .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; }
  .field input[type="file"] { font-size: 12px; }
  .sale-conversion-row { margin-top: 10px; }
  .checkbox-label { min-height: 36px; line-height: 1.6; }
  .more-fields > summary, .stock-options > summary { padding-block: 7px; }
  .form-footer { flex-wrap: wrap; gap: 13px; }
  .form-footer .section-actions { margin-left: auto; }
  .form-footer .button.primary { min-height: 43px; padding-inline: 21px; }
  .simple-recent-panel > .recent-heading { grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 7px; }
  .recent-heading > h2 { grid-column: 1; grid-row: 1; }
  .recent-heading > .recent-sort { grid-column: 2; grid-row: 1; }
  .recent-heading > .recent-all { grid-column: 3; grid-row: 1; }
  .recent-heading > .recent-wallet-filter { grid-column: 1 / -1; grid-row: 2; max-width: 100%; flex-wrap: wrap; }
  .recent-wallet-filter > button { min-height: 32px; padding-inline: 12px; }
  #view-overview .simple-recent-row { gap: 10px; padding-block: 14px; }
  .simple-recent-row > strong { font-size: 14px; }
  #view-overview .simple-recent-row small { font-size: 12px; }
  .recent-pagination { align-items: start; gap: 13px; }
  .recent-pagination .section-actions { margin-left: auto; }
  .recent-pagination .button { min-height: 36px; }
  .toolbar, .table-panel > .section-heading { padding-inline: 18px; }
  .ledger-table th:first-child, .ledger-table td:first-child { padding-left: 18px; }
  .ledger-table th:last-child, .ledger-table td:last-child { padding-right: 18px; }
  .filter-grid .field input, .filter-grid .field select { height: 42px; font-size: 16px; }
  .pagination { padding-inline: 18px; flex-wrap: wrap; gap: 12px; }
  .toast { left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); font-size: 12px; }
  dialog.app-dialog { width: calc(100vw - 24px); max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); border-radius: 2px; }
  .dialog-header { padding: 19px 20px; }
  .dialog-header h2 { font-size: 21px; }
  .dialog-body { padding: 22px 20px; }
  .dialog-footer { padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .dialog-footer .button { min-height: 42px; }
  .transaction-detail { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 374px) {
  .main, body[data-page="overview"] .main { padding-inline: 13px; }
  .sidebar { padding-inline: 16px; }
  .nav-list { margin-inline: -16px; padding-inline: 16px; }
  .nav-more { margin-inline: -16px; padding-inline: 16px; }
  .legend-game-logo { width: 78px; height: 78px; }
  .legend-identity { padding-inline: 8px; }
  .legend-title-block { padding-left: 9px; }
  .legend-tool-title { font-size: 24px; }
  .legend-tool-subtitle { max-width: 170px; }
  .merchant-funds .funds-value { font-size: 34px; }
  .funds-summary > .merchant-funds { padding: 23px 20px; }
  .personal-flow-summary > .funds-group { padding: 16px 14px; }
  .own-balance-row .funds-value { font-size: 22px; }
  .funds-heading > .button { font-size: 12px; }
  .simple-recent-row { grid-template-columns: minmax(0, 1fr) auto; }
  .simple-recent-row > .button { grid-column: 2; }
  .recent-heading > h2 { font-size: 17px; }
  .recent-all { gap: 4px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0ms !important; animation-duration: 0ms !important; }
}
/* Daily ledger: clear figures, quiet brass, and a deliberate two-column rhythm. */
@media screen {
  :root { --panel-rule: #595c48; --quiet-rule: #414b40; --label-ink: #c9ccb9; }
  .main, body[data-page="overview"] .main { padding-top: 26px; }
  .panel, .entry-panel, .wallet-panel, .table-panel, .settings-card { border-color: var(--panel-rule); }
  .topbar, body[data-page="overview"] .topbar { border-bottom-color: #656045; }
  .page-title > p, body[data-page="overview"] .page-title > p { font-size: 13px; }
  .button { font-size: 13px; }
  .button.text { font-weight: 500; text-underline-offset: 5px; }
  .field > label, .field > .field-label { color: var(--label-ink); font-size: 13px; line-height: 1.6; }
  .field { gap: 8px; }
  .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { border-color: #646950; font-size: 14px; color: #ede9d7; }
  .field input::placeholder, .field textarea::placeholder { color: #a9b09e; font-weight: 400; letter-spacing: 0; }
  .field-help, .sale-conversion-row { color: #b0b6a3; line-height: 1.8; }
  .checkbox-label { color: #bfc4b0; font-size: 13px; line-height: 1.7; gap: 8px; }
  input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; flex-shrink: 0; }
  .more-fields > summary, .stock-options > summary { color: #c9cbb6; font-size: 13px; }

  .funds-summary { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); grid-template-rows: auto; gap: 18px; align-items: stretch; }
  .funds-summary > .merchant-funds { grid-column: auto; grid-row: auto; justify-content: flex-start; min-height: 0; padding: 24px 28px; container-type: inline-size; border-color: #9d8758; background: linear-gradient(120deg, #24352c, #192920 80%); }
  .merchant-funds::before { inset: 6px; border-color: #82926b24; }
  .merchant-funds::after { width: 20px; height: 20px; border-width: 2px; border-color: #c4aa71; }
  .merchant-funds .funds-heading > h2 { font-size: 18px; letter-spacing: .055em; }
  .merchant-balance-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 28px; margin: 18px 0 24px; }
  .merchant-balance-main { flex: 1 1 180px; min-width: max-content; max-width: 100%; }
  .merchant-funds .funds-value { margin: 0; font-size: clamp(28px, 7.5cqi, 46px); font-weight: 600; line-height: 1.15; white-space: nowrap; overflow-wrap: normal; }
  .merchant-funds .funds-note { margin-top: 10px; color: #b7c1ad; font-size: 12px; }
  .funds-summary .funds-wallets { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
  .funds-wallets .wallet-pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; min-width: 0; max-width: 100%; }
  .funds-wallets .wallet-pair dt, .funds-wallets .wallet-pair dd { margin: 0; text-align: left; white-space: nowrap; }
  .funds-summary .funds-wallets dt { color: #b4bca8; font-size: 12px; }
  .funds-summary .funds-wallets dd { color: #e6e7d4; font-weight: 500; font-size: 13px; overflow-wrap: normal; }
  .merchant-funds .funds-wallets { width: max-content; max-width: 100%; margin: 0; padding-left: 24px; border-left: 1px solid #626f52; gap: 9px; }
  .merchant-funds .funds-wallets dd { font-size: 14px; }
  .merchant-funds .overview-trade-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 0; padding-top: 20px; border-top-color: #606c50; }
  .merchant-funds .trade-points-line > span { color: #bdc5b3; font-size: 13px; }
  .merchant-funds .trade-points-line > strong { margin-top: 5px; color: #eee5c9; font-size: clamp(16px, 4cqi, 24px); font-weight: 500; line-height: 1.4; }
  .merchant-funds .overview-trade-summary p { margin-top: 6px; color: #acb8a3; font-size: 12px; line-height: 1.65; }
  .merchant-funds .overview-trade-summary p > strong { margin-left: 4px; color: #d6deca; font-weight: 400; }

  .funds-secondary { min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--panel-rule); border-radius: 2px; background: #202820; }
  .funds-secondary > .own-funds { padding: 17px 22px 15px; container-type: inline-size; }
  .funds-heading > h2 { color: #e5d8b8; }
  .funds-heading > .button { font-size: 12px; min-height: 30px; font-weight: 400; }
  .own-balance-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px; margin: 9px 0 0; }
  .own-balance-row .funds-value { font-size: clamp(22px, 7cqi, 30px); font-weight: 550; white-space: nowrap; overflow-wrap: normal; }
  .funds-split-details { min-width: 0; max-width: 100%; font-size: 12px; color: #b8c0a9; }
  .funds-split-details > summary { width: fit-content; min-height: 26px; padding-block: 4px; cursor: pointer; }
  .funds-split-details > summary:hover, .funds-source-details > summary:hover { color: #efd39a; }
  .funds-split-details[open] { flex-basis: 100%; }
  .funds-split-details .funds-wallets { margin: 7px 0 2px; gap: 6px; }
  .funds-source-details { margin-top: 5px; color: #b0b7a2; }
  .funds-source-details > summary { min-height: 25px; line-height: 21px; }
  .funds-secondary > .personal-flow-summary { grid-column: auto; flex: 1; border: 0; border-top: 1px solid var(--quiet-rule); border-radius: 0; background: transparent; }
  .personal-flow-summary > .funds-group { padding: 15px 22px 17px; min-width: 0; container-type: inline-size; }
  .personal-flow-summary > .funds-group + .funds-group { border-left-color: var(--quiet-rule); }
  .personal-flow-summary .funds-heading { align-items: center; gap: 4px 12px; }
  .personal-flow-summary .funds-heading > h2 { color: #d8ddc8; font-size: 14px; font-weight: 500; white-space: nowrap; }
  .personal-flow-summary .funds-heading > .button { min-height: 28px; padding: 2px 0; font-size: 12px; font-weight: 400; text-decoration: underline; }
  .personal-flow-summary .funds-value { margin: 7px 0 5px; color: #e4e6d4; font-size: 26px; font-weight: 500; white-space: nowrap; overflow-wrap: normal; }
  .personal-flow-summary .funds-value.long-amount { font-size: clamp(14px, 11cqi, 26px); }
  .merchant-funds .trade-points-line > strong.long-amount { font-size: clamp(14px, 3cqi, 20px); white-space: nowrap; overflow-wrap: normal; }
  .personal-flow-summary .funds-note { margin-top: 5px; color: #aeb6a0; font-size: 12px; }

  .overview-ledger-totals { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr); border-color: var(--panel-rule); background: #1b251e; }
  .overview-ledger-totals > .wallet-cash-module, .ledger-combined > div { padding: 16px 22px 18px; min-width: 0; container-type: inline-size; }
  .overview-ledger-totals > div + div, .ledger-combined > div + div { border-left: 1px solid var(--quiet-rule); }
  .overview-ledger-totals > .wallet-total-module { padding: 0; justify-content: flex-start; }
  .ledger-combined { width: 100%; height: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; }
  .ledger-combined > div { display: block; }
  .ledger-combined dt, .overview-ledger-totals .overview-stat-heading { min-height: 30px; line-height: 30px; }
  .ledger-combined dt, .overview-ledger-totals .overview-stat-heading > span { color: #b7bea8; font-size: 13px; }
  .overview-ledger-totals .overview-stat-heading > .button { min-height: 30px; line-height: 26px; padding: 0; font-size: 12px; font-weight: 400; }
  .overview-ledger-totals > div > strong, .ledger-combined dd { display: block; margin: 6px 0 0; color: #e9e7d2; font-size: 24px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow-wrap: normal; }
  .overview-ledger-totals > div > strong.long-amount, .ledger-combined dd.long-amount { font-size: clamp(14px, 9cqi, 24px); }
  .cash-review-bar { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 24px; margin-top: -6px; padding-inline: 1px; }
  .cash-review-bar > .wallet-breakdown { max-width: 100%; }
  .cash-review-bar > .wallet-breakdown[open] { flex-basis: 100%; }
  .wallet-breakdown > summary { min-height: 30px; line-height: 26px; font-size: 12px; color: #c5b78e; }
  .overview-cash-notes { margin: 0 0 0 auto; font-size: 12px; color: #adb5a0; }
  .wallet-breakdown-grid { border-color: var(--panel-rule); background: #202820; }

  #view-overview .simple-work-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 20px; align-items: start; }
  #view-overview .panel { padding: 24px; }
  #view-overview .entry-panel { border-color: #8e7b51; background: #222b23; }
  #view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { margin: -24px -24px 24px; padding: 18px 23px 16px; border-bottom-color: #656448; background: linear-gradient(180deg, #343a2d, #2a3227); }
  #view-overview .entry-panel > .section-heading h2, .recent-heading > h2 { font-size: 20px; letter-spacing: .045em; }
  .entry-day { font-size: 12px; color: #bfc2ad; }
  .entry-day input { height: 36px; min-height: 36px; padding-inline: 10px; border-color: #74744f; font-size: 13px; }
  #view-overview .simple-entry-fields, #view-overview .simple-entry-fields.sale-entry { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
  #view-overview .simple-entry-fields > #amount-field { grid-column: auto; }
  #view-overview .simple-entry-fields input, #view-overview .simple-entry-fields select, #view-overview .simple-entry-fields #tx-amount { height: 46px; font-size: 14px; }
  #view-overview .simple-entry-fields #tx-amount { background: #131f17; border-color: #8b8558; font-size: 18px; font-weight: 550; }
  #view-overview .simple-entry-fields #tx-amount::placeholder { font-size: 14px; font-weight: 400; color: #b1b6a0; }
  .sale-conversion-row { margin-top: 14px; }
  .simple-work-grid .tx-excluded-control { margin-top: 13px; color: #b0b8a1; font-size: 12px; }
  .simple-work-grid .more-fields { margin-top: 18px; border-top: 1px solid var(--quiet-rule); padding-top: 6px; }
  .simple-work-grid .more-fields > summary { min-height: 38px; padding-block: 8px; }
  .simple-work-grid .stock-options { margin-top: 20px; padding-top: 12px; border-top-color: var(--quiet-rule); }
  .simple-work-grid .stock-options > summary { min-height: 34px; padding-block: 6px; }
  .simple-work-grid .more-fields > .field-grid { gap: 18px 16px; }
  .simple-work-grid .more-fields .field input { height: 44px; min-width: 0; width: 100%; }
  #view-overview .simple-work-grid .form-footer { margin-top: 20px; padding-top: 20px; border-top-color: #5d654a; gap: 14px; }
  .live-effect { color: #c0c7b2; font-size: 13px; }
  #save-transaction { min-width: 116px; min-height: 44px; font-size: 14px; letter-spacing: .035em; }
  .simple-recent-panel { background: #1f2820; }
  .simple-recent-panel > .recent-heading, .simple-recent-panel > .recent-heading.multi-wallets { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px 12px; margin-bottom: 0; }
  .recent-heading > h2, .recent-heading.multi-wallets > h2 { grid-column: 1; grid-row: 1; }
  .recent-heading > .recent-sort, .recent-heading.multi-wallets > .recent-sort { grid-column: 2; grid-row: 1; }
  .recent-heading > .recent-all, .recent-heading.multi-wallets > .recent-all { grid-column: 3; grid-row: 1; }
  .recent-heading .subtle { color: #b7bca6; font-size: 12px; letter-spacing: 0; }
  .recent-heading > .recent-wallet-filter, .recent-heading.multi-wallets > .recent-wallet-filter { grid-column: 1 / -1; grid-row: 2; display: flex; justify-self: stretch; max-width: 100%; flex-wrap: wrap; gap: 4px; padding: 4px; border: 1px solid #586146; background: #172219; }
  .recent-wallet-filter > button { min-height: 34px; padding: 6px 12px; color: #bac2aa; font-size: 13px; font-weight: 400; }
  .recent-wallet-filter > button[aria-pressed="true"] { color: #fff0c9; background: #655333; box-shadow: inset 0 0 0 1px #9e8654; font-weight: 600; }
  .button.text.recent-sort { border-color: #62694c; background: #283323; font-weight: 400; padding-inline: 9px; }
  .recent-all { font-weight: 400; padding-inline: 0; }
  #view-overview .simple-recent-row { padding-block: 16px; border-bottom-color: var(--quiet-rule); gap: 12px; }
  #view-overview .record-open > strong { font-size: 14px; line-height: 1.5; color: #e1e4d0; }
  #view-overview .simple-recent-row small { margin-top: 5px; font-size: 12px; color: #adb6a0; line-height: 1.6; }
  .simple-recent-row > strong { font-size: 16px; }
  .simple-recent-list > .empty-state { min-height: 256px; padding: 38px 12px; }
  .empty-state > svg { width: 30px; height: 30px; color: #9f956c; }
  .empty-state > h3 { margin-top: 18px; color: #d3d6bd; font-size: 18px; letter-spacing: .04em; }
  .empty-state > p { margin-top: 10px; color: #acb59d; font-size: 13px; line-height: 1.8; }
  .recent-pagination { margin-top: 0; padding-top: 16px; border-top: 1px solid var(--quiet-rule); font-size: 12px; }
}
@container (max-width: 150px) {
  .personal-flow-summary .funds-heading svg { display: none; }
}
@media screen and (max-width: 1250px) {
  .funds-summary { grid-template-columns: minmax(0, 1fr); }
  .funds-summary > .merchant-funds { padding: 24px 26px; }
  .funds-secondary { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); }
  .funds-secondary > .personal-flow-summary { grid-column: auto; border-top: 0; border-left: 1px solid var(--quiet-rule); }
  .funds-secondary > .own-funds { padding: 18px 22px; }
  .personal-flow-summary > .funds-group { padding: 18px; }
  .overview-ledger-totals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .overview-ledger-totals > .wallet-total-module { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--quiet-rule); }
  #view-overview .simple-work-grid { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 1050px) {
  .funds-secondary { display: flex; }
  .funds-secondary > .personal-flow-summary { border-left: 0; border-top: 1px solid var(--quiet-rule); }
}
@media screen and (max-width: 720px) {
  .main, body[data-page="overview"] .main { padding-top: 20px; }
  .funds-summary { gap: 16px; }
  .funds-summary > .merchant-funds { padding: 24px 20px; }
  .merchant-balance-row { gap: 18px; margin: 17px 0 22px; }
  .merchant-balance-main { flex-basis: 100%; }
  .merchant-funds .funds-value { font-size: clamp(28px, 9cqi, 40px); }
  .merchant-funds .funds-wallets { padding: 0; border: 0; }
  .merchant-funds .overview-trade-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding-top: 18px; }
  .merchant-funds .trade-points-line > strong { font-size: 23px; }
  .merchant-funds .overview-trade-summary > div:last-child { padding-top: 14px; border-top-color: #606c50; }
  .funds-secondary { display: flex; }
  .funds-secondary > .own-funds { padding: 18px 20px; }
  .funds-secondary > .personal-flow-summary { border-left: 0; border-top: 1px solid var(--quiet-rule); }
  .personal-flow-summary > .funds-group { padding: 16px 18px; }
  .overview-ledger-totals > .wallet-cash-module, .ledger-combined > div { padding: 13px 14px 16px; }
  .overview-ledger-totals > div > strong, .ledger-combined dd { font-size: 22px; }
  .overview-ledger-totals .overview-stat-heading { flex-wrap: wrap; }
  .ledger-combined dt, .overview-ledger-totals .overview-stat-heading > span { font-size: 12px; }
  .cash-review-bar { gap: 2px 12px; }
  .overview-cash-notes { margin-left: 0; flex-basis: 100%; }
  #view-overview .panel { padding: 22px 18px; }
  #view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { margin: -22px -18px 22px; padding: 16px 17px; }
  #view-overview .entry-panel > .section-heading { flex-wrap: wrap; gap: 12px; }
  #view-overview .entry-panel > .section-heading h2, .recent-heading > h2 { font-size: 19px; }
  .entry-day { margin-left: auto; }
  #view-overview .simple-entry-fields, #view-overview .simple-entry-fields.sale-entry { gap: 17px 12px; }
  #view-overview .simple-entry-fields input, #view-overview .simple-entry-fields select, #view-overview .simple-entry-fields #tx-amount { min-width: 0; font-size: 16px; height: 46px; }
  #view-overview .simple-entry-fields #tx-amount::placeholder { font-size: 16px; }
  .field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea { font-size: 16px; }
  .recent-heading > h2, .recent-heading.multi-wallets > h2 { grid-column: 1 / 3; }
  .recent-heading > .recent-sort, .recent-heading.multi-wallets > .recent-sort { grid-column: 1; grid-row: 2; justify-self: start; }
  .recent-heading > .recent-all, .recent-heading.multi-wallets > .recent-all { grid-column: 3; grid-row: 1; }
  .recent-heading > .recent-wallet-filter, .recent-heading.multi-wallets > .recent-wallet-filter { grid-row: 3; gap: 4px; }
  .recent-wallet-filter > button { min-height: 40px; padding-inline: 10px; font-size: 13px; }
  .simple-recent-panel > .recent-heading, .simple-recent-panel > .recent-heading.multi-wallets { margin-bottom: 0; gap: 12px 6px; }
  .simple-recent-list > .empty-state { min-height: 240px; }
  .simple-recent-row > strong { font-size: 14px; }
  .simple-work-grid .more-fields > .field-grid { grid-template-columns: minmax(0, 1fr); }
}
@media screen and (max-width: 374px) {
  .personal-flow-summary { grid-template-columns: minmax(0, 1fr); }
  .personal-flow-summary > .funds-group + .funds-group { border-left: 0; border-top: 1px solid var(--quiet-rule); }
  .personal-flow-summary .funds-value { font-size: 26px; }
  #view-overview .simple-entry-fields, #view-overview .simple-entry-fields.sale-entry { grid-template-columns: minmax(0, 1fr); }
  #view-overview .simple-entry-fields > .field { grid-column: 1; }
  .overview-ledger-totals > .wallet-cash-module, .ledger-combined > div { padding-inline: 11px; }
}
@media print {
  :root { color-scheme: light; --ink: #222; --muted: #555; --line: #aaa; }
  body, .main, .panel, .funds-summary > .own-funds, .personal-flow-summary, .overview-ledger-totals { background: white; color: #222; }
  .legend-masthead { display: none; }
  .funds-summary > .merchant-funds { color: #222; background: white; border: 1px solid #999; }
  .merchant-funds::before, .merchant-funds::after { display: none; }
  .merchant-funds .funds-value, .merchant-funds .funds-wallets dd, .merchant-funds .trade-points-line > strong, .merchant-funds .overview-trade-summary p > strong { color: #222; }
  .merchant-funds .funds-note, .merchant-funds .funds-wallets dt, .merchant-funds .trade-points-line > span, .merchant-funds .overview-trade-summary p { color: #555; }
  .topbar, body[data-page="overview"] .topbar { display: flex; border-color: #aaa; }
  .panel > .section-heading:first-child, .wallet-panel > .section-heading:first-child, #view-overview .entry-panel > .section-heading, .simple-recent-panel > .recent-heading { background: white; color: #222; }
  .ledger-table th, .ledger-table td { color: #222; background: white; border-color: #aaa; }
  h1, h2, h3, .funds-heading > h2, .merchant-funds .funds-heading > h2 { color: #222; }
  .table-scroll { overflow: visible; }
}
