/* Saisie uniquement. Aucun sélecteur ne cible les résultats ou le comparateur. */
#stageShell {
  border: 1px solid #dce9ea;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 40px #39767c08;
  padding: 0;
  overflow: hidden;
}
#stageShell .stage-head {
  padding: 24px 30px;
  margin: 0;
  border-bottom: 1px solid #dce9ea;
  background: #fcfefe;
}
#stageShell #stageTitle { font-size: clamp(24px, 2.5vw, 30px); line-height: 1.3; }
#stageShell #stageKicker { color: #3e8f98; }
#stageShell #taxForm { padding: 28px 30px 24px; }
#stageShell .panel { border: 0; box-shadow: none; background: transparent; }
#stageShell .grid,
#stageShell .v16-card-grid { column-gap: 22px; row-gap: 20px; }
#stageShell .field { min-width: 0; }
#stageShell .field label { font-size: 12px; line-height: 1.5; margin-bottom: 6px; }
#stageShell :is(input, select, textarea) {
  border: 1px solid #bfd4d6;
  border-radius: 8px;
  padding: 12px;
  min-height: 47px;
  font-size: 14px;
  font-weight: 400;
  color: #484848;
  background-color: #fff;
  max-width: 100%;
}
#stageShell :is(input, select, textarea):disabled { background-color: #f3f7f7; color: #657474; }
#stageShell :is(input, select, textarea, button, summary):focus-visible {
  outline: 3px solid #347681;
  outline-offset: 3px;
}
#stageShell .person-title { padding: 0; border: 0; background: transparent; font-size: 16px; }
#stageShell :is(.salary-card, .v16-asset-card, .v16-property-card, .pd-person-card, .pd-card) {
  border: 1px solid #dce9ea;
  border-radius: 12px;
  background: #fafdfe;
  box-shadow: none;
}
/* Structure commune avec Genève. Les aides restent en lecture seule. */
body.saisie-layout-active .topbar .progress-wrap { display: none !important; }
#stageShell .saisie-steps {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  list-style: none; gap: 8px; padding: 20px 24px; margin: 0;
  background: #fcfefe; border-bottom: 1px solid #dce9ea;
}
#stageShell .saisie-steps:has(>li:last-child:nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#stageShell .saisie-steps li {
  min-width: 0; display: block;
}
#stageShell .saisie-steps button {
  display: flex; align-items: center; gap: 8px; padding: 10px 8px;
  font-size: 11px; line-height: 1.5; color: #484848; border-radius: 8px;
  border: 0; background: transparent; width: 100%; height: 100%; text-align: left;
}
#stageShell .saisie-steps button:hover { background: #edfbfc; }
#stageShell .saisie-steps [aria-current="step"] { background: #fff4d2; font-weight: 700; }
#stageShell .saisie-step-number {
  display: grid; place-items: center; width: 25px; height: 25px; flex: 0 0 25px;
  border-radius: 50%; border: 1px solid #dce9ea; background: white; font-size: 11px;
}
#stageShell [aria-current="step"] .saisie-step-number { background: #ffd24c; border-color: #ffd24c; }
#stageShell .saisie-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; }
#stageShell .saisie-body>.stage-head { grid-column: 1; padding: 32px 36px 24px; border: 0; background: white; }
#stageShell .saisie-body>#errorBox { grid-column: 1; }
#stageShell .saisie-body>#taxForm { grid-column: 1; padding: 0 36px 30px; min-width: 0; }
#stageShell .saisie-body #stageKicker, #stageShell .saisie-body #stageCount { display: none !important; }
#stageShell .saisie-body #stageTitle { font-size: 28px; letter-spacing: -.6px; margin: 0; line-height: 1.35; }
#stageShell .saisie-help {
  grid-column: 2; grid-row: 1 / 4; padding: 36px 26px;
  background: #edfbfc; border-left: 1px solid #dce9ea; color: #484848; min-width: 0;
}
#stageShell .saisie-help h3 { font-size: 20px; line-height: 1.4; margin: 0 0 16px; }
#stageShell .saisie-help p { font-size: 12px; line-height: 1.8; margin: 0; }
#stageShell .saisie-help .saisie-help-recap { border-top: 1px solid #c4e3e6; padding-top: 22px; margin-top: 26px; font-weight: 700; }
#stageShell .saisie-body :is(.grid, .v16-card-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
/* Reset every legacy 12-track span before applying the two-column field layout.
   A single span 12 (notably .mode-warning) creates ten implicit columns otherwise. */
#stageShell .saisie-body .grid>* { grid-column: 1 / -1; min-width: 0; }
#stageShell .saisie-body .grid>.field:not(.v20-ifd-panel) { grid-column: auto; padding: 0; border: 0; }
#stageShell .saisie-body .grid>:is(.w12, .section-label, .input-section-heading, .saisie-person-card) { grid-column: 1 / -1; }
/* The IFD guidance card is also a .field; retain its own padding and border.
   Wrap its heading by available card width, including beside the help column. */
#stageShell #ifdFamilyPanel .v20-ifd-head { flex-wrap: wrap; align-items: flex-start; gap: 16px 24px; }
#stageShell #ifdFamilyPanel .v20-ifd-head>div:first-child { flex: 1 1 260px; min-width: 0; }
#stageShell #ifdFamilyPanel .v20-ifd-current { max-width: 100%; }
#stageShell .saisie-person-card {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px;
  padding: 24px 20px; border: 1px solid #dce9ea; border-radius: 12px; background: white; min-width: 0;
}
#stageShell .saisie-person-card>.person-title { grid-column: 1 / -1; margin: 0; line-height: 1.5; }
#stageShell .saisie-person-card>.field { grid-column: auto; padding: 0; margin: 0; border: 0; }
#stageShell .saisie-person-card>.w12 { grid-column: 1 / -1; }
#stageShell .saisie-body :is(.v16-person-grid, .salary-grid) { grid-template-columns: minmax(0, 1fr); gap: 22px; }
#stageShell .saisie-body :is(.salary-card, .v16-asset-card, .oi-person) { padding: 24px 20px; border: 1px solid #dce9ea; border-radius: 12px; background: white; }
#stageShell .saisie-body #d02FamilyColumns { grid-template-columns: minmax(0, 1fr); }
#stageShell #otherIncomePanel .oi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#stageShell .saisie-body .d02-family-column { padding: 24px 20px; border: 1px solid #dce9ea; border-radius: 12px; }
#stageShell .saisie-body .stage-actions { margin-top: 30px; padding-top: 24px; border-color: #dce9ea; gap: 16px; }
@media(max-width: 1000px) {
  #stageShell .saisie-steps { gap: 4px; padding: 16px 12px; }
  #stageShell .saisie-steps button { flex-direction: column; text-align: center; padding: 8px 4px; }
  #stageShell .saisie-body { grid-template-columns: minmax(0, 1fr) 220px; }
  #stageShell .saisie-body>.stage-head { padding: 28px 24px 22px; }
  #stageShell .saisie-body>#taxForm { padding: 0 24px 26px; }
  #stageShell .saisie-help { padding: 30px 20px; }
}
@media(max-width: 760px) {
  #stageShell .saisie-body { grid-template-columns: minmax(0, 1fr); }
  #stageShell .saisie-help { grid-column: 1; grid-row: auto; border-left: 0; border-top: 1px solid #dce9ea; }
  #stageShell .saisie-steps { display: flex; overflow-x: auto; }
  #stageShell .saisie-steps li { flex: 0 0 110px; }
}
@media(max-width: 520px) {
  #stageShell .saisie-body>.stage-head { padding: 24px 18px 20px; }
  #stageShell .saisie-body>#taxForm { padding: 0 18px 24px; }
  #stageShell .saisie-body :is(.grid, .v16-card-grid, .saisie-person-card) { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  #stageShell #otherIncomePanel .oi-row { grid-template-columns: minmax(0, 1fr); }
  #stageShell .saisie-person-card, #stageShell .saisie-body :is(.salary-card, .v16-asset-card, .oi-person, .d02-family-column) { padding: 20px 14px; }
  #stageShell .saisie-body .stage-actions { flex-wrap: wrap; }
}
#stageShell :is(.salary-head, .v16-asset-card>header) { background: transparent; }
#stageShell .v18-period { background: #edfbfc; border-color: #c4e3e6; border-radius: 12px; }
#stageShell details { border-color: #dce9ea; border-radius: 10px; }
#stageShell details>summary { padding: 16px 18px; }
#stageShell :is(.field-note, .v16-salary-help) { line-height: 1.65; }
#stageShell .btn { border-radius: 8px; min-height: 46px; padding: 12px 22px; }
#stageShell :is(.btn.primary, .btn-primary, button[data-next]) { background: #ffd24c; color: #343434; border-color: #ffd24c; }
#stageShell :is(.btn.primary, .btn-primary, button[data-next]):hover { background: #ffde7a; }
#stageShell #errorBox:not(:empty) { margin: 20px 30px 0; }
@media(max-width: 600px) {
  #stageShell .stage-head { padding: 20px 18px; }
  #stageShell #taxForm { padding: 22px 18px; }
  #stageShell .grid, #stageShell .v16-card-grid { gap: 16px; }
  #stageShell .btn { padding: 12px 16px; }
}

/* Fiona v4 slides 7–12: help stays in the sidebar; input grids remain responsive. */
#taxForm :is(.field-note,.v236-securities-help:not([id]),.oi-note){display:none}
#taxForm .field>small{display:none}
#stageShell #otherIncomePanel .oi-row{grid-template-columns:repeat(3,minmax(0,1fr))}
#stageShell #otherIncomePanel .oi-remove{grid-column:1/-1;justify-self:end}
#stageShell .saisie-body #d02FamilyColumns .d02-family-column{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start}
#stageShell .saisie-body #d02FamilyColumns .d02-family-column h4{grid-column:1/-1}
@media(max-width:600px){#stageShell #otherIncomePanel .oi-row,#stageShell .saisie-body #d02FamilyColumns .d02-family-column{grid-template-columns:minmax(0,1fr)}}

#stageShell .saisie-body #d02FamilyColumns .d02-family-column>.field{grid-column:auto}
