:root {
  --navy: #0f3554;
  --navy-2: #174d75;
  --blue: #dcecf7;
  --pale: #f4f8fb;
  --green: #e5f3e9;
  --orange: #fce6d4;
  --yellow: #fff5cc;
  --ink: #172b3a;
  --muted: #647788;
  --line: #c8d7e2;
  --danger: #b42318;
  --shadow: 0 10px 30px rgba(15, 53, 84, .08);
  --excel: #217346;
  --excel-dark: #185c37;
  --excel-grid: #d0d0d0;
  --excel-header: #f3f3f3;
  --excel-select: #107c41;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef3f7; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang HK", "Noto Sans CJK TC", sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
.hidden, .role-hidden { display: none !important; }
.screen { min-height: 100vh; padding: 24px; }
.centered { display: grid; place-items: center; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.login-card { width: min(430px, 100%); padding: 34px; }
.brand-mark, .brand { color: var(--navy); font-size: 30px; font-weight: 900; letter-spacing: .12em; }
.brand-mark { font-size: 42px; }
.brand { color: #fff; font-size: 24px; }
.brand-subtitle { color: #b9d0df; font-size: 12px; margin-top: 2px; }
.eyebrow { color: #6d93ae; font-size: 11px; font-weight: 800; letter-spacing: .14em; margin: 0 0 7px; }
h1, h2 { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 17px; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.55; }
.demo-note { background: var(--pale); border-radius: 8px; color: var(--muted); font-size: 12px; padding: 10px; }
.stack { display: grid; gap: 14px; margin-top: 22px; }
.stack-fields { display: grid; gap: 14px; }
.login-action-row { display: grid; gap: 8px; }
.security-hint {
  background: var(--pale);
  border-radius: 8px;
  color: #486477;
  font-size: 12px;
  line-height: 1.55;
  margin: 0;
  padding: 10px 12px;
}
label { color: #35566d; display: grid; font-size: 12px; font-weight: 700; gap: 6px; }
input, select, textarea { background: #fff; border: 1px solid #b9ccd9; border-radius: 8px; color: var(--ink); min-height: 40px; outline: none; padding: 9px 10px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: #2782b4; box-shadow: 0 0 0 3px rgba(39, 130, 180, .13); }
#accounts-view input[type="number"],
.acc-summary-list input[type="number"],
.asset-table-card input[type="number"],
#asset-form input[type="number"],
.support-number-input,
#settlement-expense-form input[type="number"],
#channel-directory-view input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
#accounts-view input[type="number"]::-webkit-inner-spin-button,
#accounts-view input[type="number"]::-webkit-outer-spin-button,
.acc-summary-list input[type="number"]::-webkit-inner-spin-button,
.acc-summary-list input[type="number"]::-webkit-outer-spin-button,
.asset-table-card input[type="number"]::-webkit-inner-spin-button,
.asset-table-card input[type="number"]::-webkit-outer-spin-button,
#asset-form input[type="number"]::-webkit-inner-spin-button,
#asset-form input[type="number"]::-webkit-outer-spin-button,
.support-number-input::-webkit-inner-spin-button,
.support-number-input::-webkit-outer-spin-button,
#settlement-expense-form input[type="number"]::-webkit-inner-spin-button,
#settlement-expense-form input[type="number"]::-webkit-outer-spin-button,
#channel-directory-view input[type="number"]::-webkit-inner-spin-button,
#channel-directory-view input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
button { border: 0; border-radius: 8px; font-weight: 750; min-height: 40px; padding: 9px 14px; }
button.primary { background: var(--navy); color: #fff; }
button.primary:hover { background: var(--navy-2); }
button.secondary { background: var(--blue); color: var(--navy); }
button.ghost { background: transparent; color: #d7e7f1; min-height: 32px; }
button.ghost:hover { background: rgba(255,255,255,.1); }
.error { color: var(--danger); min-height: 18px; }
.form-message { color: #2e7650; min-height: 18px; font-size: 13px; }

.topbar { align-items: center; background: var(--navy); color: #fff; display: flex; justify-content: space-between; padding: 13px max(18px, calc((100vw - 1500px) / 2)); }
.user-area { align-items: center; display: flex; gap: 14px; }
.install-app-button {
  border: 1px solid rgba(255, 255, 255, .35);
  color: #fff;
  font-size: 12px;
}
.main-nav { background: #fff; border-bottom: 1px solid var(--line); display: flex; gap: 5px; overflow-x: auto; padding: 8px max(18px, calc((100vw - 1500px) / 2)); position: sticky; top: 0; z-index: 10; }
.nav-button { background: transparent; border-radius: 8px; color: #486477; min-width: 115px; }
.nav-button:hover, .nav-button.active { background: var(--blue); color: var(--navy); }
.page-shell { margin: 0 auto; max-width: 1800px; padding: 28px 18px 70px; }
.view { display: none; }
.active-view { display: block; }
.section-heading { align-items: flex-end; display: flex; justify-content: space-between; margin-bottom: 22px; }
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-card .label { color: var(--muted); font-size: 12px; }
.stat-card .value { color: var(--navy); font-size: 24px; font-weight: 800; margin-top: 8px; }
.two-column { align-items: start; display: grid; gap: 18px; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr); }
.form-card, .table-card { padding: 18px; }
.form-card h2 { margin-bottom: 8px; }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
.compact-grid { max-width: 1000px; }
.wide { grid-column: 1 / -1; }
.table-card { min-width: 0; }
.card-title-row { align-items: center; display: flex; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.heading-actions { align-items: end; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.compact-field { min-width: 155px; }
.compact-field input { min-height: 40px; }
.form-button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.record-count {
  background: var(--blue);
  border-radius: 999px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
  padding: 6px 10px;
  white-space: nowrap;
}
.row-actions { display: flex; gap: 5px; white-space: nowrap; }
.table-action {
  background: var(--blue);
  color: var(--navy);
  font-size: 11px;
  min-height: 28px;
  padding: 4px 8px;
}
.table-action.danger { background: #fde9e7; color: var(--danger); }
.table-search { max-width: 360px; min-width: 240px; }
.table-wrap { overflow: auto; width: 100%; }
table { border-collapse: collapse; font-size: 12px; min-width: 830px; width: 100%; }
th { background: var(--navy-2); color: #fff; font-weight: 800; white-space: nowrap; }
th, td { border: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
td.money { background: var(--green); text-align: right; white-space: nowrap; }
td.adjust { background: var(--orange); text-align: right; white-space: nowrap; }
td.warn { color: var(--danger); font-weight: 700; }

.acc-toolbar {
  align-items: end;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 10px 12px;
}
.acc-group-control,
.acc-group-tabs,
.acc-group-form {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.acc-group-control {
  flex: 1 1 100%;
  min-width: 0;
}
.acc-group-form input {
  min-height: 34px;
  padding: 5px 8px;
  width: 110px;
}
.acc-group-tab {
  background: #eef2f5;
  border-radius: 6px;
  color: #516779;
  min-height: 34px;
  min-width: 82px;
  padding: 6px 14px;
}
.acc-group-tab.active { background: #f8c9a8; color: #4b2d1a; }
.acc-toolbar-actions {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: 0;
  width: 100%;
}
.acc-date { width: 155px; }
.acc-date input { min-height: 34px; padding: 5px 8px; }
.compact-button { min-height: 34px; padding: 6px 12px; }
.danger-button { background: #fde9e7; color: var(--danger); }
.danger-button:hover { background: #f8d4d0; }
.acc-report-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-areas:
    "accounts summary"
    "channels summary";
  grid-template-columns: minmax(560px, 1fr) minmax(290px, 330px);
}
.account-balance-panel { grid-area: accounts; }
.channel-balance-panel { grid-area: channels; }
.acc-summary-panel { grid-area: summary; }
.acc-report-panel, .acc-summary-panel { border-radius: 10px; box-shadow: 0 5px 18px rgba(15, 53, 84, .06); padding: 12px; }
.acc-panel-title { align-items: center; display: flex; gap: 10px; justify-content: space-between; margin-bottom: 8px; }
.acc-alert-pill, .formula-chip {
  background: #fff2cc;
  border-radius: 999px;
  color: #705400;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 9px;
  white-space: nowrap;
}
.formula-chip { background: #e8f2eb; color: var(--excel-dark); }
.acc-table { font-size: 11px; min-width: 100%; table-layout: fixed; }
.channel-report-table { min-width: 100%; }
.channel-report-table .channel-action-head,
.channel-report-table .channel-action-cell {
  padding-left: 3px;
  padding-right: 3px;
  text-align: center;
  width: 44px;
}
.channel-report-table .channel-action-cell .channel-delete-button { margin: 0; }
.account-report-grid { display: grid; gap: 10px; }
.account-section-heading {
  align-items: center;
  background: #edf6d9;
  border-left: 4px solid #4d9f98;
  color: #176a45;
  display: flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: space-between;
  letter-spacing: .02em;
  margin-top: 2px;
  padding: 5px 8px;
}
.account-section-heading.frozen-account-section-heading {
  background: #e7f3e9;
  border-left-color: #278a59;
}
.account-section-heading.reserve-account-section-heading {
  background: #f1ebfb;
  border-left-color: #8059b8;
  color: #6841a1;
}
.account-section-heading.reserve-account-section-heading .section-note { color: #705f85; }
.account-section-heading .section-note {
  color: #577063;
  font-size: 9px;
  font-weight: 700;
}
.account-table-spread {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.account-table-spread + .account-table-spread {
  border-top: 1px dashed #d8e0e5;
  padding-top: 10px;
}
.account-table-spread.single-column { grid-template-columns: minmax(0, 1fr); }
.account-table-section { min-width: 0; overflow: hidden; }
.account-report-table { font-size: 10px; }
.acc-table th { background: #f4eee9; color: #3c2f29; padding: 3px 4px; text-align: center; }
.acc-table td { background: #fff; padding: 2px 4px; vertical-align: middle; }
.acc-table tbody tr:nth-child(even) td { background: #fcfaf8; }
.acc-table .input-money-cell { min-width: 0; padding: 0 1px; }
.acc-inline-input {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  min-height: 21px;
  padding: 1px 3px;
}
.acc-inline-input:hover { border-color: #d7b497; }
.acc-inline-input:focus { background: #fff; border-color: var(--excel); box-shadow: 0 0 0 2px rgba(33, 115, 70, .12); }
.acc-inline-input.number-input { text-align: right; }
.account-note-input,
.account-note-display {
  box-sizing: border-box;
  display: block;
  font-size: 10px;
  font-weight: 700 !important;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.account-note-secondary {
  color: #c62828 !important;
  font-weight: 800 !important;
}
.account-balance-panel .account-report-table .machine-actions-head { width: 47px; }
.account-balance-panel .account-report-table .account-machine-head { width: 54px; }
.account-balance-panel .account-report-table .account-bank-head { width: 66px; }
.account-balance-panel .account-report-table .account-balance-head { width: 92px; }
.account-balance-panel .account-report-table .account-frozen-head { width: 78px; }
.account-balance-panel .account-report-table .account-operation-head { width: 62px; }
.account-balance-panel .account-report-table .account-note-head { width: 88px; }
.account-machine-code {
  color: #15334c;
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
  line-height: 1.1;
}
.channel-balance-panel .acc-table th:first-child { width: 88px; }
.account-bank-cell {
  background: var(--bank-bg, #eef3f7) !important;
  border-left: 4px solid var(--bank-accent, #7890a4);
  color: var(--bank-text, var(--ink));
}
.account-bank-code { font-weight: 850; }
.bank-m89 { --bank-bg: #e5f0ff; --bank-accent: #2e6eb5; --bank-text: #1d5d9b; }
.bank-l88 { --bank-bg: #f0e8ff; --bank-accent: #8059b8; --bank-text: #6841a1; }
.bank-a95 { --bank-bg: #ffe9d7; --bank-accent: #cf7a38; --bank-text: #9a4d13; }
.bank-c82 { --bank-bg: #e3f6ec; --bank-accent: #3f9b6d; --bank-text: #176a45; }
.bank-i18 { --bank-bg: #fff6c9; --bank-accent: #c3a12c; --bank-text: #806000; }
.bank-i72 { --bank-bg: #fce5f0; --bank-accent: #c96795; --bank-text: #9a3165; }
.bank-o35 { --bank-bg: #ddf6f7; --bank-accent: #3ca6aa; --bank-text: #176d75; }
.bank-b12 { --bank-bg: #fee9d6; --bank-accent: #d88747; --bank-text: #9b4a13; }
.bank-o25 { --bank-bg: #eee6fa; --bank-accent: #9270c3; --bank-text: #63449b; }
.bank-d40 { --bank-bg: #ddf1ef; --bank-accent: #4d9f98; --bank-text: #176a62; }
.bank-c50 { --bank-bg: #fce6e6; --bank-accent: #c85e5e; --bank-text: #a33535; }
.bank-s03 { --bank-bg: #edf6d9; --bank-accent: #8caf43; --bank-text: #547d1b; }
.bank-d15 { --bank-bg: #e6edf7; --bank-accent: #6e94bd; --bank-text: #385c83; }
.bank-f28 { --bank-bg: #fbe8e3; --bank-accent: #ca7d6f; --bank-text: #9a5145; }
.machine-action-cell { padding: 1px !important; text-align: left; }
.account-freeze-cell { padding: 1px !important; text-align: center; }
.machine-row-actions,
.account-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  margin: 0;
}
.machine-row-actions button,
.bank-delete-button,
.channel-delete-button,
.account-freeze-button,
.account-unfreeze-button,
.account-reserve-button,
.account-restore-button {
  align-items: center;
  border-radius: 999px;
  box-sizing: border-box;
  display: inline-flex;
  font-size: 8px;
  height: 18px;
  justify-content: center;
  line-height: 1.15;
  min-height: 18px;
  min-width: 28px;
  padding: 1px 4px;
  white-space: nowrap;
  width: auto;
}
.machine-move-target {
  border: 1px solid #b8c9d5;
  border-radius: 999px;
  font-size: 8px;
  height: 18px;
  min-height: 18px;
  padding: 0 12px 0 3px;
  width: 42px;
}
.machine-chip-actions .machine-move-target { width: 58px; }
.machine-move-button { background: #e6f1f8; color: var(--navy); }
.machine-delete-button,
.bank-delete-button,
.channel-delete-button { background: #fde9e7; color: var(--danger); }
.account-freeze-button { background: #e5f4eb; color: #176a45; }
.account-unfreeze-button { background: #e6f1f8; color: var(--navy); }
.account-reserve-button { background: #f1ebfb; color: #6841a1; }
.account-restore-button { background: #e6f1f8; color: var(--navy); }
.account-freeze-button:disabled,
.account-unfreeze-button:disabled,
.account-reserve-button:disabled,
.account-restore-button:disabled { cursor: not-allowed; opacity: .55; }
.bank-delete-button,
.channel-delete-button {
  display: inline-flex;
  margin-left: 3px;
  margin-top: 0;
  vertical-align: middle;
}
.company-badge { background: #f5d8c4; border-radius: 3px; font-size: 9px; margin-right: 4px; padding: 2px 3px; }
.acc-number { display: block; text-align: right; white-space: nowrap; }
.frozen-funds-number { color: #176a45; font-weight: 850; }
.reserve-account-number { color: #6841a1; font-weight: 850; }
.report-formula { background: #e7f3e9 !important; color: var(--excel-dark); font-weight: 850; text-align: right; white-space: nowrap; }
.report-formula.negative, .adjustment-item strong.negative { color: var(--danger); }
.channel-sub { color: var(--muted); display: block; font-size: 10px; font-weight: 500; margin-top: 2px; white-space: nowrap; }
.empty-report { height: 90px; text-align: center; }
.acc-summary-panel { position: sticky; top: 72px; }
.acc-summary-panel h2 { margin-bottom: 12px; }
.acc-summary-list { border: 1px solid #e2e5e7; border-radius: 8px; overflow: hidden; }

/* Fully expand only the selected account-report group while producing its PNG. */
#accounts-view.account-capture-mode {
  background: #eef3f7;
  display: block !important;
  max-width: none;
  padding: 18px;
  width: 1680px;
}
#accounts-view.account-capture-mode .section-heading {
  align-items: flex-end;
  flex-direction: row;
}
#accounts-view.account-capture-mode .acc-report-layout {
  grid-template-areas:
    "accounts summary"
    "channels summary";
  grid-template-columns: minmax(0, 1fr) 340px;
}
#accounts-view.account-capture-mode .account-balance-panel { grid-area: accounts; }
#accounts-view.account-capture-mode .channel-balance-panel { grid-area: channels; }
#accounts-view.account-capture-mode .acc-summary-panel {
  grid-area: summary;
  position: static;
}
#accounts-view.account-capture-mode .table-wrap,
#accounts-view.account-capture-mode .account-table-section {
  max-height: none !important;
  overflow: visible !important;
}
#accounts-view.account-capture-mode .card { box-shadow: none; }
#accounts-view.account-capture-mode .account-note-display {
  line-height: 1.3;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}
#accounts-view.account-capture-mode .account-balance-head { width: 108px; }
#accounts-view.account-capture-mode .account-frozen-head { width: 96px; }
#accounts-view.account-capture-mode .channel-report-table th:nth-child(n + 3) { width: 116px; }
#accounts-view.account-capture-mode .input-money-cell,
#accounts-view.account-capture-mode .report-formula,
#accounts-view.account-capture-mode .acc-number {
  font-variant-numeric: tabular-nums;
  overflow: visible;
  white-space: nowrap;
}
#accounts-view.account-capture-mode .capture-number-value {
  box-sizing: border-box;
  display: block;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.35;
  overflow: visible;
  padding: 2px 4px;
  text-align: right;
  white-space: nowrap;
  width: 100%;
}
#accounts-view.account-capture-mode .capture-summary-number {
  color: var(--navy);
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
  white-space: nowrap;
}
#accounts-view.account-capture-mode [data-html2canvas-ignore],
#accounts-view.account-capture-mode .section-heading > button,
#accounts-view.account-capture-mode .acc-toolbar-actions > button,
#accounts-view.account-capture-mode .machine-actions-head,
#accounts-view.account-capture-mode .machine-action-cell,
#accounts-view.account-capture-mode .account-operation-head,
#accounts-view.account-capture-mode .account-freeze-cell,
#accounts-view.account-capture-mode .channel-action-head,
#accounts-view.account-capture-mode .channel-action-cell,
#accounts-view.account-capture-mode .machine-row-actions,
#accounts-view.account-capture-mode .bank-delete-button,
#accounts-view.account-capture-mode .channel-delete-button,
#accounts-view.account-capture-mode .adjustment-delete,
#accounts-view.account-capture-mode #account-adjustment-form {
  display: none !important;
}
.acc-summary-list > div {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #e5e7e9;
  display: flex;
  justify-content: space-between;
  padding: 10px 11px;
}
.acc-summary-list > div:last-child { border-bottom: 0; }
.acc-summary-list span { color: #526878; font-size: 12px; font-weight: 700; }
.acc-summary-list strong { color: var(--navy); font-size: 16px; }
.acc-summary-list .summary-emphasis { background: #f4f8fb; }
.acc-summary-list .summary-total { background: #e6f2e9; }
.acc-summary-list .summary-total span, .acc-summary-list .summary-total strong { color: var(--excel-dark); font-size: 18px; }
.acc-summary-list .expected-balance-row,
.acc-summary-list .u-number-row { align-items: center; gap: 10px; }
.expected-balance-row input,
.u-number-row input {
  border-radius: 5px;
  font-size: 12px;
  min-height: 28px;
  padding: 4px 6px;
  text-align: right;
  width: 132px;
}
#report-expected-balance,
#report-u-number { font-weight: 700; }
.balance-check-row.is-correct { background: #e6f2e9; }
.balance-check-row.is-correct strong { color: var(--excel-dark); }
.balance-check-row.is-error { background: #fde9e7; }
.balance-check-row.is-error strong { color: var(--danger); }
.adjustment-heading { align-items: end; display: flex; justify-content: space-between; margin: 18px 0 8px; }
.adjustment-heading h3 { font-size: 14px; margin: 0; }
.adjustment-list { display: grid; gap: 6px; }
.adjustment-item {
  align-items: center;
  background: #fff8ef;
  border: 1px solid #f2d8b5;
  border-radius: 6px;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 7px 8px;
}
.adjustment-item > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adjustment-category { color: #8c4d15; font-size: 10px; font-weight: 850; margin-right: 6px; }
.adjustment-delete { background: transparent; color: var(--danger); min-height: 24px; padding: 0 4px; }
.empty-adjustment { margin: 8px 0; }
.adjustment-form { display: grid; gap: 6px; grid-template-columns: 90px minmax(0, 1fr); margin-top: 10px; }
.adjustment-form input, .adjustment-form select, .adjustment-form button { min-height: 32px; padding: 5px 7px; }

.excel-workbook {
  background: #fff;
  border: 1px solid #b7b7b7;
  box-shadow: 0 6px 22px rgba(25, 55, 40, .09);
  margin-bottom: 18px;
  min-width: 0;
}
.excel-ribbon {
  align-items: stretch;
  background: #fafafa;
  border-bottom: 1px solid #c9c9c9;
  display: flex;
  gap: 0;
  min-height: 66px;
  overflow-x: auto;
  padding: 6px 8px;
}
.ribbon-group {
  align-content: center;
  border-right: 1px solid #d7d7d7;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 5px;
  padding: 5px 9px;
}
.ribbon-group:last-child { border-right: 0; }
.ribbon-filters { flex: 1 0 auto; }
.excel-command {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: #252525;
  font-size: 12px;
  font-weight: 600;
  min-height: 28px;
  padding: 4px 9px;
}
.excel-command:hover { background: #e7f2ec; border-color: #a9cbb8; }
.excel-command.primary { background: var(--excel); color: #fff; }
.excel-command.primary:hover { background: var(--excel-dark); }
.excel-command:disabled:hover { background: transparent; border-color: transparent; }
.excel-command.primary:disabled,
.excel-command.primary:disabled:hover { background: #6f8f7c; }
.excel-search, .excel-select {
  border: 1px solid #b5b5b5;
  border-radius: 2px;
  font-size: 12px;
  min-height: 30px;
  padding: 4px 7px;
}
.excel-search { min-width: 190px; }
.excel-select { width: 105px; }
.excel-formula-bar {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid #c6c6c6;
  display: grid;
  gap: 0;
  grid-template-columns: 72px 36px minmax(260px, 1fr) auto minmax(105px, auto);
  min-height: 38px;
}
.name-box, .formula-input {
  border: 0;
  border-radius: 0;
  min-height: 36px;
}
.name-box { border-right: 1px solid #c6c6c6; font-weight: 700; text-align: center; }
.fx-mark { color: #666; font-family: Georgia, serif; font-style: italic; font-weight: 700; text-align: center; }
.formula-input { border-left: 1px solid #e0e0e0; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.formula-run {
  background: #e7f2ec;
  border-radius: 2px;
  color: var(--excel-dark);
  font-size: 12px;
  min-height: 28px;
  margin-right: 6px;
  padding: 4px 11px;
}
.formula-result {
  color: #3c3c3c;
  font-size: 12px;
  overflow: hidden;
  padding: 0 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.excel-grid-wrap {
  max-height: 620px;
  overflow: auto;
  position: relative;
  width: 100%;
}
.excel-grid {
  border-collapse: separate;
  border-spacing: 0;
  font-family: Arial, "PingFang HK", sans-serif;
  font-size: 12px;
  min-width: max-content;
  table-layout: fixed;
  width: max-content;
}
.excel-grid th, .excel-grid td {
  border: 0;
  border-bottom: 1px solid var(--excel-grid);
  border-right: 1px solid var(--excel-grid);
  height: 29px;
  min-width: 90px;
  padding: 5px 7px;
  vertical-align: middle;
}
.excel-grid tr > :first-child { min-width: 44px; width: 44px; }
#settlement-grid {
  min-width: 920px;
  width: 100%;
}
#settlement-grid .settlement-col-row-number { width: 32px; }
#settlement-grid .settlement-col-intermediary { width: 65px; }
#settlement-grid .settlement-col-channel { width: 80px; }
#settlement-grid .settlement-col-yesterday { width: 82px; }
#settlement-grid .settlement-col-deposit { width: 94px; }
#settlement-grid .settlement-col-self-charge { width: 58px; }
#settlement-grid .settlement-col-payout { width: 94px; }
#settlement-grid .settlement-col-return-u { width: 72px; }
#settlement-grid .settlement-col-rates { width: 82px; }
#settlement-grid .settlement-col-fee { width: 74px; }
#settlement-grid .settlement-col-balance { width: 102px; }
#settlement-grid .settlement-col-notes { width: 85px; }
#settlement-grid th,
#settlement-grid td {
  font-size: 11px;
  height: 26px;
  min-width: 0;
  padding: 3px 4px;
}
#settlement-grid tr > :first-child {
  min-width: 32px;
  width: 32px;
}
#settlement-grid .excel-letters th {
  height: 20px;
  min-height: 20px;
}
#settlement-grid .excel-fields th {
  font-size: 10px;
  height: 42px;
  top: 20px;
}
#settlement-grid tfoot th,
#settlement-grid tfoot td {
  background: #d9ead3;
  border-top: 2px solid var(--excel);
  bottom: 0;
  color: #174e2e;
  font-weight: 850;
  position: sticky;
  z-index: 6;
}
#settlement-grid tfoot .row-number { z-index: 9; }
#settlement-grid .settlement-total-label {
  text-align: right;
  white-space: nowrap;
}
#settlement-grid .settlement-total-value {
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}
#settlement-grid .settlement-total-count {
  color: #456151;
  font-size: 10px;
  text-align: center;
  white-space: nowrap;
}
.excel-grid .excel-letters th {
  background: var(--excel-header);
  color: #444;
  font-weight: 500;
  height: 24px;
  min-height: 24px;
  position: sticky;
  text-align: center;
  top: 0;
  z-index: 5;
}
.excel-grid .excel-fields th {
  background: #e9ecef;
  color: #222;
  font-weight: 700;
  height: 48px;
  line-height: 1.2;
  position: sticky;
  text-align: center;
  top: 24px;
  white-space: normal;
  z-index: 5;
}
.excel-grid .excel-corner,
.excel-grid .excel-fields th:first-child {
  left: 0;
  position: sticky;
  z-index: 8;
}
.excel-grid .row-number {
  background: var(--excel-header);
  color: #555;
  font-weight: 500;
  left: 0;
  position: sticky;
  text-align: center;
  z-index: 3;
}
.excel-cell {
  background: #fff;
  cursor: cell;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.excel-cell.number-cell { text-align: right; }
.excel-cell.editable-cell:hover { background: #f7fbf8; }
.excel-cell.formula-cell { background: #e2f0d9; color: #174e2e; font-weight: 700; }
.excel-cell.formula-cell.supervisor-override-cell {
  background: #fff;
  color: var(--ink);
}
.excel-cell.adjust-cell { background: #fff2cc; }
.excel-cell.negative-cell { background: #fde2e2; color: var(--danger); }
.excel-cell.selected-cell {
  box-shadow: inset 0 0 0 2px var(--excel-select);
  overflow: visible;
  position: relative;
  z-index: 2;
}
.excel-cell.selected-cell::after {
  background: var(--excel-select);
  bottom: -3px;
  content: "";
  height: 6px;
  position: absolute;
  right: -3px;
  width: 6px;
}
.excel-cell.range-cell { background: #e7f3ec; }
.excel-cell.formula-cell.range-cell { background: #d2e9c7; }
.excel-cell[contenteditable="true"]:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--excel-select);
  outline: 0;
  overflow: visible;
}
.grid-cell-editor {
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  height: 100%;
  min-height: 24px;
  outline: 0;
  padding: 0 4px;
  text-align: inherit;
  width: 100%;
}
.grid-cell-editor:focus {
  border: 0;
  box-shadow: none;
}
.excel-cell.saving { color: #7b7b7b; }
.excel-empty { background: #fff; color: #777; height: 90px !important; text-align: center; }
.excel-status {
  align-items: center;
  background: #f5f5f5;
  border-top: 1px solid #d2d2d2;
  color: #4b4b4b;
  display: flex;
  font-size: 11px;
  justify-content: space-between;
  min-height: 26px;
  padding: 4px 10px;
}
.sheet-tabs {
  align-items: end;
  background: #f3f3f3;
  border-top: 1px solid #d0d0d0;
  display: flex;
  gap: 3px;
  min-height: 36px;
  padding: 5px 10px 0;
}
.sheet-tab {
  background: #fff;
  border-bottom: 3px solid var(--excel);
  border-radius: 0;
  color: #222;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 18px;
}
.sheet-add { color: #555; font-size: 20px; padding: 0 8px 5px; }
.entry-panel { margin: 18px 0; }
.entry-panel > summary {
  color: var(--navy);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  padding: 15px 18px;
}
.entry-panel[open] > summary { border-bottom: 1px solid var(--line); }
.compact-entry-grid { max-width: 720px; }
.settlement-channel-entry-grid {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  max-width: 980px;
}
.settlement-fee-note { margin: 12px 0 0; }
.settlement-channel-manager {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 18px;
}
.settlement-channel-manager h3 { margin: 0 0 4px; }
.settlement-channel-manager .card-title-row { align-items: flex-start; }
.settlement-channel-manager-table { min-width: 890px; }
.settlement-channel-manager-table td { padding: 7px 9px; vertical-align: middle; }
.settlement-channel-manager-table .channel-name { color: var(--navy); font-weight: 800; }
.settlement-channel-manager-table .channel-rate { text-align: right; white-space: nowrap; }
.settlement-channel-manager-table .channel-rate-date { color: var(--muted); white-space: nowrap; }
.settlement-channel-manager-table .channel-action { text-align: center; width: 145px; }
.settlement-channel-manager-table .channel-action .row-actions { justify-content: center; }
.settlement-rate-input {
  appearance: textfield;
  -moz-appearance: textfield;
  border-radius: 6px;
  font-weight: 750;
  min-height: 32px;
  padding: 5px 7px;
  text-align: right;
  width: 82px;
}
.settlement-rate-input::-webkit-inner-spin-button,
.settlement-rate-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.entry-section-title,
.channel-entry-title { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 20px; }
.machine-list { display: grid; gap: 10px; margin-top: 13px; }
.machine-list-section { display: grid; gap: 6px; }
.machine-list-section-title { color: var(--muted); font-size: 11px; font-weight: 800; margin: 0; }
.machine-list-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.machine-list-section.reserve-machine-list { border-left: 3px solid #8059b8; padding-left: 8px; }
.machine-chip {
  align-items: stretch;
  background: #f3f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  padding: 7px 10px;
}
.machine-chip.reserve-machine { background: #f1ebfb; border-color: #d7c7ed; }
.machine-chip.reserve-machine strong { color: #6841a1; }
.machine-chip strong { color: var(--navy); }
.machine-chip-label { display: grid; gap: 2px; }
.machine-chip-label > span { color: var(--muted); font-size: 11px; }
.machine-chip-actions { display: grid; gap: 3px; }
.machine-chip-actions button {
  border-radius: 4px;
  font-size: 9px;
  min-height: 22px;
  padding: 2px 5px;
}

.roster-clock-card { margin-bottom: 18px; max-width: 900px; padding: 20px; }
.roster-account-row { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; }
.roster-date-stack { align-items: flex-end; display: flex; flex-direction: column; gap: 7px; }
.roster-date-chip {
  background: var(--blue);
  border: 1px solid #cdddea;
  border-radius: 999px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 12px;
}
.roster-shift-chip {
  background: #edf7f0;
  border: 1px solid #c9e4d1;
  border-radius: 999px;
  color: var(--excel);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
}
.roster-time-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}
.roster-time-grid > div {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
}
.roster-time-grid span { color: var(--muted); display: block; font-size: 12px; }
.roster-time-grid strong { color: var(--navy); display: block; font-size: 25px; margin-top: 5px; }
.roster-actions { display: flex; gap: 10px; margin-top: 14px; }
.roster-actions button { min-width: 135px; }
.staff-account-card { margin-bottom: 18px; }
.staff-user-form-grid {
  grid-template-columns: minmax(180px, 1.3fr) repeat(3, minmax(130px, .7fr));
}
.staff-user-table-wrap { margin-top: 18px; }
.staff-user-table { min-width: 1020px; }
.staff-permission-option > span:first-child {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-bottom: 7px;
}
.staff-permission-option > span:last-child {
  align-items: center;
  display: flex;
  font-weight: 700;
  gap: 8px;
}
.staff-permission-option input[type="checkbox"] {
  min-height: 18px;
  padding: 0;
  width: 18px;
}
.permission-toggle-cell {
  align-items: center;
  display: flex;
  gap: 6px;
  white-space: nowrap;
}
.staff-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 9px;
}
.staff-status.is-active { background: #edf7f0; color: #17643a; }
.staff-status.is-inactive { background: #f6e8e6; color: #9e322b; }
.roster-schedule-card { margin-bottom: 18px; }
.schedule-form-grid { grid-template-columns: 1.1fr 1fr .75fr 1.6fr; max-width: 1200px; }
.roster-schedule-table-card { margin-bottom: 18px; }
.roster-group-tabs {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 0 0 18px;
  padding: 9px 11px;
}
.roster-group-tabs > span { color: var(--muted); font-size: 12px; font-weight: 800; margin-right: 3px; }
.roster-group-tabs button {
  background: #eef3f7;
  color: #516779;
  font-size: 12px;
  min-height: 30px;
  padding: 5px 13px;
}
.roster-group-tabs button.active { background: #f8c9a8; color: #4b2d1a; }
.roster-stats-card { margin-bottom: 18px; }
.roster-record-card { margin-top: 0; }
.roster-table { min-width: 760px; }
.roster-schedule-table { min-width: 1180px; }
.roster-stats-table { min-width: 820px; }
.roster-table td.roster-time { font-variant-numeric: tabular-nums; font-weight: 700; }
.roster-company {
  background: #edf7f0;
  border-radius: 999px;
  color: var(--excel);
  display: inline-block;
  font-size: 11px;
  font-weight: 900;
  min-width: 25px;
  padding: 4px 8px;
  text-align: center;
}
.roster-minutes { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.roster-minutes.is-warning { color: #b34b17; }
.roster-row-actions { align-items: center; flex-wrap: wrap; }
.attendance-action { background: #e5f4eb; color: #176a45; font-weight: 800; }
.roster-attendance-modal-card { max-width: 560px; }
.roster-attendance-context {
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
  padding: 12px;
}
.roster-attendance-context span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-bottom: 3px;
}
.roster-attendance-context strong { color: var(--navy); font-size: 14px; }
.roster-attendance-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.roster-attendance-form .wide { grid-column: 1 / -1; }

.daily-management-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.4fr) minmax(330px, .8fr);
  margin-bottom: 18px;
}
.daily-paste { min-height: 283px; }
.daily-bank-accounts {
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.daily-bank-account-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.daily-bank-account-heading span { display: block; margin-top: 2px; }
.daily-bank-account-heading button { min-height: 34px; padding: 6px 10px; }
.daily-bank-account-list { display: grid; gap: 8px; }
.daily-bank-account-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(130px, .65fr) minmax(180px, 1fr) minmax(180px, 1fr) auto;
}
.daily-bank-account-row + .daily-bank-account-row {
  border-top: 1px dashed var(--line);
  padding-top: 8px;
}
.daily-bank-account-remove {
  background: #fde9e7;
  color: var(--danger);
  min-height: 40px;
  padding: 7px 10px;
}
.daily-bank-cell { min-width: 110px; }
.daily-bank-value {
  border-bottom: 1px dashed #dbe5ec;
  min-height: 22px;
  padding: 2px 0;
  white-space: nowrap;
}
.daily-bank-value:last-child { border-bottom: 0; }
.daily-table-card { margin-top: 0; }
.daily-pagination {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}
.daily-pagination button { min-height: 34px; padding: 6px 12px; }

.operations-toolbar {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
}
.settlement-notes-field { flex: 1 1 240px; max-width: 460px; }
.settlement-date-mode {
  align-self: center;
  background: #eef3f7;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  padding: 7px 11px;
  white-space: nowrap;
}
.settlement-date-mode.is-live {
  background: #e8f5eb;
  border-color: #b9dcc4;
  color: #17643a;
}
.settlement-date-mode.is-history {
  background: #fff5d9;
  border-color: #ead6a0;
  color: #795b14;
}
.settlement-date-mode.is-empty { background: #fce8e6; color: #9b2c2c; }
.asset-table-card td { background: #fff; padding: 4px; }
.asset-inline-input {
  background: #fff;
  border-color: transparent;
  border-radius: 5px;
  min-height: 34px;
  padding: 6px 7px;
}
.asset-inline-input:hover { border-color: #b9ccd9; }
.asset-inline-input:focus { border-color: #2782b4; }
.asset-amount-input, .asset-number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.asset-number { display: block; padding: 7px; }
.asset-edit-cell { min-width: 130px; }
.asset-change-details-cell { min-width: 150px; }
.asset-change-detail {
  align-items: center;
  background: #edf1f4;
  border: 1px solid #d5dee5;
  border-radius: 999px;
  color: #506270;
  display: inline-flex;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 1.2;
  min-height: 27px;
  padding: 5px 9px;
  white-space: nowrap;
}
.asset-change-detail.is-up,
.asset-change-detail.is-new {
  background: #e4f5e9;
  border-color: #b7dec3;
  color: #17643a;
}
.asset-change-detail.is-down {
  background: #fce8e6;
  border-color: #edc2bd;
  color: #a13a32;
}
.asset-change-detail.is-same {
  background: #edf1f4;
  border-color: #d5dee5;
  color: #506270;
}
.asset-change-detail.is-unavailable {
  background: #fff5d9;
  border-color: #ead6a0;
  color: #795b14;
}
.asset-notes-cell { min-width: 170px; }
.asset-category-row {
  --asset-accent: #6b7d8c;
  --asset-category-bg: #e8edf1;
  --asset-row-bg: #f5f7f9;
}
.asset-category-row td { background: var(--asset-row-bg); }
.asset-category-row .asset-category-cell {
  background: var(--asset-category-bg);
  border-left: 5px solid var(--asset-accent);
  font-weight: 800;
  min-width: 190px;
}
.asset-category-row .asset-inline-input {
  background: rgba(255, 255, 255, .62);
}
.asset-category-row .asset-inline-input:hover,
.asset-category-row .asset-inline-input:focus {
  background: #fff;
}
.asset-tone-blue {
  --asset-accent: #2f75b5;
  --asset-category-bg: #dcecff;
  --asset-row-bg: #f1f7ff;
}
.asset-tone-gold {
  --asset-accent: #c58b00;
  --asset-category-bg: #ffedb8;
  --asset-row-bg: #fff9e8;
}
.asset-tone-violet {
  --asset-accent: #7c4dcc;
  --asset-category-bg: #e8dcff;
  --asset-row-bg: #f7f2ff;
}
.asset-tone-teal {
  --asset-accent: #16866f;
  --asset-category-bg: #d5f1e9;
  --asset-row-bg: #effaf7;
}
.asset-tone-rose {
  --asset-accent: #cf5675;
  --asset-category-bg: #ffdce5;
  --asset-row-bg: #fff2f5;
}
.asset-tone-orange {
  --asset-accent: #d66b21;
  --asset-category-bg: #ffe0c4;
  --asset-row-bg: #fff4ea;
}
.asset-tone-slate {
  --asset-accent: #64788a;
  --asset-category-bg: #e2e9ef;
  --asset-row-bg: #f3f6f8;
}
.settlement-support-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}
.support-summary-card { min-width: 0; }
.support-summary-table {
  min-width: 100%;
  table-layout: fixed;
  width: 100%;
}
.support-summary-table th {
  background: #f3f7fa;
  color: #35566d;
  font-weight: 750;
  text-align: left;
  width: 58%;
}
.support-summary-table td {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.support-summary-table .formula-value { background: #e8f5eb; font-weight: 800; }
.support-summary-table .support-total-row th,
.support-summary-table .support-total-row td {
  background: var(--navy);
  color: #fff;
  font-weight: 900;
}
.support-summary-table .is-balanced th,
.support-summary-table .is-balanced td { background: #e8f5eb; color: #17643a; }
.support-summary-table .is-difference th,
.support-summary-table .is-difference td { background: #fce8e6; color: #9b2c2c; }
.support-summary-table .support-status-row th,
.support-summary-table .support-status-row td {
  background: #eaf2f8;
  color: var(--navy);
  font-weight: 900;
}
.support-inline-input {
  background: #fff;
  border-color: transparent;
  border-radius: 5px;
  min-height: 34px;
  padding: 6px 7px;
}
.support-inline-input:hover { border-color: #b9ccd9; }
.support-inline-input:focus { border-color: #2782b4; }
.support-number,
.support-number-input {
  display: block;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.settlement-expense-card { grid-column: 1 / -1; }
.expense-entry-form {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: 1.2fr .65fr 1.5fr auto;
  padding: 0 14px 10px;
}
.expense-entry-form input { min-height: 36px; }
.expense-message { padding: 0 14px; }
.settlement-expense-card td { background: #fff; padding: 4px; }
.settlement-expense-card td:nth-child(2) { min-width: 145px; text-align: right; }
.settlement-expense-action-cell { text-align: center; white-space: nowrap; }
.settlement-expense-delete-button,
.settlement-expense-history-button {
  border-radius: 7px;
  font-size: 11px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
  white-space: nowrap;
}
.settlement-expense-delete-button { background: #fbd9d5; color: #9f251d; }
.settlement-expense-delete-button:hover { background: #f4c0ba; }
.settlement-expense-history-button { background: #eef3f7; color: #647887; }
.settlement-history-card { margin-top: 18px; overflow: hidden; padding: 0; }
.settlement-history-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 13px 16px;
}
.settlement-history-summary::-webkit-details-marker { display: none; }
.settlement-history-summary h2 { font-size: 16px; margin: 0 0 2px; }
.settlement-history-summary p { margin: 0; }
.settlement-history-meta { align-items: center; display: flex; gap: 8px; }
.settlement-history-toggle {
  background: #eef3f7;
  border-radius: 999px;
  color: var(--navy);
  font-size: 10px;
  font-weight: 850;
  padding: 6px 9px;
}
.settlement-history-toggle::before { content: "展開"; }
.settlement-history-card[open] .settlement-history-toggle::before { content: "收起"; }
.settlement-history-content { border-top: 1px solid var(--line); padding: 0 14px 14px; }
.settlement-history-content > .table-wrap { max-height: 300px; }
.history-detail {
  background: #f7fafc;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 16px;
  padding: 14px;
}
.history-detail-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.history-detail-heading h3 { margin: 0; }
.history-summary {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}
.history-summary > div {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}
.history-summary span { color: var(--muted); display: block; font-size: 11px; }
.history-summary strong { color: var(--navy); display: block; font-size: 17px; margin-top: 4px; }

.channel-directory-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.channel-directory-card { margin-top: 18px; }
.channel-directory-table { min-width: 1440px; table-layout: fixed; }
.channel-directory-table th:nth-child(1) { width: 12%; }
.channel-directory-table th:nth-child(2) { width: 15%; }
.channel-directory-table th:nth-child(3) { width: 12%; }
.channel-directory-table th:nth-child(4) { width: 12%; }
.channel-directory-table th:nth-child(5) { width: 15%; }
.channel-directory-table th:nth-child(6) { width: 12%; }
.channel-directory-table th:nth-child(7) { width: 12%; }
.channel-directory-table th:nth-child(8) { width: 10%; }
.channel-directory-table td { vertical-align: middle; }
.channel-directory-channel-name,
.channel-directory-intermediary {
  color: var(--navy);
  display: block;
  font-size: 14px;
  font-weight: 900;
}
.channel-directory-channel-name { letter-spacing: .01em; }
.channel-directory-match-name { color: #47677b; font-size: 12px; font-weight: 750; }
.channel-directory-intermediary-input {
  font-weight: 800;
  min-height: 34px;
  padding: 5px 7px;
  width: 100%;
}
.channel-directory-fee-input {
  font-weight: 800;
  min-height: 34px;
  padding: 5px 7px;
  width: 100%;
}
.channel-directory-fee-readonly { color: var(--navy); font-size: 14px; font-weight: 900; }
.channel-directory-unset { color: var(--muted); font-size: 11px; }

.risk-stat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.risk-processing-card { border-top: 4px solid #e5a800; }
.risk-completed-card { border-top: 4px solid #2e8b57; }
.risk-ignored-card { border-top: 4px solid #b42318; }
.risk-stat-money {
  align-items: center;
  border-top: 1px solid #e4eaee;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 7px;
}
.risk-stat-money span { color: var(--muted); font-size: 10px; font-weight: 750; }
.risk-stat-money strong { color: var(--navy); font-size: 15px; white-space: nowrap; }
.risk-stat-note { color: #527083; font-size: 9px; font-weight: 750; margin: 5px 0 0; }
.risk-stat-explanation { color: #607887; font-size: 10px; margin: -8px 2px 14px; text-align: right; }
.risk-filter-card { margin-bottom: 18px; padding: 14px; }
.risk-filter-grid {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(260px, 2fr) repeat(4, minmax(115px, .72fr)) auto;
}
.risk-filter-grid input,
.risk-filter-grid select { min-height: 36px; padding: 6px 8px; }
.risk-filter-grid button { min-height: 36px; white-space: nowrap; }
.risk-filter-result {
  color: #45677c;
  font-size: 12px;
  font-weight: 750;
  margin: 10px 0 0;
}
.risk-form-card, .risk-import-card, .risk-bank-rules-card { margin-top: 18px; }
.risk-form-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.risk-import-card {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}
.risk-import-card > div:first-child { max-width: 760px; }
.risk-import-controls { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; }
.risk-import-controls input { min-width: 280px; }
.risk-workbench-card { margin-top: 18px; padding: 0; overflow: hidden; }
.risk-workbench-heading {
  align-items: center;
  background: linear-gradient(135deg, #f9fbfd 0%, #fff9e8 100%);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 18px 20px;
}
.risk-workbench-heading h2,
.risk-archive-heading h2 { margin: 0 0 3px; }
.risk-workbench-heading p,
.risk-archive-heading p { margin-bottom: 0; }
.risk-section-total {
  align-items: center;
  background: #fff3c4;
  border: 1px solid #efd77a;
  border-radius: 12px;
  color: #755800;
  display: flex;
  flex-direction: column;
  min-width: 108px;
  padding: 10px 14px;
}
.risk-section-total strong { font-size: 24px; line-height: 1; }
.risk-section-total span { font-size: 10px; font-weight: 800; margin-top: 4px; }
.risk-archive-panel > summary::-webkit-details-marker { display: none; }
.risk-sheet-tabs-bar {
  align-items: start;
  background: #dfe5e8;
  border-top: 1px solid #b9c5cc;
  display: grid;
  gap: 5px;
  grid-template-columns: 32px minmax(0, 1fr) 32px auto auto;
  padding: 0 10px 7px;
}
.risk-sheet-nav {
  align-items: center;
  align-self: stretch;
  background: #f7f9fa;
  border: 1px solid #b9c5cc;
  border-radius: 0 0 4px 4px;
  border-top: 0;
  color: #34566a;
  display: inline-flex;
  font-size: 20px;
  justify-content: center;
  min-height: 34px;
  padding: 0;
}
.risk-sheet-nav:disabled { color: #a5b1b8; cursor: default; opacity: .62; }
.risk-sheet-tabs {
  align-items: start;
  display: flex;
  gap: 3px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-color: #aebbc2 transparent;
  scrollbar-width: thin;
}
.risk-sheet-tab {
  background: #f5f7f8;
  border: 1px solid #b9c5cc;
  border-radius: 0 0 5px 5px;
  border-top: 0;
  color: #365a6e;
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 800;
  min-height: 34px;
  padding: 7px 14px 6px;
  white-space: nowrap;
}
.risk-sheet-tab:hover { background: #fff; }
.risk-sheet-tab.active {
  background: #fff;
  box-shadow: inset 0 3px 0 #1d7a4a;
  color: #123f2a;
}
.risk-sheet-tabs-empty { color: #617987; font-size: 11px; font-weight: 750; padding: 9px; }
.risk-sheet-page-status {
  color: #536d7c;
  font-size: 10px;
  font-weight: 800;
  padding: 10px 3px 0 5px;
  white-space: nowrap;
}
.risk-sheet-delete-button {
  align-self: center;
  background: #fff3f2;
  border: 1px solid #e4aaa4;
  border-radius: 5px;
  color: #a42d25;
  font-size: 10px;
  font-weight: 850;
  margin: 5px 0 0 3px;
  min-height: 27px;
  padding: 4px 9px;
  white-space: nowrap;
}
.risk-sheet-delete-button:hover { background: #ffe6e3; }
.risk-sheet-delete-button:disabled { cursor: default; opacity: .55; }
.risk-sheet-workbook { background: #eef2f4; min-width: 0; padding: 10px; }
.risk-sheet-title-row {
  align-items: center;
  background: #fff;
  border: 1px solid #bdc9cf;
  border-bottom: 0;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 8px 11px;
}
.risk-sheet-grid-wrap {
  background: #fff;
  border: 1px solid #bdc9cf;
  max-height: 650px;
  overflow: auto;
}
.risk-sheet-table {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  min-width: 1480px;
  width: 100%;
}
.risk-sheet-table th {
  background: #e7ecef;
  border-bottom: 1px solid #aebbc2;
  border-right: 1px solid #c4ced3;
  color: #294b5e;
  font-size: 10px;
  font-weight: 850;
  padding: 6px 7px;
  position: sticky;
  text-align: left;
  top: 0;
  white-space: nowrap;
  z-index: 2;
}
.risk-sheet-table td {
  border-bottom: 1px solid #d9e0e4;
  border-right: 1px solid #d9e0e4;
  color: #31566a;
  line-height: 1.35;
  padding: 5px 7px;
  vertical-align: middle;
}
.risk-sheet-case-row:nth-child(odd) td { background: #fbfcfd; }
.risk-sheet-case-row:hover td { background: #fff9df; }
.risk-sheet-owner-row td {
  background: #dbeaf2;
  border-bottom-color: #b9cbd5;
  padding: 5px 8px;
}
.risk-sheet-owner-row div { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.risk-sheet-owner-row strong { color: #153f57; font-size: 11px; }
.risk-sheet-owner-row span { color: #44687c; font-size: 10px; font-weight: 800; }
.risk-sheet-money { color: var(--navy) !important; font-weight: 850; text-align: right; white-space: nowrap; }
.risk-sheet-copy-cell { max-width: 250px; min-width: 150px; }
.risk-sheet-copy-cell .risk-text-value {
  display: block;
  max-width: 245px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Refined risk-control workbook: overview sheet plus spreadsheet-style editing. */
.risk-workbench-card {
  background: #f7faf8;
  border-color: #d8e4dd;
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(28, 64, 48, .08);
}
.risk-workbench-heading {
  background:
    radial-gradient(circle at 88% 10%, rgba(214, 234, 221, .9), transparent 34%),
    linear-gradient(135deg, #fbfdfc 0%, #f1f7f3 100%);
  border-bottom-color: #d8e4dd;
  padding: 20px 22px;
}
.risk-section-total {
  background: rgba(255, 255, 255, .88);
  border-color: #c8dcd0;
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(36, 80, 58, .07);
  color: #245a3d;
}
.risk-sheet-tabs-bar {
  background: #edf3ef;
  border-top-color: #d1dfd7;
  padding: 0 11px 8px;
}
.risk-sheet-nav {
  background: #fff;
  border-color: #ccd9d2;
  border-radius: 0 0 7px 7px;
  color: #315d47;
}
.risk-sheet-tabs { gap: 4px; scrollbar-color: #afc1b7 transparent; }
.risk-sheet-tab {
  align-items: center;
  background: #f8fbf9;
  border-color: #cbd9d1;
  border-radius: 0 0 8px 8px;
  color: #456555;
  display: inline-flex;
  gap: 7px;
  min-height: 36px;
  padding: 7px 13px 6px;
}
.risk-sheet-tab.active {
  box-shadow: inset 0 3px 0 #2e7d55, 0 5px 12px rgba(31, 83, 57, .06);
}
.risk-sheet-tab-all {
  background: #e4f0e8;
  border-color: #afcbbb;
  color: #1f5839;
}
.risk-sheet-tab-all small {
  background: rgba(34, 102, 67, .11);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: .02em;
  padding: 2px 5px;
}
.risk-sheet-tab-all.active {
  background: #245f40;
  box-shadow: inset 0 3px 0 #f2c94c, 0 6px 14px rgba(28, 82, 53, .16);
  color: #fff;
}
.risk-sheet-tab-all.active small { background: rgba(255, 255, 255, .16); }
.risk-sheet-page-status { color: #587064; }
.risk-sheet-workbook {
  background: linear-gradient(180deg, #f2f6f3 0%, #edf3ef 100%);
  padding: 11px;
}
.risk-sheet-title-row {
  border-color: #ccd9d2;
  padding: 11px 13px;
}
.risk-sheet-title-all {
  background: linear-gradient(90deg, #f7fcf8 0%, #fff 55%);
  border-left: 4px solid #2c7952;
}
.risk-sheet-title-copy { min-width: 0; }
.risk-sheet-title-copy > span {
  color: var(--muted);
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .06em;
}
.risk-sheet-title-copy > strong {
  color: #183f2b;
  display: block;
  font-size: 16px;
  margin-top: 2px;
}
.risk-sheet-title-copy > p { color: #61766b; font-size: 10px; margin: 2px 0 0; }
.risk-sheet-title-meta { align-items: flex-end; display: flex; flex-direction: column; gap: 6px; }
.risk-sheet-edit-hint {
  align-items: center;
  color: #6f5b12 !important;
  display: inline-flex;
  font-size: 9px !important;
  font-weight: 800;
  gap: 5px;
}
.risk-sheet-edit-hint::before {
  background: #fff6c9;
  border: 1px solid #e3cf69;
  border-radius: 3px;
  content: "";
  height: 9px;
  width: 13px;
}
.risk-sheet-summary-pills { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; justify-content: flex-end; }
.risk-sheet-summary-pills > * {
  background: #edf5f0;
  border: 1px solid #d4e4da;
  border-radius: 999px;
  color: #315c46 !important;
  font-size: 10px !important;
  font-weight: 850;
  padding: 4px 8px;
  white-space: nowrap;
}
.risk-sheet-summary-pills b { background: #fff7d6; border-color: #eadb91; color: #6b5814 !important; }
.risk-sheet-grid-wrap {
  border-color: #ccd9d2;
  box-shadow: inset 0 1px 0 #fff;
  overflow-x: hidden;
}
.risk-sheet-table {
  font-size: 10px;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.risk-col-date { width: 6.5%; }
.risk-col-group { width: 4%; }
.risk-col-machine { width: 5.5%; }
.risk-col-bank { width: 6%; }
.risk-col-amount { width: 7.5%; }
.risk-col-reason { width: 13%; }
.risk-col-follow-up { width: 16%; }
.risk-col-phone { width: 10%; }
.risk-col-notes { width: 13%; }
.risk-col-status { width: 7.5%; }
.risk-col-actions { width: 11%; }
.risk-sheet-table th {
  background: #e8efeb;
  border-bottom-color: #bdcbc3;
  border-right-color: #d0dbd5;
  color: #294f3b;
  overflow: hidden;
  padding: 5px 4px;
  text-overflow: ellipsis;
}
.risk-sheet-table td {
  border-bottom-color: #e1e8e4;
  border-right-color: #e1e8e4;
  color: #365848;
  overflow: hidden;
  padding: 3px 4px;
  text-overflow: ellipsis;
}
.risk-sheet-case-row:nth-child(odd) td { background: #fbfdfc; }
.risk-sheet-case-row:hover td { background: #f2f8f4; }
.risk-sheet-table th.risk-sheet-edit-heading {
  background: #fff0ad;
  border-bottom-color: #d8c15a;
  color: #66520c;
  text-align: center;
}
.risk-sheet-case-row td.risk-sheet-edit-cell { background: #fffbed; padding: 3px 4px; }
.risk-sheet-case-row:nth-child(odd) td.risk-sheet-edit-cell { background: #fff9df; }
.risk-sheet-case-row:hover td.risk-sheet-edit-cell { background: #fff4c7; }
.risk-sheet-edit-cell.is-saving { box-shadow: inset 0 -2px 0 #d3a800; }
.risk-sheet-edit-cell.is-saved { animation: risk-cell-saved .9s ease; }
.risk-sheet-edit-cell.is-error { animation: risk-cell-error 1.4s ease; }
@keyframes risk-cell-saved {
  0%, 100% { background: #fffbed; }
  35% { background: #dff3e5; box-shadow: inset 0 0 0 1px #73b388; }
}
@keyframes risk-cell-error {
  0%, 100% { background: #fffbed; }
  30% { background: #fde2df; box-shadow: inset 0 0 0 1px #d86f66; }
}
.risk-inline-control {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #3f5320;
  font-size: 10px;
  font-weight: 700;
  min-height: 26px;
  min-width: 0;
  padding: 3px 5px;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.risk-inline-control:hover { background: rgba(255, 255, 255, .68); border-color: #e0cf80; }
.risk-inline-control:focus {
  background: #fff;
  border-color: #4f916c;
  box-shadow: 0 0 0 3px rgba(61, 132, 89, .13);
  outline: 0;
}
.risk-inline-control:disabled { color: #786c45; cursor: wait; opacity: .75; }
.risk-inline-reason,
.risk-inline-follow-up,
.risk-inline-phone-status,
.risk-inline-notes { min-width: 0; }
.risk-sheet-case-row .risk-machine { font-size: 11px; }
.risk-sheet-case-row .risk-status { font-size: 9px; padding: 4px 6px; }
.risk-sheet-case-row .row-actions { gap: 2px; justify-content: center; }
.risk-sheet-case-row .table-action {
  font-size: 9px;
  min-height: 25px;
  padding: 3px 5px;
}
.risk-sheet-intermediary-row td {
  background: linear-gradient(90deg, #245f40 0%, #327552 68%, #3e8060 100%);
  border-bottom: 0;
  border-right: 0;
  color: #fff;
  padding: 8px 10px;
}
.risk-sheet-intermediary-row div,
.risk-sheet-owner-row div { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.risk-sheet-intermediary-row strong { font-size: 12px; letter-spacing: .02em; }
.risk-sheet-intermediary-row span { color: #e8f5ec; font-size: 10px; font-weight: 800; }
.risk-sheet-owner-row td {
  background: #e2eee7;
  border-bottom-color: #c8d9cf;
  color: #234a35;
  padding: 6px 9px;
}
.risk-sheet-owner-row strong { color: #214d35; font-size: 11px; }
.risk-sheet-owner-row span { color: #567463; font-size: 10px; font-weight: 800; }
.risk-sheet-intermediary-name { color: #2b6345; font-weight: 800; }
.risk-intermediary-modal-card { max-width: 520px; }
.risk-intermediary-form { align-items: end; grid-template-columns: minmax(0, 1fr) auto; }
.risk-follow-up-case {
  background: #fff;
  border: 1px solid #e0e7eb;
  border-left: 4px solid #e5a800;
  border-radius: 8px;
  min-width: 0;
  padding: 10px 11px;
}
.risk-follow-up-identity {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 92px minmax(150px, 1fr) auto;
}
.risk-follow-up-identity time,
.risk-archive-identity time { color: #5b7484; font-size: 11px; font-weight: 750; }
.risk-follow-up-identity > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.risk-follow-up-identity > div span { color: #47677b; font-size: 12px; font-weight: 750; }
.risk-follow-up-amount { color: var(--navy); font-size: 15px; white-space: nowrap; }
.risk-follow-up-copy {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  margin-top: 8px;
}
.risk-follow-up-copy > div { background: #f8fafb; border-radius: 7px; min-width: 0; padding: 7px 9px; }
.risk-follow-up-copy span { color: var(--muted); display: block; font-size: 9px; font-weight: 800; margin-bottom: 2px; }
.risk-follow-up-copy p {
  color: #294c61;
  display: -webkit-box;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.risk-follow-up-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.risk-follow-up-meta span {
  background: #eef3f6;
  border-radius: 999px;
  color: #506e80;
  font-size: 10px;
  font-weight: 700;
  max-width: 360px;
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.risk-follow-up-case footer,
.risk-archive-item footer {
  align-items: center;
  border-top: 1px solid #edf1f3;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
}
.risk-case-actions { justify-content: flex-end; }
.risk-empty-state {
  align-items: center;
  background: #fff;
  border: 1px dashed #c7d5dd;
  border-radius: 10px;
  color: #557183;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  min-height: 110px;
  padding: 20px;
  text-align: center;
}
.risk-empty-state.compact { border: 0; min-height: 100px; }
.risk-empty-state strong { color: var(--navy); }
.risk-empty-state span { font-size: 12px; }
.risk-archive-section { margin-top: 24px; }
.risk-archive-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 10px;
}
.risk-archive-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.risk-archive-section.single-status .risk-archive-grid { grid-template-columns: 1fr; }
.risk-archive-panel { margin: 0; overflow: hidden; padding: 0; }
.risk-archive-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}
.risk-archive-panel > summary > div { align-items: center; display: flex; gap: 8px; }
.risk-archive-panel[open] > summary { border-bottom: 1px solid var(--line); }
.risk-archive-dot { border-radius: 999px; display: inline-block; height: 10px; width: 10px; }
.risk-archive-completed .risk-archive-dot { background: #2e8b57; }
.risk-archive-ignored .risk-archive-dot { background: #b42318; }
.risk-archive-count {
  background: #eef3f6;
  border-radius: 999px;
  color: #45677c;
  font-size: 11px;
  font-weight: 850;
  padding: 5px 9px;
}
.risk-archive-list { background: #f6f9fa; display: grid; gap: 8px; max-height: 640px; overflow-y: auto; padding: 9px; }
.risk-archive-item { background: #fff; border: 1px solid #dfe7eb; border-radius: 8px; padding: 9px 10px; }
.risk-archive-completed .risk-archive-item { border-left: 3px solid #2e8b57; }
.risk-archive-ignored .risk-archive-item { border-left: 3px solid #b42318; }
.risk-archive-identity {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 78px minmax(0, 1fr) auto;
}
.risk-archive-identity > div { min-width: 0; }
.risk-archive-identity > div strong,
.risk-archive-identity > div span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.risk-archive-identity > div strong { color: var(--navy); font-size: 12px; }
.risk-archive-identity > div span { color: #5a7484; font-size: 10px; margin-top: 2px; }
.risk-archive-amount { color: var(--navy); font-size: 13px; white-space: nowrap; }
.risk-archive-item > p {
  color: #47677b;
  display: -webkit-box;
  font-size: 11px;
  line-height: 1.45;
  margin: 7px 0 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.risk-machine { color: var(--navy); font-size: 13px; letter-spacing: .02em; }
.risk-text-value {
  display: -webkit-box;
  line-height: 1.45;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.risk-status {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  padding: 5px 9px;
  white-space: nowrap;
}
.risk-status-processing { background: #fff3c4; color: #755800; }
.risk-status-completed { background: #e5f3e9; color: #17643a; }
.risk-status-ignored { background: #fde9e7; color: #9f251d; }

/* Risk-control palette: soft blue-teal workspace with clear status colours. */
#risk-control-view { color: #29485a; }
#risk-control-view .muted,
#risk-control-view .risk-filter-result,
#risk-control-view .risk-stat-explanation { color: #6a7f8e; }
#risk-control-view button.primary { background: #2f7180; border-color: #2f7180; color: #fff; }
#risk-control-view button.primary:hover { background: #245d69; border-color: #245d69; }
#risk-control-view button.secondary { background: #f4f9fb; border-color: #bfd3dc; color: #31596c; }
#risk-control-view button.secondary:hover { background: #e8f2f5; border-color: #9fbfc9; }
#risk-control-view .table-action { background: #eaf3f6; color: #31596c; }
#risk-control-view .table-action:hover { background: #dbecef; }
#risk-control-view .table-action.danger { background: #fae9e7; color: #914a43; }
#risk-control-view .section-heading {
  background: linear-gradient(135deg, #f7fbfc 0%, #eaf5f6 100%);
  border-color: #c9dde3;
}
#risk-control-view .risk-filter-card,
#risk-control-view .risk-form-card,
#risk-control-view .risk-import-card,
#risk-control-view .risk-bank-rules-card { background: #fbfdfe; border-color: #d1e1e6; }
.risk-processing-card {
  background: #edf6fb;
  border-color: #c5dbe8;
  border-top: 4px solid #5a9cc3;
}
.risk-completed-card {
  background: #fff8de;
  border-color: #e7d89a;
  border-top: 4px solid #d3a83e;
}
.risk-ignored-card {
  background: #fff0ef;
  border-color: #e6c4c0;
  border-top: 4px solid #c97970;
}
.risk-total-card {
  background: #edf8f5;
  border-color: #bdded4;
  border-top: 4px solid #5c9f8d;
}
.risk-processing-card .value,
.risk-processing-card .risk-stat-money strong { color: #24536b; }
.risk-completed-card .value,
.risk-completed-card .risk-stat-money strong { color: #6f5714; }
.risk-ignored-card .value,
.risk-ignored-card .risk-stat-money strong { color: #7b3e39; }
.risk-total-card .value { color: #286355; }
.risk-workbench-card {
  background: #f9fcfd;
  border-color: #cbdfe4;
  box-shadow: 0 12px 30px rgba(47, 93, 108, .09);
}
.risk-workbench-heading {
  background: linear-gradient(135deg, #f8fcfd 0%, #edf6f8 100%);
  border-bottom-color: #cfdee3;
}
.risk-section-total {
  background: #f3faf8;
  border-color: #b9d8d0;
  box-shadow: none;
  color: #315c54;
}
.risk-sheet-tabs-bar { background: #eaf3f6; border-top-color: #c9dce2; }
.risk-sheet-nav { background: #f9fcfd; border-color: #b8d0d8; color: #31596c; }
.risk-sheet-nav:hover { background: #e6f1f4; }
.risk-sheet-tabs { scrollbar-color: #8eafb9 transparent; }
.risk-sheet-tab {
  background: #f4f9fb;
  border-color: #bdd2d9;
  color: #426477;
}
.risk-sheet-tab.active {
  background: #fff;
  box-shadow: inset 0 3px 0 #4d8997, 0 4px 10px rgba(47, 93, 108, .08);
  color: #285466;
}
.risk-sheet-tab-all { background: #dfeef1; border-color: #abc8d0; color: #315d6b; }
.risk-sheet-tab-all small { background: #c8dfe4; color: #315d6b; }
.risk-sheet-tab-all.active {
  background: #356f7b;
  box-shadow: inset 0 3px 0 #bfe1df, 0 5px 12px rgba(47, 93, 108, .16);
  color: #fff;
}
.risk-sheet-tab-all.active small { background: rgba(255, 255, 255, .18); color: #fff; }
.risk-sheet-page-status { color: #64808d; }
.risk-sheet-workbook { background: #eef5f7; }
.risk-sheet-title-row { background: #fbfdfe; border-color: #c8dbe1; }
.risk-sheet-title-all {
  background: #f5fafb;
  border-left-color: #4c8997;
}
.risk-sheet-title-copy > strong { color: #294f60; }
.risk-sheet-title-copy > p { color: #6a7f8e; }
.risk-sheet-edit-hint { color: #446879 !important; }
.risk-sheet-edit-hint::before { background: #fff; border-color: #6f9fab; }
.risk-sheet-summary-pills > * {
  background: #edf5f7;
  border-color: #cfdee3;
  color: #365e70 !important;
}
.risk-sheet-summary-pills b { background: #fff; border-color: #b9d0d7; color: #294f60 !important; }
.risk-sheet-grid-wrap { background: #fff; border-color: #c8dbe1; }
.risk-sheet-table th {
  background: #ddebf0;
  border-bottom-color: #aac5cf;
  border-right-color: #c5d8df;
  color: #315a6c;
}
.risk-sheet-table td { border-bottom-color: #dce8ec; border-right-color: #dce8ec; color: #365465; }
.risk-sheet-case-row:nth-child(odd) td,
.risk-sheet-case-row:nth-child(odd) td.risk-sheet-edit-cell { background: #fbfdfe; }
.risk-sheet-case-row:nth-child(even) td,
.risk-sheet-case-row td.risk-sheet-edit-cell { background: #f5fafb; }
.risk-sheet-case-row:hover td,
.risk-sheet-case-row:hover td.risk-sheet-edit-cell { background: #eaf5f7; }
.risk-sheet-table th.risk-sheet-edit-heading {
  background: #fff4cd;
  border-bottom-color: #dfca78;
  color: #67531a;
}
.risk-sheet-edit-cell.is-saving { box-shadow: inset 0 -2px 0 #4c8997; }
@keyframes risk-cell-saved {
  0%, 100% { background: #f5fafb; }
  35% { background: #e3f2ed; box-shadow: inset 0 0 0 1px #78aa9d; }
}
.risk-inline-control { color: #294f60; }
.risk-inline-control:hover { background: #fff; border-color: #9bbbc5; }
.risk-inline-control:focus {
  background: #fff;
  border-color: #4d8997;
  box-shadow: 0 0 0 3px rgba(77, 137, 151, .14);
}
.risk-inline-control:disabled { color: #718692; }
.risk-sheet-intermediary-row td {
  background: linear-gradient(90deg, #4e8792 0%, #6a9fa6 100%);
  color: #fff;
}
.risk-sheet-intermediary-row span { color: #e8f5f5; }
.risk-sheet-owner-row td {
  background: #e5f1f4;
  border-bottom-color: #bfd5dc;
  color: #315a6c;
}
.risk-sheet-owner-row strong { color: #294f60; }
.risk-sheet-owner-row span { color: #62808d; }
.risk-sheet-money,
.risk-machine { color: #315a6c !important; }
.risk-archive-completed {
  background: #fff8de;
  border-color: #e5d69a;
}
.risk-archive-completed > summary { background: #faedba; color: #6f5714; }
.risk-archive-completed .risk-archive-list { background: #fffaf0; }
.risk-archive-completed .risk-archive-item {
  background: #fffdf6;
  border-color: #eadfae;
  border-left-color: #d3a83e;
}
.risk-archive-completed .risk-archive-identity > div strong,
.risk-archive-completed .risk-archive-amount,
.risk-archive-completed .risk-archive-item > p { color: #6f5714; }
.risk-archive-completed .risk-archive-dot { background: #c99f35; }
.risk-archive-completed .risk-archive-count { background: #eedb8e; color: #675114; }
.risk-archive-ignored {
  background: #fff0ef;
  border-color: #e6c4c0;
}
.risk-archive-ignored > summary { background: #f7dcd9; color: #7b3e39; }
.risk-archive-ignored .risk-archive-list { background: #fff6f5; }
.risk-archive-ignored .risk-archive-item {
  background: #fffbfa;
  border-color: #e8cbc7;
  border-left-color: #c97970;
}
.risk-archive-ignored .risk-archive-identity > div strong,
.risk-archive-ignored .risk-archive-amount,
.risk-archive-ignored .risk-archive-item > p { color: #7b3e39; }
.risk-archive-ignored .risk-archive-dot { background: #bf6d65; }
.risk-archive-ignored .risk-archive-count { background: #edc8c4; color: #743b36; }
.risk-status-processing {
  background: #e6f2f8;
  border: 1px solid #a9ccdd;
  color: #24536b;
}
.risk-status-completed {
  background: #faedba;
  border: 1px solid #d9c46d;
  color: #6f5714;
}
.risk-status-ignored {
  background: #f7dcd9;
  border: 1px solid #daa8a2;
  color: #7b3e39;
}
.risk-sheet-amount-cell { padding: 2px 6px !important; }
.risk-status-select {
  font-size: 11px;
  font-weight: 850;
  min-height: 30px;
  min-width: 92px;
  padding: 4px 7px;
}
.risk-rule-flag {
  border-radius: 999px;
  display: inline-block;
  font-size: 11px;
  font-weight: 850;
  padding: 4px 9px;
}
.risk-rule-flag.is-risk { background: #fde9e7; color: #9f251d; }
.risk-rule-flag.is-clear { background: #e5f3e9; color: #17643a; }
#risk-control-view input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
#risk-control-view input[type="number"]::-webkit-inner-spin-button,
#risk-control-view input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.risk-details-modal-card { max-width: 1040px; }
.account-risk-modal-card { max-width: 860px; }
.account-risk-source-summary {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 14px 0 18px;
  padding: 12px;
}
.account-risk-source-summary > div {
  background: #fff;
  border: 1px solid #e0e8ed;
  border-radius: 8px;
  min-width: 0;
  padding: 9px 10px;
}
.account-risk-source-summary > div.wide { grid-column: 1 / -1; }
.account-risk-source-summary span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-bottom: 3px;
}
.account-risk-source-summary strong { overflow-wrap: anywhere; }
.account-risk-source-summary .risk-source-ok {
  background: #e5f3e9;
  border-color: #b8dcc5;
  color: #17643a;
}
.account-risk-source-summary .risk-source-error {
  background: #fde9e7;
  border-color: #efc3be;
  color: #9f251d;
}
.account-risk-form {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.account-risk-form .wide { grid-column: 1 / -1; }
.risk-details-summary {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.risk-details-summary > div {
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 9px;
  min-width: 0;
  padding: 10px 12px;
}
.risk-details-summary > div.wide { grid-column: 1 / -1; }
.risk-details-summary span:first-child {
  color: var(--muted);
  display: block;
  font-size: 10px;
  margin-bottom: 4px;
}
.risk-details-summary strong { overflow-wrap: anywhere; }
.risk-follow-up-form {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  padding-top: 18px;
}
.risk-follow-up-form .wide { grid-column: 1 / -1; }
.risk-history-grid {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
  padding-top: 16px;
}
.risk-history-grid h3 { color: var(--navy); font-size: 15px; margin: 0 0 9px; }
.risk-history-list { display: grid; gap: 8px; max-height: 430px; overflow-y: auto; padding-right: 3px; }
.risk-history-item {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
}
.risk-history-item p { font-size: 12px; line-height: 1.5; margin: 7px 0 0; overflow-wrap: anywhere; }
.risk-history-heading { align-items: flex-start; display: flex; gap: 8px; justify-content: space-between; }
.risk-history-heading strong { color: var(--navy); font-size: 12px; }
.risk-history-heading time,
.risk-history-heading span { color: var(--muted); font-size: 10px; text-align: right; }
.risk-history-meta { align-items: center; display: flex; gap: 7px; margin-top: 7px; }
.risk-history-meta > span:last-child { color: var(--navy); font-size: 12px; font-weight: 850; }
.risk-source-item { background: #fffaf0; }
.risk-source-location { color: #705400; font-weight: 750; }

.screenshot-card { margin-top: 18px; }
.screenshot-table { min-width: 1120px; }
.screenshot-table .shot-channel th { background: var(--navy); font-size: 13px; text-align: left; }
.screenshot-table .shot-labels th { background: var(--blue); color: var(--navy); text-align: center; }
.screenshot-table .shot-values td { text-align: right; white-space: nowrap; }
.screenshot-table .shot-values:not(:last-child) td { border-bottom: 5px solid #eef3f7; }
.settlement-summary-capture {
  background: #eef3f7;
  color: var(--ink);
  display: grid;
  gap: 14px;
  left: 0;
  padding: 22px;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 1280px;
  z-index: -2147483647;
}
.settlement-capture-header {
  align-items: center;
  background: var(--navy);
  border-radius: 10px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  padding: 14px 18px;
}
.settlement-capture-header > div { align-items: baseline; display: flex; gap: 12px; }
.settlement-capture-header span { font-size: 14px; font-weight: 900; letter-spacing: .12em; }
.settlement-capture-header h1 { color: #fff; font-size: 22px; margin: 0; }
.settlement-capture-header strong { font-size: 17px; }
.settlement-capture-section {
  background: #fff;
  border: 1px solid #cad7df;
  border-radius: 10px;
  overflow: hidden;
}
.settlement-capture-section > h2 {
  background: #d9ebf7;
  border-bottom: 1px solid #b9ccd9;
  color: var(--navy);
  font-size: 15px;
  margin: 0;
  padding: 9px 12px;
}
.settlement-capture-section > table {
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  width: 100%;
}
.settlement-capture-section > table th,
.settlement-capture-section > table td {
  border-bottom: 1px solid #d7e0e6;
  border-right: 1px solid #d7e0e6;
  font-size: 11px;
  height: 29px;
  overflow-wrap: anywhere;
  padding: 5px 7px;
  vertical-align: middle;
}
.settlement-capture-section > table thead th {
  background: #e9eef2;
  color: #243f52;
  font-weight: 800;
  text-align: center;
}
.settlement-capture-section > table tr:last-child > * { border-bottom: 0; }
.settlement-capture-section > table tr > *:last-child { border-right: 0; }
#settlement-capture-grid {
  border-spacing: 0;
  font-family: Arial, "PingFang HK", sans-serif;
  min-width: 0;
  width: 100%;
}
#settlement-capture-grid th,
#settlement-capture-grid td {
  font-size: 10px;
  height: 28px;
  min-width: 0;
  padding: 4px;
  position: static;
}
#settlement-capture-grid .excel-fields th { height: 42px; position: static; }
#settlement-capture-grid .row-number {
  background: var(--excel-header);
  position: static;
  text-align: center;
}
#settlement-capture-grid tfoot th,
#settlement-capture-grid tfoot td {
  background: #d9ead3;
  border-top: 2px solid var(--excel);
  color: #174e2e;
  font-weight: 850;
  position: static;
}
#settlement-capture-grid .settlement-total-label,
#settlement-capture-grid .settlement-total-value { text-align: right; }
#settlement-capture-grid .settlement-total-count { text-align: center; }
.settlement-capture-control-value {
  display: block;
  line-height: 1.35;
  min-height: 15px;
  white-space: pre-wrap;
}
.settlement-capture-control-value.is-number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.settlement-capture-lower-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
}
.settlement-summary-capture .support-summary-table th { width: 58%; }
.settlement-summary-capture .asset-category-row .asset-category-cell {
  border-left: 5px solid var(--asset-accent);
}
.data-paste { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; margin: 12px 0; min-height: 225px; }
.toast { background: var(--navy); border-radius: 8px; bottom: 22px; color: #fff; left: 50%; opacity: 0; padding: 11px 16px; pointer-events: none; position: fixed; transform: translate(-50%, 10px); transition: .2s ease; z-index: 20; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.security-modal {
  align-items: flex-start;
  background: rgba(6, 25, 40, .68);
  display: flex;
  inset: 0;
  justify-content: center;
  overflow-y: auto;
  padding: 24px;
  position: fixed;
  z-index: 45;
}
.security-modal-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(6, 25, 40, .3);
  max-width: 700px;
  padding: 26px;
  width: 100%;
}
.security-modal-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
}
.security-modal-heading h2 { font-size: 23px; }
.security-close {
  background: var(--pale);
  border-radius: 999px;
  color: var(--navy);
  font-size: 25px;
  height: 38px;
  line-height: 1;
  min-height: 38px;
  padding: 0;
  width: 38px;
}
.security-account-row {
  align-items: center;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}
.security-account-row span:first-child {
  color: var(--muted);
  display: block;
  font-size: 11px;
}
.security-account-row strong { display: block; margin-top: 3px; }
.security-section {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 20px;
}
.security-section h3 { color: var(--navy); font-size: 16px; margin: 0 0 8px; }
.security-form { display: grid; gap: 11px; margin-top: 12px; }
.compact-security-form {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}
.totp-enrollment {
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 16px;
  padding: 16px;
  text-align: center;
}
.totp-enrollment img {
  background: #fff;
  border: 10px solid #fff;
  border-radius: 10px;
  height: 230px;
  margin: 8px auto 12px;
  max-width: 100%;
  width: 230px;
}
.security-step { color: var(--navy); font-size: 13px; font-weight: 800; margin: 8px 0; }
.totp-secret {
  background: #eaf2f7;
  border-radius: 7px;
  color: var(--navy);
  display: block;
  font-size: 13px;
  letter-spacing: .09em;
  margin: 8px auto 16px;
  overflow-wrap: anywhere;
  padding: 10px;
}
.security-success {
  background: #edf7f0;
  border-radius: 9px;
  color: #17643a;
  font-size: 13px;
  padding: 11px 12px;
}
.security-details {
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-top: 12px;
  padding: 11px 12px;
}
.security-details summary {
  color: var(--navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}
.danger-details summary { color: var(--danger); }
.recovery-codes-panel {
  background: #fff7dc;
  border: 1px solid #ead48a;
  border-radius: 12px;
  margin-top: 16px;
  padding: 16px;
}
.recovery-codes-panel p { color: #705400; font-size: 12px; }
.recovery-code-list {
  display: grid;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  gap: 6px 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 12px 0;
}
.recovery-code-list code {
  background: #fff;
  border: 1px solid #ead48a;
  border-radius: 6px;
  color: #493a08;
  font-size: 14px;
  padding: 8px;
  text-align: center;
}
.install-guide {
  align-items: center;
  background: rgba(6, 25, 40, .62);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 40;
}
.install-guide-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(6, 25, 40, .28);
  max-width: 440px;
  padding: 26px;
  width: 100%;
}
.install-guide-card h2 { font-size: 22px; margin-bottom: 14px; }
.install-guide-card button { margin-top: 18px; width: 100%; }
.install-guide-steps {
  color: #35566d;
  font-size: 14px;
  line-height: 1.7;
}
.install-guide-steps ol { margin: 8px 0 0; padding-left: 22px; }
.install-guide-steps strong { color: var(--navy); }

.sr-only {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}
.payx-ai-assistant {
  bottom: 14px;
  position: fixed;
  right: 18px;
  user-select: none;
  z-index: 35;
}
.payx-ai-launcher {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: grab;
  display: flex;
  height: 124px;
  justify-content: center;
  min-height: 0;
  padding: 0;
  touch-action: none;
  transition: filter .18s ease, transform .18s ease;
  width: 124px;
}
.payx-ai-launcher:hover {
  filter: drop-shadow(0 12px 13px rgba(15, 53, 84, .28));
  transform: translateY(-3px) scale(1.025);
}
.payx-ai-launcher img {
  background: transparent;
  border: 0;
  height: 124px;
  object-fit: contain;
  pointer-events: none;
  width: 124px;
}
.payx-ai-assistant.is-dragging .payx-ai-launcher {
  cursor: grabbing;
  filter: drop-shadow(0 15px 17px rgba(15, 53, 84, .34));
  transform: scale(1.04);
}
.payx-ai-panel {
  background: #fff;
  border: 1px solid #b9d4da;
  border-radius: 19px;
  box-shadow: 0 24px 64px rgba(9, 42, 62, .28);
  display: flex;
  flex-direction: column;
  max-height: min(690px, calc(100vh - 120px));
  overflow: hidden;
  position: fixed;
  width: min(440px, calc(100vw - 28px));
}
.payx-ai-header {
  align-items: center;
  background: linear-gradient(135deg, #164d67 0%, #277f83 100%);
  color: #fff;
  display: grid;
  gap: 10px;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  padding: 13px 14px;
}
.payx-ai-header > img {
  background: transparent;
  border: 0;
  height: 52px;
  object-fit: contain;
  width: 52px;
}
.payx-ai-header h2 { color: #fff; font-size: 16px; margin: 0 0 3px; }
.payx-ai-header p {
  align-items: center;
  color: #d8f1f0;
  display: flex;
  font-size: 10px;
  font-weight: 750;
  gap: 6px;
  margin: 0;
}
.payx-ai-header p span {
  background: #77e2ad;
  border: 2px solid rgba(255, 255, 255, .42);
  border-radius: 50%;
  height: 9px;
  width: 9px;
}
.payx-ai-header-actions { display: flex; gap: 5px; }
.payx-ai-header-actions button {
  align-items: center;
  background: rgba(255, 255, 255, .13);
  color: #fff;
  display: flex;
  font-size: 21px;
  height: 32px;
  justify-content: center;
  min-height: 32px;
  padding: 0;
  width: 32px;
}
.payx-ai-header-actions button:hover { background: rgba(255, 255, 255, .23); }
.payx-ai-header-actions button[aria-pressed="true"] {
  background: rgba(119, 226, 173, .28);
  box-shadow: 0 0 0 2px rgba(119, 226, 173, .2);
}
.payx-ai-messages {
  background: linear-gradient(180deg, #f4fafb 0%, #eef6f8 100%);
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 12px;
  min-height: 290px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px;
}
.payx-ai-message { align-items: flex-end; display: flex; gap: 7px; }
.payx-ai-message > img {
  background: transparent;
  border: 0;
  flex: 0 0 auto;
  height: 34px;
  object-fit: contain;
  width: 34px;
}
.payx-ai-message.is-user { justify-content: flex-end; }
.payx-ai-bubble {
  background: #fff;
  border: 1px solid #d2e2e6;
  border-radius: 14px 14px 14px 4px;
  box-shadow: 0 4px 12px rgba(30, 75, 93, .07);
  color: #2e5060;
  font-size: 12px;
  line-height: 1.55;
  max-width: calc(100% - 42px);
  overflow-wrap: anywhere;
  padding: 10px 11px;
}
.payx-ai-message.is-user .payx-ai-bubble {
  background: #2f7180;
  border-color: #2f7180;
  border-radius: 14px 14px 4px 14px;
  color: #fff;
  max-width: 84%;
}
.payx-ai-message.is-loading .payx-ai-bubble { color: #68808c; font-style: italic; }
.payx-ai-answer { color: #244b5d; font-weight: 750; margin: 0; }
.payx-ai-result-summary {
  color: #68808c;
  font-size: 10px;
  margin: 5px 0 0;
}
.payx-ai-result-section {
  background: #f8fbfc;
  border: 1px solid #d5e4e8;
  border-radius: 10px;
  margin-top: 8px;
  overflow: hidden;
}
.payx-ai-result-section > summary {
  align-items: center;
  color: #315b6c;
  cursor: pointer;
  display: flex;
  font-size: 11px;
  font-weight: 850;
  justify-content: space-between;
  list-style: none;
  padding: 8px 9px;
}
.payx-ai-result-section > summary::-webkit-details-marker { display: none; }
.payx-ai-result-section > summary::after { content: "＋"; font-size: 13px; }
.payx-ai-result-section[open] > summary::after { content: "−"; }
.payx-ai-result-list { border-top: 1px solid #dce8eb; display: grid; gap: 7px; padding: 7px; }
.payx-ai-result-card {
  background: #fff;
  border: 1px solid #dae7ea;
  border-radius: 8px;
  padding: 8px;
}
.payx-ai-result-card header {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: space-between;
  margin-bottom: 6px;
}
.payx-ai-result-card header strong { color: #234b5d; font-size: 12px; }
.payx-ai-result-card header span { color: #6d838e; font-size: 10px; }
.payx-ai-location-badges {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}
.payx-ai-group-badge {
  background: #264f65;
  border-radius: 999px;
  color: #fff !important;
  font-size: 9px !important;
  font-weight: 850;
  padding: 3px 7px;
  white-space: nowrap;
}
.payx-ai-facts {
  display: grid;
  gap: 4px 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.payx-ai-fact { min-width: 0; }
.payx-ai-fact.is-wide { grid-column: 1 / -1; }
.payx-ai-fact span { color: #7a8e98; display: block; font-size: 9px; font-weight: 750; }
.payx-ai-fact strong {
  color: #345869;
  display: block;
  font-size: 10px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.payx-ai-bank-list { display: grid; gap: 4px; margin-top: 6px; }
.payx-ai-bank-list div {
  background: #eef6f7;
  border-radius: 6px;
  color: #345869;
  font-size: 10px;
  padding: 5px 6px;
}
.payx-ai-status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px !important;
  font-weight: 850;
  padding: 3px 7px;
  white-space: nowrap;
}
.payx-ai-status.is-normal { background: #e5f3e9; color: #256443; }
.payx-ai-status.is-reserve { background: #edf1f6; color: #526579; }
.payx-ai-status.is-frozen,
.payx-ai-status.is-processing { background: #e7f2f8; color: #285f78; }
.payx-ai-status.is-completed { background: #fff0b9; color: #6c5514; }
.payx-ai-status.is-ignored { background: #f8dcd9; color: #7b3e39; }
.payx-ai-attendance-row {
  align-items: center;
  display: grid;
  gap: 3px 7px;
  grid-template-columns: 70px minmax(0, 1fr) auto;
}
.payx-ai-attendance-row + .payx-ai-attendance-row {
  border-top: 1px dashed #d5e3e7;
  padding-top: 6px;
}
.payx-ai-attendance-row time { color: #355d6e; font-size: 10px; font-weight: 800; }
.payx-ai-attendance-row div { color: #5f7783; font-size: 10px; }
.payx-ai-attendance-row div strong { color: #294f60; }
.payx-ai-attendance-row small { color: #7a8e98; font-size: 9px; text-align: right; }
.payx-ai-shortcuts {
  background: #fff;
  border-top: 1px solid #d7e5e8;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 8px 10px 5px;
}
.payx-ai-shortcuts button {
  background: #edf6f7;
  border: 1px solid #c9dfe3;
  color: #356172;
  flex: 0 0 auto;
  font-size: 10px;
  min-height: 29px;
  padding: 4px 9px;
}
.payx-ai-form {
  background: #fff;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 6px 10px;
}
.payx-ai-form input {
  background: #f7fbfc;
  border-color: #bfd7dc;
  border-radius: 10px;
  font-size: 12px;
  min-height: 40px;
}
.payx-ai-form input:focus { border-color: #4d8997; box-shadow: 0 0 0 3px rgba(77, 137, 151, .13); }
.payx-ai-form button {
  background: #2f7180;
  color: #fff;
  font-size: 11px;
  min-height: 40px;
  padding: 7px 13px;
}
.payx-ai-form button:disabled { cursor: wait; opacity: .58; }
.payx-ai-privacy {
  background: #fff;
  color: #82949c;
  font-size: 9px;
  margin: 0;
  padding: 0 11px 9px;
  text-align: center;
}

@media (max-width: 1280px) {
  .settlement-support-grid { grid-template-columns: 1fr; }
  .support-summary-card { max-width: 900px; width: 100%; }
  .settlement-expense-card { grid-column: auto; }
  .risk-filter-grid { grid-template-columns: minmax(240px, 2fr) repeat(2, minmax(130px, 1fr)); }
  .risk-search-field { grid-column: span 2; }
}

@media (max-width: 980px) {
  .two-column { grid-template-columns: 1fr; }
  .daily-management-grid { grid-template-columns: 1fr; }
  .settlement-support-grid { grid-template-columns: 1fr; }
  .settlement-expense-card { grid-column: auto; }
  .expense-entry-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .staff-user-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .schedule-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .history-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .channel-directory-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .risk-import-card { align-items: stretch; flex-direction: column; }
  .risk-archive-grid { grid-template-columns: 1fr; }
  .risk-history-grid { grid-template-columns: 1fr; }
  .acc-report-layout {
    grid-template-areas: "accounts" "channels" "summary";
    grid-template-columns: 1fr;
  }
  .acc-summary-panel { position: static; }
  .account-table-spread { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .screen { padding: 14px; }
  .topbar { align-items: flex-start; gap: 10px; }
  .user-area { flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
  .user-area > span { flex-basis: 100%; text-align: right; }
  .install-app-button, .user-area .ghost { min-height: 32px; padding: 5px 9px; }
}
@media (max-width: 620px) {
  .screen { padding: 14px; }
  .login-card { padding: 24px; }
  .topbar { padding: 11px 14px; }
  .brand { font-size: 21px; }
  .user-area { font-size: 12px; gap: 4px; }
  .page-shell { padding: 22px 12px 50px; }
  .section-heading { align-items: flex-start; gap: 12px; flex-direction: column; }
  .heading-actions { justify-content: flex-start; width: 100%; }
  .heading-actions > * { flex: 1 1 140px; }
  .form-grid { grid-template-columns: 1fr; }
  .staff-user-form-grid { grid-template-columns: 1fr; }
  .schedule-form-grid { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .table-search { max-width: none; min-width: 0; width: 100%; }
  .daily-table-card .card-title-row { align-items: stretch; flex-direction: column; }
  .daily-bank-account-heading { align-items: stretch; flex-direction: column; }
  .daily-bank-account-row { grid-template-columns: 1fr; }
  .daily-bank-account-remove { justify-self: start; min-height: 34px; }
  .daily-pagination { justify-content: space-between; }
  .operations-toolbar > button { flex: 1 1 145px; }
  .settlement-history-summary { align-items: flex-start; padding: 12px; }
  .settlement-history-summary p { display: none; }
  .settlement-history-content { padding: 0 8px 10px; }
  .settlement-date-mode { align-self: flex-end; }
  .expense-entry-form { grid-template-columns: 1fr; }
  .history-summary { grid-template-columns: 1fr; }
  .stat-grid { gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 19px; }
  .nav-button { min-width: 100px; }
  .acc-toolbar { align-items: stretch; flex-wrap: wrap; }
  .acc-toolbar-actions { align-items: stretch; flex-wrap: wrap; margin-left: 0; width: 100%; }
  .acc-date { width: 100%; }
  .acc-toolbar-actions .compact-button { flex: 1 1 140px; }
  .acc-toolbar .compact-button { width: 100%; }
  .roster-account-row { align-items: stretch; flex-direction: column; }
  .roster-date-stack { align-items: flex-start; }
  .roster-time-grid { grid-template-columns: 1fr; }
  .roster-actions { flex-direction: column; }
  .roster-actions button { width: 100%; }
  .roster-attendance-context, .roster-attendance-form { grid-template-columns: 1fr; }
  .roster-attendance-form .wide { grid-column: auto; }
  .security-modal { padding: 10px; }
  .security-modal-card { border-radius: 14px; padding: 18px; }
  .risk-filter-grid { grid-template-columns: 1fr; }
  .risk-search-field { grid-column: auto; }
  .risk-form-grid { grid-template-columns: 1fr; }
  .account-risk-source-summary,
  .account-risk-form { grid-template-columns: 1fr; }
  .account-risk-source-summary > div.wide,
  .account-risk-form .wide { grid-column: auto; }
  .risk-import-controls { align-items: stretch; flex-direction: column; }
  .risk-import-controls input { min-width: 0; }
  .risk-workbench-heading, .risk-archive-heading { align-items: flex-start; flex-direction: column; }
  .risk-section-total { align-items: baseline; flex-direction: row; gap: 6px; min-width: 0; }
  .risk-section-total strong { font-size: 20px; }
  .risk-sheet-tabs-bar { grid-template-columns: 30px minmax(0, 1fr) 30px; padding-inline: 6px; }
  .risk-sheet-page-status { grid-column: 1 / -1; padding: 5px 0 2px; text-align: right; }
  .risk-sheet-delete-button { grid-column: 1 / -1; justify-self: end; margin: 0 0 2px; }
  .risk-sheet-tab { padding-inline: 11px; }
  .risk-sheet-workbook { padding: 6px; }
  .risk-sheet-title-row { align-items: flex-start; flex-direction: column; gap: 9px; }
  .risk-sheet-title-meta { align-items: flex-start; width: 100%; }
  .risk-sheet-summary-pills { justify-content: flex-start; }
  .risk-intermediary-form { grid-template-columns: 1fr; }
  .risk-follow-up-identity, .risk-archive-identity { grid-template-columns: 1fr auto; }
  .risk-follow-up-identity time, .risk-archive-identity time { grid-column: 1 / -1; }
  .risk-follow-up-copy { grid-template-columns: 1fr; }
  .risk-follow-up-case footer, .risk-archive-item footer { align-items: stretch; flex-direction: column; }
  .risk-case-actions { justify-content: flex-start; }
  .risk-details-summary { grid-template-columns: 1fr; }
  .risk-details-summary > div.wide { grid-column: auto; }
  .risk-follow-up-form { grid-template-columns: 1fr; }
  .risk-follow-up-form .wide { grid-column: auto; }
  .compact-security-form { grid-template-columns: 1fr; }
  .recovery-code-list { grid-template-columns: 1fr; }
  .excel-ribbon { min-height: 58px; }
  .excel-formula-bar { grid-template-columns: 58px 30px minmax(210px, 1fr) auto; overflow-x: auto; }
  .formula-result { display: none; }
  .excel-grid-wrap { max-height: 520px; }
  .payx-ai-assistant { bottom: 8px; right: 6px; }
  .payx-ai-launcher { height: 98px; width: 98px; }
  .payx-ai-launcher img { height: 98px; width: 98px; }
  .payx-ai-panel {
    max-height: min(72vh, 650px);
    width: min(430px, calc(100vw - 20px));
  }
  .payx-ai-messages { min-height: 230px; }
}
