.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  width: 244px;
  padding: 31px 22px 22px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}
.logo {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #20243a;
}
.logo > span {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(145deg, #6578ff, #7658e8);
  box-shadow: 0 6px 14px rgba(89, 108, 245, 0.24);
}
.logo > span i {
  position: absolute;
  bottom: 7px;
  width: 4px;
  border-radius: 4px;
  background: #fff;
  transform: rotate(18deg);
}
.logo > span i:first-child {
  height: 9px;
  left: 9px;
  opacity: 0.65;
}
.logo > span i:nth-child(2) {
  height: 15px;
  left: 15px;
  opacity: 0.82;
}
.logo > span i:last-child {
  height: 21px;
  left: 21px;
}
.sidebar > nav {
  display: grid;
  gap: 6px;
  margin-top: 48px;
}
.sidebar > nav button,
.sidebar-bottom > button {
  position: relative;
  width: 100%;
  height: 48px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  border-radius: 12px;
  color: #5b6275;
  background: transparent;
  text-align: left;
  transition: 0.2s;
}
.sidebar > nav button:hover,
.sidebar-bottom > button:hover {
  color: var(--primary);
  background: #f5f6ff;
}
.sidebar > nav button.active {
  color: var(--primary);
  background: #eef1ff;
}
.sidebar > nav button.active > i {
  position: absolute;
  right: -22px;
  width: 3px;
  height: 25px;
  border-radius: 3px 0 0 3px;
  background: var(--primary);
}
.sidebar-bottom {
  margin-top: auto;
}
.support-card {
  margin: 14px 0 20px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #eef1ff, #f8f4ff);
}
.support-card > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 9px;
  color: var(--primary);
  background: white;
  box-shadow: 0 4px 12px #596cf51c;
}
.support-card p {
  margin: 6px 0 11px;
  color: var(--muted);
}
.support-card button {
  padding: 0;
  border: 0;
  color: var(--primary);
  background: none;
}

.budget-hero {
  position: relative;
  min-height: 300px;
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border-radius: 22px;
  color: white;
  background: linear-gradient(135deg, #5065ee 0%, #6678fb 52%, #735ee8 100%);
  box-shadow: 0 18px 36px rgba(74, 88, 202, 0.22);
  overflow: hidden;
}
.budget-hero::before {
  content: "";
  position: absolute;
  width: 330px;
  height: 330px;
  right: -110px;
  top: -180px;
  border: 70px solid #ffffff0c;
  border-radius: 50%;
}
.budget-hero::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  left: -90px;
  bottom: -130px;
  border: 55px solid #ffffff0a;
  border-radius: 50%;
}
.hero-copy,
.budget-hero .ring {
  position: relative;
  z-index: 1;
}
.card-eyebrow {
  color: #d9defe;
}
.hero-copy h2 {
  margin: 8px 0 3px;
}
.hero-copy p {
  margin: 0;
  color: #e5e8ff;
}
.positive-pill {
  width: fit-content;
  margin-top: 20px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  color: #d9fff0;
  background: #224da45c;
}
.ring {
  --progress: 270deg;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#fff var(--progress), #ffffff26 0);
  transform: rotate(20deg);
}
.ring-large {
  width: 132px;
  height: 132px;
  padding: 9px;
}
.ring-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  text-align: center;
  border-radius: 50%;
  background: #6273f2;
  transform: rotate(-20deg);
}
.ring-inner strong,
.ring-inner span {
  display: block;
}
.ring-inner span {
  color: #d7dcff;
}
.hero-foot {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  align-self: end;
  padding-top: 19px;
  display: flex;
  gap: 26px;
  border-top: 1px solid #ffffff26;
}
.hero-foot span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dce0ff;
}
.hero-foot b {
  margin-left: 3px;
  color: white;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.dot.actual {
  background: white;
}
.dot.planned {
  background: #b3bcff;
}

.category-card {
  position: relative;
  min-height: 190px;
  padding: 17px;
  border-radius: 18px;
  color: white;
  overflow: hidden;
  box-shadow: 0 12px 26px rgba(50, 67, 150, 0.13);
}
.category-card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  top: -45px;
  right: -45px;
  border: 28px solid #ffffff10;
  border-radius: 50%;
}
.category-card.blue {
  background: linear-gradient(145deg, #4478ec, #5569dc);
}
.category-card.violet {
  background: linear-gradient(145deg, #6153d8, #7e49cb);
}
.category-card.cyan {
  background: linear-gradient(145deg, #13a6ca, #3f76d8);
}
.category-card.pink {
  background: linear-gradient(145deg, #b858d0, #e45d9b);
}

.transaction-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
  color: #4770e6;
  background: #eaf0ff;
}
.transaction-icon.cyan {
  color: #129bab;
  background: #e4f7f9;
}
.transaction-icon.violet {
  color: #7955cf;
  background: #f0eaff;
}
.transaction-icon.pink {
  color: #d65a91;
  background: #fdeaf2;
}
.transaction-icon.green {
  color: #299b74;
  background: #e6f7f0;
}
.transaction-icon.orange {
  color: #d58340;
  background: #fff0df;
}
.income-text {
  color: #279776 !important;
}
.bottom-nav,
/* Composants transposés de Figma Make. Les formulaires existants gardent leurs identifiants. */
:root {
  --primary:#596cf5;
  --primary-dark:#4558dc;
  --ink:#202333;
  --muted:#5b6275;
  --line:#e8ebf3;
  --surface:#fff;
  --paper:#f6f8fc;
  --shadow:0 12px 38px rgba(44,54,96,.07);
  --phase-ink:var(--ink);
  --phase-muted:var(--muted);
  --phase-border:var(--line);
  --phase-blue:var(--primary-dark);
  --phase-pale:#eef1ff;
  --brand-accent:var(--primary-dark);
}
body {color:var(--ink);background:var(--paper)}
body :is(h1,h2,h3,strong) {overflow-wrap:anywhere}
body :is(button,input:not([type=checkbox]):not([type=radio]),select,textarea,summary) {min-height:44px}
body :is(button,input,select,textarea,summary,a):focus-visible {outline:3px solid #3347c5;outline-offset:2px}
body button.primary {background:#4558dc;border-color:#4558dc;color:white}
.panel,.budget-card {background:var(--surface);border-color:var(--line);border-radius:18px;box-shadow:var(--shadow)}
.topbar {display:grid!important;position:sticky;z-index:19;top:0;grid-template-columns:minmax(0,1fr) auto 44px;align-items:center;gap:5px;
  padding:calc(7px + env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) 7px max(10px,env(safe-area-inset-left));min-height:60px;border-bottom:1px solid var(--line);background:white}
.topbar > button {padding:0;border-color:transparent}
.topbar #go-home {position:absolute;width:1px;height:1px;min-width:0;min-height:0;padding:0;overflow:hidden;clip-path:inset(50%)}
.topbar #go-home:focus-visible {width:auto;height:44px;clip-path:none;top:100%;left:12px;padding:0 12px}
.topbar #figma-reminder {display:flex;position:relative;align-items:center;justify-content:center}
.topbar #figma-reminder b {position:absolute;right:1px;top:0;padding:0 5px;background:#eef1ff;color:#3748a8;border-radius:10px;}
.topbar svg,.sidebar svg,.category-card svg,.transaction-icon svg {width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.topbar .logo {gap:6px}
#figma-period .period-nav {display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:0}
#figma-period select {padding:0 2px}
#figma-period :is(select,button) {margin:0}
.sidebar {display:none}
body main {max-width:1240px;padding:22px clamp(13px,3vw,35px) 34px}
#phase-home,#phase-plus,#year,#month {max-width:none}
#phase-home-title,#phase-plus-title,#month > h1,#year > h1,#phase-home-period,#phase-year-caption {text-align:left}
#phase-home-period {margin-bottom:18px}
.overview-grid,.budget-page-grid {display:grid;grid-template-columns:minmax(0,1fr);gap:14px;align-items:start}
.budget-hero {min-width:0;min-height:205px;gap:12px;padding:18px;text-align:left}
#phase-home .budget-hero,.budget-page-grid .budget-hero {
  display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:center;color:#fff;border:0;
  background:linear-gradient(135deg,#4256c7,#515fd0 52%,#6049bd);border-radius:22px;
}
#phase-home .budget-hero::after {content:"";right:auto;top:auto;bottom:-130px;left:-90px}
#phase-home .budget-hero[hidden] {display:none}
.hero-copy {min-width:0}
.hero-copy > strong {display:block;margin:7px 0}
.hero-copy p,.hero-foot span,.ring-inner span {color:white}
.hero-copy p + p {margin-top:8px}
.card-eyebrow {color:white}
.ring-large {width:94px;height:94px;padding:7px}
.ring-inner {background:#4553bf;color:white}
.hero-foot {gap:8px 20px;flex-wrap:wrap;padding-top:9px}
#phase-home-cards {grid-template-columns:minmax(0,1fr);gap:9px}
:is(#phase-home-cards,#phase-home-goal) .phase-metric {display:grid;grid-template-columns:36px minmax(0,1fr);align-content:center;min-height:80px;
  background:#fff;padding:12px 15px;text-align:left;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:16px}
:is(#phase-home-cards,#phase-home-goal) .phase-metric :is(strong,small,.phase-home-link,progress) {grid-column:2}
:is(#phase-home-cards,#phase-home-goal) .phase-metric svg {grid-row:1/4;width:33px;height:33px}
#phase-home-alert:not(:empty) {margin:14px 0;background:linear-gradient(90deg,#f0f3ff,#f7f3ff)}
#phase-home-alert.phase-alert-danger {background:#fff0ec}
.figma-categories {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.figma-categories .category-card {min-width:0;min-height:140px;text-align:left;display:grid;gap:5px;border:0}
.category-card :is(strong,small,b) {color:white;overflow-wrap:anywhere}
.category-card progress {width:100%;accent-color:#fff}
.category-card.phase-tone-blue {background:linear-gradient(145deg,#3b59aa,#4b59bc)}
.category-card.phase-tone-teal {background:linear-gradient(145deg,#167286,#3659aa)}
.category-card.phase-tone-purple {background:linear-gradient(145deg,#5e4cc4,#7942a2)}
.category-card.phase-tone-orange {background:linear-gradient(145deg,#85459d,#ad426f)}
#figma-home-details > h2,.figma-home-annual {margin-top:20px}
.figma-group h2 {margin:0 0 8px}
.figma-group .phase-list button {justify-content:flex-start;gap:10px;text-align:left}
.figma-group .phase-list button > span:nth-child(2) {flex:1}
.figma-group .phase-list button::after {margin-left:auto}
#figma-budget-overview {margin:12px 0}
#figma-budget-overview .panel {margin:0}
#figma-budget-overview > .panel {margin-top:12px}
.figma-year-months {display:grid;gap:7px;padding:0;list-style:none;grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr))}
.figma-year-months li {display:grid;background:#f1f3ff;border-radius:10px;padding:7px;text-align:center}
.transaction-row {display:grid;align-items:center;gap:9px;grid-template-columns:38px minmax(0,1fr) auto;padding:10px 0;border-bottom:1px solid var(--line)}
.transaction-row:last-child {border:0}
.transaction-row .daily-history-actions {grid-column:2/-1;margin:0}
.transaction-name {min-width:0;overflow-wrap:anywhere}
.transaction-name :is(b,span) {display:block}
.transaction-name span {color:var(--muted)}
.transaction-icon {display:grid;place-items:center;width:36px;height:36px;border-radius:11px}
#figma-operation-filters,.figma-kind {flex-wrap:wrap}
#daily-operation {border:1px solid var(--line);border-radius:21px;box-shadow:0 25px 65px #28346743;overscroll-behavior:contain}
#daily-operation-form:has(.figma-kind:not([hidden])) #daily-operation-kind {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#daily-operation-amount {display:block}
#daily-operation-amount input {display:block;width:100%;}
.figma-wizard-exit {align-self:center;margin:0}
.figma-wizard-exit summary {display:list-item;cursor:pointer;padding:10px}
#saving-goal:has(#saving-goal-summary:not([hidden])) {background:linear-gradient(145deg,#4456c1,#6348ba);color:white;border:0;padding:20px}
#saving-goal:has(#saving-goal-summary:not([hidden])) :is(h2,h3,#saving-goal-summary p) {color:white}
#saving-goal:has(#saving-goal-summary:not([hidden])) form {color:var(--ink);background:white;border-radius:12px;padding:12px;margin-top:12px}
#navigation #phase-add {display:grid;justify-items:center;align-content:center;gap:0;border-radius:12px;width:auto;height:auto;min-width:44px;box-shadow:none;background:none;color:#394ccc;padding:0}
#navigation #phase-add > span {display:grid;place-items:center;width:44px;height:44px;border-radius:14px;background:#4558dc;color:white;}
#navigation #phase-add > small {color:#394ccc;}
#navigation button[aria-current=page] {color:#3e4ec0}
@media(max-width:1023px) {
  body.with-budget-nav main {padding-bottom:calc(100px + env(safe-area-inset-bottom))}
  body #navigation {position:fixed;z-index:21;bottom:0;left:0;right:0;max-width:none;margin:0;border-radius:0;
    display:grid;grid-template-columns:repeat(5,minmax(0,1fr));padding:4px max(5px,env(safe-area-inset-right)) calc(4px + env(safe-area-inset-bottom)) max(5px,env(safe-area-inset-left));gap:2px;background:white}
  body #navigation button {min-height:48px;min-width:44px;padding:2px;}
  body:has(:is(input:not([type=checkbox]):not([type=radio]):not([type=file]),textarea):focus) #navigation {display:none}
  body:has(dialog[open]) #navigation {display:none}
}
@media(max-width:365px) {
  .topbar .logo > span {width:25px;height:25px}
  .topbar .logo > span i {bottom:5px;width:3px}
  .topbar .logo > span i:first-child {left:5px}
  .topbar .logo > span i:nth-child(2) {left:10px}
  .topbar .logo > span i:last-child {left:15px;height:17px}
  .ring-large {width:72px;height:72px;padding:5px}
}
@media(min-width:1024px) {
  body.with-budget-nav {padding-left:244px}
  .sidebar:not([hidden]) {display:flex}
  body #navigation {display:none}
  body.with-budget-nav .topbar {grid-template-columns:minmax(0,1fr) auto 44px;padding-inline:28px}
  body.with-budget-nav .topbar [data-figma-logo] {visibility:hidden}
  .overview-grid {grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);align-items:stretch}
  #phase-home-cards {grid-template-columns:minmax(0,1fr);grid-auto-rows:1fr;align-content:stretch}
  .budget-page-grid {grid-template-columns:minmax(0,1.5fr) minmax(0,1fr)}
  .budget-hero {padding:25px}
  .ring-large {width:132px;height:132px;padding:9px}
  .figma-categories {grid-template-columns:repeat(4,minmax(0,1fr))}
  #phase-plus {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  #phase-plus > h1 {grid-column:1/-1}
  #phase-plus > .figma-group {margin:0}
  body.with-budget-nav footer {margin-left:0}
}
@media(prefers-reduced-motion:reduce) {html{scroll-behavior:auto}}

.logo > span {flex:none}
.summary-stack {display:grid;align-content:start;gap:12px}
#phase-home-cards .phase-metric {width:100%}
#figma-period button {padding:0;min-width:44px}
#phase-home :focus:not(:focus-visible) {outline:none}
@media(max-width:420px) {
  .topbar {grid-template-columns:minmax(0,1fr) minmax(0,1.42fr) 44px}
  #figma-period .period-nav {grid-template-columns:44px minmax(0,1fr) 44px}
  #figma-period select {text-overflow:ellipsis}
}

.sidebar > nav button.active,.support-card button {color:#3949b4}
#daily-operation #daily-operation-category select,#daily-operation input[type=date] {min-height:44px}
#daily-operation .figma-kind button {flex:1 1 auto;min-width:44px}
#figma-operation-filters button {min-width:44px}
#phase-home .phase-chip.good {color:#215c40}
.figma-home-annual .phase-trend {margin-block:12px}
@media(max-width:1023px) {
  #setup[data-guided=true] #wizard-actions {
    position:sticky;
    bottom:env(safe-area-inset-bottom,0px);
    z-index:3;
    padding:8px 0;
    background:var(--surface);
    overflow-anchor:none;
  }
  #setup[data-guided=true] #wizard-actions button {scroll-margin-block:8px}
  .mobile-keyboard #setup[data-guided=true] #wizard-actions {position:static}
}
@media(max-width:500px) {
  #figma-operation-filters {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));width:100%;min-width:0}
  #figma-operation-filters button {white-space:normal;overflow-wrap:anywhere}
}
#daily-operation .figma-kind {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,.85fr) minmax(0,1.45fr);
  width:100%;min-width:0
}
#daily-operation .figma-kind button {min-width:44px;padding-inline:4px;white-space:normal;overflow-wrap:anywhere}
#daily-operation-preview {min-width:0;overflow-wrap:anywhere}
/* Accueil Budget Perso */
body:has(#welcome:not([hidden])) {
  background:
    radial-gradient(ellipse at 100% 0%, #7e49cb1c, transparent 44%),
    radial-gradient(ellipse at 0% 15%, #4478ec18, transparent 45%),
    var(--paper);
}
body:has(#welcome:not([hidden])) .topbar {display:none!important}
body:has(#welcome:not([hidden])) main {
  display:flex;
  flex-direction:column;
  max-width:none;
  min-height:100svh;
  padding:calc(42px + env(safe-area-inset-top)) 24px calc(20px + env(safe-area-inset-bottom));
}
body:has(#welcome:not([hidden])) footer {
  margin:auto 0 0;
  padding-top:24px;
  text-align:center;
  color:var(--muted);
  font:400 13px/1.4 var(--type-body);
}
body:has(#welcome:not([hidden])) footer a {color:inherit;text-underline-offset:2px}
main > .muted:has(#current-date) {display:none}
#welcome {
  width:min(100%,520px);
  margin-inline:auto;
}
#welcome .logo {width:max-content;max-width:100%;gap:2px;margin-bottom:31px}
#welcome .logo b {
  font:800 28px/1.1 var(--type-display);
  letter-spacing:.08em;
}
#welcome .logo small {font:600 14px/1.35 var(--type-body);letter-spacing:.04em}
.welcome-copy h1 {
  margin:0 0 10px;
  font:700 26px/1.22 var(--type-display);
  letter-spacing:-.035em;
}
.welcome-copy p {max-width:330px;margin:0;color:var(--muted);font:400 16px/1.55 var(--type-body)}
.welcome-preview {position:relative;min-width:0;height:190px;margin:36px 0 30px;pointer-events:none}
.welcome-expenses {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  width:calc(100% - 18px);
  min-height:118px;
  padding:16px 22px 16px 20px;
  border-radius:22px;
  color:#fff;
  background:linear-gradient(135deg,#5065ee,#6678fb 52%,#735ee8);
  box-shadow:0 18px 34px #4558dc3b;
  font:400 13px/1.35 var(--type-body);
}
.welcome-expenses-label {text-transform:uppercase;font-weight:700;font-size:12px;letter-spacing:.06em}
.welcome-expenses strong {display:block;margin:4px 0;font:800 32px/1.16 var(--type-display)}
.welcome-ring {
  display:grid;
  flex:0 0 auto;
  place-items:center;
  width:60px;
  aspect-ratio:1;
  border-radius:50%;
  background:conic-gradient(#fff 86%,#ffffff40 0);
}
.welcome-ring b {
  display:grid;
  place-items:center;
  width:calc(100% - 13px);
  aspect-ratio:1;
  border-radius:50%;
  background:#735ee8;
  font-size:14px;
}
.welcome-food,.welcome-balance {
  position:absolute;
  padding:12px 14px;
  border-radius:18px;
  background:var(--surface);
  box-shadow:0 14px 30px #2023331c;
  color:var(--muted);
  font:400 13px/1.35 var(--type-body);
}
.welcome-food {right:0;top:95px;width:178px}
.welcome-food-label {display:flex;align-items:center;gap:8px;margin-bottom:7px;color:var(--ink);font-weight:700}
.welcome-food-label i {position:relative;width:28px;height:28px;border-radius:9px;background:#fff0df;color:#9d3527}
.welcome-food-label i::before {
  content:'';
  position:absolute;
  inset:10px 8px 9px;
  border:1.5px solid currentColor;
  transform:skew(-12deg);
}
.welcome-food strong {color:var(--ink);font-size:16px}
.welcome-food-progress {height:6px;margin-top:6px;border-radius:6px;background:var(--line)}
.welcome-food-progress::before {
  content:'';
  display:block;
  width:80%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#4478ec,#6153d8);
}
.welcome-balance {display:none}
.welcome-actions {display:grid;gap:10px}
.welcome-actions button {margin:0;border-radius:14px;font-family:var(--type-body);font-weight:600}
#welcome .welcome-actions .primary {min-height:54px;font-size:17px;box-shadow:0 10px 24px #4558dc33}
#welcome-first-use {
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:0 0 5px;
  color:var(--muted);
  text-align:center;
  font:400 13px/1.4 var(--type-body);
}
#welcome-first-use[hidden] {display:none}
#welcome-first-use i {
  position:relative;
  flex:0 0 12px;
  width:12px;
  height:12px;
  border:1px solid currentColor;
  border-radius:50%;
}
#welcome-first-use i::before {
  content:'';
  position:absolute;
  top:2px;
  left:5px;
  width:3px;
  height:4px;
  border-left:1px solid currentColor;
  border-bottom:1px solid currentColor;
}
#welcome #start-demo {min-height:52px;background:var(--surface);border-color:#dbe3fa;color:var(--brand-accent);font-size:16px}
#welcome #start-restore {
  justify-self:center;
  padding-inline:10px;
  background:transparent;
  border-color:transparent;
  color:var(--muted);
  font-size:15px;
  font-weight:500;
}
#start-restore span {font-size:18px;vertical-align:-1px}
@media(max-width:340px) {
  body:has(#welcome:not([hidden])) main {padding-inline:20px}
  .welcome-preview {height:163px;margin-top:29px}
  .welcome-expenses {width:calc(100% - 14px);min-height:98px;padding:13px 18px}
  .welcome-expenses strong {font-size:26px}
  .welcome-expenses-label {font-size:10px}
  .welcome-ring {width:50px}
  .welcome-food {top:83px;width:152px;padding:10px 12px;font-size:11px}
  .welcome-food-label i {width:24px;height:24px}
  .welcome-food strong {font-size:14px}
}
@media(min-width:1024px) {
  body:has(#welcome:not([hidden])) {
    background:
      radial-gradient(ellipse at 84% 30%, #7e49cb20, transparent 39%),
      radial-gradient(ellipse at 54% 94%, #4478ec16, transparent 38%),
      var(--paper);
  }
  body:has(#welcome:not([hidden])) main {padding:32px clamp(36px,6.25vw,100px) 24px}
  body:has(#welcome:not([hidden])) footer {margin-top:0}
  #welcome:not([hidden]) {
    display:grid;
    grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);
    grid-template-areas:"brand preview" "intro preview" "actions preview";
    column-gap:clamp(28px,5vw,68px);
    width:min(100%,1120px);
    margin-block:auto;
  }
  #welcome .logo {grid-area:brand;margin-bottom:36px}
  #welcome .logo b {font-size:34px}
  #welcome .logo small {font-size:16px}
  .welcome-copy {grid-area:intro;max-width:450px}
  .welcome-copy h1 {font-size:40px;line-height:1.15;margin-bottom:18px}
  .welcome-copy p {font-size:18px;max-width:420px}
  .welcome-preview {grid-area:preview;height:332px;margin:24px 0 0}
  .welcome-expenses {width:88%;min-height:166px;margin-left:5%;padding:24px 30px;border-radius:30px;font-size:18px}
  .welcome-expenses-label {font-size:16px}
  .welcome-expenses strong {font-size:44px}
  .welcome-ring {width:88px}
  .welcome-ring b {font-size:20px}
  .welcome-food {top:173px;width:44%;padding:16px 18px;border-radius:22px;font-size:16px}
  .welcome-food-label i {width:36px;height:36px}
  .welcome-food-label i::before {inset:14px 10px 12px}
  .welcome-food strong {font-size:22px}
  .welcome-food-progress {height:8px;margin-top:8px}
  .welcome-balance {display:grid;gap:5px;top:197px;left:0;width:53%;padding:18px 20px;border-radius:22px;font-size:14px}
  .welcome-balance strong {font:800 26px/1.3 var(--type-display);color:var(--ink)}
  .welcome-balance small {
    justify-self:start;
    padding:6px 10px;
    border:1px solid var(--line);
    border-radius:20px;
    color:#276545;
    font-weight:700;
  }
  .welcome-balance small::before {content:'●';margin-right:6px}
  .welcome-actions {
    grid-area:actions;
    display:flex;
    flex-wrap:wrap;
    justify-content:flex-start;
    align-items:center;
    gap:10px 12px;
    margin-top:36px;
  }
  .welcome-actions button {padding-inline:clamp(12px,2vw,30px)}
  #welcome-first-use {order:1;flex-basis:100%;justify-content:flex-start;margin:2px 0 0;font-size:14px}
  #welcome #start-restore {order:2;padding-inline:0}
}
#welcome-sign-in {margin:16px 0 0}
#welcome-sign-in button {padding-inline:8px}
#welcome-sign-in button:disabled {background:#eef1f7;color:var(--muted);cursor:default}
#welcome-sign-in small {display:block;color:var(--muted)}
#setup-income-single {display:grid;gap:12px;max-width:34rem}
#setup-income-single p {margin:0 0 6px}
#setup-income-single input {width:100%;max-width:20rem}
#setup-income-single [data-setup-pattern] {min-width:64px}
#phase-actions [data-phase-action] {min-height:64px}
#saving-goal-summary {
  color:var(--ink);
  display:flow-root;
}
#saving-goal:has(#saving-goal-summary:not([hidden])) #saving-goal-summary :is(h3,p) {color:var(--ink)}
#saving-goal #saving-goal-status:empty {display:none}
#saving-goal #phase-saving-months {margin:12px 0 0;color:var(--ink)}
#saving-goal:has(#saving-goal-summary:not([hidden])) #phase-saving-months h2 {color:var(--ink)}
#saving-goal .goal-progress {display:block;clear:both;max-width:100%}
.phase-saving-ledger {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,78px),1fr))}
.phase-saving-ledger > div,.phase-chart-ledger li > *, .hero-foot span {min-width:0;overflow-wrap:anywhere}
.phase-chip {width:auto;justify-self:start}
.transaction-row > strong {overflow-wrap:anywhere}
.phase-month-donut .chart-pie span {text-align:center;overflow-wrap:anywhere;padding:5px}
@media (max-width:760px) {
  #figma-period select {text-overflow:clip;padding:0}
  #phase-annual-metrics {grid-template-columns:minmax(0,1fr)}
  #phase-annual-metrics .phase-compact-metric {padding:10px}
  #month[data-budget-kind=compare] .phase-table thead {
    position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);
  }
  #month[data-budget-kind=compare] .phase-table,
  #month[data-budget-kind=compare] .phase-table :is(caption,tbody) {display:block;width:100%}
  #month[data-budget-kind=compare] .phase-table tbody th {grid-column:1/-1}
  #month[data-budget-kind=compare] .phase-table tbody td::before {
    content:attr(data-label);display:block;color:var(--phase-muted);
  }
  #month[data-budget-kind=compare] .phase-table tbody tr {
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    padding:8px;
  }
  #month[data-budget-kind=compare] .phase-table tbody tr td:last-child {grid-column:1/-1}
  #month[data-budget-kind=compare] .phase-table tbody td {min-width:0;text-align:left;overflow-wrap:anywhere}
  #month[data-budget-kind=compare] .phase-table tbody td:not(.phase-missing,.phase-match) {overflow-wrap:anywhere}
  .phase-trend:has(.phase-trend-bars) {
    grid-auto-flow:row;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:8px 4px;
    overflow:visible;
  }
  .phase-trend-month {min-width:0}
  .phase-trend-month small {display:block;overflow-wrap:anywhere}
  .phase-trend-bars {height:88px}
  .phase-chart-ledger li {grid-template-columns:10px minmax(0,1fr) auto}
  .phase-chart-ledger li > strong {grid-column:2/-1}
}

/* Création et suivi du budget */
[data-figma-logo].logo {display:grid;gap:1px;align-content:center;line-height:1.1}
[data-figma-logo] b {
  width:max-content;
  max-width:100%;
  color:var(--brand-accent);
}
@supports (background-clip:text) or (-webkit-background-clip:text) {
  [data-figma-logo] b {
    background:linear-gradient(100deg,#4478ec,#6153d8,#7e49cb);
    -webkit-background-clip:text;
    background-clip:text;
    color:transparent;
  }
}
[data-figma-logo] small {color:var(--ink);font-size:11px;font-weight:700}
#setup-guided-question > h3 {margin:0}
#setup-guided-question .guided-expense-options {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
#setup-guided-question .guided-expense-options label {
  position:relative;display:grid;justify-items:center;align-content:center;text-align:center;
  min-height:72px;min-width:0;padding:8px 4px;gap:5px;overflow-wrap:anywhere;
  border:1px solid var(--line);border-radius:12px;cursor:pointer
}
#setup-guided-question .guided-expense-options input {
  position:absolute;inset:0;opacity:0;width:100%;height:100%;margin:0;cursor:pointer
}
#setup-guided-question .guided-expense-options label:has(:checked) {
  border-color:var(--brand-accent);background:#eef0ff;box-shadow:inset 0 0 0 1px var(--brand-accent)
}
#setup-guided-question .guided-expense-options label:has(:focus-visible) {outline:2px solid var(--brand-accent);outline-offset:2px}
.setup-expense-amounts {display:grid;gap:6px}
#setup-guided-question .setup-expense-amounts :is(.guided-category,label) {min-width:0;overflow-wrap:anywhere}
#setup-guided-question .setup-expense-amounts .guided-category {
  display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;padding:8px
}
#setup-guided-question .setup-expense-amounts label {
  display:grid;grid-template-columns:minmax(0,1fr) minmax(74px,30%);align-items:center;gap:8px
}
#setup-guided-question .setup-expense-amounts input {min-width:0;max-width:none}
.setup-expense-total {margin:0;padding:10px;border-radius:8px;background:#eef0ff;font-weight:700}
.monthly-amount-choices {display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.monthly-amount-choices button {min-height:44px;padding-inline:8px}
.monthly-amount-choices button[aria-pressed=true] {background:#eef0ff;border-color:var(--brand-accent);color:var(--brand-accent)}
.monthly-amount-choices small {flex-basis:100%;overflow-wrap:anywhere}
.exceptional-entry {margin-block:10px}
.exceptional-entry .settings-fields label {margin-top:6px}
.figma-group .phase-list button > small {display:block}
#month-review-chart {margin-block:12px}
@media(max-width:365px) {
  .topbar:has(#figma-period:not([hidden])) {grid-template-columns:77px minmax(0,1fr) 44px}
  .topbar:has(#figma-period:not([hidden])) [data-figma-logo] {visibility:visible}
  .topbar:has(#figma-period:not([hidden])) .logo b {position:static;width:auto;height:auto;clip-path:none;font-size:11px}
  #figma-period .period-nav {grid-template-columns:44px minmax(0,1fr) 44px}
}

@media(max-width:365px) {
  body .topbar:has(#figma-period:not([hidden])) {grid-template-columns:77px minmax(0,1fr) 44px}
  body .topbar:has(#figma-period:not([hidden])) .logo b {position:static;width:auto;height:auto;clip-path:none;font-size:11px}
}

#setup-guided-question .guided-expense-options label {font-size:11px}
#setup-guided-question .setup-expense-amounts button {justify-self:end;min-height:44px}
#month[data-phase-mode=entry] #manual-form > .exceptional-entry {order:0}
@media(max-width:365px) {
  #figma-period .period-nav {grid-template-columns:34px minmax(0,1fr) 34px}
  #figma-period .period-nav button {min-width:34px}
}
@media(max-width:600px) {
  #manual-rows td:has(.monthly-amount-choices) {grid-column:1/-1}
  .exceptional-entry .settings-fields {grid-template-columns:minmax(0,1fr)}
}

#monthly-income-choices {grid-column:1/-1}
.monthly-amount-choices button {white-space:normal;overflow-wrap:normal;max-width:100%}
@media(max-width:767px) {
  #month[data-phase-mode=entry] #manual-form:focus-within > .actions {position:static}
  #month[data-phase-mode=entry] #manual-rows td:nth-child(3):has(.monthly-amount-choices) {grid-column:1/-1;grid-row:3}
  #month[data-phase-mode=entry] #manual-rows .monthly-amount-choices button {flex:0 1 auto}
}
/* Stabilisation des écrans de suivi */
#welcome-sign-in:has(button:disabled),
body:has(#setup-progress:not([hidden])) main > .muted:has(#current-date) {display:none}
#phase-home .budget-hero {min-height:0;padding:14px;gap:8px}
#phase-home .hero-foot strong {color:#fff}
#phase-home .ring.over-budget {background:#eb820e}
.category-card.phase-tone-pink {background:linear-gradient(145deg,#85459d,#ad426f)}
.category-card .report-bar.over-budget {accent-color:#ffb34b}
#month .budget-gauge-panel {display:flex;align-items:center;flex-wrap:wrap;gap:8px;min-width:0;padding:12px}
#month .budget-gauge-panel .hero-copy {flex:1 1 135px}
#month .budget-gauge-panel .hero-copy > strong {display:inline;margin-inline-end:8px}
#month .budget-gauge-panel .hero-copy p,#month .budget-gauge-panel .hero-foot span {color:var(--ink)}
#month .budget-gauge-panel .card-eyebrow {display:block;color:var(--muted)}
#month .budget-gauge-panel .ring {width:auto;height:auto;padding:0;background:none}
#month .budget-gauge-panel .ring-inner {display:flex;gap:4px;color:var(--ink);background:none}
#month .budget-gauge-panel .ring-inner span {color:var(--muted)}
#month .budget-gauge-panel .hero-foot {padding:0;border:0}
#month-guided .month-question > p {font-weight:400}
#setup-guided-question .setup-expense-amounts .guided-prompt {font:inherit}
.setup-expense-amounts label:has(input[type=number]) {position:relative}
.setup-expense-amounts label:has(input[type=number])::after {content:"€" / "";position:absolute;inset-inline-end:6px;pointer-events:none;color:var(--muted)}
.setup-expense-amounts label:has(input[type=number]) input {padding-inline-end:19px}
#month-review-chart h2,#phase-month-chart-summary h2,#year details:has(#charts) > summary {font-weight:800}
#saving-goal-amount strong,#saving-goal-amount small {display:block}
#saving-goal-amount small {font-weight:400}
.phase-preview-over {color:#98530a}
#phase-plus .phase-list button > span:not(.phase-icon) {display:grid;gap:2px;min-width:0}
@media(max-width:760px) {
  #month[data-budget-kind=compare] .phase-table tbody tr {grid-template-columns:repeat(3,minmax(0,1fr));gap:3px;padding:7px}
  #month[data-budget-kind=compare] .phase-table tbody td:last-child {grid-column:auto}
  #month[data-budget-kind=compare] .phase-table tbody td {padding:5px}
  #month[data-budget-kind=compare] .phase-table tbody td.phase-match {background:transparent;color:#276545}
  .phase-chart-ledger li {grid-template-columns:10px minmax(0,1fr) auto auto;gap:6px}
  .phase-chart-ledger li > strong {grid-column:auto}
}
.phase-saving-ledger {grid-template-columns:1fr;text-align:left}
.phase-saving-ledger > div {display:grid;gap:4px;padding:8px;border-top:1px solid var(--line)}
.phase-saving-ledger > div > button {justify-self:start}
#phase-charts-panel > summary {font-weight:800}
#daily-operation .figma-daily-links {gap:4px 12px}
#daily-operation .figma-daily-links button {padding:4px 0;border:0;background:transparent;color:var(--brand-accent);text-decoration:underline;text-underline-offset:2px}
#daily-operation #daily-operation-preview > p {margin-block:4px}
#month-guided .guided-question-position {margin-block:4px}
#phase-home-alert:empty {display:none}
#phase-home-cards {gap:7px}
@media(max-width:760px) {
  #month[data-budget-kind=compare] .phase-table tbody tr > td:last-child {grid-column:auto}
  #month[data-budget-kind=compare] .phase-table tbody tr > th {padding:5px}
  #month[data-budget-kind=compare] .phase-table tbody td {font-size:var(--type-secondary)}
}
/* Le récapitulatif guidé possède sa propre action de vérification. */
#month:has(#month-entry-editor:not([hidden]) #month-guided:not([hidden]):not(.month-tiles)) #close-month {display:none}

/* Alignement des revenus et de l’épargne dans Mon budget */
#phase-budget-rows [data-budget-metric=income] {background:#f2f5ff}
#phase-budget-rows tr[data-budget-metric=income] {box-shadow:inset 0 0 0 1px #dbe3fa}
#phase-budget-rows tr:is([data-budget-metric=income],[data-budget-metric=saving]) > td {
  text-align:end;
  vertical-align:top;
  font-variant-numeric:tabular-nums;
}
#phase-budget-rows .phase-budget-totals > [data-budget-metric] {
  display:grid;
  grid-template-rows:minmax(44px,auto) auto;
  align-content:start;
  align-items:center;
  text-align:end;
}
#phase-budget-rows .phase-budget-totals [data-budget-metric] > :is(button,small) {
  justify-self:end;
  text-align:end;
}
#phase-budget-rows .phase-budget-totals [data-budget-metric] > strong {font-variant-numeric:tabular-nums}
@media(max-width:760px) {
  #month[data-budget-kind=compare] #phase-budget-rows tr:is([data-budget-metric=income],[data-budget-metric=saving]) > td {
    text-align:end;
    align-self:stretch;
  }
}

/* Solde de départ et lecture des montants */
.signed-balance-field {display:flex;align-items:stretch;gap:8px}
.signed-balance-field input {flex:1;min-width:0}
.signed-balance-field button {flex:0 0 44px;font-size:20px;padding:0}
.signed-balance-field button[aria-pressed=true] {background:var(--phase-pale);color:var(--brand-accent)}
#phase-budget-rows [data-budget-metric=income],
:is(#phase-review-metrics,#phase-annual-metrics) [data-metric=income] {
  background:#eef1ff;
  color:var(--ink);
  box-shadow:inset 0 0 0 1px #dbe3fa;
}
:is(#phase-review-metrics,#phase-annual-metrics) [data-metric=income] > span:not(.phase-icon) {
  color:var(--ink);
  font-weight:800;
  font-size:15px;
}
:is(#phase-review-metrics,#phase-annual-metrics) [data-metric=income] > strong {
  color:#3347c5;
  font-size:clamp(16px,2vw,22px);
  font-weight:800;
}
.forecast-table table {min-width:0;overflow-wrap:anywhere}
.forecast-table td small {display:block}
@media(max-width:600px) {
  .forecast-table tbody tr {grid-template-columns:minmax(0,1fr);gap:8px;padding:12px}
  .forecast-table tbody td:not(:first-child) {
    padding-top:7px;
    border-top:1px solid var(--line);
    font-variant-numeric:tabular-nums;
  }
  .forecast-table tbody td:first-child {font-weight:750}
  .forecast-table .mobile-cell-label {font-weight:650}
  .forecast-table tr.forecast-alert {border-color:var(--red)}
}

/* Revenus du mois */
#phase-home .phase-home-income {
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:stretch;
  gap:10px;
  width:100%;
  min-height:84px;
  padding:12px clamp(14px,4vw,18px);
  margin:0;
  border:0;
  border-radius:22px;
  background:linear-gradient(125deg,#176f80,#3454a4);
  box-shadow:0 12px 26px #176f8026;
  color:#fff;
  text-align:left;
}
.phase-home-income :is(.phase-home-income-main,.phase-home-income-meta) {
  display:grid;
  min-width:0;
  gap:3px;
  overflow-wrap:anywhere;
}
.phase-home-income-title {
  font:700 var(--type-secondary)/1.35 var(--type-body);
  letter-spacing:.13em;
}
.phase-home-income-main strong {
  white-space:nowrap;
  font:700 var(--type-overview-amount)/1.15 var(--type-display);
  letter-spacing:-.045em;
  font-variant-numeric:tabular-nums;
}
.phase-home-income-main strong.income-unset {font-size:17px;letter-spacing:-.025em}
.phase-home-income-main strong.income-long {font-size:clamp(19px,5vw,31px)}
.phase-home-income-planned {font:400 var(--type-secondary)/1.35 var(--type-body)}
.phase-home-income-meta {
  align-content:space-between;
  text-align:right;
  font:400 var(--type-secondary)/1.35 var(--type-body);
}
.phase-home-income .phase-home-income-meta b {color:inherit;font-weight:400}
.phase-home-income-action {text-decoration:underline;text-underline-offset:3px}

/* Shared navigation and typography across the personal workspace. */
[data-figma-logo] a { display: grid; gap: 1px; color: inherit; text-decoration: none; width: fit-content; max-width: 100%; }
.skip-app { position: fixed; z-index: 50; inset: 8px auto auto 8px; padding: 12px 16px; background: white; color: var(--ink); border-radius: 8px; transform: translateY(calc(-100% - 16px)); }
.skip-app:focus { transform: none; }
:where(button,a,input,select,textarea,summary):focus-visible { outline: 3px solid #394ccc; outline-offset: 3px; }
.topbar:has(#header-profile:not([hidden])) { grid-template-columns: minmax(72px,1fr) minmax(0,auto) 44px minmax(0,auto); }
.topbar:has(#header-profile:not([hidden])) #header-account { grid-column: 4; }
body:has(#welcome:not([hidden])) .topbar:has(#header-profile:not([hidden])) {
  display: flex !important; justify-content: flex-end; background: transparent; border: 0;
}
body:has(#welcome:not([hidden])) .topbar > [data-figma-logo] { display: none; }
#header-profile { position: relative; min-width: 0; }
#header-profile summary { display: flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .6rem; cursor: pointer; font-weight: 700; list-style: none; }
#header-profile summary::-webkit-details-marker { display: none; }
#header-first-name { max-width: clamp(85px,18vw,200px); overflow-wrap: anywhere; }
.header-profile-actions { position: absolute; z-index: 3; top: 100%; right: 0; min-width: 160px; margin: 0; padding: .5rem; box-shadow: 0 12px 32px #2023331f; }
.header-profile-actions button { display: block; width: 100%; min-height: 44px; text-align: left; }
#account-profile-form:not([hidden]) { display: grid; gap: .6rem; }
#account-profile-form input { min-width: 0; }
#account-signup-name { width: 100%; }
#budget-sync-panel { max-width: 100%; }
#budget-sync-panel:has(#budget-sync-actions:empty) { padding-block: .35rem; box-shadow: none; }
#budget-sync-panel:has(#budget-sync-actions:empty) #budget-sync-status { margin: .15rem 0; color: var(--muted); font-size: .875rem; }
#budget-sync-panel:has(#budget-sync-actions:empty) .actions { display: none; }
#budget-sync-recovery summary { min-height: 28px; padding-block: .3rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea { font-size: max(16px,1em); }
@media (max-width: 650px) {
  body .topbar:has(#header-profile:not([hidden])) { grid-template-columns: minmax(0,1fr) 44px auto; }
  .topbar:has(#header-profile:not([hidden])) #figma-period:not([hidden]) { grid-area: 2 / 1 / 3 / -1; }
  .topbar:has(#header-profile:not([hidden])) #figma-reminder { grid-area: 1 / 2; }
  .topbar:has(#header-profile:not([hidden])) #header-account { grid-area: 1 / 3; }
}
@media (min-width: 768px) and (max-width: 1100px) {
  .figma-categories { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .overview-grid, .budget-page-grid { grid-template-columns: minmax(0,1fr); }
  #phase-home-cards { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
  #phase-plus:not([hidden]) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  #phase-plus > h1 { grid-column: 1 / -1; }
  #phase-plus > .figma-group { margin: 0; min-width: 0; }
}

#welcome-sign-in:has(button[hidden]) { display: none; }

#header-account { display: grid; justify-items: end; min-width: 0; }
#header-account:not(:has(#header-profile:not([hidden]))) { display: none; }
#header-save-status p { margin: 0; padding-inline: .6rem; color: var(--muted); font-size: .75rem; line-height: 1.25; text-align: right; }
#header-save-status:empty, #header-save-status:has(p:empty) { display: none; }
#budget-sync-panel:not(:has(#budget-sync-status:not(:empty), #budget-sync-actions:not(:empty), #budget-sync-recovery:not([hidden]))) { display: none; }
#budget-sync-panel:has(#budget-sync-actions:not(:empty)) #budget-sync-status { color: var(--ink); }
/* ===== Stabilisation V2 — composants consolidés ===== */
/* Message de confirmation : neutre, distinct de la zone d’erreur. */
.app-notice {margin:0 0 12px;padding:10px 14px;border-radius:12px;background:#eef6f1;color:#185839;border:1px solid #cfe7d8;font-weight:600}
/* Choix du mode de création : sous-titre explicite. */
.setup-method-options button small {display:block;color:var(--muted);font-weight:400}
/* E5 : pas de cadre sur les titres qui reçoivent le focus par programme ; le focus clavier reste visible. */
:is(h1,h2,h3)[tabindex="-1"]:focus {outline:none}
/* F1 : la répartition est déjà affichée dans le bilan du mois. */
#month[data-phase-mode=review] :is(#phase-month-chart,#phase-month-chart-open) {display:none}
/* D1 : écarts courts sur une seule ligne. */
#phase-budget-rows td[data-label="Écart"] {white-space:nowrap}
/* E1 : fenêtre d’ajout plus compacte. */
#daily-operation {padding:12px}
#daily-operation form {gap:6px}
#daily-operation h2 {margin-bottom:4px}

/* B : saisie du mois en tuiles. */
#month-guided.month-tiles {display:grid;gap:12px}
.month-tiles-intro {display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px 10px}
.month-tiles-intro > p:first-child {grid-column:1/-1;margin:0;color:var(--muted)}
.month-tiles-progress {margin:0;font-weight:600;color:var(--brand-accent);background:#e8efff;padding:4px 10px;border-radius:8px;white-space:nowrap}
.month-tiles-bar {height:6px;border-radius:3px;background:linear-gradient(90deg,var(--brand-accent) var(--tiles-progress,0%),var(--line) 0)}
.month-tiles-status {margin:0;min-height:1.3em;color:var(--muted)}
.month-tiles-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media(min-width:768px) {.month-tiles-grid {grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1280px) {.month-tiles-grid {grid-template-columns:repeat(4,minmax(0,1fr))}}
.month-tile {display:flex;flex-direction:column;gap:5px;min-width:0;padding:12px;border:1px solid var(--line);border-radius:16px;background:#fff}
.month-tile.is-done {background:#f4f6ff;border-color:#c9d1fb}
.month-tile.is-missing {border:2px solid #d4880f}
.month-tile-head {display:flex;align-items:center;gap:8px;min-width:0}
.month-tile-head .phase-icon {flex-shrink:0}
.month-tile-head h3 {margin:0;font-size:14px;line-height:1.25;font-weight:600;min-width:0;overflow-wrap:normal;word-break:normal;hyphens:manual}
.month-tile-planned {margin:0;font-size:13px;color:var(--muted)}
.month-tile-planned:empty {display:none}
.month-tile-amount {display:flex;align-items:center;gap:6px}
.month-tile-amount strong {font:800 19px/1.2 var(--type-display, inherit);letter-spacing:-.02em;white-space:nowrap}
#month-guided .month-tile-edit {width:32px;height:32px;min-width:32px;min-height:32px;padding:0;border-radius:16px;display:inline-flex;align-items:center;justify-content:center;background:#fff;flex-shrink:0}
.month-tile-edit svg {width:15px;height:15px;stroke:var(--muted);fill:none;stroke-width:2}
.month-tile-chip {align-self:flex-start;padding:3px 8px;border-radius:999px;font-size:12px;font-weight:600;background:#eef1f7;color:var(--ink)}
.month-tile-chip.ok {background:#e3f5e9;color:#185839}
.month-tile-chip.warn {background:#fff4df;color:#86490c}
.month-tile-confirm {margin-top:4px;min-height:40px;border:1.5px solid var(--brand-accent);border-radius:11px;background:#fff;color:var(--brand-accent);font-weight:600;white-space:nowrap}
.month-tile-other {align-self:center;min-height:32px;border:0;background:transparent;color:var(--muted);text-decoration:underline;text-underline-offset:3px;padding:2px 4px}
.month-tile-choices {display:flex;flex-direction:column;gap:2px}
@media(max-width:359px) {
  .month-tile-head {flex-direction:column;align-items:flex-start;gap:6px}
  .month-tile-confirm {font-size:13px;padding-inline:4px}
}
#month-tile-sheet,#month-category-sheet {width:min(440px,calc(100% - 24px));padding:16px;border:1px solid var(--line);border-radius:20px;box-sizing:border-box}
#month-tile-sheet::backdrop,#month-category-sheet::backdrop {background:#14233d99}
#month-tile-sheet form,#month-category-sheet form {display:grid;gap:4px;align-items:stretch}
#month-tile-sheet h2,#month-category-sheet h2 {margin:0;font-size:18px}
#month-tile-sheet .month-tile-sheet-planned,#month-category-sheet .month-tile-sheet-planned {margin:2px 0 10px;color:var(--muted)}
#month-tile-sheet .month-tile-sheet-planned:empty,#month-category-sheet .month-tile-sheet-planned:empty {display:none}
#month-tile-sheet label,#month-category-sheet label {display:grid;gap:6px;font-weight:600}
#month-tile-sheet input,#month-category-sheet input {width:100%;min-height:48px;font-size:22px;font-weight:700}
#month-tile-sheet .month-tile-sheet-gap,#month-category-sheet .month-tile-sheet-gap {min-height:1.3em;margin:6px 0;color:#86490c}
#month-tile-sheet .actions,#month-category-sheet .actions {display:flex;gap:8px;justify-content:flex-end;flex-wrap:nowrap}
#month-tile-sheet .actions button,#month-category-sheet .actions button {white-space:nowrap}
#month-tile-sheet .actions button,#month-category-sheet .actions button {min-height:44px}
@media(max-width:600px) {
  #month-tile-sheet,#month-category-sheet {margin:auto 0 0;width:100%;max-width:none;border-radius:20px 20px 0 0;padding-bottom:calc(16px + env(safe-area-inset-bottom))}
  #month-tile-sheet .actions button,#month-category-sheet .actions button {flex:1}
}
}
/* Accueil : colonne gauche Dépenses puis Revenus ; colonne droite Épargne puis Solde ; objectif dessous. */
.phase-home-column {display:grid;gap:12px;align-content:start;min-width:0}
#phase-home-goal:not(:empty) {margin-top:12px}
#phase-home-goal .phase-metric {width:100%}
.phase-home-link {justify-self:start;min-height:32px;padding:2px 0;border:0;background:transparent;color:var(--brand-accent);text-decoration:underline;text-underline-offset:3px;font-weight:600;text-align:left}
@media(min-width:1024px) {
  #phase-home-cards .phase-metric {align-content:center}
}
/* Pages secondaires de Plus : retour visible. */
.plus-back {display:inline-flex;align-items:center;min-height:40px;margin:0 0 8px;padding:6px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--brand-accent);font-weight:600}
/* Aide et conseils : une page dédiée, en rubriques. */
#help .help-topics {display:grid;gap:8px;max-width:820px}
#help .help-topic {background:#fff;border:1px solid var(--line);border-radius:14px;padding:0 14px}
#help .help-topic summary {cursor:pointer;min-height:48px;display:flex;align-items:center;font-weight:600;padding-block:8px}
#help .help-topic p {margin:0 0 12px;line-height:1.5}
#phase-amount-help {display:none}
/* Mon mois : la carte de l’objectif n’est pas répétée (l’affectation de l’épargne reste proposée). */
#review-goal {display:none}
/* Mes mois : écran compact, aligné sur le titre. */
#year[data-phase-analysis=months] #phase-month-status {max-width:640px;margin-inline:0;padding:8px 14px}
#year[data-phase-analysis=months] #phase-month-status > details {display:none}
#year[data-phase-analysis=months] .period-nav {max-width:260px;margin-inline:0}
#year[data-phase-analysis=months] .phase-month-list-row {padding:4px 2px}
/* ===== Version candidate ===== */
/* Navigation sans budget : pages vides explicatives, actions qui exigent un budget indisponibles. */
#phase-empty .phase-empty-card {display:grid;gap:8px;max-width:640px;padding:20px}
#phase-empty .phase-empty-card h2 {margin:0;font-size:20px}
#phase-empty .phase-empty-card p {margin:0;color:var(--muted)}
#phase-empty .phase-empty-actions {margin-top:6px;display:flex;flex-wrap:wrap;gap:8px}
#phase-empty .phase-empty-actions button {min-height:44px}
body.no-budget :is(#figma-period,#figma-reminder,#export-excel,#export-csv,#export-backup,#data-import,#csv-panel) {display:none !important}
#phase-plus button:disabled {opacity:.5;cursor:not-allowed}
#phase-add:disabled {opacity:.45;cursor:not-allowed}
/* Indicateur de sauvegarde : « Sauvegardé » s’efface ; les autres états restent visibles. */
#header-save-status.is-quiet {visibility:hidden}
/* Correction d’un mois terminé : écart provisoire sous le montant modifié. */
.provisional-gap {display:block;margin-top:4px;color:#86490c;font-size:12px;font-weight:600}
/* Saisie en tuiles : ajout d’une catégorie. */
.month-tile-add {align-items:center;justify-content:center;border-style:dashed;background:transparent;min-height:96px}
.month-tile-add .month-tile-other {font-weight:600;color:var(--brand-accent)}
#month-category-sheet label + label {margin-top:8px}
#month-category-sheet input[type=text] {width:100%;min-height:44px;font-size:16px}
/* ===== RC-06 : compte obligatoire, première page du visiteur non connecté ===== */
.welcome-account-actions {display:none}
body.guest-locked .welcome-account-actions {display:grid;gap:10px;width:100%}
body.guest-locked .welcome-account-actions button {width:100%;min-height:52px}
body.guest-locked #welcome :is(#start-blank,#resume-setup,#export-setup-draft,#start-new,#start-restore,#welcome-sign-in) {display:none !important}
/* ===== RC-07 : retours du premier testeur ===== */
/* Tableau Prévu / Réalisé / Écart : revenus et épargne alignés comme les catégories sur téléphone. */
@media (max-width:760px) {
  #month[data-budget-kind=compare] #phase-budget-rows tr:is([data-budget-metric=income],[data-budget-metric=saving]) > td {text-align:left}
}
/* Bilan du mois : synthèse, chiffres et répartition d’abord ; actions ensuite. */
#month[data-phase-mode=review] #manual-panel {display:flex;flex-direction:column}
#month[data-phase-mode=review] #manual-panel > * {order:20}
#month[data-phase-mode=review] #phase-review-header {order:1}
#month[data-phase-mode=review] #phase-review-synthesis {order:2}
#month[data-phase-mode=review] #phase-review-metrics {order:3}
#month[data-phase-mode=review] #month-review-chart {order:4}
#month[data-phase-mode=review] #month-dashboard {order:5}
#month[data-phase-mode=review] #manual-message {order:6}
#month[data-phase-mode=review] #open-savings-allocation {order:7;align-self:flex-start}
#phase-review-synthesis {margin:4px 0 10px;font-size:17px;font-weight:600;line-height:1.4;color:var(--ink)}
#phase-budget-rows tr:is([data-budget-metric=income],[data-budget-metric=saving]) > td {vertical-align:middle}
/* ===== RC-08 : Bien démarrer ===== */
#phase-onboarding {display:grid;gap:8px;margin:0 0 14px}
#phase-onboarding h2 {margin:0;font-size:20px}
#phase-onboarding > p {margin:0}
.phase-onboarding-steps {list-style:none;margin:4px 0 0;padding:0;display:grid;gap:8px}
.phase-onboarding-steps li {display:flex;align-items:center;gap:10px;min-height:44px}
.phase-onboarding-steps li button {flex:1;min-height:44px;text-align:left;justify-content:flex-start}
.phase-onboarding-steps li.is-done {color:var(--phase-muted)}
.phase-onboarding-mark {flex:0 0 28px;height:28px;border-radius:50%;display:grid;place-items:center;font-weight:700;font-size:13px;background:#eef1f7;color:var(--phase-muted)}
.phase-onboarding-steps li.is-done .phase-onboarding-mark {background:#e3f4ea;color:#276545}
.phase-onboarding-steps li.is-next .phase-onboarding-mark {background:var(--brand-accent);color:#fff}
.phase-onboarding-footer {display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-top:4px}
.phase-onboarding-footer button {min-height:40px}
/* ===== RC-09 : Bien démarrer réductible ===== */
#phase-onboarding.is-collapsed {padding-block:10px}
.phase-onboarding-head {display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.phase-onboarding-head h2 {font-size:17px}
.phase-onboarding-head p {margin:0;flex:1}
.phase-onboarding-head button {min-height:40px}
.phase-onboarding-footer small {color:var(--phase-muted)}
