/* Tafat — styles. Style épuré, palette nature, clair / sombre selon le réglage du téléphone.
   Toutes les couleurs sont ici, en variables : :root = clair, @media (prefers-color-scheme: dark) = sombre. */

@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/Geist-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/Geist-SemiBold.woff2') format('woff2'); font-weight: 600 900; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  /* Base */
  --bg: #F1EEE7;          /* Lin */
  --card: #FBFAF6;        /* Crème */
  --ink: #1E211D;         /* Forêt */
  --ink-2: #3A3D36;
  --muted: #6A6A60;
  --line: #E4DFD3;
  --line-2: #CFC8B8;      /* bordures plus marquées (cases, pointillés) */
  --line-soft: #EEEAE1;   /* séparateurs dans une carte */
  --track: #E6E1D5;       /* fond des barres de progression */
  --field: #F1EEE7;       /* fond des champs */
  --on-ink: #FBFAF6;
  /* Pastels (texte --on-pastel dessus, dans les deux modes) */
  --sage: #C9D6C3;        /* Sauge : agenda, avatar, bouton + */
  --wheat: #EBD9B4;       /* Blé : finances */
  --clay: #E8C6B3;        /* Argile : échéances, alertes */
  --olive: #D7DCB6;       /* Voiture */
  --sand: #E6DAC4;        /* Documents, garde-robe */
  --linen: #DCD5C8;       /* Projets, carnet, général */
  --mist: #C8D6D3;        /* Voyages */
  --dusk: #D6D2DE;        /* Spiritualité, dîner */
  --rose: #EBCFCB;        /* Cycles */
  --on-pastel: #1E211D;
  --on-pastel-2: #45463E;
  --pastel-surface: rgba(251, 250, 246, .72); /* pastille / bouton « blanc » posé sur un pastel */
  /* Accents */
  --accent: #4E6B47;      /* liens, cases cochées, barres */
  --accent-ink: #FBFAF6;
  --accent-soft: #E1E8DC;
  --warn-bg: #F2DED2;
  --warn-ink: #7A3A1E;
  --hot: #B8693F;
  --hot-ink: #8A4120;
  --income: #3F6B45;
  --danger: #A3261B;
  --danger-bg: #F4DAD6;
  --period: #B0506A;      /* règles */
  --period-2: #D493A6;    /* règles habituelles, barre du cycle */
  --period-soft: #E6BCC6; /* cycle en cours */
  --dusk-strong: #5E587E; /* barre de progression du jeûne */
  --overlay: rgba(18, 20, 17, .42);
  --shadow: 0 10px 30px rgba(30, 33, 29, .12), 0 2px 6px rgba(30, 33, 29, .06);
  /* Formes */
  --radius-xl: 30px;      /* grandes cartes */
  --radius-lg: 26px;      /* lignes, cartes moyennes */
  --radius: 20px;
  --radius-field: 14px;
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --nav-h: 68px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121411;
    --card: #1C1F1B;
    --ink: #EFEBE3;
    --ink-2: #D2CEC4;
    --muted: #A29F94;
    --line: #2A2E28;
    --line-2: #40453D;
    --line-soft: #262A24;
    --track: #2C302A;
    --field: #252923;
    --on-ink: #121411;
    --sage: #B3C4AC;
    --wheat: #DCC79C;
    --clay: #D9B39F;
    --olive: #C4CA9F;
    --sand: #D3C6AE;
    --linen: #C7BFB1;
    --mist: #B1C3BF;
    --dusk: #C1BCCC;
    --rose: #D9B7B3;
    --pastel-surface: rgba(251, 250, 246, .6);
    --accent: #B3C4AC;
    --accent-ink: #121411;
    --accent-soft: #283026;
    --warn-bg: #3A2A22;
    --warn-ink: #E8C6B3;
    --hot: #D99A74;
    --hot-ink: #E6B092;
    --income: #A9C7A0;
    --danger: #F08A7E;
    --danger-bg: #3D2321;
    --period: #E08DA2;
    --period-2: #B97586;
    --period-soft: #6E4752;
    --dusk-strong: #B9B2D6;
    --overlay: rgba(0, 0, 0, .6);
    --shadow: 0 10px 30px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.45;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
h1, h2, h3 { margin: 0; font-weight: 500; }
strong, b { font-weight: 600; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; position: relative; }
.screen {
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(var(--nav-h) + 48px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; outline: none;
}
.screen.full { padding-bottom: 40px; }

/* ---- Titres ---- */
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 400; }
.title { font-size: 40px; font-weight: 300; letter-spacing: -0.035em; line-height: 1.08; }
.title strong { font-weight: 600; }
.h2 { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; }
.big-num { font-size: 46px; font-weight: 300; letter-spacing: -0.05em; line-height: 1; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* ---- Cartes (sans bordure ni ombre) ---- */
.card { background: var(--card); border-radius: var(--radius-lg); padding: 14px 18px; }
.card-lg { background: var(--card); border-radius: var(--radius-xl); padding: 20px 22px; }
.card-list { background: var(--card); border-radius: var(--radius-lg); overflow: hidden; }
.card-list > * + * { border-top: 1px solid var(--line-soft); }
.alert { background: var(--clay); color: var(--on-pastel); border-radius: var(--radius-lg); padding: 14px 18px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; border: none; width: 100%; text-align: left; }
.alert strong { font-size: 14px; }
.alert span { font-size: 13px; font-weight: 500; white-space: nowrap; }
.empty { border: 1px dashed var(--line-2); border-radius: var(--radius-lg); padding: 22px 20px; color: var(--ink-2); font-size: 14px; line-height: 1.6; background: var(--card); }

/* ---- Boutons ---- */
.btn { min-height: 44px; padding: 0 18px; border-radius: 99px; border: none; background: var(--card);
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; color: var(--ink); }
.card .btn, .card-lg .btn, .card-list .btn, .sheet .btn, .empty .btn { background: var(--field); }
.btn-primary, .card .btn-primary, .card-lg .btn-primary, .card-list .btn-primary, .sheet .btn-primary, .empty .btn-primary { background: var(--ink); color: var(--on-ink); }
.btn-danger { color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; }
.btn-row { display: flex; gap: 8px; }
.btn-row > .btn { flex: 1; }
.link-btn { border: none; background: none; padding: 8px 0; font-size: 13px; font-weight: 500; color: var(--accent); min-height: 40px; text-decoration: none; }
.icon-btn { width: 44px; height: 44px; border: none; background: none; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border-radius: 99px; flex-shrink: 0; }
/* Boutons ronds 44 px : fond crème + icône, ou fond Forêt (action principale), sauge, ou simple bordure. */
.round-btn { width: 44px; height: 44px; border-radius: 99px; border: none; background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; text-decoration: none; padding: 0; position: relative; }
.round-btn.is-ink { background: var(--ink); color: var(--on-ink); }
.round-btn.is-sage { background: var(--sage); color: var(--on-pastel); }
.round-btn.is-light { background: var(--pastel-surface); color: var(--on-pastel); }
.round-btn.is-outline { background: transparent; border: 1px solid var(--line-2); color: var(--ink); }
.round-btn .dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 99px; background: var(--hot); box-shadow: 0 0 0 2px var(--card); }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---- Étiquettes de module (pastels, texte Forêt) ---- */
.tag { font-size: 11px; font-weight: 500; padding: 4px 10px; border-radius: 99px; white-space: nowrap; color: var(--on-pastel); background: var(--linen); }
.tag-Santé { background: var(--sage); }
.tag-Soins { background: var(--clay); }
.tag-Finances { background: var(--wheat); }
.tag-Voiture { background: var(--olive); }
.tag-Documents { background: var(--sand); }
.tag-Projets { background: var(--linen); }
.tag-Voyages { background: var(--mist); }
.tag-Agenda { background: var(--linen); }

/* ---- Événements ---- */
.event { display: flex; gap: 12px; align-items: center; }
.event-when { width: 58px; flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-size: 15px; font-weight: 500; }
.event-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.event-card { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.event-card .event-title { font-size: 16px; }
.is-done .event-title { text-decoration: line-through; color: var(--muted); }
.is-late .event-when-text { color: var(--hot-ink); }
.plain-btn { border: none; background: none; padding: 0; text-align: left; width: 100%; }

/* ---- Filtres (pastilles de 40 px) ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 99px; border: none; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; }
.card .chip, .card-lg .chip, .sheet .chip { background: var(--field); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 -20px; padding: 0 20px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .chip { flex-shrink: 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; background: var(--card); border-radius: 99px; }
.card .segmented, .sheet .segmented { background: var(--field); }
.segmented button { min-height: 40px; border: none; border-radius: 99px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }

/* ---- Courses ---- */
.section-name { font-size: 13px; font-weight: 500; color: var(--muted); padding: 4px 4px; }
.item { display: flex; align-items: center; min-height: 52px; }
.item-toggle { flex: 1; min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 0 0 18px; border: none; background: none; text-align: left; }
.box { width: 22px; height: 22px; flex-shrink: 0; border-radius: 99px; border: 1.5px solid var(--line-2); display: flex; align-items: center; justify-content: center; background: var(--card); color: var(--on-ink); }
.is-checked .box { background: var(--ink); border-color: var(--ink); }
.item-name { flex: 1; font-size: 15px; font-weight: 400; }
.is-checked .item-name { text-decoration: line-through; color: var(--muted); }
.item-qty { font-size: 13px; color: var(--muted); font-weight: 400; }

/* ---- Finances ---- */
.progress { height: 6px; border-radius: 99px; background: var(--track); overflow: hidden; }
.progress > div { height: 100%; border-radius: 99px; background: var(--accent); }
.progress.thin { height: 5px; }
.progress .hot { background: var(--hot); }
.balances { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.balance { border-radius: var(--radius-lg); padding: 16px 18px; background: var(--card); }
.balance.primary { background: var(--wheat); color: var(--on-pastel); }
.balance-label { font-size: 13px; font-weight: 400; color: var(--muted); }
.balance.primary .balance-label { color: var(--on-pastel-2); }
.balance-amount { font-size: 22px; font-weight: 400; margin-top: 4px; letter-spacing: -0.03em; }
.month-switch { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-switch strong { font-size: 15px; font-weight: 500; text-transform: capitalize; }
.tx { display: flex; align-items: center; gap: 12px; padding: 14px 18px; width: 100%; border: none; background: none; text-align: left; }
.tx-body { flex: 1; min-width: 0; }
.tx-label { font-size: 15px; font-weight: 500; }
.tx-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.tx-amount { font-size: 15px; font-weight: 500; white-space: nowrap; }
.tx-amount.in { color: var(--income); }
.budget { display: flex; flex-direction: column; gap: 6px; border: none; background: none; padding: 0; width: 100%; text-align: left; }
.budget-head { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; width: 100%; }
.budget-head strong { font-weight: 500; }
.budget-head span { color: var(--muted); font-weight: 400; }
.budget-head span.hot { color: var(--hot-ink); }

/* ---- Modules ---- */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.module { min-height: 104px; text-align: left; padding: 16px 18px; border-radius: var(--radius-lg); border: none; background: var(--card);
  display: flex; flex-direction: column; justify-content: space-between; gap: 12px; text-decoration: none; color: var(--ink); }
.module-dot { width: 40px; height: 40px; border-radius: 99px; display: flex; align-items: center; justify-content: center; color: var(--on-pastel); }
.module-name { display: block; font-size: 15px; font-weight: 500; }
.module-sub { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.soon { font-size: 11px; font-weight: 500; color: var(--muted); }
.tone-sage { background: var(--sage); } .tone-wheat { background: var(--wheat); } .tone-clay { background: var(--clay); }
.tone-olive { background: var(--olive); } .tone-sand { background: var(--sand); } .tone-linen { background: var(--linen); }
.tone-mist { background: var(--mist); } .tone-dusk { background: var(--dusk); } .tone-rose { background: var(--rose); }
[class*="tone-"] { color: var(--on-pastel); }

/* ---- Navigation flottante (pilule) ---- */
.nav {
  position: fixed; z-index: 10;
  left: max(16px, calc(50% - 224px)); right: max(16px, calc(50% - 224px));
  bottom: calc(16px + env(safe-area-inset-bottom));
  height: var(--nav-h); padding: 0 10px; border-radius: 99px;
  background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 4px;
}
.nav a { height: 48px; min-width: 48px; flex: 1 1 0; display: flex; align-items: center; justify-content: center; gap: 8px; border-radius: 99px;
  color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; transition: flex-grow .2s; }
.nav a .nav-label { display: none; }
.nav a[aria-current="page"] { flex: 2.4 1 0; background: var(--ink); color: var(--on-ink); padding: 0 16px; }
.nav a[aria-current="page"] .nav-label { display: inline; }
.fab { width: 48px; height: 48px; border-radius: 99px; border: none; background: var(--sage); color: var(--on-pastel); display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: 4px; }

/* ---- Feuilles (formulaires qui montent du bas) ---- */
.sheet-overlay { position: fixed; inset: 0; z-index: 20; background: var(--overlay); display: flex; flex-direction: column; justify-content: flex-end; animation: fade .15s ease-out; }
.sheet-close-area { flex: 1; border: none; background: transparent; min-height: 40px; }
.sheet { background: var(--card); border-radius: var(--radius-xl) var(--radius-xl) 0 0; padding: 12px 22px calc(26px + env(safe-area-inset-bottom));
  max-width: 480px; width: 100%; margin: 0 auto; max-height: 88vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  animation: up .2s ease-out; }
.sheet-handle { width: 40px; height: 5px; border-radius: 99px; background: var(--line-2); align-self: center; }
.sheet-title { font-size: 24px; font-weight: 300; letter-spacing: -0.03em; }
.quick { min-height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 18px; border: none; border-radius: 99px; background: var(--field); text-align: left; font-size: 15px; font-weight: 500; width: 100%; color: var(--ink); }
.quick-dot { width: 10px; height: 10px; border-radius: 99px; flex-shrink: 0; }
@keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- Formulaires ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--muted); padding-left: 4px; }
.input { min-height: 48px; padding: 0 14px; border-radius: var(--radius-field); border: 1px solid transparent; background: var(--field); font-size: 16px; width: 100%; color: var(--ink); }
.input:focus { border-color: var(--line-2); outline: none; }
.screen .input { background: var(--card); }
.screen .card .input, .screen .card-lg .input { background: var(--field); }
textarea.input { padding: 12px 14px; min-height: 84px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 400; min-height: 44px; padding-top: 10px; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); flex-shrink: 0; }
.type-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--field); border-radius: 99px; }
.type-switch button { min-height: 40px; border: none; border-radius: 99px; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); }
.type-switch button[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.error { color: var(--danger); font-size: 13px; font-weight: 500; min-height: 1em; }

/* ---- Connexion ---- */
.login { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; gap: 28px; padding: 32px 24px; max-width: 420px; margin: 0 auto; }
.login-logo { width: 64px; height: 64px; border-radius: 20px; }
.pin { letter-spacing: .4em; font-size: 22px; text-align: center; font-weight: 500; }

/* ---- Message temporaire ---- */
.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--on-ink); padding: 12px 18px; border-radius: 99px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 30; max-width: calc(100% - 40px); }
.toast.show { opacity: 1; transform: translateX(-50%); }

/* ---- Carnet ---- */
.contact { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.contact-name { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.contact-name svg { color: var(--hot); fill: currentColor; flex-shrink: 0; }
.contact-meta { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-actions .btn { flex: 1 1 auto; }
.pick { display: flex; flex-direction: column; gap: 2px; width: 100%; min-height: 56px; padding: 10px 18px; border: none; background: none; text-align: left; justify-content: center; color: var(--ink); }
.pick strong { font-size: 15px; font-weight: 500; }
.pick span { font-size: 13px; color: var(--muted); }
.pick-list { max-height: 50vh; overflow-y: auto; }
.sheet .card-list { background: var(--field); }
.linked { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--sage); color: var(--on-pastel);
  border-radius: 99px; padding: 4px 4px 4px 16px; font-size: 13px; font-weight: 500; min-height: 44px; }
.event-place { display: flex; gap: 6px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.event-place svg { flex-shrink: 0; margin-top: 1px; color: var(--muted); }

.loading { color: var(--muted); font-size: 14px; padding: 40px 0; text-align: center; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---- Documents ---- */
.doc-card { display: flex; align-items: center; gap: 12px; padding: 16px 18px; text-decoration: none; color: var(--ink); min-height: 68px; }
.doc-card > svg { color: var(--muted); flex-shrink: 0; }
.doc-icon { width: 44px; height: 44px; border-radius: 99px; background: var(--sand); color: var(--on-pastel); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.doc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-expiry { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.doc-expiry.is-soon { background: var(--clay); color: var(--on-pastel); border-radius: 99px; padding: 4px 10px; align-self: flex-start; }
.doc-row { display: flex; align-items: center; gap: 2px; padding: 8px 6px 8px 18px; min-height: 62px; }
.doc-text { flex: 1; min-width: 0; }
.doc-label { font-size: 12px; font-weight: 400; color: var(--muted); }
.doc-value { font-size: 16px; font-weight: 500; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; margin-top: 1px; }
.doc-value.is-secret { letter-spacing: .15em; color: var(--ink-2); }
.custom-field { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--radius); background: var(--field); }
.doc-file { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 48px; text-decoration: none; color: var(--ink); }
.doc-file .doc-text { display: flex; flex-direction: column; gap: 1px; }
.doc-file .doc-value { font-size: 15px; }
.event-budget { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.event-budget svg { color: var(--accent); flex-shrink: 0; }

/* ---- Voyages ---- */
.trip-icon { background: var(--mist); color: var(--on-pastel); }
.trip-total { font-size: 13px; font-weight: 500; color: var(--ink); margin-top: 2px; }
.trip-big { font-size: 40px; font-weight: 300; letter-spacing: -0.05em; margin-top: 2px; line-height: 1.1; }
.trip-day::first-letter { text-transform: uppercase; }
.contact-name .tag { margin-left: 4px; }

/* ---- Projets ---- */
.project-icon { background: var(--linen); color: var(--on-pastel); }
.doc-body .progress { margin-top: 6px; }
.project-item { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 8px 0; }
.project-item .item-qty { font-size: 12px; }
.is-late-text { color: var(--hot-ink); }

/* ---- Voiture ---- */
.car-add { justify-content: flex-start; border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); min-height: 52px; }
.car-next { color: var(--accent); font-weight: 500; }
.car-next.is-due { color: var(--hot-ink); }

/* ---- Cuisine ---- */
.recipe-icon { background: var(--wheat); color: var(--on-pastel); }
.recipe-thumb { width: 56px; height: 56px; border-radius: 18px; object-fit: cover; flex-shrink: 0; background: var(--wheat); }
.recipe-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-xl); background: var(--wheat); }
.recipe-list, .recipe-steps { margin: 0; padding: 16px 18px 16px 38px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; line-height: 1.5; }
.recipe-steps li::marker { font-weight: 500; color: var(--accent); }
.menu-day { display: flex; flex-direction: column; gap: 2px; padding: 14px 8px 8px 18px; }
.menu-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink); }
.menu-day-title { font-size: 13px; font-weight: 500; color: var(--muted); margin-bottom: 2px; }
.is-today .menu-day-title { color: var(--ink); }
.menu-slot { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.menu-meal { width: 64px; flex-shrink: 0; font-size: 12px; font-weight: 400; color: var(--muted); }
.menu-choice { flex: 1; min-width: 0; min-height: 44px; border: none; background: none; text-align: left; font-size: 15px; font-weight: 500; padding: 0; color: var(--ink); }
.menu-choice.is-empty { color: var(--accent); font-weight: 400; font-size: 14px; }
.ingredient-check { padding: 10px 18px; margin: 0; }
.menu-week strong { text-transform: none; }
.menu-choice.is-recipe { display: flex; align-items: center; gap: 4px; color: var(--ink); text-decoration: none; }
.menu-choice.is-recipe svg { color: var(--accent); flex-shrink: 0; }

/* ---- Soins ---- */
.product { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.product .btn-row .btn { flex: 0 0 auto; }
details > summary { list-style-position: inside; }

/* ---- Aujourd'hui ---- */
.today-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.today-bar-right { display: flex; gap: 8px; }
.today-hello { display: flex; flex-direction: column; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 99px; flex-shrink: 0; background: var(--sage); color: var(--on-pastel);
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 500; text-decoration: none; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
img.avatar { object-fit: cover; object-position: center 25%; }
.avatar-lg { width: 64px; height: 64px; font-size: 24px; }

/* Grande carte pastel (rendez-vous, finances, échéance) */
.panel { border-radius: var(--radius-xl); padding: 20px 22px; color: var(--on-pastel); display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.panel-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-label { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 500; }
.panel-label::first-letter { text-transform: uppercase; }
.panel-actions { display: flex; gap: 8px; }
.panel-text { font-size: 26px; font-weight: 300; letter-spacing: -0.03em; line-height: 1.3; margin: 0; }
.panel-text strong { font-weight: 600; }
.panel-pill { display: inline-block; vertical-align: middle; font-size: 14px; font-weight: 500; letter-spacing: 0; padding: 6px 12px; border-radius: 99px;
  background: var(--pastel-surface); margin: 0 2px; line-height: 1.2; }
.panel-rule { height: 1px; background: var(--on-pastel); opacity: .16; border: none; margin: 0; }
.panel-tags { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--on-pastel-2); }
.panel-sub { font-size: 13px; color: var(--on-pastel-2); }
.panel-ico { width: 44px; height: 44px; border-radius: 99px; background: var(--pastel-surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.month-pill { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 99px; background: var(--pastel-surface); font-size: 13px; }
.month-pill span { padding: 6px 10px; color: var(--on-pastel-2); }
.month-pill strong { padding: 6px 12px; border-radius: 99px; background: var(--ink); color: var(--on-ink); font-weight: 500; text-transform: capitalize; }
.money-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.money-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.money-side.is-right { align-items: flex-end; text-align: right; }
.money-side strong { font-size: 18px; font-weight: 500; letter-spacing: -0.02em; }
.money-big { display: flex; align-items: baseline; gap: 6px; }
.money-big > span:last-child { font-size: 15px; font-weight: 500; }

/* Une ligne de rendez-vous */
.appt { display: flex; align-items: center; gap: 14px; padding: 10px 12px 10px 10px; border-radius: var(--radius-lg); background: var(--card);
  border: none; width: 100%; text-align: left; color: var(--ink); }
.appt-when { width: 58px; height: 60px; border-radius: 20px; background: var(--ink); color: var(--on-ink); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.appt-when strong { font-size: 15px; font-weight: 500; letter-spacing: -0.02em; }
.appt-when span { font-size: 11px; opacity: .7; }
.appt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.appt-title { font-size: 16px; font-weight: 500; }
.appt-meta { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--card); border: none;
  text-decoration: none; color: var(--ink); min-height: 112px; }
.tile-head { display: flex; align-items: center; gap: 10px; }
.tile-icon { width: 36px; height: 36px; border-radius: 99px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--on-pastel); }
.tile-label { font-size: 13px; font-weight: 400; color: var(--muted); }
.tile-value { font-size: 16px; font-weight: 500; line-height: 1.3; text-decoration: none; color: var(--ink); }
.meal-tile .btn { align-self: flex-start; }
.meal-link::after { content: ' ›'; color: var(--accent); }
.meal-dejeuner { background: var(--wheat); }
.meal-diner { background: var(--dusk); }

/* ---- Santé ---- */
.cycle-status { font-size: 22px; font-weight: 400; letter-spacing: -0.02em; }
.cycle-dot { width: 12px; height: 12px; border-radius: 99px; background: var(--accent); }
.cycle-dot.is-period { background: var(--period); }
.cycle-card .progress .hot { background: var(--period); }
.cycle-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cycle-stats .card { padding: 14px; border-radius: var(--radius); }
.cycle-num { font-size: 22px; font-weight: 400; letter-spacing: -0.03em; margin-top: 2px; }

/* ---- Cycles ---- */
.cycle-icon { background: var(--rose); color: var(--on-pastel); }
.cycle-big { font-size: 40px; font-weight: 300; letter-spacing: -0.05em; line-height: 1.1; margin-top: 2px; }
.cycle-badge { font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 99px; background: var(--sage); color: var(--on-pastel); white-space: nowrap; }
.cycle-badge.is-period { background: var(--rose); }
.cycle-list { display: flex; flex-direction: column; padding: 4px 18px; }
.cycle-list > * + * { border-top: 1px solid var(--line-soft); }
.cycle-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border: none; background: none; width: 100%; text-align: left; min-height: 52px; color: var(--ink); }
.cycle-row-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cycle-row-dates { color: var(--ink-2); font-weight: 400; }
.cycle-row-head strong { font-weight: 500; }
.cycle-track { position: relative; height: 10px; border-radius: 99px; background: var(--track); }
.cycle-fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--rose); overflow: hidden; display: block; }
.cycle-fill.is-current { background: repeating-linear-gradient(90deg, var(--rose) 0 6px, var(--period-soft) 6px 9px); }
.cycle-period { position: absolute; inset: 0 auto 0 0; background: var(--period); display: block; }
.cycle-start { position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--period); display: block; }
.cycle-expected { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--period); border-radius: 2px; }
.cycle-row.is-odd .cycle-fill { background: var(--line-2); }
.cycle-row.is-odd strong { color: var(--muted); }
.cycle-note { font-size: 12px; color: var(--hot-ink); font-weight: 500; }
.year-row { display: grid; grid-template-columns: 40px 1fr 44px; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 4px 0; }
.year-label { font-size: 13px; font-weight: 500; grid-row: span 2; }
.year-track { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; display: block; }
.year-track span { display: block; height: 100%; border-radius: 99px; background: var(--rose); }
.year-value { font-size: 14px; font-weight: 500; text-align: right; }
.year-meta { grid-column: 2 / span 2; font-size: 11px; color: var(--muted); font-weight: 400; }

.period-soon { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--rose); color: var(--on-pastel); text-decoration: none; }
.period-soon-icon { width: 40px; height: 40px; border-radius: 99px; background: var(--pastel-surface); color: var(--on-pastel); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.period-soon-text { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.period-soon-text strong { font-size: 15px; font-weight: 500; }
.period-soon-text span { font-size: 13px; font-weight: 400; opacity: .8; }

/* ---- Spiritualité ---- */
.arabic { font-family: 'SF Arabic', 'Geeza Pro', 'Noto Naskh Arabic', 'Segoe UI', 'Arial', sans-serif; }
textarea.arabic { font-size: 18px; line-height: 1.8; }
.spirit-card .progress > div { background: var(--dusk-strong); }
.spirit-big { font-size: 46px; font-weight: 300; letter-spacing: -0.05em; }
.spirit-unit { font-size: 14px; font-weight: 400; color: var(--muted); }
.dua-theme { padding: 0; overflow: hidden; }
.dua-summary { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 64px; cursor: pointer; list-style: none; }
.dua-summary::-webkit-details-marker { display: none; }
.dua-emoji { font-size: 20px; width: 40px; height: 40px; border-radius: 99px; background: var(--dusk); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dua-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: right; }
.dua-title strong { font-size: 17px; font-weight: 500; }
.dua-title span { font-size: 13px; color: var(--muted); }
.dua-count { font-size: 12px; font-weight: 500; color: var(--on-pastel); background: var(--dusk); border-radius: 99px; padding: 3px 10px; flex-shrink: 0; }
.dua-theme[open] .dua-summary { border-bottom: 1px solid var(--line-soft); }
.dua-theme > .stack-sm { padding: 10px 18px 16px; }
.dua { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 4px; border-radius: var(--radius); background: var(--field); }
.dua-text { margin: 0; font-size: 19px; line-height: 1.9; text-align: right; user-select: text; -webkit-user-select: text; }
.dua-actions { display: flex; justify-content: flex-start; gap: 2px; }
.cycle-period.is-usual { background: var(--period-2); }
.cycle-stats .plain-btn.card { text-align: left; }
.cycle-glance { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--radius-lg); background: var(--card);
  color: var(--ink); text-decoration: none; }
.cycle-glance .period-soon-icon { background: var(--rose); }
.cycle-glance.is-soon { background: var(--rose); color: var(--on-pastel); }
.cycle-glance.is-soon .period-soon-icon { background: var(--pastel-surface); }
.cycle-glance-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.cycle-glance-track { display: block; height: 5px; border-radius: 99px; background: var(--track); overflow: hidden; }
.cycle-glance.is-soon .cycle-glance-track { background: var(--pastel-surface); }
.cycle-glance-track span { display: block; height: 100%; border-radius: 99px; background: var(--period-2); }

/* ---- Garde-robe ---- */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border-radius: 99px; border: 1px solid var(--line-2); padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.swatch-dot { width: 12px; height: 12px; border-radius: 99px; border: 1px solid var(--line-2); flex-shrink: 0; display: inline-block; }
.cloth-photo-btn { display: flex; align-items: center; gap: 14px; border: 1px dashed var(--line-2); background: var(--field); border-radius: var(--radius);
  padding: 10px; font-weight: 500; color: var(--accent); text-align: left; }
.cloth-preview { width: 72px; height: 72px; border-radius: 18px; background: var(--sand); color: var(--on-pastel-2); display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; }
.cloth-preview img { width: 100%; height: 100%; object-fit: cover; }
.cloth-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cloth-card { display: flex; flex-direction: column; border: none; border-radius: var(--radius); background: var(--card); padding: 0; overflow: hidden; text-align: left; color: var(--ink); }
.cloth-card img, .cloth-card-empty { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: flex; align-items: center; justify-content: center; background: var(--sand); color: var(--on-pastel-2); }
.cloth-card-body { display: flex; align-items: center; gap: 5px; padding: 8px 10px 10px; min-width: 0; }
.cloth-card-name { font-size: 12px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.pick-cloth { display: flex; flex-direction: column; gap: 3px; border: 2px solid transparent; border-radius: 16px; background: var(--field); padding: 4px; overflow: hidden; color: var(--ink); }
.pick-cloth img, .pick-cloth-icon { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--sand); color: var(--on-pastel-2); }
.pick-cloth-name { font-size: 11px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-cloth[aria-pressed="true"] { border-color: var(--ink); background: var(--accent-soft); }
.collage { width: 72px; height: 72px; border-radius: 20px; overflow: hidden; display: grid; gap: 2px; background: var(--sand); flex-shrink: 0; }
.collage.collage-lg { width: 96px; height: 96px; }
.collage.n2 { grid-template-columns: 1fr 1fr; }
.collage.n3, .collage.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage.n3 img:first-child { grid-row: span 2; }
.collage img { width: 100%; height: 100%; object-fit: cover; display: block; }
.collage-empty { display: flex; align-items: center; justify-content: center; color: var(--on-pastel-2); }
.suggest { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.outfit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.outfit-card { display: flex; flex-direction: column; gap: 8px; padding: 10px; border-radius: var(--radius-lg); background: var(--card); text-decoration: none; color: var(--ink); }
.outfit-card .collage { width: 100%; height: auto; aspect-ratio: 1; }
.outfit-card strong { font-size: 14px; font-weight: 500; }

/* ---- Routines ---- */
.routine-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; padding: 8px 0; }
.routine-week { display: flex; gap: 4px; }
.routine-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--track); }
.routine-dot.is-done { background: var(--accent); }
.routine-dot.is-off { background: transparent; border: 1px dashed var(--line-2); }
.routine-streak { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--hot-ink); white-space: nowrap; padding-right: 6px; }
.weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.weekday { padding: 0; min-height: 40px; justify-content: center; display: flex; align-items: center; }
.routine-wrap { display: flex; flex-direction: column; }
.card-list > .routine-wrap + *, .card-list > * + .routine-wrap { border-top: 1px solid var(--line-soft); }
.routine-more svg { transition: transform .15s; }
.routine-more[aria-expanded="true"] svg { transform: rotate(90deg); }
.routine-details { margin: 0; padding: 0 18px 12px 58px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); }
.routine-details li::marker { color: var(--accent); font-weight: 500; }
.routine-hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.product-main { display: flex; gap: 12px; align-items: flex-start; }
.product-thumb { width: 52px; height: 52px; border-radius: 18px; object-fit: cover; flex-shrink: 0; background: var(--clay); }
.product-thumb.is-empty { border: 1px dashed var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 20px; padding: 0; }

.product-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }

/* ---- Inventaire de la cuisine ---- */
.pantry-row { display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 10px; min-height: 56px; }
.pantry-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; min-height: 44px; justify-content: center; }
.pantry-status { flex-shrink: 0; min-height: 34px; padding: 0 14px; border-radius: 99px; border: none; font-size: 12px; font-weight: 500; color: var(--on-pastel); }
.pantry-status.is-ok { background: var(--sage); }
.pantry-status.is-bas { background: var(--clay); }
.pantry-status.is-vide { background: var(--danger-bg); color: var(--danger); }
.pantry-thumb { width: 42px; height: 42px; border-radius: 14px; background: var(--sage); }
.pantry-thumb.is-empty { border-color: var(--line-2); font-size: 17px; }
.mode-switch { flex: 1; }
.mode-switch button { min-height: 36px; font-size: 13px; }

/* ---- En-têtes d'écran ---- */
.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; min-height: 44px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.page-head-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.page-head-actions { display: flex; gap: 8px; flex-shrink: 0; padding-bottom: 2px; }

/* ---- Carte de rendez-vous (Agenda, modules) ---- */
.event-head { display: flex; align-items: center; gap: 14px; }
.event-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.event-card .appt-when strong { font-size: 20px; font-weight: 400; }
.event-card.is-late .appt-when { background: var(--clay); color: var(--on-pastel); }
.event-card.is-done .appt-when { background: var(--track); color: var(--muted); }
.event-card { padding: 12px 14px 14px 12px; }
.event-card > .event-place, .event-card > .event-budget, .event-card > .btn-row { padding-left: 2px; }
.event-card .tag { align-self: flex-start; margin-top: 4px; }
.btn-add { justify-content: flex-start; color: var(--muted); padding: 0 20px; min-height: 52px; }
.month-switch.is-pill { background: var(--card); border-radius: 99px; padding: 4px; }
.month-switch.is-pill .icon-btn { background: var(--field); color: var(--ink); }
.btn { white-space: nowrap; }
.btn-row[style*="wrap"] > .btn { flex: 1 1 auto; }
