/* Paris Pollens — style « Liquid Glass » chaud */
:root {
  --ground: #F7EFE3;
  --map-ground: #F3EADB;
  --surface: #FFFFFF;
  --ink: #241B13;
  --muted: #5C4E40;
  --muted-2: #6B5D50;
  --rule: #F2E9DC;
  --chip: #F2E8D9;
  --tint: rgba(60, 40, 20, 0.07);

  --accent: #A6DB3C;          /* aplat vert anis */
  --accent-ink: #1F3A00;      /* texte sur l'aplat */
  --accent-soft: #E4F6BF;
  --accent-text: #3F7A00;     /* vert lisible sur clair */
  --accent-strong: #335F00;
  --switch-on: #8CCB24;
  --switch-off: #DCCFBD;
  --locate: #0A84FF;
  --danger: #C41C29;

  --fort: #F25A00; --fort-soft: #FFDCC2; --fort-ink: #992E00;
  --mod: #F0AE00;  --mod-soft: #FFF0B8;  --mod-ink: #6E4A00;

  --lv1: #00A88C; --lv1-soft: #CDF4EC; --lv1-ink: #0F5546;
  --lv2: #55AD12; --lv2-soft: #E0F5C9; --lv2-ink: #33520E;
  --lv3: #F0AE00; --lv3-soft: #FFF0B8; --lv3-ink: #6E4A00;
  --lv4: #F25A00; --lv4-soft: #FFDCC2; --lv4-ink: #992E00;
  --lv5: #E8221B; --lv5-soft: #FFD9D3; --lv5-ink: #A3140E;
  --lv6: #B0128F; --lv6-soft: #FADAF1; --lv6-ink: #6E0B57;

  --glass-bg: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 8px 24px rgba(60, 40, 20, 0.08);
  --glass-blur: blur(20px) saturate(1.8);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: calc(54px + max(var(--safe-top), 4px));
  --tabbar-space: calc(98px + var(--safe-bottom));
  --radius: 20px;
  --font: "Manrope", Inter, -apple-system, system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent-text); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- Barre du haut ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 1200;
  height: var(--header-h);
  padding: max(var(--safe-top), 4px) 16px 0;
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(253, 248, 240, 0.62);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 6px 20px rgba(60, 40, 20, 0.06);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); display: grid; place-items: center; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.round-btn {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center;
  background: rgba(60, 40, 20, 0.07); color: var(--ink); position: relative;
}
.round-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.round-btn.has-query::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-text); border: 2px solid #FDF8F0; }
.avatar {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; border: none;
  background: var(--accent-soft); color: var(--accent-strong);
  display: grid; place-items: center; font-size: 14px; font-weight: 700;
}

/* ---------- Vues ---------- */
.view { position: fixed; inset: 0; display: none; }
.view.active { display: block; }
.scroll {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--header-h) + 16px) 16px calc(var(--tabbar-space) + 16px);
}
.column { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.page-title { padding: 0 4px; }
.page-title h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.page-title p { margin-top: 2px; font-size: 14px; color: var(--muted); }
.section { display: flex; flex-direction: column; gap: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px; }
.section-head h2 { font-size: 20px; font-weight: 600; }
.section-head span { font-size: 14px; color: var(--muted); }
.card { background: var(--surface); border-radius: var(--radius); }
.card-pad { padding: 16px; }
.list { padding: 0 16px; }
.note { padding: 0 4px; font-size: 13px; line-height: 1.5; color: var(--muted-2); }
.pill { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.pill-mine { background: var(--accent-soft); color: var(--accent-strong); }
.pill-demo { background: var(--chip); color: var(--muted); }

/* Niveaux (échelle Atmo / Airparif 1 à 6) */
.lv0 { background: var(--chip); color: var(--muted); }
.lv1 { background: var(--lv1-soft); color: var(--lv1-ink); } .ink1 { color: var(--lv1-ink); } .mk1 { background: var(--lv1); }
.lv2 { background: var(--lv2-soft); color: var(--lv2-ink); } .ink2 { color: var(--lv2-ink); } .mk2 { background: var(--lv2); }
.lv3 { background: var(--lv3-soft); color: var(--lv3-ink); } .ink3 { color: var(--lv3-ink); } .mk3 { background: var(--lv3); }
.lv4 { background: var(--lv4-soft); color: var(--lv4-ink); } .ink4 { color: var(--lv4-ink); } .mk4 { background: var(--lv4); }
.lv5 { background: var(--lv5-soft); color: var(--lv5-ink); } .ink5 { color: var(--lv5-ink); } .mk5 { background: var(--lv5); }
.lv6 { background: var(--lv6-soft); color: var(--lv6-ink); } .ink6 { color: var(--lv6-ink); } .mk6 { background: var(--lv6); }
.ink0 { color: var(--muted); }
.mk0 { background: rgba(60, 40, 20, 0.1); }
.mk-fort { background: var(--fort); } .mk-mod { background: var(--mod); }

.scale { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
.scale span { height: 10px; border-radius: 5px; }
.scale-mini { display: grid; grid-template-columns: repeat(6, 18px); gap: 3px; }
.scale-mini span { height: 6px; border-radius: 3px; }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 3px; }
.months .m { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.months i { display: block; width: 100%; height: 8px; border-radius: 4px; }
.months small { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 500; line-height: 1; color: var(--muted-2); }
.months .on small { font-weight: 700; }
.months .on.fort small { color: var(--fort-ink); }
.months .on.mod small { color: var(--mod-ink); }
.months .now small { background: var(--tint); color: var(--ink); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- Carte ---------- */
#map { position: absolute; inset: 0; background: var(--map-ground); }
.leaflet-container { font-family: var(--font); background: var(--map-ground); }
.osm-tiles { filter: sepia(0.22) saturate(0.85) brightness(1.03); }
.leaflet-control-attribution { font-size: 11px; background: rgba(255, 255, 255, 0.7) !important; }
.leaflet-bottom.leaflet-right { bottom: calc(var(--tabbar-space) - 20px); }

.map-ui { position: absolute; left: 0; right: 0; top: calc(var(--header-h) + 10px); z-index: 900; padding: 0 16px; pointer-events: none; }
.map-ui > * { pointer-events: auto; }
.map-ui-inner { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }

.search { position: relative; display: none; }
.search.open { display: block; }
.search label {
  height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: 24px;
}
.search input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear { border: none; background: none; padding: 6px; display: none; color: var(--muted); }
.search.has-value .search-clear { display: block; }
.search-results {
  position: absolute; top: 56px; left: 0; right: 0; border-radius: 20px; padding: 6px; display: none;
  background: rgba(255, 255, 255, 0.82);
  max-height: 50vh; overflow-y: auto;
}
.search-results.open { display: block; }
.search-results button {
  width: 100%; text-align: left; border: none; background: transparent; border-radius: 14px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.search-results button:hover, .search-results button:focus-visible { background: var(--tint); }
.search-results b { font-weight: 600; font-size: 15px; }
.search-results small { font-size: 13px; color: var(--muted); }

.airparif-card {
  height: 44px; padding: 0 12px 0 16px; border-radius: 22px; color: var(--ink);
  display: flex; align-items: center; gap: 10px; white-space: nowrap;
}
.airparif-card .k { font-size: 14px; color: var(--muted); }
.airparif-card .v { font-size: 16px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.airparif-card .scale-mini { grid-template-columns: repeat(6, 10px); gap: 2px; }
.airparif-card .scale-mini span { height: 8px; border-radius: 4px; }
.airparif-card .pill-demo { font-size: 11px; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 34px; padding: 0 13px; border-radius: 17px; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px;
}
.chip[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; border-color: transparent; font-weight: 600; box-shadow: none; }

.map-controls {
  position: absolute; right: 16px; z-index: 900; width: 46px; border-radius: 23px;
  top: calc(var(--header-h) + (100% - var(--header-h) - 80px - var(--safe-bottom)) / 2); transform: translateY(-50%); display: flex; flex-direction: column;
}
.map-controls button { width: 100%; height: 44px; padding: 0; margin: 0; border: none; background: transparent; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.map-controls svg, .round-btn svg, .avatar svg { display: block; flex: none; }
.map-controls button[aria-pressed="true"], .map-controls button[aria-expanded="true"] { color: var(--accent-text); }
.map-controls button { position: relative; }
.map-controls .badge { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--fort); display: none; }
.map-controls .filtered .badge { display: block; }
.filter-menu {
  position: absolute; z-index: 960; right: 72px; top: calc(var(--header-h) + (100% - var(--header-h) - 80px - var(--safe-bottom)) / 2); transform: translateY(-50%);
  width: min(260px, calc(100vw - 104px)); border-radius: 20px; padding: 6px;
  background: rgba(255, 255, 255, 0.86);
}
.filter-menu[hidden] { display: none; }
.filter-menu p { font-size: 13px; font-weight: 600; color: var(--muted); padding: 8px 12px 4px; }
.filter-menu button {
  width: 100%; min-height: 46px; border: none; background: transparent; border-radius: 14px; padding: 8px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left;
}
.filter-menu button:hover, .filter-menu button:focus-visible { background: var(--tint); }
.filter-menu button span { display: flex; flex-direction: column; gap: 1px; }
.filter-menu button b { font-weight: 600; font-size: 15px; }
.filter-menu button small { font-size: 12px; color: var(--muted); }
.filter-menu button[aria-checked="true"] b { color: var(--accent-strong); }
.filter-menu .check { width: 18px; flex: none; color: var(--accent-text); visibility: hidden; }
.filter-menu button[aria-checked="true"] .check { visibility: visible; }

.cluster {
  border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(1.8); backdrop-filter: blur(12px) saturate(1.8);
  border: 2.5px solid var(--mod);
  box-shadow: 0 3px 10px rgba(60, 40, 20, 0.14);
}
.cluster.fort { border-color: var(--fort); }
.cluster.mine { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(60, 40, 20, 0.14); }
.leaflet-heatmap-layer { opacity: 0.8; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--locate); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(10, 60, 120, 0.3); }
.place-pin { width: 18px; height: 18px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }

/* Panneau « Près de vous » */
.sheet {
  position: absolute; z-index: 950; left: 12px; right: 12px; bottom: calc(var(--tabbar-space) + 4px);
  max-width: 560px; margin: 0 auto;
  border-radius: 26px; padding: 0 18px 6px;
  background: rgba(255, 255, 255, 0.62);
}
.grabber { display: block; width: 100%; height: 18px; border: none; background: none; padding: 0; }
.grabber::before { margin-top: 7px !important; }
.sheet-toggle { display: block; width: 100%; border: none; background: none; padding: 0 0 8px; text-align: left; }
.grabber::before { content: ""; display: block; width: 36px; height: 5px; margin: 0 auto; border-radius: 3px; background: rgba(60, 40, 20, 0.16); }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 17px; font-weight: 600; white-space: nowrap; }
.sheet-head span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.near-where { font-size: 13px; color: var(--muted); margin: -4px 0 2px; }
.near-row {
  width: 100%; border: none; background: none; text-align: left; padding: 0;
  display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid rgba(60, 40, 20, 0.06);
}
.near-row:last-child { border-bottom: none; }
.near-row .dot { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.near-row .n { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.near-row .d { font-size: 14px; color: var(--muted); white-space: nowrap; }
.sheet.collapsed #near-body { display: none; }
.sheet.collapsed .sheet-toggle { padding-bottom: 6px; }
.near-empty { padding: 10px 0 8px; font-size: 14px; color: var(--muted); line-height: 1.45; }

/* Fiche arbre */
.detail {
  position: absolute; z-index: 1000; left: 0; right: 0; bottom: 0; max-width: 600px; margin: 0 auto;
  max-height: calc(100% - var(--header-h) - 40px); overflow-y: auto;
  border-radius: 34px 34px 0 0; padding: 6px 20px calc(var(--tabbar-space) + 8px);
  background: rgba(253, 248, 240, 0.9);
  -webkit-backdrop-filter: blur(30px) saturate(1.8); backdrop-filter: blur(30px) saturate(1.8);
  border-top: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 -10px 40px rgba(60, 40, 20, 0.12);
  transform: translateY(105%); transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column; gap: 16px;
}
.detail.open { transform: none; }
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.detail-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.detail-head p { margin-top: 4px; font-size: 15px; color: var(--muted); line-height: 1.4; }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: none; background: var(--tint); display: grid; place-items: center; color: var(--ink); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tile { padding: 14px; border-radius: 20px; display: flex; flex-direction: column; gap: 4px; }
.tile .k { font-size: 13px; font-weight: 500; }
.tile .v { font-size: 22px; font-weight: 700; }
.tile .s { font-size: 13px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 20px; font-size: 15px; line-height: 1.4; }
.banner-mine { background: var(--accent-soft); color: var(--accent-ink); }
.banner-mine button { border: none; background: none; padding: 0; font-weight: 700; color: var(--accent-ink); text-decoration: underline; }
.season { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; align-items: end; }
.season div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.season i { display: block; width: 100%; border-radius: 6px; }
.season small { font-size: 12px; color: var(--muted-2); }
.season .now small { color: var(--ink); font-weight: 700; }
.cta-wrap { display: flex; justify-content: center; }
.cta { height: 54px; padding: 0 32px; border-radius: 27px; border: none; background: var(--ink); color: #fff; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Alertes ---------- */
.big-level { font-size: 36px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.scale-ends { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted-2); }
.advice { padding: 12px 14px; border-radius: 14px; font-size: 15px; line-height: 1.45; }
.days { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.day { padding: 14px 12px; border-radius: 20px; display: flex; flex-direction: column; gap: 6px; }
.day b { font-size: 17px; line-height: 1.15; }
.day span { font-size: 14px; font-weight: 500; }
.day small { font-size: 13px; }
.taxon { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--rule); }
.taxon:last-child { border-bottom: none; }
.taxon .l { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.taxon .n { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.taxon .v { font-size: 15px; font-weight: 600; }

/* Interrupteur */
.row-setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--rule); }
.row-setting:last-child { border-bottom: none; }
.row-setting .t { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; }
.row-setting .t b { font-weight: 500; }
.row-setting .t small { font-size: 14px; color: var(--muted); }
.switch { flex: none; width: 52px; height: 32px; border-radius: 16px; border: none; padding: 2px; background: var(--switch-off); display: flex; justify-content: flex-start; transition: background 0.2s; }
.switch::after { content: ""; width: 28px; height: 28px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); }
.switch[aria-checked="true"] { background: var(--switch-on); justify-content: flex-end; }
.select { border: none; background: var(--chip); border-radius: 10px; padding: 6px 10px; font-weight: 600; }
.time { border: none; background: var(--chip); border-radius: 10px; padding: 6px 10px; font-weight: 600; }

/* Segmenté */
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 3px; border-radius: 22px; background: var(--tint); }
.segmented button { height: 38px; border-radius: 19px; border: none; background: transparent; font-size: 15px; font-weight: 500; color: var(--muted); }
.segmented button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 4px rgba(60, 40, 20, 0.1); }

/* ---------- Espèces ---------- */
.species-row { width: 100%; border: none; background: none; text-align: left; padding: 14px 0 12px; display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 68px; border-bottom: 1px solid var(--rule); }
.species-row:last-child { border-bottom: none; }
.species-row .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.species-row .nm { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; }
.species-row .nm b { font-weight: 600; }
.species-row .nm small { font-size: 14px; color: var(--muted-2); }
.species-row .c { font-size: 15px; font-weight: 500; }

/* ---------- Profil ---------- */
.account { display: flex; align-items: center; gap: 14px; }
.account .avatar { width: 56px; height: 56px; font-size: 20px; flex: none; }
.account input { width: 100%; border: none; background: transparent; font-size: 18px; font-weight: 600; padding: 0; }
.account small { font-size: 14px; color: var(--muted); }
.allergy-group { display: flex; flex-direction: column; gap: 10px; }
.allergy-group > span { font-size: 14px; font-weight: 500; color: var(--muted); }
.allergy-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.a-chip { height: 36px; padding: 0 14px; border-radius: 18px; border: none; background: var(--chip); font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.a-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.a-chip[aria-pressed="true"]::before { content: ""; width: 12px; height: 7px; border-left: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor; transform: rotate(-45deg) translateY(-2px); }
.btn-plain { height: 52px; border-radius: 20px; border: none; background: #fff; font-weight: 600; color: var(--danger); }

/* ---------- Barre d'onglets ---------- */
.tabbar {
  position: fixed; z-index: 1200; left: 16px; right: 16px; bottom: calc(16px + var(--safe-bottom));
  max-width: 520px; margin: 0 auto; height: 64px; padding: 4px; border-radius: 32px;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 10px 30px rgba(60, 40, 20, 0.12);
}
.tabbar a {
  border-radius: 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 11px; font-weight: 500; transition: background 0.2s, color 0.2s;
}
.tabbar a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); font-weight: 700; }

.toast {
  position: fixed; z-index: 1300; left: 16px; right: 16px; top: calc(var(--header-h) + 12px); max-width: 520px; margin: 0 auto;
  padding: 12px 16px; border-radius: 18px; font-size: 14px; line-height: 1.4; display: none;
  background: rgba(255, 255, 255, 0.85);
}
.toast.show { display: block; }
.loading { position: absolute; z-index: 940; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 12px 18px; border-radius: 18px; font-size: 14px; font-weight: 500; }

/* Écran d'accueil */
.splash {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--safe-top) 24px var(--safe-bottom);
  background: var(--ground); color: var(--ink);
  transition: opacity .45s ease, visibility 0s linear .45s;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.splash-mark {
  width: 96px; height: 96px; border-radius: 28px; background: var(--accent);
  display: grid; place-items: center; margin-bottom: 22px;
  box-shadow: 0 14px 34px rgba(80, 120, 0, 0.22);
  animation: splash-in .6s cubic-bezier(.2, .8, .2, 1) both;
}
.splash-name { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; animation: splash-in .6s .08s cubic-bezier(.2, .8, .2, 1) both; }
.splash-tagline { margin-top: 6px; font-size: 15px; color: var(--muted); animation: splash-in .6s .16s cubic-bezier(.2, .8, .2, 1) both; }
.splash-progress {
  margin-top: 128px; width: 160px; height: 4px; border-radius: 4px; overflow: hidden; background: var(--chip);
}
.splash-progress span {
  display: block; width: 100%; height: 100%; border-radius: inherit; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
}
.splash-status { margin-top: 12px; min-height: 1.4em; font-size: 13px; color: var(--muted-2); }
@keyframes splash-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .detail, .switch, .tabbar a { transition: none; }
  .splash { transition: none; }
  .splash-mark, .splash-name, .splash-tagline { animation: none; }
}
