/* ==========================================================================
   Timekeeper — feuille de style de l'application
   Identité « Stellar » (HTML5 UP) : dégradé rose → violet, texture,
   typographie Source Sans Pro, tuiles pastel et icônes Font Awesome.
   ========================================================================== */

/* --------------------------------------------------------------- Tokens -- */
:root {
  color-scheme: light;

  /* Fond dégradé de la page */
  --grad-a: #e37682;
  --grad-b: #5f4d93;

  /* Palette pastel Stellar (tuiles de statistiques, accents) */
  --pastel-1: #efa8b0;
  --pastel-2: #c79cc8;
  --pastel-3: #a89cc8;
  --pastel-4: #9bb2e1;
  --pastel-5: #8cc9f0;

  /* Texte posé sur le dégradé (identique dans les deux thèmes) */
  --on-bg:      #ffffff;
  --on-bg-soft: rgba(255, 255, 255, .82);
  --on-bg-dim:  rgba(255, 255, 255, .62);
  --on-bg-fill: rgba(255, 255, 255, .14);
  --on-bg-line: rgba(255, 255, 255, .28);

  /* Cartes et panneaux */
  --surface:    #ffffff;
  --surface-2:  #f6f7fb;
  --border:     rgba(0, 0, 0, .08);
  --text:       #2c2c2c;
  --text-soft:  #5d6470;
  --text-dim:   #8a919e;
  --accent:     #5f4d93;
  --accent-soft:#ece9f7;

  --green:  #2e7d32;
  --orange: #e65100;
  --red:    #b71c1c;
  --slate:  #546e7a;
  --green-grad:  linear-gradient(135deg, #388e3c, #2e7d32);
  --orange-grad: linear-gradient(135deg, #f57c00, #e65100);
  --red-grad:    linear-gradient(135deg, #e53935, #b71c1c);
  --slate-grad:  linear-gradient(135deg, #78909c, #546e7a);

  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .10);
  --shadow:    0 6px 16px rgba(0, 0, 0, .16);
  --shadow-lg: 0 24px 54px rgba(0, 0, 0, .35);

  --font: "Source Sans Pro", Helvetica, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bar-h: 54px;
  --maxw: 1180px;
}

/* Thème nuit : même identité, dégradé assombri. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --grad-a: #5a3350;
  --grad-b: #1b1730;

  --surface:    #191d2e;
  --surface-2:  #212639;
  --border:     rgba(255, 255, 255, .10);
  --text:       #edf0f8;
  --text-soft:  #aab3c6;
  --text-dim:   #7f8799;
  --accent:     #b9a8ff;
  --accent-soft:#2a2544;

  --green:  #4caf50;
  --orange: #ffa726;
  --red:    #ef5350;
  --slate:  #90a4ae;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
  --shadow:    0 8px 20px rgba(0, 0, 0, .45);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grad-a: #5a3350;
    --grad-b: #1b1730;
    --surface:    #191d2e;
    --surface-2:  #212639;
    --border:     rgba(255, 255, 255, .10);
    --text:       #edf0f8;
    --text-soft:  #aab3c6;
    --text-dim:   #7f8799;
    --accent:     #b9a8ff;
    --accent-soft:#2a2544;
    --green:  #4caf50;
    --orange: #ffa726;
    --red:    #ef5350;
    --slate:  #90a4ae;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .35);
    --shadow:    0 8px 20px rgba(0, 0, 0, .45);
  }
}

/* ---------------------------------------------------------------- Reset -- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--grad-b);
  background-image: url("../css/images/overlay.png"),
                    linear-gradient(45deg, var(--grad-a) 15%, var(--grad-b) 85%);
  background-attachment: fixed, fixed;
  color: var(--on-bg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, h4, p, figure { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }

:where(button, a, input, select, summary):focus-visible {
  outline: 2px solid var(--on-bg);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.shell { max-width: var(--maxw); margin: 0 auto; padding: 0 20px 64px; }
@media (max-width: 560px) { .shell { padding: 0 14px 72px; } }

/* --------------------------------------------------------------- Header -- */
#header {
  padding: 4.5em 2em 2.2em;
  text-align: center;
}
@media (max-width: 736px) { #header { padding: 3em 1.5em 1.6em; } }

#header .logo {
  display: block;
  margin: 0 0 1em;
}
#header .logo img {
  display: block;
  margin: 0 auto;
  width: 148px;
  max-width: 45vw;
  height: auto;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .3));
  animation: logo-in 1.1s cubic-bezier(.2, .9, .3, 1) both;
}
@media (max-width: 736px) { #header .logo img { width: 104px; } }

@keyframes logo-in {
  from { opacity: 0; transform: scale(.8) rotate(-30deg); }
  to   { opacity: 1; transform: none; }
}

#header h1 {
  font-size: 3.25em;
  font-weight: 300;
  letter-spacing: -.035em;
  line-height: 1.1;
}
@media (max-width: 736px) { #header h1 { font-size: 2.3em; } }

#header p {
  margin-top: .35em;
  font-size: 1.05em;
  font-weight: 300;
  color: var(--on-bg-soft);
  letter-spacing: -.01em;
}
@media (max-width: 736px) { #header p { font-size: .95em; } }

#header .logo img,
#header h1,
#header p,
#header .park-switcher { animation-fill-mode: both; }

#header h1,
#header p,
#header .park-switcher { animation: fade-up .8s ease both; }
#header h1 { animation-delay: .15s; }
#header p  { animation-delay: .25s; }
#header .park-switcher { animation-delay: .35s; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  #header .logo img, #header h1, #header p, #header .park-switcher { animation: none; }
}

/* ------------------------------------------------------ Sélecteur parc --- */
.park-switcher {
  display: inline-flex;
  margin-top: 1.5em;
  padding: 4px;
  gap: 4px;
  background: var(--on-bg-fill);
  border: 1px solid var(--on-bg-line);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
}
.park-switcher a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--on-bg);
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.park-switcher a img {
  width: 22px; height: 22px;
  padding: 2px;
  background: #fff;
  border-radius: 50%;
  flex: none;
}
.park-switcher a:hover { background: rgba(255, 255, 255, .12); }
.park-switcher a[aria-current="true"] {
  background: #fff;
  color: #4a3c77;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 480px) {
  .park-switcher { display: flex; margin-top: 1.2em; }
  .park-switcher a { flex: 1; justify-content: center; padding: 8px 10px; font-size: .86rem; }
  .park-switcher a span { font-size: .95em; }
}

/* ------------------------------------------------------------ Actionbar -- */
.actionbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(30, 20, 45, .34);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--on-bg-line);
  border-bottom: 1px solid var(--on-bg-line);
}

.actionbar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: var(--bar-h);
  padding: 8px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
@media (max-width: 560px) { .actionbar__inner { padding: 8px 12px; gap: 8px; } }

.actionbar__spacer { flex: 1 1 auto; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  flex: none;
  border: 1px solid var(--on-bg-line);
  background: var(--on-bg-fill);
  color: var(--on-bg);
  border-radius: 50%;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, .26); }
.icon-btn:active { transform: scale(.94); }

.refresh-state {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px;
  font-size: .8rem;
  color: var(--on-bg-soft);
  background: var(--on-bg-fill);
  border: 1px solid var(--on-bg-line);
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.refresh-state .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #7ee2a8;
  box-shadow: 0 0 0 3px rgba(126, 226, 168, .25);
}
.refresh-state[data-state="loading"] .dot { background: #ffd479; box-shadow: 0 0 0 3px rgba(255, 212, 121, .25); animation: pulse 1s ease-in-out infinite; }
.refresh-state[data-state="error"]   .dot { background: #ff8a80; box-shadow: 0 0 0 3px rgba(255, 138, 128, .25); }
@media (max-width: 980px) { .refresh-state { display: none; } }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ----------------------------------------------------------------- Tabs -- */
.tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: .92rem;
  font-weight: 600;
  color: var(--on-bg-soft);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
}
.tab i { font-size: .92em; opacity: .9; }
.tab:hover { color: var(--on-bg); background: rgba(255, 255, 255, .12); }
.tab[aria-selected="true"] {
  background: #fff;
  color: #4a3c77;
  box-shadow: var(--shadow-sm);
}
.tab .count {
  font-size: .74rem; font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .18);
  font-variant-numeric: tabular-nums;
}
.tab[aria-selected="true"] .count { background: var(--pastel-3); color: #fff; }
@media (max-width: 560px) { .tab { padding: 8px 11px; font-size: .86rem; } .tab i { display: none; } }

/* --------------------------------------------------------------- Banner -- */
.banner {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .9rem;
  border: 1px solid var(--on-bg-line);
  background: var(--on-bg-fill);
  color: var(--on-bg);
  backdrop-filter: blur(6px);
}
.banner--warn  { background: rgba(255, 196, 92, .22); border-color: rgba(255, 196, 92, .55); }
.banner--error { background: rgba(255, 120, 110, .22); border-color: rgba(255, 120, 110, .55); }
.banner--sim {
  background: rgba(140, 201, 240, .24);
  border-color: rgba(140, 201, 240, .6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.banner--sim b { letter-spacing: .02em; }
.banner i { margin-top: 3px; flex: none; }
.banner[hidden] { display: none; }

/* ----------------------------------------------------------------- Hero -- */
.hero {
  margin-top: 22px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
@media (max-width: 560px) { .hero { padding: 16px; margin-top: 16px; } }

.hero__top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.hero__icon {
  width: 38px; height: 38px;
  padding: 5px;
  flex: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.hero__title {
  font-size: 1.7rem;
  font-weight: 300;
  letter-spacing: -.03em;
  color: var(--text);
}
@media (max-width: 560px) { .hero__title { font-size: 1.32rem; } }

.status-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: #fff;
}
.status-chip--open   { background: var(--green-grad); }
.status-chip--closed { background: var(--slate-grad); }

.weather {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: .82rem;
  white-space: nowrap;
}
.weather i { color: var(--pastel-4); font-size: .95rem; }
.weather b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.weather__rain {
  padding-left: 8px;
  margin-left: 2px;
  border-left: 1px solid var(--border);
  color: var(--orange);
  font-weight: 600;
}
@media (max-width: 560px) {
  .weather { margin-left: 0; font-size: .78rem; padding: 5px 11px; }
  .weather__rain { display: none; }
}

.hero__hours { margin-top: 10px; color: var(--text-soft); font-size: .95rem; }
.hero__hours b { color: var(--text); font-variant-numeric: tabular-nums; }

/* Tuiles pastel — héritées de la liste « statistics » de Stellar. */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  margin-top: 18px;
  border-radius: 8px;
  overflow: hidden;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  min-width: 0;
  padding: 14px 16px;
  color: #fff;
  text-align: center;
}
.stat:nth-child(1) { background: var(--pastel-1); }
.stat:nth-child(2) { background: var(--pastel-2); }
.stat:nth-child(3) { background: var(--pastel-4); }
.stat:nth-child(4) { background: var(--pastel-5); }

.stat__value {
  font-size: 1.75rem;
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.025em;
  font-variant-numeric: tabular-nums;
}
.stat__value small { font-size: .55em; font-weight: 400; opacity: .85; margin-left: 2px; }
.stat__label {
  margin-top: 2px;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  opacity: .92;
}
.stat__sub {
  min-width: 0;
  margin-top: 4px;
  font-size: .78rem;
  opacity: .95;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) {
  .stat { padding: 11px 10px; }
  .stat__value { font-size: 1.4rem; }
  .stat__label { font-size: .66rem; letter-spacing: .05em; }
  .stat__sub { font-size: .72rem; }
}

/* -------------------------------------------------------------- Ticker --- */
.ticker {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px;
  padding: 11px 16px;
  border-radius: var(--radius-pill);
  background: var(--on-bg-fill);
  border: 1px solid var(--on-bg-line);
  color: var(--on-bg);
  font-size: .9rem;
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.ticker[hidden] { display: none; }
.ticker__icon { flex: none; color: #fff; opacity: .9; }
.ticker__viewport {
  flex: 1;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
}
.ticker__track {
  display: inline-flex; gap: 30px;
  white-space: nowrap;
  padding-left: 12px;
  animation: ticker-scroll 42s linear infinite;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.ticker__item b { font-weight: 700; }
.ticker__item em { font-style: normal; font-weight: 700; color: #ffe08a; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker__track { animation: none; white-space: normal; flex-wrap: wrap; gap: 14px; }
}

/* -------------------------------------------------------------- Toolbar -- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.search { position: relative; flex: 1 1 260px; min-width: 200px; }
.search input {
  width: 100%;
  padding: 10px 36px 10px 40px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--on-bg-line);
  background: var(--on-bg-fill);
  color: var(--on-bg);
  font-size: .95rem;
  backdrop-filter: blur(6px);
}
.search input::placeholder { color: var(--on-bg-dim); }
.search input::-webkit-search-cancel-button { display: none; }
.search > i {
  position: absolute; left: 15px; top: 50%;
  transform: translateY(-50%);
  color: var(--on-bg-dim);
  pointer-events: none;
}
.search__clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .22); color: var(--on-bg); cursor: pointer;
  display: none; align-items: center; justify-content: center; font-size: 1rem; line-height: 1;
}
.search.has-value .search__clear { display: inline-flex; }

.select {
  padding: 10px 32px 10px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--on-bg-line);
  background-color: var(--on-bg-fill);
  color: var(--on-bg);
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.select option { color: #2c2c2c; background: #fff; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  appearance: none;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--on-bg-line);
  background: var(--on-bg-fill);
  color: var(--on-bg-soft);
  font-size: .86rem; font-weight: 600;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s ease, color .15s ease;
}
.chip i { font-size: .9em; }
.chip:hover { background: rgba(255, 255, 255, .24); color: var(--on-bg); }
.chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: #4a3c77; }

/* ------------------------------------------------------------- Conseils -- */
.tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.tip {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  text-align: left;
  font: inherit;
  width: 100%;
  border-left: 4px solid var(--slate);
}
button.tip { cursor: pointer; transition: transform .14s ease, box-shadow .14s ease; }
button.tip:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.tip--good { border-left-color: var(--green); }
.tip--warn { border-left-color: var(--orange); }
.tip--info { border-left-color: var(--pastel-4); }

.tip__icon {
  flex: none;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: .82rem;
  background: var(--surface-2);
  color: var(--text-soft);
}
.tip--good .tip__icon { background: rgba(46, 125, 50, .12); color: var(--green); }
.tip--warn .tip__icon { background: rgba(230, 81, 0, .12);  color: var(--orange); }
.tip--info .tip__icon { background: rgba(155, 178, 225, .18); color: var(--pastel-4); }

.tip__body { min-width: 0; }
.tip__title {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-dim);
}
.tip__text { display: block; margin-top: 3px; font-size: .86rem; line-height: 1.4; }
.tip__text b { font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .tips { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .tip { padding: 11px 13px; gap: 10px; }
  .tip__icon { width: 28px; height: 28px; }
}

/* -------------------------------------------------------------- Section -- */
.section { margin-top: 28px; }
.section__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.section__head h3 {
  font-size: .92rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--on-bg);
}
.section__count {
  font-size: .74rem; font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--on-bg-fill);
  border: 1px solid var(--on-bg-line);
  color: var(--on-bg-soft);
  font-variant-numeric: tabular-nums;
}
.section__rule { flex: 1; height: 1px; background: var(--on-bg-line); }

details.section > summary { cursor: pointer; list-style: none; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary .section__head { margin-bottom: 0; }
details.section > summary .chevron { color: var(--on-bg-soft); transition: transform .2s ease; }
details.section[open] > summary .chevron { transform: rotate(180deg); }
details.section[open] > summary .section__head { margin-bottom: 12px; }

/* ----------------------------------------------------------------- Grid -- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 10px;
}
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; gap: 8px; } }

/* ----------------------------------------------------------------- Card -- */
.card {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  animation: card-in .22s ease both;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.card:active { transform: translateY(0); }

@keyframes card-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .card { animation: none; } .card:hover { transform: none; } }

.card::before { content: ""; width: 4px; flex: none; background: var(--slate); }
.card[data-level="low"]::before  { background: var(--green); }
.card[data-level="mid"]::before  { background: var(--orange); }
.card[data-level="high"]::before { background: var(--red); }

.card--dim { opacity: .9; }
.card--dim:hover { opacity: 1; }

.card__body { flex: 1; min-width: 0; padding: 11px 6px 11px 13px; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.card__name { font-size: .88rem; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; }
.card__meta { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px;
  border-radius: 5px;
  font-size: .68rem; font-weight: 700;
  background: var(--surface-2);
  color: var(--text-dim);
  white-space: nowrap;
}
.tag--sr   { background: rgba(168, 156, 200, .22); color: #6d5fa6; }
.tag--pa   { background: rgba(230, 81, 0, .12);    color: var(--orange); }
.tag--vq   { background: rgba(46, 125, 50, .12);   color: var(--green); }
.tag--down { background: rgba(183, 28, 28, .12);   color: var(--red); }
:root[data-theme="dark"] .tag--sr { color: #c3b5ff; }

.card__aside { flex: none; display: flex; align-items: center; justify-content: center; padding: 8px 10px 8px 4px; }

/* Pastille ronde d'attente — style d'origine. */
.wait {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
  background: var(--slate-grad);
  box-shadow: 0 2px 6px rgba(84, 110, 122, .3);
}
.wait i { font-size: .95rem; }
.wait small { font-size: .5rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; opacity: .9; margin-top: 1px; }
.card[data-level="low"]  .wait { background: var(--green-grad);  box-shadow: 0 2px 6px rgba(46, 125, 50, .35); }
.card[data-level="mid"]  .wait { background: var(--orange-grad); box-shadow: 0 2px 6px rgba(230, 81, 0, .35); }
.card[data-level="high"] .wait { background: var(--red-grad);    box-shadow: 0 2px 6px rgba(183, 28, 28, .35); }

.fav {
  position: absolute; top: 4px; right: 4px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: transparent;
  color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, color .15s ease, transform .15s ease;
}
.card:hover .fav, .fav:focus-visible, .fav[aria-pressed="true"] { opacity: 1; }
.fav:hover { transform: scale(1.18); }
.fav[aria-pressed="true"] { color: #f0a500; }
@media (hover: none) { .fav { opacity: 1; } }

/* --------------------------------------------------------------- Lists --- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list--split { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }

.row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.row__main { flex: 1; min-width: 0; }
.row__title { font-size: .95rem; font-weight: 600; }
.row__sub { margin-top: 3px; font-size: .82rem; color: var(--text-soft); }
.row__aside { flex: none; text-align: right; }

.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.menu-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.menu-btn i { font-size: .95em; color: #c0392b; }
:root[data-theme="dark"] .menu-btn i { color: #ff8a80; }
@media (max-width: 480px) { .menu-btn { padding: 7px 11px; } }

.times { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.time-pill {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: .78rem; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.time-pill--next { background: var(--pastel-3); color: #fff; }
.time-pill--past { opacity: .45; text-decoration: line-through; }

.countdown {
  font-size: .82rem; font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- Horaires -- */
.hours-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .hours-grid { grid-template-columns: 1fr; } }

.hours-card {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.hours-card__head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-weight: 600;
}
.hours-card__head i { color: var(--pastel-3); }
.hours-card__head img { width: 24px; height: 24px; padding: 2px; background: #fff; border-radius: 50%; flex: none; }
.hours-card table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.hours-card td { padding: 10px 18px; border-bottom: 1px solid var(--border); }
.hours-card tr:last-child td { border-bottom: 0; }
.hours-card tr.is-today { background: var(--accent-soft); }
.hours-card tr.is-today td:first-child { font-weight: 700; }
.hours-card td:first-child { color: var(--text-soft); text-transform: capitalize; }
.hours-card td:last-child { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hours-card .emh { display: block; font-size: .76rem; font-weight: 600; color: var(--accent); }

/* ----------------------------------------------------------------- Plan -- */
.map {
  position: relative;
  height: clamp(380px, calc(100vh - 280px), 760px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: linear-gradient(160deg, #cfe3d4, #e8e2d2);
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.map.is-dragging { cursor: grabbing; }
:root[data-theme="dark"] .map { background: linear-gradient(160deg, #1d2b2a, #2a2438); }

.map__tiles, .map__pins { position: absolute; inset: 0; }
.map__pins { pointer-events: none; }

.map__tile {
  position: absolute;
  top: 0; left: 0;
  width: 256px; height: 256px;
  will-change: transform;
}
/* Fond de carte assombri pour le thème nuit. */
:root[data-theme="dark"] .map__tile { filter: invert(1) hue-rotate(180deg) brightness(.86) contrast(.92) saturate(.8); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map__tile { filter: invert(1) hue-rotate(180deg) brightness(.86) contrast(.92) saturate(.8); }
  :root:not([data-theme="light"]) .map { background: linear-gradient(160deg, #1d2b2a, #2a2438); }
}

/* Repli sans fond de carte : la silhouette du parc reste lisible. */
.map--schematic .map__tiles { display: none; }
:root .map--schematic {
  background-image:
    linear-gradient(rgba(255, 255, 255, .10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .10) 1px, transparent 1px),
    linear-gradient(160deg, #6f6296, #8d5f79);
  background-size: 48px 48px, 48px 48px, auto;
}
:root[data-theme="dark"] .map--schematic {
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(160deg, #3a2f57, #241f38);
  background-size: 48px 48px, 48px 48px, auto;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .map--schematic {
    background-image:
      linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px),
      linear-gradient(160deg, #3a2f57, #241f38);
    background-size: 48px 48px, 48px 48px, auto;
  }
}

.map__pin {
  position: absolute;
  top: 0; left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--slate-grad);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
  transition: width .12s ease, height .12s ease, font-size .12s ease;
}
.map__pin[data-level="low"]  { background: var(--green-grad); }
.map__pin[data-level="mid"]  { background: var(--orange-grad); }
.map__pin[data-level="high"] { background: var(--red-grad); }
.map__pin--closed { opacity: .75; }
.map__pin--fav { border-color: #f0a500; }
.map__pin:hover, .map__pin:focus-visible { z-index: 5; transform-origin: center; filter: brightness(1.08); }

.map__pin--dot   { width: 13px; height: 13px; margin: -6px 0 0 -6px; font-size: 0; border-width: 2px; }
.map__pin--small { width: 27px; height: 27px; margin: -13px 0 0 -13px; font-size: .74rem; }
.map__pin--full  { width: 40px; height: 40px; margin: -20px 0 0 -20px; font-size: .88rem; flex-direction: column; }
.map__pin--full small { font-size: .5rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .9; margin-top: 1px; }
.map__pin i { font-size: .8em; }

.map__ui {
  position: absolute;
  top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 6;
}
.map__ui button {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, .94);
  color: #2c2c2c;
  font-size: .95rem;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  display: inline-flex; align-items: center; justify-content: center;
}
.map__ui button:hover { background: #fff; }
.map__ui button:disabled { opacity: .45; cursor: default; }

.map__legend {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 6;
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .92);
  color: #2c2c2c;
  font-size: .72rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.map__legend span { display: inline-flex; align-items: center; gap: 5px; }
.map__legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.map__legend .lg-low  { background: var(--green); }
.map__legend .lg-mid  { background: var(--orange); }
.map__legend .lg-high { background: var(--red); }
.map__legend .lg-off  { background: var(--slate); }
@media (max-width: 560px) { .map__legend { font-size: .68rem; gap: 7px; padding: 6px 10px; } }

.map__attrib {
  position: absolute;
  right: 0; bottom: 0;
  z-index: 6;
  padding: 2px 7px;
  border-radius: var(--radius-sm) 0 0 0;
  background: rgba(255, 255, 255, .82);
  color: #333;
  font-size: .64rem;
}
.map__attrib a { color: #333; }

.map__note {
  position: absolute;
  left: 50%; top: 12px;
  transform: translateX(-50%);
  z-index: 6;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: rgba(20, 12, 34, .72);
  color: #fff;
  font-size: .76rem;
  white-space: nowrap;
}

.map__hint {
  margin-top: 10px;
  font-size: .78rem;
  color: var(--on-bg-dim);
  text-align: center;
}

/* --------------------------------------------------------------- Sheet --- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 12, 34, .6);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade-in .18s ease;
}
@media (min-width: 640px) { .sheet-backdrop { align-items: center; padding: 24px; } }
.sheet-backdrop[hidden] { display: none; }

.sheet {
  width: 100%; max-width: 460px;
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: var(--shadow-lg);
  padding: 22px 22px calc(22px + env(safe-area-inset-bottom));
  animation: sheet-up .22s cubic-bezier(.2, .9, .3, 1);
}
@media (min-width: 640px) { .sheet { border-radius: var(--radius-lg); animation: fade-in .18s ease; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.sheet__head { display: flex; align-items: flex-start; gap: 12px; }
.sheet__title { flex: 1; font-size: 1.2rem; font-weight: 600; letter-spacing: -.02em; }
.sheet .icon-btn { border-color: var(--border); background: var(--surface-2); color: var(--text-soft); }
.sheet .icon-btn:hover { background: var(--surface-2); color: var(--text); }
.sheet__grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sheet__item { padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); }
.sheet__item dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); }
.sheet__item dd { margin: 3px 0 0; font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart {
  margin-top: 16px;
  padding: 12px 12px 8px;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.chart__svg { display: block; width: 100%; height: 104px; }
.chart__hint { margin: 0; font-size: .82rem; color: var(--text-dim); text-align: center; padding: 14px 4px; }

.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__axis { fill: var(--text-dim); font-size: 9px; font-family: inherit; }
.chart__axis--end { text-anchor: end; }

.chart__usual-area { fill: var(--accent); opacity: .12; }
.chart__usual { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; opacity: .65; }
.chart__today { fill: none; stroke: var(--green); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart__now { fill: var(--green); stroke: var(--surface-2); stroke-width: 2; }

.chart__legend {
  display: flex; align-items: center; gap: 6px;
  margin: 6px 0 0;
  font-size: .74rem;
  color: var(--text-dim);
}
.chart__key { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart__key--today { background: var(--green); }
.chart__key--usual { background: var(--accent); opacity: .65; margin-left: 10px; }
.chart__days { margin-left: auto; }

.sheet__actions { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: .88rem; font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: filter .15s ease;
}
.btn:hover { filter: brightness(.96); }
.btn--primary {
  background: linear-gradient(45deg, var(--grad-a), var(--grad-b));
  border-color: transparent;
  color: #fff;
}

/* ---------------------------------------------------------- État / vide -- */
.empty {
  padding: 38px 20px;
  text-align: center;
  color: var(--on-bg-soft);
  border: 1px dashed var(--on-bg-line);
  border-radius: var(--radius-lg);
  font-size: .92rem;
}
.empty i { font-size: 1.8rem; opacity: .7; display: block; margin-bottom: 10px; }
.empty .btn { margin-top: 14px; }

/* Bloc vide posé sur une carte blanche (vue horaires). */
.hours-card .empty { border: 0; color: var(--text-dim); }

.skeleton-card {
  height: 74px;
  border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255, 255, 255, .16) 30%, rgba(255, 255, 255, .3) 50%, rgba(255, 255, 255, .16) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 180% 0; } to { background-position: -40% 0; } }

/* -------------------------------------------------------------- Footer --- */
.footer {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--on-bg-line);
  color: var(--on-bg-dim);
  font-size: .82rem;
  text-align: center;
  line-height: 1.8;
}
.footer a { color: var(--on-bg-soft); }

/* --------------------------------------------------------------- Utils --- */
[hidden] { display: none !important; }
.muted { color: var(--text-dim); }
.nowrap { white-space: nowrap; }
