/* ============================================================
   m.fenli.app — design system mobile (socle) — v1
   Port CSS du design system iOS Fenli (DorliProsV4).
   Mobile-first ≤ 430 px. Aucune dépendance hors Google Fonts Inter.
   ============================================================ */

/* ------------------------------------------------------------
   1. Tokens (spec_infra §5.1 / spec_design §1–3)
   ------------------------------------------------------------ */
:root {
  --ink: #0B0C0F;
  --paper: #FEFEFE;
  --bg: #F3F5F7;
  --text-2: #6D7481;
  --logo-grey: #9FA0A1;
  --border: #E8EBEF;
  --fenli-50: #EAFAFF;
  --fenli-300: #5AD8FF;
  --fenli-500: #00C7FF;
  --fenli-600: #00A9DB;
  --fenli-700: #0092C7;
  --fenli-800: #006E99;
  --navy: #0A2E40;
  --green: #2BAA66;
  --green-soft: #DFF3E6;
  --red: #E0413A;
  --red-soft: #FDE3E1;
  --grey-soft: #EEF1F5;
  --avatar-blue: #DFE8F3;
  --avatar-text: #4A6B8A;

  --fenli-gradient: linear-gradient(135deg, #5AD8FF 0%, #00C7FF 50%, #0092C7 100%);
  --mic-gradient-rest: linear-gradient(180deg, rgba(11, 12, 15, .92), #0B0C0F);
  --mic-gradient-rec: linear-gradient(180deg, #5AD8FF, #0092C7);
  --shadow-cta-cyan: 0 4px 16px rgba(0, 199, 255, .35);

  --hPad: 20px;
  --r-card: 22px;
  --r-card-big: 26px;
  --r-btn: 22px;
  --r-chip: 18px;
  --r-header: 32px;
  --r-tabbar: 28px;
  --r-tile: 12px;
  --r-field: 14px;

  --press-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ------------------------------------------------------------
   2. Reset léger + base
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }

button {
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: inherit;
  -webkit-tap-highlight-color: transparent;
}
input, textarea, select { font-family: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--fenli-600); outline-offset: 2px; }
input:focus-visible { outline: none; }

/* Press feedback universel (PressScaleStyle) */
button, a.press, .press {
  transition: transform .25s var(--press-spring);
}
button:active, a.press:active, .press:active {
  transform: scale(.97);
}

/* ------------------------------------------------------------
   3. Structure de page + safe-areas
   ------------------------------------------------------------ */
.page {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 var(--hPad);
}
.content.gap-16 { gap: 16px; }

.tabbar-spacer { height: 110px; }

.hidden { display: none !important; }
.center { text-align: center; }

/* ------------------------------------------------------------
   4. Header noir (variantes home / screen)
   ------------------------------------------------------------ */
.m-header {
  background: var(--ink);
  border-radius: 0 0 var(--r-header) var(--r-header);
  padding: calc(4px + env(safe-area-inset-top, 0px)) var(--hPad) 18px;
  color: #fff;
}

.fenli-logo { display: block; --logo-primary: #FEFEFE; }
.m-header--home .fenli-logo { height: 30px; width: auto; aspect-ratio: 2210 / 800; }
.m-header--screen .fenli-logo { height: 22px; width: auto; aspect-ratio: 2210 / 800; }

.m-header--home {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.m-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
  min-width: 0;
}
.m-header-slogan {
  font-size: 15px;
  font-weight: 400;
  color: var(--logo-grey);
  white-space: nowrap;
}
.m-header-actions { display: flex; gap: 8px; }

.hbtn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  flex: none;
}
.hbtn svg { width: 18px; height: 18px; }
.hbtn-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fenli-500);
}

/* Œil : prix visibles → œil cyan ; prix masqués → œil barré blanc */
.hbtn-eye .ic-eye { display: block; color: var(--fenli-500); }
.hbtn-eye .ic-eye-off { display: none; }
body.prices-hidden .hbtn-eye .ic-eye { display: none; }
body.prices-hidden .hbtn-eye .ic-eye-off { display: block; color: #fff; }

.m-header--screen {
  display: flex;
  align-items: center;
  gap: 14px;
}
.m-header-screen-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.m-header-title {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--logo-grey);
}
.m-header-status svg { width: 13px; height: 13px; color: var(--fenli-500); flex: none; }

/* ------------------------------------------------------------
   5. Tab bar flottante
   ------------------------------------------------------------ */
.m-tabbar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  max-width: 398px;
  margin: 0 auto;
  background: var(--paper);
  border-radius: var(--r-tabbar);
  box-shadow: 0 3px 16px rgba(0, 0, 0, .05);
  padding: 10px 12px;
  display: flex;
  z-index: 90;
}
.m-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 400;
}
.m-tab svg { width: 19px; height: 19px; }
.m-tab.active { color: var(--fenli-700); font-weight: 600; }

/* ------------------------------------------------------------
   6. Cartes
   ------------------------------------------------------------ */
.card {
  background: var(--paper);
  border-radius: var(--r-card);
  border: 1px solid var(--border);
  padding: 18px;
}
.card--big { border-radius: var(--r-card-big); }

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
}
.card-title svg { width: 16px; height: 16px; color: var(--fenli-700); flex: none; }

.section-title { font-size: 20px; font-weight: 700; }

/* Sous-section (motif accueil / écrans de config) */
.subsec + .subsec { margin-top: 18px; }
.subsec-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.subsec-head svg { width: 16px; height: 16px; color: var(--fenli-700); flex: none; }
.subsec-head h2, .subsec-head h3 { font-size: 17px; font-weight: 600; }
.subsec-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  margin-top: 3px;
}

/* Section de configuration générique (écrans fenêtre/volets/garage) */
.config-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ------------------------------------------------------------
   7. Boutons
   ------------------------------------------------------------ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  border-radius: var(--r-btn);
  font-size: 16px;
  font-weight: 600;
  padding: 0 22px;
  width: 100%;
}
.btn-between { justify-content: space-between; }
.btn .btn-arrow { font-size: 14px; font-weight: 700; }

.btn-cta {
  background: var(--ink);
  color: #fff;
  justify-content: space-between;
}
.btn-gradient {
  background: var(--fenli-gradient);
  color: var(--navy);
  box-shadow: var(--shadow-cta-cyan);
}
.btn-gradient:disabled {
  background: var(--border);
  color: var(--text-2);
  box-shadow: none;
  cursor: default;
}
.btn-secondary {
  background: var(--paper);
  border: 1px solid var(--border);
  color: var(--ink);
  font-weight: 500;
}
.btn-secondary.danger { color: var(--red); }

/* Bouton refresh 28×28 (carte Tarif) */
.btn-refresh {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fenli-50);
  color: var(--fenli-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.btn-refresh svg { width: 16px; height: 16px; }
.btn-refresh.loading svg { animation: spin 1s linear infinite; }

/* Capsule (pill) : « Scanner avec la caméra », mini-actions */
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.pill svg { width: 14px; height: 14px; }
.pill-sm { padding: 8px 14px; font-size: 13px; box-shadow: none; }

.btn-retry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--fenli-700);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* Badge prix sélectionné (capsule cyan pâle) */
.badge-price {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--fenli-50);
  color: var(--fenli-700);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   8. Chips / radios / switches / steppers (accent #0092C7)
   ------------------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-chip);
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.chip.active, .chip[aria-pressed="true"] {
  background: var(--fenli-700);
  border-color: var(--fenli-700);
  color: #fff;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Radios en rangées (type de caisson, type de porte, styles…) */
.radio-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.radio-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--paper);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: transform .25s var(--press-spring), border-color .15s, background-color .15s;
}
.radio-option:active { transform: scale(.97); }
.radio-option input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.radio-option .radio-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #C9D1D9;
  flex: none;
  position: relative;
  transition: border-color .15s;
}
.radio-option input:checked ~ .radio-dot { border-color: var(--fenli-700); }
.radio-option input:checked ~ .radio-dot::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--fenli-700);
}
.radio-option:has(input:checked),
.radio-option.selected {
  border-color: var(--fenli-700);
  background: var(--fenli-50);
}
.radio-option .radio-sub {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
}

/* Switch (toggle) */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex: none;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch .track {
  position: absolute;
  inset: 0;
  background: #E2E7EC;
  border-radius: 999px;
  transition: background-color .2s;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
  transition: transform .2s;
}
.switch input:checked + .track { background: var(--fenli-700); }
.switch input:checked + .track::after { transform: translateX(20px); }

/* Rangée toggle (WarmEdge, Opalin…) : fond gris, pastille icône, switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg);
  border-radius: var(--r-field);
  padding: 12px;
}
.toggle-ic {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fenli-50);
  color: var(--fenli-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.toggle-ic svg { width: 14px; height: 14px; }
.toggle-txt { flex: 1; min-width: 0; }
.toggle-title { font-size: 14px; font-weight: 600; }
.toggle-sub { font-size: 11px; color: var(--text-2); }

/* Stepper quantité */
.stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}
.stepper button {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--paper);
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stepper button:disabled { color: var(--text-2); opacity: .5; cursor: default; }
.stepper .stepper-value {
  min-width: 40px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}

/* ------------------------------------------------------------
   9. Champs de saisie
   ------------------------------------------------------------ */
.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field-box {
  display: flex;
  align-items: center;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: var(--r-field);
  background: var(--paper);
  padding: 0 14px;
  transition: border-color .15s, box-shadow .15s;
}
.field-box input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  padding: 0;
}
.field-box .unit {
  font-size: 14px;
  color: var(--text-2);
  margin-left: 8px;
  flex: none;
}
.field-box:focus-within {
  border-color: var(--fenli-700);
  box-shadow: inset 0 0 0 1px var(--fenli-700); /* rendu bordure 2px sans décalage */
}
.field-help { font-size: 12px; color: var(--text-2); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; min-width: 0; }

/* Valeur de cote accent (« L 1800 mm ») */
.dim-accent { color: var(--fenli-800); font-weight: 700; font-size: 17px; }

/* ------------------------------------------------------------
   10. Bottom-sheet
   ------------------------------------------------------------ */
.sheet-scrim {
  position: fixed;
  inset: 0;
  background: rgba(11, 12, 15, .45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
  z-index: 100;
}
.sheet-scrim.open { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  max-width: 430px;
  background: var(--paper);
  border-radius: var(--r-card-big) var(--r-card-big) 0 0;
  padding: 10px var(--hPad) calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(105%);
  transition: transform .32s cubic-bezier(.32, .72, .33, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85dvh;
  overflow-y: auto;
}
.sheet.open { transform: none; }
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #D8DDE3;
  margin: 0 auto;
  flex: none;
}
.sheet-title { text-align: center; font-size: 17px; font-weight: 600; }

/* ------------------------------------------------------------
   11. Grilles de tuiles pictos
   ------------------------------------------------------------ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 10px;
  row-gap: 12px;
  margin-top: 12px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 4px;
  background: var(--paper);
  border-radius: var(--r-tile);
  border: 1px solid var(--border);
  min-width: 0;
}
.tile img {
  width: 44px;
  height: 38px;
  object-fit: contain;
}
.tile-label {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-2);
  text-align: center;
  line-height: 11px;
  height: 22px;
  overflow: hidden;
  width: 100%;
}
.tile.selected { border-color: var(--fenli-700); background: var(--fenli-50); }

/* Rangée-bouton avec picto (porte de garage) */
.row-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-tile);
  margin-top: 12px;
  width: 100%;
}
.row-cta img { width: 64px; height: 50px; object-fit: contain; flex: none; }
.row-cta-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.row-cta-text strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.row-cta-text small { font-size: 11px; font-weight: 400; color: var(--text-2); }
.row-cta .chev { color: var(--text-2); flex: none; }
.row-cta .chev svg { width: 13px; height: 13px; }

/* ------------------------------------------------------------
   12. MATRICE de prix (carte Tarif)
   ------------------------------------------------------------ */
.matrix-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.matrix-card-head .card-title { flex: 1; min-width: 0; }
.matrix-meta {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 3px;
}

.matrix-scroll { overflow-x: auto; scrollbar-width: none; margin-top: 12px; }
.matrix-scroll::-webkit-scrollbar { display: none; }

.matrix {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 100%;
  transition: opacity .2s;
}
.matrix.loading { opacity: .45; pointer-events: none; }

/* --matrix-cols = nombre de colonnes couleurs (JS) */
.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: 92px repeat(var(--matrix-cols, 5), minmax(48px, 1fr));
  gap: 6px;
  align-items: center;
}
.matrix-head { padding: 0 6px; }
.matrix-head span {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-2);
  text-align: center;
  line-height: 1.15;
}
.matrix-head span:first-child { text-align: left; }

/* fond cyan progressif : JS pose --row-t = i/(n−1) sur chaque rangée */
.matrix-row {
  background: rgba(0, 199, 255, calc(.08 + var(--row-t, 0) * .28));
  border-radius: 12px;
  padding: 6px;
}
.matrix-row .row-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  padding-left: 4px;
  line-height: 1.2;
}

.matrix-cell {
  position: relative;
  width: 100%;
  padding: 11px 2px;
  border-radius: 10px;
  background: rgba(254, 254, 254, .85);
  border: 1px solid rgba(232, 235, 239, .5);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}
.matrix-cell.selected {
  background: var(--fenli-700);
  border: 2px solid rgba(255, 255, 255, .85);
  padding: 10px 1px;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 199, 255, .3);
}
.matrix-cell.selected::after {
  content: "✓";
  position: absolute;
  top: 1px;
  right: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.matrix-cell:disabled {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
  font-weight: 400;
  cursor: default;
}

/* ------------------------------------------------------------
   13. Estimation / bandeaux / états
   ------------------------------------------------------------ */
.estimate-row {
  display: flex;
  align-items: center;
  gap: 14px;
}
.estimate-info { flex: 1; min-width: 0; }
.estimate-price { font-size: 28px; font-weight: 700; }
.estimate-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.estimate-seal {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--fenli-50);
  color: var(--fenli-700);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.estimate-seal svg { width: 22px; height: 22px; }

/* Bandeaux (avertissement ESTIMATION provisoire, erreurs, succès) */
.banner {
  border-radius: var(--r-field);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}
.banner-estimate { background: var(--fenli-50); color: var(--fenli-800); }
.banner-error { background: var(--red-soft); color: var(--red); }
.banner-success { background: var(--green-soft); color: var(--green); }

/* État chargement */
.state-loading {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}
.spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid var(--fenli-50);
  border-top-color: var(--fenli-700);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* État erreur */
.state-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 0;
  text-align: center;
}
.state-error svg { width: 26px; height: 26px; color: var(--red); }
.state-error-title { font-size: 15px; font-weight: 600; }
.state-error-msg { font-size: 13px; color: var(--text-2); max-width: 260px; }

/* Encart transcript (fiche fenêtre) */
.transcript {
  background: var(--grey-soft);
  border-radius: var(--r-field);
  padding: 12px 14px;
  font-size: 14px;
  font-style: italic;
  color: var(--ink);
  display: flex;
  gap: 8px;
}
.transcript svg { width: 14px; height: 14px; color: var(--text-2); flex: none; margin-top: 2px; }

/* Grille d'attributs (Ouverture / Vitrage / Pose / Quantité) */
.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.attr-cell {
  background: var(--bg);
  border-radius: var(--r-field);
  padding: 12px;
}
.attr-label { font-size: 11px; font-weight: 600; color: var(--text-2); }
.attr-value { font-size: 14px; font-weight: 600; margin-top: 2px; }
.attr-value.todo { color: var(--text-2); font-weight: 400; }

/* ------------------------------------------------------------
   14. Accueil : salutation, quick cards, stats
   ------------------------------------------------------------ */
.greeting {
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.greeting h1 { font-size: 30px; font-weight: 700; color: var(--ink); }
.greeting p { font-size: 17px; font-weight: 400; color: var(--text-2); }

.quick-row { display: flex; gap: 12px; }
.quick-card {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px;
}
.quick-icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--fenli-50);
  color: var(--fenli-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-icon svg { width: 22px; height: 22px; }
.quick-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.quick-sub {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-2);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stats-row {
  display: flex;
  align-items: stretch;
  margin-top: 14px;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
}
.stat-ic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--fenli-50);
  color: var(--fenli-700);
  display: flex;
  align-items: center;
  justify-content: center;
}
.stat-ic svg { width: 16px; height: 16px; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--ink); }
.stat-label { font-size: 12px; font-weight: 400; color: var(--text-2); line-height: 1.25; }
.stat-sep {
  width: 1px;
  height: 50px;
  background: var(--border);
  align-self: center;
  flex: none;
}

/* ------------------------------------------------------------
   15. Hero dictée (bouton micro 130px, halo, anneaux, waveforms)
   ------------------------------------------------------------ */
.hero {
  padding: 28px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mic-wrap {
  position: relative;
  width: 130px;
  height: 130px;
  flex: none;
}
.mic-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1.5px solid rgba(0, 199, 255, .18);
  width: 190px;
  height: 190px;
  transform: translate(-50%, -50%) scale(.95);
  opacity: 0;
  pointer-events: none;
}
.mic-ring.r2 {
  width: 220px;
  height: 220px;
  border-color: rgba(0, 199, 255, .10);
}
.hero.recording .mic-ring { animation: ring-pulse 1.4s ease-out infinite; }
.hero.recording .mic-ring.r2 { animation-duration: 1.6s; animation-delay: .3s; }
@keyframes ring-pulse {
  0% { transform: translate(-50%, -50%) scale(.95); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.08); opacity: 0; }
}

.mic-halo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 142px;
  height: 142px;
  border-radius: 50%;
  background: var(--fenli-50);
  box-shadow: 0 6px 32px rgba(0, 199, 255, .4);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.hero.recording .mic-halo { opacity: 1; }

.mic-btn {
  position: relative;
  z-index: 2;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: var(--mic-gradient-rest);
  box-shadow: 0 4px 20px rgba(0, 0, 0, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform .25s var(--press-spring), box-shadow .25s;
}
.hero.recording .mic-btn {
  background: var(--mic-gradient-rec);
  box-shadow: 0 4px 20px rgba(0, 199, 255, .3);
}
.mic-btn .ic-mic { width: 42px; height: 42px; }
.mic-btn .ic-stop { width: 39px; height: 39px; display: none; }
.hero.recording .mic-btn .ic-mic { display: none; }
.hero.recording .mic-btn .ic-stop { display: block; }

/* Waveform 7 barres (56px de large, hauteur max 60) */
.wave {
  width: 56px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
}
.wave .bar {
  border-radius: 999px;
  background: var(--fenli-gradient);
  height: 10px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .25s, transform .25s;
}
.wave .bar:nth-child(1) { width: 3.8px; --h: 37px; animation-duration: .5s;   animation-delay: 0s; }
.wave .bar:nth-child(2) { width: 4.2px; --h: 40px; animation-duration: .385s; animation-delay: -.05s; }
.wave .bar:nth-child(3) { width: 4.6px; --h: 43px; animation-duration: .3125s; animation-delay: -.08s; }
.wave .bar:nth-child(4) { width: 5px;   --h: 46px; animation-duration: .5s;   animation-delay: -.2s; }
.wave .bar:nth-child(5) { width: 4.6px; --h: 43px; animation-duration: .385s; animation-delay: -.14s; }
.wave .bar:nth-child(6) { width: 4.2px; --h: 40px; animation-duration: .3125s; animation-delay: -.18s; }
.wave .bar:nth-child(7) { width: 3.8px; --h: 37px; animation-duration: .5s;   animation-delay: -.33s; }
.hero.recording .wave .bar {
  opacity: 1;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 199, 255, .45);
  animation-name: wave-bar;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
@keyframes wave-bar {
  0%, 100% { height: 6px; }
  50% { height: var(--h, 30px); }
}

.hero-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hero-status {
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}
.hero-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  text-align: center;
  padding: 0 24px;
  min-height: 20px;
  max-width: 340px;
}
.hero-sub.error { color: var(--red); }

/* ------------------------------------------------------------
   16. Masquage prix
   ------------------------------------------------------------ */
/* Contrat : tout élément .price porte data-price (nombre HT serveur).
   Fenli.renderPrices() écrit « ••• » ou la valeur formatée. */
.price { font-variant-numeric: tabular-nums; }
