/* =====================================================================
   Je gère mes biens · Améliorations v2 (à charger après refonte.css)
   1. Revenir avec plaisir  2. Structure  3. Lisibilité  4. Détails
   ===================================================================== */

html body[data-design] {
  font-family: var(--font-sans);
  font-feature-settings: "cv11", "ss01";
}
html body[data-design] .ui_icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html body[data-design] .ui_icon.is-filled { fill: currentColor; stroke: none; }

/* ---------- 2. Barre du haut : patrimoine, recherche, échéances ---------- */
html body[data-design] .topbar_component { gap: 16px; }
html body[data-design] .topbar_left,
html body[data-design] .topbar_right { display: flex; align-items: center; gap: 10px; min-width: 0; }
html body[data-design] .topbar_right { gap: 6px; }
html body[data-design] .topbar_left > strong { font-size: var(--fs-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body[data-design] .topbar_entity {
  position: relative; display: flex; align-items: center; height: 38px; padding: 0 10px; gap: 8px;
  border-radius: var(--r-md); color: var(--c-muted); transition: background-color .15s ease;
}
html body[data-design] .topbar_entity:hover { background: var(--c-surface); }
html body[data-design] .topbar_entity select,
html body[data-design] main .topbar_entity select,
html body[data-design] .topbar_entity select:focus {
  width: auto; field-sizing: content; max-width: 320px; appearance: none; -webkit-appearance: none; min-height: 0; height: 38px; margin: 0 -28px 0 -36px; padding: 0 28px 0 36px;
  border: 0; background: transparent; box-shadow: none; font-size: var(--fs-body); font-weight: 600; color: var(--c-ink); cursor: pointer;
}
html body[data-design] .topbar_entity:focus-within { outline: 3px solid var(--c-focus); outline-offset: 0; }
html body[data-design] .topbar_entity .ui_icon:last-child { pointer-events: none; width: 16px; }
/* Le sélecteur est désormais dans la barre : les blocs par page disparaissent. */
html body[data-design] .entity-filter_component { display: none; }

html body[data-design] .topbar_search {
  display: flex; align-items: center; gap: 10px; width: 300px; height: 38px; padding: 0 8px 0 12px; margin-right: 8px;
  border: 1px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); color: var(--c-muted);
  font: inherit; font-size: var(--fs-body-sm); text-align: left; cursor: pointer; transition: border-color .15s ease;
}
html body[data-design] .topbar_search:hover { border-color: var(--c-field); }
html body[data-design] .topbar_search-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html body[data-design] kbd {
  font: 600 12px/1 inherit; padding: 4px 6px; border-radius: var(--r-xs); background: var(--c-track); color: var(--c-muted); border: 0;
}
html body[data-design] .topbar_bell { position: relative; }
html body[data-design] .topbar_badge {
  position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--c-danger); color: #fff; font-size: var(--fs-caption); font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--c-bg);
}
html body[data-design][data-theme=dark] .topbar_badge { color: #0E1B21; }

/* Recherche (⌘K) */
html body[data-design] .search_dialog {
  width: min(560px, calc(100vw - 32px)); margin: 12vh auto auto; padding: 8px; border: 0; border-radius: var(--r-lg);
  background: var(--c-surface); color: var(--c-text); box-shadow: var(--sh-pop);
}
html body[data-design] .search_dialog::backdrop { background: rgba(18,62,75,.28); backdrop-filter: blur(2px); }
html body[data-design] .search_box { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; border-bottom: 1px solid var(--c-line); color: var(--c-muted); }
html body[data-design] .search_box input[type=search],
html body[data-design] .search_box input[type=search]:focus { flex: 1; border: 0; box-shadow: none; padding: 6px 0; font-size: var(--fs-lead); background: transparent; }
html body[data-design] .search_group { padding: 8px 4px 4px; }
html body[data-design] .search_group p { margin: 4px 8px 6px; font-size: var(--fs-caption); font-weight: 600; color: var(--c-muted); }
html body[data-design] .search_group a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: var(--r-md); color: var(--c-ink); font-size: var(--fs-body); text-decoration: none; }
html body[data-design] .search_group a .nav_icon, html body[data-design] .search_group a .ui_icon { width: 18px; height: 18px; color: var(--c-muted); }
html body[data-design] .search_group a small { margin-left: auto; font-size: var(--fs-small); color: var(--c-muted); }
html body[data-design] .search_group a:hover, html body[data-design] .search_group a:focus-visible { background: var(--c-brand-soft); color: var(--c-brand-deep); outline: none; }

/* Encart d'essai réduit à une ligne */
html body[data-design] .trial_line {
  display: flex; align-items: center; gap: 10px; margin: 0 0 8px; padding: 10px 12px; border-radius: var(--r-md);
  background: var(--c-brand-softer); color: var(--c-text); font-size: var(--fs-small); text-decoration: none;
}
html body[data-design] .trial_line strong { color: var(--c-ink); font-weight: 600; }
html body[data-design] .trial_line > span { flex: 1; }
html body[data-design] .trial_line .ui_icon { width: 16px; height: 16px; color: var(--c-brand); }
html body[data-design] .trial_line .ui_icon:last-child { color: var(--c-muted); }
html body[data-design] .trial_line:hover { background: var(--c-brand-soft); color: var(--c-ink); }
html body[data-design] .user_component a { display: inline-grid; place-items: center; }

/* ---------- 1. Bien démarrer ---------- */
html body[data-design] .onboard_component { padding: 24px; margin: 0 0 16px; }
html body[data-design] .onboard_head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 14px; }
html body[data-design] .onboard_head h2 { margin: 0 0 4px; }
html body[data-design] .onboard_head p { margin: 0; font-size: var(--fs-body-sm); color: var(--c-muted); }
html body[data-design] .onboard_count { flex: none; font-size: var(--fs-body-sm); font-weight: 600; color: var(--c-brand); font-variant-numeric: tabular-nums; }
html body[data-design] .progress_track { height: 6px; border-radius: var(--r-pill); background: var(--c-track); overflow: hidden; }
html body[data-design] .progress_track > span { display: block; height: 100%; min-width: 0; border-radius: inherit; background: var(--c-brand-bright); transition: width .4s ease; }
html body[data-design] .progress_track.is-warning > span { background: var(--c-warning); }
html body[data-design] .onboard_steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
html body[data-design] .onboard_steps li {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; border-radius: var(--r-md);
  background: var(--c-bg); min-height: 100%;
}
html body[data-design] .onboard_steps li > div { flex: 1; }
html body[data-design] .onboard_steps strong { display: block; font-size: var(--fs-body); font-weight: 600; color: var(--c-ink); }
html body[data-design] .onboard_steps small { display: block; margin-top: 2px; font-size: var(--fs-small); line-height: 1.45; color: var(--c-muted); }
html body[data-design] .step_mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill);
  background: var(--c-surface); color: var(--c-muted); font-size: var(--fs-small); font-weight: 650; box-shadow: inset 0 0 0 1.5px var(--c-field);
}
html body[data-design] .onboard_steps .is-done .step_mark { background: var(--c-brand); color: #fff; box-shadow: none; }
html body[data-design][data-theme=dark] .onboard_steps .is-done .step_mark { color: #0E1B21; }
html body[data-design] .onboard_steps .is-done .step_mark .ui_icon { width: 16px; height: 16px; stroke-width: 2.4; }
html body[data-design] .onboard_steps .is-done strong { color: var(--c-muted); font-weight: 500; text-decoration: line-through; text-decoration-color: var(--c-field); }
html body[data-design] .onboard_steps .is-next { background: var(--c-brand-soft); }
html body[data-design] .onboard_steps .is-next .step_mark { background: var(--c-brand); color: #fff; box-shadow: none; }
html body[data-design][data-theme=dark] .onboard_steps .is-next .step_mark { color: #0E1B21; }
html body[data-design][data-theme=dark] .onboard_steps li { background: var(--c-track); }
html body[data-design][data-theme=dark] .onboard_steps .is-next { background: var(--c-brand-soft); }

/* Où vous en êtes : progression des tâches */
html body[data-design] .progress_item { display: block; padding: 16px 0; border-top: 1px solid var(--c-line); color: inherit; text-decoration: none; }
html body[data-design] .summary_section-heading + .progress_item { border-top: 0; padding-top: 4px; }
html body[data-design] .progress_item-top { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
html body[data-design] .progress_item-top strong { font-size: var(--fs-body); font-weight: 600; color: var(--c-ink); }
html body[data-design] .progress_item-value { font-size: var(--fs-body-sm); font-weight: 600; color: var(--c-brand); font-variant-numeric: tabular-nums; white-space: nowrap; }
html body[data-design] .progress_item-value.is-warning { color: var(--c-warning); }
html body[data-design] .progress_item-value.is-muted { color: var(--c-muted); font-weight: 500; }
html body[data-design] .progress_item small { display: block; margin-top: 8px; font-size: var(--fs-small); color: var(--c-muted); }
html body[data-design] .progress_item:hover strong { color: var(--c-brand); }

/* ---------- 3. Graphique vide : barres fantômes ---------- */
html body[data-design] .chart_ghost { position: relative; margin-top: 20px; }
html body[data-design] .summary_chart.is-empty { display: grid; }
html body[data-design] .summary_bar.is-ghost,
html body[data-design] .summary_bar.is-ghost.is-muted { fill: var(--c-track); }
html body[data-design] .summary_bar.is-ghost:not(.is-muted) { fill: color-mix(in srgb, var(--c-track) 60%, var(--c-line)); }
html body[data-design] .chart_ghost .summary_chart-empty {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(340px, 90%); margin: 0;
  padding: 14px 18px; text-align: center; background: var(--c-surface); border-radius: var(--r-md); box-shadow: var(--sh-pop);
  font-size: var(--fs-small); line-height: 1.45; color: var(--c-muted);
}
html body[data-design] .chart_ghost .summary_chart-empty strong { display: block; margin-bottom: 2px; font-size: var(--fs-body-sm); color: var(--c-ink); }
html body[data-design][data-theme=dark] .chart_ghost .summary_chart-empty { background: var(--c-track); }

/* ---------- 1. Message de confirmation ---------- */
html body[data-design] .toast_component {
  position: fixed; left: 50%; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px 10px 10px 14px; border-radius: var(--r-md);
  background: var(--c-ink); color: #fff; box-shadow: var(--sh-pop); font-size: var(--fs-body-sm);
  transform: translate(-50%, 12px); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
html body[data-design] .toast_component.is-visible { transform: translate(-50%, 0); opacity: 1; }
html body[data-design] .toast_icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-pill); background: #5CC6E4; color: #0E1B21; }
html body[data-design] .toast_icon .ui_icon { width: 14px; height: 14px; stroke-width: 2.6; }
html body[data-design] .toast_text { flex: 1; }
html body[data-design] .toast_action { color: #9BDDEF; font-weight: 600; text-decoration: none; padding: 4px 6px; }
html body[data-design] .toast_action:hover { color: #fff; }
html body[data-design] .toast_close { display: grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: var(--r-sm); background: transparent; color: #A9BCC2; cursor: pointer; }
html body[data-design] .toast_close:hover { background: rgba(255,255,255,.1); color: #fff; }
html body[data-design][data-theme=dark] .toast_component { background: #E6F0F2; color: #0E1B21; }
html body[data-design][data-theme=dark] .toast_icon { background: #007398; color: #fff; }
html body[data-design][data-theme=dark] .toast_action { color: #005A75; }
html body[data-design][data-theme=dark] .toast_close { color: #5B6F76; }

/* ---------- 1. Façades des biens ---------- */
html body[data-design] .portfolio_avatar.is-property {
  width: 64px; height: 48px; flex: none; border-radius: var(--r-md); font-size: 0; color: transparent;
  background: var(--c-brand-soft) var(--facade, none) center / cover no-repeat;
}
/*FACADES*/
html body[data-design] .portfolio_table tbody tr:nth-child(4n+1) .portfolio_avatar.is-property, html body[data-design] .facade-1 { --facade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Crect width='64' height='48' fill='%23E7F8FC'/%3E%3Crect y='42' width='64' height='6' fill='%23D5E3D2'/%3E%3Crect x='16' y='8' width='32' height='36' rx='1.5' fill='%23F1E6D6'/%3E%3Crect x='14' y='6' width='36' height='4' rx='1' fill='%235B6F76'/%3E%3Crect x='20' y='14' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='29' y='14' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='38' y='14' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='20' y='25' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='29' y='25' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='38' y='25' width='6' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='28' y='35' width='8' height='9' rx='1' fill='%23123E4B'/%3E%3C/svg%3E"); }
html body[data-design] .portfolio_table tbody tr:nth-child(4n+2) .portfolio_avatar.is-property, html body[data-design] .facade-2 { --facade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Crect width='64' height='48' fill='%23F0FAFF'/%3E%3Crect y='42' width='64' height='6' fill='%23D5E3D2'/%3E%3Cpath d='M14 24 32 9l18 15v20H14Z' fill='%23FFFFFF'/%3E%3Cpath d='M11 25 32 7l21 18' fill='none' stroke='%23123E4B' stroke-width='3' stroke-linejoin='round'/%3E%3Crect x='19' y='28' width='7' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='38' y='28' width='7' height='7' rx='1' fill='%239FD3E3'/%3E%3Crect x='28' y='31' width='8' height='13' rx='1' fill='%23007398'/%3E%3Crect x='40' y='10' width='4' height='8' fill='%23123E4B'/%3E%3C/svg%3E"); }
html body[data-design] .portfolio_table tbody tr:nth-child(4n+3) .portfolio_avatar.is-property, html body[data-design] .facade-3 { --facade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Crect width='64' height='48' fill='%23E7F8FC'/%3E%3Crect y='42' width='64' height='6' fill='%23D5E3D2'/%3E%3Crect x='12' y='16' width='40' height='28' fill='%23DCD3C4'/%3E%3Cpath d='M10 17 18 8h28l8 9Z' fill='%233E5862'/%3E%3Crect x='17' y='21' width='7' height='8' rx='1' fill='%23BFE6F1'/%3E%3Crect x='28.5' y='21' width='7' height='8' rx='1' fill='%23BFE6F1'/%3E%3Crect x='40' y='21' width='7' height='8' rx='1' fill='%23BFE6F1'/%3E%3Crect x='17' y='33' width='7' height='8' rx='1' fill='%23BFE6F1'/%3E%3Crect x='29' y='32' width='7' height='12' rx='3.5' fill='%23123E4B'/%3E%3Crect x='40' y='33' width='7' height='8' rx='1' fill='%23BFE6F1'/%3E%3C/svg%3E"); }
html body[data-design] .portfolio_table tbody tr:nth-child(4n+4) .portfolio_avatar.is-property, html body[data-design] .facade-4 { --facade: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 48'%3E%3Crect width='64' height='48' fill='%23F0FAFF'/%3E%3Crect y='42' width='64' height='6' fill='%23D5E3D2'/%3E%3Cpath d='M8 28 24 16l16 12v16H8Z' fill='%23F4EEE4'/%3E%3Cpath d='M6 29 24 14l18 15' fill='none' stroke='%238C5A3C' stroke-width='3' stroke-linejoin='round'/%3E%3Crect x='13' y='31' width='7' height='6' rx='1' fill='%239FD3E3'/%3E%3Crect x='26' y='32' width='7' height='12' rx='1' fill='%23007398'/%3E%3Crect x='50' y='32' width='2.5' height='12' fill='%237A5A40'/%3E%3Ccircle cx='51' cy='26' r='8' fill='%238FBF9A'/%3E%3C/svg%3E"); }

/* ---------- 3. Statuts, montants, boutons ---------- */
html body[data-design] .portfolio_status.is-vacant { background: var(--c-warning-bg); color: var(--c-warning); white-space: nowrap; }
html body[data-design] .text-numeric { font-variant-numeric: tabular-nums; }
html body[data-design] .portfolio_table td:has(> .text-numeric),
html body[data-design] .portfolio_table td:has(> strong.text-numeric) { text-align: right; }
html body[data-design] .portfolio_table:has(td[data-label="Dépôt"]) th:nth-child(2),
html body[data-design] .portfolio_table:has(td[data-label="Dépôt"]) th:nth-child(3) { text-align: right; }
html body[data-design] .portfolio_table td[data-label="Loyer / charges"] small { text-align: right; }
html body[data-design] .portfolio_menu-trigger .ui_icon { width: 18px; height: 18px; }
html body[data-design] .text-link.has-icon { display: inline-flex; align-items: center; gap: 6px; padding: 8px 6px; font-size: var(--fs-body); text-decoration: none; }
html body[data-design] .accounting2_header-actions { display: flex; align-items: center; gap: 12px; }

/* Comptabilité : 4 onglets + Plus */
html body[data-design] .accounting2_tabs { display: flex; align-items: flex-end; overflow: visible; }
html body[data-design] .tabs_more { position: relative; }
html body[data-design] .tabs_more summary {
  display: flex; align-items: center; gap: 4px; padding: 10px 0 12px; list-style: none; cursor: pointer;
  font-size: var(--fs-body); font-weight: 500; color: var(--c-muted); border-bottom: 2px solid transparent; margin-bottom: -1px;
}
html body[data-design] .tabs_more summary::-webkit-details-marker { display: none; }
html body[data-design] .tabs_more summary .ui_icon { width: 16px; height: 16px; transition: transform .15s ease; }
html body[data-design] .tabs_more[open] summary { color: var(--c-ink); }
html body[data-design] .tabs_more[open] summary .ui_icon { color: var(--c-brand); }
html body[data-design] .tabs_more-menu {
  position: absolute; top: calc(100% + 6px); left: -8px; z-index: 30; display: grid; min-width: 200px; padding: 6px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--sh-pop);
}
html body[data-design] .accounting2_tabs .tabs_more-menu a { padding: 9px 12px; margin: 0; border: 0; border-radius: var(--r-sm); color: var(--c-ink); font-size: var(--fs-body); }
html body[data-design] .accounting2_tabs .tabs_more-menu a:hover { background: var(--c-brand-softer); }

html body[data-design] .accounting2_tabs .is-mobile-only { display: none; }
@media (max-width: 650px) {
  html body[data-design] .accounting2_tabs > .is-desktop-only { display: none; }
  html body[data-design] .accounting2_tabs .tabs_more-menu .is-mobile-only { display: block; }
}

/* Clôture : les étapes visibles */
html body[data-design] .closing_card { margin: 0 0 20px; padding: 20px; border-radius: var(--r-md); background: var(--c-bg); }
html body[data-design][data-theme=dark] .closing_card { background: var(--c-track); }
html body[data-design] .closing_card h2 { font-size: var(--fs-lead); }
html body[data-design] .closing_steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: s; }
html body[data-design] .closing_steps li {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--r-md); background: var(--c-surface);
  font-size: var(--fs-body-sm); font-weight: 500; color: var(--c-muted);
}
html body[data-design] .closing_steps li > span { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--c-field); font-size: var(--fs-caption); font-weight: 650; }
html body[data-design] .closing_steps .is-done { color: var(--c-ink); }
html body[data-design] .closing_steps .is-done .ui_icon { width: 18px; height: 18px; padding: 3px; border-radius: var(--r-pill); background: var(--c-success-bg); color: var(--c-success); stroke-width: 2.6; }
html body[data-design] .closing_steps .is-next { background: var(--c-brand-soft); color: var(--c-brand-deep); font-weight: 600; }
html body[data-design] .closing_steps .is-next > span { background: var(--c-brand); color: #fff; box-shadow: none; }
html body[data-design][data-theme=dark] .closing_steps .is-next > span { color: #0E1B21; }

/* ---------- 2. Barre d'onglets mobile ---------- */
html body[data-design] .tabbar_component { display: none; }
@media (max-width: 900px) {
  html body[data-design] .tabbar_component {
    position: fixed; inset: auto 0 0 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--c-surface) 92%, transparent); backdrop-filter: saturate(160%) blur(16px);
    border-top: 1px solid var(--c-line);
  }
  html body[data-design] .tabbar_component a,
  html body[data-design] .tabbar_component button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding: 6px 0 2px;
    border: 0; background: none; font: inherit; font-size: var(--fs-caption); font-weight: 550; color: var(--c-muted); text-decoration: none; cursor: pointer;
  }
  html body[data-design] .tabbar_component svg { width: 24px; height: 24px; }
  html body[data-design] .tabbar_component .nav_icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  html body[data-design] .tabbar_component .is-active { color: var(--c-brand); }
  html body[data-design] .main_component { padding-bottom: 96px; }
  html body[data-design] .footer_component { padding-bottom: 88px; }
  html body[data-design] .toast_component { bottom: calc(76px + env(safe-area-inset-bottom)); width: calc(100vw - 32px); }
  html body[data-design] .topbar_component .button.is-icon.menu_button { display: none !important; }
  html body[data-design] .topbar_search { width: 38px; padding: 0; margin: 0; justify-content: center; border-color: transparent; background: transparent; }
  html body[data-design] .topbar_search-label,
  html body[data-design] .topbar_search kbd,
  html body[data-design] .topbar_security,
  html body[data-design] .topbar_left .breadcrumb_separator,
  html body[data-design] .topbar_left > strong { display: none; }
  html body[data-design] .topbar_entity { padding-left: 0; }
  html body[data-design] .topbar_entity > .ui_icon:first-child { display: none; }
  html body[data-design] .topbar_entity select,
  html body[data-design] main .topbar_entity select,
  html body[data-design] .topbar_entity select:focus { margin-left: 0; padding-left: 0; max-width: 58vw; text-overflow: ellipsis; }
  html body[data-design] .onboard_steps { grid-template-columns: 1fr 1fr; }
}

/* ---------- 2. Mobile : onglets qui défilent, tableaux en cartes ---------- */
@media (max-width: 650px) {
  html body[data-design] .section-tabs_component {
    overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 82%, transparent); mask-image: linear-gradient(to right, #000 82%, transparent);
  }
  html body[data-design] .section-tabs_component::-webkit-scrollbar { display: none; }
  html body[data-design] .accounting2_tabs { gap: 20px; }
  html body[data-design] .tabs_more-menu { left: auto; right: 0; }
  html body[data-design] .onboard_steps { grid-template-columns: 1fr; }
  html body[data-design] .onboard_steps li { flex-direction: row; align-items: center; flex-wrap: wrap; }
  html body[data-design] .onboard_steps li > div { min-width: 60%; }
  html body[data-design] .onboard_steps .is-done small { display: none; }
  html body[data-design] .onboard_head { flex-direction: column; gap: 6px; }
  html body[data-design] .closing_steps { grid-template-columns: 1fr; }
  html body[data-design] .accounting2_component, html body[data-design] .accounting2_workspace { grid-template-columns: minmax(0, 1fr); }
  html body[data-design] .accounting2_header-actions { justify-content: space-between; flex-wrap: wrap; width: 100%; }
  html body[data-design] .accounting2_heading, html body[data-design] .accounting2_heading > *, html body[data-design] .accounting2_contextbar { min-width: 0; max-width: 100%; }

  html body[data-design] .portfolio_table,
  html body[data-design] .portfolio_table tbody { display: block; width: 100%; }
  html body[data-design] .portfolio_table thead { display: none; }
  html body[data-design] .portfolio_table tr {
    display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px; border-top: 1px solid var(--c-line);
  }
  html body[data-design] .portfolio_table tbody tr:first-child { border-top: 0; }
  html body[data-design] .portfolio_table td,
  html body[data-design] .portfolio_table tbody tr:hover td { display: block; padding: 0; border: 0; max-width: none; background: none; text-align: left; }
  html body[data-design] .portfolio_table td[data-label],
  html body[data-design] .portfolio_table td[data-label]:not(:first-child) { display: block; width: auto; min-width: 0; }
  html body[data-design] .portfolio_table td[data-label]:not(:first-child)::before { content: none; }
  html body[data-design] .portfolio_table tr { width: auto; }
  html body[data-design] .portfolio_table td:first-child { grid-column: 1 / -1; }
  html body[data-design] .portfolio_table td[data-label="Locataires"]:not(:first-child) { display: none; }
  html body[data-design] .portfolio_table td[data-label="État"],
  html body[data-design] .portfolio_table td[data-label="Période / état"] { justify-self: end; text-align: right; }
  html body[data-design] .portfolio_table td[data-label="Caractéristiques"] small { display: inline; }
  html body[data-design] .portfolio_table td[data-label="Caractéristiques"] small + small::before { content: " · "; }
  html body[data-design] .portfolio_table td[data-label="Caractéristiques"] > strong { display: inline; font-size: var(--fs-body-sm); }
  html body[data-design] .portfolio_table td[data-label="Caractéristiques"] > strong + small::before { content: " · "; }
  html body[data-design] .portfolio_table td[data-label="Loyer / charges"]:not(:first-child),
  html body[data-design] .portfolio_table td[data-label="Loyer / charges"]:not(:first-child) small { text-align: left; }
  html body[data-design] .portfolio_table td[data-label="Loyer / charges"] > strong { display: block; font-size: var(--fs-lead); }
  html body[data-design] .portfolio_table td[data-label="Dépôt"] { justify-self: end; align-self: start; }
  html body[data-design] .portfolio_table td[data-label="Période / état"]:not(:first-child) { grid-column: 1 / -1; justify-self: stretch; text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  html body[data-design] .portfolio_table td[data-label="Période / état"] small { display: inline; margin: 0; }
  html body[data-design] .portfolio_table td[data-label="Période / état"] .portfolio_status { margin-left: auto; }
  html body[data-design] .portfolio_table td[data-label="Loyer / charges"] small { display: inline; }
  html body[data-design] .portfolio_table td[data-label="Loyer / charges"] small + small::before { content: " · "; }
  html body[data-design] .portfolio_table td[data-label="Dépôt"]:not(:first-child)::before { content: "Dépôt "; color: var(--c-muted); font-size: var(--fs-small); }
  html body[data-design] .portfolio_table td[data-label="Actions"] { grid-column: 1 / -1; margin-top: 6px; }
  html body[data-design] .portfolio_table .portfolio_actions { display: flex; justify-content: space-between; align-items: center; }
  html body[data-design] .portfolio_table .portfolio_actions .button { flex: 1; margin-right: 8px; }
  html body[data-design] .portfolio_identity { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html body[data-design] .toast_component { transition: none; }
}

/* Correctifs d'affichage */
html body[data-design] .search_group .nav_icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
html body[data-design] .tabs_more summary .ui_icon { display: block; transform-origin: 50% 50%; }

/* Intégration Django : résultats dynamiques de la recherche (⌘K) */
html body[data-design] .search_results:empty { display: none; }
html body[data-design] .search_empty { margin: 12px 14px 4px; font-size: var(--fs-body-sm); color: var(--c-muted); }
html body[data-design] .topbar_entity noscript .button { margin-left: 8px; }

/* Largeurs des barres de progression : la CSP interdit les attributs style, d'où des classes par pas de 5 %. */
html body[data-design] .progress_track > span.w-0 { width: 0%; } html body[data-design] .progress_track > span.w-5 { width: 5%; } html body[data-design] .progress_track > span.w-10 { width: 10%; } html body[data-design] .progress_track > span.w-15 { width: 15%; } html body[data-design] .progress_track > span.w-20 { width: 20%; } html body[data-design] .progress_track > span.w-25 { width: 25%; } html body[data-design] .progress_track > span.w-30 { width: 30%; } html body[data-design] .progress_track > span.w-35 { width: 35%; } html body[data-design] .progress_track > span.w-40 { width: 40%; } html body[data-design] .progress_track > span.w-45 { width: 45%; } html body[data-design] .progress_track > span.w-50 { width: 50%; } html body[data-design] .progress_track > span.w-55 { width: 55%; } html body[data-design] .progress_track > span.w-60 { width: 60%; } html body[data-design] .progress_track > span.w-65 { width: 65%; } html body[data-design] .progress_track > span.w-70 { width: 70%; } html body[data-design] .progress_track > span.w-75 { width: 75%; } html body[data-design] .progress_track > span.w-80 { width: 80%; } html body[data-design] .progress_track > span.w-85 { width: 85%; } html body[data-design] .progress_track > span.w-90 { width: 90%; } html body[data-design] .progress_track > span.w-95 { width: 95%; } html body[data-design] .progress_track > span.w-100 { width: 100%; }
html body[data-design] .progress_track.is-warning > span.w-0 { width: 2%; }

/* Menu « Tous mes biens » : même langage que les autres cartes et menus du site. */
html body[data-design] .topbar_entity.has-menu { padding: 0; gap: 0; }
html body[data-design] .topbar_entity.has-menu > .ui_icon:first-child { position: absolute; left: 10px; top: 11px; width: 16px; pointer-events: none; z-index: 1; }
html body[data-design] .topbar_entity.has-menu > .ui_icon:last-of-type { position: absolute; right: 10px; top: 11px; z-index: 1; }
html body[data-design] .entity_menu { position: relative; }
html body[data-design] .entity_menu-button {
  display: flex; align-items: center; height: 38px; padding: 0 34px 0 34px; border: 0; border-radius: var(--r-md);
  background: transparent; color: var(--c-ink); font-size: var(--fs-body); font-weight: 600; font-family: inherit; cursor: pointer; white-space: nowrap; max-width: 320px;
}
html body[data-design] .entity_menu-button span { overflow: hidden; text-overflow: ellipsis; }
html body[data-design] .entity_menu-button:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 0; }
html body[data-design] .entity_menu-list {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 260px; max-width: 360px; max-height: 320px; overflow: auto;
  margin: 0; padding: 6px; list-style: none; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: 0 16px 40px rgba(18, 62, 75, .18); outline: 0;
}
html body[data-design] .entity_menu-list[hidden] { display: none; }
html body[data-design] .entity_menu-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: var(--r-md);
  color: var(--c-text); font-size: var(--fs-body); cursor: pointer;
}
html body[data-design] .entity_menu-list li.is-active { background: var(--c-brand-softer); }
html body[data-design] .entity_menu-list li[aria-selected="true"] { color: var(--c-brand-deep); font-weight: 700; background: var(--c-brand-soft); }
html body[data-design] .entity_menu-list li[aria-selected="true"]::after { content: ""; flex: none; width: 14px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(-45deg) scale(.8); }
@media (max-width: 760px) {
  html body[data-design] .topbar_entity.has-menu > .ui_icon:first-child { display: none; }
  html body[data-design] .entity_menu-button { padding-left: 4px; max-width: 58vw; }
  html body[data-design] .entity_menu-list { min-width: min(280px, calc(100vw - 32px)); }
}
