/* Foundation: tokens, document defaults, and application shell. */
:root {
  color-scheme:light;
  --navy:#13243b;
  --navy-2:#1d3858;
  --blue:#235ea7;
  --primary:var(--blue);
  --blue-soft:#eaf1f8;
  --teal:#157f82;
  --teal-soft:#e7f5f3;
  --ink:#172536;
  --muted:#5d6c7d;
  --line:#d8e0e7;
  --line-strong:#b9c7d3;
  --bg:#f2f5f6;
  --card:#fff;
  --green:#13745d;
  --orange:#b76518;
  --red:#b83c46;
  --focus:#67a7d8;
  --radius:8px;
  --control-height:40px;
  /* #420: one thin arrow for native and searchable selects; one search glyph.
     Data URIs cannot read custom properties, so the stroke is --muted (#5d6c7d). */
  --select-arrow:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%235d6c7d' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --search-icon:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none' stroke='%235d6c7d' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='4.75'/%3E%3Cpath d='M10.5 10.5 14 14' stroke-linecap='round'/%3E%3C/svg%3E");
  --shadow:0 10px 28px rgba(24,44,65,.08);
}
* { box-sizing:border-box; }
body { margin:0; min-width:1000px; color:var(--ink); background:var(--bg); font:14px/1.5 "Segoe UI Variable Text","Segoe UI",system-ui,"Microsoft YaHei",sans-serif; text-rendering:optimizeLegibility; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
button,a,input,select,textarea,summary { touch-action:manipulation; -webkit-tap-highlight-color:rgba(35,94,167,.14); }
[hidden] { display:none !important; }
.app-shell { min-height:100vh; display:flex; }
.login-shell { min-height:100vh; display:grid; place-items:center; padding:24px; background:linear-gradient(115deg,#102137 0 58%,#173f55 58% 59%,#e5edef 59%); }
.login-card { width:min(430px,100%); padding:32px; border:1px solid rgba(255,255,255,.62); border-radius:12px; background:#fff; box-shadow:0 28px 72px rgba(4,16,36,.3); }
.login-brand { display:flex; align-items:center; gap:11px; margin-bottom:28px; }
.login-brand>span { display:grid; place-items:center; width:38px; height:38px; border-radius:9px; color:#fff; background:#2563eb; font-size:20px; font-weight:800; }
.login-brand strong,.login-brand small { display:block; }
.login-brand strong { font-size:17px; }
.login-brand small { margin-top:2px; color:var(--muted); font-size:12px; }
.login-card h1 { margin:0 0 7px; font-size:23px; }
.login-card>p { margin:0 0 20px; color:var(--muted); }
.login-card form { display:grid; gap:14px; }
.login-button { width:100%; margin-top:4px; min-height:40px; }
.login-help { margin-top:20px; color:#6d7d94; font-size:12px; line-height:1.7; }
.login-notice { margin:0 0 16px; padding:9px 11px; border-radius:6px; color:#9b3a20; background:#fff2e9; font-size:12px; }
/* Navigation and workspace layout. */
.sidebar { position:fixed; inset:0 auto 0 0; width:252px; color:#dbe7f0; background:linear-gradient(180deg,var(--navy),#0d1c2c); overflow-y:auto; z-index:2; }
.brand { padding:25px 22px 19px; border-bottom:1px solid rgba(255,255,255,.1); }
.brand-mark { display:flex; align-items:center; gap:11px; color:#fff; font-size:19px; font-weight:700; }
.brand-icon { width:32px; height:32px; display:grid; place-items:center; border-radius:9px; background:#2970e6; font-size:18px; }
.brand small { display:block; margin-top:7px; color:#9fb3d2; font-size:11px; letter-spacing:.2px; }
.nav-group { padding:17px 12px 3px; }
.nav-group-label { padding:0 10px 8px; color:#8197bc; font-size:11px; font-weight:700; letter-spacing:.8px; }
.nav-item { display:flex; align-items:center; gap:10px; width:100%; padding:10px; border:0; border-radius:7px; color:#c4d1e8; background:transparent; text-align:left; }
.nav-item:hover { background:rgba(255,255,255,.08); color:#fff; }
.nav-item.active { color:#fff; background:#214660; box-shadow:inset 3px 0 0 #52b7b4; }
.nav-icon { width:20px; text-align:center; opacity:.9; }
.workspace { width:calc(100% - 252px); margin-left:252px; }
.topbar { min-height:72px; padding:0 30px; display:flex; justify-content:space-between; align-items:center; background:rgba(255,255,255,.96); border-bottom:1px solid var(--line); box-shadow:0 1px 0 rgba(19,36,59,.03); }
.topbar h1 { margin:0; font-size:21px; letter-spacing:.2px; }
.breadcrumb { margin-top:3px; color:var(--muted); font-size:12px; }
.topbar-actions { display:flex; gap:11px; align-items:center; min-width:0; }
.topbar-actions > .button { flex:none; white-space:nowrap; }
.role-chip { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:6px 10px; border-radius:14px; color:#294a77; background:#eef4fb; font-size:12px; }
/* #432: top-bar button labels never wrap. When the row is short of space the
   role chip gives way first (ellipsis, full text in its title), then the
   company selector down to 9rem. Both start from that minimum and grow back to
   their full width, the selector first. If the actions still do not fit beside
   the title they move to a row of their own and wrap there, as in the narrow
   layout (max-width:1100px) further down, which is unchanged. */
@media (min-width:1101px) {
  .topbar { flex-wrap:wrap; column-gap:20px; row-gap:10px; padding-block:9px; }
  .topbar-actions { flex:1 1 auto; flex-wrap:wrap; justify-content:flex-end; min-width:auto; }
  .topbar-actions > .searchable-select { flex:1000 1 auto; width:9rem; min-width:9rem; max-width:max-content; }
  .role-chip { flex:1 1 auto; width:0; min-width:4.5em; max-width:max-content; }
}
.company-select { max-width:260px; min-height:34px; padding:6px 9px; border:1px solid var(--line); border-radius:6px; color:#294a77; background:#fff; font-weight:600; }
.content { padding:26px 30px 48px; max-width:1720px; }
.page-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:20px; }
.page-heading h2 { margin:0; padding-left:12px; border-left:4px solid var(--teal); font:700 22px/1.25 "Segoe UI Variable Display","Segoe UI",system-ui,sans-serif; letter-spacing:-.2px; text-wrap:balance; }
.page-heading p { max-width:800px; margin:5px 0 0; color:var(--muted); }
/* Shared controls, pending-operation state, and content primitives. */
.button {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:var(--control-height);
  padding:8px 14px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  color:#2c4055;
  background:#fff;
  font-weight:650;
}
.button:hover { border-color:#adc1e0; background:#f8fbff; }
.button.primary { border-color:var(--blue); color:#fff; background:var(--blue); box-shadow:0 1px 1px rgba(16,38,61,.12); }
.button.primary:hover { background:#1d55c8; }
.button.danger { color:var(--red); }
.button.small { min-height:32px; padding:5px 10px; font-size:12px; }
.operation-pending::before { content:""; width:13px; height:13px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:operation-spin .7s linear infinite; }
[data-operation-pending="true"] { cursor:progress; }
@keyframes operation-spin { to { transform:rotate(360deg); } }
.global-operation-overlay {
  position:fixed;
  inset:0;
  z-index:10000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(21,36,60,.42);
  backdrop-filter:blur(2px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .12s ease,visibility .12s ease;
}
.global-operation-overlay.visible { opacity:1; visibility:visible; pointer-events:all; cursor:progress; }
.global-operation-card {
  min-width:280px;
  max-width:420px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  padding:28px 32px;
  border:1px solid rgba(255,255,255,.7);
  border-radius:14px;
  color:#203554;
  background:#fff;
  box-shadow:0 18px 55px rgba(13,31,57,.28);
  text-align:center;
}
.global-operation-card strong { font-size:18px; }
.global-operation-card small { color:var(--muted); font-size:14px; }
.global-operation-spinner { width:42px; height:42px; border:4px solid #dbe7fa; border-right-color:var(--blue); border-radius:50%; animation:operation-spin .7s linear infinite; }
.modal:focus-visible { outline:3px solid #77a3df; outline-offset:-3px; }
.visually-hidden {
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
.patch-upload-label.disabled { opacity:.55; pointer-events:none; }
.modal-confirmation { padding:19px 20px 20px; }
.modal-confirmation p { margin:0; line-height:1.65; }
.operation-locked body { overflow:hidden; }
/* Dashboard, tables, filters, reports, and date controls. */
.kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(160px,1fr)); gap:16px; }
.kpi-card { min-width:0; min-height:124px; padding:18px; border:1px solid var(--line); border-radius:var(--radius); background:var(--card); box-shadow:0 2px 8px rgba(25,48,70,.04); }
.kpi-card .kpi-label { color:var(--muted); font-size:13px; }
.kpi-card .kpi-value { margin:8px 0 6px; color:#172e50; font-size:25px; font-weight:750; letter-spacing:-.6px; }
.kpi-card .kpi-note { color:#8491a6; font-size:12px; }
.kpi-card .kpi-value,.kpi-card .kpi-note,.kpi-subsidiary,.shared-credit-pool dd { overflow-wrap:anywhere; }
.kpi-card.green { border-top:3px solid var(--green); }.kpi-card.blue { border-top:3px solid var(--blue); }.kpi-card.orange { border-top:3px solid var(--orange); }.kpi-card.red { border-top:3px solid var(--red); }
.shared-credit-summary { margin-top:16px; padding:15px; border:1px solid #bfd3ef; border-radius:10px; background:#f7faff; }
.shared-credit-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:12px; }
.shared-credit-heading strong,.shared-credit-heading small { display:block; }
.shared-credit-heading small,.shared-credit-heading>span { margin-top:3px; color:var(--muted); font-size:12px; }
.shared-credit-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:10px; }
.shared-credit-pool { min-width:0; padding:12px; border:1px solid #d8e3f1; border-radius:8px; background:#fff; }
.shared-credit-pool-title { display:flex; justify-content:space-between; gap:10px; }
.shared-credit-pool-title span { overflow:hidden; color:var(--muted); font-size:12px; text-overflow:ellipsis; white-space:nowrap; }
.shared-credit-pool dl { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:10px 0 0; }
.shared-credit-pool dl div { min-width:0; padding:8px; border-radius:6px; background:#f6f8fc; }
.shared-credit-pool dt { color:var(--muted); font-size:11px; }
.shared-credit-pool dd { margin:3px 0 0; color:#203b60; font-weight:750; }
.shared-credit-pool .warning { color:#8a5a00; background:#fff8e6; }
.shared-credit-warning { margin-top:9px; color:#9d2f2f; font-size:12px; }
.two-col { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(320px,.9fr); gap:18px; margin-top:18px; }
.credit-source-summary{margin-top:16px;padding:15px;border:1px solid #c9d7e7;border-radius:10px;background:#fff}
.credit-source-group+.credit-source-group{margin-top:14px}
.credit-source-group h4{display:flex;align-items:center;gap:7px;margin:0 0 7px;color:#24425f}
.credit-source-group h4 span{padding:1px 7px;border-radius:999px;background:#eaf2fa;color:#49657f;font-size:11px}
.credit-source-table-wrap{overflow-x:auto}
.credit-source-table{min-width:760px}
.credit-source-cell-value{min-width:0}
.credit-source-table td.numeric>.credit-source-cell-value{display:block}
.credit-source-table td small{display:block;margin-top:3px;color:var(--muted);font-size:11px}
.credit-impact-item+.credit-impact-item::before{content:" · "}
.credit-source-table .negative{color:#b42318;font-weight:800}
.linked-margin-deposit-list{display:grid;gap:8px;margin-top:12px}.linked-margin-deposit-list .button{display:flex;justify-content:space-between;gap:12px;width:100%;text-align:left}
@media (max-width:720px){
  .credit-source-summary{padding:12px}
  .credit-source-table.data-table{min-width:0}
  .credit-source-table thead{display:none}
  .credit-source-table,.credit-source-table tbody,.credit-source-table tr,.credit-source-table td{display:block;width:100%}
  .credit-source-table tr{margin-bottom:10px;padding:8px 10px;border:1px solid #d8e3f1;border-radius:8px}
  .credit-source-table td{padding:6px 0;border:0;text-align:left!important}
  .credit-source-table td::before{content:attr(data-label);display:block;margin-bottom:3px;color:var(--muted);font-size:12px}
  .credit-source-cell-value{display:block!important;overflow-wrap:anywhere}
  .credit-source-cell-value small{white-space:normal;overflow-wrap:anywhere}
  .credit-impact-item{display:block}
  .credit-impact-item+.credit-impact-item::before{content:""}
  .shared-credit-heading{align-items:flex-start}
  .shared-credit-grid{grid-template-columns:1fr}
}
.card { overflow:hidden; border:1px solid var(--line); border-radius:var(--radius); background:var(--card); box-shadow:0 2px 8px rgba(25,48,70,.04); }
.card-head { display:flex; align-items:center; justify-content:space-between; padding:14px 17px; border-bottom:1px solid var(--line); }
.card-head h3 { margin:0; font-size:15px; }.card-head span { color:var(--muted); font-size:12px; }
.card-body { padding:14px 17px; }
.alert-row { display:grid; grid-template-columns:84px 1fr 95px 88px; gap:8px; align-items:center; padding:10px 0; border-bottom:1px solid #eef1f5; }
.alert-row:last-child { border-bottom:0; }.alert-row strong { font-size:13px; }.alert-row small { color:var(--muted); }.due { color:var(--red); font-size:12px; font-weight:700; text-align:right; }
.maturity-card .card-body { padding:0; }
.maturity-group { border-bottom:1px solid var(--line); }
.maturity-group:last-child { border-bottom:0; }
.maturity-group summary { display:flex; align-items:center; justify-content:space-between; padding:13px 17px; color:#29496f; background:#f8faff; cursor:pointer; font-weight:750; }
.maturity-group summary:hover { background:#eef4fd; }
.maturity-group summary b { color:var(--muted); font-size:12px; }
.maturity-record {
  display:grid;
  grid-template-columns:100px minmax(0,1fr) 100px;
  align-items:center;
  gap:12px;
  width:100%;
  padding:13px 17px;
  border:0;
  border-bottom:1px solid #eef1f5;
  color:inherit;
  background:#fff;
  text-align:left;
}
.maturity-record:last-child { border-bottom:0; }
.maturity-record:hover { background:#f7faff; }
.maturity-record>span,.maturity-record small { color:var(--muted); }
.maturity-record div { min-width:0; }
.maturity-record strong,.maturity-record small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.maturity-record small { margin-top:3px; }
.due.overdue { color:#b42318; }
.register-readonly { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; overflow:hidden; }
.register-readonly-scroll { flex:1 1 auto; min-height:0; padding:19px 20px 20px; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.register-readonly-scroll:focus-visible { outline:3px solid rgba(103,167,216,.55); outline-offset:-3px; }
.register-readonly .calculated-value { min-height:var(--control-height); height:auto; overflow-wrap:anywhere; }
.register-readonly .calculated-value .truncate { max-width:none; white-space:normal; }
.empty { padding:32px 15px; color:#7b899d; text-align:center; }.empty-icon { display:block; margin-bottom:6px; font-size:21px; }
.stats-list { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.stat-cell { padding:11px; border:1px solid #edf0f4; border-radius:7px; }
.stat-cell span { color:var(--muted); font-size:12px; }
.stat-cell strong { display:block; margin-top:2px; font-size:18px; }
.toolbar { display:flex; flex-wrap:wrap; gap:10px; align-items:center; padding:14px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.search { flex:1; min-width:220px; height:var(--control-height); padding:8px 11px; border:1px solid var(--line-strong); border-radius:var(--radius); outline:none; }
.search:focus-visible { border-color:var(--focus); box-shadow:0 0 0 3px rgba(103,167,216,.22); }
.filter-select { min-width:120px; height:var(--control-height); padding:7px 9px; border:1px solid var(--line-strong); border-radius:var(--radius); background:#fff; }
.cash-filter-toolbar { align-items:flex-end; margin-bottom:14px; }
.filter-field { display:flex; flex-direction:column; gap:5px; min-width:130px; }
.filter-field label { font-size:12px; color:var(--muted); font-weight:600; }
.filter-field input { min-width:130px; height:34px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; }
.cash-keyword { flex:1; min-width:190px; }
.cash-keyword input { width:100%; }
.register-view-tabs { margin-bottom:14px; }
.table-card { margin-top:14px; overflow:auto; overscroll-behavior-inline:contain; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.data-table { width:100%; min-width:940px; border-collapse:collapse; }
.data-table th { position:sticky; top:0; z-index:1; padding:11px 12px; color:#40566b; background:#eef2f4; border-bottom:1px solid var(--line-strong); font-size:12px; text-align:left; white-space:nowrap; }
.data-table td { padding:11px 12px; border-bottom:1px solid #e7ecef; vertical-align:middle; }
.data-table tbody tr:nth-child(even) td { background:#fbfcfc; }
.data-table tr:hover td { background:#edf6f5; }
/* #432: list action cells (small buttons placed directly in the cell). Each
   label stays on one line and the buttons wrap inside the cell; below 940px a
   table with such a cell may narrow to its card instead of scrolling. :where()
   keeps both rules weaker than page-specific table and button rules. */
.data-table td > :where(.button.small) { white-space:nowrap; }
.data-table:where(:has(> tbody > tr > td > .button.small)) { min-width:min(940px,100%); }
.numeric { text-align:right; font-family:"Cascadia Mono","SFMono-Regular",Consolas,monospace; font-variant-numeric:tabular-nums; }
.muted { color:var(--muted); }
.truncate { max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.status { display:inline-flex; align-items:center; gap:5px; padding:3px 8px; border-radius:10px; font-size:11px; font-weight:700; }
.status::before { content:""; width:6px; height:6px; border-radius:50%; background:currentColor; }
.status.active { color:#08705b; background:#e5f4ee; }
.status.closed { color:#667483; background:#edf0f2; }
.status.warning { color:#875209; background:#fff1d1; }
/* #585: a received LC created for a linked issued LC, waiting for its operator. */
.status.pending { color:#875209; background:#fff1d1; }
.linked-beneficiary { display:grid; gap:8px; }
.linked-beneficiary [hidden] { display:none; }
.todo-record-facts { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:8px 16px; margin:12px 0; }
.todo-record-facts dt { font-size:12px; color:#667483; }
.todo-record-facts dd { margin:2px 0 0; font-weight:600; overflow-wrap:anywhere; }
.segmented { display:inline-flex; padding:3px; border:1px solid var(--line); border-radius:7px; background:#fff; }
.segmented button { padding:5px 11px; border:0; border-radius:5px; color:#64748b; background:transparent; }
.segmented button.active { color:#194d9d; background:#eaf1ff; font-weight:700; }
.report-controls { display:grid; gap:14px; margin-bottom:15px; padding:14px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.report-tabs { padding-bottom:14px; border-bottom:1px solid var(--line); }
/* #577: four report tabs; on a phone they wrap instead of widening the page. */
.report-tabs > .segmented { flex-wrap:wrap; max-width:100%; }
.export-actions { display:inline-flex; flex-wrap:wrap; gap:8px; }
.report-loading { min-height:180px; display:grid; place-items:center; }
.field { display:grid; gap:6px; }
.field label { color:#536176; font-size:12px; font-weight:650; }
.field input,.field select,.field textarea { min-height:var(--control-height); padding:8px 10px; border:1px solid var(--line-strong); border-radius:var(--radius); color:var(--ink); background:#fff; outline:none; }
.field textarea { min-height:82px; resize:vertical; }
.field input:focus-visible,.field select:focus-visible,.field textarea:focus-visible { border-color:var(--focus); box-shadow:0 0 0 3px rgba(103,167,216,.22); }
.date-control { position:relative; display:flex; min-width:0; }
.date-control input { width:100%; padding-right:38px; font-variant-numeric:tabular-nums; }
.date-trigger { position:absolute; top:1px; right:1px; width:34px; height:33px; border:0; border-left:1px solid #e4e9f1; border-radius:0 5px 5px 0; color:#42658f; background:#f8faff; cursor:pointer; }
.date-trigger:hover { color:#174f91; background:#eaf2ff; }
.date-picker-popover { position:fixed; z-index:30; width:292px; padding:12px; border:1px solid #cfd8e6; border-radius:10px; color:#24364f; background:#fff; box-shadow:0 14px 38px rgba(21,44,76,.22); font-size:13px; }
.calendar-head { display:grid; grid-template-columns:34px 1fr 34px; align-items:center; gap:5px; margin-bottom:8px; }
.calendar-head strong { text-align:center; text-transform:capitalize; }
.calendar-head button,.calendar-foot button { min-height:30px; border:0; border-radius:6px; color:#315f99; background:#f3f7fd; cursor:pointer; }
.calendar-head button:hover,.calendar-foot button:hover { background:#e4eefc; }
.calendar-head button { font-size:22px; line-height:1; }
.calendar-week,.calendar-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; }
.calendar-week span { padding:5px 0; color:#748299; font-size:11px; font-weight:700; text-align:center; }
.calendar-day { aspect-ratio:1; border:0; border-radius:7px; color:#2c3e56; background:transparent; font-size:12px; cursor:pointer; }
.calendar-day:hover { background:#eaf2ff; }
.calendar-day.outside { color:#a8b2c1; }
.calendar-day.today { box-shadow:inset 0 0 0 1px #77a3df; }
.calendar-day.selected { color:#fff; background:#1769d2; box-shadow:none; font-weight:750; }
.calendar-foot { display:flex; justify-content:space-between; gap:8px; margin-top:9px; padding-top:9px; border-top:1px solid #edf0f5; }
.calendar-foot button { padding:5px 10px; font-weight:650; }
/* Administration, import, modal, and form components. */
.settings-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.setting-tile { min-height:145px; padding:18px; border:1px solid var(--line); border-radius:10px; color:inherit; background:#fff; text-align:left; box-shadow:0 3px 10px rgba(31,54,88,.03); }
.setting-tile:hover { border-color:#a9c3e9; box-shadow:var(--shadow); }
.setting-tile .tile-icon { display:block; margin-bottom:8px; font-size:20px; }
.setting-tile strong { display:block; font-size:15px; }
.setting-tile span { display:block; margin-top:5px; color:var(--muted); font-size:12px; }
.choice-row { display:flex; flex-wrap:wrap; gap:10px; }
.choice { display:flex; align-items:center; gap:6px; padding:8px 11px; border:1px solid var(--line); border-radius:7px; background:#f8fafc; }
.wide-card { grid-column:1 / -1; }
.conversion-preview { padding:11px 13px; border:1px solid #cfe0fb; border-radius:8px; background:#f3f8ff; }
.conversion-preview .ui-field-label { color:#31527d; }
.pnl-table { overflow:auto; }
.pnl-table table { min-width:1900px; }
.pnl-table th { min-width:125px; white-space:normal; }
.pnl-table th:first-child { min-width:150px; }
.pnl-net { font-weight:700; color:var(--navy); }
.pnl-company strong,.pnl-company small,.pnl-primary-amount,.pnl-secondary-amount { display:block; }
.pnl-company small,.pnl-secondary-amount { margin-top:3px; color:var(--muted); font-size:11px; font-weight:500; }
.pnl-primary-amount { white-space:nowrap; }
.pnl-conversion-panel { margin:0 0 12px; overflow:hidden; border:1px solid #bfd3ef; border-radius:9px; background:#fff; }
.pnl-conversion-panel.warning { border-color:#e5bd68; }
.pnl-conversion-panel>summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:42px;
  padding:8px 12px;
  color:#29496f;
  background:#f7faff;
  cursor:pointer;
  list-style:none;
  font-weight:750;
}
.pnl-conversion-panel.warning>summary { color:#80520b; background:#fff9ec; }
.pnl-conversion-panel>summary::-webkit-details-marker { display:none; }
.pnl-conversion-panel>summary:hover { background:#edf4ff; }
.pnl-conversion-panel.warning>summary:hover { background:#fff3d7; }
.pnl-conversion-panel>summary:focus-visible { outline:3px solid #77a3df; outline-offset:-3px; }
.pnl-conversion-panel[open]>summary { border-bottom:1px solid var(--line); }
.pnl-conversion-title,.pnl-conversion-warning { display:inline-flex; align-items:center; gap:7px; }
.pnl-conversion-title>span { font-size:18px; }
.pnl-conversion-warning { color:#9d2f2f; font-size:12px; }
.pnl-conversion-badge { display:grid; place-items:center; min-width:22px; height:22px; padding:0 6px; border-radius:11px; color:#fff; background:#c73535; font-size:12px; font-variant-numeric:tabular-nums; }
.pnl-conversion-complete { color:#08785b; font-size:12px; }
.pnl-conversion-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding:12px; }
.pnl-conversion-grid section { min-width:0; padding:12px; border:1px solid #e1e8f2; border-radius:8px; background:#fbfcff; }
.pnl-conversion-grid h3 { margin:0 0 8px; font-size:13px; }
.pnl-conversion-overview { grid-column:1 / -1; display:flex; align-items:center; gap:10px; }
.pnl-conversion-overview strong { color:#08785b; }
.pnl-conversion-overview.warning strong { color:#9d2f2f; }
.pnl-conversion-overview span { color:var(--muted); font-size:12px; }
.pnl-conversion-section.warning { border-color:#efd49a; background:#fffaf0; }
.pnl-conversion-list { max-height:240px; margin:0; padding-left:19px; overflow:auto; }
.pnl-conversion-list li { padding:5px 0; }
.pnl-conversion-list strong,.pnl-conversion-list small { display:block; overflow-wrap:anywhere; }
.pnl-conversion-list strong { font-size:12px; }
.pnl-conversion-list small { margin-top:2px; color:var(--muted); font-size:11px; }
.field-label-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }.field-label-actions label { margin:0; }.reminder-module-choices .choice { min-width:180px; }
.credit-facilities-table table { min-width:1750px; }
.credit-facilities-table th { min-width:130px; text-align:center; white-space:normal; vertical-align:middle; }
.credit-facilities-table th:first-child { min-width:90px; }
.credit-total-row td { font-weight:750; color:var(--navy); background:#f3f7fd; border-top:2px solid #9bb4d8; }
.report-unit { margin-bottom:10px; }
.notice.warning { margin-bottom:10px; color:#8a5a00; border-color:#f2d08b; background:#fff8e6; }
.import-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; margin-top:15px; }
.import-sheet { padding:11px; border:1px solid #e7edf6; border-radius:7px; background:#fbfcff; }
.import-sheet strong { display:block; }
.import-sheet span { color:var(--muted); font-size:12px; }
.import-order { margin-bottom:16px; }
.import-template-grid { display:grid; gap:12px; }
.import-template-card {
  display:grid;
  grid-template-columns:44px minmax(0,1fr) auto;
  gap:14px;
  align-items:center;
  padding:16px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  box-shadow:0 3px 10px rgba(31,54,88,.03);
}
.template-step { display:grid; place-items:center; width:36px; height:36px; border-radius:10px; color:#fff; background:#2563eb; font-size:16px; font-weight:800; }
.template-content h3 { margin:0; font-size:15px; }.template-content p { margin:4px 0 6px; color:var(--muted); }.template-meta { color:#8190a5; font-size:12px; }
.template-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
.import-lower { margin-top:18px; }
.import-history { display:grid; gap:0; }
.import-history-row { display:flex; justify-content:space-between; gap:16px; padding:10px 0; border-bottom:1px solid #edf1f6; }.import-history-row:last-child { border-bottom:0; }
.import-history-row strong,.import-history-row span { display:block; }.import-history-row span,.import-history-row small { color:var(--muted); font-size:12px; }.import-history-row small { text-align:right; }
.modal-overlay { position:fixed; inset:0; z-index:5; display:grid; place-items:center; padding:24px; background:rgba(10,25,48,.42); }
.modal { width:min(760px,100%); max-height:calc(100vh - 48px); overflow:auto; overscroll-behavior:contain; border-radius:12px; background:#fff; box-shadow:0 20px 55px rgba(0,0,0,.24); }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:17px 20px; border-bottom:1px solid var(--line); }
.modal-header h3 { margin:0; font-size:17px; text-wrap:balance; }
.icon-button { width:32px; height:32px; border:0; border-radius:5px; color:#6a778c; background:transparent; font-size:20px; }
.icon-button:hover { background:#f1f4f8; }
.modal form { padding:19px 20px 20px; }
.form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.form-grid .wide { grid-column:1 / -1; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:21px; }
.notice { padding:12px 14px; border:1px solid #cfe0fb; border-radius:8px; color:#31527d; background:#f3f8ff; }
.margin-registration-notice [data-margin-amount-status] { display:block; margin-top:7px; }
.toast-root { position:fixed; top:18px; right:22px; z-index:8; display:grid; gap:8px; }
.toast { min-width:270px; padding:11px 14px; border-radius:7px; color:#fff; background:#203b60; box-shadow:0 8px 24px rgba(18,43,78,.2); }
.toast.error { background:#b93742; }
.audit-table { min-width:740px; }
.password-policy { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:7px; margin-top:3px; padding:10px; border:1px solid #dce4ef; border-radius:8px; background:#f8fafc; }
.password-policy-title { grid-column:1 / -1; color:#596a80; font-size:12px; font-weight:700; }
.password-rule { display:flex; align-items:center; gap:6px; color:#758398; font-size:12px; transition:color .15s ease; }
.password-rule-icon { display:grid; place-items:center; flex:0 0 18px; width:18px; height:18px; border:1px solid #b9c4d2; border-radius:50%; color:#8b98aa; font-size:11px; font-weight:800; }
.password-rule.met { color:#08785b; font-weight:700; }
.password-rule.met .password-rule-icon { border-color:#17a27e; color:#fff; background:#17a27e; }
.field input[aria-invalid="true"] { border-color:#d97878; }
.button:disabled { cursor:not-allowed; opacity:.48; }
.register-modal { width:min(1180px,100%); overflow:hidden; }
.register-form-modal { display:flex; flex-direction:column; max-height:min(calc(100vh - 48px),calc(100dvh - 48px)); }
.register-form-modal>form { display:flex; flex:1 1 auto; flex-direction:column; min-height:0; max-height:none; overflow:hidden; padding:0; }
.register-form-scroll { flex:1 1 auto; min-height:0; padding:19px 20px 20px; overflow:auto; overscroll-behavior:contain; }
.register-form-sections { container-type:inline-size; display:grid; gap:14px; }
.register-form-section { min-width:0; padding:14px; border:1px solid #d8e3f1; border-radius:9px; background:#fbfdff; }
.register-form-section>h4 { margin:0 0 12px; color:#23466f; font-size:13px; }
.register-form-section .form-grid { grid-template-columns:repeat(3,minmax(0,1fr)); align-items:start; }
.register-form-section .field>label,.register-form-section .field>.ui-field-label { min-height:32px; line-height:1.35; overflow-wrap:anywhere; }
.field-label-help { color:#718299; font-size:11px; font-weight:500; }
.register-modal .modal-actions { flex:0 0 auto; margin:0; padding:13px 20px calc(13px + env(safe-area-inset-bottom,0px)); border-top:1px solid var(--line); background:#fff; }
.register-context { margin-bottom:16px; padding:11px 13px; border:1px solid #cfe0fb; border-radius:8px; color:#31527d; background:#f3f8ff; }
.register-context small { color:#65758c; }
.form-section { margin-top:4px; padding:9px 11px; border-radius:7px; color:#23466f; background:#eaf2ff; font-size:13px; font-weight:750; }
.calculated-value { min-height:35px; padding:8px 9px; border:1px dashed #a9bdd8; border-radius:6px; color:#23466f; background:#f5f8fc; font-variant-numeric:tabular-nums; }
.register-table .data-table { width:max-content; min-width:100%; }
.register-table th { max-width:210px; white-space:normal; }
.register-table .sticky-action { position:sticky; right:0; z-index:2; background:#f6f8fc; box-shadow:-1px 0 0 var(--line),-8px 0 12px -6px rgba(19,36,59,.22); white-space:normal; }
.register-table td.sticky-action { background:#fff; }
/* An empty wide register keeps its message in the visible part of the card (#358). */
.register-table { container-type:inline-size; }
.register-table td[colspan] > .empty { position:sticky; left:0; box-sizing:border-box; width:100cqw; }
.register-table tr:hover td.sticky-action { background:#fbfcff; }
.numeric-value { white-space:nowrap; }
.bank-charge-section { display:grid; gap:12px; padding:14px; border:1px solid #cbdced; border-radius:9px; background:#f7fbff; }
.bank-charge-section h4 { margin:0; color:#23466f; font-size:13px; }
.bank-charge-section p { margin:4px 0 0; }
.bank-charge-add { display:flex; align-items:center; gap:8px; }
.bank-charge-add select { min-width:220px; min-height:var(--control-height); }
.bank-charge-list { display:grid; gap:10px; }
.bank-charge-detail { position:relative; background:#fff; }
.bank-charge-detail summary { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#23466f; font-weight:750; cursor:pointer; }
.bank-charge-detail summary em { color:#8a5a00; font-size:11px; font-style:normal; }
.bank-charge-remove { margin-top:10px; }
.empty-inline { padding:18px; border:1px dashed #b8c9dd; border-radius:8px; color:#718299; text-align:center; }
.empty-inline.hidden { display:none; }
.lc-details-section .field-label-actions{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.lc-details-section .field-label-actions>div{min-width:0}
.lc-details-section .field-label-actions>.button{flex:0 0 auto;white-space:nowrap}
.lc-details-section h4{margin:0;color:#23466f;font-size:13px}
.lc-detail-list{display:grid;gap:10px}
.lc-detail-row{display:grid;grid-template-columns:1.2fr repeat(4,minmax(120px,1fr)) minmax(110px,.7fr) minmax(130px,.8fr);gap:8px;align-items:end;padding:10px;border:1px solid #d8e3f1;border-radius:8px;background:#fff}
.lc-detail-row label,.lc-detail-row .ui-field-label{display:block;margin-bottom:5px;font-size:11px;color:#65758c}
.lc-detail-row input,.lc-detail-row select{width:100%}
.lc-detail-actions{min-width:0;color:#65758c;font-size:12px}
.lc-detail-actions .button + small{display:block;margin-top:4px}
.lc-detail-row.reminder-highlight{border-color:#1f70d1;box-shadow:0 0 0 3px rgba(31,112,209,.18);background:#f3f8ff}
.estimated-input-control { position:relative; }
.estimated-input-control input { width:100%; padding-right:88px; }
.estimated-input-control input::placeholder { color:#8a9bb5; font-style:italic; opacity:1; }
.estimate-badge { position:absolute; top:50%; right:8px; translate:0 -50%; padding:2px 7px; border-radius:5px; color:#3567a3; background:#eef5ff; font-size:11px; font-weight:700; pointer-events:none; }
.estimated-input-control.manual .estimate-badge,.estimated-input-control.manual input::placeholder,.estimated-input-control.unavailable .estimate-badge { visibility:hidden; }
/* #362: the same estimate badge as an inline mark on report amounts. */
.estimate-badge.pnl-estimate { position:static; display:inline-block; translate:none; margin-top:4px; white-space:nowrap; font-family:"Segoe UI Variable Text","Segoe UI",system-ui,"Microsoft YaHei",sans-serif; }
.estimate-help { display:block; color:#718299; font-size:11px; line-height:1.35; }
.permission-company-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; padding:12px; border:1px solid var(--line); border-radius:8px; background:#f8faff; }
.permission-check { display:flex; align-items:center; gap:7px; color:#34445b; font-size:13px; }
.permission-check-group { grid-column:1/-1; padding-bottom:9px; border-bottom:1px solid var(--line); color:var(--primary); font-weight:700; }
.permission-check input,.permission-matrix input { width:17px; height:17px; accent-color:var(--primary); }
.permission-matrix-wrap { margin-top:18px; overflow:auto; border:1px solid var(--line); border-radius:8px; }
.permission-matrix { min-width:520px; margin:0; }
/* #367, #467, #469: the eight columns of the permission matrix fit a 960px dialog in all three languages; a
   narrower window scrolls them inside the matrix. Permission columns size to their content. */
.modal:has(#role-v2-form) { width:min(960px,100%); }
.permission-matrix th:not(:first-child),.permission-matrix td:not(:first-child) { text-align:center; }
.initialization-required { max-width:620px; margin:36px auto; text-align:center; }
.initialization-required .card-body { padding:34px; }
.initialization-required .empty { margin-bottom:10px; }
.initialization-required p { color:var(--muted); }
.permission-bulk-toolbar {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:18px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-bottom:0;
  border-radius:8px 8px 0 0;
  background:#f8faff;
}
.permission-bulk-toolbar + .permission-matrix-wrap { margin-top:0; border-radius:0 0 8px 8px; }
.permission-quick { display:inline-flex; gap:4px; margin-left:8px; vertical-align:middle; }
.permission-quick button { padding:2px 6px; border:1px solid #ced9e8; border-radius:5px; color:#315f99; background:#fff; font-size:11px; cursor:pointer; white-space:nowrap; }
.permission-quick button:hover { border-color:#8eb2df; background:#eaf2ff; }
.permission-module-cell { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:4px 8px; min-width:calc(var(--permission-module-width) - 16px); }
.permission-module-cell .permission-quick { flex-wrap:wrap; margin-left:0; }
.permission-matrix th .permission-quick { display:flex; flex-direction:column; align-items:stretch; margin:5px 0 0; }
/* #469: headers wrap and stack their two chips, so a column is as wide as its longest word or chip rather
   than both chips side by side. The module column stays in view while the other columns scroll sideways;
   scroll-padding keeps a focused box from scrolling in under it. */
.permission-matrix-wrap { --permission-module-width:150px; scroll-padding-left:var(--permission-module-width); }
.permission-matrix th { white-space:normal; vertical-align:bottom; }
.permission-matrix th,.permission-matrix td { padding-inline:8px; }
.permission-matrix th .permission-quick button { padding-inline:4px; white-space:normal; line-height:1.25; }
.permission-matrix :is(th,td):first-child { position:sticky; left:0; z-index:1; background:#fff;
  box-shadow:inset -1px 0 0 var(--line-strong); }
.permission-matrix thead th:first-child { z-index:2; background:#eef2f4; }
.language-picker { display:inline-flex; align-items:center; gap:5px; min-height:34px; padding:0 7px; border:1px solid var(--line); border-radius:7px; color:#53647d; background:#fff; white-space:nowrap; }
.language-picker select { min-width:82px; border:0; outline:0; color:#24364f; background:transparent; font:inherit; cursor:pointer; }
.login-card { position:relative; }
.language-picker.on-login { position:absolute; top:16px; right:16px; z-index:2; }
.language-picker.on-login + .login-brand { padding-right:112px; }
/* Tasks, system center, attachments, and audit presentation. */
.task-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
.task-card { padding:17px; border:1px solid var(--line); border-top:3px solid var(--blue); border-radius:10px; background:#fff; box-shadow:0 3px 10px rgba(31,54,88,.03); }
.personal-settings-stack { display:grid; gap:18px; }.personal-settings-stack form { display:grid; gap:4px; }.personal-settings-stack .system-save { margin-top:0; }
.task-card.urgent { border-top-color:var(--red); }
.task-card h3 { margin:12px 0 6px; }
.task-card p { min-height:39px; margin:0 0 14px; color:var(--muted); }
.task-meta,.task-actions { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.task-meta { padding-top:10px; border-top:1px solid #edf1f6; color:var(--muted); font-size:12px; }
.task-actions { justify-content:flex-end; margin-top:12px; }
.system-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-bottom:16px; }
.backup-list { max-height:350px; overflow:auto; }
.backup-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid #edf1f6; }
.backup-row:last-child { border-bottom:0; }
.backup-row strong,.backup-row small { display:block; }
.backup-row small { margin-top:3px; color:var(--muted); font-size:12px; }
.system-save { display:flex; justify-content:flex-end; margin-top:4px; }
.system-data-scale .table-card { margin:14px 0 8px; }
.system-data-scale .data-table { min-width:0; }
.system-data-scale .data-table th { white-space:normal; }
.system-data-scale .card-body > small { display:block; margin-top:6px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
/* #497: backup budget usage at 70% (caution) and 90% (warning), in the notice colours. */
.system-data-scale .system-backup-budget { margin-top:10px; }
.system-data-scale .system-backup-budget + .notice.warning { margin:10px 0 0; color:#9d2f2f; border-color:#e7a4a4; background:#fff5f5; }
.stat-cell.budget-caution { border-color:#f2d08b; background:#fff8e6; }
.stat-cell.budget-caution strong { color:#8a5a00; }
.stat-cell.budget-warning { border-color:#e7a4a4; background:#fff5f5; }
.stat-cell.budget-warning strong { color:#9d2f2f; }
/* #509: the save-time segments, the split readiness check and the undeclared-access counts. */
.system-data-scale .save-phase td:first-child { padding-left:28px; color:var(--muted); }
.system-data-scale :is(.system-split-health,.system-undeclared-access,.system-structure-readings) { margin-top:16px; padding-top:12px; border-top:1px solid var(--line); }
.system-data-scale :is(.system-split-health,.system-undeclared-access,.system-structure-readings) h4 { margin:0 0 10px; font-size:14px; }
.system-data-scale :is(.system-split-health,.system-undeclared-access) .notice { margin:10px 0 0; }
.system-data-scale :is(.system-split-health,.system-undeclared-access,.system-structure-readings) > small { display:block; margin-top:6px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.system-data-scale .split-health-detail { margin-top:10px; }
.system-data-scale .split-health-detail > summary { color:var(--blue); cursor:pointer; }
.system-data-scale .split-health-issue td { background:#fff8e6; color:#8a5a00; }
/* #648: the readings of the new structure: the layout of the split readiness check; program names wrap anywhere. */
.system-data-scale .structure-reading code { overflow-wrap:break-word; }
.system-data-scale .structure-reading .structure-field-names { display:block; min-width:16em; }
.system-data-scale .structure-reading .structure-field-names code { overflow-wrap:anywhere; }
/* #669: the system centre in titled sections. A section is a full-width item of .system-grid and lays its own
   cards out in the same two columns; the diagnostics section is a details element whose card takes the full width. */
.system-section { grid-column:1 / -1; }
.system-section-title { margin:0 0 10px; font-size:16px; line-height:1.35; overflow-wrap:anywhere; }
.system-section-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.system-diagnostics > summary { padding:12px 17px; border:1px solid var(--line); border-radius:var(--radius); background:var(--card); cursor:pointer; }
.system-diagnostics > summary:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
.system-diagnostics > summary .system-section-title { display:inline; margin:0; }
.system-diagnostics[open] > summary { margin-bottom:16px; }
.system-diagnostics .card { grid-column:1 / -1; }
.system-scale-summary .card-body > small { display:block; margin-top:8px; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
/* #672: the database connection card (its button, the last change, the SQLite archive), the form that changes the
   connection with its test result and confirmation, and the page shown while the service restarts. */
.system-database-connection .card-head { flex-wrap:wrap; gap:8px 12px; }
.system-database-connection :is(.system-database-switch,.system-database-archive) { overflow-wrap:anywhere; }
.system-database-connection :is(.system-database-switch,.system-database-archive) p { margin:6px 0 0; }
.system-database-connection .system-database-switch { margin-bottom:14px; }
.system-database-connection .system-database-archive { margin-top:14px; }
.database-connection-form .field :is(input,select) { width:100%; min-width:0; }
.database-connection-form .ui-form-hint { margin:12px 0 0; overflow-wrap:anywhere; }
.database-connection-form .database-password-required { margin:12px 0 0; overflow-wrap:anywhere; }
.database-connection-result { margin-top:14px; overflow-wrap:anywhere; }
.database-connection-result.danger { color:#9d2f2f; border-color:#e7a4a4; background:#fff5f5; }
.database-connection-result > strong { display:block; font-size:15px; }
.database-connection-result p { margin:8px 0 0; line-height:1.6; }
.database-connection-result > p:first-child { margin-top:0; }
.database-connection-result > strong + .database-overview { margin-top:12px; }
.database-connection-result h4 { margin:12px 0 6px; font-size:13px; }
.database-connection-result .database-overview { margin-top:10px; gap:8px 22px; }
.database-connection-result .database-overview-ledgers { grid-template-columns:repeat(3,minmax(0,1fr)); margin-top:0; }
.database-connection-result .database-connection-warning { font-weight:600; }
.database-restart { width:min(480px,100%); padding:32px; border:1px solid rgba(255,255,255,.62); border-radius:12px; background:#fff; box-shadow:0 28px 72px rgba(4,16,36,.3); overflow-wrap:anywhere; }
.database-restart h1 { margin:0 0 10px; font-size:23px; }
.database-restart p { margin:0; color:var(--muted); line-height:1.65; }
.database-restart .button { margin-top:20px; text-decoration:none; }
@media (max-width:720px) {
  .database-connection-form .form-grid,.database-connection-result .database-overview-ledgers { grid-template-columns:1fr; }
  .database-connection-form .form-grid .wide { grid-column:auto; }
  .database-restart { padding:24px 20px; }
}
/* #460: the system center save bar stays in view while the page scrolls. It is
   sticky, not fixed, so after the last card it takes its own space and covers nothing. */
#system-settings-form .system-save { position:sticky; bottom:0; z-index:3; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:0; padding:12px 0; border-top:1px solid var(--line); background:var(--bg); }
#system-settings-form .system-save .status { font-size:12px; }
.system-grid .card-body.form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
.system-time-zone .field,.online-update .field { min-width:0; }
.system-time-zone .field input,.online-update .field input { width:100%; }
.online-update-help,.backup-help { display:grid; gap:2px; margin-top:9px; color:var(--muted); line-height:1.5; overflow-wrap:anywhere; }
.backup-help { gap:6px; }
.online-update-result { margin-top:12px; overflow-wrap:anywhere; }
.online-update-result.danger { color:#9d2f2f; border-color:#e7a4a4; background:#fff5f5; }
.business-reset-action { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:5px 16px; margin:14px 0; padding:14px; border:1px solid #e7a4a4; border-radius:8px; background:#fff5f5; }
.business-reset-action strong { color:#9d2f2f; }
.business-reset-action span { color:var(--muted); font-size:12px; }
.business-reset-action .button { grid-column:2; grid-row:1 / span 2; }
/* #460: online update and the offline patch are sections of the "Version and Updates" card. */
.upgrade-section { margin-top:16px; padding-top:14px; border-top:1px solid var(--line); }
.upgrade-section-head { display:flex; justify-content:space-between; align-items:flex-start; flex-wrap:wrap; gap:8px 12px; margin-bottom:10px; }
.upgrade-section-head h4 { margin:0 0 4px; }
.upgrade-section-head small { color:var(--muted); }
.patch-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.patch-summary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 22px; }
.patch-summary>div { min-width:0; }
.patch-summary small,.patch-summary strong { display:block; }
.patch-summary small { margin-bottom:4px; color:var(--muted); }
.patch-summary strong,.patch-summary p { overflow-wrap:anywhere; }
.patch-summary p { margin:0; line-height:1.55; }
.patch-notes,.patch-message { grid-column:1/-1; }
.patch-message { margin:0; }
@media (max-width:720px) {
  .upgrade-section-head { display:grid; }
  .patch-actions { width:100%; }
  .patch-actions .button { flex:1 1 180px; }
  .patch-summary { grid-template-columns:1fr; }
  .patch-notes,.patch-message { grid-column:auto; }
}
@media (max-width:720px) { .system-time-zone .form-grid,.online-update .form-grid { grid-template-columns:1fr; } }
.pagination { display:flex; align-items:center; flex-wrap:wrap; gap:10px 14px; margin:12px 0 20px; padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:#fff; }
.pagination-total { margin-right:auto; color:var(--muted); font-size:12px; }
.pagination-navigation { display:flex; align-items:center; gap:5px; }
.pagination-page { min-width:32px; height:32px; padding:0 8px; border:1px solid var(--line); border-radius:6px; color:var(--navy); background:#fff; cursor:pointer; }
.pagination-page.active { border-color:var(--navy); color:#fff; background:var(--navy); }
.pagination-page:focus-visible,.pagination select:focus-visible { outline:3px solid #77a3df; outline-offset:2px; }
.pagination-size,.pagination-jump { display:flex; align-items:center; gap:6px; color:var(--muted); font-size:12px; }
.pagination select { min-height:32px; padding:4px 7px; border:1px solid var(--line); border-radius:6px; background:#fff; }
.import-history-row { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; padding:11px 0; }
.import-history-main { display:flex; align-items:center; gap:9px; min-width:0; }
.import-file-name { display:block; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.import-history-meta { display:flex; align-items:center; flex-wrap:wrap; gap:5px 10px; min-width:0; color:var(--muted); font-size:12px; }
.import-history-meta span:first-child { flex:1; min-width:130px; }
.import-history-detail { font-size:12px; }
.import-history-detail summary,.backup-list-more>summary { width:max-content; color:#31527d; cursor:pointer; }
.import-history-detail summary:focus-visible,.backup-list-more>summary:focus-visible { outline:3px solid #77a3df; outline-offset:2px; }
/* #459: the three backup lists of the system centre. */
.backup-list[data-backup-category] { max-height:none; overflow:visible; }
.backup-list-more>summary { max-width:100%; padding:9px 0; font-size:12px; }
.backup-list-more[open] { max-height:350px; overflow:auto; }
.backup-latest { margin:10px 0; }
.backup-list+h4 { margin-top:18px; }
.backup-restore-confirmation .notice { margin-top:14px; }
.import-history-detail ul { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:5px 18px; margin:8px 0 0; padding:9px 9px 9px 26px; border-radius:7px; background:#f7f9fc; }
.import-history-modal { max-height:58vh; overflow:auto; }
.attachment-panel,.import-preview { padding:19px 20px 20px; }
.attachment-panel form { padding:15px 0 0; }
.preview-kpis { display:flex; gap:18px; align-items:center; padding:16px 0; color:#31527d; }
.import-preview .data-table { min-width:520px; }
.audit-table details { margin-top:6px; }
.audit-table pre { max-width:440px; overflow:auto; padding:8px; border-radius:6px; background:#f6f8fc; font-size:11px; }
.audit-filters { margin:14px 0; padding:16px; }
.audit-filters .form-grid { margin-bottom:12px; grid-template-columns:repeat(3,minmax(0,1fr)); }
.audit-summary-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:14px 0; }
.audit-summary-grid .card-body { padding:0; }
.audit-summary-grid .data-table { min-width:0; }
.audit-table code { font-size:11px; word-break:break-all; }
@media (max-width:900px) { .audit-filters .form-grid,.audit-summary-grid { grid-template-columns:1fr; } }
.account-pending { color:#b45309; font-weight:700; }.link-button { border:0; background:none; color:#2563eb; cursor:pointer; padding:0 3px; text-decoration:underline; }
@container (max-width:1079px){.register-form-section .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@container (max-width:719px){.register-form-section .form-grid{grid-template-columns:1fr;}.register-form-section .form-grid .wide{grid-column:auto;}}
@media (max-width:1080px){.lc-detail-row{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media (max-width:1080px){.settlement-detail-row,.receipt-batch-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:720px){.lc-detail-row{grid-template-columns:1fr 1fr}}
@media (max-width:720px){
  .settlement-details-section .field-label-actions,.receipt-batch-footer{align-items:stretch;flex-direction:column}
  .settlement-details-section .field-label-actions>.button{width:100%}
  .batch-charge-row{grid-template-columns:1fr}
  .receipt-batch-card{padding:11px}
}
@media (max-width:430px){.lc-detail-row{grid-template-columns:1fr}}
@media (max-width:430px){.settlement-detail-row,.receipt-batch-grid{grid-template-columns:1fr}}
@media (max-width:1180px){.pnl-conversion-grid{grid-template-columns:1fr;}.pnl-conversion-overview{grid-column:auto;}.pnl-conversion-panel>summary{align-items:flex-start;}.pnl-conversion-warning{flex-shrink:0;}}
@media (max-width:620px){.password-policy{grid-template-columns:1fr;}.password-policy-title{grid-column:auto;}}
/* Late feature additions and their responsive overrides. */
.floating-attachments[hidden] { display:none !important; }
.closed-register-row td { background:#f8fafc; color:#64748b; }
.closed-register-row:hover td { background:#f1f5f9 !important; }
.register-field-group { border:1px solid #cfe0fb; border-radius:8px; background:#f8fbff; }
.register-field-group summary { padding:11px 13px; color:#23466f; background:#eaf2ff; border-radius:8px; cursor:pointer; font-size:13px; font-weight:750; }
.register-field-group[open] summary { border-bottom:1px solid #cfe0fb; border-radius:8px 8px 0 0; }
.register-field-group > .form-grid { padding:13px; }
.field input:disabled,.field select:disabled,.date-trigger:disabled { cursor:not-allowed; color:#94a3b8; background:#f1f5f9; }
.company-limit-detail-table { overflow:hidden; border:1px solid var(--line); border-radius:7px; }
/* #598: company · purpose · company cap · action. */
.company-limit-detail-head,.company-limit-detail-row { display:grid; grid-template-columns:minmax(200px,1.4fr) minmax(150px,1fr) minmax(150px,.8fr) 76px; align-items:center; gap:10px; }
.company-limit-detail-head { padding:8px 10px; color:#65758c; background:#f4f7fb; font-size:12px; font-weight:750; }
.company-limit-detail-row { padding:9px 10px; border-top:1px solid var(--line); background:#fff; }
.company-limit-detail-cell { min-width:0; }
.company-limit-mobile-label { display:none; }
.company-limit-detail-row select,.company-limit-detail-row input { width:100%; }
.button.compact { min-height:34px; padding:7px 10px; }
.button.danger { color:#b4323d; border-color:#e5bcc0; background:#fff8f8; }
.credit-company-limits > small { display:block; margin-top:8px; }
@container (max-width:719px){
  .company-limit-detail-head{display:none}
  .company-limit-detail-row{grid-template-columns:1fr;align-items:stretch;gap:10px;padding:12px}
  .company-limit-detail-cell{display:grid;gap:5px}
  .company-limit-mobile-label{display:block;color:var(--muted);font-size:12px;font-weight:650}
  .company-limit-detail-row .button{width:100%}
  .company-limit-detail-row .muted{padding:4px 0}
}
.searchable-native-select {
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  margin:-1px !important;
  padding:0 !important;
  overflow:hidden !important;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0 !important;
}
.searchable-select { position:relative; min-width:0; }
.searchable-select-trigger {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  width:100%;
  min-height:var(--control-height);
  padding:8px 12px 8px 10px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  color:var(--ink);
  background:#fff;
  text-align:left;
}
.searchable-select-trigger span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.searchable-select-trigger:focus-visible { outline:0; border-color:var(--focus); box-shadow:0 0 0 3px rgba(103,167,216,.22); }
.searchable-select-popover {
  position:fixed;
  z-index:1000;
  display:flex;
  flex-direction:column;
  max-width:calc(100vw - 32px);
  padding:8px;
  border:1px solid #c9d6e7;
  border-radius:9px;
  background:#fff;
  box-shadow:0 14px 34px rgba(21,44,76,.22);
}
.searchable-select-search { flex:none; width:100%; height:35px; margin-bottom:6px; padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:#fff; }
.searchable-select-options { display:flex; flex-direction:column; min-height:0; }
.searchable-select-pinned { flex:none; }
.searchable-select-results { max-height:240px; overflow:auto; min-height:0; }
.searchable-select-footer { flex:none; border-top:1px solid #edf1f6; }
.searchable-select-pages { display:flex; flex-wrap:wrap; gap:6px; justify-content:space-between; }
.searchable-select-pages button { flex:0 1 auto; }
.searchable-select-option { display:block; width:100%; min-height:36px; padding:8px 9px; border:0; border-radius:5px; color:var(--ink); background:#fff; text-align:left; }
.searchable-select-option:hover,.searchable-select-option.active { background:#eaf2ff; }
.searchable-select-option[aria-selected="true"] { color:#174f91; font-weight:750; }
.searchable-select-empty,.searchable-select-status { padding:9px; color:var(--muted); font-size:12px; }
.searchable-select-status { padding:5px 9px; }
.searchable-select-option span,.searchable-select-option strong,.searchable-select-option small { display:block; overflow-wrap:anywhere; }
.searchable-select-option small { margin-top:2px; color:var(--muted); font-size:11px; font-weight:500; }
.searchable-select-trigger[aria-invalid="true"] { border-color:#d14343; box-shadow:0 0 0 3px rgba(209,67,67,.12); }
.field input.number-format-error { border-color:#d14343; box-shadow:0 0 0 3px rgba(209,67,67,.12); }
@media (max-width:1250px) {
  .kpi-grid { grid-template-columns:repeat(2,1fr); }
  .settings-grid { grid-template-columns:repeat(2,1fr); }
  .import-template-card { grid-template-columns:44px 1fr; }
  .template-actions { grid-column:2; justify-content:flex-start; }
}
@media (max-width:1250px) { .task-grid { grid-template-columns:repeat(2,1fr); }.system-grid,.system-section-grid { grid-template-columns:1fr; }.wide-card { grid-column:auto; } }
@media (max-width:720px) {
  .pagination { align-items:stretch; }
  .pagination-total { width:100%; }
  .pagination-navigation { order:3; width:100%; overflow-x:auto; }
  .pagination-size,.pagination-jump { flex:1; }
  .import-history-row { grid-template-columns:minmax(0,1fr); }
  .import-history-meta { justify-content:flex-start; text-align:left; }
  .import-history-detail ul { grid-template-columns:1fr; }
  .business-reset-action { grid-template-columns:1fr; }
  .business-reset-action .button { grid-column:auto; grid-row:auto; width:100%; }
}
@media (max-width:1100px) {
  body { min-width:0; }
  .sidebar { width:68px; }
  .brand { padding:18px; }
  .brand-mark { justify-content:center; font-size:0; }
  .brand small,.nav-group-label { display:none; }
  .nav-group { padding:10px 8px 0; }
  .nav-item { justify-content:center; padding:10px 4px; font-size:0; }
  .nav-icon { font-size:14px; }
  .workspace { width:calc(100% - 68px); min-width:0; margin-left:68px; }
  .topbar { min-height:0; padding:12px 14px; flex-direction:column; align-items:stretch; gap:10px; }
  .topbar>div:first-child { width:100%; min-width:0; }
  .topbar h1 { font-size:18px; }
  .topbar-actions { width:100%; min-width:0; justify-content:flex-start; flex-wrap:wrap; gap:6px; }
  .role-chip { display:none; }
  .company-select { width:min(100%,260px); min-width:0; max-width:100%; }
  .content { padding:18px 14px 36px; }
  .page-heading { flex-direction:column; gap:10px; }
  .two-col,.task-grid,.settings-grid { grid-template-columns:1fr; }
  .import-template-card { grid-template-columns:36px minmax(0,1fr); padding:13px; }
  .template-actions { grid-column:1 / -1; }
  .floating-attachments { min-height:40px; }
}
.role-tags { min-width: 180px; }
.role-tag { display:inline-flex; align-items:center; margin:2px; padding:3px 8px; border-radius:999px; background:#e8f0ff; color:#244c92; font-size:12px; font-weight:700; }
.role-tag.inactive { background:#eef0f3; color:#747b86; text-decoration:line-through; }
.role-choice-list { display:grid; gap:10px; max-height:360px; overflow:auto; margin:14px 0; }
.role-choice-card { display:flex; gap:10px; align-items:flex-start; border:1px solid var(--line); border-radius:10px; padding:12px; cursor:pointer; }
.role-choice-card:has(input:checked) { border-color:var(--blue); background:#f3f7ff; }
.role-choice-card input { margin-top:4px; }
.role-choice-card span { display:grid; gap:4px; }
.role-choice-card small { color:var(--muted); line-height:1.55; }
.role-preview-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.role-preview-grid ul { margin:8px 0 0; padding-left:20px; max-height:180px; overflow:auto; }
@media (max-width: 760px) { .role-preview-grid { grid-template-columns:1fr; } }

/* Issue 28: treasury-grade system polish and governance workspaces. */
.skip-link { position:fixed; top:8px; left:8px; z-index:10001; padding:9px 12px; color:#fff; background:var(--navy); translate:0 -150%; }
.skip-link:focus { translate:0; }
:where(button,a,input,select,textarea,summary,[tabindex]):focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
.setting-tile { border-radius:var(--radius); box-shadow:0 2px 8px rgba(25,48,70,.04); transition:border-color .14s ease,box-shadow .14s ease,transform .14s ease; }
.setting-tile:hover { border-color:#91b5bc; box-shadow:var(--shadow); transform:translateY(-1px); }
.setting-tile .tile-icon { display:inline-flex; width:36px; height:36px; margin:0 0 12px; align-items:center; justify-content:center; border-radius:9px; color:#fff; background:var(--teal); }
.template-step { color:#fff; background:var(--teal); }
.record-row { cursor:pointer; }
.record-row:focus-visible td { background:var(--teal-soft); box-shadow:inset 0 2px 0 var(--teal),inset 0 -2px 0 var(--teal); }
.record-row:focus-visible td:first-child { box-shadow:inset 2px 0 0 var(--teal),inset 0 2px 0 var(--teal),inset 0 -2px 0 var(--teal); }
.record-row:focus-visible td:last-child { box-shadow:inset -2px 0 0 var(--teal),inset 0 2px 0 var(--teal),inset 0 -2px 0 var(--teal); }
.date-trigger { width:38px; height:38px; color:#315a76; background:#f3f7f8; }
.date-picker-popover,.searchable-select-popover { border-color:var(--line-strong); border-radius:var(--radius); box-shadow:0 16px 42px rgba(19,36,59,.2); }
.searchable-select-trigger,.searchable-select-search { min-height:var(--control-height); border-color:var(--line-strong); border-radius:var(--radius); }
.register-form-section { border-color:var(--line); border-radius:var(--radius); background:#fafcfc; }
.register-form-section>h4 { padding-left:9px; border-left:3px solid var(--teal); color:#244457; letter-spacing:.1px; }
.calculated-value { min-height:var(--control-height); padding:9px 10px; border-color:#aebfca; border-radius:var(--radius); color:#28465b; background:#f3f6f7; }
.lc-detail-row { align-items:end; padding:13px; border-color:var(--line); border-radius:var(--radius); background:#fff; }
.lc-detail-row input,.lc-detail-row select { min-height:var(--control-height); border:1px solid var(--line-strong); border-radius:var(--radius); }
.lc-detail-summary { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:10px 26px; margin-top:12px; padding:12px 14px; border-top:2px solid var(--teal); color:#43586a; background:#f0f6f5; }
.lc-detail-summary strong { margin-left:6px; color:#173f4b; font-family:"Cascadia Mono",Consolas,monospace; font-variant-numeric:tabular-nums; }
.settlement-details-section { border-top:3px solid var(--teal); background:linear-gradient(180deg,#f7fbfa 0,#fff 46px); }
.settlement-details-section .field-label-actions { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.settlement-details-section h4 { margin:0; color:#173f4b; text-wrap:balance; }
.settlement-details-section p { margin:5px 0 0; max-width:72ch; overflow-wrap:anywhere; }
.settlement-detail-list,.receipt-batch-list { display:grid; gap:10px; margin-top:12px; }
.settlement-detail-row {
  display:grid;
  grid-template-columns:repeat(3,minmax(130px,1fr)) minmax(150px,.8fr);
  align-items:end;
  gap:10px;
  padding:13px;
  border:1px solid var(--line);
  border-left:4px solid #76a8a0;
  border-radius:var(--radius);
  background:#fff;
}
.settlement-detail-row label,.receipt-batch-card label { display:block; margin-bottom:5px; color:#5f7180; font-size:11px; font-weight:700; }
.settlement-detail-row input,.settlement-detail-row select,.receipt-batch-card input,.receipt-batch-card select {
  width:100%;
  min-width:0;
  min-height:var(--control-height);
  padding:8px 10px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  color:var(--ink);
  background:#fff;
}
.settlement-detail-row :is(input,select):focus-visible,.receipt-batch-card :is(input,select):focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
.settlement-detail-row :is(input,select):disabled,.receipt-batch-card :is(input,select):disabled { color:var(--muted); background:#eef3f4; cursor:not-allowed; }
.receipt-batch-card { padding:14px; border:1px solid var(--line); border-left:4px solid #2f8177; border-radius:var(--radius); background:#fff; box-shadow:0 6px 18px rgba(23,63,75,.06); }
.receipt-batch-card input[readonly] { color:#536a76; background:#eef3f4; cursor:not-allowed; }
/* #585: the DHL number and amount of a written-back presentation detail stay locked while it is pending. */
.lc-detail-row input[readonly] { color:#536a76; background:#eef3f4; border-style:dashed; cursor:not-allowed; }
.receipt-batch-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
.batch-charge-list { display:grid; gap:7px; margin:12px 0; padding:10px; border-radius:var(--radius); background:#f1f6f5; }
.batch-charge-row { display:grid; grid-template-columns:repeat(3,minmax(150px,1fr)); gap:10px; padding:12px; border:1px solid #d6e4e1; border-radius:var(--radius); background:#fff; }
.batch-charge-date-action { display:flex; flex-direction:column; align-items:flex-start; gap:7px; min-width:0; }
.batch-charge-date-field { display:grid; gap:5px; width:100%; min-width:0; }
.batch-charge-date-title { color:#5f7180; font-size:11px; font-weight:700; overflow-wrap:anywhere; }
.batch-charge-date-field .calculated-value { display:block; width:100%; min-width:0; overflow-wrap:anywhere; }
.batch-charge-date-note { display:block; color:#718299; line-height:1.4; overflow-wrap:anywhere; }
.receipt-batch-card .batch-charge-remove { width:auto; max-width:100%; min-height:32px; padding:5px 10px; align-self:flex-start; white-space:normal; text-align:center; }
.reconciliation-banner {
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-top:12px;
  padding:12px 14px;
  border:1px solid #d5b66a;
  border-left:4px solid #b98418;
  border-radius:var(--radius);
  background:#fff9e8;
}
.reconciliation-banner[data-reconciliation-status="reconciled"] { border-color:#9bc5b9; border-left-color:#2f8177; background:#f1f8f6; }
.reconciliation-banner>div { display:grid; gap:4px; }
.reconciliation-banner span { color:#704f0e; font-weight:800; }
.reconciliation-banner small { color:#6b6251; overflow-wrap:anywhere; }
.reconciliation-banner label { display:block; margin-bottom:5px; color:#5f7180; font-size:11px; font-weight:700; }
.reconciliation-banner .ui-field { min-width:220px; }
.receipt-batch-footer { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }
.legacy-unallocated-notice { margin:12px 0; padding:12px; border:1px solid #e3c789; border-radius:var(--radius); color:#654a1e; background:#fff8e8; }
.legacy-unallocated-notice>p { margin:4px 0 10px; }
.legacy-unallocated-notice .bank-charge-section { border:0; background:transparent; }
@media (max-width:1080px) {
  .settlement-detail-row,.receipt-batch-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:720px) {
  .settlement-details-section .field-label-actions,.receipt-batch-footer { align-items:stretch; flex-direction:column; }
  .settlement-details-section .field-label-actions>.button { width:100%; }
  .batch-charge-row { grid-template-columns:1fr; }
  .reconciliation-banner { align-items:stretch; flex-direction:column; }
  .reconciliation-banner .ui-field { min-width:0; }
  .receipt-batch-card { padding:11px; }
}
@media (max-width:430px) {
  .settlement-detail-row,.receipt-batch-grid { grid-template-columns:1fr; }
}
.lc-receipt-detail-row { grid-template-columns:1.2fr repeat(3,minmax(120px,1fr)) minmax(110px,.7fr) minmax(130px,.8fr); }
.kpi-subsidiary { display:block; margin-top:5px; color:#667887; font-family:"Cascadia Mono",Consolas,monospace; font-size:12px; font-variant-numeric:tabular-nums; }
.save-state { display:inline-flex; align-items:center; gap:6px; color:var(--green) !important; font-weight:700; }
.save-state::before { content:""; width:7px; height:7px; border-radius:50%; background:currentColor; }
.governance-layout { display:grid; grid-template-columns:minmax(210px,260px) minmax(0,1fr); gap:18px; align-items:start; }
.governance-ledgers { position:sticky; top:14px; display:grid; gap:3px; padding:8px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.governance-ledgers button { min-height:38px; padding:8px 10px; border:0; border-left:3px solid transparent; color:#405368; background:transparent; text-align:left; }
.governance-ledgers button:hover { background:#f0f5f5; }
.governance-ledgers button.active { border-left-color:var(--teal); color:#173e4b; background:var(--teal-soft); font-weight:700; }
.required-rule-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; }
.required-rule { display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:10px; align-items:start; min-height:70px; padding:12px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; }
.required-rule:has(input:checked) { border-color:#96bdbb; background:#f2f8f7; }
.required-rule input { width:18px; height:18px; margin-top:2px; accent-color:var(--teal); }
.required-rule span,.required-rule strong,.required-rule small { display:block; }
.required-rule small { margin-top:4px; color:var(--muted); }
.required-rule em { padding:2px 7px; color:#7b4b0d; background:#fff0cf; font-size:11px; font-style:normal; white-space:nowrap; }
.required-rule.blocked { opacity:.62; background:#f1f3f4; }
.company-scope-field { margin:0; padding:12px; border:1px solid var(--line); border-radius:var(--radius); }
.company-scope-field legend { padding:0 5px; color:#536176; font-size:12px; font-weight:650; }
.company-scope-search { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.company-scope-search input { flex:1 1 220px; min-width:0; }
.company-scope-search small { flex:0 0 auto; color:var(--muted); }
.company-scope-field .choice-row { max-height:220px; overflow:auto; overscroll-behavior:contain; }
.company-scope-field .choice span { min-width:0; overflow-wrap:anywhere; }
.company-scope-field [data-governance-company][hidden] { display:none; }
.company-scope-actions { display:flex; align-items:center; flex-wrap:wrap; gap:.5rem; margin:.65rem 0; }
.company-scope-actions strong { margin-inline-start:auto; color:var(--muted); font-size:.85rem; }
.company-full-name { display:block; overflow-wrap:anywhere; line-height:1.35; }
.company-full-name + small { display:block; margin-top:.2rem; color:var(--muted); }
.readonly-operator { min-height:2.65rem; display:flex; align-items:center; }
.operator-identity { position:relative; appearance:none; border:0; background:transparent; color:inherit; font:inherit; padding:.2rem .15rem; text-align:start; cursor:help; max-width:100%; }
.operator-identity > span { display:block; overflow-wrap:anywhere; }
.operator-identity > small {
  position:absolute;
  z-index:30;
  inset-inline-start:0;
  bottom:calc(100% + .35rem);
  min-width:max-content;
  max-width:min(22rem,80vw);
  padding:.4rem .55rem;
  border-radius:.45rem;
  background:#172033;
  color:#fff;
  box-shadow:0 8px 22px rgba(0,0,0,.22);
  overflow-wrap:anywhere;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .15s ease;
}
.operator-identity:hover > small,.operator-identity:focus-visible > small,.operator-identity[aria-expanded="true"] > small { opacity:1; visibility:visible; }
.operator-candidate-list { display:grid; gap:.5rem; max-height:min(42vh,24rem); overflow:auto; padding:.15rem; }
.operator-candidate[hidden] { display:none; }
@media (max-width:640px){.company-scope-actions strong{width:100%;margin-inline-start:0}.operator-candidate-list{max-height:36vh}}
@media (max-width:620px){#governance-managers-form .form-grid{grid-template-columns:1fr}#governance-managers-form .field,#governance-managers-form select{min-width:0;width:100%}}
.scope-chip { display:inline-flex; margin:2px 3px 2px 0; padding:3px 7px; border:1px solid #b9d4d1; color:#245b5c; background:var(--teal-soft); font-size:11px; font-weight:700; }
.scope-chip.legacy { border-color:#e7c986; color:#7b4b0d; background:#fff4d8; }

@media (max-width:900px) {
  .governance-layout { grid-template-columns:1fr; }
  .governance-ledgers { position:static; grid-template-columns:repeat(3,minmax(0,1fr)); }
  .required-rule-list { grid-template-columns:1fr; }
}
@media (max-width:620px) {
  .login-shell { padding:14px; background:linear-gradient(160deg,#102137 0 34%,#e5edef 34%); }
  .login-card { padding:24px 20px; }
  .button,.nav-item,.company-select,.language-picker { min-height:44px; }
  .kpi-grid { grid-template-columns:1fr; }
  .page-heading h2 { font-size:20px; }
  .governance-ledgers { grid-template-columns:1fr 1fr; }
  .modal-overlay { padding:8px; }
  .modal { max-height:calc(100dvh - 16px); border-radius:8px; }
  .register-form-scroll,.register-readonly-scroll { padding:14px 12px; }
  .register-modal .modal-actions { position:sticky; bottom:0; padding:10px 12px calc(10px + env(safe-area-inset-bottom,0px)); }
  .lc-details-section .field-label-actions { align-items:stretch; flex-direction:column; }
  .lc-details-section .field-label-actions>.button { align-self:stretch; width:100%; }
  .bank-charge-section .field-label-actions,.bank-charge-add { align-items:stretch; flex-direction:column; }.bank-charge-add select,.bank-charge-add .button { width:100%; }
  .lc-detail-summary { justify-content:flex-start; }
  .company-scope-search { align-items:stretch; flex-direction:column; gap:6px; }
  .company-scope-search input { flex-basis:auto; }
  .company-scope-search small { align-self:flex-start; }
}
.daily-currency-groups { display:grid; gap:12px; }
.pnl-section .pnl-table table { min-width:0; width:100%; }
.pnl-section .pnl-table th:first-child { min-width:220px; width:220px; }
label:has(>#credit-bank-view),label:has(>#credit-report-currency) { display:inline-flex; align-items:center; gap:8px; }
#credit-bank-view,#credit-report-currency { min-height:40px; padding:8px 12px; border:1px solid #b8c9dc; border-radius:8px; background:#fff; color:#15283e; font:inherit; }
.daily-currency-groups summary,.credit-bank-summary summary { cursor:pointer; list-style:none; }
.daily-currency-groups summary::before,.credit-bank-summary summary>:first-child::before { content:"▸"; margin-inline-end:6px; color:var(--primary,#195eb0); }
.daily-currency-groups details[open]>summary::before,.credit-bank-summary[open]>summary>:first-child::before { content:"▾"; }
/* #571: company rows and total rows of the daily report share fixed columns: marker, name, currency, balance. */
.daily-currency-groups summary,.daily-currency-total { display:grid; grid-template-columns:1em minmax(0,1fr) 4.5em 18em; align-items:center; gap:8px 16px; padding:16px; }
.daily-currency-total { margin-bottom:12px; background:#f7faff; }
.daily-currency-total::before { content:""; }
.daily-currency-groups summary>strong,.daily-currency-total>strong { overflow-wrap:anywhere; }
.daily-currency-balance { display:flex; justify-content:space-between; gap:8px; min-width:0; }
.daily-currency-balance .numeric { overflow-wrap:anywhere; }
/* #571: bank summary rows: one track per header column; the header table uses equal fixed columns too. */
.credit-bank-groups { overflow-x:auto; overscroll-behavior-inline:contain; }
.credit-bank-groups>* { min-width:calc(var(--bank-columns,5) * 112px); }
.credit-bank-groups[data-columns="1"] { --bank-columns:1; }.credit-bank-groups[data-columns="2"] { --bank-columns:2; }
.credit-bank-groups[data-columns="3"] { --bank-columns:3; }.credit-bank-groups[data-columns="4"] { --bank-columns:4; }
.credit-bank-groups[data-columns="5"] { --bank-columns:5; }
.credit-bank-head { overflow:visible; }
.credit-bank-head .data-table { min-width:0; table-layout:fixed; }
.credit-bank-head .data-table th { white-space:normal; overflow-wrap:anywhere; vertical-align:bottom; }
.credit-bank-head .data-table th.numeric { text-align:right; }
.credit-bank-summary summary { display:grid; grid-template-columns:repeat(var(--bank-columns,5),minmax(0,1fr)); align-items:center; padding:4px 0; }
.credit-bank-summary summary>* { min-width:0; padding:11px 12px; overflow-wrap:anywhere; }
.credit-bank-summary { margin-top:12px; }
@media (max-width:600px) {
  .daily-currency-groups summary,.daily-currency-total { grid-template-columns:1em 4.5em minmax(0,1fr); gap:6px 8px; padding:12px; }
  .daily-currency-groups summary>strong,.daily-currency-total>strong { grid-column:2 / -1; }
  .daily-currency-code { grid-column:2; }
  .daily-currency-balance { grid-column:3; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important; animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}

/* Readable audit summaries must wrap; nested field tables must not inherit the
   main ledger's minimum width and push the after-value out of the viewport. */
.audit-readable-table { table-layout:fixed; }
.audit-readable-table > thead > tr > th:last-child { width:44%; }
.audit-readable-detail { overflow-wrap:anywhere; vertical-align:top; }
.audit-readable-detail .data-table { min-width:0; table-layout:fixed; }
.audit-readable-detail .data-table th { position:static; white-space:normal; }
.audit-readable-detail pre { max-width:100%; white-space:pre-wrap; overflow-wrap:anywhere; }

/* Ledger actions: bounded sticky surface, separate margin state, body portal. */
.register-row-actions { display:flex; flex-direction:column; align-items:stretch; gap:8px; width:clamp(8rem,22vw,14rem); }
.register-primary-actions { display:flex; align-items:flex-start; flex-wrap:wrap; gap:6px; }
.register-row-actions .button { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.register-margin-status { display:flex; flex-direction:column; align-items:flex-start; gap:4px; color:var(--muted); font-size:11px; }
.register-margin-status .badge { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.register-more { max-width:100%; }
.register-action-menu {
  position:fixed;
  z-index:120;
  display:grid;
  gap:4px;
  width:min(17rem,calc(100vw - 16px));
  max-height:calc(100dvh - 16px);
  overflow:auto;
  padding:6px;
  border:1px solid var(--line-strong);
  border-radius:8px;
  background:#fff;
  box-shadow:0 8px 28px #13243b29;
}
.register-action-menu .button { width:100%; justify-content:flex-start; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.register-action-menu .danger { border-top-color:#eed0d0; background:#fff8f8; }

/* Shared backup/attachment rows retain complete names and reachable actions. */
.backup-row { flex-wrap:wrap; }
.backup-row>:first-child { flex:1 1 12rem; min-width:0; overflow-wrap:anywhere; }
.backup-row>:last-child:not(:first-child) { flex:0 1 auto; max-width:100%; }
.backup-row>div:last-child:not(:first-child) { display:flex; flex-wrap:wrap; gap:8px; }
.backup-row .button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
.task-card { min-width:0; overflow-wrap:anywhere; }
.maturity-record>span { overflow-wrap:anywhere; }

/* Margin links wrap independently of long source references; the existing
   searchable selector owns pointer, scroll and keyboard navigation. */
.margin-linked-row{display:flex;align-items:center;justify-content:space-between;gap:.5rem;flex-wrap:wrap;padding:.5rem 0;border-bottom:1px solid var(--border,#dce3ec)}
.margin-linked-row>span{min-width:0;flex:1 1 18rem;overflow-wrap:anywhere}
.margin-link-control [data-margin-capacity]{overflow-wrap:anywhere}

/* Charge conversion evidence spans its row without widening amount/currency inputs. */
.settlement-detail-row > small.field.wide { grid-column:1 / -1; overflow-wrap:anywhere; color:var(--muted); }

/* A read-only conflict review stays bounded beside the retained draft; it
   must not push the modal recovery buttons or original form out of reach. */
.save-conflict-latest { max-height: 35vh; overflow: auto; overscroll-behavior: contain; }
/* #547: a long login name or role name in the latest saved row wraps instead of running out of its box. */
.row-conflict .calculated-value { height:auto; overflow-wrap:anywhere; }

.register-bulk-toolbar { flex-wrap: wrap; }
.bulk-delete-targets { display: grid; gap: 8px; max-height: 38vh; overflow: auto; margin-block: 12px; }
[data-bulk-delete-error] { color: var(--danger); white-space: pre-wrap; }

.margin-source-summary{display:flex;flex-direction:column;gap:.3rem;overflow-wrap:anywhere}
.margin-source-summary strong{font-size:1rem}
.margin-capacity-metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(10rem,1fr));gap:.75rem;margin:.75rem 0}
.margin-capacity-metrics>span{display:flex;flex-direction:column;gap:.3rem;padding:.65rem;background:var(--bg-secondary,#f3f6fa);border-radius:.4rem}
.margin-link-editor{margin:.75rem 0}
.margin-link-control summary{cursor:pointer;padding:.5rem 0;font-weight:600}
.ui-button-group.margin-link-actions{justify-content:flex-start;margin:.5rem 0}
.margin-link-actions [aria-pressed="true"]{outline:2px solid var(--primary,#2463c5);outline-offset:1px}
.margin-link-control:not(:has(.margin-link-editor[open])) [data-action="remove-margin-link"]{display:none}
.margin-link-control select{max-width:100%}

/* Keep fallback reminder amounts readable rather than ellipsizing their digits. */
.maturity-record.maturity-with-amount strong { overflow:visible; text-overflow:clip; white-space:normal; overflow-wrap:anywhere; }
@media (max-width:720px) {
  .maturity-record.maturity-with-amount { grid-template-columns:minmax(0,1fr) auto; }
  .maturity-record.maturity-with-amount>span { grid-column:1 / -1; }
}

/* #210: selection and one detail region reuse the existing dashboard system. */
button.kpi-card { text-align:start; font:inherit; cursor:pointer; color:inherit; }
/* #571: a button centers its content vertically; the cards start at the top so their values share one line. */
button.kpi-card[data-dashboard-metric] { display:flex; flex-direction:column; justify-content:flex-start; }
button.kpi-card[aria-pressed="true"] { outline:2px solid var(--primary); outline-offset:2px; }
button.kpi-card:focus-visible,.dashboard-contribution summary:focus-visible { outline:3px solid var(--primary); outline-offset:3px; }
.dashboard-detail { margin:20px 0; min-width:0; }
.dashboard-detail .card-head { flex-wrap:wrap; gap:12px; }
.dashboard-contribution { border-bottom:1px solid var(--line); padding:14px 0; min-width:0; }
.dashboard-contribution summary { cursor:pointer; display:flex; flex-wrap:wrap; gap:12px; align-items:center; overflow-wrap:anywhere; }
.dashboard-contribution summary::before { content:"▸"; color:var(--primary); }
.dashboard-contribution[open] summary::before { content:"▾"; }
.dashboard-contribution summary strong { flex:1; min-width:100px; }
.dashboard-contribution summary b { font-variant-numeric:tabular-nums; }
.dashboard-records article { display:flex; flex-wrap:wrap; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.dashboard-records article div { display:flex; flex:1; flex-wrap:wrap; align-items:center; gap:10px; }
.dashboard-records article small { width:100%; color:var(--muted); }
.dashboard-detail :is(strong,b,dd,span,button) { overflow-wrap:anywhere; min-width:0; }
.dashboard-credit-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:16px 0; }
.dashboard-credit-metrics>div { padding:12px; border:1px solid var(--line); border-radius:6px; }
.dashboard-credit-metrics .selected { border-color:var(--primary); background:#eef5ff; }
.dashboard-credit-metrics strong,.dashboard-credit-metrics span { display:block; margin:4px 0; }
.dashboard-basis { display:grid; grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); gap:12px; }
.dashboard-basis dt { color:var(--muted); font-size:12px; }.dashboard-basis dd { margin:4px 0; }
@media(max-width:600px){.dashboard-credit-metrics{grid-template-columns:1fr}.dashboard-detail .card-body{padding:14px}.dashboard-records article{align-items:flex-start}.dashboard-contribution summary b{max-width:100%}}

.register-sort-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.register-sort-controls label { display: inline-flex; align-items: center; gap: .3rem; }

.bulk-edit-fields, .bulk-edit-details, [data-bulk-preview-page] { max-height: 46vh; overflow: auto; }
.bulk-edit-details { display: grid; gap: 8px; }
.bulk-edit-details:empty { display: none; }
[data-bulk-edit-error] { white-space: pre-line; }

.bulk-edit-form [hidden], #bulk-register-edit-form[hidden], #bulk-register-confirm-form[hidden] { display: none !important; }

.searchable-select-trigger:disabled { color:var(--muted); background:#eef1f5; cursor:not-allowed; opacity:.8; }
.batch-charge-row .batch-charge-lock-note { grid-column:1 / -1; margin:0; }

.modal:has(#bank-balance-import-form) { width:min(660px,100%); }
.modal:has(#bank-balance-import-form [data-bank-balance-rows]) { width:min(1100px,100%); }
.modal:has(#bank-balance-mapping-form) { width:min(680px,100%); }
#bank-balance-import-form .field,#bank-balance-mapping-form .field { min-width:0; align-content:start; }
#bank-balance-import-form .field :is(input,select),#bank-balance-mapping-form .field :is(input,select) { width:100%; min-width:0; }
#bank-balance-import-form .date-trigger { bottom:1px; height:auto; }
#bank-balance-import-form .modal-actions,#bank-balance-mapping-form .modal-actions { flex-wrap:wrap; }
.bank-balance-file {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px 18px;
  margin-bottom:16px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:var(--bg);
}
.bank-balance-file-info { flex:1 1 240px; min-width:0; overflow-wrap:anywhere; }
.bank-balance-file-info p { margin:4px 0 0; color:var(--muted); }
[data-bank-balance-filename]:not(:empty) { display:block; margin-top:5px; font-weight:650; }
.bank-balance-summary { margin:16px 0 10px; font-variant-numeric:tabular-nums; }
.bank-balance-preview-filters .field { flex:1 1 12rem; }
.bank-balance-filter-scope { display:flex; flex-wrap:wrap; gap:4px 12px; margin:10px 0; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.bank-balance-filter-scope span { color:var(--muted); }
.bank-balance-preview-table td { overflow-wrap:anywhere; }
.bank-balance-preview-table .data-table { min-width:52rem; }
.bank-balance-preview-table td:nth-child(4) { min-width:8ch; }
.bank-balance-preview-table td:nth-child(5) { white-space:nowrap; }
.bank-balance-preview-table :is(th,td):nth-child(n+8) { text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.bank-balance-preview-table + .field { max-width:10rem; margin-top:10px; }
.bank-balance-form-error { margin:0; }
.bank-balance-form-error:not(:empty) { margin-top:12px; padding:10px 12px; border-left:3px solid var(--red); color:var(--ink); background:#fff4f4; overflow-wrap:anywhere; }
.bank-mapping-empty { margin-top:14px; }
.bank-mapping-empty p { margin:5px 0 12px; }
.bank-mapping-list .data-table { min-width:34rem; }
.bank-mapping-list th { white-space:normal; }
.bank-mapping-list td { overflow-wrap:anywhere; }
.bank-mapping-list td small { display:block; margin-top:3px; }
.bank-mapping-list :is(td:first-child,td:last-child,.status) { white-space:nowrap; }
.bank-mapping-source { margin:0 0 14px; color:var(--muted); }
.bank-mapping-source strong { margin-left:4px; color:var(--ink); }
.bank-mapping-enabled { width:fit-content; min-height:var(--control-height); margin-top:14px; cursor:pointer; }
.bank-mapping-enabled input { margin:0; accent-color:var(--teal); }
#bank-balance-mapping-form .searchable-select-trigger span { white-space:normal; overflow:visible; overflow-wrap:anywhere; }
@media (max-width:800px) {
  #bank-balance-import-form .form-grid,#bank-balance-mapping-form .form-grid { grid-template-columns:1fr; }
}
/* Issue #366: exchange-rate currency-group cards reuse the KPI card tokens. */
.exchange-rate-sync-status { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; margin:14px 0 0; padding-top:12px; border-top:1px solid var(--line); }
.exchange-rate-failures { margin-top:10px; }
.exchange-rate-failures ul { margin:6px 0 0; padding-left:18px; overflow-wrap:anywhere; }
.rate-group-toolbar { margin:16px 0; }
.rate-group-section { margin-bottom:16px; }
.rate-group-grid { grid-template-columns:repeat(auto-fill,minmax(min(220px,100%),1fr)); }
.rate-group-card { display:flex; flex-direction:column; align-items:stretch; gap:2px; width:100%; }
.rate-group-card:hover { border-color:var(--line-strong); }
/* button.kpi-card's focus rule uses the undefined --primary token; keep a visible ring here. */
button.rate-group-card:focus-visible { outline:3px solid var(--focus); outline-offset:3px; }
.rate-group-card.stale { border-top:3px solid var(--orange); }
.rate-group-card[hidden] { display:none; }
.rate-group-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px; }
.rate-group-head .kpi-label { color:var(--ink); font-weight:700; }
.rate-group-card .kpi-value { margin:4px 0; }
.rate-group-names { overflow-wrap:anywhere; }
.rate-group-title { margin:0 0 12px; font-size:16px; }

/* Issue #370: a failed save marks its field and keeps one banner at the top of the form. */
.field-error-text { display:block; margin-top:4px; color:var(--red); font-size:12.5px; line-height:1.4; overflow-wrap:anywhere; }
.field input.field-error-control,.field select.field-error-control,.field textarea.field-error-control,.settlement-detail-row .field-error-control,.lc-detail-row .field-error-control,
.receipt-batch-card .field-error-control,.batch-charge-row .field-error-control,.company-limit-detail-row .field-error-control,.data-table .field-error-control,
.searchable-select-trigger.field-error-control { border-color:var(--red); box-shadow:0 0 0 3px rgba(184,60,70,.14); }
.field-error-control:focus-visible { outline:2px solid var(--red); outline-offset:1px; }
.form-error-banner { margin-bottom:10px; color:var(--red); border-color:#e6b3b8; background:#fdf1f2; overflow-wrap:anywhere; }

/* #377: full-width reminder panel and reminder page. Each reminder shows its
   title, identity, amount, date and operator, and margin notes; long names wrap
   instead of truncating digits. Filters reuse the segmented control. */
.maturity-card { margin-top:18px; }
.reminder-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; padding:12px 17px; border-bottom:1px solid var(--line); }
.reminder-toolbar.card { margin-bottom:15px; }
.reminder-filter { flex-wrap:wrap; max-width:100%; }
.reminder-filter button span { color:var(--muted); font-variant-numeric:tabular-nums; }
.reminder-filter button:focus-visible { outline:2px solid var(--focus); outline-offset:1px; }
.reminder-totals { margin:0; color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.reminder-totals span[translate="no"] { color:var(--ink); font-weight:700; font-variant-numeric:tabular-nums; }
.maturity-record.reminder-item { grid-template-columns:minmax(150px,230px) minmax(0,1fr) auto; align-items:start; }
.maturity-record.reminder-item:focus-visible { outline:2px solid var(--focus); outline-offset:-2px; }
.maturity-record>.reminder-title { color:#29496f; font-weight:700; overflow-wrap:anywhere; }
.reminder-info { display:grid; gap:3px; min-width:0; }
.maturity-record .reminder-info strong,.maturity-record .reminder-info small,.reminder-info strong,.reminder-info small { display:block; overflow:visible; text-overflow:clip; white-space:normal; overflow-wrap:anywhere; }
.reminder-info small { margin-top:0; color:var(--muted); }
.reminder-amount { color:var(--ink); font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.reminder-flag { display:inline-block; padding:1px 6px; border-radius:5px; color:var(--orange); background:#fff4e8; font-weight:700; }
.reminder-more { padding:10px 17px; border-top:1px solid var(--line); text-align:right; }
.task-card .reminder-info { margin-top:8px; }
.task-card .task-actions .due { margin-right:auto; text-align:left; }
/* #577: the reminder page lists reminders in the dashboard's one-line layout. */
.task-grid+.reminder-list { margin-top:15px; }
.reminder-list { padding:0; overflow:hidden; }
.reminder-row .task-actions { flex-wrap:wrap; margin-top:0; }
@media (max-width:720px) {
  .reminder-toolbar { align-items:flex-start; flex-direction:column; }
  .maturity-record.reminder-item { grid-template-columns:minmax(0,1fr) auto; }
  .maturity-record.reminder-item>.reminder-title { grid-column:1 / -1; }
}
/* #602: on a phone the buttons of a reminder row (two on a notice or renewal to-do) go under its text. */
@media (max-width:480px) {
  .maturity-record.reminder-item { grid-template-columns:minmax(0,1fr); }
  .reminder-row .task-actions { justify-content:flex-start; }
}

/* #378: personal column order and header sorting on register lists. */
.register-column-head { cursor:grab; }
.register-column-head.dragging { opacity:.5; }
.register-column-head.drop-before { box-shadow:inset 3px 0 0 var(--blue); }
.register-column-head.drop-after { box-shadow:inset -3px 0 0 var(--blue); }
.register-sort-head { display:inline-flex; align-items:center; gap:4px; padding:0; border:0; color:inherit; background:none; font:inherit; font-weight:inherit; text-align:inherit; cursor:pointer; }
.register-sort-head:hover { color:var(--blue); }
.register-sort-head:focus-visible { outline:2px solid var(--focus); outline-offset:2px; border-radius:3px; }
.register-column-head.numeric .register-sort-head { justify-content:flex-end; }
.register-sort-indicator { color:var(--muted); font-size:11px; }
.register-sort-indicator.active { color:var(--blue); }
.register-sort-current { color:var(--muted); font-size:13px; overflow-wrap:anywhere; }
.credit-bank-head { margin-bottom:8px; }
.register-column-list { display:grid; gap:6px; margin:12px 0; padding:0; list-style:none; }
.register-column-item { display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; padding:6px 8px; border:1px solid var(--line); border-radius:6px; }
.register-column-item .choice { flex:1 1 220px; min-width:0; overflow-wrap:anywhere; }
.register-column-moves { display:inline-flex; gap:4px; margin-left:auto; }

/* #396: read-only list of the business utilizing a credit line (view and edit dialogs). */
.credit-occupations>summary { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 16px; color:#244457; font-size:13px; font-weight:750; cursor:pointer; list-style:none; }
.credit-occupations>summary::-webkit-details-marker { display:none; }
.credit-occupations>summary::before { content:"▸"; color:var(--teal); }
.credit-occupations[open]>summary::before { content:"▾"; }
.credit-occupations-title { flex:1 1 220px; min-width:0; overflow-wrap:anywhere; }
.credit-occupations-summary { display:flex; flex-wrap:wrap; gap:4px 16px; color:var(--muted); font-weight:600; font-variant-numeric:tabular-nums; }
.credit-occupations-gap { color:#8a5a00; }
.credit-occupations-body { margin-top:12px; }
.credit-occupations-body .table-card { margin-top:0; }
.credit-occupations-body .data-table { min-width:760px; }
.credit-occupations-body .data-table th { vertical-align:bottom; }
.credit-occupations-body .data-table th.numeric { min-width:128px; font-family:inherit; text-align:right; white-space:normal; }
.credit-occupations-body .data-table th.numeric .register-sort-head { justify-content:flex-end; }
.credit-occupations-body .data-table td { white-space:nowrap; }
.credit-occupations-body .data-table td.credit-occupations-reference { min-width:180px; max-width:320px; white-space:normal; overflow-wrap:anywhere; }
.credit-occupations-reference .button { height:auto; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.credit-occupations-note { margin:10px 0 0; font-size:12px; line-height:1.55; overflow-wrap:anywhere; }
.credit-occupations-reconcile { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px 18px; margin:14px 0 0; padding:12px 14px; border-top:2px solid var(--teal); background:#f0f6f5; }
.credit-occupations-reconcile>div { min-width:0; }
.credit-occupations-reconcile dt { color:#43586a; font-size:12px; line-height:1.4; overflow-wrap:anywhere; }
.credit-occupations-reconcile dd { margin:4px 0 0; color:#173f4b; font-weight:700; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.credit-occupations-error { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-bottom:0; }
.credit-occupations>summary:hover .credit-occupations-title { color:var(--blue); }

/* Issue #408: why a bank list offers no choice; the unsaved-changes question beside the dialog buttons. */
.field-note { display:block; margin-top:4px; color:var(--muted); font-size:12.5px; line-height:1.4; overflow-wrap:anywhere; }
.unsaved-changes-prompt { flex:0 0 auto; margin:12px 0 0; }
.register-modal .unsaved-changes-prompt { margin:10px 20px; }
.unsaved-changes-prompt p { margin:0 0 8px; overflow-wrap:anywhere; }
.unsaved-changes-prompt .modal-actions,.register-modal .unsaved-changes-prompt .modal-actions { position:static; flex-wrap:wrap; margin:0; padding:0; border:0; background:transparent; }
/* #412: ledger filters form their own row inside the ledger toolbar. */
.register-filters { display:flex; flex-wrap:wrap; flex-basis:100%; align-items:center; gap:12px 20px; padding-top:12px; border-top:1px solid var(--line); }
.register-filters:empty { display:none; }
.register-filter-field { display:flex; align-items:center; gap:10px; min-width:0; }
.register-filter-field > label { white-space:nowrap; }
.register-filter-field .filter-select { min-width:140px; max-width:260px; }
.register-filter-field .searchable-select { width:220px; }
/* #577: on a phone the due-date range wraps (label, then both ends) instead of widening the page. */
.register-filter-range { flex-wrap:wrap; max-width:100%; }
.register-filter-range > .ui-field-group-controls { flex-wrap:wrap; max-width:100%; }
.register-filter-range .date-control { width:150px; max-width:100%; }
.register-filter-clear { margin-left:auto; }
.register-filter-error { flex-basis:100%; margin:0; color:var(--red); }
.register-filter-error:empty { display:none; }
.register-filter-summary { display:flex; flex-wrap:wrap; flex-basis:100%; align-items:center; gap:6px; color:var(--muted); }
.register-filter-chip { padding:1px 9px; border:1px solid var(--line-strong); border-radius:999px; background:var(--blue-soft); color:var(--ink); overflow-wrap:anywhere; }
.register-filter-summary strong { color:var(--ink); }
.register-export-area { display:flex; flex-direction:column; align-items:flex-end; gap:4px; max-width:340px; text-align:right; }
.register-export-area .muted { font-size:12.5px; line-height:1.4; }
/* #420: the control module (ui-controls.js). Sizes, spacing and where the small
   button may appear: docs/quality/UI_CONTROLS.md. */
/* Every native single select gets the field box and the shared arrow. Compact
   selects with their own rules (company, language, pagination) keep their size
   and border; the arrow rule below, which is more specific, still reaches them. */
:where(select:not([multiple]):not([size])) { min-height:var(--control-height); padding:8px 34px 8px 10px; border:1px solid var(--line-strong); border-radius:var(--radius); color:var(--ink); background-color:#fff; }
select:not([multiple]):not([size]) {
  appearance:none;
  -webkit-appearance:none;
  padding-right:34px;
  background-image:var(--select-arrow);
  background-repeat:no-repeat;
  background-position:right 12px center;
  background-size:12px 8px;
}
:where(select):focus-visible { border-color:var(--focus); box-shadow:0 0 0 3px rgba(103,167,216,.22); }
:where(select):disabled { cursor:not-allowed; color:#94a3b8; background-color:#f1f5f9; }
:where(select)[aria-invalid="true"] { border-color:#d97878; }
.ui-select-arrow { flex:none; width:12px; height:8px; background:var(--select-arrow) no-repeat center / 12px 8px; }
.ui-required-mark { margin-left:3px; color:var(--red); }
/* A stacked field never grows past its width: a long option scrolls inside the select. */
.ui-field:not(.ui-field-inline) { grid-template-columns:minmax(0,1fr); }
.ui-field:not(.ui-field-inline) > :is(select,input,textarea) { width:100%; min-width:0; }
.ui-field-inline { display:flex; align-items:center; gap:10px; }
.ui-field-inline > label,.ui-field-inline > .ui-field-label { margin:0; white-space:nowrap; }
.ui-field-label { color:#536176; font-size:12px; font-weight:650; }
.ui-field-group-controls { display:flex; align-items:center; gap:8px; min-width:0; }
:where(.ui-checkbox) { display:inline-flex; align-items:center; gap:8px; cursor:pointer; }
.ui-button-group { display:flex; flex-wrap:wrap; align-items:flex-start; justify-content:flex-end; gap:12px; }
.ui-button-group .export-actions { display:contents; }
.ui-control-bar { display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:16px 24px; }
.ui-control-group { display:flex; flex-wrap:wrap; align-items:flex-end; gap:12px; min-width:0; }
.ui-control-group-end { margin-left:auto; justify-content:flex-end; }
.ui-control-bar .field { flex:none; }
:is(.ui-control-bar,.ui-button-group,.ui-modal-actions,.register-toolbar,.register-bulk-toolbar) .button:not(.small) { min-width:104px; }
/* Dialog footer: equal-width buttons (the widest sets the width), right-aligned. */
.ui-modal-actions { display:flex; justify-content:flex-end; margin-top:20px; padding-top:16px; border-top:1px solid var(--line); }
.ui-modal-actions > .ui-modal-buttons { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:12px; max-width:100%; }
.ui-info-strip { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--radius); color:#31475d; background:#f6f9fa; }
.ui-info-label { color:var(--muted); font-size:12px; }
.ui-record-reference { font-family:"Cascadia Mono",Consolas,monospace; font-weight:650; overflow-wrap:anywhere; }
.ui-record-strip .status { margin-left:auto; }
.ui-form-hint { margin:10px 0 16px; color:var(--muted); font-size:13px; }
.ui-tag { display:inline-flex; align-items:center; padding:2px 9px; border:1px solid var(--line); border-radius:999px; color:var(--ink); background:#f6f9fa; font-size:12px; white-space:nowrap; }
.ui-divider { align-self:stretch; width:1px; min-height:24px; background:var(--line-strong); }
.ui-search { padding-left:36px; background:#fff var(--search-icon) no-repeat 12px center / 16px 16px; }
#register-reactivation-form textarea,#operator-transfer-form textarea { min-height:100px; }
#operator-transfer-form .ui-record-strip { margin-bottom:14px; }
.register-toolbar { gap:12px; }
.register-toolbar .search { flex:1 1 240px; }
.register-bulk-note { margin-left:auto; text-align:right; }
.report-control-field { width:180px; }
.exchange-rate-fetch-card .card-head .status { white-space:nowrap; }
.exchange-rate-fetch-blocks { display:flex; flex-wrap:wrap; gap:16px; margin-top:14px; }
.exchange-rate-fetch-blocks:empty { display:none; }
.exchange-rate-fetch-block { flex:1 1 auto; min-width:0; padding:14px; border:1px solid var(--line); border-radius:var(--radius); background:#f8fafb; }
.exchange-rate-fetch-block h4 { margin:0 0 10px; color:#244457; font-size:13px; }
.exchange-rate-fetch-block .field { width:180px; }
.ui-button-group .register-export-area .export-actions { display:inline-flex; flex-wrap:wrap; justify-content:flex-end; gap:12px; }
#operator-transfer-form .operator-candidate-list { margin:12px 0 16px; }
/* #420: the report unit line and the rate-detail disclosure read as one kind of light info strip. */
#report-result :is(.notice.report-unit,details.notice:not(.warning)) { margin-bottom:10px; padding:10px 14px; border:1px solid var(--line); border-radius:var(--radius); color:#31475d; background:#f6f9fa; }
#report-result details.notice:not(.warning) > summary { color:var(--blue); cursor:pointer; }
/* #424: batch 2 of the control module. Rules: docs/quality/UI_CONTROLS.md. */
/* Page heading: the title column takes the free width and may shrink; the
   actions are one group that never shrinks, keeps every label on one line and
   moves below the title as a whole when the row is too narrow. */
.page-heading { flex-wrap:wrap; }
.page-heading-text { flex:1 1 360px; min-width:0; }
.page-heading-actions { flex:none; max-width:100%; margin-left:auto; }
.page-heading-actions .button,.page-heading > .button { flex:none; white-space:nowrap; }
/* Below 1100px the heading is a column (see above): the title keeps its own height. */
@media (max-width:1100px) { .page-heading-text { flex:none; } }
/* Choice cards (uiChoiceCard): the whole card is the label of its radio or checkbox. */
.ui-choice-card { display:flex; align-items:flex-start; gap:10px; padding:10px 12px; border:1px solid var(--line); border-radius:var(--radius); background:#fff; cursor:pointer; }
.ui-choice-card[hidden] { display:none; }
.ui-choice-card:hover { border-color:#adc1e0; }
.ui-choice-card:has(.ui-choice-card-input:checked) { border-color:var(--blue); background:var(--blue-soft); }
.ui-choice-card:has(.ui-choice-card-input:focus-visible) { outline:2px solid var(--focus); outline-offset:2px; }
.ui-choice-card:has(.ui-choice-card-input:disabled) { cursor:not-allowed; opacity:.6; }
.ui-choice-card-input { flex:none; width:16px; height:16px; margin:2px 0 0; accent-color:var(--blue); }
.ui-choice-card-input:focus-visible { outline:none; }
.ui-choice-card-text { display:grid; gap:2px; min-width:0; }
.ui-choice-card-title { color:var(--ink); font-weight:650; overflow-wrap:anywhere; }
.ui-choice-card-description { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
/* Scrolling card lists leave room for the focus ring. */
:is(.bulk-edit-details,.bulk-delete-targets,.operator-candidate-list) { padding:4px; }
/* Buttons that read as text (sortable column heads, the operator name) keep no button frame. */
.button:is(.register-sort-head,.operator-identity) { min-height:0; justify-content:flex-start; gap:4px; border:0; border-radius:3px; background:none; box-shadow:none; }
.button:is(.register-sort-head,.operator-identity):hover { border-color:transparent; background:none; }
/* Fields inside detail rows keep the compact detail label. */
:is(.lc-detail-row,.settlement-detail-row,.receipt-batch-card,.batch-charge-row) .ui-field { gap:0; min-width:0; }
:is(.lc-detail-row,.settlement-detail-row,.receipt-batch-card,.batch-charge-row,.reconciliation-banner) .ui-field > :is(label,.ui-field-label) { min-height:0; }
.receipt-batch-footer > .ui-field { min-width:160px; }
/* A caption that names a group of controls (margin links, company limits) stacks its content. */
:is(.margin-link-control,.credit-company-limits) > .ui-field-group-controls { display:grid; gap:8px; align-items:stretch; }
.credit-company-limits .company-limit-add { justify-self:start; }
.margin-link-editor [data-action="apply-margin-link-choice"] { justify-self:start; margin-top:8px; }
/* Batch edit: level and action side by side, the reason across the row. */
.bulk-edit-grid { align-items:end; margin-bottom:16px; }
.bulk-edit-details:not(:empty) { margin-bottom:16px; }
.bulk-edit-field [data-bulk-control] { margin-top:6px; }
/* #426: batch 3 of the control module. Rules: docs/quality/UI_CONTROLS.md. */
/* A group whose controls stack at full width (a list of choices with its hint). */
.ui-field-group-stacked > .ui-field-group-controls { display:grid; gap:8px; align-items:stretch; }
/* The caption of a group with the buttons that act on the whole group. */
.ui-field-group-head { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; }
/* A file button (uiFileButton) shows the keyboard focus of its file input. */
label.button:has(+ input[type="file"]:focus-visible) { outline:2px solid var(--focus); outline-offset:2px; }
/* The view switch in a page heading is as tall as the buttons beside it. */
.page-heading-actions > .segmented { flex:none; align-self:stretch; }
.page-heading-actions > .segmented button { white-space:nowrap; }
/* Detail rows (#424 follow-up). A date box keeps room for its whole placeholder: wider date
   columns, and the narrow-window layouts of .lc-detail-row apply to the presentation row too. */
.lc-receipt-detail-row { grid-template-columns:minmax(120px,1.2fr) minmax(150px,1fr) minmax(110px,1fr) minmax(150px,1fr) minmax(100px,.7fr) minmax(110px,.8fr); }
@media (max-width:1080px) { .lc-receipt-detail-row { grid-template-columns:repeat(3,minmax(0,1fr)); } }
@media (max-width:720px) { .lc-receipt-detail-row { grid-template-columns:1fr 1fr; } }
@media (max-width:430px) { .lc-receipt-detail-row { grid-template-columns:1fr; } }
/* #587: a list with a row pending supplementation gives the status column the room of its whole name
   ("Pending supplementation"); every row of the list keeps the same columns. */
@media (min-width:1081px) { .lc-detail-list-pending > .lc-receipt-detail-row { grid-template-columns:minmax(120px,1.1fr) minmax(150px,1fr) minmax(110px,.9fr) minmax(150px,1fr) minmax(215px,1.2fr) minmax(110px,.8fr); } }
/* Every control of a bank-charge row sits on the bottom line of its cell, also beside a label that wraps. */
.batch-charge-row > .ui-field { align-content:end; }
.batch-charge-date-action { justify-content:flex-end; }
/* #428: batch 4 of the control module. Rules: docs/quality/UI_CONTROLS.md. */
/* Compact fields (top bar, pagination bar): label on the left; the caller's class sets the size. */
:where(.ui-field-compact) { display:inline-flex; align-items:center; gap:6px; }
/* Groups that follow one another, a notice or the fields around them keep one vertical gap. */
:is(.ui-field-group,.notice) + .ui-field-group,.ui-field-group + .form-grid { margin-top:20px; }

/* #671: ledger lists and report tables show every row and scroll with the page. installTableScroll
   (ui-shell.js) shows a copy of the header fixed at the window top (two header rows as one; the bank
   summary's header table) and a sideways scroll bar fixed at the window bottom. */
.table-scroll>:is(.table-sticky-head,.table-scroll-bar) { position:fixed; z-index:4; min-width:0; margin:0; }
.table-sticky-head { overflow:hidden; box-shadow:0 3px 8px -2px rgba(19,36,59,.18); }
.table-scroll-bar { bottom:0; height:14px; overflow-x:scroll; overflow-y:hidden; border-top:1px solid var(--line); background:#fff; }
.table-scroll-bar>div { height:1px; }
/* A styled bar stays visible where the system hides scroll bars until they are used (macOS). */
.table-scroll-bar::-webkit-scrollbar { height:13px; }
.table-scroll-bar::-webkit-scrollbar-thumb { border:3px solid #fff; border-radius:8px; background:#a9b7c6; }
.table-scroll-bar::-webkit-scrollbar-thumb:hover { background:#7f91a5; }
/* The bank summary is a header table above expandable cards. */
.credit-bank-groups.table-scroll { margin-top:14px; }
.credit-bank-groups .credit-bank-head { margin-top:0; }
/* #575: total rows of "business utilizing this credit line"; they stay below the sorted rows. */
.credit-occupations-total td { font-weight:700; color:var(--navy); background:#f3f7fd; vertical-align:top; }
.credit-occupations-total tr:first-child td { border-top:2px solid #9bb4d8; }
.credit-occupations-unknown { display:block; margin-top:2px; color:var(--muted); font-size:11px; font-weight:500; white-space:normal; }
/* #604: close approvals: the pending notice of a record, the rule settings card and its form. */
.approval-notice { display:flex; flex-wrap:wrap; gap:8px 16px; align-items:center; justify-content:space-between; margin-bottom:12px; color:#875209; border-color:#f2d08b; background:#fff8e6; }
.approval-notice>div { display:flex; flex-wrap:wrap; gap:4px 12px; align-items:baseline; min-width:0; }
.approval-notice span { overflow-wrap:anywhere; }
/* #610: the approval history of a record in its read-only view. */
.approval-history-list { list-style:none; margin:0; padding:0 16px 12px; display:grid; gap:12px; }
.approval-history-group p { margin:0 0 6px; overflow-wrap:anywhere; }
.approval-history-steps { list-style:none; margin:0; padding-left:16px; display:grid; gap:4px; color:var(--muted, #5f6b7a); overflow-wrap:anywhere; }
.approval-history-current { color:#875209; font-weight:600; }
.approval-rules-card .notice { margin:0 0 12px; }
.approval-rules-table td { vertical-align:top; overflow-wrap:break-word; }
.approval-rules-table .status,.approval-rules-table .button { white-space:nowrap; }
.approval-rules-table td:first-child { min-width:160px; }
.approval-rules-table .ui-button-group { flex-wrap:nowrap; }
.approval-rule-form .form-grid { margin-bottom:12px; }
.approval-rule-form .ui-field-group { margin-bottom:12px; }
.approval-choice-list { display:flex; flex-wrap:wrap; align-items:center; gap:8px 18px; width:100%; }
.approval-rule-form .ui-field-group-controls { display:block; }
.approval-choice-list .ui-checkbox { min-width:0; min-height:28px; overflow-wrap:anywhere; }
.approval-choice-list .ui-checkbox input { width:auto; height:auto; min-height:0; margin:0; }
.approval-rule-form [data-register-action-error]:not(:empty) { color:var(--red); font-weight:600; }
.approval-steps { margin:4px 0 12px; }
.approval-steps-head { display:flex; gap:12px; align-items:center; justify-content:space-between; margin-bottom:8px; }
.approval-steps-head h4 { margin:0; font-size:14px; }
.approval-step-list { display:grid; gap:10px; margin:0; padding:0; list-style:none; }
.approval-step { display:grid; gap:10px; padding:12px; border:1px solid var(--line); border-radius:var(--radius); background:#fafcfd; }
.approval-step-head { display:flex; flex-wrap:wrap; gap:8px 12px; align-items:center; justify-content:space-between; }
.approval-step .ui-field:not(.ui-field-group) { max-width:320px; }
.approval-rule-modal { width:min(860px,calc(100vw - 32px)); }
