/* Polices hébergées localement (Fontsource, licence OFL) : aucune requête vers Google. */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("fonts/manrope-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Hanken Grotesk"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("fonts/hanken-grotesk-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); }


  /* L'appli n'a qu'un seul thème : sombre. */
  :root {
    --bg: #10111c;
    --surface: #191c2b;
    --surface-2: #212439;
    --border: #2b2e45;
    --border-strong: #3c4060;
    --text: #edeef7;
    --muted: #9599b5;
    --accent: #8490ff;
    --accent-dark: #a3adff;
    --accent-soft: rgba(132, 144, 255, 0.14);
    --on-accent: #10111c;
    --green: #3fd48a;
    --green-bg: rgba(63, 212, 138, 0.13);
    --red: #ff7269;
    --red-bg: rgba(255, 114, 105, 0.13);
    --amber: #e3a13d;
    --amber-bg: rgba(227, 161, 61, 0.14);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 32px -16px rgba(0, 0, 0, 0.6);
    --bg-image: url("bg-dark.svg");
    --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
    --radius-sm: 9px; --radius: 14px; --radius-lg: 20px;
    --font-display: "Manrope", -apple-system, "Segoe UI", sans-serif;
    --font-body: "Hanken Grotesk", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color-scheme: dark;
  }
  * { box-sizing: border-box; }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
    }
  }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    padding: 28px 16px 64px;
    -webkit-font-smoothing: antialiased;
  }
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--bg-image) center / cover no-repeat;
    pointer-events: none;
  }
  .wrap { max-width: 920px; margin: 0 auto; }
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
  }
  h1 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .brand-logo { display: block; width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px var(--border-strong), 0 2px 10px rgba(0, 0, 0, 0.35); }
  .month-picker {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px 5px;
    box-shadow: var(--shadow-sm);
  }
  .month-picker button {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    padding: 5px 9px;
    border-radius: 7px;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .month-picker button:hover { background: var(--surface-2); color: var(--text); }
  .month-label {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.82rem;
    min-width: 128px;
    text-align: center;
    text-transform: capitalize;
    color: var(--text);
  }

  .cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--border-strong);
  }
  .card.income::before { background: var(--green); }
  .card.expense::before { background: var(--red); }
  .card.balance::before { background: var(--accent); }
  .card .label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
  }
  .card .value {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .card.income .value { color: var(--green); }
  .card.expense .value { color: var(--red); }
  .card.balance .value.pos { color: var(--green); }
  .card.balance .value.neg { color: var(--red); }
  .card.balance .value.warn { color: var(--amber); }
  .balance-warn-badge[hidden] { display: none; }
  .balance-warn-badge {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--amber);
    background: var(--amber-bg);
    border: 1px solid var(--amber);
    border-radius: 999px;
    padding: 2px 9px;
  }
  .balance-alert {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
  }
  .balance-alert label { font-size: 0.72rem; color: var(--muted); font-weight: 500; margin: 0; }
  .balance-alert input {
    width: 64px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.75rem;
    color: var(--text);
  }
  .balance-alert .unit { color: var(--muted); font-size: 0.72rem; }

  .panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    padding: 18px;
    margin-bottom: 16px;
  }
  .panel h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.005em;
    margin: 0 0 14px;
    font-size: 1.02rem;
  }

  .panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
  }
  .panel-header h2 { margin: 0; }
  .collapse-btn {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--muted);
    border-radius: 9px;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
  }
  .collapse-btn:hover { border-color: var(--accent); color: var(--accent); }
  .collapse-btn .chevron { transition: transform 0.2s ease; }
  .collapse-btn.collapsed .chevron { transform: rotate(-90deg); }

  form.add-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    align-items: end;
  }
  form.add-form .field { display: flex; flex-direction: column; gap: 4px; }
  form.add-form label { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
  input, select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 9px;
    padding: 9px 10px;
    font-family: inherit;
    font-size: 0.9rem;
    width: 100%;
    transition: border-color 0.15s ease, background 0.15s ease;
  }
  input[type="number"], input[type="date"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  input:hover, select:hover { border-color: var(--border-strong); }
  input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); background: var(--surface); }
  .type-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: 9px;
    overflow: hidden;
  }
  .type-toggle button {
    flex: 1;
    border: none;
    background: var(--surface-2);
    color: var(--muted);
    padding: 9px 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
  }
  .type-toggle button.active[data-type="income"] { background: var(--green-bg); color: var(--green); font-weight: 700; }
  .type-toggle button.active[data-type="expense"] { background: var(--red-bg); color: var(--red); font-weight: 700; }

  button.submit-btn {
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 9px;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    transition: background 0.15s ease, transform 0.1s ease;
  }
  button.submit-btn:hover { background: var(--accent-dark); }
  button.submit-btn:active { transform: translateY(1px); }

  table { width: 100%; border-collapse: collapse; margin-top: 4px; }
  th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
  }
  td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
  tr:last-child td { border-bottom: none; }
  tr:hover td { background: var(--surface-2); }
  td:first-child {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: var(--muted);
    font-size: 0.82rem;
  }
  td.amount {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
  }
  td.amount.income { color: var(--green); }
  td.amount.expense { color: var(--red); }
  .cat-pill {
    display: inline-block;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.78rem;
  }
  select.cat-select {
    display: inline-block;
    width: auto;
    max-width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 22px 2px 10px;
    font-size: 0.78rem;
    color: var(--text);
    cursor: pointer;
  }
  select.cat-select:hover { border-color: var(--accent); }
  .subcat-input {
    display: block;
    width: auto;
    max-width: 100%;
    margin-top: 4px;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 0.72rem;
    color: var(--muted);
  }
  .subcat-input:focus { border-style: solid; border-color: var(--accent); color: var(--text); }
  .subcat-input::placeholder { color: var(--muted); opacity: 0.7; }
  .del-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 6px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
  }
  .del-btn:hover { color: var(--red); background: var(--red-bg); }
  .empty { color: var(--muted); text-align: center; padding: 30px 10px; font-size: 0.9rem; }

  .breakdown-total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
  }
  .breakdown-total .label { color: var(--muted); font-size: 0.82rem; }
  .breakdown-total .amt {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--red);
  }

  .breakdown-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    font-size: 0.85rem;
  }
  .breakdown-row .cat-name {
    width: 132px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .breakdown-row .cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
  }
  .breakdown-row .bar-bg {
    flex: 1;
    background: var(--surface-2);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
  }
  .breakdown-row .bar-fill {
    height: 100%;
    border-radius: 999px;
    width: 0%;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .breakdown-row .amt-wrap {
    width: 128px;
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
  }
  .breakdown-row .amt {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
  .breakdown-row .pct { color: var(--muted); font-size: 0.75rem; width: 34px; text-align: right; }

  .card .sub { color: var(--muted); font-size: 0.75rem; margin-top: 4px; }

  .evolution-chart {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    padding-top: 8px;
    border-bottom: 1px solid var(--border);
  }
  .evolution-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 6px;
    padding: 4px 2px 6px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .evolution-col:hover { background: var(--surface-2); }
  .evolution-col.current { background: var(--surface-2); }
  .evolution-col.current .evolution-label { color: var(--text); font-weight: 700; }
  .evolution-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    flex: 1;
    width: 100%;
  }
  .evolution-bar {
    width: 12px;
    min-height: 2px;
    border-radius: 4px 4px 0 0;
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .evolution-bar.income { background: var(--green); }
  .evolution-bar.expense { background: var(--red); }
  .evolution-label { font-size: 0.72rem; color: var(--muted); text-transform: capitalize; white-space: nowrap; }
  .evolution-solde {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.68rem;
    font-weight: 700;
    white-space: nowrap;
  }
  .evolution-solde.pos { color: var(--green); }
  .evolution-solde.neg { color: var(--red); }

  .evolution-legend {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--muted);
  }
  .evolution-legend .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    vertical-align: middle;
  }
  .evolution-hint { margin-left: auto; font-size: 0.72rem; opacity: 0.75; }

  .sub-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    margin: 18px 0 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .period-range { display: block; font-size: 0.66rem; font-weight: 500; text-transform: none; color: var(--muted); }
  .payday-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    flex-wrap: wrap;
  }
  .payday-box label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 4px; }
  .payday-box input { width: 80px; }
  .salary-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--green-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    flex-wrap: wrap;
  }
  .salary-box label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 4px; }
  .salary-hint { color: var(--muted); font-size: 0.78rem; max-width: 420px; }
  .salary-fixed-toggle {
    display: flex !important;
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    font-weight: 500 !important;
    font-size: 0.78rem !important;
    color: var(--text);
    cursor: pointer;
    user-select: none;
  }
  .salary-fixed-toggle input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
  }
  .salary-input-wrap { display: flex; align-items: center; gap: 6px; }
  .salary-input-wrap input {
    width: 140px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--green);
    background: var(--surface);
  }
  .salary-input-wrap .unit { color: var(--muted); font-weight: 600; }

  form.recurring-form { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin-top: 4px; }

  .recurring-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
  .recurring-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
  }
  .recurring-item .rec-desc { flex: 1; min-width: 80px; font-size: 0.9rem; }
  .recurring-item .rec-amt {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
  }
  .recurring-item .rec-amt.income { color: var(--green); }
  .recurring-item .rec-amt.expense { color: var(--red); }
  .rec-day-input {
    width: 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.78rem;
    color: var(--text);
  }
  select.rec-notify-select {
    display: inline-block;
    width: auto;
    max-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 2px 22px 2px 10px;
    font-size: 0.78rem;
    color: var(--text);
    cursor: pointer;
  }
  .debit-status {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .debit-status.passed {
    background: var(--surface);
    color: var(--muted);
    border: 1px solid var(--border);
  }
  .debit-status.soon {
    background: var(--amber-bg);
    color: var(--amber);
    border: 1px solid var(--amber);
  }
  .fixed-note { color: var(--muted); font-size: 0.78rem; margin-top: 10px; }

  .notif-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
  .notif-status { color: var(--muted); font-size: 0.78rem; flex: 1; min-width: 220px; }
  .submit-btn.small { padding: 7px 12px; font-size: 0.78rem; white-space: nowrap; }

  .reminder-banner[hidden] { display: none; }
  .reminder-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    max-width: min(92vw, 460px);
    background: var(--surface);
    border: 1px solid var(--accent);
    box-shadow: var(--shadow);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1000;
    font-size: 0.85rem;
  }
  .reminder-banner button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    padding: 2px 4px;
  }

  .theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    font-size: 0.85rem;
    transition: border-color 0.15s ease;
  }
  .theme-btn:hover { border-color: var(--accent); }

  .acct-dot {
    display: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--muted);
    margin-right: 7px;
    vertical-align: middle;
  }
  .acct-dot.on { display: inline-block; }
  .acct-dot.ok { background: var(--green); }
  .acct-dot.warn { background: var(--amber); }
  .acct-dot.err { background: var(--red); }

  .account-dialog {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
    padding: 20px;
    width: min(92vw, 400px);
    font-family: var(--font-body);
  }
  .account-dialog::backdrop { background: rgba(10, 12, 24, 0.6); }
  .acct-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .acct-head h2 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 0; }
  .acct-intro { color: var(--muted); font-size: 0.88rem; margin: 0 0 14px; }
  .acct-intro strong { color: var(--text); word-break: break-all; }
  .acct-status { font-size: 0.82rem; color: var(--muted); margin: 0 0 14px; }
  .acct-form { display: grid; gap: 10px; }
  .acct-form .field { display: flex; flex-direction: column; gap: 4px; }
  .acct-form label { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
  .acct-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
  .acct-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px 16px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
  }
  .acct-secondary:hover { border-color: var(--accent); }
  .acct-secondary.small-btn { padding: 7px 12px; font-size: 0.78rem; white-space: nowrap; }
  .acct-secondary:disabled { opacity: 0.6; cursor: default; }
  .acct-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
  }
  .account-dialog { max-height: 90vh; overflow-y: auto; }
  .acct-data { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
  .acct-data summary { cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--text); }
  .acct-hint { display: block; color: var(--muted); font-size: 0.78rem; margin: 8px 0 6px; }
  .acct-data textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 8px 10px;
    resize: vertical;
  }
  .acct-data textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
  .acct-data .acct-link { margin-top: 10px; }
  .acct-danger { display: grid; gap: 8px; margin-top: 14px; justify-items: start; }
  .acct-link-danger { color: var(--red); }
  .acct-msg { min-height: 1.2em; font-size: 0.82rem; margin: 12px 0 0; color: var(--muted); }
  .acct-msg.err { color: var(--red); }
  .acct-msg.ok { color: var(--green); }

  @media (max-width: 760px) {
    .cards { grid-template-columns: 1fr; }
    form.add-form { grid-template-columns: 1fr 1fr; }
    form.add-form .field.type-field { grid-column: 1 / -1; }
    form.add-form .submit-field { grid-column: 1 / -1; }
    #txContent table, #txContent thead, #txContent tbody, #txContent th, #txContent td, #txContent tr { display: block; }
    #txContent thead { display: none; }
    #txContent tr { border-bottom: 1px solid var(--border); padding: 8px 0; position: relative; }
    #txContent tr:hover td { background: none; }
    #txContent td { border: none; padding: 3px 0; }
    #txContent td.amount { text-align: left; }
    #txContent .del-btn { position: absolute; top: 8px; right: 0; }
    form.recurring-form { grid-template-columns: 1fr 1fr; }
    .salary-box { flex-direction: column; align-items: stretch; }
    .salary-input-wrap { justify-content: flex-end; }
    .breakdown-row { flex-wrap: wrap; }
    .breakdown-row .cat-name { width: auto; flex: 1; }
    .breakdown-row .bar-bg { flex-basis: 100%; order: 3; }
    .breakdown-row .amt-wrap { width: auto; }
    .evolution-chart { gap: 4px; height: 130px; }
    .evolution-bar { width: 9px; }
    .evolution-label { font-size: 0.62rem; }
    .evolution-solde { font-size: 0.6rem; }
    .evolution-hint { display: none; }
  }

/* Pages légales et 404 */
.doc { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.doc h1 { font-family: var(--font-display); font-size: 1.6rem; margin: 0 0 4px; }
.doc h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 26px 0 8px; }
.doc p, .doc li { line-height: 1.6; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--accent-dark); }
.doc-meta { color: var(--muted); font-size: 0.85rem; margin: 0 0 8px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 8px 0; }
.doc-table th, .doc-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.doc-actions { margin: 28px 0 8px; }
.doc-links { margin: 0; font-size: 0.9rem; }
.doc-cta { display: inline-block; background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none; padding: 11px 18px; border-radius: 9px; }
.doc .doc-cta { color: var(--on-accent); }
.doc-cta:focus-visible, .doc a:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.doc-center { text-align: center; padding: 40px 20px; }
.doc-code { font-family: var(--font-mono); font-size: 3.4rem; font-weight: 600; color: var(--muted); margin: 0; }

/* Pied de page de l'application */
.site-footer { text-align: center; font-size: 0.85rem; color: var(--muted); padding: 8px 0 28px; }
.site-footer a { color: var(--muted); text-decoration: underline; }
.acct-legal { font-size: 0.8rem; color: var(--muted); margin: 8px 0 0; line-height: 1.5; }
.acct-legal a { color: var(--muted); text-decoration: underline; }
.doc-table td:first-child { font-family: var(--font-body); font-weight: 600; }
.doc-center h1 { justify-content: center; text-align: center; }

/* Bandeau d'installation de l'application (téléphone / tablette) */
.install-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px; margin-bottom: 16px; }
.install-bar[hidden], .install-bar [hidden] { display: none; }
.install-text { display: grid; gap: 2px; min-width: 0; flex: 1 1 200px; }
.install-text strong { font-family: var(--font-display); font-size: 0.95rem; color: var(--text); }
.install-text span { font-size: 0.82rem; color: var(--text); line-height: 1.4; }
.install-actions { display: flex; align-items: center; gap: 14px; }
.install-actions .acct-link { padding: 8px 2px; }

/* Champ mot de passe avec bouton Afficher / Masquer */
.pw-wrap { position: relative; display: flex; }
.pw-wrap input { padding-right: 82px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--accent-dark); font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.pw-toggle:hover { text-decoration: underline; }
.pw-toggle:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; }

/* Menu Options : onglets */
.opt-tabs { display: flex; gap: 4px; margin: 4px 0 14px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
.opt-tabs::-webkit-scrollbar { display: none; }
.opt-tab { flex: 0 0 auto; background: none; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: var(--font-body); font-size: 0.85rem; font-weight: 600; padding: 8px 10px; cursor: pointer; border-radius: 8px 8px 0 0; }
.opt-tab[hidden], .opt-panel[hidden] { display: none; }
.opt-tab:hover { color: var(--text); }
.opt-tab[aria-selected="true"] { color: var(--accent-dark); border-bottom-color: var(--accent); }
.opt-tab:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: -2px; }
.acct-data.flat { margin-top: 0; border-top: 0; padding-top: 0; }
.inline-link { display: inline; font-size: inherit; font-weight: 600; text-decoration: underline; }

/* Bouton « Continuer avec Google » */
.google-block { margin-bottom: 14px; }
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: #ffffff; color: #1f1f1f; border: 1px solid #747775; border-radius: 9px; padding: 10px 14px; font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.google-btn:hover { background: #f1f3f4; }
.google-btn:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.acct-or { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; color: var(--muted); font-size: 0.78rem; }
.acct-or::before, .acct-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* À propos et statistiques */
.about-list { margin: 0 0 8px; display: grid; gap: 8px; }
.about-list div { display: grid; gap: 2px; }
.about-list dt { color: var(--muted); font-size: 0.78rem; }
.about-list dd { margin: 0; font-family: var(--font-mono); font-size: 0.85rem; word-break: break-word; }
.stats-body { display: grid; gap: 14px; margin-bottom: 10px; }
.stats-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-kpi { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; }
.stats-kpi .n { font-family: var(--font-mono); font-size: 1.25rem; font-weight: 600; }
.stats-kpi .l { color: var(--muted); font-size: 0.75rem; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.stats-table th, .stats-table td { text-align: right; padding: 5px 6px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table th { color: var(--muted); font-weight: 500; font-family: var(--font-body); }
.footer-version { font-family: var(--font-mono); font-size: 0.78rem; }

/* Navigation Budget / Épargne */
.view-nav { display: inline-flex; gap: 4px; padding: 4px; margin: 0 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.view-tab { background: none; border: none; color: var(--muted); font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; padding: 8px 18px; border-radius: 9px; cursor: pointer; }
.view-tab:hover { color: var(--text); }
.view-tab[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); }
.view-tab:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; }
.month-picker[hidden] { display: none; }
#viewDashboard[hidden], #viewBudget[hidden], #viewSavings[hidden] { display: none; }

/* Page Épargne */
.sv-horizon { margin-left: 6px; width: auto; padding: 2px 6px; font-size: 0.78rem; border-radius: 7px; }
.sv-proj-card .label { display: flex; align-items: center; flex-wrap: wrap; }
.sv-actions { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.sv-list { display: grid; gap: 12px; }
.sv-item { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px; display: grid; gap: 6px; }
.sv-item-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: flex-start; }
.sv-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.sv-title strong { font-family: var(--font-display); font-size: 1rem; word-break: break-word; }
.sv-type { color: var(--muted); font-size: 0.78rem; }
.sv-item-actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sv-item-actions .acct-link { padding: 4px 0; }
.sv-balance { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 600; }
.sv-meta { color: var(--muted); font-size: 0.8rem; }
.sv-proj-line { font-size: 0.85rem; }
.sv-progress { height: 8px; border-radius: 6px; background: var(--border); overflow: hidden; }
.sv-progress-fill { height: 100%; background: var(--green); border-radius: 6px; }
.sv-update { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
.sv-update[hidden] { display: none; }
.sv-update input { width: 150px; }
.sv-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding: 8px 4px 0; }
.sv-col { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 6px; }
.sv-bar { background: var(--accent); border-radius: 6px 6px 2px 2px; opacity: 0.55; min-height: 2px; }
.sv-bar.current { opacity: 1; }
.sv-bar.none { background: var(--border-strong); opacity: 0.5; }
.sv-lab { color: var(--muted); font-size: 0.7rem; text-align: center; white-space: nowrap; }
@media (max-width: 480px) {
  .sv-chart { gap: 4px; }
  .sv-lab { font-size: 0.62rem; }
  .sv-col:nth-child(even) .sv-lab { visibility: hidden; }
}
.savings-hint { grid-column: 1 / -1; margin: 0; font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.savings-hint[hidden], form.add-form .field[hidden] { display: none; }

/* Boutons d'action des lignes (modifier, détails) */
.edit-btn, .rec-toggle { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.95rem; padding: 4px 6px; border-radius: 6px; transition: color 0.15s ease, background 0.15s ease; }
.edit-btn:hover, .rec-toggle:hover { color: var(--accent-dark); background: var(--accent-soft); }
.edit-btn:focus-visible, .rec-toggle:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 1px; }
.rec-toggle { transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease; }
.rec-toggle[aria-expanded="true"] { transform: rotate(180deg); }
.row-actions { white-space: nowrap; text-align: right; }

/* Ligne d'opération fixe compacte : détails repliés par défaut */
.rec-details { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; border-top: 1px dashed var(--border); }
.rec-details[hidden] { display: none; }
.rec-details select { width: auto; min-width: 130px; max-width: 100%; }
.rec-badge { font-size: 0.72rem; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.rec-badge.warn { color: var(--amber); background: var(--amber-bg); }
@media (max-width: 760px) {
  #txContent .edit-btn { position: absolute; top: 8px; right: 34px; }
  #txContent .row-actions { text-align: left; }
}

  /* Budgets par catégorie */
  .budget-hint { color: var(--muted); font-size: 0.8rem; margin: 0 0 12px; }
  .budget-row { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .budget-row:last-child { border-bottom: 0; }
  .budget-meter .bar-bg { background: var(--surface-2); border-radius: 999px; height: 8px; overflow: hidden; }
  .budget-meter .bar-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
  .budget-status { font-size: 0.74rem; color: var(--muted); margin-top: 4px; }
  .budget-row.warn .budget-status { color: var(--amber); font-weight: 600; }
  .budget-row.over .budget-status { color: var(--red); font-weight: 600; }
  .budget-input-wrap { display: flex; align-items: center; gap: 4px; }
  .budget-input { width: 90px; }
  /* Recherche et filtres des opérations */
  .tx-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
  .tx-filters input[type="search"] { flex: 2 1 220px; min-width: 0; }
  .tx-filters select { flex: 1 1 150px; min-width: 0; }
  .tx-filter-note { color: var(--muted); font-size: 0.78rem; margin: 0 0 8px; }
  .rec-period { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
  .recurring-item.inactive { opacity: 0.55; }
  @media (max-width: 600px) { .budget-row { grid-template-columns: 1fr; gap: 6px; } }

/* ===== Système de design : composants communs ===== */
button:focus-visible, a:focus-visible, summary:focus-visible, .view-tab:focus-visible { outline: 2px solid var(--accent-dark); outline-offset: 2px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
button.acct-secondary.btn-lg { padding: 13px 22px; }

/* Affichage : présentation (nouveau visiteur) ou application */
html[data-mode="app"] #landing { display: none; }
html:not([data-mode="app"]) #appRoot, html:not([data-mode="app"]) #reminderBanner { display: none; }

/* Messages de confirmation discrets */
.toast-region { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-left: 4px solid var(--green); border-radius: 12px; padding: 11px 16px; font-size: 0.88rem; box-shadow: var(--shadow); max-width: 100%; animation: toast-in 0.2s ease; }
.toast.error { border-left-color: var(--red); }
.toast.leaving { opacity: 0; transition: opacity 0.25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* États vides pédagogiques */
.empty-state { text-align: center; padding: 28px 18px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); margin-bottom: 16px; }
.empty-state h2, .empty-state h3 { font-family: var(--font-display); margin: 8px 0 6px; font-size: 1.15rem; }
.empty-state h3 { font-size: 1rem; }
.empty-state p { color: var(--muted); max-width: 460px; margin: 0 auto 16px; line-height: 1.5; font-size: 0.9rem; }
.empty-state .es-icon, .ob-step .es-icon { font-size: 2.2rem; line-height: 1; }
.empty-state .es-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.empty-state.small { padding: 18px 14px; margin-bottom: 0; background: transparent; }
.empty-state.small .es-icon { font-size: 1.7rem; }
.empty-state[hidden] { display: none; }
.cat-ico { display: inline-block; width: 1.3em; text-align: center; margin-right: 2px; }

/* Tableau de bord */
.dash-hero { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 22px; margin-bottom: 14px; box-shadow: var(--shadow); text-align: center; }
.dash-label { color: var(--muted); font-weight: 600; font-size: 0.95rem; }
.dash-left { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(2.2rem, 9vw, 3.4rem); font-weight: 600; letter-spacing: -0.02em; margin: 6px 0 2px; color: var(--green); }
.dash-left.neg { color: var(--red); }
.dash-left.warn { color: var(--amber); }
.dash-left-sub { color: var(--muted); font-size: 0.88rem; text-transform: none; }
.dash-meter, .dash-check-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 16px auto 6px; max-width: 460px; }
.dash-meter-fill, .dash-check-fill { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.5s ease; }
.dash-meter-fill.over { background: var(--red); }
.dash-meter-text { color: var(--muted); font-size: 0.8rem; }
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.dash-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.dash-stat .label, .dash-sav-row .label { color: var(--muted); font-size: 0.74rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.dash-stat .value, .dash-sav-row .value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 600; }
.dash-stat .value.income { color: var(--green); }
.dash-stat .value.expense { color: var(--red); }
.dash-stat .value.saving { color: #2ec4b6; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.dash-list, .dash-insights, .dash-check-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.dash-list li:last-child { border-bottom: 0; }
.dash-list .when { color: var(--muted); font-size: 0.8rem; display: block; }
.dash-list .amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.dash-total { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-strong); display: flex; justify-content: space-between; font-weight: 700; }
.dash-total[hidden] { display: none; }
.dash-insights li { padding: 8px 0; font-size: 0.9rem; line-height: 1.45; border-bottom: 1px solid var(--border); }
.dash-insights li:last-child { border-bottom: 0; }
.dash-cats { display: grid; gap: 8px; margin-bottom: 6px; }
.dash-cat { display: flex; justify-content: space-between; gap: 10px; font-size: 0.9rem; }
.dash-cat .amt { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.dash-check-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 0.9rem; }
.dash-check-list .mark { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; flex: 0 0 auto; }
.dash-check-list li.done .mark { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.dash-check-list li.done .txt { color: var(--muted); text-decoration: line-through; }
.dash-check-list .acct-link { margin-left: auto; }
.dash-sav-row { display: flex; gap: 32px; flex-wrap: wrap; margin-bottom: 14px; }
.privacy-card { background: var(--accent-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.privacy-card h2 { font-family: var(--font-display); font-size: 1rem; margin: 0 0 8px; }
.privacy-card ul { margin: 0 0 8px; padding-left: 20px; color: var(--muted); font-size: 0.86rem; line-height: 1.6; }

/* Objectifs d'épargne */
.goal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.goal-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.goal-card .goal-name { font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.78rem; color: var(--muted); }
.goal-card .goal-amounts { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; margin: 6px 0 8px; }
.goal-card .goal-bar { height: 10px; background: var(--surface); border-radius: 999px; overflow: hidden; }
.goal-card .goal-fill { height: 100%; background: #2ec4b6; border-radius: 999px; }
.goal-card .goal-fill.done { background: var(--green); }
.goal-card .goal-meta { color: var(--muted); font-size: 0.8rem; margin-top: 8px; line-height: 1.5; }

/* Guide de démarrage */
.onboard-dialog { border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); padding: 22px; width: min(94vw, 520px); max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow); }
.onboard-dialog::backdrop { background: rgba(10, 12, 24, 0.7); }
.ob-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ob-progress { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.ob-dots { display: flex; gap: 6px; margin-bottom: 18px; }
.ob-dots i { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); }
.ob-dots i.on { background: var(--accent); }
.ob-step { display: grid; gap: 12px; }
.ob-step[hidden] { display: none; }
.ob-step h2 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.ob-lead { color: var(--muted); margin: 0; line-height: 1.5; }
.ob-benefits { margin: 0; padding-left: 20px; line-height: 1.7; }
.ob-step .field { display: flex; flex-direction: column; gap: 4px; }
.ob-step label, .ob-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.ob-hint { color: var(--muted); font-size: 0.76rem; }
.ob-fixed { display: grid; gap: 8px; }
.ob-fixed-row { display: grid; grid-template-columns: 1fr 110px 70px; gap: 8px; align-items: center; }
.ob-fixed-row span { font-size: 0.92rem; }
.ob-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ob-choices button { border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); border-radius: 999px; padding: 8px 14px; cursor: pointer; font-size: 0.86rem; }
.ob-choices button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); font-weight: 700; }
.ob-goal-fields { display: grid; gap: 10px; }
.ob-summary { margin: 0; display: grid; gap: 8px; }
.ob-summary div { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--surface-2); border-radius: 10px; }
.ob-summary dt { color: var(--muted); }
.ob-summary dd { margin: 0; font-family: var(--font-mono); font-weight: 600; }
.ob-summary .ob-sum-total { background: var(--green-bg); font-size: 1.1rem; }
.ob-summary .ob-sum-total dt { color: var(--text); font-weight: 700; }
.ob-error { color: var(--red); min-height: 1.2em; margin: 10px 0 0; font-size: 0.86rem; }
.ob-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.ob-actions .acct-link { margin-right: auto; }
.ob-actions [hidden] { display: none; }

/* Page de présentation */
.landing { max-width: 920px; margin: 0 auto; padding: 8px 4px 40px; }
.ld-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ld-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.ld-hero { text-align: center; padding: 44px 8px 36px; }
.ld-hero h1 { display: block; font-size: clamp(2rem, 7vw, 3.1rem); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 14px; }
.ld-lead { font-size: 1.2rem; margin: 0 0 8px; }
.ld-sub { color: var(--muted); margin: 0 0 24px; }
.ld-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ld-section { padding: 28px 0; }
.ld-section h2, .ld-final h2 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 16px; letter-spacing: -0.01em; }
.ld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.ld-grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.ld-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.ld-card h3 { font-family: var(--font-display); font-size: 1rem; margin: 6px 0; }
.ld-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.5; margin: 0; }
.ld-ico { font-size: 1.6rem; }
.ld-steps { list-style: none; counter-reset: ld; margin: 0; padding: 0; display: grid; gap: 12px; }
.ld-steps li { counter-increment: ld; display: grid; gap: 4px; padding: 16px 16px 16px 60px; position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.ld-steps li::before { content: counter(ld); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.ld-steps span { color: var(--muted); font-size: 0.92rem; }
.ld-list { padding-left: 20px; line-height: 1.8; margin: 0; }
.ld-note { margin-top: 10px; }
.ld-note a, .landing p a { color: var(--accent-dark); }
.landing details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.landing summary { cursor: pointer; font-weight: 600; }
.landing details p { color: var(--muted); line-height: 1.6; margin: 10px 0 0; }
.ld-final { text-align: center; padding: 36px 0; }

/* Mobile : navigation en bas de l'écran, sections lisibles */
@media (max-width: 760px) {
  .view-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; margin: 0; display: flex; justify-content: space-around; border-radius: 0; border-width: 1px 0 0; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); }
  .view-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; padding: 6px 4px; }
  .view-tab .tab-ico { font-size: 1.15rem; }
  body { padding-bottom: 96px; }
  .dash-stats { grid-template-columns: 1fr; }
  .dash-cols { grid-template-columns: 1fr; }
  .ob-fixed-row { grid-template-columns: 1fr 96px 60px; }
  .toast-region { bottom: 92px; }
}
@media (min-width: 761px) { .view-tab .tab-ico { margin-right: 6px; } }
@media (max-width: 380px) {
  body { padding-left: 10px; padding-right: 10px; }
  .dash-hero { padding: 18px 14px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
form.add-form .field { min-width: 0; }
@media (max-width: 420px) {
  form.add-form, form.recurring-form { grid-template-columns: 1fr; }
}

.acct-compare { display: grid; gap: 8px; margin-bottom: 8px; }
.acct-compare div { display: grid; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 0.86rem; }
.acct-compare span { color: var(--muted); }
.data-explain { color: var(--muted); font-size: 0.8rem; line-height: 1.6; padding-left: 18px; margin: 12px 0 0; }
.privacy-card.in-dialog { margin: 12px 0; }
.privacy-card.in-dialog h3 { margin: 0 0 6px; font-size: 0.95rem; }
.ob-check { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text); cursor: pointer; }
.ob-check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ===== Second passage : accueil, ajout rapide, formulaires simples, mobile ===== */
.cards[hidden], .evolution-chart[hidden], .evolution-legend[hidden] { display: none; }
.unit-note { color: var(--muted); font-weight: 500; font-size: 0.8rem; }
.chart-empty { color: var(--muted); text-align: center; padding: 22px 10px; margin: 0; }
.panel.secondary h2 { font-size: 0.95rem; color: var(--muted); }
.setup-hint { background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.setup-hint p { margin: 0; flex: 1 1 260px; line-height: 1.5; font-size: 0.92rem; }
.setup-hint[hidden] { display: none; }

/* Dépenses récentes */
.dash-list .rec-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dash-list .rec-main { display: grid; min-width: 0; }
.dash-list .rec-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-ico { font-size: 1.25rem; width: 2rem; text-align: center; flex: 0 0 auto; }
.dash-list .amt.neg { color: var(--red); }
.dash-stat .value.saving { color: var(--green); }
.goal-card .goal-fill { background: var(--green); }

/* Options avancées (formulaires) */
details.adv { grid-column: 1 / -1; border: 1px dashed var(--border-strong); border-radius: 12px; padding: 4px 12px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; font-weight: 600; padding: 8px 0; list-style: none; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "＋ "; }
details.adv[open] summary::before { content: "－ "; }
details.adv .adv-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 4px 0 12px; align-items: end; }
details.adv .adv-body.wide { display: block; }
details.adv .adv-body .savings-hint, details.adv .adv-note { grid-column: 1 / -1; }
.adv-note { color: var(--muted); font-size: 0.82rem; margin: 0; }
details.panel-adv { background: var(--surface); border-style: solid; border-color: var(--border); padding: 6px 16px; margin-bottom: 16px; }

/* Bouton « Ajouter » et fenêtre d'ajout rapide */
.fab { position: fixed; right: 18px; bottom: 22px; z-index: 55; display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: var(--on-accent); border: none; border-radius: 999px; padding: 14px 20px; font-family: var(--font-body); font-weight: 800; font-size: 1rem; cursor: pointer; box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.6); transition: transform 0.12s ease, background 0.15s ease; }
.fab:hover { background: var(--accent-dark); }
.fab:active { transform: scale(0.97); }
.fab > span:first-child { font-size: 1.4rem; line-height: 1; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 12, 24, 0.65); z-index: 65; }
.sheet-backdrop[hidden] { display: none; }
#addPanel.sheet-open { position: fixed; z-index: 70; left: 50%; top: 8vh; transform: translateX(-50%); width: min(94vw, 560px); max-height: 84vh; overflow-y: auto; margin: 0; box-shadow: var(--shadow); animation: sheet-in 0.18s ease; }
#addPanel .sheet-close { display: none; }
#addPanel.sheet-open .sheet-close { display: flex; }
#addPanel.sheet-open #addToggleBtn { display: none; }
@keyframes sheet-in { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
body.sheet-lock { overflow: hidden; }
.install-bar.off-view { display: none; }
.more-tab { display: none; }

/* Mobile : zones tactiles, navigation à 5 entrées, bouton Ajouter au-dessus de la barre */
@media (max-width: 760px) {
  .more-tab { display: flex; }
  .view-tab { min-width: 0; padding: 6px 2px; font-size: 0.68rem; }
  #accountBtn { display: none; }
  .fab { bottom: calc(82px + env(safe-area-inset-bottom)); right: 14px; }
  .submit-btn, .acct-secondary, .acct-link, .type-toggle button, details.adv summary, input:not([type="checkbox"]), select { min-height: 44px; }
  .del-btn, .edit-btn, .rec-toggle, .collapse-btn { min-width: 40px; min-height: 40px; }
  #addPanel.sheet-open { top: auto; bottom: 0; left: 0; right: 0; transform: none; width: 100%; max-height: 92vh; border-radius: 20px 20px 0 0; animation: sheet-up 0.2s ease; }
  @keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .dash-list li { align-items: center; }
}
@media (max-width: 380px) {
  .view-tab .tab-ico { font-size: 1.05rem; }
  .view-tab { font-size: 0.62rem; }
}
@media (max-width: 760px) {
  .dash-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .dash-stat { padding: 10px 10px; }
  .dash-stat .label { font-size: 0.64rem; letter-spacing: 0.02em; }
  .dash-stat .value { font-size: clamp(0.8rem, 3.8vw, 1.05rem); overflow-wrap: anywhere; }
}
