/* Mise en page : une colonne mobile, fiches en cartes, feuilles qui montent du bas, bouton + flottant.
   Polices système uniquement : aucune dépendance externe, fonctionne hors connexion. */
:root {
  --bg: #f8f4f3; --card: #ffffff; --tx: #2a1d20; --mu: #6f5f63; --ac: #7b1e3a; --acx: #ffffff;
  --bd: #e6dadd; --bdi: #857579; --soft: #f1e8ea; --or: #d9a94f; --orf: #f7eccf; --ortx: #5c1428; --orbr: #f2d487; --ok: #2e7d4f; --wa: #a35f00; --bad: #a3282d;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --vvt: 0px; --vvh: 100%;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; overscroll-behavior-y: contain; }
body {
  margin: 0 auto; max-width: 680px; background: var(--bg); color: var(--tx);
  font: 16px/1.45 var(--font);
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ac); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-family: Georgia, 'Times New Roman', serif; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--mu); margin: 18px 0 8px; }
p { margin: 4px 0; }
.mu { color: var(--mu); } .small { font-size: 14px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 0 10px; position: sticky; top: 0; z-index: 12; background: var(--bg); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.icon { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--bd); background: var(--card); color: var(--tx); display: grid; place-items: center; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 10px 6px; text-align: center; min-width: 0; }
.stat b { display: block; font-size: 20px; color: var(--ac); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat b.txt { font-size: 15px; white-space: nowrap; }
.stat span { font-size: 12px; color: var(--mu); }

.banner { background: var(--card); border: 1px solid var(--bd); border-left: 4px solid var(--wa); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.err { border-left-color: var(--bad); }
.banner.info { border-left-color: var(--ac); }
.banner p { margin: 0; flex: 1 1 200px; font-size: 14px; }

.tabs { display: flex; gap: 8px; margin: 2px 0 12px; }
/* Les trois boutons du moteur de l’appli : plus hauts, plus gras, couleur or pour les distinguer des filtres. */
.tab {
  flex: 1; min-height: 54px; padding: 6px 4px; border-radius: 12px;
  border: 1.5px solid var(--or); background: var(--orf); color: var(--ortx);
  font-size: 14px; font-weight: 700; letter-spacing: .01em; line-height: 1.15;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; position: relative;
  box-shadow: 0 3px 0 var(--or); transition: transform .08s ease, box-shadow .08s ease;
}
.tab:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--or); }
.tab.on { background: var(--ac); color: var(--orbr); border-color: var(--ac); box-shadow: inset 0 -4px 0 var(--or); }

.tools { display: flex; gap: 8px; }
.tools input { flex: 1; min-width: 0; }
.tools select { flex: 0 0 auto; width: auto; max-width: 40%; }
input, select, textarea { width: 100%; min-height: 44px; padding: 10px 11px; border: 1px solid var(--bdi); border-radius: 10px; background: var(--card); }
textarea { resize: vertical; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 10px 0; padding-bottom: 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 6px 14px; border-radius: 99px; border: 1px solid var(--bd); background: var(--card); font-size: 14px; }
.chip.on { background: var(--ac); color: var(--acx); border-color: var(--ac); }
.chip .n { opacity: .75; font-variant-numeric: tabular-nums; }

.w { background: var(--card); border: 1px solid var(--bd); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.w.out { background: var(--soft); }
.w.out h4 { color: var(--mu); font-weight: 600; }
.w.out .pc { background: var(--card); }
.w.hl { outline: 2px solid var(--ac); }
.w h4 { margin: 0; font-size: 17px; font-weight: 700; color: var(--tx); overflow-wrap: anywhere; }
.w p { margin: 2px 0; color: var(--mu); font-size: 14px; overflow-wrap: anywhere; }
.w .why { color: var(--tx); }
.row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.row > div:first-child { min-width: 0; }
.q { display: flex; align-items: center; gap: 6px; flex: none; }
.q button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--ac); background: none; color: var(--ac); font-size: 20px; line-height: 1; }
.q b { min-width: 26px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.tag { font-size: 12px; font-weight: 600; white-space: nowrap; }
.ok { color: var(--ok); } .wa { color: var(--wa); } .bad { color: var(--bad); }
.acts { display: flex; flex-wrap: wrap; gap: 0 16px; }
.lnk { background: none; border: 0; color: var(--ac); font-size: 14px; padding: 8px 0; min-height: 36px; }
details { margin-top: 4px; font-size: 14px; }
summary { color: var(--ac); cursor: pointer; padding: 4px 0; }
.pc { display: inline-block; background: var(--soft); border-radius: 99px; padding: 2px 9px; margin: 2px 3px 2px 0; font-size: 13px; color: var(--tx); }
.more { display: block; width: 100%; margin: 6px 0 16px; }
.empty { text-align: center; color: var(--mu); margin: 28px 0; }
.empty .stack { max-width: 340px; margin: 14px auto 0; }
.lbl { display: block; font-size: 13px; color: var(--mu); margin: 4px 0 4px; }

#fab { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 60px; height: 60px; border-radius: 50%; border: 0; background: var(--ac); color: var(--acx); box-shadow: 0 6px 16px rgb(0 0 0 / .28); display: grid; place-items: center; z-index: 5; }

.btn { display: block; width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 10px; background: var(--ac); color: var(--acx); font-weight: 600; text-align: center; }
.btn.o { background: none; color: var(--ac); border: 1px solid var(--ac); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { width: auto; min-height: 44px; padding: 8px 14px; flex: none; }
.btn:disabled { opacity: .55; cursor: default; }
.stack { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.row2 input { flex: 1; min-width: 0; }
.close { margin-top: 10px; }

.modal { position: fixed; left: 0; right: 0; top: var(--vvt); height: var(--vvh); background: rgb(0 0 0 / .5); display: none; align-items: flex-end; justify-content: center; z-index: 20; }
.modal.show { display: flex; }
#sDlg { z-index: 30; }
.sheet { background: var(--bg); width: 100%; max-width: 680px; max-height: 94%; overflow: auto; border-radius: 18px 18px 0 0;
  padding: 18px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); overscroll-behavior: contain; }
.sheet { position: relative; }
.sheet::before { content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--mu); opacity: .4; pointer-events: none; z-index: 1; }
.sheet > h2:first-child, .sb > h2:first-child { padding-right: 40px; }
.sx { position: absolute; top: 6px; right: 6px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--mu); font-size: 30px; line-height: 40px; text-align: center; cursor: pointer; z-index: 2; -webkit-tap-highlight-color: transparent; }
.sx:active { background: var(--line, rgb(127 127 127 / .15)); }
.sheet label { display: block; font-size: 13px; color: var(--mu); margin: 12px 0 4px; }
.sheet.fx { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.sb { overflow: auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 18px max(16px, env(safe-area-inset-left, 0px)); flex: 1; min-height: 0; overscroll-behavior: contain; }
.sb .btn.o { margin-top: 12px; }
.ft { display: flex; gap: 10px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); border-top: 1px solid var(--bd); background: var(--bg); }
.ft .btn { flex: 1; } .ft .btn:last-child { flex: 2; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.g2 > div { min-width: 0; }

.lr { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--bd); font-size: 14px; align-items: flex-start; }
.lr b { display: block; overflow-wrap: anywhere; }
.lr small { color: var(--mu); display: block; }
.sp { width: 16px; height: 16px; border: 2px solid var(--bd); border-top-color: var(--ac); border-radius: 50%; animation: spn .8s linear infinite; flex: none; margin-top: 2px; }
@keyframes spn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sp { animation: none; border-top-color: var(--ac); } }

#toasts { position: fixed; z-index: 40; left: 0; right: 0; top: calc(8px + env(safe-area-inset-top, 0px) + var(--upd-h, 0px)); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none;
  padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
.toast { pointer-events: auto; width: 100%; max-width: 640px; background: var(--ac); color: var(--acx); border-radius: 12px; padding: 10px 8px 10px 14px; font-size: 14px; display: flex; gap: 8px; align-items: center; box-shadow: 0 6px 16px rgb(0 0 0 / .25); }
.toast.err { background: var(--bad); color: #fff; }
.toast span { flex: 1; overflow-wrap: anywhere; }
.toast button { background: none; border: 0; color: inherit; min-height: 44px; min-width: 44px; padding: 4px 8px; font-weight: 700; }
.toast .tact { text-decoration: underline; }

.steps { padding-left: 20px; margin: 6px 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.code { background: var(--soft); border: 1px solid var(--bd); border-radius: 10px; overflow: hidden; }
.code pre { margin: 0; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); max-height: 260px; overflow: auto; }
.code .cp { border-radius: 0; }
.noscript { padding: 20px; }
.guide { border: 1px solid var(--bd); border-radius: 12px; padding: 12px; margin: 10px 0; background: var(--card); }
.guide p { margin: 0 0 4px; }

/* Titre modifiable, citation du jour, crédit */
.ttl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ttl h1 { overflow-wrap: anywhere; cursor: pointer; }
.pen { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--ac); background: var(--soft); color: var(--ac); display: grid; place-items: center; }
.credit { text-align: center; color: var(--mu); font-size: 13px; margin: 30px 0 6px; }

.src { font-size: 13px; color: var(--mu, inherit); overflow-wrap: anywhere; }
.src a { color: var(--ac); }

.credit .lnk { margin-top: 6px; min-height: 44px; }

/* Bandeau de mise à jour : plein écran, collé en haut */
#updBar { margin: 0 -16px; }
#updBar:empty { display: none; }
#updBar .upd { display: flex; align-items: center; gap: 10px; background: var(--ac); color: var(--acx); padding: 10px 16px; }
#updBar .ic { font-size: 26px; line-height: 1; }
#updBar .tx { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
#updBar .tx b { font-size: 16px; }
#updBar .tx span { font-size: 13px; opacity: .9; }
#updBar .btn { width: auto; flex: 0 0 auto; background: var(--acx); color: var(--ac); border: 0; font-weight: 700; padding: 10px 14px; min-height: 44px; white-space: nowrap; animation: updpulse 1.6s ease-in-out infinite; }
@keyframes updpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .55); } 50% { box-shadow: 0 0 0 9px rgba(255, 255, 255, 0); } }
@media (prefers-reduced-motion: reduce) { #updBar .btn { animation: none; } }
@media (max-width: 360px) { #updBar .tx span { display: none; } }

.chk { display: flex; align-items: center; gap: 10px; font-size: 16px; color: var(--tx); }
.chk input { width: 22px; height: 22px; flex: 0 0 auto; }
#dlgX { white-space: pre-line; }

/* Ma cave en chiffres */
.chiffres { padding-bottom: 24px; }
.chiffres .portrait { font-size: 17px; font-weight: 600; margin: 4px 0 8px; }
.chiffres .ch { font-size: 15px; margin: 18px 0 6px; }
.chiffres .bar { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr) 36px; gap: 8px; align-items: center; font-size: 14px; margin: 4px 0; }
.chiffres .bar > span { min-width: 0; }
.chiffres .bar i { display: block; height: 10px; border-radius: 5px; background: var(--ac); }
.chiffres .bar b { text-align: right; font-variant-numeric: tabular-nums; }
.chiffres .frise { display: flex; align-items: flex-end; gap: 2px; height: 120px; border-bottom: 1px solid var(--bd); }
.chiffres .fcol { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-width: 0; }
.chiffres .fcol i { display: block; background: var(--ac); border-radius: 2px 2px 0 0; min-height: 2px; }
.chiffres .fcol span { font-size: 12px; line-height: 1; height: 36px; writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; text-align: center; }

.quote { position: relative; margin: 2px 0 14px; padding: 20px 20px 18px 22px; border-radius: 16px; background: var(--ac); color: var(--acx); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); overflow: hidden; }
.quote .qm { position: absolute; top: -14px; left: 10px; font: 700 96px/1 Georgia, "Times New Roman", serif; opacity: .22; pointer-events: none; }
.quote p { position: relative; margin: 0; font: italic 19px/1.45 Georgia, "Times New Roman", serif; text-wrap: pretty; }

/* Magic : anneaux, statuts, légende */
.chiffres .statuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.chiffres .st { border-radius: 12px; padding: 10px 6px; text-align: center; border: 1px solid var(--bd); background: var(--card); }
.chiffres .st b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.chiffres .st span { font-size: 12px; color: var(--mu); }
.chiffres .st.ok b { color: var(--ok); }
.chiffres .st.wa b { color: var(--wa); }
.chiffres .st.bad b { color: var(--bad); }
.stats .vis { font: inherit; color: inherit; width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bilan { margin: 14px 0 6px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--bd); background: var(--card); }
.bilan p { margin: 0 0 6px; }
.bilan .lnk { font-size: 13px; padding: 4px 0; }
.chiffres button.st { font: inherit; color: inherit; cursor: pointer; width: 100%; -webkit-tap-highlight-color: transparent; }
.chiffres button.st:active { transform: scale(.97); }
.chiffres .donut { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.chiffres .donut svg { width: 150px; height: 150px; flex: none; }
.chiffres .dc { font-size: 7px; font-weight: 700; text-anchor: middle; fill: var(--tx); }
.chiffres .dl { font-size: 3px; text-anchor: middle; fill: var(--mu); }
.chiffres .legende { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; font-size: 14px; }
.chiffres .legende li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.chiffres .legende .lk { flex: 1; }
.chiffres .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }

/* Écran d'accueil (première visite) */
#landing:not([hidden]) { position: fixed; inset: 0; z-index: 60; background: var(--bg); overflow-y: auto; padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
#landing .ld { max-width: 520px; margin: 0 auto; }
#landing h1 { margin: 8px 0 4px; font-size: 30px; }
#landing .tuto { margin-top: 14px; }
#landing .steps { margin-top: 12px; }
#landing .stack { margin: 12px 0; }
/* Onboarding : installation, options repliées, tutoriel animé */
#installBox:not([hidden]) { margin-bottom: 12px; }
#installBox .inst { background: var(--card); border: 1px solid var(--bd); border-left: 4px solid var(--ac); border-radius: 12px; padding: 12px; }
#installBox .inst b { display: block; margin-bottom: 4px; }
#installBox .inst .stack { margin-top: 8px; }
details.adv { border: 1px solid var(--bd); border-radius: 10px; padding: 8px 10px; margin: 8px 0; background: var(--card); }
details.adv summary { min-height: 36px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
details.adv[open] summary { margin-bottom: 6px; }
.notes { padding-left: 18px; margin: 6px 0; }
.notes li { margin: 3px 0; }
.tuto { background: var(--soft); border-radius: 14px; padding: 14px; margin: 10px 0; }
.tuto .tb { background: var(--card); border-radius: 10px; padding: 8px; text-align: center; font-size: 14px; }
.tuto .tbar i { font-style: normal; font-weight: 600; }
.tuto .tmenu { margin-top: 10px; background: var(--card); border-radius: 10px; overflow: hidden; }
.tuto .ti { padding: 10px 12px; font-size: 15px; border-bottom: 1px solid var(--bd); animation: tHl 6s infinite; }
.tuto .ti.t2 { animation-delay: 2s; }
.tuto .ti.t3 { animation-delay: 4s; }
@keyframes tHl {
  0%, 25% { background: #f3c9d3; box-shadow: inset 4px 0 0 var(--ac); }
  33%, 100% { background: transparent; box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) { .tuto .ti { animation: none; } }

/* Journal de dégustation */
.jr { margin-top: 10px; padding-top: 8px; border-top: 1px solid #eadfe2; }
.jr ul { list-style: none; padding: 0; margin: 4px 0; }
.jr li { margin: 6px 0; }
.etoiles { color: #7b1e3a; letter-spacing: 1px; }
.stars { display: flex; gap: 4px; margin: 6px 0 12px; }
.stars button { font-size: 34px; line-height: 1; padding: 4px 6px; background: none; border: 0; color: #b5545f; cursor: pointer; min-width: 44px; min-height: 44px; }
.stars button[aria-checked="true"] { color: #7b1e3a; }
.stars button:focus-visible { outline: 2px solid #7b1e3a; outline-offset: 2px; }

/* Identité visuelle 1.25.2 : icônes au trait, recherche, signature, esprit de Ma cave */
.tab .ti { flex: none; }
.tab .chev { display: none; position: absolute; right: 6px; top: 50%; margin-top: -8px; opacity: .55; }
@media (min-width: 560px) { .tab { flex-direction: row; gap: 8px; padding-right: 22px; } .tab .chev { display: block; } }
.tools input#q { padding-left: 38px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f5f63' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6'/%3E%3Cpath d='M15 15l5 5'/%3E%3C/svg%3E") no-repeat 11px 50% / 18px 18px; }
.slogan { display: block; font-size: 12px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ac); margin: 2px 0 10px; }
.credit .slogan { margin: 0 0 8px; font-size: 12px; }
.wm { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; }
.cv { border-top: 1px solid var(--bd); padding: 12px 0 6px; }
.cv p { margin: 0 0 4px; font-size: 15px; }
.kick { font-size: 12px !important; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--or-dark, #8a6a1f); }
.cv .cvt { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ac); margin: 2px 0 6px; }

/* Cartes : statut principal en pastille, informations de fiche au second niveau */
.w .stl { margin: 6px 0 2px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag.stp { padding: 3px 10px; border-radius: 99px; border: 1px solid currentColor; font-weight: 700; }
.w .sec { margin-top: 2px; }
.acts .main { font-weight: 700; }
.acts .quiet { color: var(--mu); }
.chip.sec { background: none; border-style: dashed; color: var(--mu); }
.chip.sec.on { background: var(--ac); color: var(--acx); border-style: solid; }
/* Ajouter des vins : actions de gestion en liste discrète */
#sMenu h3.first { margin-top: 6px; }
.stack.lst { gap: 0; border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; background: var(--card); }
.stack.lst .btn.o { border: 0; border-radius: 0; border-bottom: 1px solid var(--bd); text-align: left; font-weight: 500; color: var(--tx); background: none; min-height: 48px; }
.stack.lst .btn.o:last-child { border-bottom: 0; }
/* Réglages : rubriques */
.rub { border-top: 1px solid var(--bd); margin-top: 10px; padding-top: 2px; }
.rub.apropos { border-top: 0; margin-top: 0; }
.rub h3 { color: var(--ac); }
.aboutcard { background: var(--card); border: 1px solid var(--bd); border-left: 4px solid var(--or); border-radius: 12px; padding: 12px 14px; }
.aboutcard .wm { margin: 0; }
.aboutcard .stack { margin-top: 8px; }
.esnote { margin-top: 14px !important; }
/* Magic : Équilibre de ma cave, présentation éditoriale (le contenu n’est pas touché) */
.bilan { border-top: 3px solid var(--ac); padding: 14px 16px; }
.bilan .bt { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ac); margin: 0 0 4px; }
.bilan .bsub { color: var(--mu); font-size: 14px; margin-bottom: 8px; }
.bilan #avisIA { font-size: 15px; line-height: 1.6; margin-bottom: 10px; }
.bilan #avisIA .mu.small { display: block; margin-top: 8px; }
.bilan > p:not(.bt):not(.bsub) { padding-top: 8px; border-top: 1px solid var(--bd); }
.avis-complet { margin-top: 10px; }
.avis-complet summary { display: inline-block; min-height: 44px; line-height: 44px; padding: 0 16px; border: 1px solid var(--ac); border-radius: 99px; color: var(--ac); font-weight: 600; cursor: pointer; }
.avis-complet[open] summary { background: var(--soft); }
.avis-complet p { white-space: pre-line; line-height: 1.65; margin: 10px 0 0; }
.guide a { color: var(--ac); }
.rub h4.sub { margin: 14px 0 4px; font-size: 15px; font-weight: 600; color: var(--tx); }

/* Cartes sobres : l’essentiel d’un coup d’œil, le reste dans « Fiche et accords » */
.w .ml { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin: 4px 0 0; }
.w .ml .mm { margin: 0; flex: 1 1 auto; min-width: 0; }
.w .ml .stl { margin: 0 0 0 auto; flex: none; justify-content: flex-end; }
.w .acts { justify-content: flex-end; align-items: center; margin-top: 2px; }
.w .acts .lnk { font-size: 14px; font-weight: 500; color: var(--mu); }
.w .acts .gen { margin-right: auto; color: var(--ac); }
.w details { margin-top: 6px; }
.w details > summary { font-weight: 600; color: var(--ac); min-height: 40px; display: flex; align-items: center; cursor: pointer; }
/* Repère de dépliage : chevron vers la droite (fermée), vers le bas (dépliée). */
.w details > summary { list-style: none; gap: 8px; }
.w details > summary::-webkit-details-marker { display: none; }
.w details > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-top: -2px; border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.w details[open] > summary::after { transform: rotate(45deg) translate(-2px, -2px); }

/* Menu Actions : un seul bouton par carte, sur la ligne de « Fiche et accords » */
.w .fr { position: relative; margin-top: 6px; min-height: 44px; }
.w .fr details { margin-top: 0; }
.w .am { position: absolute; right: 0; top: 0; min-height: 44px; padding: 0 14px; border: 1px solid var(--bd); border-radius: 99px; background: var(--card); color: var(--mu); font-size: 14px; font-weight: 600; }
.w .am:active { background: var(--soft); }
#acN { margin-bottom: 4px; }
#acSep { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--bd); }

/* Équilibre de ma cave : avis structuré (message clé, repères, trois blocs, analyse détaillée) */
.bilan #avisIA { font-size: 16px; }
.avis-lead { font-size: 17px; font-weight: 600; line-height: 1.5; color: var(--tx); margin: 0 0 10px; }
.cles { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.cles li { background: var(--orf); color: var(--ortx); border: 1px solid var(--orbr); border-radius: 99px; padding: 4px 12px; font-size: 13px; font-weight: 600; }
.ab { border-left: 4px solid var(--bd); background: var(--card); border-radius: 0 10px 10px 0; padding: 8px 12px; margin: 0 0 10px; }
.ab h4 { margin: 0 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ab ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.5; }
.ab-ok { border-left-color: var(--ok); } .ab-ok h4 { color: var(--ok); }
.ab-wa { border-left-color: var(--wa); } .ab-wa h4 { color: var(--wa); }
.ab-pr { border-left-color: var(--ac); background: var(--soft); } .ab-pr h4 { color: var(--ac); }
.avis-complet p { font-size: 15px; }

/* Cave vide et cave de démonstration (1.26.0) */
.stats[hidden] { display: none; }
.empty.vide { text-align: left; padding: 8px 4px; }
.empty.vide .vt { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; margin: 4px 0 8px; color: var(--wine, #6b1d2a); }
.empty.vide .ou { text-align: center; margin: 14px 0 2px; }
.demobar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; border: 1px dashed #c9a24a; border-radius: 12px; background: rgba(201, 162, 74, .12); font-size: 14px; }
.demobar .btn { width: auto; min-height: 40px; padding: 6px 14px; }

/* Transitions douces (changement d'onglet, ouverture des fenêtres, boutons) ; coupées si l'appareil demande moins d'animations. */
@keyframes vueIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fondIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes monte { from { transform: translateY(32px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.vin { animation: vueIn .28s cubic-bezier(.2, .8, .2, 1); }
.modal.show { animation: fondIn .2s ease-out; }
.modal.show > .sheet { animation: monte .28s cubic-bezier(.2, .8, .2, 1); }
.toast { animation: toastIn .22s ease-out; }
.tab, .chip { transition: background-color .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .08s ease; }
@media (prefers-reduced-motion: reduce) { .vin, .modal.show, .modal.show > .sheet, .toast { animation: none; } .tab, .chip { transition: none; } }

/* Fenêtre à réponse obligatoire : pas de croix */
.modal.force .sx{display:none}

/* Maturité (1.34.0) : frise de la fiche, fiabilité, pastille et liseré de la liste. Blocs unis, couleurs naturelles. */
:root { --mf-piste: #ece3e4; --ph-garde: #c9bbbe; --ph-jeune: #8e9c96; --ph-apogee: #d2aa5c; --ph-declin: #8e4a56; }
.mat2 { margin: 10px 0 2px; }
.mat2 svg { width: 100%; height: auto; display: block; overflow: visible; }
.mat2 .mf-piste { fill: var(--mf-piste); }
.mat2 .mf-j { fill: #8e9c96; } .mat2 .mf-a { fill: #e3c58c; } .mat2 .mf-d { fill: #8e4a56; }
.mat2 .mf-now { fill: #fff; stroke: var(--tx); stroke-width: 2.5; }
.mat2 .mf-tick { stroke: #b3a7ab; stroke-width: 1; }
.mat2 .d { font-size: 12.5px; fill: var(--mu); font-variant-numeric: tabular-nums; }
.mat2 .dk { fill: var(--tx); font-weight: 600; }
.mat2 .au { font-size: 11.5px; fill: var(--mu); }
.fiab { margin: 4px 0 6px; font-size: 13px; color: var(--mu); }
.fiab b { color: var(--tx); font-weight: 600; }
.fiab .rs { color: var(--wa); }
.fiab .pts i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bd); margin-right: 2px; }
.fiab .pts i.on { background: var(--ac); }
.tag.stp.pill { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 0; color: var(--tx); font-size: 13.5px; font-weight: 600; white-space: normal; }
.tag.stp.pill i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--ph); box-shadow: 0 0 0 1.5px rgba(42, 29, 32, .4); }
.tag.stp.pill s { text-decoration: none; font-weight: 400; color: var(--mu); }
.tag.stp.ph-garde i { --ph: var(--ph-garde); } .tag.stp.ph-jeune i { --ph: var(--ph-jeune); }
.tag.stp.ph-apogee i { --ph: var(--ph-apogee); } .tag.stp.ph-declin i { --ph: var(--ph-declin); }
/* Liseré de la carte (liste) : disparaît quand la fiche est dépliée pour garder une fiche sobre. */
.w.ph-garde { box-shadow: inset 5px 0 0 var(--ph-garde); } .w.ph-jeune { box-shadow: inset 5px 0 0 var(--ph-jeune); }
.w.ph-apogee { box-shadow: inset 5px 0 0 var(--ph-apogee); } .w.ph-declin { box-shadow: inset 5px 0 0 var(--ph-declin); }
.w[class*="ph-"]:has(details[open]) { box-shadow: none; }

/* Activation de la clé gratuite : encarts discrets, jamais bloquants */
.enc { position: relative; background: var(--card); border: 1px solid var(--bd); border-left: 4px solid var(--or); border-radius: 12px; padding: 10px 12px 8px; margin: 10px 0; }
.enc.cx { padding-right: 44px; }
.enc:focus, .sheet [tabindex="-1"]:focus { outline: none; }
.enc b { display: block; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; margin-bottom: 2px; }
.enc p { margin: 0 0 6px; font-size: 14px; }
.enc .stack { margin-top: 6px; }
.enc .x { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--mu); }
.enc.mini { background: transparent; border-color: transparent; border-left: 3px solid var(--or); border-radius: 4px; padding: 2px 12px; }
.enc.mini p { margin: 0; }
.enc.mini .lnk { display: block; min-height: 44px; padding: 0; font-weight: 600; text-align: left; }
.cle-etape { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ac); margin: 2px 0 8px; }
.res { border: 1px solid var(--bd); border-left: 4px solid var(--ok); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: var(--card); font-size: 15px; }
.res.ko { border-left-color: var(--bad); } .res.att { border-left-color: var(--wa); }
.photo { margin: 8px 0; text-align: center; } .photo img { display: block; max-width: 100%; max-height: 170px; border-radius: 8px; margin: 0 auto 4px; }

/* Fiche dépliée : blocs titrés (Repères, L'histoire, Accords, Journal) */
.w .bl, .w .jr { border-top: 1px solid var(--bd, #eadfe2); margin-top: 12px; padding-top: 10px; }
.w .bl > h5, .w .jr > p:first-child b { display: block; margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ac); }
.w .kv { display: grid; grid-template-columns: 74px 1fr; gap: 6px 10px; margin: 0; }
.w .kv dt { color: var(--mu); font-size: 15px; }
.w .kv dd { margin: 0; font-size: 15px; color: var(--tx); overflow-wrap: anywhere; }
.w .kv small { display: block; margin-top: 1px; font-size: 13px; color: var(--mu); }
.w .kv .mu { font-size: 14px; }
.w p.hist { margin: 8px 0 0; font-size: 15.5px; line-height: 1.6; color: var(--tx); }
.w p.hist.lead { margin-top: 0; font-weight: 600; }

#sMenu [data-m].indispo { opacity: .5; }

/* 1.40.0 : mention « À relire » sous l'histoire (formulaire et fiche), discrète mais visible */
.rlr { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 0 0; font-size: 13px; color: var(--ac); }
.rlr > span { border-left: 3px solid var(--or); padding-left: 8px; }
.rlr .lnk { font-size: 13px; padding: 4px 0; min-height: 32px; }
#f-web { margin-top: 8px; }
#f-web-n { margin-top: 6px; }

/* ===== 1.44.0 : accueil (filtres), effervescents, Réglages en liste, partage ===== */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.filtres select { flex: 1 1 140px; min-width: 0; width: auto; }
.tools { display: block; }
.tools input#q { width: 100%; }
.tag.nb { color: var(--ac); border: 1px solid var(--ac); border-radius: 99px; padding: 1px 8px; }
#sSet .sheet:not([data-view="flat"]) [data-pane] { display: none; }
#sSet .sheet[data-view="ia"] [data-pane="ia"], #sSet .sheet[data-view="auto"] [data-pane="auto"], #sSet .sheet[data-view="data"] [data-pane="data"],
#sSet .sheet[data-view="stats"] [data-pane="stats"], #sSet .sheet[data-view="app"] [data-pane="app"], #sSet .sheet[data-view="partage"] [data-pane="partage"] { display: block; }
#sSet .sheet:not([data-view="home"]):not([data-view="flat"]) [data-home] { display: none; }
#sSet .sheet[data-view="flat"] #set-list { display: none; }
.lnk.back { padding: 4px 0 10px; font-weight: 600; }
.qrbig { width: min(100%, 360px); aspect-ratio: 1; margin: 8px auto; background: #fff; border-radius: 12px; border: 1px solid var(--bd); overflow: hidden; }
.setlist { border: 1px solid var(--bd); border-radius: 14px; background: var(--card); overflow: hidden; }
.setrow { display: block; position: relative; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--bd); padding: 13px 34px 13px 14px; color: var(--tx); font: inherit; min-height: 56px; }
.setrow:first-child { border-top: 0; }
.setrow::after { content: '›'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--mu); font-size: 24px; }
.setrow .rt { display: block; font-weight: 600; }
.setrow .rs { display: block; color: var(--mu); font-size: 13px; margin-top: 2px; }

.qrbig svg { display: block; width: 100%; height: 100%; }
