/* Polices du site, servies par gva-ai.ch */
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-display:swap;font-weight:200 800;src:url(/assets/fonts/bricolage-grotesque-latin-opsz-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Instrument Sans";font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/fonts/instrument-sans-latin-ext-wght-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Instrument Sans";font-style:normal;font-display:swap;font-weight:400 700;src:url(/assets/fonts/instrument-sans-latin-wght-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
:root { padding-top: env(safe-area-inset-top, 0px); }
[hidden] { display: none !important; }
img { max-width: 100%; }
/* GVA AI, application. Mise en page : une colonne au format téléphone, en-tête collant,
   barre d'onglets fixe en bas ; sur grand écran la colonne est centrée sur un fond brume.
   Couleurs et polices reprises de gva-ai.ch (bleu lac, encre, rouge Sommet, soleil). */
:root {
  --ground: #e9f3f6;
  --surface: #ffffff;
  --surface-2: #f5fafb;
  --line: #d4e3e9;
  --ink: #15303f;
  --ink-2: #4a6070;
  --lake: #0b6c8c;
  --lake-ink: #08546d;
  --lake-soft: #d9eef5;
  --summit: #c21b33;
  --summit-soft: #fde4e8;
  --sun: #ffc53d;
  --sun-soft: #fff3cf;
  --talks: #0b6c8c;
  --talks-bg: #dff0f6;
  --work: #23784a;
  --work-bg: #e0f3e7;
  --meet: #a85200;
  --meet-bg: #ffeed6;
  --official: #5a43a3;
  --official-bg: #ebe6f8;
  --ok: #23784a;
  --err: #b3261e;
  --on-lake: #ffffff;
  --shadow: 0 10px 30px rgba(21, 48, 63, .14);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --r-l: 22px;
  --r: 14px;
  --r-s: 10px;
  --col: 34rem;
  --nav-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #08131a; --surface: #0e1b23; --surface-2: #132833; --line: #24404f;
    --ink: #e7f1f5; --ink-2: #a9bfca; --lake: #6cc6e4; --lake-ink: #9ad9ee; --lake-soft: #12384a;
    --summit: #ff7387; --summit-soft: #3a1720; --sun: #ffc53d; --sun-soft: #3a2f10;
    --talks: #6cc6e4; --talks-bg: #12384a; --work: #6fd39a; --work-bg: #123826;
    --meet: #ffb067; --meet-bg: #3d2610; --official: #b7a4ff; --official-bg: #2a2147;
    --ok: #6fd39a; --err: #ff8a80; --on-lake: #08131a; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #08131a; --surface: #0e1b23; --surface-2: #132833; --line: #24404f;
  --ink: #e7f1f5; --ink-2: #a9bfca; --lake: #6cc6e4; --lake-ink: #9ad9ee; --lake-soft: #12384a;
  --summit: #ff7387; --summit-soft: #3a1720; --sun: #ffc53d; --sun-soft: #3a2f10;
  --talks: #6cc6e4; --talks-bg: #12384a; --work: #6fd39a; --work-bg: #123826;
  --meet: #ffb067; --meet-bg: #3d2610; --official: #b7a4ff; --official-bg: #2a2147;
  --ok: #6fd39a; --err: #ff8a80; --on-lake: #08131a; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 400 15px/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}
button, input { font: inherit; color: inherit; }
a { color: var(--lake-ink); }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app {
  max-width: var(--col);
  margin-inline: auto;
  min-height: 100%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.gutter {
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* En-tête */
.top {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; color: inherit; }
.brand svg { width: 34px; height: 34px; flex: none; }
.brand b { display: block; font: 800 19px/1 var(--display); letter-spacing: -.01em; }
.brand b span { color: var(--lake); }
.brand small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pill-btn {
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px;
  padding: 6px 11px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pill-btn.install { background: var(--lake); border-color: var(--lake); color: var(--on-lake); }
.ribbon {
  background: var(--sun-soft); color: var(--ink); font-size: 12.5px; line-height: 1.4;
  padding-block: 8px; border-bottom: 1px solid var(--line);
}
.ribbon b { font-weight: 700; }

/* Contenu */
main { flex: 1; padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
.view-head { padding-block: 18px 6px; display: grid; gap: 6px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lake-ink); }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; letter-spacing: -.015em; }
h1 { font-size: 28px; line-height: 1.12; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.2; font-weight: 750; }
h3 { font-size: 17px; line-height: 1.25; font-weight: 700; }
.lead { color: var(--ink-2); margin: 0; }

.search { position: relative; margin-top: 8px; }
.search input {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: var(--r); padding: 11px 12px 11px 40px; font-size: 15px;
}
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-2); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-block: 12px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.count { font-size: 13px; color: var(--ink-2); padding-block: 6px 2px; }

.month {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--top-h, 57px)); z-index: 2;
  background: var(--surface); padding-block: 14px 6px;
  font: 700 13px/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
}
.list { list-style: none; margin: 0; padding: 0; }
.ev { display: flex; align-items: stretch; border-bottom: 1px solid var(--line); }
.ev-open {
  flex: 1; min-width: 0; display: flex; gap: 14px; text-align: left; background: none; border: 0;
  padding: 14px 0; cursor: pointer;
}
.ev-date { flex: none; width: 46px; text-align: center; padding-top: 2px; }
.ev-date b { display: block; font: 800 24px/1 var(--display); font-variant-numeric: tabular-nums; }
.ev-date span { display: block; font-size: 12px; color: var(--ink-2); margin-top: 4px; text-transform: lowercase; }
.ev-date span:first-child:not(:last-child) { margin: 0 0 3px; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.ev-body { min-width: 0; display: grid; gap: 4px; border-left: 3px solid var(--c, var(--line)); padding-left: 12px; }
.ev-title { font-weight: 650; font-size: 15.5px; line-height: 1.3; overflow-wrap: anywhere; }
.ev-meta { font-size: 13px; color: var(--ink-2); line-height: 1.4; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--cbg, var(--surface-2)); color: var(--c, var(--ink)); }
.tag.plain { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
.tag.rtg { background: var(--summit-soft); color: var(--summit); }
.tag.new { background: var(--sun); color: #2a1f00; }
.cat-talks { --c: var(--talks); --cbg: var(--talks-bg); }
.cat-work { --c: var(--work); --cbg: var(--work-bg); }
.cat-meet { --c: var(--meet); --cbg: var(--meet-bg); }
.cat-official { --c: var(--official); --cbg: var(--official-bg); }
.cat-summit { --c: var(--summit); --cbg: var(--summit-soft); }
.star {
  flex: none; width: 48px; display: grid; place-items: center; background: none; border: 0; cursor: pointer;
  color: var(--ink-2);
}
.star svg { width: 22px; height: 22px; }
.star[aria-pressed="true"] { color: var(--sun); }
.star[aria-pressed="true"] svg path { fill: var(--sun); stroke: #a77900; }

.empty { padding-block: 28px; display: grid; gap: 10px; justify-items: start; }
.empty p { margin: 0; color: var(--ink-2); max-width: 32em; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 11px 16px; font-weight: 650; font-size: 15px; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--lake); border-color: var(--lake); color: var(--on-lake); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; box-sizing: border-box; }
.btn svg { width: 18px; height: 18px; }
.btn[disabled] { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Sommet */
.summit-hero {
  margin-top: 14px; border-radius: var(--r-l); background: var(--summit-soft); padding: 20px;
  display: grid; gap: 6px;
}
.summit-hero .days { font: 800 56px/1 var(--display); color: var(--summit); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.summit-hero .days small { font: 700 18px/1 var(--display); margin-left: 6px; letter-spacing: 0; }
.summit-hero p { margin: 0; }
.note { font-size: 13px; color: var(--ink-2); margin: 0; }
.section { padding-block: 22px 4px; display: grid; gap: 10px; }
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { border-bottom: 1px solid var(--line); padding-block: 12px; display: grid; gap: 4px; }
.feed .src { font-size: 12px; font-weight: 700; color: var(--ink-2); letter-spacing: .02em; }
.feed a { font-weight: 650; color: var(--ink); text-decoration: none; }
.feed a:hover { text-decoration: underline; }
.feed p { margin: 0; font-size: 13.5px; color: var(--ink-2); }

/* Alertes */
.panel {
  border: 1px solid var(--line); border-radius: var(--r-l); padding: 18px; display: grid; gap: 12px;
  background: var(--surface);
}
.panel.lead-panel { background: var(--lake-soft); border-color: transparent; }
.panel-head { display: flex; gap: 12px; align-items: flex-start; }
.panel-head .ico {
  flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--lake-ink);
}
.lead-panel .panel-head .ico { background: var(--surface); }
.panel-head .ico svg { width: 22px; height: 22px; }
.panel-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.status { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-2); }
.status.on::before { background: var(--ok); }
.switches { display: grid; gap: 2px; }
.sw { display: flex; align-items: flex-start; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); }
.lead-panel .sw { border-top-color: rgba(11, 108, 140, .18); }
.sw label { flex: 1; min-width: 0; cursor: pointer; }
.sw label b { display: block; font-weight: 650; }
.sw label span { display: block; font-size: 13px; color: var(--ink-2); }
.sw input {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px;
  background: var(--line); position: relative; cursor: pointer; margin: 2px 0 0; transition: background .15s;
}
.sw input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s;
}
.sw input:checked { background: var(--lake); }
.sw input:checked::after { transform: translateX(18px); }
.themes { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 6px; }
.themes .chip { padding: 5px 11px; font-size: 13px; }
.mail-form { display: flex; gap: 8px; flex-wrap: wrap; }
.mail-form input {
  flex: 1 1 12rem; min-width: 0; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px;
  background: var(--surface-2);
}
.form-msg { font-size: 13.5px; margin: 0; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--err); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; color: var(--ink-2); }
.stack { display: grid; gap: 14px; padding-block: 16px 8px; }
.privacy { font-size: 13px; color: var(--ink-2); padding-block: 8px 0; }

/* Barre d'onglets */
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: min(var(--col), 100%);
  z-index: 6; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabs a {
  position: relative; height: var(--nav-h); display: grid; place-items: center; align-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-2); font-size: 11.5px; font-weight: 650;
}
.tabs a svg { width: 23px; height: 23px; }
.tabs a[aria-current="page"] { color: var(--lake); }
.tabs a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--lake);
}
.badge {
  position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 999px; background: var(--sun); color: #2a1f00; font-size: 11px; font-weight: 800; display: grid; place-items: center;
}

/* Fiche d'événement */
.sheet-back {
  position: fixed; inset: 0; z-index: 20; background: rgba(8, 19, 26, .45); display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: min(var(--col), 100%); max-height: 88vh; overflow-y: auto; background: var(--surface);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow);
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  animation: rise .22s ease-out;
}
@keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-bar { height: 6px; background: var(--c, var(--lake)); border-radius: 22px 22px 0 0; }
.sheet-inner { display: grid; gap: 14px; padding-block: 16px 0; }
.sheet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.close { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; flex: none; }
.close svg { width: 18px; height: 18px; }
.facts { display: grid; gap: 8px; margin: 0; }
.facts div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 10px; font-size: 14px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-weight: 550; }
.desc { margin: 0; font-size: 15px; line-height: 1.55; }
.how { display: grid; gap: 10px; margin: 0; padding-left: 1.2em; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  z-index: 30; width: min(calc(var(--col) - 32px), calc(100% - 32px)); box-sizing: border-box;
  background: var(--ink); color: var(--surface); padding: 12px 14px; border-radius: 12px; font-size: 14px;
  box-shadow: var(--shadow);
}

.pad-18 { padding-block: 18px 0; }
.pad-16 { padding-block: 16px 0; }
.pad-10 { padding-block: 10px 0; }
.sw.first { border-top: 0; }

/* partage */
.pill-btn.icon { padding: 6px 8px; display: grid; place-items: center; }
.pill-btn.icon svg { width: 18px; height: 18px; display: block; }
.share-row .btn { flex: 1 1 calc(50% - 5px); box-sizing: border-box; min-width: 0; }
.qr { margin: 2px 0 0; display: grid; justify-items: center; gap: 8px; }
.qr img { width: 168px; height: 168px; background: #fff; padding: 10px; border-radius: 14px; border: 1px solid var(--line); box-sizing: content-box; }

@media (min-width: 40rem) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  .sw input, .sw input::after { transition: none; }
}
