:root {
    --blue: #0b63d8;
    --blue-dark: #084eae;
    --page: #f4f7fb;
    --surface: #ffffff;
    --text: #182234;
    --muted: #68758a;
    --border: #dce5ef;
    --border-strong: #cbd7e5;
    --green: #229653;
    --orange: #ea5b1b;
    --cyan: #138b9e;
    --danger: #c63c3c;
}

.tenant-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr);
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.toggle-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    color: #18324f;
    font-weight: 600;
}

.toggle-line input {
    width: 18px;
    height: 18px;
    accent-color: #1267d6;
    flex: 0 0 auto;
}

.report-assignment-list {
    display: grid;
    gap: 6px;
    margin: 4px 0 18px;
}

@media (max-width: 900px) {
    .tenant-admin-grid {
        grid-template-columns: 1fr;
    }
}

* { box-sizing: border-box; }

html, body {
    min-height: 100%;
    margin: 0;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background: var(--page);
    font-size: 14px;
    letter-spacing: 0;
}

body { min-width: 320px; }
a { color: var(--blue); }
button, input, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
button[aria-busy="true"] { cursor: progress; }
h1:focus { outline: none; }

.app-shell { min-height: 100vh; }

.app-header {
    height: 48px;
    color: #fff;
    background: var(--blue);
    border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.header-inner,
.nav-inner,
.app-main {
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand {
    display: inline-flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.brand-logo { display: block; width: auto; height: 18px; }

.environment-badge {
    padding: 2px 8px;
    color: #084a9d;
    background: #dcecff;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}

.account-area { margin-left: auto; }
.account-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
}

.avatar {
    width: 26px;
    height: 26px;
    color: var(--blue);
    background: #fff;
    border-radius: 50%;
}
.avatar svg { width: 15px; height: 15px; }

.main-nav {
    height: 48px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 5px rgba(23, 46, 77, .07);
}

.nav-inner {
    height: 100%;
    display: flex;
    align-items: stretch;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }

.nav-entry {
    position: relative;
    min-width: 112px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #36445a;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.nav-entry svg { width: 15px; height: 15px; }
.nav-entry:hover { color: var(--blue); }
.nav-entry.active { color: var(--blue); }
.nav-entry.active::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 0;
    height: 2px;
    background: var(--blue);
}

.logout-form { margin-left: auto; display: flex; align-items: center; }
.logout-button { color: #59677a; }

.app-main { padding-top: 16px; padding-bottom: 28px; }

.workspace {
    width: 100%;
    padding: 18px;
    background: var(--surface);
    border: 1px solid #e5ebf3;
    border-radius: 7px;
    box-shadow: 0 3px 12px rgba(28, 50, 80, .06);
}

.section-heading {
    min-height: 38px;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}
.section-heading h1 { margin: 0; font-size: 18px; line-height: 1.25; font-weight: 750; }
.section-heading h2 { margin: 0; font-size: 13px; line-height: 1.25; font-weight: 750; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.section-heading.compact-heading { min-height: 0; margin: 20px 0 8px; }

.filter-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 12px;
    align-items: end;
}
.field-service, .field-sender { grid-column: span 5; }
.field-date { grid-column: span 3; }
.field-criterion { grid-column: span 4; }
.field-counterparty { grid-column: span 5; }
.load-button { grid-column: span 2; width: 100%; }

.field { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.field > span { color: #435066; font-size: 10px; font-weight: 700; }
.field input,
.field select {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    color: #263247;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    outline: none;
    font-size: 11px;
}
.field input::placeholder { color: #98a3b2; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(11, 99, 216, .12); }
.password-field { position: relative; }
.password-field > input { padding-right: 44px !important; }
.password-visibility-toggle {
    position: absolute;
    z-index: 4;
    right: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    color: #52647d;
    background: transparent;
    border: 0;
    border-radius: 4px;
}
.form-floating.password-field > .password-visibility-toggle { top: 11px; }
.field.password-field > .password-visibility-toggle { top: 18px; height: 30px; }
.password-visibility-toggle:hover { color: var(--blue); background: #edf4fd; }
.password-visibility-toggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.password-visibility-toggle span { width: 17px; height: 17px; display: inline-grid; place-items: center; }
.password-visibility-toggle svg { width: 17px; height: 17px; }
.password-toggle-hide { display: none !important; }
.password-visibility-toggle.is-password-visible .password-toggle-show { display: none; }
.password-visibility-toggle.is-password-visible .password-toggle-hide { display: inline-grid !important; }

.primary-button,
.secondary-button,
.danger-button {
    min-height: 34px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.primary-button { color: #fff; background: var(--blue); border: 1px solid var(--blue); }
.primary-button:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.secondary-button { color: var(--blue); background: #fff; border: 1px solid #a9c7ea; }
.secondary-button:hover { background: #f1f7ff; }
.danger-button { color: #fff; background: #bd3030; border: 1px solid #bd3030; }
.danger-button:hover { background: #9d2525; border-color: #9d2525; }
.primary-button svg, .secondary-button svg, .danger-button svg { width: 14px; height: 14px; }

.icon-button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #536175;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
}
.icon-button:hover { color: var(--blue); background: #eef5fd; border-color: #d6e5f7; }
.icon-button svg { width: 15px; height: 15px; }

.status-row {
    margin: 15px 0 10px;
    padding-top: 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #536175;
    border-top: 1px solid #edf1f6;
    font-size: 10px;
}
.load-status, .last-run { display: inline-flex; align-items: center; gap: 6px; }
.status-dot { width: 8px; height: 8px; background: #35a85b; border-radius: 50%; }
.status-dot.neutral { background: #9aa5b4; }
.last-run svg { width: 12px; height: 12px; }

.metric-grid {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.metric-card {
    min-width: 0;
    height: 70px;
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.metric-card > div { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.metric-label { overflow: hidden; text-overflow: ellipsis; font-size: 10px; font-weight: 700; white-space: nowrap; }
.metric-card strong { font-size: 20px; line-height: 1; }
.metric-card > svg { width: 21px; height: 21px; flex: 0 0 auto; }
.metric-card.blue { color: #1469dc; border-color: #cfe0f7; }
.metric-card.cyan { color: var(--cyan); border-color: #cae4e8; }
.metric-card.green { color: var(--green); border-color: #cee8d6; }
.metric-card.orange { color: var(--orange); border-color: #f1d7ca; }
.metric-card.gray { color: #667085; border-color: #dce2e9; }
.control-metrics { grid-template-columns: minmax(0, 1.2fr) 160px minmax(0, 2fr); }
.hash-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: Consolas, monospace; font-size: 13px; }
.dashboard-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-date { width: 150px; flex: 0 0 150px; }

.table-shell { overflow: hidden; border: 1px solid var(--border); border-radius: 6px; }
.data-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.data-table th {
    height: 32px;
    padding: 0 12px;
    color: #344054;
    background: #edf2f7;
    text-align: left;
    font-size: 10px;
    font-weight: 750;
}
.data-table td { height: 35px; padding: 0 12px; color: #354156; border-top: 1px solid #e8edf3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table th:nth-child(1), .data-table td:nth-child(1) { width: 14%; }
.data-table th:nth-child(2), .data-table td:nth-child(2) { width: 18%; }
.data-table th:nth-child(4), .data-table td:nth-child(4),
.data-table th:nth-child(5), .data-table td:nth-child(5) { width: 16%; }
.number-column { text-align: right !important; font-variant-numeric: tabular-nums; }
.reference-cell { font-family: Consolas, monospace; }
.matched-row td { background: #f1faf4; }
.table-footer { min-height: 46px; padding: 7px 10px 7px 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #f8fafc; border-top: 1px solid var(--border); }
.totals { display: flex; align-items: center; gap: 60px; font-size: 10px; }

.date-chip, .role-badge, .state-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.date-chip, .role-badge { color: #31557d; background: #edf4fb; border: 1px solid #d9e7f5; }
.state-badge.active { color: #187743; background: #e8f6ed; }
.state-badge.inactive { color: #7b4a4a; background: #f7eded; }

.empty-state, .upload-zone {
    min-height: 250px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px dashed #c9d6e5;
    border-radius: 6px;
    background: #fafcfe;
}
.empty-state.compact { min-height: 180px; margin-top: 14px; }
.empty-state > svg, .upload-zone > svg { width: 28px; height: 28px; margin-bottom: 10px; color: #7690ad; }
.empty-state h2, .upload-zone h2 { margin: 0; font-size: 14px; }
.empty-state p, .upload-zone p { margin: 5px 0 16px; color: var(--muted); font-size: 11px; }
.consultation-filters .field { grid-column: span 3; }
.consultation-filters .load-button { grid-column: span 3; }
.consultation-results, .import-history { margin-top: 14px; }

.import-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(160px, 1fr) minmax(260px, 2fr) 130px;
    gap: 12px;
    align-items: end;
    margin-bottom: 14px;
}
.bulk-import-grid { grid-template-columns: minmax(280px, 1fr) 130px; }
.initial-upload-grid { grid-template-columns: minmax(0, 1fr); margin-bottom: 12px; }
.initial-context-grid { margin-bottom: 14px; }
.initial-context-grid .primary-button { width: 100%; }
.queue-table th:nth-child(n), .queue-table td:nth-child(n) { width: auto; }
.queue-table th:first-child { width: 110px; }
.queue-table th:nth-child(2) { width: 25%; }
.queue-table th:nth-child(3) { width: 150px; }
.queue-table th:last-child { width: 82px; }
.queue-status {
    display: inline-flex;
    min-height: 23px;
    padding: 0 7px;
    align-items: center;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 750;
}
.queue-pending { color: #6b5714; background: #fff7d6; }
.queue-processing { color: #1559a8; background: #e8f2ff; }
.queue-completed { color: #187743; background: #e8f6ed; }
.queue-completed-warning { color: #855d08; background: #fff2c2; }
.queue-failed { color: #a12a2a; background: #fdecec; }
.completed-status { color: #187743; background: #e8f6ed; }
.warning-status { color: #855d08; background: #fff2c2; }
.queue-error { color: #a12a2a; }
.queue-table td { vertical-align: top; }
.queue-result-warning {
    width: 100%;
    max-width: 560px;
    margin-top: 5px;
    color: #855d08;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}
.queue-result-warning summary {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}
.queue-result-warning summary::-webkit-details-marker { display: none; }
.queue-result-warning summary svg { width: 14px; height: 14px; flex: 0 0 14px; }
.queue-result-warning > div {
    max-height: 120px;
    margin-top: 5px;
    padding: 7px 8px;
    overflow: auto;
    border: 1px solid #eadba4;
    border-radius: 4px;
    background: #fffbeb;
}
.queue-actions { padding-right: 6px !important; text-align: right; }
.queue-action-group { display: flex; justify-content: flex-end; gap: 3px; }
.reconciliation-dashboard-table { min-width: 940px; }
.reconciliation-dashboard-table th:nth-child(n),
.reconciliation-dashboard-table td:nth-child(n) { width: auto; }
.reconciliation-dashboard-table th:first-child { width: 82px; }
.reconciliation-dashboard-table th:nth-child(2) { width: 80px; }
.reconciliation-dashboard-table th:nth-child(3) { width: 29%; }
.reconciliation-dashboard-table th:nth-child(4) { width: 92px; }
.reconciliation-dashboard-table th:nth-child(5) { width: 90px; }
.reconciliation-dashboard-table th:nth-child(6) { width: 120px; }
.reconciliation-dashboard-table th:nth-child(7) { width: 90px; }
.reconciliation-dashboard-table th:last-child { width: 88px; }
.matrix-filters { display: grid; grid-template-columns: minmax(250px, 1fr) 150px; gap: 10px; min-width: 480px; }
.matrix-legend { margin: 2px 0 10px; display: flex; flex-wrap: wrap; gap: 15px; color: var(--muted); font-size: 10px; }
.matrix-legend span { display: inline-flex; align-items: center; gap: 5px; }
.matrix-dot { width: 9px; height: 9px; border-radius: 2px; }
.matrix-dot.missing, .matrix-cell.missing { background: #dc3545; }
.matrix-dot.mismatch, .matrix-cell.balancemismatch { background: #e9b21d; }
.matrix-dot.ready, .matrix-cell.ready { background: #2a9d55; }
.matrix-dot.reconciled, .matrix-cell.reconciled { background: #1a67d2; }
.matrix-dot.reprocessing, .matrix-cell.reprocessing { background: #0891b2; }
.matrix-shell { overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.reconciliation-matrix { min-width: 720px; width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 9px; }
.reconciliation-matrix th { min-width: 74px; height: 48px; padding: 5px; color: #36445a; background: #edf2f7; border: 1px solid #dce5ef; text-align: center; }
.reconciliation-matrix th:first-child { width: 165px; min-width: 165px; text-align: left; }
.reconciliation-matrix th small { display: block; overflow: hidden; text-overflow: ellipsis; font-weight: 500; white-space: nowrap; }
.reconciliation-matrix td { height: 42px; padding: 5px; border: 1px solid #e5ebf2; text-align: center; }
.matrix-cell { width: 24px; height: 24px; padding: 0; border: 2px solid transparent; border-radius: 4px; }
.matrix-cell.selected { border-color: #172b4d; box-shadow: 0 0 0 2px #fff inset; }
.matrix-na { color: #a5afbc; }
.reconciliation-browser { padding: 0; overflow: hidden; }
.reconciliation-browser-grid { min-height: 640px; display: grid; grid-template-columns: 290px minmax(0, 1fr); }
.reconciliation-tree-panel { min-width: 0; display: flex; flex-direction: column; align-self: stretch; background: #f8fafc; border-right: 1px solid var(--border); }
.tree-heading { padding: 12px; border-bottom: 1px solid var(--border); }
.tree-heading > div { margin-bottom: 10px; display: flex; align-items: center; gap: 7px; }
.tree-heading h1 { margin: 0; font-size: 15px; }
.reconciliation-tree { min-height: 0; padding: 8px; flex: 1 1 auto; overflow: visible; }
.tree-node, .tree-relation {
    width: 100%;
    min-width: 0;
    border: 0;
    display: flex;
    align-items: center;
    text-align: left;
}
.tree-node { min-height: 31px; padding: 4px 5px; gap: 4px; color: #324055; background: transparent; font-size: 10px; }
.tree-node:hover, .tree-relation:hover { background: #eaf1f8; }
.tree-node:disabled, .tree-relation:disabled { cursor: wait; opacity: .65; }
.tree-node svg { width: 13px; height: 13px; flex: 0 0 auto; }
.tree-node span, .tree-node strong, .tree-relation span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-service + .tree-service { margin-top: 3px; }
.tree-children { padding-left: 10px; }
.tree-bank-node { color: #46566d; }
.tree-relations { padding-left: 18px; }
.tree-relation { min-height: 28px; padding: 3px 6px; gap: 7px; color: #536175; background: transparent; font-size: 10px; }
.tree-relation.active { color: #0b63d8; background: #e7f1fd; font-weight: 700; }
.tree-relation .matrix-dot { flex: 0 0 auto; }
.reconciliation-detail-panel { min-width: 0; padding: 14px; }
.detail-loading { min-height: 420px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.notice-info { color: #31557d; background: #edf4fb; border-color: #d3e2f2; }
.balance-summary { color: #fff; background: #287fcf; }
.balance-title { min-height: 48px; padding: 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid rgba(255,255,255,.24); }
.balance-title strong { font-size: 14px; }
.balance-title span { font-size: 11px; font-weight: 700; }
.balance-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 11px; }
.balance-table th, .balance-table td { height: 29px; padding: 5px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 1px solid rgba(255,255,255,.15); }
.balance-table thead th { height: 37px; background: rgba(0,0,0,.08); text-align: right; font-size: 10px; }
.balance-table th:first-child { width: 135px; text-align: left; }
.balance-table tbody td { text-align: right; font-variant-numeric: tabular-nums; }
.balance-difference-row { background: rgba(0,0,0,.06); }
.balance-warning { color: #fff0a8; font-weight: 800; }
.reconciliation-detail-toolbar {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(270px, 1fr) 145px minmax(180px, 260px) auto;
    align-items: end;
    gap: 10px;
}
.reconciliation-detail-toolbar .detail-tabs { align-self: stretch; }
.search-field-selector { width: 145px; }
.movement-search { min-width: 180px; }
.reconciliation-detail-table { overflow-x: auto; }
.reconciliation-detail-table table { min-width: 860px; }
.reconciliation-detail-statusbar {
    min-height: 54px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(320px, 1fr) auto auto;
    align-items: center;
    gap: 16px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0;
}
.detail-counts { display: flex; align-items: center; gap: 28px; font-size: 10px; }
.pagination-controls { display: flex; align-items: center; gap: 4px; font-size: 10px; white-space: nowrap; }
.detail-command-group { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.unreconciliation-panel {
    padding: 14px;
    background: #fff;
    border: 1px solid #e3aaaa;
    border-top: 0;
}
.unreconciliation-panel .panel-heading { margin-bottom: 10px; }
.unreconciliation-panel .panel-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.unreconciliation-range-grid {
    display: grid;
    grid-template-columns: 180px 180px auto;
    align-items: end;
    gap: 12px;
}
.unreconciliation-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 1px;
    margin-bottom: 12px;
    background: var(--border);
    border: 1px solid var(--border);
}
.unreconciliation-progress > div { min-height: 52px; padding: 9px 10px; background: #f8fafc; }
.unreconciliation-progress span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 9px; }
.unreconciliation-progress strong { font-size: 11px; }
.replacement-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -3px 0 12px;
}
.replacement-requirement {
    min-height: 34px;
    padding: 6px 9px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--border);
    background: #f8fafc;
    font-size: 10px;
}
.replacement-requirement svg { width: 15px; height: 15px; }
.replacement-requirement strong { margin-left: 5px; font-size: 9px; }
.replacement-requirement.covered { color: #187743; border-color: #aad8bc; background: #edf8f1; }
.replacement-requirement.balance-mismatch { color: #875900; border-color: #e7c56b; background: #fff8df; }
.replacement-requirement.missing { color: #a12a2a; border-color: #efbbbb; background: #fff3f3; }
.replacement-upload {
    display: grid;
    grid-template-columns: minmax(300px, 1fr) auto auto auto;
    align-items: end;
    gap: 8px;
}
.replacement-queue { margin-top: 12px; }
.replacement-queue-table th:nth-child(n),
.replacement-queue-table td:nth-child(n) { width: auto; }
.replacement-queue-table th:first-child { width: 105px; }
.replacement-queue-table th:nth-child(2) { width: 28%; }
.replacement-queue-table th:last-child { width: 74px; }
.replacement-queue-table .queue-error {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}
.unreconciliation-confirmation h3,
.unreconciliation-final-confirmation h3 { margin: 0 0 12px; font-size: 13px; }
.unreconciliation-confirmation dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 1px;
    margin: 0 0 14px;
    background: var(--border);
    border: 1px solid var(--border);
}
.unreconciliation-confirmation dl > div { min-height: 54px; padding: 9px 10px; background: #fff; }
.unreconciliation-confirmation dt { color: var(--muted); font-size: 9px; }
.unreconciliation-confirmation dd { margin: 4px 0 0; font-size: 11px; font-weight: 700; }
.unreconciliation-final-confirmation { padding: 18px; text-align: center; background: #fff5f5; border: 1px solid #e5b0b0; }
.unreconciliation-final-confirmation > svg { width: 28px; height: 28px; margin-bottom: 8px; color: #bd3030; }
.unreconciliation-final-confirmation .settings-actions { justify-content: center; }
.recalculation-running { min-height: 46px; display: flex; align-items: center; gap: 10px; color: #08728c; }
.recalculation-running > svg { width: 20px; height: 20px; animation: queue-spin 1s linear infinite; }
@keyframes queue-spin { to { transform: rotate(360deg); } }
.reconciliation-reportbar {
    min-height: 52px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 24px;
    background: #fff;
    border: 1px solid var(--border);
    border-top: 0;
    border-radius: 0 0 6px 6px;
}
.report-download-group {
    display: flex;
    align-items: center;
    gap: 7px;
}
.report-download-group + .report-download-group {
    padding-left: 24px;
    border-left: 1px solid var(--border);
}
.report-download-group strong {
    min-width: 66px;
    color: #354156;
    font-size: 10px;
}
.report-format-button {
    min-width: 62px;
    height: 32px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    text-decoration: none;
}
.report-format-button svg { width: 15px; height: 15px; }
.report-format-button.xlsx { background: #148a51; border-color: #148a51; }
.report-format-button.pdf { background: #dc3545; border-color: #dc3545; }
.report-format-button:hover { color: #fff; filter: brightness(.9) saturate(1.08); }
.report-send-button { margin-left: auto; }
.report-send-button:disabled { cursor: default; }
.manual-reconciliation-workspace { min-height: calc(100vh - 136px); }
.manual-reconciliation-header {
    display: grid;
    grid-template-columns: minmax(390px, 44%) minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}
.manual-totals {
    display: grid;
    grid-template-columns: 135px repeat(2, minmax(120px, 1fr));
    color: #fff;
    background: #71879c;
    border: 1px solid #61778d;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}
.manual-totals > * {
    min-height: 34px;
    padding: 7px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-right: 1px solid rgba(255,255,255,.24);
    border-bottom: 1px solid rgba(255,255,255,.24);
}
.manual-totals > :nth-child(3n + 1) { justify-content: flex-start; }
.manual-totals > :nth-last-child(-n + 3) { border-bottom: 0; }
.manual-totals strong { justify-content: center; text-transform: uppercase; }
.manual-totals b { font-weight: 800; }
.manual-total-warning { color: #ffe3a3; }
.manual-relation-heading { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.manual-relation-heading h1 {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 22px;
    line-height: 1.2;
}
.manual-relation-heading p { margin: 5px 0 2px; font-size: 17px; font-weight: 750; }
.manual-relation-heading span { color: var(--muted); font-size: 11px; }
.manual-balance-row {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 10px;
}
.manual-balance-card {
    min-height: 58px;
    padding: 9px 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 2px;
    background: #f7fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
}
.manual-balance-card span,
.manual-balance-card small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.manual-balance-card span { color: var(--muted); font-size: 10px; font-weight: 700; }
.manual-balance-card strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.manual-balance-card small { color: #526174; font-size: 10px; }
.manual-balance-card .manual-total-warning { color: #b45500; }
.manual-balance-card .icon-button { grid-row: span 3; }
.manual-balance-editor { padding: 16px; }
.manual-balance-editor p { margin: 0 0 12px; color: var(--muted); font-size: 11px; font-weight: 700; }
.manual-command-row {
    min-height: 68px;
    display: grid;
    grid-template-columns: auto minmax(470px, 1fr);
    align-items: end;
    gap: 18px;
}
.manual-record-actions { display: flex; align-items: end; gap: 7px; }
.manual-action-button {
    width: 39px;
    height: 39px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    border: 0;
    border-radius: 50%;
}
.manual-action-button svg { width: 19px; height: 19px; }
.manual-action-button.add { background: #16b364; }
.manual-action-button.delete { background: #ef3340; }
.manual-action-button.edit { background: #08aeb8; }
.manual-action-button:disabled { cursor: default; }
.manual-action-button:not(:disabled):hover { filter: brightness(.9) saturate(1.08); }
.manual-action-button:focus-visible {
    outline: 3px solid rgba(11, 99, 216, .28);
    outline-offset: 2px;
}
.manual-search {
    display: grid;
    grid-template-columns: 150px minmax(220px, 1fr) auto 30px;
    align-items: end;
    gap: 9px;
}
.manual-table-layout { border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.manual-table-scroll { max-height: calc(100vh - 365px); min-height: 330px; overflow: auto; }
.manual-reconciliation-table { min-width: 1050px; table-layout: fixed; }
.manual-reconciliation-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0 7px;
}
.manual-reconciliation-table th:nth-child(n),
.manual-reconciliation-table td:nth-child(n) { width: auto; }
.manual-reconciliation-table th:nth-child(1) { width: 88px; }
.manual-reconciliation-table th:nth-child(2),
.manual-reconciliation-table th:nth-child(3) { width: 105px; }
.manual-reconciliation-table th:nth-child(4) { width: 31%; }
.manual-reconciliation-table th:nth-child(5) { width: 150px; }
.manual-reconciliation-table th:nth-child(6) { width: 60px; }
.manual-reconciliation-table th:nth-child(7) { width: 135px; }
.manual-reconciliation-table th:nth-child(8) { width: 88px; }
.manual-reconciliation-table tbody tr { outline: none; }
.manual-reconciliation-table tbody tr:hover td { background: #f3f7fb; }
.manual-reconciliation-table tbody tr.active-row td { background: #e7f1fd; }
.manual-reconciliation-table tbody tr.checked-row:not(.active-row) td { background: #f0faf4; }
.manual-reconciliation-table tbody tr.checked-row td:first-child { box-shadow: inset 3px 0 0 #26965a; }
.manual-reconciliation-table tbody tr:focus td { outline: 1px solid #5c98dd; outline-offset: -1px; }
.manual-sort {
    width: 100%;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    color: inherit;
    background: transparent;
    border: 0;
    text-align: left;
    font: inherit;
    font-weight: inherit;
}
.manual-sort.active { color: #0759bb; }
.manual-sort span { font-size: 13px; }
.select-column { text-align: center !important; }
.select-column input { width: 15px; height: 15px; accent-color: var(--blue); }
.manual-table-footer {
    min-height: 55px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}
.manual-record-count { font-size: 11px; }
.manual-record-count span { margin-left: 28px; color: var(--muted); }
.manual-select-page { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; white-space: nowrap; }
.manual-select-page input { width: 15px; height: 15px; accent-color: var(--blue); }
.manual-footer-actions { display: flex; align-items: center; gap: 7px; }
.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1000;
    padding: 18px;
    display: grid;
    place-items: center;
    background: rgba(24, 34, 52, .42);
}
.manual-dialog {
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    background: #fff;
    border: 1px solid #cbd7e5;
    border-radius: 7px;
    box-shadow: 0 18px 50px rgba(24, 34, 52, .24);
}
.manual-dialog > header {
    min-height: 52px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
.manual-dialog h2 { margin: 0; font-size: 15px; }
.manual-dialog > p { margin: 0; padding: 20px 16px; color: #354156; font-size: 12px; }
.manual-dialog > footer {
    min-height: 58px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    background: #f8fafc;
    border-top: 1px solid var(--border);
}
.manual-editor-grid {
    padding: 16px;
    display: grid;
    grid-template-columns: 170px 145px 145px minmax(140px, 1fr);
    gap: 12px;
}
.manual-description-field { grid-column: span 3; }
.confirmation-dialog { width: min(470px, 100%); }
.relation-detail { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.relation-summary { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); background: #1976d2; color: #fff; }
.relation-summary > div { min-width: 0; min-height: 62px; padding: 10px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-right: 1px solid rgba(255,255,255,.2); }
.relation-summary > div:first-child { grid-column: span 2; }
.relation-summary span { overflow: hidden; text-overflow: ellipsis; font-size: 9px; white-space: nowrap; }
.relation-summary strong { overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }
.relation-summary .text-danger { color: #fff0a8; }
.detail-toolbar { min-height: 52px; display: flex; align-items: end; gap: 12px; }
.reference-digits { width: 135px; flex: 0 0 auto; }
.detail-tabs { min-width: 0; display: flex; align-items: end; overflow-x: auto; }
.detail-tabs button { height: 34px; padding: 0 10px; color: #59677a; background: transparent; border: 0; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 10px; }
.detail-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }
.detail-toolbar > .primary-button { margin-left: auto; }
.entity-form-grid { display: grid; grid-template-columns: 110px 150px minmax(220px, 1fr) minmax(180px, 1fr); gap: 12px; }
.service-selection { margin: 14px 0 0; padding: 10px; display: flex; flex-wrap: wrap; gap: 18px; border: 1px solid var(--border); }
.service-selection legend { padding: 0 5px; color: #435066; font-size: 10px; font-weight: 700; }
.service-selection label, .switch-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; }
.table-input { width: 100%; height: 28px; padding: 0 7px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: 11px; }
.entity-directory-heading { margin-top: 18px; display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.entity-directory-heading h2 { margin: 0; font-size: 15px; }
.entity-directory-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.entity-search { width: min(320px, 100%); }
.entity-service-table { margin-top: 9px; }
.entity-service-table table { min-width: 880px; table-layout: fixed; }
.entity-service-table th:first-child { width: 240px; }
.entity-service-table th:not(:first-child) { width: 210px; }
.entity-service-table th small { color: var(--muted); font-weight: 500; }
.entity-service-table td { vertical-align: top; }
.entity-service-table td:first-child span, .entity-service-table td:first-child small { display: block; margin-top: 2px; }
.entity-service-table td:first-child small { color: var(--muted); }
.participation-toggle { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; }
.participant-account { display: grid; grid-template-columns: minmax(0, 1fr) 30px; gap: 5px; align-items: center; }
.confirmation-bar {
    margin-bottom: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff8f0;
    border: 1px solid #f0d0af;
    border-radius: 6px;
}
.confirmation-bar > div { min-width: 0; margin-right: auto; display: flex; flex-direction: column; gap: 3px; }
.confirmation-bar strong { font-size: 11px; }
.confirmation-bar span { color: var(--muted); font-size: 10px; }
.inline-confirmation-row td { padding: 6px 8px 10px; background: #fffaf4; }
.inline-confirmation-row .confirmation-bar { margin: 0; }
.entity-core-fields { grid-template-columns: 120px 180px minmax(260px, 1fr); }
.service-assignment-editor { margin: 14px 0; border-top: 1px solid var(--border); }
.assignment-heading { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.assignment-heading strong { font-size: 11px; }
.assignment-heading span { color: var(--muted); font-size: 10px; }
.service-assignment-row {
    min-height: 54px;
    padding: 8px 10px;
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(220px, 320px);
    align-items: center;
    gap: 18px;
    border-top: 1px solid #e8edf3;
}
.directory-toolbar { margin: 18px 0 9px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.directory-toolbar p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.view-tabs { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.view-tabs button {
    height: 34px;
    padding: 0 12px;
    color: #59677a;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    font-size: 11px;
    font-weight: 700;
}
.view-tabs button.active { color: var(--blue); border-bottom-color: var(--blue); }
.view-tabs button span { margin-left: 5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.entity-directory-table th:first-child { width: 31% !important; }
.entity-directory-table th:nth-child(2) { width: 22% !important; }
.entity-directory-table th:nth-child(3) { width: auto !important; }
.entity-directory-table td, .inactive-entity-table td { height: 52px; }
.entity-directory-table td:first-child small,
.inactive-entity-table td:first-child small,
.inactive-entity-table td:nth-child(2) small { display: block; margin-top: 3px; color: var(--muted); }
.service-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.service-tags span, .activity-category {
    display: inline-flex;
    min-height: 22px;
    padding: 0 7px;
    align-items: center;
    color: #31557d;
    background: #edf4fb;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}
.account-line { display: flex; gap: 8px; font-size: 10px; }
.account-line + .account-line { margin-top: 3px; }
.account-line strong { min-width: 34px; }
.danger-icon { color: #a43737; }
.service-form-grid { display: grid; grid-template-columns: 120px minmax(260px, 1fr) 110px 90px minmax(190px, auto); gap: 12px; align-items: end; }
.service-auto-toggle { min-height: 34px; }
.service-admin-table th:first-child { width: 36% !important; }
.relation-settings-heading {
    margin: 24px 0 9px;
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
}
.relation-settings-heading h2 { margin: 0; font-size: 13px; }
.relation-settings-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.relation-settings-filters { display: grid; grid-template-columns: minmax(260px, 340px) minmax(220px, 300px); gap: 12px; }
.relation-settings-table th:first-child,
.relation-settings-table th:nth-child(2) { width: 29% !important; }
.relation-settings-table th:nth-child(3) { width: 120px !important; }
.relation-settings-table th:nth-child(4) { width: 190px !important; }
.relation-settings-table td:nth-child(4) small { display: block; margin-top: 3px; color: var(--muted); }
.relation-digits-input { width: 82px; text-align: right; font-variant-numeric: tabular-nums; }
.default-setting { color: var(--muted); }
.email-form-grid { display: grid; grid-template-columns: minmax(260px, 1fr) 180px minmax(260px, 1fr); gap: 12px; }
.bank-email-table th:first-child { width: 27% !important; }
.bank-email-table th:nth-child(2) { width: 16% !important; }
.bank-email-table th:nth-child(3) { width: auto !important; }
.activity-filters { display: grid; grid-template-columns: 140px 140px minmax(220px, 1fr) 180px 120px; gap: 12px; align-items: end; }
.activity-summary { min-height: 38px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; }
.activity-summary strong { color: #354156; font-size: 11px; }
.activity-table { overflow-x: auto; }
.activity-table table { min-width: 1050px; }
.activity-table th:nth-child(n), .activity-table td:nth-child(n) { width: auto; }
.activity-table th:first-child { width: 145px; }
.activity-table th:nth-child(2) { width: 190px; }
.activity-table th:nth-child(3) { width: 115px; }
.activity-table th:nth-child(4) { width: 160px; }
.activity-table th:nth-child(5) { width: 210px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.file-field input[type="file"] {
    width: 100%;
    height: 34px;
    padding: 5px 8px;
    color: #435066;
    background: #fff;
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    font-size: 10px;
}
.reconciliation-table th:nth-child(n), .reconciliation-table td:nth-child(n),
.consultation-table th:nth-child(n), .consultation-table td:nth-child(n),
.import-table th:nth-child(n), .import-table td:nth-child(n),
.dashboard-table th:nth-child(n), .dashboard-table td:nth-child(n),
.report-table th:nth-child(n), .report-table td:nth-child(n) { width: auto; }
.reconciliation-table .origin-bank-column { width: 9%; }
.reconciliation-table .date-column { width: 12%; }
.reconciliation-table .description-column { width: 20%; }
.reconciliation-table .amount-column { width: 14%; }

.notice { margin: 0 0 12px; padding: 9px 11px; border: 1px solid; border-radius: 5px; font-size: 11px; }
.notice-success { color: #176a3c; background: #edf8f1; border-color: #cde8d6; }
.notice-error { color: #963434; background: #fdf1f1; border-color: #efcccc; }
.validation-summary { margin-bottom: 12px; color: var(--danger); font-size: 11px; }
.validation-summary ul { margin: 0; padding-left: 18px; }

.editor-panel, .settings-section { margin-bottom: 14px; padding: 14px; background: #f9fbfd; border: 1px solid var(--border); border-radius: 6px; }
.panel-heading { margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.panel-heading h2, .settings-heading h2 { margin: 0; font-size: 13px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: end; }
.form-action { display: flex; align-items: end; }
.form-action .primary-button { width: 100%; }
.admin-table .data-table th:nth-child(n), .admin-table .data-table td:nth-child(n) { width: auto; }
.admin-table .data-table th:first-child { width: 22%; }
.admin-table .data-table th:nth-child(2) { width: 30%; }
.admin-table .action-column { width: 100px !important; text-align: right; }
.table-empty { height: 70px !important; color: var(--muted) !important; text-align: center; }

.settings-workspace { max-width: 860px; margin: 0 auto; }
.settings-heading { margin-bottom: 14px; display: flex; align-items: flex-start; gap: 10px; }
.settings-heading > svg { width: 18px; height: 18px; color: var(--blue); }
.settings-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.settings-grid .span-two { grid-column: span 2; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; }

#blazor-error-ui { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; padding: 10px 18px; color: #fff; background: #9e3434; box-shadow: 0 -1px 4px rgba(0,0,0,.2); }
#blazor-error-ui .dismiss { float: right; color: #fff; background: transparent; border: 0; }

@media (max-width: 720px) {
    .header-inner, .nav-inner, .app-main { width: calc(100% - 16px); }
    .account-link > span:first-child { display: none; }
    .main-nav { height: 44px; }
    .nav-inner { gap: 2px; }
    .nav-entry { min-width: max-content; padding: 0 5px; gap: 3px; font-size: 9px; }
    .nav-entry.active::after { left: 6px; right: 6px; }
    .logout-form { margin-left: 0; }
    .workspace { padding: 12px; }
    .metric-grid { gap: 5px; }
    .metric-card { height: 60px; padding: 8px; }
    .metric-card strong { font-size: 15px; }
    .metric-card > svg { display: none; }
    .metric-label { font-size: 8px; }
    .data-table th, .data-table td { padding: 0 7px; }
    .totals { gap: 16px; }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .consultation-filters .field, .consultation-filters .load-button { grid-column: span 6; }
    .import-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .matrix-filters { min-width: 0; grid-template-columns: 1fr 130px; }
    .relation-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .entity-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .relation-settings-heading { align-items: stretch; flex-direction: column; }
    .relation-settings-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .service-name { grid-column: span 2; }
    .email-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .bank-email-bank, .bank-email-address { grid-column: span 2; }
    .activity-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .reconciliation-browser-grid { grid-template-columns: 220px minmax(680px, 1fr); overflow-x: auto; }
    .reconciliation-detail-toolbar { grid-template-columns: minmax(240px, 1fr) 130px minmax(170px, 1fr) auto; }
    .manual-reconciliation-header { grid-template-columns: 1fr; }
    .manual-balance-row { grid-template-columns: 1fr; }
    .manual-command-row { grid-template-columns: 1fr; align-items: stretch; padding: 10px 0; }
    .manual-search { grid-template-columns: 140px minmax(180px, 1fr) auto 30px; }
    .manual-table-footer { min-width: 850px; }
}

@media (max-width: 430px) {
    .environment-badge { display: none; }
    .section-heading { align-items: flex-start; }
    .section-heading p { display: none; }
    .status-row { align-items: flex-start; gap: 6px; }
    .last-run { justify-content: flex-end; text-align: right; }
    .metric-grid { grid-template-columns: repeat(5, minmax(58px, 1fr)); overflow-x: auto; padding-bottom: 3px; }
    .field-service, .field-sender { grid-column: span 6; }
    .field-date, .field-criterion, .field-counterparty { grid-column: span 6; }
    .load-button { grid-column: span 6; }
    .dashboard-metrics { grid-template-columns: 1fr; }
    .table-shell { overflow-x: auto; }
    .data-table { min-width: 540px; }
    .table-footer { min-width: 540px; }
    .form-grid { grid-template-columns: 1fr; }
    .settings-grid .span-two { grid-column: span 1; }
    .import-grid { grid-template-columns: 1fr; }
    .matrix-filters { width: 100%; grid-template-columns: 1fr; }
    .section-heading:has(.matrix-filters) { flex-direction: column; }
    .relation-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .relation-summary > div:first-child { grid-column: span 2; }
    .detail-toolbar { align-items: stretch; flex-direction: column; }
    .reference-digits { width: 100%; }
    .detail-toolbar > .primary-button { width: 100%; margin-left: 0; }
    .entity-form-grid { grid-template-columns: 1fr; }
    .entity-directory-heading { align-items: stretch; flex-direction: column; gap: 8px; }
    .entity-search { width: 100%; }
    .confirmation-bar, .directory-toolbar, .assignment-heading { align-items: stretch; flex-direction: column; }
    .service-assignment-row { grid-template-columns: 1fr; gap: 8px; }
    .service-form-grid, .email-form-grid, .activity-filters { grid-template-columns: 1fr; }
    .relation-settings-filters { grid-template-columns: 1fr; }
    .service-name, .bank-email-bank, .bank-email-address { grid-column: span 1; }
    .view-tabs { width: 100%; overflow-x: auto; }
    .reconciliation-browser { overflow: visible; }
    .reconciliation-browser-grid { display: block; min-height: 0; overflow: visible; }
    .reconciliation-tree-panel { border-right: 0; border-bottom: 1px solid var(--border); }
    .reconciliation-tree { max-height: 300px; overflow: auto; }
    .reconciliation-detail-panel { padding: 10px; overflow-x: auto; }
    .balance-summary, .reconciliation-detail-toolbar, .reconciliation-detail-table { min-width: 720px; }
    .reconciliation-detail-toolbar { grid-template-columns: minmax(240px, 1fr) 130px 190px auto; }
    .reconciliation-detail-statusbar, .reconciliation-reportbar { min-width: 790px; }
    .unreconciliation-panel { min-width: 790px; }
    .manual-reconciliation-workspace { overflow-x: auto; }
    .manual-reconciliation-header, .manual-balance-row, .manual-command-row, .manual-table-layout { min-width: 720px; }
    .manual-editor-grid { grid-template-columns: 1fr; }
    .manual-description-field { grid-column: span 1; }
    .unreconciliation-range-grid,
    .replacement-upload,
    .unreconciliation-progress,
    .unreconciliation-confirmation dl { grid-template-columns: 1fr; }
}
