.brand-row { display:flex; flex-direction:column; gap:18px; align-items:flex-start; }
.install-button { font-size:11px; }
#bank-accounts-list { margin-top:20px; }
#reconciliation-results table { font-size:11px; }
#reconciliation-results td { max-width:280px; white-space:normal; overflow-wrap:anywhere; }
.bank-annual { padding:16px 0; border-bottom:1px solid var(--border); }
#category-management { width:calc(100% - 32px); max-width:560px; max-height:85dvh; overflow:auto; }
#category-list { align-items:stretch; }
#category-list button { min-height:44px; white-space:normal; }
#operations-totals { padding:18px; margin:16px 0; border:1px solid var(--border); border-radius:10px; background:var(--light); }
.operation-total-values { display:flex; flex-wrap:wrap; gap:16px 30px; margin:12px 0; }
.operation-total-values>div { display:flex; flex-direction:column; gap:8px; }
#operations-totals small { display:block; color:var(--muted); line-height:1.6; }
.holder-filter-label { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:12px; max-width:100%; }
.holder-filter-label select { max-width:100%; min-height:44px; }
@media(max-width:720px) { .holder-filter-label { width:100%; flex-wrap:wrap; } .holder-filter-label select { width:100%; } }
@media(min-width:721px) {
  .sidebar { overflow-y:auto; overflow-x:hidden; overscroll-behavior-y:contain; scrollbar-width:thin; }
  .sidebar>*,.sidebar nav { flex-shrink:0; }
}
.stat-link { display:block; width:100%; text-align:left; color:var(--ink); transition:transform .15s,box-shadow .15s; }
.stat-link:hover { transform:translateY(-2px); box-shadow:0 6px 20px #20365315; }
.stat-link:active { transform:translateY(0); }
@media(prefers-reduced-motion:reduce) { .stat-link { transition:none; } .stat-link:hover { transform:none; } }
.rule-filter-label { display:flex; flex-direction:column; gap:8px; margin:18px 0; }
.rule-filter-label input { width:100%; min-height:48px; font-size:16px; }
#categorization-preview { width:calc(100% - 32px); max-width:1050px; max-height:85dvh; overflow:auto; }
#rescan-results { margin:18px 0; }
#rescan-results input { width:22px; height:22px; min-height:22px; }
#rescan-results table { table-layout:fixed; white-space:normal; font-size:11px; }
#rescan-results th,#rescan-results td { padding:9px 6px; vertical-align:top; overflow-wrap:anywhere; }
#rescan-results th { font-size:9px; letter-spacing:.2px; }
#rescan-results th:nth-child(1) { width:6%; }
#rescan-results th:nth-child(2) { width:10%; }
#rescan-results th:nth-child(3) { width:26%; }
#rescan-results th:nth-child(4) { width:12%; }
#rescan-results th:nth-child(5) { width:16%; }
#rescan-results th:nth-child(6),#rescan-results th:nth-child(7) { width:15%; }
#categorization-preview #confirm-categorization { position:sticky; bottom:0; margin-top:10px; }
@media(max-width:700px) {
  #categorization-preview { padding:16px; width:calc(100% - 16px); max-height:94dvh; }
  #categorization-preview>p { font-size:12px; }
  #rescan-results table,#rescan-results tbody { display:block; }
  #rescan-results thead { display:none; }
  #rescan-results tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 12px; border:1px solid var(--border); border-radius:8px; margin-bottom:12px; padding:10px; }
  #rescan-results td { display:block; width:auto; border:0; padding:4px 0; font-size:12px; }
  #rescan-results td::before { content:attr(data-label); display:block; font-size:10px; color:var(--muted); margin-bottom:4px; }
  #rescan-results td:nth-child(3),#rescan-results td:nth-child(5) { grid-column:1/-1; }
  #categorization-preview #confirm-categorization { width:100%; }
}
.month-stepper { display:inline-flex; align-items:center; gap:6px; min-width:0; max-width:100%; }
.month-stepper:has(input[hidden]) { display:none; }
.month-stepper .month-step { flex:0 0 44px; min-width:44px; min-height:44px; padding:4px; font-size:25px; line-height:1; }
.month-stepper input[type="month"] { min-width:0; width:150px; flex:1; }
.annual-categories { display:flex; flex-wrap:wrap; gap:10px 18px; margin:12px 0 20px; }
.annual-categories label { display:flex; align-items:center; gap:7px; font-size:12px; min-height:44px; cursor:pointer; }
.annual-categories input { width:18px; height:18px; min-height:18px; accent-color:var(--blue); }
.annual-chart { width:100%; overflow-x:auto; }
.annual-chart>svg { display:block; width:100%; min-width:650px; }
#annual-table { margin-top:18px; }
#annual-table caption { text-align:left; margin-bottom:14px; color:var(--muted); }
.coverage-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:10px; margin:16px 0; }
.coverage-month { display:flex; flex-direction:column; gap:8px; padding:15px; border:1px solid var(--border); border-radius:9px; font-size:12px; }
.coverage-month.present { background:#e8f5ee; color:#25634c; border-color:#c2e3d3; }
.coverage-month.missing { background:#fff3e5; color:#865321; border-color:#eed4b4; }
.document-month-label { display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:12px; font-size:12px; }
.document-month-label input { width:170px; min-height:44px; }
#category-menu { width:calc(100% - 32px); max-width:480px; max-height:85dvh; overflow:auto; }
#category-menu-label { overflow-wrap:anywhere; }
.category-menu-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.category-menu-options button { min-height:44px; white-space:normal; overflow-wrap:anywhere; }
#review-list [data-quick-category] { margin-right:12px; }
.category-drilldown { display:block; width:100%; border:0; background:transparent; color:inherit; text-align:left; padding:10px 8px; border-radius:8px; margin:8px 0; min-height:56px; }
.category-drilldown:hover { background:var(--light); }
.category-drilldown progress { display:block; }
#category-detail { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; }
.import-error { border-color:#e7b8b2; color:#8c362f; background:#fff0ee; }
.month-label { flex-wrap:wrap; }
.month-label select { font-size:13px; min-height:44px; max-width:100%; }
.workspace { width:100%; background:transparent; border-left:0; border-right:0; text-align:left; color:inherit; }
.household-link { border:0; background:transparent; padding:10px 0; color:var(--blue); font:inherit; min-height:44px; }
.household-link:hover { text-decoration:underline; }
#install-dialog { max-width:490px; width:calc(100% - 32px); }
#install-dialog p { overflow-wrap:anywhere; }
@media(max-width:720px) {
  body { padding-left:env(safe-area-inset-left); padding-right:env(safe-area-inset-right); }
  .sidebar { padding-top:max(16px, env(safe-area-inset-top)); }
  .brand-row { flex-direction:row; align-items:center; justify-content:space-between; gap:10px; }
  .install-button { min-height:44px; padding:8px 10px; }
  main { min-width:0; }
  .content { padding-bottom:max(24px, env(safe-area-inset-bottom)); }
  .panel,.dashboard-grid,.stats,.settings-panel { min-width:0; }
  .month-label { width:100%; }
  .month-label input { font-size:16px; flex:1; min-width:140px; }
  .month-label select { font-size:16px; flex:1; min-width:140px; }
  .nav { min-height:44px; }
  input,select,textarea { font-size:16px; max-width:100%; min-height:44px; }
  .form-grid { grid-template-columns:1fr; }
  .form-grid .full { grid-column:auto; }
  .upload-form { align-items:stretch; }
  .upload-form label { min-width:0; width:100%; }
  .panel-heading { flex-wrap:wrap; }
  .topbar>span { min-width:0; overflow-wrap:anywhere; }
  .document-row>.actions { width:100%; }
  dialog { max-height:calc(100dvh - 32px); overflow-y:auto; }
  .primary,.secondary,.quiet { min-height:44px; }
}
@media(max-width:380px) {
  .brand { font-size:19px; gap:6px; }
  .install-button { font-size:10px; }
}
#pdf-dropzone { border:2px dashed var(--accent, #3974c5); border-radius:14px; padding:24px; text-align:center; cursor:pointer; margin:16px 0; background:rgba(57,116,197,.05); }
#pdf-dropzone.dragging, #pdf-dropzone:focus-visible { background:rgba(57,116,197,.15); outline:2px solid #3974c5; }
.import-issues pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:12px; padding:12px; background:rgba(57,116,197,.06); }
#import-inbox-list .panel, #savings-results .panel { margin-top:16px; }
#import-inbox-list h2 { overflow-wrap:anywhere; }
.correction-row { min-width:0; margin:16px 0; padding:14px; border:1px solid #b6c8df; border-radius:10px; }
.correction-row legend { max-width:100%; white-space:normal; overflow-wrap:anywhere; font-weight:600; }
.correction-row label { min-width:0; }
.correction-row input, .correction-row select { width:100%; min-width:0; }
.nav[data-view="importerrors"] b { display:inline-block; }
.partial-import-choice { flex-basis:100% !important; flex-direction:row; align-items:flex-start; line-height:1.6; } .partial-import-choice input { width:auto; flex-shrink:0; }
.operation-table .holder-cell { width:120px; min-width:90px; max-width:120px; white-space:normal; overflow-wrap:anywhere; }
.operation-table .amount { min-width:100px; white-space:nowrap; font-variant-numeric:tabular-nums; }
#holder-filter { width:200px; text-overflow:ellipsis; }
@media(max-width:720px) { #holder-label { width:auto; max-width:100%; } #holder-filter { width:180px; max-width:100%; } }
.operations-scrollbar { width:100%; max-width:100%; height:20px; overflow-x:scroll; overflow-y:hidden; margin:8px 0; scrollbar-color:#6a8ab7 #e8eff8; scrollbar-width:auto; }
.operations-scrollbar>div { height:1px; }
.operations-scrollbar::-webkit-scrollbar, #operations-list::-webkit-scrollbar { height:14px; }
.operations-scrollbar::-webkit-scrollbar-track, #operations-list::-webkit-scrollbar-track { background:#e8eff8; border-radius:8px; }
.operations-scrollbar::-webkit-scrollbar-thumb, #operations-list::-webkit-scrollbar-thumb { background:#6a8ab7; border:3px solid #e8eff8; border-radius:8px; }
#operations-list { max-width:100%; overflow-x:auto; scrollbar-gutter:stable; }
.operation-table .holder-cell { width:75px; min-width:60px; max-width:80px; text-align:center; }
.holder-icon { display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; font-size:24px; line-height:1; border-radius:50%; background:rgba(57,116,197,.08); cursor:help; }
.holder-icon:focus-visible { outline:2px solid #3974c5; outline-offset:2px; }
.holder-profiles-list { display:flex; flex-wrap:wrap; gap:8px; }
.holder-profile-choice span { font-size:21px; vertical-align:middle; }
#holder-profile-form select[name="icon"] { font-size:24px; min-width:80px; }
.holder-profile-choice { max-width:100%; white-space:normal; overflow-wrap:anywhere; text-align:left; }
.operation-table .category-action { position:sticky; right:0; background:var(--paper,#fff); box-shadow:-4px 0 7px rgba(35,65,105,.08); } #review-list [data-quick-category] { margin-right:0; }
.category-remember { display:flex; align-items:center; gap:10px; margin:16px 0; }
.category-remember input { width:20px; height:20px; flex-shrink:0; }
#category-rule-settings[hidden] { display:none; }
@media (max-width:720px) {
  #review-list { overflow:visible; }
  #review-list .operation-table,
  #review-list .operation-table tbody { display:block; width:100%; min-width:0; white-space:normal; }
  #review-list .operation-table thead { display:none; }
  #review-list .operation-table tr { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px 12px; padding:16px 0; border-bottom:1px solid var(--border); }
  #review-list .operation-table td { display:block; width:auto; min-width:0; max-width:none; border:0; padding:0; white-space:normal; overflow-wrap:anywhere; }
  #review-list .operation-table td.label-cell { grid-column:1/-1; overflow:visible; text-overflow:clip; font-size:14px; line-height:1.5; }
  #review-list .operation-table td:nth-child(1) { align-self:center; }
  #review-list .operation-table td.amount { white-space:nowrap; font-size:16px; }
  #review-list .operation-table td:nth-child(4)::before { content:'Titulaire'; }
  #review-list .operation-table td:nth-child(5)::before { content:'Catégorie'; }
  #review-list .operation-table td:nth-child(6)::before { content:'État'; }
  #review-list .operation-table td:nth-child(7)::before { content:'Ajouté par'; }
  #review-list .operation-table td:nth-child(n+4):nth-child(-n+7)::before { display:block; color:var(--muted); font-size:10px; margin-bottom:5px; }
  #review-list .operation-table td.category-action { grid-column:1/-1; position:static; background:transparent; box-shadow:none; }
  #review-list [data-quick-category] { width:100%; min-height:44px; margin:4px 0 0; }
}
#quick-category-create { margin:16px 0; padding:12px 0; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
#quick-category-create summary { min-height:36px; }
#quick-category-form { display:grid; gap:12px; margin-top:12px; }
#quick-category-feedback { font-size:12px; overflow-wrap:anywhere; }
.category-choice-section { margin-top:20px; padding-top:16px; border-top:1px solid var(--border); }
.category-choice-section h3 { font-size:13px; margin:0 0 12px; }
.operation-filters { display:flex; flex-wrap:wrap; align-items:flex-end; gap:16px; margin-bottom:22px; }
.operation-filters .search-label { flex:1 1 250px; max-width:none; margin:0; }
.operation-filters #operation-category-label { flex:1 1 220px; min-width:0; }
.operation-filters select { width:100%; min-height:44px; }
.operation-filters .operation-display-label { flex:1 1 270px; min-width:0; max-width:100%; }
.operation-display-label select { text-overflow:ellipsis; }
#back-to-dashboard { margin-bottom:18px; white-space:normal; }
#distribution-income { border-bottom:1px solid var(--border); margin-bottom:22px; }
.income-row { background:rgba(53,154,108,.08); padding:14px; border-radius:8px; }
#view-distribution .category-row>div { gap:12px; flex-wrap:wrap; }
#view-distribution h3 { font-size:14px; }
.category-total-caption { display:block; color:var(--muted); font-size:10px; font-weight:400; margin-bottom:4px; }
#distribution-total { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
#distribution-total>div { font-size:20px; font-weight:600; margin-left:auto; text-align:right; }
#distribution-expenses .category-drilldown strong { margin-left:auto; text-align:right; }
tr[data-transfer-detail] { cursor:pointer; }
tr[data-transfer-detail]:hover, tr[data-transfer-detail]:focus-visible { background:rgba(57,116,197,.08); }
.transfer-detail-label { white-space:normal; min-width:180px; max-width:350px; overflow-wrap:anywhere; }
.coverage-group-title { grid-column:1/-1; font-size:14px; margin:16px 0 4px; }
.balance-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:20px 0; }
.balance-stat { border:1px solid var(--border); border-radius:10px; padding:18px; background:rgba(57,116,197,.04); }
.balance-stat span { display:block; font-size:12px; color:var(--muted); margin-bottom:10px; }
.balance-stat strong { font-size:24px; overflow-wrap:anywhere; }
.balance-stat.income,.balance-stat.positive { background:rgba(37,132,102,.07); }
.balance-stat.negative { background:rgba(170,65,65,.06); }
.balance-legend { display:flex; flex-wrap:wrap; gap:20px; font-size:12px; margin:24px 0 10px; }
.balance-legend span { display:flex; align-items:center; gap:8px; }
.balance-legend i { width:12px; height:12px; border-radius:3px; }
.balance-legend .income { background:#258466; }
.balance-legend .expenses { background:#3974c5; }
.balance-chart { width:100%; overflow-x:auto; }
.balance-chart svg { display:block; width:100%; min-width:720px; font-size:11px; fill:var(--muted); }
.balance-positive { color:#247b65; }
.balance-negative { color:#a33d3d; }
#balance-months caption { text-align:left; font-weight:600; padding:16px 0; }
#balance-months tbody th { text-transform:none; color:var(--ink); letter-spacing:normal; padding:17px 10px; }
#balance-months tfoot { background:rgba(57,116,197,.07); font-weight:600; }
@media(max-width:720px) { .balance-stats { grid-template-columns:1fr; } .balance-stat { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; } .balance-stat span { margin:0; } .balance-stat strong { font-size:22px; } }
.operation-net { display:inline-block; padding:4px 8px; border-radius:5px; font-size:14px; }
.operation-net.balance-positive { background:rgba(37,132,102,.10); }
.operation-net.balance-negative { background:rgba(163,61,61,.09); }
