  :root {
    box-sizing: border-box;
    --bg: #EEEDE1;
    --surface: #FFFFFF;
    --surface-2: #F6F5EC;
    --ink: #1E2A22;
    --ink-muted: #5C6558;
    --ink-faint: #8B9184;
    --moss: #2F4A3C;
    --moss-dark: #22362B;
    --moss-tint: #E7EDE7;
    --amber: #C08A2E;
    --amber-deep: #96690F;
    --amber-tint: #FBF0DB;
    --rust: #A6431F;
    --rust-tint: #FBE9E1;
    --line: #D9D6C6;
    --line-strong: #C3C0AC;
    --radius: 5px;
    --font-ui: 'IBM Plex Sans', system-ui, sans-serif;
    --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #1A1F1A; --surface: #212820; --surface-2: #262E25; --ink: #EAE8DC;
      --ink-muted: #A9AF9E; --ink-faint: #757C6C; --moss: #6FA085; --moss-dark: #587F68;
      --moss-tint: #26332A; --amber: #E0AC52; --amber-deep: #F0C374; --amber-tint: #33291A;
      --rust: #E27C56; --rust-tint: #362019; --line: #384034; --line-strong: #47513F;
    }
  }
  :root[data-theme="dark"] {
    --bg: #1A1F1A; --surface: #212820; --surface-2: #262E25; --ink: #EAE8DC;
    --ink-muted: #A9AF9E; --ink-faint: #757C6C; --moss: #6FA085; --moss-dark: #587F68;
    --moss-tint: #26332A; --amber: #E0AC52; --amber-deep: #F0C374; --amber-tint: #33291A;
    --rust: #E27C56; --rust-tint: #362019; --line: #384034; --line-strong: #47513F;
  }
  html, body { height: 100%; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body { overflow-x: hidden; }
  * { box-sizing: border-box; }
  html { scroll-padding-top: env(safe-area-inset-top, 0px); }
  body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-ui); font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
  button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
  a { color: var(--moss-dark); }

  #shell { display: flex; min-height: 100%; }
  #login-screen { min-height: 100vh; align-items: center; justify-content: center; padding: 20px; }
  #login-screen .login-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; width: 100%; max-width: 360px; }
  #login-screen h1 { font-size: 19px; margin: 0 0 4px; }
  #login-screen p.sub { margin: 0 0 22px; color: var(--ink-muted); font-size: 13.5px; }
  #login-screen .field { margin-bottom: 14px; }
  #login-error { color: var(--rust); font-size: 12.5px; min-height: 16px; margin: 2px 0 4px; }
  #login-mode-hint { font-size: 12.5px; color: var(--ink-muted); margin-top: 16px; }
  #login-mode-hint a { color: var(--moss-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
  #sidebar { width: 230px; flex-shrink: 0; background: var(--moss); color: #F2F3EC; padding: 22px 16px; display: flex; flex-direction: column; gap: 26px; }
  #sidebar .brand { display: flex; flex-direction: column; gap: 2px; padding: 0 6px; }
  #sidebar .brand .mark { font-family: var(--font-mono); font-size: 12px; letter-spacing: .04em; color: #C9D9CC; }
  #sidebar .brand .name { font-size: 18px; font-weight: 600; line-height: 1.25; }
  #sidebar .brand .tag { font-size: 11.5px; color: #B9C8BB; margin-top: 2px; }
  #sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  #sidebar nav button { all: unset; cursor: pointer; padding: 9px 10px; border-radius: var(--radius); display: flex; align-items: center; gap: 10px; font-size: 14px; color: #D9E2DA; transition: background .15s ease, color .15s ease; }
  #sidebar nav button:hover { background: rgba(255,255,255,0.08); color: #fff; }
  #sidebar nav button.active { background: #F2F3EC; color: var(--moss-dark); font-weight: 600; }
  #sidebar nav .icon { width: 16px; text-align: center; font-family: var(--font-mono); font-size: 13px; opacity: .85; }
  #sidebar .foot { margin-top: auto; font-size: 11.5px; color: #AEBDAF; padding: 0 6px; line-height: 1.6; }
  #sidebar .foot button { all: unset; cursor: pointer; color: #D9E2DA; text-decoration: underline; text-underline-offset: 2px; }

  #main { flex: 1; min-width: 0; padding: 30px 36px 60px; }
  .page-head { margin-bottom: 22px; }
  .page-head h1 { font-size: 22px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
  .page-head p { margin: 0; color: var(--ink-muted); font-size: 13.5px; max-width: 60ch; }

  .cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; margin-bottom: 26px; }
  .card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
  .card .label { font-size: 12px; color: var(--ink-muted); margin-bottom: 8px; }
  .card .value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
  .card .sub { font-size: 12px; color: var(--ink-faint); margin-top: 4px; font-family: var(--font-mono); }
  .card.accent { border-color: var(--amber); background: var(--amber-tint); }
  .card.accent .value { color: var(--amber-deep); }

  .panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
  .panel-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
  .panel-head h2 { font-size: 15px; font-weight: 600; margin: 0; }
  .panel-body { padding: 18px; }

  .tabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .tabs button { all: unset; cursor: pointer; white-space: nowrap; padding: 8px 4px; margin-right: 20px; font-size: 13.5px; color: var(--ink-muted); border-bottom: 2px solid transparent; }
  .tabs button.active { color: var(--moss-dark); border-bottom-color: var(--amber); font-weight: 600; }

  .btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; border: 1px solid var(--line-strong); }
  .btn:hover { background: var(--surface-2); }
  .btn-primary { background: var(--moss); border-color: var(--moss); color: #fff; }
  .btn-primary:hover { background: var(--moss-dark); }
  .btn-amber { background: var(--amber); border-color: var(--amber); color: #2B1D06; }
  .btn-amber:hover { background: var(--amber-deep); }
  .btn[disabled] { opacity: .5; cursor: not-allowed; }

  .field-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); gap: 14px; }
  .field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
  .field label { font-size: 12px; color: var(--ink-muted); }
  .field input, .field select, .field textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 40px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); }
  .field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--amber); outline-offset: 0; border-color: var(--amber); }
  .field input[disabled], .field select[disabled] { opacity: .45; cursor: not-allowed; }
  .field input[type=date] { -webkit-appearance: none; appearance: none; text-align: left; }
  .field textarea { font-family: var(--font-ui); resize: vertical; min-height: 40px; }

  .form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
  .hint { font-size: 12px; color: var(--ink-faint); }

  table { width: 100%; border-collapse: collapse; font-size: 13px; }
  thead th { text-align: left; font-weight: 500; color: var(--ink-muted); font-size: 11.5px; padding: 8px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
  tbody td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-family: var(--font-mono); white-space: nowrap; }
  tbody td.txt { font-family: var(--font-ui); }
  tbody tr:hover { background: var(--surface-2); }
  .table-scroll { overflow-x: auto; max-width: 100%; }
  .empty-row td { text-align: center; color: var(--ink-faint); font-family: var(--font-ui); padding: 28px 10px; }
  .row-actions { display: flex; gap: 8px; }
  .row-actions button[data-edit]:hover { color: var(--moss); }
  .edit-banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--amber-tint); border: 1px solid var(--amber); color: var(--ink); border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px; font-size: 13px; }
  .row-actions button { all: unset; cursor: pointer; font-size: 12px; color: var(--ink-muted); }
  .row-actions button:hover { color: var(--rust); }
  .pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-family: var(--font-ui); }
  .pill.paid { background: var(--moss-tint); color: var(--moss-dark); }
  .pill.notpaid { background: var(--rust-tint); color: var(--rust); }
  .pill.partial { background: var(--amber-tint); color: var(--amber-deep); }

  .toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: var(--radius); font-size: 13px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 40; white-space: nowrap; }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

  #invoice-overlay { position: fixed; inset: 0; z-index: 100; background: #cfcdbf; overflow: auto; padding: 12px; color-scheme: only light; }
  #invoice-sheet, #invoice-sheet * { color-scheme: only light; forced-color-adjust: none; }
  #invoice-overlay .btn:not(.btn-primary) { color: #26301f; border-color: #7c7a68; background: #e8e6d8; }
  #invoice-overlay .btn-primary { background: #3E6B52; color: #fff; border-color: #3E6B52; }
  #invoice-overlay .inv-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  #invoice-overlay .inv-edit-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
  #invoice-sheet { position: relative; width: 481.63pt; height: 608.14pt; margin: 0 auto; background: #fff; color: #000; font-family: 'Amasis MT Pro Medium','Amasis MT Pro','Bitter','Roboto Slab','Rockwell',Georgia,serif; font-weight: 500; overflow: hidden; }
  #invoice-sheet, #invoice-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #invoice-sheet div { position: absolute; box-sizing: border-box; white-space: nowrap; }
  #invoice-sheet .ft { display: inline-block; }
  #invoice-sheet .rs { font-family: 'Times New Roman', Times, serif; }
  #statement-sheet { box-sizing: border-box; width: 100%; max-width: 800px; margin: 0 auto; background: #fff; color: #000; padding: 22px 26px; font-family: Arial, Helvetica, sans-serif; font-size: 13px; color-scheme: only light; }
  #statement-sheet * { color-scheme: only light; }
  #statement-sheet h1 { font-size: 22px; margin: 0 0 4px; }
  #statement-sheet h2 { font-size: 16px; margin: 16px 0 2px; }
  #statement-sheet .sub { margin: 0 0 8px; color: #333; font-size: 12px; }
  #statement-sheet .stmt-scroll { overflow-x: auto; margin-top: 10px; }
  #statement-sheet table { width: 100%; min-width: 560px; border-collapse: collapse; margin-top: 0; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
  #statement-sheet th, #statement-sheet td { border: 1px solid #000; padding: 5px 7px; text-align: right; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: normal; color: #000; white-space: normal; vertical-align: top; }
  #statement-sheet th { background: #B5E6A2; font-weight: bold; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #statement-sheet td:first-child, #statement-sheet th:first-child { white-space: nowrap; text-align: left; }
  #statement-sheet td:nth-child(n+3), #statement-sheet th:nth-child(n+3) { white-space: nowrap; }
  #statement-sheet .l { text-align: left; }
  @media (max-width: 600px) {
    #invoice-overlay { padding: 8px; }
    #statement-sheet { padding: 14px 10px; }
    #statement-sheet table { min-width: 0; }
    #statement-sheet th, #statement-sheet td { font-size: 11px; padding: 4px 4px; }
    #statement-sheet th:nth-child(n+3) { white-space: normal; }
    #statement-sheet td:nth-child(n+3) { white-space: nowrap; }
    #statement-sheet td:nth-child(5) { white-space: normal; }
    #statement-sheet h1 { font-size: 19px; }
  }
  #statement-sheet .tot td { font-weight: bold; background: #F3F1E6; }
  #statement-sheet .due { font-size: 15px; font-weight: bold; text-align: right; margin-top: 12px; }
  @media print {
    :root { color-scheme: only light; }
    html, body { background: #fff !important; height: auto !important; }
    body > *:not(#invoice-overlay) { display: none !important; }
    #invoice-overlay { position: static; background: #fff; padding: 14mm 0 0; overflow: visible; }
    #invoice-overlay .inv-bar, #invoice-overlay .inv-edit-panel { display: none !important; }
    #invoice-overlay .inv-wrap { zoom: 1 !important; }
    #invoice-sheet { margin: 0 auto; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    @page { size: A4; margin: 0; } /* zero margin = browser adds no date/title/URL header or footer */
  }
  @media (max-width: 820px) {
    #shell { flex-direction: column; }
    #sidebar { width: 100%; flex-direction: row; align-items: center; padding: calc(8px + env(safe-area-inset-top,0px)) 10px 8px; gap: 8px; position: sticky; top: 0; z-index: 20; }
    #sidebar .brand { display: none; }
    #sidebar nav { flex-direction: row; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    #sidebar nav::-webkit-scrollbar { display: none; }
    #sidebar nav button { white-space: nowrap; padding: 10px 12px; }
    #sidebar .foot { display: block; margin: 0; padding: 0; flex-shrink: 0; }
    #sidebar .foot .who, #sidebar .foot br { display: none; }
    #sidebar .foot button { padding: 10px 6px; font-size: 13px; }
    #main { padding: 16px 14px 60px; }
    .page-head h1 { font-size: 20px; }
    .panel-head { padding: 12px 14px; }
    .panel-body { padding: 14px; }
    .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
    .card { padding: 12px 14px; }
    .card .value { font-size: 18px; overflow-wrap: anywhere; }
    .field input, .field select, .field textarea { font-size: 16px; min-height: 44px; }
    .btn { padding: 11px 16px; font-size: 14px; }
    .tabs button { padding: 11px 4px; }
    .toast { white-space: normal; max-width: calc(100vw - 32px); text-align: center; }
  }
  @media (max-width: 480px) {
    .field-grid { grid-template-columns: minmax(0, 1fr); }
    .form-actions .btn { flex: 1 1 auto; justify-content: center; }
  }

  /* ---------- dashboard: month picker, tonne chart, RM by material ---------- */
  .dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
  .dash-head > div:first-child { flex: 1 1 320px; min-width: 0; }
  .month-picker { display: inline-flex; align-items: stretch; gap: 6px; flex: none; }
  .month-picker .btn { padding: 6px 12px; font-size: 16px; line-height: 1; background: var(--surface); }
  .month-picker input { min-height: 36px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 4px 10px; font-family: var(--font-mono); font-size: 13.5px; color: var(--ink); }
  .month-picker input:focus { outline: 2px solid var(--amber); outline-offset: 0; border-color: var(--amber); }
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 0 18px; align-items: start; }
  .dash-grid .panel { height: calc(100% - 22px); }
  .legend { display: flex; gap: 14px; align-items: center; font-size: 12.5px; color: var(--ink-muted); flex-wrap: wrap; }
  .legend span { display: inline-flex; align-items: center; gap: 6px; }
  .legend .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
  .legend .sw.sales { background: var(--amber); }
  .legend .sw.rm { background: var(--moss); }
  .panel-head .unit { font-size: 12px; color: var(--ink-faint); }
  .dash-chart { width: 100%; height: auto; display: block; }
  .dash-chart .grid { stroke: var(--line); stroke-width: 1; }
  .dash-chart .axis { fill: var(--ink-muted); font-size: 11px; font-family: var(--font-mono); }
  .dash-chart .axis.sel { fill: var(--ink); font-weight: 600; }
  .dash-chart .bar-sales { fill: var(--amber); }
  .dash-chart .bar-rm { fill: var(--moss); }
  .dash-chart .bar-val { fill: var(--ink-muted); font-size: 11px; font-family: var(--font-mono); }
  /* RM by material: name | bar | tonnes over avg cost, one row per material */
  .mat-list { display: flex; flex-direction: column; gap: 22px; padding-top: 22px; padding-bottom: 22px; }
  .mat-row { display: grid; grid-template-columns: minmax(96px, 9.5em) minmax(40px, 1fr) auto; align-items: center; gap: 16px; }
  .mat-name { font-size: 14.5px; }
  .mat-bar { height: 10px; background: var(--moss-tint); border-radius: 99px; overflow: hidden; }
  .mat-bar span { display: block; height: 100%; background: var(--moss); border-radius: 99px; }
  .mat-nums { text-align: right; font-family: var(--font-mono); line-height: 1.4; white-space: nowrap; }
  .mat-nums strong { display: block; font-size: 13px; font-weight: 500; color: var(--ink); }
  .mat-nums span { display: block; font-size: 11.5px; color: var(--ink-muted); }
  @media (max-width: 900px) {
    .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .dash-grid .panel { height: auto; }
  }
  @media (max-width: 480px) {
    .month-picker { width: 100%; }
    .month-picker input { flex: 1; min-width: 0; font-size: 16px; }
  }

  /* ---------- dashboard: oldest unpaid bills / suppliers to pay ---------- */
  .dues-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; align-items: start; }
  .dues-grid .panel { height: calc(100% - 22px); }
  .link-btn { all: unset; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--amber-deep); }
  .link-btn:hover { text-decoration: underline; }
  .link-btn:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 2px; }
  .due-list { padding: 4px 18px; }
  .due-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
  .due-row:last-child { border-bottom: 0; }
  .due-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
  .due-main strong { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .due-main span { font-size: 12.5px; color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .due-main span.mono { font-family: var(--font-mono); }
  .due-amt { font-family: var(--font-mono); font-weight: 600; font-size: 14px; text-align: right; white-space: nowrap; min-width: 6.5em; }
  .due-empty { padding: 18px 0; color: var(--ink-faint); font-size: 13px; }
  .pill.dot { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
  .pill.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  @media (max-width: 900px) {
    .dues-grid { grid-template-columns: minmax(0, 1fr); }
    .dues-grid .panel { height: auto; }
  }
  @media (max-width: 480px) {
    .due-list { padding: 2px 14px; }
    .due-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
    .due-row .pill { grid-column: 1; grid-row: 2; justify-self: start; }
    .due-row .due-amt { grid-column: 2; grid-row: 1 / span 2; }
  }

  /* ---------- RM purchases: pending payments ---------- */
  .tabs .tab-count { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; font-family: var(--font-mono); font-weight: 500; color: var(--ink-muted); }
  .pend-summary { display: flex; gap: 40px; flex-wrap: wrap; padding: 16px 20px; }
  .pend-summary .lbl { display: block; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); font-weight: 600; margin-bottom: 6px; }
  .pend-summary strong { font-family: var(--font-mono); font-size: 22px; font-weight: 600; }
  .pend-summary strong.red { color: var(--rust); }
  .pend-table thead th { background: var(--surface-2); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; font-weight: 600; padding: 12px 14px; }
  .pend-table tbody td { padding: 12px 14px; vertical-align: middle; }
  .pend-table th.num, .pend-table td.num { text-align: right; }
  .pend-table td.strong { font-weight: 700; }
  .pend-table td.two span { display: block; font-family: var(--font-ui); font-size: 13.5px; color: var(--ink); }
  .pend-table td.two small { display: block; font-family: var(--font-ui); font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
  .pend-table td.act { text-align: right; }
  .pend-table td.act .btn { padding: 7px 12px; background: var(--surface); font-family: var(--font-ui); font-weight: 600; }
  .pend-table tbody tr:hover td { background: var(--surface-2); }

  /* pop-up (modal) */
  #pay-modal { position: fixed; inset: 0; z-index: 90; background: rgba(20, 24, 20, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
  #pay-modal .pm-box { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--ink); border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); }
  #pay-modal .pm-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
  #pay-modal .pm-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
  #pay-modal .pm-x { all: unset; cursor: pointer; font-size: 24px; line-height: 1; padding: 2px 8px; color: var(--ink-muted); border-radius: var(--radius); }
  #pay-modal .pm-x:hover { background: var(--surface-2); color: var(--ink); }
  #pay-modal .pm-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; padding: 20px 22px; }
  #pay-modal .field .hint { display: block; margin-top: 5px; }
  #pay-modal .req { color: var(--rust); }
  #pay-modal .pm-check { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-muted); }
  #pay-modal .pm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); }
  #pay-modal .pm-foot .btn { padding: 9px 18px; }
  @media (max-width: 480px) {
    #pay-modal { align-items: flex-end; padding: 0; }
    #pay-modal .pm-box { max-width: none; border-radius: 12px 12px 0 0; }
    #pay-modal .pm-body { grid-template-columns: minmax(0, 1fr); }
    #pay-modal .pm-foot .btn { flex: 1; justify-content: center; }
    .pend-summary { gap: 24px; }
  }
