/* v115 — thèmes, personnalisation et nouveaux panneaux. */
:root {
  --accent-user: #087F68;
  --accent-user-rgb: 8,127,104;
}
html[data-accent="green"] { --accent-user:#087F68; --accent-user-rgb:8,127,104; }
html[data-accent="blue"] { --accent-user:#3478F6; --accent-user-rgb:52,120,246; }
html[data-accent="purple"] { --accent-user:#8E5AF7; --accent-user-rgb:142,90,247; }
html[data-accent="rose"] { --accent-user:#D94C78; --accent-user-rgb:217,76,120; }
html[data-accent="orange"] { --accent-user:#E87924; --accent-user-rgb:232,121,36; }

html[data-accent] {
  --ca-accent: var(--accent-user) !important;
}

/* Préférences */
.preference-settings-list .preference-row { gap: 14px; }
.preference-row > span:first-child { min-width:0; display:grid; gap:2px; }
.preference-row strong { font-size:14px; font-weight:700; color:var(--ink, var(--text)); }
.preference-row small { font-size:11px; line-height:1.25; color:var(--ui-muted, var(--muted)); }
.preference-row select {
  flex:0 0 auto; max-width:145px; min-height:34px; padding:0 28px 0 10px;
  border:1px solid var(--ui-border, var(--line)); border-radius:10px;
  background:var(--ui-surface-solid, var(--paper)); color:var(--ink, var(--text)); font:inherit; font-size:13px;
}

/* Cloche et centre interne */
.notification-open { position:relative; }
.notification-open svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.notification-badge { position:absolute; top:-3px; right:-4px; min-width:16px; height:16px; padding:0 4px; border-radius:999px; display:grid; place-items:center; background:#E44C43; color:#fff; font-size:9px; font-weight:800; border:2px solid var(--paper); }
.notification-panel { max-height:min(72dvh,620px); padding:18px !important; }
.notification-head { display:grid; grid-template-columns:auto 1fr auto; align-items:start; gap:12px; margin-bottom:14px; }
.notification-head > div { text-align:center; }
.notification-list { display:grid; gap:7px; overflow:auto; max-height:calc(72dvh - 100px); }
.notification-row { width:100%; display:grid; grid-template-columns:8px minmax(0,1fr); gap:10px; align-items:start; text-align:left; padding:12px; border:1px solid var(--ui-border, var(--line)); border-radius:13px; background:var(--ui-surface-solid, var(--paper)); color:inherit; }
.notification-row.unread { background:rgba(var(--accent-user-rgb),.065); border-color:rgba(var(--accent-user-rgb),.16); }
.notification-dot { width:7px; height:7px; margin-top:6px; border-radius:50%; background:transparent; }
.notification-row.unread .notification-dot { background:var(--accent-user); }
.notification-copy { min-width:0; display:grid; gap:2px; }
.notification-copy strong { font-size:14px; }
.notification-copy span { font-size:12px; line-height:1.35; color:var(--ui-muted,var(--muted)); }
.notification-copy small { margin-top:2px; font-size:10.5px; color:var(--light); }
.notification-empty { padding:28px 12px; text-align:center; color:var(--ui-muted,var(--muted)); font-size:13px; }

/* Conflits */
.conflict-panel { max-width:520px; padding:20px !important; }
.conflict-name { margin:16px 0 8px; font-size:17px; font-weight:760; }
.conflict-choice { width:100%; min-height:64px; display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:7px; padding:11px 13px; border:1px solid var(--ui-border,var(--line)); border-radius:13px; background:var(--ui-surface-solid,var(--paper)); color:inherit; text-align:left; }
.conflict-choice > span:first-child { display:grid; gap:3px; min-width:0; }
.conflict-choice strong { font-size:14px; }
.conflict-choice small { font-size:11px; color:var(--ui-muted,var(--muted)); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

/* Onboarding */
.onboarding { position:fixed; inset:0; z-index:120; display:grid; place-items:center; padding:max(24px,var(--safe-top)) 20px max(24px,var(--safe-bottom)); background:rgba(245,247,248,.88); -webkit-backdrop-filter:blur(24px) saturate(150%); backdrop-filter:blur(24px) saturate(150%); }
.onboarding[hidden] { display:none !important; }
.onboarding-card { width:min(100%,430px); padding:26px; border-radius:26px; border:1px solid rgba(35,48,62,.08); background:rgba(255,255,255,.96); box-shadow:0 24px 70px rgba(35,48,62,.14); text-align:center; }
.onboarding-mark { width:58px; height:58px; display:grid; place-items:center; margin:0 auto 18px; border-radius:18px; background:var(--accent-user); color:white; font-size:26px; font-weight:800; }
.onboarding h2 { font-size:28px; letter-spacing:-.7px; }
.onboarding p { margin:8px auto 22px; color:#6E7781; line-height:1.45; font-size:14px; max-width:320px; }
.onboarding-primary,.onboarding-secondary { width:100%; min-height:48px; border-radius:13px; font:inherit; font-weight:720; }
.onboarding-primary { border:0; background:var(--accent-user); color:white; }
.onboarding-secondary { margin-top:8px; border:1px solid rgba(35,48,62,.10); background:#F4F6F7; color:#1C2630; }
.onboarding-back { display:block; margin:0 0 14px; border:0; background:none; color:var(--accent-user); font:inherit; font-weight:700; }
.onboarding form { display:grid; gap:10px; }
.onboarding input { width:100%; min-height:50px; padding:0 14px; text-align:center; letter-spacing:.18em; font-size:20px; font-weight:760; border:1px solid rgba(35,48,62,.12); border-radius:13px; outline:none; }
.onboarding-message { min-height:18px; margin-top:10px; font-size:12px; color:#5F6872; }
.onboarding-message.error { color:#B0443B; }

/* Vrai dark mode, pas une simple inversion. */
html[data-theme="dark"] {
  --bg:#111315;
  --paper:#15181B;
  --text:#F3F4F5;
  --ink:#F3F4F5;
  --muted:#A6ADB4;
  --light:#7F8790;
  --line:#2A2F34;
  --soft:#1C2024;
  --ui-surface:#1A1E22;
  --ui-surface-solid:#1A1E22;
  --ui-border:rgba(255,255,255,.075);
  --ui-border-strong:rgba(255,255,255,.13);
  --ui-muted:#A6ADB4;
  --control-glass-strong:rgba(24,28,32,.98);
  color-scheme:dark;
}
html[data-theme="dark"], html[data-theme="dark"] body, html[data-theme="dark"] .page { background:#15181B !important; color:#F3F4F5 !important; }
html[data-theme="dark"] body { background:linear-gradient(180deg,#121416,#171A1D) !important; }
html[data-theme="dark"] .hero,
html[data-theme="dark"] .income-block,
html[data-theme="dark"] .month-balance,
html[data-theme="dark"] .variable-category,
html[data-theme="dark"] .v110-home-main,
html[data-theme="dark"] .v110-home-tile,
html[data-theme="dark"] .v110-feature-row,
html[data-theme="dark"] .v110-annual-card,
html[data-theme="dark"] .v110-annual-ranking,
html[data-theme="dark"] .v110-search-row,
html[data-theme="dark"] .v112-bank-row,
html[data-theme="dark"] .v112-anomaly-row,
html[data-theme="dark"] .profile-account-card,
html[data-theme="dark"] .profile-settings-list,
html[data-theme="dark"] .household-summary,
html[data-theme="dark"] .household-member-row,
html[data-theme="dark"] .household-activity-row,
html[data-theme="dark"] .cloud-backup-row,
html[data-theme="dark"] .sheet,
html[data-theme="dark"] .notification-row,
html[data-theme="dark"] .conflict-choice { background:#1A1E22 !important; border-color:rgba(255,255,255,.075) !important; color:#F3F4F5 !important; box-shadow:none !important; }
html[data-theme="dark"] .sheet-drag-zone { background:#1A1E22 !important; }
html[data-theme="dark"] .ca-bottom-nav { background:rgba(24,28,32,.94) !important; border-top-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] input,html[data-theme="dark"] select,html[data-theme="dark"] textarea { background:#20252A !important; color:#F5F6F7 !important; border-color:rgba(255,255,255,.12) !important; }
html[data-theme="dark"] .category-metrics,html[data-theme="dark"] .summary-tile { background:#1D2226 !important; }
html[data-theme="dark"] .auth-gate { background:#121416 !important; }
html[data-theme="dark"] .auth-card { background:#1A1E22 !important; border-color:rgba(255,255,255,.08) !important; }
html[data-theme="dark"] .onboarding { background:rgba(12,14,16,.84); }
html[data-theme="dark"] .onboarding-card { background:#1A1E22; border-color:rgba(255,255,255,.08); color:#F3F4F5; }
html[data-theme="dark"] .onboarding p, html[data-theme="dark"] .notification-copy span { color:#A6ADB4; }
html[data-theme="dark"] .onboarding-secondary { background:#22272C; color:#F3F4F5; border-color:rgba(255,255,255,.08); }
html[data-theme="dark"] .notification-badge { border-color:#1A1E22; }

@media (max-width:700px) {
  .notification-panel,.conflict-panel { width:100% !important; border-radius:24px 24px 0 0 !important; }
  .preference-row select { max-width:126px; }
}

/* Les composants qui étaient historiquement verts suivent maintenant l'accent utilisateur. */
html[data-accent] .sheet-button.primary,
html[data-accent] .copy-confirm-button.primary,
html[data-accent] .auth-submit,
html[data-accent] .v112-primary-row-button,
html[data-accent] .v110-icon-button.primary,
html[data-accent] .v110-fab,
html[data-accent] .onboarding-primary,
html[data-accent] .profile-inline-actions button:last-child:not(.danger-action),
html[data-accent] .household-join-actions button:last-child {
  background: var(--accent-user) !important;
}
html[data-accent] input:focus,
html[data-accent] select:focus,
html[data-accent] textarea:focus {
  border-color: rgba(var(--accent-user-rgb), .42) !important;
  box-shadow: 0 0 0 3px rgba(var(--accent-user-rgb), .09) !important;
}
html[data-accent] .profile-avatar,
html[data-accent] .household-member-avatar { color: var(--accent-user) !important; }

.notification-sheet { z-index: 72 !important; }
.conflict-sheet { z-index: 96 !important; }


/* ========================================================================== */
/* v116 — ajustements UI demandés, sans toucher au moteur métier              */
/* ========================================================================== */

/* Aucun badge quand il n'y a aucune notification. */
.notification-badge[hidden],
.notification-badge:empty {
  display: none !important;
}

/* Les montants réellement négatifs prennent seulement une teinte rouge douce. */
.is-negative {
  color: #B84E49 !important;
}
html[data-theme="dark"] .is-negative {
  color: #E87973 !important;
}

/* Sélection de période/mois : supprimer l'effet de cellule blanche. */
#month-header.period-hero {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.period-control {
  min-height: 62px !important;
  padding: 9px 2px 10px !important;
  background: transparent !important;
}
.period-control-chevron {
  background: transparent !important;
  box-shadow: none !important;
}
.period-control:active .period-control-chevron {
  background: rgba(var(--accent-user-rgb), .07) !important;
}
.period-control .period-fallback.visible {
  inset: 4px 0 !important;
  background: transparent !important;
}
.period-control .period-fallback.visible .native-period-picker {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
.months {
  gap: 4px !important;
  background: transparent !important;
}
.month-button {
  min-width: 46px !important;
  min-height: 36px !important;
  padding: 0 8px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 999px !important;
  box-shadow: none !important;
}
.month-button.active {
  background: rgba(var(--accent-user-rgb), .10) !important;
  color: var(--accent-user) !important;
  box-shadow: none !important;
}

/* iOS : Bonjour + prénom + version restent sur une seule ligne. */
html.is-ios .v110-header-row {
  gap: 8px !important;
}
html.is-ios .v110-header-row h1 {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: clamp(23px, 6.8vw, 29px) !important;
  line-height: 1 !important;
  letter-spacing: -.75px !important;
}
html.is-ios .v110-header-row .app-version {
  margin-left: 4px !important;
  font-size: 8px !important;
}
html.is-ios .v110-header-actions {
  flex: 0 0 auto !important;
  gap: 6px !important;
}

/* Switch : piste et curseur restent des pilules, mais l'espace vertical est réduit. */
.ios-switch {
  flex-basis: 50px !important;
  width: 50px !important;
  height: 28px !important;
}
.ios-switch-track::after {
  top: 3px !important;
  left: 4px !important;
  width: 24px !important;
  height: 22px !important;
  border-radius: 999px !important;
}
.ios-switch input:checked + .ios-switch-track::after {
  transform: translateX(18px) !important;
}

/* Personnalisation : les valeurs restent simples, sans cellule/bordure propre. */
.preference-row select {
  min-height: 30px !important;
  max-width: 145px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-user) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  text-align: right !important;
  text-align-last: right !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
.preference-row select:focus,
.preference-row select:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

@media (max-width: 390px) {
  html.is-ios .v110-header-row h1 {
    font-size: 22px !important;
  }
  html.is-ios .v110-icon-button {
    width: 35px !important;
    height: 35px !important;
  }
}


/* ========================================================================== */
/* v117 — listes plus légères + thèmes visuels                                */
/* ========================================================================== */

/* Les sections demandées reprennent le langage très léger de Personnalisation :
   contenu directement dans la feuille, séparateurs fins, aucune grosse cellule. */
#profile-sheet .household-summary,
#profile-sheet .household-members-list,
#profile-sheet .household-settings-list,
#profile-sheet .cloud-backup-list,
#month-settings-sheet #v112-rule-list,
#month-settings-sheet #v112-history-list {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#profile-sheet .household-summary {
  min-height: 0 !important;
  margin: 0 !important;
  padding: 10px 2px 11px !important;
  border-bottom: 1px solid var(--ui-border, var(--line)) !important;
}

#profile-sheet .household-members-list {
  margin: 0 0 4px !important;
  overflow: visible !important;
}

#profile-sheet .household-member-row,
#profile-sheet .cloud-backup-row,
#month-settings-sheet #v112-rule-list .v110-feature-row,
#month-settings-sheet #v112-history-list .v110-feature-row {
  min-height: var(--ui-row-height, 54px) !important;
  margin: 0 !important;
  padding: 10px 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ui-border, var(--line)) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#profile-sheet .household-member-row:last-child,
#profile-sheet .cloud-backup-row:last-child,
#month-settings-sheet #v112-rule-list .v110-feature-row:last-child,
#month-settings-sheet #v112-history-list .v110-feature-row:last-child {
  border-bottom: 0 !important;
}

#profile-sheet .household-settings-list {
  margin: 3px 0 14px !important;
  overflow: visible !important;
}

#profile-sheet .household-settings-list .settings-row {
  min-height: var(--ui-row-height, 54px) !important;
  padding-left: 2px !important;
  padding-right: 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ui-border, var(--line)) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#profile-sheet .household-settings-list .settings-row:last-child:not([hidden]),
#profile-sheet .household-settings-list:has(#household-leave[hidden]) #household-open-join {
  border-bottom: 0 !important;
}

/* Les actions de ces listes deviennent de simples actions texte. */
#profile-sheet .household-summary .profile-mini-button,
#profile-sheet .household-member-actions button,
#profile-sheet .cloud-backup-actions button,
#month-settings-sheet #v112-rule-list .v110-feature-action,
#month-settings-sheet #v112-history-list .v110-feature-action {
  min-height: 28px !important;
  padding: 2px 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-user) !important;
}
#profile-sheet .household-member-actions .danger-action,
#profile-sheet .cloud-backup-actions .danger-action,
#month-settings-sheet #v112-rule-list .v110-feature-action.danger {
  color: #B0443B !important;
}

/* Import bancaire : choix du payeur et choix de fichier sans capsule/cellule. */
#month-settings-sheet .v112-bank-toolbar {
  gap: 12px !important;
  padding: 2px 0 !important;
}
#month-settings-sheet .v112-file-button,
#month-settings-sheet #v112-bank-payer {
  min-height: 32px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-user) !important;
  font-weight: 680 !important;
}
#month-settings-sheet #v112-bank-payer {
  text-align: right !important;
  text-align-last: right !important;
  -webkit-appearance: none !important;
  appearance: none !important;
}
#month-settings-sheet #v112-bank-payer:focus,
#month-settings-sheet #v112-bank-payer:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* -------------------------------------------------------------------------- */
/* Thème Windows 98                                                           */
/* -------------------------------------------------------------------------- */
html[data-ui-theme="win98"] {
  --accent-user: #000080 !important;
  --accent-user-rgb: 0,0,128 !important;
  --ca-accent: #000080 !important;
  --bg: #008080 !important;
  --paper: #C0C0C0 !important;
  --text: #000000 !important;
  --ink: #000000 !important;
  --muted: #404040 !important;
  --light: #666666 !important;
  --line: #808080 !important;
  --soft: #C0C0C0 !important;
  --ui-surface: #C0C0C0 !important;
  --ui-surface-solid: #C0C0C0 !important;
  --ui-border: #808080 !important;
  --ui-border-strong: #404040 !important;
  --ui-muted: #404040 !important;
  --control-glass-strong: #C0C0C0 !important;
  color-scheme: light !important;
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
}

html[data-ui-theme="win98"],
html[data-ui-theme="win98"] body {
  background: #008080 !important;
  color: #000 !important;
}
html[data-ui-theme="win98"] body,
html[data-ui-theme="win98"] button,
html[data-ui-theme="win98"] input,
html[data-ui-theme="win98"] select,
html[data-ui-theme="win98"] textarea {
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif !important;
}
html[data-ui-theme="win98"] .page {
  background: #C0C0C0 !important;
  color: #000 !important;
}

/* Surfaces classiques avec bord 3D Windows. */
html[data-ui-theme="win98"] .hero,
html[data-ui-theme="win98"] .income-block,
html[data-ui-theme="win98"] .month-balance,
html[data-ui-theme="win98"] .variable-category,
html[data-ui-theme="win98"] .profile-account-card,
html[data-ui-theme="win98"] .v110-home-main,
html[data-ui-theme="win98"] .v110-home-tile,
html[data-ui-theme="win98"] .v110-annual-card,
html[data-ui-theme="win98"] .v110-annual-ranking,
html[data-ui-theme="win98"] .notification-row,
html[data-ui-theme="win98"] .conflict-choice,
html[data-ui-theme="win98"] .auth-card,
html[data-ui-theme="win98"] .onboarding-card {
  border-top: 2px solid #FFFFFF !important;
  border-left: 2px solid #FFFFFF !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  border-radius: 0 !important;
  background: #C0C0C0 !important;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #DFDFDF !important;
  color: #000 !important;
}

html[data-ui-theme="win98"] .sheet,
html[data-ui-theme="win98"] .sheet-drag-zone {
  border-radius: 0 !important;
  background: #C0C0C0 !important;
  color: #000 !important;
}
html[data-ui-theme="win98"] .sheet {
  border-top: 2px solid #FFF !important;
  border-left: 2px solid #FFF !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #DFDFDF !important;
}
html[data-ui-theme="win98"] .sheet-handle { background:#808080 !important; border-radius:0 !important; }

html[data-ui-theme="win98"] .profile-section-label,
html[data-ui-theme="win98"] .settings-sheet-title,
html[data-ui-theme="win98"] .v110-section-head .profile-section-label {
  color: #000080 !important;
  text-shadow: 1px 1px #FFF !important;
}

html[data-ui-theme="win98"] .ca-bottom-nav {
  background: #C0C0C0 !important;
  border-top: 2px solid #FFFFFF !important;
  border-radius: 0 !important;
  box-shadow: inset 0 1px #DFDFDF !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
html[data-ui-theme="win98"] .ca-bottom-link,
html[data-ui-theme="win98"] .ca-bottom-button { color:#000 !important; }
html[data-ui-theme="win98"] body[data-active-nav="income"] .ca-bottom-link[data-ca-target="income"],
html[data-ui-theme="win98"] body[data-active-nav="fixed"] .ca-bottom-link[data-ca-target="fixed"],
html[data-ui-theme="win98"] body[data-active-nav="variable"] .ca-bottom-link[data-ca-target="variable"],
html[data-ui-theme="win98"] body[data-active-nav="menu"] .ca-bottom-link[data-ca-target="menu"],
html[data-ui-theme="win98"] body[data-active-nav="profile"] .ca-bottom-link[data-ca-target="profile"] {
  background:#000080 !important;
  color:#FFF !important;
}

html[data-ui-theme="win98"] button:not(.ca-bottom-link):not(.profile-avatar):not(.notification-open),
html[data-ui-theme="win98"] .data-button,
html[data-ui-theme="win98"] .sheet-button,
html[data-ui-theme="win98"] .copy-confirm-button,
html[data-ui-theme="win98"] .v112-file-button {
  border-top: 2px solid #FFF !important;
  border-left: 2px solid #FFF !important;
  border-right: 2px solid #404040 !important;
  border-bottom: 2px solid #404040 !important;
  border-radius: 0 !important;
  background:#C0C0C0 !important;
  color:#000 !important;
  box-shadow: inset -1px -1px #808080, inset 1px 1px #DFDFDF !important;
}
html[data-ui-theme="win98"] button:not(.ca-bottom-link):active,
html[data-ui-theme="win98"] .data-button:active,
html[data-ui-theme="win98"] .sheet-button:active {
  border-top-color:#404040 !important;
  border-left-color:#404040 !important;
  border-right-color:#FFF !important;
  border-bottom-color:#FFF !important;
  box-shadow: inset 1px 1px #808080 !important;
}

html[data-ui-theme="win98"] input,
html[data-ui-theme="win98"] select,
html[data-ui-theme="win98"] textarea {
  border-top: 2px solid #404040 !important;
  border-left: 2px solid #404040 !important;
  border-right: 2px solid #FFF !important;
  border-bottom: 2px solid #FFF !important;
  border-radius: 0 !important;
  background:#FFF !important;
  color:#000 !important;
  box-shadow: inset 1px 1px #808080 !important;
}

/* Les sélecteurs volontairement plats restent plats, même dans le thème 98. */
html[data-ui-theme="win98"] .preference-row select,
html[data-ui-theme="win98"] #v112-bank-payer {
  border:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  color:#000080 !important;
}

html[data-ui-theme="win98"] .month-button {
  border-radius:0 !important;
  color:#000 !important;
}
html[data-ui-theme="win98"] .month-button.active {
  background:#000080 !important;
  color:#FFF !important;
}
html[data-ui-theme="win98"] .category-progress,
html[data-ui-theme="win98"] .v110-progress-track {
  border:1px solid #808080 !important;
  border-radius:0 !important;
  background:#FFF !important;
}
html[data-ui-theme="win98"] .category-progress-bar,
html[data-ui-theme="win98"] .v110-progress-bar { background:#000080 !important; border-radius:0 !important; }

html[data-ui-theme="win98"] .ios-switch-track {
  background:#808080 !important;
  border:1px solid #404040 !important;
  border-radius:0 !important;
}
html[data-ui-theme="win98"] .ios-switch-track::after {
  background:#C0C0C0 !important;
  border-top:2px solid #FFF !important;
  border-left:2px solid #FFF !important;
  border-right:2px solid #404040 !important;
  border-bottom:2px solid #404040 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}
html[data-ui-theme="win98"] .ios-switch input:checked + .ios-switch-track { background:#000080 !important; }

html[data-ui-theme="win98"] .notification-badge {
  border-radius:0 !important;
  border:1px solid #FFF !important;
  background:#800000 !important;
}

/* Les listes allégées demandées restent sans grosses cartes sous tous les thèmes. */
html[data-ui-theme="win98"] #profile-sheet .household-summary,
html[data-ui-theme="win98"] #profile-sheet .household-members-list,
html[data-ui-theme="win98"] #profile-sheet .household-settings-list,
html[data-ui-theme="win98"] #profile-sheet .cloud-backup-list,
html[data-ui-theme="win98"] #month-settings-sheet #v112-rule-list,
html[data-ui-theme="win98"] #month-settings-sheet #v112-history-list,
html[data-ui-theme="win98"] #profile-sheet .household-member-row,
html[data-ui-theme="win98"] #profile-sheet .cloud-backup-row,
html[data-ui-theme="win98"] #month-settings-sheet #v112-rule-list .v110-feature-row,
html[data-ui-theme="win98"] #month-settings-sheet #v112-history-list .v110-feature-row {
  background:transparent !important;
  border-radius:0 !important;
  box-shadow:none !important;
}

/* ========================================================================== */
/* v118 — Options : hiérarchie plus légère et mieux espacée                  */
/* ========================================================================== */

/* Un séparateur discret entre chaque grande fonction, avec retrait latéral. */
#month-settings-sheet #settings-main-panel > .v110-settings-section {
  position: relative !important;
  margin-top: 0 !important;
  padding-top: 28px !important;
}

#month-settings-sheet #settings-main-panel > .v110-settings-section::before {
  content: "";
  position: absolute;
  top: 13px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--ui-border, var(--line));
  opacity: .82;
  pointer-events: none;
}

/* Les actions de tête s'alignent sur le bas du bloc texte : plus naturel
   pour Actualiser, Clôturer, Ajouter et le sélecteur du Dashboard. */
#month-settings-sheet .v110-section-head {
  align-items: flex-end !important;
  gap: 16px !important;
}

#month-settings-sheet .v110-section-head > div:first-child {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

#month-settings-sheet #v112-anomaly-refresh,
#month-settings-sheet #v110-close-toggle,
#month-settings-sheet #v110-recurring-add,
#month-settings-sheet #v110-goal-add,
#month-settings-sheet #v112-rule-add {
  align-self: flex-end !important;
  margin-bottom: 1px !important;
  flex: 0 0 auto !important;
}

/* Centre d'attention : Actualiser descend sur la ligne de description. */
#month-settings-sheet #v112-anomaly-refresh {
  transform: translateY(3px);
}

/* Dashboard : sélecteur plus bas et sans effet de cellule. */
#month-settings-sheet #v110-year-select {
  align-self: flex-end !important;
  width: auto !important;
  min-width: 62px !important;
  min-height: 28px !important;
  margin: 0 0 -1px !important;
  padding: 0 2px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-user, var(--ca-accent)) !important;
  font-weight: 720 !important;
  text-align: right !important;
  text-align-last: right !important;
}

#month-settings-sheet #v110-year-select:focus,
#month-settings-sheet #v110-year-select:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Dépenses récurrentes, objectifs et règles : listes plates sans cartes,
   avec davantage de respiration et des actions texte bien alignées. */
#month-settings-sheet #v110-recurring-list,
#month-settings-sheet #v110-goal-list,
#month-settings-sheet #v112-rule-list {
  margin-top: 10px !important;
  gap: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row,
#month-settings-sheet #v110-goal-list .v110-feature-row,
#month-settings-sheet #v112-rule-list .v110-feature-row {
  min-height: 62px !important;
  margin: 0 !important;
  padding: 12px 2px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ui-border, var(--line)) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  gap: 12px !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row:last-child,
#month-settings-sheet #v110-goal-list .v110-feature-row:last-child,
#month-settings-sheet #v112-rule-list .v110-feature-row:last-child {
  border-bottom: 0 !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row-main,
#month-settings-sheet #v110-goal-list .v110-feature-row-main,
#month-settings-sheet #v112-rule-list .v110-feature-row-main {
  min-width: 0 !important;
  padding-right: 4px !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row-title,
#month-settings-sheet #v110-goal-list .v110-feature-row-title,
#month-settings-sheet #v112-rule-list .v110-feature-row-title {
  font-size: 13.5px !important;
  line-height: 1.28 !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row-sub,
#month-settings-sheet #v110-goal-list .v110-feature-row-sub,
#month-settings-sheet #v112-rule-list .v110-feature-row-sub {
  margin-top: 4px !important;
  font-size: 10.75px !important;
  line-height: 1.3 !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-row-actions,
#month-settings-sheet #v110-goal-list .v110-feature-row-actions,
#month-settings-sheet #v112-rule-list .v110-feature-row-actions {
  align-self: center !important;
  flex: 0 0 auto !important;
  gap: 8px !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-action,
#month-settings-sheet #v110-goal-list .v110-feature-action,
#month-settings-sheet #v112-rule-list .v110-feature-action {
  min-height: 28px !important;
  padding: 2px 4px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--accent-user, var(--ca-accent)) !important;
}

#month-settings-sheet #v110-recurring-list .v110-feature-action.danger,
#month-settings-sheet #v110-goal-list .v110-feature-action.danger,
#month-settings-sheet #v112-rule-list .v110-feature-action.danger {
  color: #B0443B !important;
}

/* Objectifs : progression plus fine et intégrée à la ligne. */
#month-settings-sheet #v110-goal-list .v110-feature-progress {
  height: 4px !important;
  margin-top: 9px !important;
  background: rgba(28,42,57,.075) !important;
}

/* Clôture : donne un peu plus de hauteur au bloc sans recréer de cellule. */
#month-settings-sheet #v110-close-note {
  margin-top: 4px !important;
}

#month-settings-sheet #v110-close-toggle {
  min-height: 30px !important;
}

/* Les formulaires restent compacts mais se détachent clairement de la liste. */
#month-settings-sheet #v110-recurring-form,
#month-settings-sheet #v110-goal-form,
#month-settings-sheet #v112-rule-form {
  margin-top: 12px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--ui-border, var(--line)) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Windows 98 : garder les séparateurs nets sans réintroduire les grosses cartes. */
html[data-ui-theme="win98"] #month-settings-sheet #settings-main-panel > .v110-settings-section::before,
html[data-ui-theme="win98"] #month-settings-sheet #v110-recurring-list .v110-feature-row,
html[data-ui-theme="win98"] #month-settings-sheet #v110-goal-list .v110-feature-row,
html[data-ui-theme="win98"] #month-settings-sheet #v112-rule-list .v110-feature-row {
  border-color: #808080 !important;
}

@media (max-width: 390px) {
  #month-settings-sheet .v110-section-head {
    gap: 11px !important;
  }
  #month-settings-sheet #v110-recurring-list .v110-feature-row,
  #month-settings-sheet #v110-goal-list .v110-feature-row,
  #month-settings-sheet #v112-rule-list .v110-feature-row {
    padding-top: 11px !important;
    padding-bottom: 11px !important;
  }
  #month-settings-sheet #v110-recurring-list .v110-feature-row-actions,
  #month-settings-sheet #v110-goal-list .v110-feature-row-actions,
  #month-settings-sheet #v112-rule-list .v110-feature-row-actions {
    gap: 5px !important;
  }
}

/* ========================================================================== */
/* v119 — Foyer partagé / Sauvegardes cloud sur surfaces blanches arrondies  */
/* ========================================================================== */

/* Foyer partagé : un seul bloc visuel blanc, sans réintroduire les anciennes
   grosses cellules. Les trois sous-blocs se touchent pour former une carte. */
#profile-sheet .household-summary {
  margin: 0 !important;
  padding: 12px 14px 11px !important;
  background: #FFFFFF !important;
  border: 0 !important;
  border-bottom: 1px solid var(--ui-border, var(--line)) !important;
  border-radius: 16px 16px 0 0 !important;
  box-shadow: none !important;
}

#profile-sheet .household-members-list {
  margin: 0 !important;
  padding: 0 14px !important;
  background: #FFFFFF !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#profile-sheet .household-member-row {
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}

#profile-sheet .household-settings-list {
  margin: 0 0 16px !important;
  padding: 0 14px !important;
  background: #FFFFFF !important;
  border: 0 !important;
  border-radius: 0 0 16px 16px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#profile-sheet .household-settings-list .settings-row {
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}

/* Sauvegardes cloud : même langage, mais dans une carte indépendante. */
#profile-sheet .cloud-backup-list {
  margin: 0 0 6px !important;
  padding: 0 14px !important;
  background: #FFFFFF !important;
  border: 0 !important;
  border-radius: 16px !important;
  box-shadow: none !important;
  overflow: hidden !important;
}

#profile-sheet .cloud-backup-row {
  padding-left: 0 !important;
  padding-right: 0 !important;
  background: transparent !important;
}

#profile-sheet .cloud-backup-list > .profile-empty {
  padding: 16px 2px !important;
}

/* En sombre, on conserve exactement les mêmes volumes mais avec la surface
   sombre native au lieu d'un blanc forcé. */
html[data-theme="dark"] #profile-sheet .household-summary,
html[data-theme="dark"] #profile-sheet .household-members-list,
html[data-theme="dark"] #profile-sheet .household-settings-list,
html[data-theme="dark"] #profile-sheet .cloud-backup-list {
  background: var(--ui-surface-solid, #1A1E22) !important;
}

/* Windows 98 garde volontairement son matériau gris et ses angles carrés. */
html[data-ui-theme="win98"] #profile-sheet .household-summary,
html[data-ui-theme="win98"] #profile-sheet .household-members-list,
html[data-ui-theme="win98"] #profile-sheet .household-settings-list,
html[data-ui-theme="win98"] #profile-sheet .cloud-backup-list {
  background: #C0C0C0 !important;
  border-radius: 0 !important;
}
