/* Version test : une identité EQO plus légère, sans modifier la feuille source. */
:root {
  --paper: #f5f6f2;
  --paper-warm: #f6f7f2;
  --panel: #ffffff;
  --green-deep: #194d36;
  --ink-faint: #58695f;
  --shadow: 0 16px 40px -28px rgba(24, 63, 43, .2), 0 2px 8px rgba(24, 63, 43, .035);
}

html { background: var(--paper); }
body {
  background: radial-gradient(ellipse at 70% 0%, #eaf1e7 0, transparent 520px), var(--paper);
}

.app-shell { padding-top: 14px; }
.app-header {
  min-height: 48px;
  flex-wrap: nowrap;
  gap: 12px;
  margin-bottom: 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0 4px;
}
.app-header .brand { width: auto; gap: 10px; }
.app-header .brand-mark { width: 32px; height: 32px; }
.app-header .brand-word { font-size: 25px; line-height: 1; }
.unit-help {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--green-deep);
  padding: 8px 4px;
  font: 600 12px var(--sans);
}
.unit-help span {
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 1px solid #8aab97;
  border-radius: 50%;
  font: 700 12px var(--sans);
}
.unit-help:hover { background: var(--green-soft); }
.net-chip { max-width: 100%; margin: 0 0 14px; white-space: normal; }

.tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-color: #dce6de;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 28px -18px rgba(24, 63, 43, .2);
}
.tabs button { color: #52675b; }
.tabs button[aria-selected="true"] {
  background: var(--green-soft);
  color: var(--green-deep);
  box-shadow: none;
}

.scanner-card {
  border: 1px solid #e0e8de;
  border-radius: 26px;
  background: radial-gradient(circle at 100% 0, #f3f7eb, transparent 250px), #fff;
  box-shadow: var(--shadow);
  color: var(--ink);
  padding: 28px;
}
.scanner-card::before, .scanner-card::after { display: none; }
.scanner-card h1 {
  max-width: none;
  color: var(--green-deep);
  font-size: clamp(27px, 6.9vw, 36px);
  line-height: 1.1;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.scanner-intro {
  max-width: 42ch;
  margin: 11px 0 0;
  color: #58695f;
  font: 400 15px/1.5 var(--sans);
}
.ledger-entry-card > .scan-zone { margin-top: 23px; gap: 8px; }
.scanner-card > .scan-zone > .btn-main {
  min-height: 60px;
  border: 1px solid #256a45;
  border-radius: 17px;
  background: linear-gradient(110deg, #256a45, #367d55);
  color: #fff;
  box-shadow: 0 10px 24px -16px rgba(25, 77, 54, .55);
  font-size: 15px;
}
.scanner-card > .scan-zone > .btn-main::before { background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px); }
.scanner-card > .scan-zone > .btn-main::after { color: #fff; }
.scan-options { border-radius: 12px; }
.scan-options summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  color: #466252;
  cursor: pointer;
  list-style: none;
  font: 600 13px var(--sans);
}
.scan-options summary::-webkit-details-marker { display: none; }
.scan-options summary span { font-size: 18px; transition: transform .15s ease; }
.scan-options[open] summary span { transform: rotate(180deg); }
.scan-options[open] .opts { padding: 3px 0 7px; }
.opts .btn-mini, .manual .btn-ghost {
  min-height: 44px;
  border-color: #d6e3d9;
  background: #f2f6f1;
  color: var(--green-deep);
}
.opts .btn-mini:hover:not(:disabled) { border-color: #93b29e; background: #e7f0e6; color: var(--green-deep); }
.opts .btn-mini[aria-pressed="true"] { background: var(--green-soft); border-color: var(--green); color: var(--green-deep); }
.status { min-height: 0; color: #52675b; }
.status:empty { display: none; }
.status .err { color: #983d29; }
.scanner-divider { margin: 13px 0 15px; color: #607265; font-size: 10px; letter-spacing: .07em; }
.scanner-divider::before, .scanner-divider::after { background: #e0e8de; }
.entry-launchers { gap: 9px; }
.entry-launch {
  min-height: 116px;
  gap: 6px;
  border-color: #dfe9df;
  border-radius: 17px;
  background: #f5f8f2;
  color: var(--green-deep);
  padding: 14px 12px;
}
.entry-launch:hover, .entry-launch:focus-visible { border-color: #9bb8a4; background: #edf4e8; }
.entry-launch > span { margin: 0; background: #e5efdf; color: #3c714d; }
.entry-launch strong { font-size: 14px; }
.entry-launch small { color: #576a5d; font-size: 11px; }
.footer-project-link { color: #52675b; }

.budget-hero.month-card {
  border-color: #d8e6d6;
  background: radial-gradient(circle at 100% 0, #e9f1df, transparent 300px), #f9fcf5;
  box-shadow: var(--shadow);
  color: var(--ink);
}
.budget-hero.month-card::after { display: none; }
.month-card .month-nav strong, .month-card .month-nav button { color: var(--green-deep); }
.month-card .month-nav button { border-color: #d6e3d3; background: #fff; }
.month-card .month-nav button:hover:not(:disabled) { color: var(--green-deep); border-color: #94b29b; }
.month-card .account-mode { border-color: #d9e6d7; color: #52675b; }
.month-card .account-mode strong { color: #546e45; }
.month-card .balance-stage > span { color: #46614e; }
.month-card .balance-stage > strong { color: var(--green-deep); }
.month-card .balance-stage > strong small { color: #7c601c; }
.month-card .balance-stage > small { color: #58695f; }
.month-card.over .balance-stage > strong { color: #983d29; }
.month-card .month-gauge { border: 0; background: #e0e9db; box-shadow: none; }
.month-card.good .month-gauge > span { background: linear-gradient(90deg, #42815a, #79a768); }
.month-card .balance-meta > div { border-color: #dce7d7; background: rgba(255,255,255,.8); }
.month-card .balance-meta span, .month-card .balance-source { color: #58695f; }
.month-card .balance-meta strong { color: var(--green-deep); }
.month-card .explain-link { border-color: #d6e3d3; background: #fff; color: var(--green-deep); }
.month-card .explain-link i { background: #e2f0e7; color: var(--green-deep); }
.month-card .account-add { border-color: #256a45; background: #256a45; color: #fff; }
.month-card .account-add:hover { background: #194d36; }

.account-history, .project-context {
  margin: 20px 0;
  border: 1px solid #dfe7de;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}
.account-history > summary, .project-context > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  color: var(--green-deep);
  padding: 17px 20px;
  cursor: pointer;
  list-style: none;
  font: 650 15px var(--sans);
}
.account-history > summary::-webkit-details-marker, .project-context > summary::-webkit-details-marker { display: none; }
.account-history[open] > summary, .project-context[open] > summary { border-bottom: 1px solid #e5eae2; }
.account-history-body, .project-context-body { display: grid; gap: 14px; padding: 14px; }
.account-history-body .card, .project-context-body .card { margin: 0; box-shadow: none; }
.project-context .further-card { background: #f1f6eb; color: var(--ink); }
.project-context .further-card h2, .project-context .further-card .eyebrow { color: var(--green-deep); }
.project-context .further-card p, .project-context .further-card .explain-link { color: #52675b; }

:is(.unit-help, .scan-options summary, .account-history summary, .project-context summary):focus-visible {
  outline: 3px solid #256a45;
  outline-offset: 3px;
}

@media (max-width: 640px) {
  .app-shell { padding: 10px 12px calc(104px + env(safe-area-inset-bottom)); }
  .app-header { margin-bottom: 12px; }
  .scanner-card { padding: 24px 20px; border-radius: 24px; }
  .tabs { border-color: #dce6de; background: rgba(255, 255, 255, .96); }
  .tabs button[aria-selected="true"] { background: #e2f0e7; color: #194d36; }
  .entry-launch { min-height: 106px; padding: 12px 9px; }
}

@media (max-width: 365px) {
  .scanner-card { padding: 22px 16px; }
  .entry-launchers { gap: 6px; }
  .entry-launch strong { font-size: 13px; }
}

/* Petit écran : gagner de l’espace sans réduire les cibles tactiles ni masquer les postes. */
@media (max-width: 640px) and (max-height: 650px) {
  .app-header { margin-bottom: 6px; }
  .scanner-card { padding-top: 18px; padding-bottom: 14px; }
  .scanner-intro { margin-top: 8px; }
  .ledger-entry-card > .scan-zone { gap: 6px; }
  .ledger-entry-card > .scan-zone { margin-top: 17px; }
  .scanner-card > .scan-zone > .btn-main { padding-top: 15px; padding-bottom: 15px; }
  .scanner-divider { margin-top: 7px; margin-bottom: 8px; }
  .entry-launch { min-height: 94px; padding-top: 10px; padding-bottom: 10px; gap: 5px; }
  .entry-launch > span { width: 25px; height: 25px; }
  .entry-launch small { line-height: 1.3; }
}

@media (prefers-reduced-motion: reduce) {
  .scan-options summary span { transition: none; }
}
/* Catalogue étendu : identification et calcul séparés, sans surcharger le ticket. */
.catalog-tools { margin-top: 0; border-top: 1px solid #dfe5dc; padding: 18px 20px; }
.catalog-tools details { padding: 12px 0; }
.catalog-tools summary { cursor: pointer; font-size: .9rem; font-weight: 650; color: #47604e; min-height: 32px; }
.catalog-tools form { display: grid; gap: 16px; padding-top: 14px; }
.catalog-tools label { display: grid; gap: 8px; font-size: .88rem; font-weight: 650; color: #526256; }
.catalog-tools input, .catalog-tools select { width: 100%; min-width: 0; font-family: inherit; font-size: 1rem; padding: 13px 14px; border-radius: 13px; background: #fff; border: 1px solid #ccd6cc; color: #173824; }
.catalog-tools select { text-overflow: ellipsis; }
.catalog-pricing { padding: 18px 0 4px; }
.catalog-pricing h3 { font-family: inherit; font-size: 1.1rem; margin: 0 0 14px; color: #1d402b; }
.catalog-hint, .catalog-notice { font-size: .84rem; line-height: 1.55; color: #68756b; margin: 12px 0; }
.catalog-notice { background: #fbf5e7; border-radius: 12px; padding: 12px 14px; color: #6d592d; }
.catalog-modes { display: flex; gap: 5px; background: #edf1eb; border-radius: 13px; padding: 5px; }
.catalog-modes button { flex: 1; min-width: 0; min-height: 45px; padding: 9px 5px; border: 0; border-radius: 9px; background: transparent; color: #607066; font-weight: 600; font-size: .79rem; line-height: 1.25; font-family: inherit; cursor: pointer; }
.catalog-modes button[aria-pressed="true"] { background: #fff; color: #214c32; box-shadow: 0 2px 8px #17382412; }
.catalog-candidates { display: grid; gap: 9px; margin-top: 14px; max-height: 380px; overflow: auto; }
.catalog-candidates button { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; width: 100%; min-height: 70px; border: 1px solid #dde5d9; border-radius: 14px; background: #f8faf6; text-align: left; cursor: pointer; color: #214530; font-family: inherit; }
.catalog-candidates button:hover { background: #edf4e8; border-color: #96b389; }
.catalog-candidates strong { display: block; font-size: .9rem; line-height: 1.35; }
.catalog-candidates small, .catalog-selected small { display: block; font-size: .72rem; line-height: 1.4; color: #768275; margin-top: 5px; }
.catalog-candidates .catalog-factor { flex-shrink: 0; font-weight: 750; font-size: 1rem; text-align: right; }
.catalog-current, .catalog-selected { padding: 16px; border: 1px solid #dbe5d3; border-radius: 16px; background: #f2f7ed; }
.catalog-selected strong { display: block; margin-top: 5px; line-height: 1.4; }
.catalog-selected > span { text-transform: uppercase; letter-spacing: .07em; font-size: .66rem; color: #708064; }
.catalog-current { display: grid; gap: 13px; margin: 16px 0; }
.catalog-tools .catalog-remember { display: flex; align-items: center; gap: 10px; font-weight: 500; line-height: 1.4; }
.catalog-remember input { width: 20px; height: 20px; flex-shrink: 0; margin: 0; accent-color: #3c7047; }
.catalog-optional { font-weight: 400; color: #8a9388; }
.catalog-forget { background: transparent; border: 0; padding: 8px 0; text-align: left; cursor: pointer; font: inherit; font-size: .76rem; color: #7d7768; min-height: 35px; }
.catalog-tools .btn-ghost, .catalog-tools .btn-main { font-size: .82rem; min-height: 45px; }
.catalog-web a { display: inline-flex; align-items: center; text-decoration: none; }
.catalog-source { margin: 14px 0; border: 1px solid #dfe6da; border-radius: 13px; padding: 12px 14px; background: #fffdf7; }
.catalog-source summary { cursor: pointer; color: #446044; font-size: .79rem; font-weight: 600; line-height: 1.4; }
.catalog-source p { font-size: .78rem; color: #68756b; line-height: 1.6; margin: 12px 0 0; overflow-wrap: anywhere; }
.catalog-source a { color: #315b3a; text-underline-offset: 3px; }
.catalog-tools button:focus-visible, .catalog-tools summary:focus-visible, .catalog-tools a:focus-visible { outline: 3px solid #9abc82; outline-offset: 3px; }
@media (max-width: 360px) {
  .catalog-modes button { font-size: .72rem; }
  .catalog-candidates button { padding: 11px; gap: 8px; }
  .catalog-candidates .catalog-factor { font-size: .88rem; }
}

/* Repères du compte : la mesure reste fixe, seule la comparaison change. */
.reference-sheet {
  width: min(860px, calc(100% - 28px));
  max-width: none;
  max-height: min(92dvh, 850px);
  margin: auto;
  border: 0;
  border-radius: 30px;
  background: transparent;
  box-shadow: 0 40px 100px rgba(10, 38, 24, .28);
  color: var(--ink);
  padding: 0;
  overflow: hidden;
}
.reference-sheet::backdrop {
  background: rgba(15, 35, 24, .58);
  backdrop-filter: blur(7px);
}
.reference-sheet-panel {
  max-height: min(92dvh, 850px);
  overflow: auto;
  background:
    radial-gradient(circle at 100% 0, rgba(224, 238, 204, .9), transparent 360px),
    #fffefa;
  padding: clamp(26px, 5vw, 48px);
}
.reference-sheet-panel > h2 {
  max-width: 640px;
  margin: 6px 0 12px;
  color: var(--green-deep);
  font: 700 clamp(29px, 4.3vw, 44px)/1.04 var(--display);
  letter-spacing: -.04em;
}
.reference-sheet-panel > #reference-sheet-intro {
  max-width: 690px;
  margin: 0;
  color: #55675c;
  font-size: 15px;
  line-height: 1.55;
}
.reference-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}
.reference-choices button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 17px;
  min-width: 0;
  min-height: 270px;
  border: 1px solid #d9e5d7;
  border-radius: 22px;
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 16px 36px -32px rgba(10, 49, 28, .65);
  color: var(--ink);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.reference-choices button:hover {
  transform: translateY(-3px);
  border-color: #8eaf91;
  background: #fff;
  box-shadow: 0 24px 42px -30px rgba(10, 49, 28, .5);
}
.reference-choice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
  height: 38px;
  border-radius: 999px;
  background: #e3efe0;
  color: #296444;
  font: 700 12px/1 var(--mono);
  letter-spacing: .04em;
  padding: 0 12px;
}
.reference-choices button:nth-child(2) .reference-choice-icon { background: #fff1c8; color: #75570d; }
.reference-choices button:nth-child(3) .reference-choice-icon { background: #e1eee9; color: #15563c; }
.reference-choices button > span:last-child { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.reference-choices strong { color: var(--green-deep); font: 700 17px/1.22 var(--display); }
.reference-choices small { min-height: 36px; margin-top: 7px; color: #657469; font-size: 12px; line-height: 1.4; }
.reference-choices b { margin-top: auto; color: #1d5639; font: 700 20px/1.1 var(--mono); letter-spacing: -.04em; }
.reference-choices b em { font: 600 10px/1 var(--sans); letter-spacing: 0; }
.reference-choices i { margin-top: 8px; color: #78847b; font-size: 10px; font-style: normal; line-height: 1.4; }
.reference-source-note { margin: 18px 2px 0; color: #78847b; font-size: 11px; line-height: 1.5; }
.reference-source-note a { color: #315f43; text-underline-offset: 2px; }

.comparison-reference {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 285px) auto;
  align-items: center;
  gap: 15px;
  border: 1px solid #dbe6d8;
  border-radius: 21px;
  background:
    radial-gradient(circle at 0 50%, rgba(225, 239, 210, .7), transparent 260px),
    #fffefa;
  box-shadow: 0 18px 42px -37px rgba(16, 59, 35, .5);
  padding: 15px 17px;
}
.comparison-reference-copy { display: flex; flex-direction: column; min-width: 0; }
.comparison-reference-copy > span,
.comparison-reference label > span {
  color: #718077;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.comparison-reference-copy strong { margin-top: 3px; color: var(--green-deep); font: 700 18px/1.2 var(--display); }
.comparison-reference-copy small { margin-top: 3px; color: #66756b; font-size: 11px; line-height: 1.4; }
.comparison-reference label { display: grid; gap: 5px; min-width: 0; }
.comparison-reference select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #ccd9cc;
  border-radius: 13px;
  background-color: #f8faf5;
  color: #214d35;
  font: 650 13px/1.2 var(--sans);
  padding: 9px 34px 9px 12px;
}
.comparison-reference .explain-link { width: 42px; min-height: 42px; border-color: #d6e2d5; padding: 0; }
.comparison-reference .explain-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.comparison-coverage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 15px;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.35;
}
.comparison-coverage.is-partial { background: #fff4d6; color: #6c5721; }
.comparison-coverage.is-complete { background: #e6f2e4; color: #315d3f; }
.comparison-coverage strong { color: inherit; font-size: 11px; }
.comparison-coverage span { text-align: right; }

.reference-choices button:focus-visible,
.comparison-reference select:focus-visible,
.comparison-reference .explain-link:focus-visible {
  outline: 3px solid #8fb88f;
  outline-offset: 3px;
}

@media (max-width: 720px) {
  .reference-sheet { width: min(620px, calc(100% - 20px)); border-radius: 25px; }
  .reference-choices { grid-template-columns: 1fr; }
  .reference-choices button { flex-direction: row; min-height: 0; padding: 17px; }
  .reference-choices small { min-height: 0; }
  .reference-choices b { margin-top: 13px; }
  .comparison-reference { grid-template-columns: minmax(0, 1fr) 42px; }
  .comparison-reference label { grid-column: 1 / -1; grid-row: 2; }
  .comparison-reference .explain-link { grid-column: 2; grid-row: 1; }
}

@media (max-width: 420px) {
  .reference-sheet-panel { padding: 25px 18px 22px; }
  .reference-sheet-panel > h2 { font-size: 29px; }
  .reference-choices { margin-top: 20px; }
  .reference-choice-icon { min-width: 44px; height: 34px; padding: 0 9px; }
  .reference-choices strong { font-size: 15px; }
  .reference-choices b { font-size: 18px; }
  .comparison-reference { padding: 14px; }
  .comparison-coverage { align-items: flex-start; flex-direction: column; gap: 3px; }
  .comparison-coverage span { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .reference-choices button { transition: none; }
}
