/* CreaBud UX v5 « Calme & précis » (#101) — lot 1 : Dashboard, héros, barre du haut, jetons.
   A. Base layout of the new hero (every palette).  B. v5 look for CreaBud Light / Night / Auto.
   C. Clay Citron / Ambre ink.  D. Decoration scenes and personal hero photo.
   Presentation only: no figure, calculation, data, entitlement or E2EE is involved. */

/* ---------- A. Base (all palettes) ---------- */
.hero .hero-top{display:flex;align-items:center;justify-content:space-between;gap:12px}
.hero .hero-num{white-space:nowrap}
.hero-until{font-size:14px;margin:6px 0 12px}
.hero .hero-progress{margin:0 0 14px}
.hero-facts{display:grid;grid-template-columns:1fr 1fr;gap:10px;position:relative;z-index:1}
.hero-fact{border-radius:16px;padding:12px 14px;min-width:0;background:rgba(0,0,0,.18);border:1px solid rgba(255,255,255,.2)}
.hero-fact b{display:block;font-size:22px;line-height:1.15;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.hero-fact span{display:block;font-size:13px;line-height:1.3;margin-top:2px}
.hero-alert{display:flex;gap:8px;align-items:center;border-radius:14px;padding:12px 14px;font-size:15px;font-weight:600;background:rgba(0,0,0,.22);position:relative;z-index:1}
.hero-alert svg{width:18px;height:18px;flex:none}
.hero-how{margin-top:10px;position:relative;z-index:1}
.hero-how>summary{list-style:none;cursor:pointer;min-height:44px;display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:600}
.hero-how>summary::-webkit-details-marker{display:none}
.hero-how>summary::after{content:"";flex:none;width:7px;height:7px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-3px;transition:transform .2s}
.hero-how[open]>summary::after{transform:rotate(-135deg);margin-top:3px}
.hero .hero-how .hero-sub{font-size:14px;line-height:1.5;margin:0;border-radius:14px;padding:10px 14px;background:rgba(0,0,0,.18)}
.hero-sub .hs-row b{font-variant-numeric:tabular-nums}
.hero-sub .hs-total{border-top:1px solid currentColor;margin-top:6px;padding-top:6px}
#nextpay{white-space:nowrap;display:inline-flex;align-items:center;gap:8px}
#nextpay .np-ico{display:inline-flex;width:18px;height:18px}
#nextpay .np-ico svg{width:18px;height:18px}
#nextpay .np-label{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.stat .bal-note{font-size:13px}
@media (prefers-reduced-motion:reduce){.hero-how>summary::after{transition:none}}

/* ---------- B. v5 look: CreaBud clair / CreaBud nuit / Auto ---------- */
html:is([data-theme="light"],[data-theme="auto"]){
  --ux-bg:#f4f3f8; --ux-surface:#fff; --ux-surface-2:#f7f6fb; --ux-line:rgba(23,21,58,.08); --ux-line-strong:rgba(23,21,58,.14);
  --ux-text-2:#55547a; --ux-accent-ink:#b0146a; --ux-pos:#0f7a55; --ux-neg:#c0284f;
  --ux-shadow:0 1px 2px rgba(23,21,58,.05),0 6px 20px rgba(23,21,58,.06);
}
html[data-theme="dark"]{
  --ux-bg:#140c24; --ux-surface:#221638; --ux-surface-2:#2b1e45; --ux-line:rgba(255,255,255,.09); --ux-line-strong:rgba(255,255,255,.16);
  --ux-text-2:#d0c4ee; --ux-accent-ink:#ffbce2; --ux-pos:#66ecca; --ux-neg:#ffb6c7;
  --ux-shadow:0 1px 2px rgba(0,0,0,.35),0 8px 24px rgba(0,0,0,.3);
}
@media (prefers-color-scheme:dark){html[data-theme="auto"]{
  --ux-bg:#140c24; --ux-surface:#221638; --ux-surface-2:#2b1e45; --ux-line:rgba(255,255,255,.09); --ux-line-strong:rgba(255,255,255,.16);
  --ux-text-2:#d0c4ee; --ux-accent-ink:#ffbce2; --ux-pos:#66ecca; --ux-neg:#ffb6c7;
  --ux-shadow:0 1px 2px rgba(0,0,0,.35),0 8px 24px rgba(0,0,0,.3);
}}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]){
  --ux-hero:linear-gradient(140deg,#b8236f 0%,#8a36c8 55%,#4251cf 100%);
  --ux-r-card:22px; --ux-r-ctl:14px;
}
/* 1. Calm canvas: the brand gradient is the hero's signature, not every screen's background. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]){background:var(--ux-bg)!important}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) body{background:var(--ux-bg)!important}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) body::before{display:none}
/* 2. Solid cards, hairline, one soft shadow, one radius. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .card{background:var(--ux-surface);border:1px solid var(--ux-line);border-radius:var(--ux-r-card);box-shadow:var(--ux-shadow);-webkit-backdrop-filter:none;backdrop-filter:none}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .up-row{background:var(--ux-surface-2);border:1px solid var(--ux-line);box-shadow:none;border-radius:16px}
/* 3. Top bar: one line. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #nextpay{background:var(--ux-surface);border:1px solid var(--ux-line);box-shadow:var(--ux-shadow);font-size:15px;min-height:44px;padding:6px 8px 6px 14px;border-radius:999px}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #nextpay .np-ico{color:var(--ux-accent-ink)}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .topbar{flex-wrap:nowrap}
/* 4. Hero (no personal photo, no decoration scene): deep CreaBud gradient, AA white text. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero{padding:22px 20px 16px;border-radius:26px;min-height:0;justify-content:flex-start}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero:not(.has-img):not([data-deco-scene]){background:var(--ux-hero);box-shadow:0 14px 34px rgba(120,50,170,.28)}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero:not(.has-img):not([data-deco-scene]) .hero-blob{display:none}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero .hero-label{font-size:15px;font-weight:600;letter-spacing:0;text-transform:none;color:#fff}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero .hero-num{font-size:clamp(40px,12.5vw,52px);line-height:1.05;letter-spacing:-.025em;margin:8px 0 0;color:#fff}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero :is(.hero-until,.hero-fact b,.hero-fact span,.hero-how>summary,.hero-sub,.hero-alert){color:#fff}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero .hero-fact{background:rgba(20,8,60,.22);border-color:rgba(255,255,255,.22)}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero .hp-track{height:6px;background:rgba(255,255,255,.28)}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) .hero .hero-sprout{width:44px;height:44px}
/* 5. Dashboard secondary stats: grouped list rows, not a cramped 2-column grid. */
@media (max-width:700px){
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4{display:flex;flex-direction:column;gap:0;margin-top:14px!important}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat{border-radius:0;margin:0!important;box-shadow:none;border-top-width:0;padding:14px 16px;display:grid;grid-template-columns:auto 1fr auto;column-gap:12px;align-items:center}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child{border-radius:var(--ux-r-card);border-top-width:1px;margin-bottom:12px!important;box-shadow:var(--ux-shadow);display:flex!important;flex-direction:column;align-items:stretch;text-align:left;padding:16px 18px}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child *{text-align:left}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .stat-top{justify-content:flex-start}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .stat-top h3{font-size:15px;font-weight:600;text-transform:none;letter-spacing:0}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .big{font-size:28px;margin:2px 0}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .avail-row{display:flex;justify-content:space-between;font-size:15px;width:100%}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .avail-name{font-size:15px}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .mobile-avail{display:none!important}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:first-child .desktop-avail{display:block!important;margin-top:12px;border-top:1px solid var(--ux-line);padding-top:4px}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .desktop-avail>summary{min-height:44px;display:flex;align-items:center;justify-content:space-between;font-size:15px;cursor:pointer}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .desktop-avail>summary b{margin-left:auto;margin-right:10px}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:nth-child(2){border-top-width:1px;border-radius:var(--ux-r-card) var(--ux-r-card) 0 0}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:last-child{border-radius:0 0 var(--ux-r-card) var(--ux-r-card);box-shadow:var(--ux-shadow)}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:not(:first-child) .stat-top{display:contents}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:not(:first-child) .stat-ico{grid-row:1/span 2;grid-column:1}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:not(:first-child) h3{grid-column:2;grid-row:1;margin:0;font-size:15px;font-weight:600;text-transform:none;letter-spacing:0}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:not(:first-child) .big{grid-column:3;grid-row:1/span 2;font-size:20px;margin:0;text-align:right}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .grid.stat4>.card.stat:not(:first-child) .muted{grid-column:2;grid-row:2;font-size:13px}
  html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .stat .stat-ico{width:36px;height:36px;border-radius:11px}
}
/* 6. Labels and small text on the Dashboard: sentence case, 13 px minimum, readable secondary ink. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard :is(.muted,.note,.avail-title,.avail-sub){font-size:13px;color:var(--ux-text-2)}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .avail-title{text-transform:none!important;letter-spacing:0!important;font-weight:600}
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) #tab-dashboard .linklike{min-height:44px;display:inline-flex;align-items:center;font-size:15px;font-weight:600;color:var(--ux-accent-ink)}
/* 7. Buttons use the brand typeface (some fell back to Arial). Focus ring only for keyboard users. */
html:is([data-theme="light"],[data-theme="dark"],[data-theme="auto"]) button{font-family:inherit}

/* ---------- C. Clay Citron / Clay Ambre: mineral hero keeps its dark ink ---------- */
html:is([data-theme="mono-yellow"],[data-theme="mono-orange"]) .hero:not(.has-img):not([data-deco-scene]) :is(.hero-until,.hero-fact b,.hero-fact span,.hero-how>summary,.hero-sub,.hero-alert){color:#202735!important}
html:is([data-theme="mono-yellow"],[data-theme="mono-orange"]) .hero:not(.has-img):not([data-deco-scene]) :is(.hero-fact,.hero-alert,.hero-how .hero-sub){background:rgba(255,255,255,.5);border-color:rgba(32,39,53,.12)}

/* ---------- D. Decoration scenes and personal hero photo: white text on a guaranteed scrim ---------- */
#tab-dashboard .hero[data-deco-scene]:not(.has-img) :is(.hero-until,.hero-fact b,.hero-fact span,.hero-how>summary,.hero-sub,.hero-alert){color:#fff!important;text-shadow:0 1px 6px #0009}
#tab-dashboard .hero[data-deco-scene]:not(.has-img) :is(.hero-fact,.hero-alert,.hero-how .hero-sub){background:rgba(8,12,30,.5);border-color:rgba(255,255,255,.18)}
/* A personal photo always wins (decision #101-1). Uniform scrim keeps white text ≥ 4.5:1 even on a white photo. */
.hero.has-img::after{background:rgba(12,8,32,.58)!important;display:block!important}
.hero.has-img :is(.hero-kicker,.hero-num,.hero-until,.hero-fact b,.hero-fact span,.hero-how>summary,.hero-sub,.hero-alert){color:#fff!important}
.hero.has-img :is(.hero-fact,.hero-alert,.hero-how .hero-sub){background:rgba(8,6,24,.35);border-color:rgba(255,255,255,.2)}
.hero.has-img>*{position:relative;z-index:1}
/* Approved v4.2 scenes keep their art, under an even veil so every hero text stays ≥ AA
   (measured before v5: 1.6–3.4:1 on Aurora / Garden / Cabin). */
#tab-dashboard .hero[data-deco-scene]:not(.has-img)::after{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;border-radius:inherit;
  background:linear-gradient(180deg,rgba(8,12,30,.42) 0%,rgba(8,12,30,.56) 100%)}
#tab-dashboard .hero[data-deco-scene]:not(.has-img)>*{position:relative;z-index:1}
#tab-dashboard .hero[data-deco-scene]:not(.has-img) .hero-blob{display:none}
