:root {
  color-scheme: dark;
  --bg: #0b111b;
  --panel: #141e2c;
  --border: #293749;
  --muted: #9daec3;
  --green: #42dda0;
  --blue: #488fff;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--bg);
  color: #edf3fa;
  font:
    15px system-ui,
    sans-serif;
  display: flex;
  min-height: 100vh;
}
aside {
  width: 220px;
  flex-shrink: 0;
  padding: 24px 15px;
  background: #101824;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
aside h2 {
  font-size: 19px;
  margin: 0 0 35px;
}
nav {
  display: grid;
  gap: 8px;
}
nav a {
  color: #c6d3e3;
  text-decoration: none;
  padding: 13px;
  border-radius: 8px;
}
nav a:hover,
nav a:first-child {
  background: #203653;
  color: white;
}
aside small {
  margin-top: auto;
}
main {
  padding: 26px;
  flex: 1;
  min-width: 0;
  max-width: 1900px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 0 26px;
  background: radial-gradient(ellipse at top right, #263d55, transparent 65%);
}
h1 {
  font-size: 32px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 0 0 18px;
}
p,
small,
footer {
  color: var(--muted);
}
header p {
  margin: 8px 0;
}
button {
  background: #244a79;
  color: white;
  border: 1px solid #41618a;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}
button:hover {
  background: #35639b;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.panel,
.kpi {
  background: linear-gradient(145deg, #182332, #121b28);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 19px;
  min-width: 0;
}
.kpi strong {
  display: block;
  font-size: clamp(19px, 2vw, 30px);
  margin: 9px 0;
}
.dashboard {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 15px;
  align-items: start;
}
.positive {
  color: var(--green);
}
.negative {
  color: #ff8585;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th,
td {
  text-align: right;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
th:first-child,
td:first-child {
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 500;
}
.ring {
  width: 165px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 8px auto 20px;
  display: grid;
  place-items: center;
}
.ring div {
  background: #141e2c;
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  font-weight: bold;
}
.legend-row,
.line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}
progress {
  width: 100%;
  height: 10px;
  accent-color: var(--green);
}
.goal {
  margin-bottom: 18px;
}
.task {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
}
input[type="checkbox"] {
  accent-color: var(--green);
}
.done {
  text-decoration: line-through;
  color: var(--muted);
}
svg {
  width: 100%;
  height: auto;
}
footer {
  padding: 25px 0;
  font-size: 12px;
}
dialog {
  background: var(--panel);
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 15px;
  width: min(850px, 94vw);
  max-height: 90vh;
  padding: 24px;
}
dialog::backdrop {
  background: #000a;
}
input:not([type="checkbox"]),
select {
  background: #0b111b;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px;
  width: 100%;
  min-width: 0;
  font: inherit;
}
.editrow {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  gap: 7px;
  margin: 8px 0;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.editgroup {
  margin: 22px 0;
}
.editgroup h3 {
  margin-bottom: 8px;
}
@media (max-width: 1150px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  body {
    display: block;
  }
  aside {
    position: static;
    width: 100%;
    height: auto;
  }
  nav {
    display: flex;
    overflow: auto;
  }
  nav a {
    white-space: nowrap;
  }
  aside small {
    display: none;
  }
  aside h2 {
    margin-bottom: 10px;
  }
  main {
    padding: 12px;
  }
  header {
    align-items: flex-start;
    flex-direction: column;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
  .editrow {
    grid-template-columns: 1fr 1fr;
  }
  .kpi {
    padding: 12px;
  }
}

/* Bandeau panoramique */
header {
  min-height: 150px;
  margin: -26px -26px 18px;
  padding: 24px 26px;
  background:
    linear-gradient(90deg, rgba(11, 17, 27, 0.88), rgba(11, 17, 27, 0.15) 65%),
    linear-gradient(0deg, #0b111b, transparent 55%),
    url("../bandeau.jpeg") center 48% / cover no-repeat;
}
header p {
  color: #e0e7ef;
}
@media (max-width: 700px) {
  header {
    margin: -12px -12px 14px;
    padding: 20px 12px;
    min-height: 170px;
  }
}
/* Disposition fidèle à la maquette */
:root {
  --bg: #0a1018;
  --panel: #151d28;
  --border: #283442;
  --muted: #b7c1ce;
}
body {
  font:
    14px Arial,
    sans-serif;
}
aside {
  width: 15%;
  min-width: 185px;
  padding: 22px 11px;
  background: linear-gradient(130deg, #111a26, #0d141e);
}
aside h2 {
  font-size: 18px;
  margin: 0 8px 32px;
}
nav {
  gap: 4px;
}
nav a {
  padding: 12px 10px;
  font-size: 13px;
}
.settings {
  margin-top: auto;
  display: grid;
  gap: 8px;
}
.settings button {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px;
}
.settings small {
  font-size: 10px;
}
main {
  padding: 14px;
  max-width: none;
}
header {
  min-height: 89px;
  margin: -14px -14px 0;
  padding: 12px 20px 18px;
  background:
    linear-gradient(90deg, #101824b8, transparent 80%),
    linear-gradient(0deg, #0a1018, transparent 50%),
    url("../bandeau.jpeg") center 43% / cover no-repeat;
}
h1 {
  font-size: 27px;
}
header p {
  margin: 5px 0;
}
.date {
  background: #18212b88;
  padding: 10px;
  border-radius: 9px;
  font-size: 12px;
}
.kpis {
  gap: 11px;
  margin-bottom: 14px;
}
.kpi,
.panel {
  background: radial-gradient(
    ellipse at top right,
    #1b2531 0%,
    #141c27 55%,
    #131b26 100%
  );
  border-radius: 12px;
  box-shadow: 0 5px 12px #0003;
  padding: 14px;
}
.kpi {
  display: flex;
  gap: 12px;
  min-height: 104px;
}
.kpi strong {
  font-size: clamp(20px, 2vw, 30px);
  margin: 7px 0;
}
.kpi small {
  font-size: 12px;
}
.kpi-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #193b60;
  color: #4796ff;
  font-size: 23px;
  flex-shrink: 0;
}
.icon-1,
.icon-3 {
  background: #153e36;
  color: #42dda0;
}
.dashboard {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  grid-template-rows: auto auto auto;
}
.panel h2 {
  font-size: 15px;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.panel h2 span {
  margin-left: auto;
}
.panel h2 small {
  font-weight: normal;
  font-size: 11px;
}
#etf {
  grid-column: 1/5;
  grid-row: 1/3;
}
#assets {
  grid-column: 1/5;
  grid-row: 3/5;
}
#allocation {
  grid-column: 5/9;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 8px;
}
#allocation h2 {
  grid-column: 1/-1;
  margin-bottom: 5px;
}
#history {
  grid-column: 9/13;
  grid-row: 1;
}
.dashboard {
  grid-template-rows: minmax(225px, auto) 36px auto auto;
}
.ring {
  width: 100%;
  max-width: 165px;
  margin: 0 auto;
}
.ring div {
  font-size: 17px;
}
.ring small {
  font-size: 10px;
  font-weight: normal;
}
.legend-row {
  font-size: 11px;
  border: 0;
  padding: 7px 0;
  gap: 4px;
}
.dot {
  margin-right: 4px;
  width: 9px;
  height: 9px;
}
table {
  font-size: 12px;
}
th,
td {
  padding: 10px 3px;
}
.marker {
  display: inline-block;
  width: 4px;
  height: 19px;
  border-radius: 4px;
  vertical-align: middle;
  margin-right: 7px;
}
.badge {
  background: #17382f;
  border-radius: 20px;
  padding: 4px 7px;
  white-space: nowrap;
  font-size: 11px;
}
.badge.negative {
  background: #48282e;
}
.goal {
  font-size: 12px;
  margin-bottom: 20px;
}
.goal .line {
  border: 0;
  padding: 5px 0;
}
.goalbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.goalbar small {
  white-space: nowrap;
  font-size: 10px;
}
.line {
  font-size: 12px;
}
.task {
  font-size: 12px;
  line-height: 1.5;
  align-items: flex-start;
}
.task input {
  margin-top: 3px;
}
footer {
  padding: 12px 0;
  font-size: 10px;
}
@media (max-width: 1050px) {
  aside {
    min-width: 160px;
  }
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
  }
  .dashboard > .panel {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 700px) {
  aside {
    width: 100%;
    min-width: 0;
  }
  .settings {
    display: flex;
  }
  main {
    padding: 12px;
  }
  header {
    margin: -12px -12px 12px;
    min-height: 110px;
  }
  .dashboard {
    grid-template-columns: 1fr;
  }
  .kpi {
    gap: 6px;
    padding: 10px;
  }
  .kpi-icon {
    width: 26px;
    height: 26px;
    font-size: 16px;
  }
}
/* Format bureau de référence, 1328 × 748 */
@media (min-width: 1051px) {
  body {
    font-size: clamp(10px, 1vw, 14px);
    height: 100vh;
    overflow: hidden;
  }
  aside {
    width: 14.8%;
    min-width: 0;
    padding: 2.5vh 0.8vw;
  }
  main {
    padding: 0 1.05vw;
    overflow: hidden;
  }
  header {
    height: 12vh;
    min-height: 0;
    margin: 0 -1.05vw;
    padding: 1.5vh 1.5vw;
    align-items: flex-start;
  }
  h1 {
    font-size: clamp(19px, 2vw, 29px);
  }
  .kpis {
    height: 14vh;
    gap: 0.8vw;
    margin-bottom: 2vh;
  }
  .kpi {
    min-height: 0;
    padding: 1.6vh 0.9vw;
    gap: 0.8vw;
  }
  .kpi strong {
    font-size: clamp(18px, 2vw, 28px);
  }
  .dashboard {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 31vh 5.2vh 26.8vh;
    gap: 1.7vh 0.9vw;
  }
  .panel {
    padding: 1.8vh 1vw;
    overflow: auto;
  }
  .panel h2 {
    font-size: clamp(11px, 1.15vw, 16px);
    margin-bottom: 1.6vh;
  }
  #etf {
    grid-row: 1/3;
  }
  #assets {
    grid-row: 3;
  }
  #allocation,
  #history {
    grid-row: 1;
  }
  table {
    font-size: clamp(9px, 0.9vw, 13px);
  }
  th,
  td {
    padding: 1.05vh 2px;
  }
  .ring {
    max-width: min(12.5vw, 22vh);
  }
  .legend-row {
    padding: 0.8vh 0;
    font-size: clamp(9px, 0.85vw, 12px);
  }
  .goal {
    margin-bottom: 2vh;
  }
  .line,
  .task,
  .goal {
    font-size: clamp(9px, 0.9vw, 13px);
  }
  .task {
    padding: 1vh 0;
  }
  footer {
    display: none;
  }
  #history svg {
    height: 23vh;
    width: 100%;
  }
  #history > small {
    display: block;
    font-size: 11px;
}
  .settings small {
    font-size: 9px;
  }
  nav a {
    padding: 1.5vh 0.7vw;
  }
}
.asset-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 10px;
  display: inline-block;
}
.asset-icon svg {
  width: 100%;
  height: 100%;
}
.asset-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 9px;
  padding: 1.1vh 0;
  font-size: 12px;
}
.asset-row > span:first-child {
  display: flex;
  align-items: center;
}
.goal-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.goal-check {
  width: 18px;
  height: 18px;
  border: 1px solid #9ba9b9;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  flex: none;
}
.goal-check.checked {
  background: #42dda0;
  color: #10251e;
  border-color: #42dda0;
  font-weight: bold;
}
.goalbar {
  margin-left: 28px;
}
progress {
  appearance: none;
  border: 0;
  background: #293442;
  border-radius: 10px;
  height: 7px;
}
progress::-webkit-progress-bar {
  background: #293442;
  border-radius: 10px;
}
progress::-webkit-progress-value {
  background: #42dda0;
  border-radius: 10px;
}
.task input {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1px solid #a0acbb;
  border-radius: 4px;
  flex: none;
}
.task input:checked {
  border-color: #42dda0;
  color: #42dda0;
}
.task input:checked:after {
  content: "✓";
  display: block;
  text-align: center;
  line-height: 13px;
}
.history-badge {
  margin-left: auto;
  color: #42dda0;
  background: #17382f;
  border-radius: 12px;
  padding: 4px;
  font-size: 10px;
  white-space: nowrap;
}

/* V5 : pictogrammes vectoriels et grille sans défilement interne */
.ui-icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  vertical-align: middle;
  display: inline-block;
}
aside h2,
nav a,
.settings button,
.date {
  display: flex;
  align-items: center;
  gap: 0.65em;
}
aside h2 {
  white-space: nowrap;
  font-size: clamp(12px, 1.15vw, 19px);
}
aside h2 .ui-icon {
  width: 1.6em;
  height: 1.6em;
}
nav a .ui-icon {
  width: 1.35em;
  height: 1.35em;
}
.kpi-icon .ui-icon {
  width: 70%;
  height: 70%;
}
.panel h2 .ui-icon {
  width: 1.25em;
  height: 1.25em;
}
.goal-check svg {
  width: 85%;
  height: 85%;
}
.panel h2 span.history-badge {
  margin-left: auto;
}
.asset-row {
  font-size: inherit;
}
.panel h2 small {
  white-space: nowrap;
}
@media (min-width: 1051px) {
  body {
    font-size: min(1vw, 1.8vh);
  }
  main {
    overflow: auto;
  }
  .dashboard {
    grid-template-rows: 31vh 5vh 29vh;
    gap: 1.5vh 0.9vw;
  }
  .panel {
    overflow: visible;
    padding: 1.5vh 0.85vw;
  }
  .panel h2 {
    font-size: min(1.15vw, 2vh);
    margin-bottom: 1.2vh;
    white-space: nowrap;
  }
  .kpi strong {
    font-size: min(2vw, 3.6vh);
    margin: 0.7vh 0;
  }
  .kpi small {
    font-size: min(0.95vw, 1.65vh);
  }
  .kpi-icon {
    width: min(3vw, 5.5vh);
    height: min(3vw, 5.5vh);
  }
  table {
    font-size: min(0.9vw, 1.6vh);
  }
  th,
  td {
    padding: 0.65vh 2px;
  }
  .marker {
    height: 2.4vh;
  }
  .badge {
    font-size: min(0.85vw, 1.5vh);
    padding: 0.4vh 0.45vw;
  }
  .asset-row {
    padding: 0.75vh 0;
    gap: 0.5vw;
    font-size: min(0.9vw, 1.6vh);
  }
  .asset-icon {
    width: 2.3vh;
    height: 2.3vh;
    margin-right: 0.55vw;
  }
  .goal {
    margin-bottom: 1.5vh;
    font-size: min(0.9vw, 1.6vh);
  }
  .goalbar {
    margin-top: 0.6vh;
  }
  .line,
  .task {
    font-size: min(0.9vw, 1.6vh);
    padding: 0.8vh 0;
  }
  .goal-check {
    width: 2.3vh;
    height: 2.3vh;
  }
  .legend-row {
    font-size: min(0.85vw, 1.5vh);
    padding: 0.7vh 0;
  }
  #history svg {
    height: 23vh;
  }
  #assets {
    min-height: max-content;
  }
  #etf {
    min-height: max-content;
  }
  nav a {
    font-size: min(1vw, 1.8vh);
  }
}
/* V6 : cockpit rente, trois rangées comme la maquette */
#etf,
#assets {
  display: none;
}
#rent {
  border-color: #32d99a;
  background: linear-gradient(135deg, #10382e, #102322);
}
#rentCards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.rentCard {
  border: 1px solid #28644e;
  border-radius: 12px;
  padding: 12px;
  background: #102a27;
}
.rentCard strong {
  display: block;
  font-size: clamp(16px, 2vw, 28px);
  margin: 8px 0;
}
.rentCard small {
  display: block;
}
.allocHead {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
}
.settings button {
  padding: 6px 9px;
}
.dashboard {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
}
#rent {
  grid-column: 1/8;
  grid-row: 1;
}
#history {
  grid-column: 8/13;
  grid-row: 1/4;
}
#allocation {
  grid-column: 1/6;
  grid-row: 2/4;
}
#preserve {
  grid-column: 10/13;
  grid-row: 2;
}
#simulation {
  grid-column: 5/9;
  grid-row: 3;
}
.kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
#legend {
  min-width: 0;
}
#allocation {
  grid-template-columns: 0.9fr 1.2fr;
}
#detailBody {
  min-width: 0;
}
#detailDialog {
  max-width: 750px;
}
.line b {
  white-space: nowrap;
}
.panel h2 {
  white-space: normal;
}
.rentCard small {
  font-size: inherit;
}
@media (min-width: 1051px) {
  header {
    height: 10vh;
  }
  .kpis {
    height: 12vh;
    margin-bottom: 1.4vh;
  }
  .dashboard {
    grid-template-rows: 23vh 27vh 23vh;
    gap: 1.3vh 0.9vw;
  }
  .panel {
    padding: 1.2vh 0.8vw;
    overflow: visible;
  }
  .panel h2 {
    margin-bottom: 1vh;
    font-size: min(1.15vw, 2vh);
  }
  #history svg {
    height: 17vh;
  }
  #rentCards {
    height: 16vh;
  }
  .rentCard {
    padding: 1.3vh 0.7vw;
  }
  .rentCard strong {
    font-size: min(2vw, 3.5vh);
  }
  .line,
  .task {
    padding: 0.65vh 0;
  }
  .goal {
    margin-bottom: 1vh;
  }
  .legend-row {
    padding: 0.5vh 0;
  }
  .ring {
    max-width: min(12vw, 20vh);
  }
  .kpi strong {
    font-size: min(1.65vw, 3vh);
  }
  nav {
    gap: 3px;
  }
  nav a {
    padding: 1.1vh 0.6vw;
  }
  .settings {
    gap: 4px;
  }
}
@media (max-width: 1050px) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .kpis {
    grid-template-columns: repeat(2, 1fr);
  }
  #rent {
    grid-column: 1/-1 !important;
  }
}
@media (max-width: 700px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
  #rentCards {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr 1fr;
  }
}
/* V8 : dimensions contraintes au viewport, sans largeur minimale implicite. */
.allocHead,
#legend .legend-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  gap: 4px;
  align-items: center;
  text-align: right;
}
.allocHead span:first-child,
#legend .legend-row span:first-child {
  text-align: left;
}
.rentCard small:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rentCard small .ui-icon {
  width: 1.5em;
  height: 1.5em;
}
.kpi > div {
  min-width: 0;
}
.kpi small {
  white-space: normal;
}
.date {
  white-space: nowrap;
}
.panel {
  min-width: 0;
}
.goalbar progress {
  min-width: 0;
}
.goalbar small {
  min-width: 2em;
  text-align: right;
}
#history #chart {
  min-width: 0;
}
#history #chart svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 18vh;
}
#allocation {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.5fr);
}
#legend .legend-row {
  font-size: clamp(9px, 0.72vw, 12px);
}
#legend .dot {
  width: 8px;
  height: 8px;
  margin-right: 4px;
}
.goal-check .ui-icon {
  width: 85%;
  height: 85%;
}
.kpi:last-child .asset-icon {
  margin: 0;
  color: #b77cff;
}
.kpi:last-child .asset-icon svg {
  stroke: currentColor;
}
.kpi:last-child .kpi-icon {
  background: #38274e;
  color: #b77cff;
}
@media (min-width: 1051px) {
  body {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  aside {
    flex: 0 0 14.8%;
    width: 14.8%;
    height: 100dvh;
  }
  main {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    padding: 0 1vw;
    display: flex;
    flex-direction: column;
    height: 100dvh;
  }
  header {
    flex: 0 0 10.5vh;
    height: 10.5vh;
    margin: 0 -1vw;
    min-width: 0;
  }
  .kpis {
    flex: 0 0 12vh;
    height: 12vh;
    min-width: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65vw;
  }
  .kpi {
    min-width: 0;
    gap: 0.6vw;
    padding: 1.2vh 0.65vw;
  }
  .kpi-icon {
    width: min(2.6vw, 5vh);
    height: min(2.6vw, 5vh);
  }
  .dashboard {
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: minmax(0, 23fr) minmax(0, 27fr) minmax(0, 23fr);
    padding-bottom: 1vh;
    gap: 1.2vh 0.75vw;
  }
  .panel {
    min-height: 0;
    overflow: hidden;
    padding: 1.1vh 0.75vw;
  }
  .panel h2 {
    font-size: min(1.05vw, 1.9vh);
  }
  #rentCards {
    height: auto;
    gap: 0.6vw;
  }
  .rentCard {
    min-width: 0;
    padding: 1.2vh 0.6vw;
  }
  .rentCard strong {
    font-size: min(1.8vw, 3.2vh);
  }
  .line,
  .task,
  .goal {
    font-size: min(0.88vw, 1.6vh);
  }
  .goal {
    margin-bottom: 0.8vh;
  }
  .goalbar {
    margin-top: 0.4vh;
  }
  .ring {
    max-width: min(10vw, 19vh);
    margin: 0 auto;
  }
  #history,
  #allocation {
    margin-bottom: 10vh;
  }
  #history #chart svg {
    height: 17vh;
    max-height: none;
  }
  #allocation .legend-row {
    padding: 0.55vh 0;
  }
  aside h2 {
    margin-bottom: 3vh;
  }
  nav a {
    padding: 1vh 0.6vw;
  }
  .settings {
    gap: 3px;
  }
}
@media (max-width: 1050px) {
  #history #chart svg {
    max-height: none;
  }
  #allocation {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  }
}

/* V9 : finitions sans données fictives */
#rent[data-state="empty"] {
  border-color: #536476;
  background: linear-gradient(135deg, #182633, #14212a);
}
#rent[data-state="empty"] .rentCard {
  background: #17232d;
  border-color: #3c4b59;
}
#rent[data-state="caution"] {
  border-color: #d7a64a;
  background: linear-gradient(135deg, #352d1d, #23241f);
}
#rent[data-state="caution"] .rentCard {
  background: #29271f;
  border-color: #665334;
}
#rent[data-state="deficit"] {
  border-color: #e47575;
  background: linear-gradient(135deg, #38252a, #251e25);
}
#rent[data-state="deficit"] .rentCard {
  background: #2e2229;
  border-color: #74434b;
}
#history {
  display: flex;
  flex-direction: column;
}
#history #chart {
  flex: 1;
  min-height: 0;
  width: 100%;
}
#history #chart svg {
  width: 100%;
  height: 100%;
  max-height: none;
}
@media (min-width: 1051px) {
  #history #chart svg {
    height: 100%;
    max-height: none;
  }
  .rentCard strong {
    font-size: min(2.15vw, 4vh);
    margin: 1vh 0;
  }
  .ring {
    max-width: min(12vw, 21vh);
  }
  #allocation {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.5fr);
  }
  .rentCard small:last-child {
    font-size: min(0.82vw, 1.5vh);
  }
}
/* V10 */
#rentCards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.rentCard small .ui-icon {
  width: 1.7em;
  height: 1.7em;
}
.chart-key {
  display: flex;
  gap: 1em;
  font-size: 11px;
  margin-bottom: 3px;
  color: #42dda0;
}
.chart-key span + span {
  color: #75aaff;
}
#history #chart svg {
  display: block;
  width: 100%;
  height: 100%;
}
#allocation .ring {
  max-width: min(11vw, 19vh);
  transform: translateY(-3px);
}
.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin: 20px 0;
}
.pyramid div {
  padding: 18px 8px;
  text-align: center;
  background: #24503f;
  width: 35%;
  color: white;
}
.pyramid div:nth-child(2) {
  width: 55%;
  background: #33796b;
}
.pyramid div:nth-child(3) {
  width: 80%;
  background: #bad9cb;
  color: #173b30;
}
.pyramid div:nth-child(4) {
  width: 100%;
  background: #e9ddbc;
  color: #173b30;
}
@media (min-width: 1051px) {
  .rentCard strong {
    font-size: min(2.2vw, 4vh);
  }
  .rentCard small {
    font-size: min(0.8vw, 1.5vh);
  }
  nav a {
    padding: 0.8vh 0.6vw;
  }
}
@media (max-width: 700px) {
  #rentCards {
    grid-template-columns: 1fr 1fr;
  }
  #allocation .ring {
    max-width: 140px;
  }
  #chart {
    min-height: 150px;
  }
}
/* V11 : titre et légende sur une seule ligne, cartes de rente agrandies */
.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65em;
  flex-wrap: wrap;
  margin-bottom: 0.5vh;
  flex: none;
}
.history-heading h2 {
  margin: 0 !important;
  white-space: nowrap;
}
.history-heading .chart-key {
  margin: 0;
  gap: 0.7em;
  font-size: clamp(9px, 0.72vw, 12px);
  white-space: nowrap;
}
#rent {
  display: flex;
  flex-direction: column;
}
#rentCards {
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.rentCard {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.rentCard small .ui-icon {
  width: 1.9em;
  height: 1.9em;
}
.rentCard strong {
  font-size: clamp(22px, 2.5vw, 38px);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
@media (min-width: 1051px) {
  .rentCard {
    padding: 1.3vh 0.65vw;
  }
  .rentCard strong {
    font-size: min(2.35vw, 4.4vh);
  }
  .rentCard small:first-child {
    font-size: min(0.85vw, 1.65vh);
  }
  .rentCard small:last-child {
    font-size: min(0.8vw, 1.45vh);
  }
}

/* Pyramide patrimoniale */
#strategyDialog {
  width: min(720px, 94vw);
  padding: clamp(16px, 2vw, 30px);
}
#strategyDialog h2 {
  font-size: clamp(18px, 2vw, 25px);
  margin-bottom: 12px;
}
.strategy-layout {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 16px;
}
.strategy-pyramid {
  display: block;
  width: min(100%, 560px, 65vh);
  height: auto;
  max-height: 65vh;
}
#strategyDialog > button {
  display: block;
  margin: 0 0 16px;
}

#strategyDialog > label {
  display: block;
  max-width: 260px;
  margin: 0 0 0;
}

#strategyInflation {
  width: 100%;
  box-sizing: border-box;
}

#strategyDialog {
  width: min(920px, 94vw);
}
.strategy-pyramid {
  width: min(100%, 720px, 78vh);
  max-height: 68vh;
}
#workspace14 {
  width: min(900px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
#workspace14 .v14head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
#workspace14 .v14grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
#workspace14 article {
  padding: 14px;
  border: 1px solid #34465b;
  border-radius: 10px;
  background: #142235;
}
#workspace14 label {
  display: block;
  margin: 10px 0;
}
#workspace14 input,
#workspace14 select,
#workspace14 textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #101c2b;
  color: #e1eaf5;
  border: 1px solid #40536a;
  padding: 8px;
  border-radius: 6px;
}
#workspace14 .v14link {
  display: inline-block;
  color: #8ec5ff;
  margin: 5px 10px 5px 0;
}
#workspace14 button {
  margin: 4px;
}
aside nav {
  overflow-y: auto;
  min-height: 0;
}
#workspace16 {
  width: min(900px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
#workspace16 .v14head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#workspace16 label {
  display: block;
  margin: 10px 0;
}
#workspace16 input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #101c2b;
  color: #e1eaf5;
  border: 1px solid #40536a;
  padding: 8px;
  border-radius: 6px;
}
#workspace16 button {
  margin: 4px;
}
#workspace16 a {
  color: #8ec5ff;
}
.privacy16 main .kpis,
.privacy16 main .dashboard {
  filter: blur(12px);
  pointer-events: none;
}
.privacy16 dialog {
  filter: blur(12px);
}
@media print {
  body:has(#workspace16[open]) > aside,
  body:has(#workspace16[open]) > main {
    display: none;
  }
  #workspace16[open] {
    position: static;
    width: 100%;
    max-height: none;
    overflow: visible;
    color: #000;
    background: #fff;
    border: 0;
  }
  #workspace16 button {
    display: none;
  }
}
#workspace17 {
  width: min(900px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
#workspace17 .v14head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
#workspace17 label {
  display: block;
  margin: 10px 0;
}
#workspace17 input,
#workspace17 select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: #101c2b;
  color: #e1eaf5;
  border: 1px solid #40536a;
  padding: 8px;
  border-radius: 6px;
}
#workspace17 button {
  margin: 4px;
}
aside nav {
  overflow-y: auto;
  min-height: 0;
}
.privacy16 #workspace17 {
  filter: blur(12px);
}
#workspace18 {
  background: #111e30;
  color: #e5edf8;
  border: 1px solid #35465d;
  border-radius: 14px;
  width: min(850px, 90vw);
  max-height: 85vh;
  overflow: auto;
  padding: 24px;
}
#workspace18 label {
  display: block;
  margin: 12px 0;
}
#workspace18 input {
  display: block;
  max-width: 100%;
  margin-top: 6px;
}
#workspace18 button {
  margin: 5px;
}
aside nav {
  overflow-y: auto;
  min-height: 0;
}
#workspace22 {
  width: min(1200px, 94vw);
  max-height: 90vh;
  overflow: auto;
}
#workspace22 article {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 8px 0;
}
#workspace22 .v22charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}
#workspace22 svg {
  width: 100%;
  height: auto;
}
#workspace22 .v22filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
#workspace22 table {
  width: 100%;
  border-collapse: collapse;
}
#workspace22 td,
#workspace22 th {
  padding: 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.history-badge.negative {
  background: #482b32;
  color: #ff8585;
}

#reports9 {
  width: min(1350px, 95vw);
  max-height: 92vh;
  overflow: auto;
  background: #151e29;
  color: #eaf0f8;
  border: 1px solid #34465a;
  border-radius: 20px;
  padding: 32px;
}
#reports9::backdrop {
  background: #000a;
}
#reports9 table {
  width: 100%;
  border-collapse: collapse;
}
#reports9 th,
#reports9 td {
  padding: 9px;
  border-bottom: 1px solid #344052;
  text-align: right;
  white-space: nowrap;
}
#reports9 th:first-child,
#reports9 td:first-child {
  text-align: left;
}
.reportcards9 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
#reports9 select {
  margin: 8px;
  padding: 8px;
}
@media print {
  body:has(#reports9[open]) > *:not(#reports9) {
    display: none !important;
  }
  #reports9[open] {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    color: black !important;
    background: white !important;
    border: 0 !important;
    padding: 0 !important;
  }
  #reports9 button,
  #reports9 select {
    display: none !important;
  }
  #reports9 .panel {
    color: black !important;
    background: white !important;
  }
  #reports9 table {
    font-size: 10pt;
  }
  #reports9::backdrop {
    display: none;
  }
}
#reports9 .v14head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
#reports9 .bad9 {
  color: #ff7777;
}
#reports9 .good9 {
  color: #35d8a0;
}
#reports9 .chart9 {
  width: 100%;
  max-height: 250px;
  display: block;
}
#reports9 .legend9 {
  font-size: 13px;
}
#reports9 #edition9 {
  color: #aebdce;
}
@media print {
  @page {
    size: A4 landscape;
    margin: 12mm;
  }
  html:has(#reports9[open]),
  body:has(#reports9[open]) {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
  }
  #reports9[open] {
    display: block !important;
    inset: auto !important;
    margin: 0 !important;
    max-width: none !important;
    height: auto !important;
    box-sizing: border-box !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }
  #reports9 .filter9,
  #reports9 .actions {
    display: none !important;
  }
  #reports9 #edition9 {
    color: #333 !important;
  }
  #reports9 div {
    overflow: visible !important;
  }
  #reports9 table {
    table-layout: fixed;
    width: 100% !important;
    font-size: 9pt;
  }
  #reports9 th,
  #reports9 td {
    white-space: normal !important;
    padding: 5px !important;
    border-color: #ccc !important;
    color: #222;
  }
  #reports9 thead {
    display: table-header-group;
  }
  #reports9 tr,
  #reports9 .panel,
  #reports9 .chart9 {
    break-inside: avoid;
  }
  #reports9 h3 {
    break-after: avoid;
  }
  #reports9 .panel {
    box-shadow: none !important;
    border: 1px solid #aaa !important;
  }
  #reports9 .reportcards9 {
    grid-template-columns: repeat(3, 1fr);
  }
  #reports9 .bad9 {
    color: #b42323 !important;
  }
  #reports9 .good9 {
    color: #08764b !important;
  }
  #reports9 .chart9 {
    max-height: 155px;
  }
}
/* V11 : synthèse compacte et vues secondaires à la demande */
#workspace22:has(.tabs11) {
  width: min(1600px, 96vw);
  max-width: 96vw;
  height: min(880px, 94vh);
  max-height: 94vh;
  box-sizing: border-box;
  padding: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#workspace22:not([open]) {
  display: none !important;
}
#workspace22 .v14head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#workspace22 .v14head h2 {
  margin: 0;
}
#workspace22 .v22filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  gap: 8px;
}
#workspace22 .v22filters label {
  min-width: 0;
  margin: 0;
}
#workspace22 .v22filters input,
#workspace22 .v22filters select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
#workspace22 .tabs11 {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#workspace22 .active11 {
  background: #3985ef;
  color: white;
}
#workspace22 .body11 {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#workspace22 [hidden] {
  display: none !important;
}
#workspace22 .cards11 {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 6px;
}
#workspace22 .cards11 article {
  margin: 0;
  padding: 7px;
  min-width: 0;
}
#workspace22 .cards11 h3 {
  font-size: 12px;
  font-weight: 500;
  margin: 0 0 4px;
}
#workspace22 .cards11 strong {
  font-size: 17px;
}
#workspace22 .lower11 {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 8px;
  align-items: start;
}
#workspace22 .lower11 article {
  margin: 0;
  padding: 8px;
  min-width: 0;
}
#workspace22 .lower11 h3 {
  font-size: 13px;
  margin: 3px 0 5px;
}
#workspace22 .lower11 td,
#workspace22 .lower11 th {
  padding: 3px 5px;
  font-size: 11px;
}
#workspace22 .row11 {
  background: none;
  border: 0;
  padding: 2px;
  color: inherit;
  text-align: left;
  font-size: inherit;
  cursor: pointer;
}
#workspace22 .selected11 {
  background: #24415b;
}
#workspace22 .negative11 {
  color: #ff8585;
}
#workspace22 .positive11 {
  color: #54c9aa;
}
#workspace22 .graphrow11 {
  display: grid;
  gap: 6px;
  min-width: 0;
}
#workspace22 .graph11 select {
  width: auto;
  max-width: 100%;
  font-size: 12px;
  padding: 4px;
}
#workspace22 .graph11 svg {
  max-height: 135px;
}
#workspace22 .graph11 article {
  border: 0;
  padding: 0;
}
#workspace22 .graph11 small {
  font-size: 10px;
}
#workspace22 .history11,
#workspace22 .entry11,
#workspace22 .settings11 {
  padding: 4px;
}
#workspace22 .v22filters + p {
  margin: 0;
  font-size: 11px;
}
#workspace22 .v22filters + p:empty {
  display: none;
}
@media (max-width: 850px) {
  #workspace22 .cards11 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #workspace22 .lower11 {
    grid-template-columns: 1fr;
  }
  #workspace22 .v22filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* V12: compact secondary views, no changes to financial formulas */
#workspace22 .historytools12 {
  display: flex;
  align-items: end;
  gap: 8px;
  flex-wrap: wrap;
}
#workspace22 .historytools12 label {
  flex: 1;
  min-width: 180px;
}
#workspace22 .history11 > p {
  font-size: 11px;
  margin: 6px 0;
}
#workspace22 .history11 article {
  padding: 6px;
  margin: 4px 0;
}
#workspace22 .history11 h3 {
  margin: 4px 0;
  font-size: 14px;
}
#workspace22 .history11 td,
#workspace22 .history11 th {
  padding: 4px;
  font-size: 11px;
}
#workspace22 .history11 td button {
  padding: 4px 7px;
  font-size: 11px;
}
#workspace22 .pagination12 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6px 0;
}
#workspace22 .pagination12 button:disabled {
  opacity: 0.4;
  cursor: default;
}
#workspace22 #quick23 {
  margin: 0;
  padding: 10px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
}
#workspace22 #quick23 > h3,
#workspace22 #inline26 {
  grid-column: 1/-1;
  margin: 0;
}
#workspace22 #inline26 h2 {
  font-size: 16px;
  margin: 4px 0 8px;
}
#workspace22 #inline26 form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
}
#workspace22 #inline26 form label:has([name="opening"]),
#workspace22 #inline26 form p {
  grid-column: 1/-1;
  margin: 0;
}
#workspace22 #inline26 form p {
  font-size: 11px;
}
#workspace22 #quick23 input,
#workspace22 #quick23 select {
  padding: 6px;
}
#workspace22 .settingsgrid12 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
#workspace22 .settingsgrid12 h3 {
  margin: 4px 0 10px;
}
#workspace22 .settingsgrid12 label {
  display: block;
  margin: 6px 0;
}
#workspace22 .settingsgrid12 small {
  display: block;
  margin-top: 8px;
}
@media (max-width: 850px) {
  #workspace22 #inline26 form,
  #workspace22 .settingsgrid12 {
    grid-template-columns: 1fr 1fr;
  }
}

.inventory13filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.inventory13filters label {
  min-width: 0;
}
.inventory13filters input,
.inventory13filters select {
  width: 100%;
}

#navigation14 {
  width: min(760px, 92vw);
  max-height: 85vh;
  overflow: auto;
}
#navigation14 .v14head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.navigation14grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  margin: 10px 0;
}
.navigation14grid button {
  text-align: left;
  min-height: 40px;
  white-space: normal;
}
#navigation14 h3 {
  margin: 14px 0 4px;
}
#oldNavigation14 {
  display: none !important;
}

#workspace14 .placement15,
#debtForm {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 16px;
  align-items: end;
}
#workspace14 .placement15 label,
#debtForm label {
  margin: 0;
}
#workspace14 .placement15 label[hidden] {
  display: none;
}
#workspace14 .placement15 button,
#debtForm button {
  justify-self: start;
}
#strategyTools14 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 700px) {
  #workspace14 .placement15 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 440px) {
  #workspace14 .placement15 {
    grid-template-columns: 1fr;
  }
}
#navigation14.unified17 {
  width: min(1500px, 95vw);
  max-height: 94vh;
  overflow: auto;
}
#navigation14.unified17 > .v14head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #151d29;
  padding: 10px 0;
}
.unified17group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
  gap: 14px;
  margin: 12px 0;
}
.unified17section {
  min-width: 0;
  border: 1px solid #35465b;
  border-radius: 12px;
  padding: 14px;
  overflow: auto;
}
.unified17section h3 {
  margin-top: 0;
}
.unified17section label {
  display: block;
  margin: 8px 0;
}
.unified17section input,
.unified17section select {
  width: 100%;
  box-sizing: border-box;
}
.unified17section button {
  margin: 4px;
}
.unified17section table {
  width: 100%;
}
.inventory19scroll {
  overflow: auto;
  max-height: 52vh;
}
.inventory19scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #17253a;
}
.inventory19scroll th button {
  white-space: nowrap;
}
.inventory19scroll td {
  white-space: nowrap;
}
#edit19:not(:empty) {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid #64748b;
  border-radius: 8px;
}

/* Synthèse patrimoniale des liquidités. */
.liquidity-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.liquidity-summary > p {
  margin: 0;
}

.liquidity-capitals {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Simulateur : graphique et saisie de la rente souhaitée */
#workspace16:has(.rent-projection) {
  width: min(1200px, 94vw);
  overflow: auto;
  max-height: 94vh;
  max-height: 94dvh;
}

.rent-projection > label {
  max-width: 260px;
  margin-bottom: 16px;
}
.rent-projection p {
  margin: 4px 0 8px;
}
.projection-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: center;
  font-size: 13px;
}
.rent-projection svg {
  display: block;
  width: 100%;
  height: min(52vh, 440px);
  height: min(52dvh, 440px);
}
.rent-projection small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

/* Keep dashboard rent amounts on one line, sized to their own card. */
#rentCards .rentCard {
  container-type: inline-size;
}
#rentCards .rentCard strong {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: min(38px, 15cqi);
}

/* Positionnement de la pyramide patrimoniale */
#strategyDialog .strategy-layout {
  margin-top: -38px;
}

/* Positionnement pendant le tutoriel */
#strategyDialog:has(.tutorial-complete, .tutorial-incomplete)
.strategy-layout {
  margin-top: 16px;
}

#rentCards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Bloc Mon objectif */
@media (min-width: 1051px) {
  #lifeObjective {
    grid-column: 6/8;
    grid-row: 2/4;
    margin-bottom: 10vh;
  }
}
/* Résultats Mon objectif */
#objectiveYears,
#objectiveMonthly {
    display: block;
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-top: 5px;
}

#objectiveYears {
    color: #42dda0;
}

#objectiveMonthly {
    color: #ffbd35;
    font-size: 26px;
}
/* Simulation Mon objectif */
.objectiveActions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.objectiveActions button {
    font-size: 9px;
    padding: 3px 6px;
    background: #9e175d;
    border: 1px solid #f472b6;
    color: #ffffff;
    border-radius: 5px;
    white-space: nowrap;
}

#objectiveSimulationLabel {
    text-align: center;
    color: #ffbd35;
    margin-top: 10px;
}

#objectiveSimulationLabel:not([hidden]) {
    display: block;
}

.objectiveActions button[hidden] {
    display: none;
}
/* Intitulés des deux rentes */
#rent h2 .rente-i-label,
#lifeObjective .rente-i-label {
    color: var(--blue);
    margin-left: 0;
    font-weight: bold;
}
/* =========================================
   Infobulles Rente npdt et Rente i
   ========================================= */

.rente-tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    color: var(--blue);
    font-size: 15px;
    font-weight: normal;
    cursor: help;
    vertical-align: middle;
}

.rente-tooltip-text {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: -15px;
    z-index: 9999;
    width: 280px;
    max-width: 70vw;
    padding: 12px;
    background: #1e293b;
    color: #f1f5f9;
    border: 1px solid #475569;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    font-weight: normal;
    line-height: 1.5;
    text-align: left;
    white-space: normal;
    transition: opacity 0.2s ease;
}

.rente-tooltip:hover .rente-tooltip-text,
.rente-tooltip:focus .rente-tooltip-text {
    visibility: visible;
    opacity: 1;
}
/* Autoriser les infobulles à dépasser des cartes */
*:has(.rente-tooltip) {
    overflow: visible;
}
/* Animation du guide à l'ouverture de l'application */

.guide-animation {
    animation: guidePulse 1s ease-in-out 10;
}

@keyframes guidePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
    }

    50% {
        box-shadow: 0 0 15px 3px rgba(56, 189, 248, 0.8);
    }
}

/* Respect des préférences d'accessibilité */

@media (prefers-reduced-motion: reduce) {
    .guide-animation {
        animation: none;
    }
}
/* =========================================
   Mise en évidence pendant le tutoriel
   ========================================= */

/* Champs et blocs à compléter */
.tutorial-incomplete {
    --tutorial-color: #ffad32;
    --tutorial-background: rgba(255, 173, 50, 0.08);
}

/* Champs et blocs correctement renseignés */
.tutorial-complete {
    --tutorial-color: var(--green);
    --tutorial-background: rgba(66, 221, 160, 0.08);
}

/* Mise en évidence des champs de saisie */
input.tutorial-incomplete,
input.tutorial-complete,
select.tutorial-incomplete,
select.tutorial-complete {
    border-color: var(--tutorial-color) !important;
    background-color: var(--tutorial-background) !important;
    box-shadow: 0 0 0 1px var(--tutorial-color);
    transition: background-color 0.2s, box-shadow 0.2s;
}

/* Mise en évidence des formulaires et blocs */
form.tutorial-incomplete,
form.tutorial-complete,
.tutorial-block.tutorial-incomplete,
.tutorial-block.tutorial-complete {
    outline: 2px solid var(--tutorial-color);
    outline-offset: -2px;
    background-color: var(--tutorial-background);
    border-radius: 10px;
    padding: 12px;
    transition: background-color 0.2s, outline-color 0.2s;
}

/* Respect des préférences d'accessibilité */
@media (prefers-reduced-motion: reduce) {
    .tutorial-incomplete,
    .tutorial-complete {
        transition: none;
    }
}
/* Boutons de réinitialisation du dossier */
button.danger-button {
    background: #991b1b;
    border: 1px solid #ef4444;
    color: #ffffff;
}

button.danger-button:hover {
    background: #b91c1c;
    border-color: #f87171;
}

button.danger-button:focus-visible {
    outline: 2px solid #f87171;
    outline-offset: 3px;
}
/* ==================================================
   MON DOSSIER - GESTION SIMPLIFIEE
   ================================================== */

#navigation14.unified17 {
  width: min(1050px, 94vw);
  max-height: 90vh;
}

.dossier-profile {
  margin-bottom: 16px;
  padding: 20px;
}

.dossier-active {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dossier-active-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.35);
}

/* Conteneur principal */

.dossier-main {
  padding: 0;
  border: none;
  overflow: visible;
}

.dossier-main > h3 {
  display: none;
}

/* Deux cartes principales */

.dossier-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dossier-action-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  padding: 22px;
  border: 1px solid #35465b;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.015);
}

.dossier-action-card h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.dossier-action-card p {
  margin: 0 0 20px;
  line-height: 1.6;
  flex: 1;
}

.dossier-action-card button {
  margin: 0;
  min-height: 42px;
}

.dossier-action-card button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.dossier-action-card small {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.8;
}

.dossier-action-card [hidden] {
  display: none !important;
}

/* Options avancées */

.dossier-options {
  border: 1px solid #35465b;
  border-radius: 12px;
  margin-top: 16px;
  padding: 14px 18px;
}

.dossier-options > summary {
  cursor: pointer;
  font-weight: 600;
  color: #b8c8dc;
}

.dossier-options > summary:hover {
  color: #ffffff;
}

.dossier-options[open] > summary {
  margin-bottom: 16px;
}

.dossier-advanced-content {
  padding-top: 4px;
}

.dossier-advanced-content .unified17group {
  grid-template-columns:
    repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.dossier-reset {
  border-color: rgba(239, 68, 68, 0.4);
}

.dossier-reset > summary {
  color: #f87171;
}

/* Adaptation aux smartphones */

@media (max-width: 650px) {

  .dossier-actions {
    grid-template-columns: 1fr;
  }

  .dossier-action-card {
    padding: 16px;
  }

  .dossier-action-card button {
    width: 100%;
  }

  .dossier-profile {
    padding: 16px;
  }

}
/* Mise en avant de Mes établissements */
#strategyDialog > #strategyInstitutionsButton {
  grid-column: 1;
  grid-row: 3;
  justify-self: stretch;
  align-self: start;
  width: 100%;
  min-height: 48px;
  margin: 8px 0 0;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}
/* =========================================
   Constitution du patrimoine - Compteur
   ========================================= */

.onboarding-question-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0;
}

.onboarding-question-row h3 {
    margin: 0;
}

.onboarding-investment-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid;
}

/* Investissements renseignés */

.onboarding-investment-badge.has-investments {
    color: #4adea8;
    background: rgba(74, 222, 168, 0.08);
    border-color: rgba(74, 222, 168, 0.35);
}

/* Aucun investissement renseigné */

.onboarding-investment-badge.no-investments {
    color: #94a3b8;
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
}

/* Adaptation aux petits écrans */

@media (max-width: 768px) {
    .onboarding-question-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}