/* Structural adaptations only. Colours, typography, shell, cards, tables,
   controls, alerts and breakpoints come from the committed Legal style.css. */
.tebfin-public-layout { grid-template-columns: 1fr; }
.tebfin-context-bar, .company-select, .page-header, .tebfin-actions {
  display:flex; align-items:center; flex-wrap:wrap; gap:10px;
}
.tebfin-context-bar { justify-content:space-between; margin-bottom:20px; }
.page-header { justify-content:space-between; margin-bottom:20px; }
.page-header .org-name { margin:0; }
.tebfin-ui main > .org-name { margin-top:0; margin-bottom:20px; }
.tebfin-ui .intro, .tebfin-ui .muted, .tebfin-footer, .tebfin-ui .helptext { opacity:.75; }
.tebfin-ui .intro { line-height:1.5; margin-bottom:20px; }
.tebfin-footer { font-size:.8rem; margin-top:2rem; }
.tebfin-ui .numeric { text-align:right; font-variant-numeric:tabular-nums; }
.tebfin-ui .data-table th { background:var(--header-bg); }
.tebfin-ui .data-table tr:hover { cursor:default; }
.tebfin-ui .data-table a { overflow-wrap:anywhere; }
.tebfin-ui .table-scroll { overflow-x:auto; -webkit-overflow-scrolling:touch; margin-bottom:1rem; }
.tebfin-ui .card .table-scroll:last-child { margin-bottom:0; }
.tebfin-ui .data-table { margin:0; }
.tebfin-ui input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.tebfin-ui select, .tebfin-ui textarea { max-width:100%; padding:6px 10px; border-radius:4px; font:inherit; min-width:0; }
.tebfin-ui select[multiple] { height:auto; min-height:90px; }
.tebfin-ui textarea { min-height:100px; width:100%; }
.tebfin-ui input[type=checkbox], .tebfin-ui input[type=radio] { width:auto; height:auto; }
.tebfin-form { max-width:900px; }
.tebfin-form > p { display:flex; flex-direction:column; gap:.5rem; margin-top:0; margin-bottom:1rem; }
.tebfin-form label { font-weight:600; }
.tebfin-form input:not([type=checkbox]):not([type=radio]):not([type=hidden]), .tebfin-form select { width:100%; }
.tebfin-ui .helptext { font-size:.85rem; font-weight:normal; }
/* Error styling reused from modal_base.html; validation behavior is unchanged. */
.tebfin-ui ul.errorlist { color:#ffb4b4; padding-left:1.2rem; margin:.35rem 0; }
.tebfin-ui .filter-form { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.tebfin-ui .filter-form input:not([type=hidden]) { flex:1; min-width:min(240px,100%); }
.tebfin-ui .empty { padding:1.5rem; }
.tebfin-ui pre { overflow-x:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.tebfin-ui .skip-link { position:fixed; top:8px; left:8px; z-index:2000; transform:translateY(-160%); }
.tebfin-ui .skip-link:focus { transform:translateY(0); }
.tebfin-ui :is(input,select,textarea,summary):focus-visible { outline:2px solid #22d3ee; outline-offset:2px; }
@media(max-width:768px) {
  .tebfin-context-bar { align-items:flex-start; }
  .company-select { width:100%; }
  .company-select select { flex:1; }
  .tebfin-ui .filter-form { align-items:stretch; }
  .tebfin-ui .filter-form input:not([type=hidden]) { width:100%; }
  .tebfin-form { max-width:100%; }
  .tebfin-ui .header-left { grid-template-columns:auto 1fr !important; }
  .tebfin-ui.nav-lock { overflow:hidden; }
}

/* Directly reused client_edit_modal.html form grid, with generic field names. */
.client-onboard-grid { display:grid; grid-template-columns:1fr 1fr; gap:1rem; align-items:start; min-width:0; margin-bottom:1rem; }
.client-onboard-grid input, .client-onboard-grid select, .client-onboard-grid textarea { width:100%; max-width:100%; box-sizing:border-box; }
.client-onboard-grid .checkbox-row { display:flex; align-items:center; gap:.6rem; min-height:38px; }
.client-onboard-grid .checkbox-row input[type=checkbox] { width:auto !important; transform:scale(1.1); margin:0; }
.client-onboard-grid .field { min-width:0; }
.client-onboard-grid label { display:block; margin-bottom:.5rem; }
.client-onboard-grid .checkbox-row label { margin-bottom:0; }
.client-onboard-grid .field-wide { grid-column:1 / -1; }
.client-onboard-grid.single-column { grid-template-columns:1fr; }
@media(max-width:768px) { .client-onboard-grid { grid-template-columns:1fr; } }

/* Description-list/card grid adapted from the committed Matter detail. */
.profile-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:1rem}.profile-grid dd{margin:0 0 1rem;overflow-wrap:anywhere}.profile-grid .label{font-weight:600;opacity:.8}
/* Component display rules must not reveal conditional alerts or controls. */
.tebfin-ui [hidden] { display:none !important; }

.tebfin-ui .filter-bar { display:flex; gap:.75rem; align-items:end; flex-wrap:wrap; margin-bottom:1rem; }
.tebfin-ui .filter-bar label { display:flex; flex-direction:column; gap:.3rem; }
.tebfin-ui [data-match-summary] { margin-top:.5rem; min-width:220px; }

.clickable-row {cursor:pointer;}
.clickable-row:focus-visible {outline:2px solid var(--primary-color, #008080);outline-offset:-2px;}
.choice-group {border:0;padding:0;margin:0;min-width:0;}
.choice-group legend {font-weight:600;margin-bottom:.65rem;}
.choice-group label {display:flex;align-items:flex-start;gap:.65rem;margin-bottom:.65rem;}
.choice-group input[type=checkbox] {flex:0 0 auto;margin-top:.2rem;width:auto;}
.contact-match-review .checkbox-row input[type=radio] { width:auto !important; flex:0 0 auto; margin:0; }
.contact-match-review summary.btn { display:inline-flex; width:auto; }
.contact-match-review details[open] > summary { margin-bottom:1rem; }
.contact-match-review .choice-group > .checkbox-row { margin-top:.75rem; }
.tebfin-ui .select2-container .select2-search__field {min-height:0;height:auto;}
/* Reused from Legal modal_base.html at 78a315d, scoped to Tebfin forms. */
.tebfin-ui .select2-container--default .select2-selection--multiple {
  background:var(--input-bg, #232323) !important;
  border:1px solid var(--border-color) !important;
  color:var(--text-color, #fff) !important;
}
.tebfin-ui .select2-container--default .select2-selection--multiple .select2-search__field {
  color:var(--text-color, #fff) !important;
  background:transparent !important;
}
.tebfin-ui .select2-container--default .select2-selection--multiple .select2-search__field::placeholder {
  color:var(--text-muted, #bdbdbd) !important;
}
.tebfin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background:rgba(255,255,255,.08) !important;
  color:var(--text-color, #fff) !important;
  border:1px solid var(--border-color) !important;
}
.tebfin-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  color:var(--text-muted, #bdbdbd) !important;
}
.tebfin-ui .data-table tr[data-href]:hover {cursor:pointer;}

.tebfin-brand-pair{display:flex;align-items:center;gap:14px;background:#fff;padding:3px 8px;border-radius:4px;flex-shrink:0}
.tebfin-brand-pair>img{object-fit:contain}.talisfin-logo{display:block;width:100px;height:40px;overflow:hidden}.talisfin-logo img{display:block;width:280px;max-width:none;height:auto}
@media(max-width:600px){.tebfin-ui .report-header{flex-wrap:wrap;gap:8px}.tebfin-brand-pair{gap:6px}.tebfin-brand-pair>img{width:68px;height:30px}.talisfin-logo{width:76px;height:30px}.talisfin-logo img{width:212px}}

/* Bank grid: preserve readable controls at desktop and mobile widths. */
.tebfin-ui .business-bank-allocation-table {min-width:1700px;table-layout:auto;}
.tebfin-ui .business-bank-allocation-table th,.tebfin-ui .business-bank-allocation-table td {vertical-align:top;}
.tebfin-ui .business-bank-allocation-table .btn {display:inline-flex;white-space:nowrap;word-break:normal;overflow-wrap:normal;margin-bottom:.5rem;}
.tebfin-ui .business-bank-allocation-table [data-deal-fields] {display:grid;gap:.5rem;min-width:270px;}
.tebfin-ui .business-bank-allocation-table [data-deal-fields] label {display:grid;gap:.35rem;}
.tebfin-ui .business-bank-allocation-table select {width:100%;min-height:38px;}
.tebfin-ui .business-bank-allocation-table select[multiple] {height:100px;min-width:270px;}
.tebfin-ui .business-bank-allocation-table .bank-support-input {width:240px;max-width:240px;}
.tebfin-ui .business-bank-allocation-table td:last-child {min-width:155px;}

/* A disclosure trigger should have the same compact size as its sibling action. */
.approval-reject { margin-top: .35rem; }
.approval-reject > summary.btn { display: inline-flex; align-items: center; gap: .4rem; width: auto; min-width: 0; }
.approval-reject > summary.btn::before { content: "▸"; }
.approval-reject[open] > summary.btn::before { content: "▾"; }
.approval-reject > form { margin-top: .5rem; }

/* Payment desk keeps instructions and evidence beside each recipient. */
.release-actions { margin-bottom: 1rem; align-items: center; }
.release-actions form { margin: 0; }
.release-rejection { max-width: 38rem; }
.release-evidence { margin-top: 1rem; }
.release-evidence td { vertical-align: top; }
.release-documents { margin: 0; padding-left: 1.1rem; }
.release-documents li { margin-bottom: .5rem; overflow-wrap: anywhere; }
.release-card .page-header { margin-bottom: .75rem; }

.tebfin-ui .linked-deal-filters label { flex-direction:row; align-items:center; }
.tebfin-ui .linked-deal-filters .helptext { flex-basis:100%; margin:0; }

.onboarding-email-body { overflow-wrap:anywhere; }

/* Native file selection keeps its accessible browser behavior and uses the system palette. */
.tebfin-ui input[type=file]:not(.file-picker__input) { height:auto; max-height:none; line-height:1.4; }
.tebfin-ui input[type=file]::file-selector-button { background:var(--btn-bg,#2563eb); color:var(--btn-text,#fff); border:1px solid transparent; border-radius:8px; padding:.55rem .8rem; margin-right:.75rem; font:inherit; font-weight:600; cursor:pointer; }
.tebfin-ui input[type=file]::file-selector-button:hover { filter:brightness(1.12); }
.tebfin-ui button:disabled { opacity:.55; cursor:not-allowed; }
#signature-canvas { display:block; max-width:100%; width:600px; height:auto; aspect-ratio:3/1; background:#fff; border:2px solid var(--border-color,#777); border-radius:8px; touch-action:none; }
#consent-signing [hidden] { display:none; }
#consent-signing fieldset { margin-bottom:1rem; border:1px solid var(--border-color,#555); border-radius:8px; }
#consent-signing input[type=radio] { margin-right:.5rem; }

/* Card/action layout reused from templates/importer/dashboard.html. */
.tebfin-import-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr)); gap:1rem; align-items:stretch; }
.tebfin-import-grid .import-card { display:flex; flex-direction:column; min-height:320px; padding:1.25rem; }
.tebfin-import-grid .import-card h2 { margin-top:0; margin-bottom:.75rem; line-height:1.25; }
.tebfin-import-grid .import-card p { margin-top:0; }
.tebfin-import-grid .import-actions { margin-top:auto; display:grid; gap:.5rem; }
.tebfin-import-grid .import-actions .btn { width:100%; box-sizing:border-box; text-align:center; white-space:normal; line-height:1.25; min-height:42px; display:inline-flex; align-items:center; justify-content:center; }

/* Batch review keeps the inherited table and buttons usable at narrow widths. */
.import-batch-approval .button-row { display:flex; flex-wrap:wrap; gap:.75rem; }
.import-batch-approval textarea { width:100%; box-sizing:border-box; margin:.5rem 0; }
.import-batch-approval .data-table td { vertical-align:top; }

/* Statement filters keep labels above controls at both desktop and panel widths. */
.statement-filter-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:1rem;align-items:start}
.statement-filter-field{min-width:0}
.statement-filter-field label{display:block;margin-bottom:.4rem}
.statement-filter-field select,.statement-filter-field input{width:100%;box-sizing:border-box}
.statement-filter-note,.statement-filter-actions,.statement-filter-form>.errorlist{grid-column:1/-1}
.statement-filter-note{margin:0;opacity:.85}

/* Consistent controls on links, buttons and expandable actions. */
.tebfin-ui .btn, .tebfin-ui a.btn, .tebfin-ui button.btn, .tebfin-ui summary.btn {
 display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;
 font-family:inherit;font-size:.95rem;font-weight:600;line-height:1.25;
 padding:.6rem .9rem;min-height:2.6rem;vertical-align:middle;text-decoration:none;
}
.tebfin-ui .approval-reject > summary.btn { min-width:6.5rem;position:relative;padding-inline:1.3rem;list-style:none; }
.tebfin-ui .approval-reject > summary.btn::before {position:absolute;left:.45rem;font-size:.7em;}
.tebfin-ui .approval-reject > summary::-webkit-details-marker {display:none;}
.tebfin-ui .approval-controls > form > .btn {min-width:6.5rem;}
.tebfin-ui .page-header .tebfin-actions {flex-wrap:wrap;gap:.5rem;}
.tebfin-ui .choice-group input[type=checkbox] {width:1rem;height:1rem;accent-color:#3563eb;}
.tebfin-ui [hidden] {display:none !important;}
.tebfin-ui .note-entry {border-bottom:1px solid #555;padding:.75rem 0;}
