/* Glow365 — interface blanche et lumineuse, accents bleu, corail, ciel ; or réservé au « 365 ». */
:root {
  --bg: #ffffff; --card: #ffffff; --soft: #f5f7fb; --soft2: #eef2f8; --line: #e3e8f0; --text: #172033; --muted: #5d6880;
  --blue: #2563eb; --blue-soft: #e8efff; --coral: #ff8a7a; --coral-soft: var(--coral-soft); --sky: #7dd3fc; --gold: #d9a521; --gold-soft: #fff6dc; --gold-line: var(--gold-line);
  --danger: #c2410c; --ok: #15803d; --warn-bg: #fff7ed; --warn-line: var(--warn-line); --dash: var(--dash);
  --hero-a: #eef4ff; --hero-b: #fff4f1; --glass: rgb(255 255 255 / .92);
  --radius: 18px; --shadow: 0 6px 24px rgb(23 32 51 / .08);
  --nav-h: 64px; color-scheme: light dark;
}
/* Mode sombre : suit le réglage clair / sombre de l'appareil. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141c; --card: #171e29; --soft: #1c2431; --soft2: #243041; --line: #2d384a; --text: #e8edf5; --muted: #9ba7bb;
    --blue: #6b9bff; --blue-soft: #1c2a4a; --coral: #ff9d8f; --coral-soft: #3a2422; --gold: #ebb93f; --gold-soft: #2c2412; --gold-line: #6b5420;
    --danger: #fb923c; --ok: #4ade80; --warn-bg: #2b1d10; --warn-line: #7c4a1d; --dash: #3d4a60;
    --hero-a: #16233d; --hero-b: #2b1c22; --glass: rgb(15 20 28 / .9); --shadow: 0 6px 24px rgb(0 0 0 / .35);
  }
  .btn.primary { background: #2f6bf0; border-color: #2f6bf0; }
  .btn.primary:hover { background: #3d77f5; }
  .chip.on { background: #2f6bf0; }
}
/* Police des dates : League Spartan (licence libre OFL, fichiers dans /polices, aucun service extérieur). */
@font-face { font-family: "Glow Dates"; src: url("/polices/LeagueSpartan-Medium.otf") format("opentype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Glow Dates"; src: url("/polices/LeagueSpartan-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Glow Dates"; src: url("/polices/LeagueSpartan-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Glow Dates"; src: url("/polices/LeagueSpartan-ExtraBold.otf") format("opentype"); font-weight: 800 900; font-display: swap; }
:root { --font-dates: "Glow Dates", system-ui, sans-serif; }
.hero .date, .hero .day-num, .day-head h2, .cal-head h2, .cal .n, .tl-day, .tl-month, .tl-date, .gal .month, .gal .dn, .otd .yr, .memory .yr, .year-grid .lbl, .years .chip {
  font-family: var(--font-dates); letter-spacing: .01em;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font: 500 16px/1.5 var(--font-dates); -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
main:focus, main:focus-visible { outline: none; }   /* le focus posé à chaque changement de page ne doit pas dessiner de trait */
[hidden] { display: none !important; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: var(--card); padding: 8px; }
svg.i { width: 24px; height: 24px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Coque : barre du haut + onglets (bas en portrait, côté en paysage) ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px; background: var(--glass); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand img { width: 32px; height: 32px; }
.brand b { color: var(--gold); }
.top h1 { flex: 1; margin: 0; font-size: 1rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 0; background: none; color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--soft); }
.tabs {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 16px; color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 500; }
.tabs a[aria-current="page"] { color: var(--blue); background: var(--blue-soft); }
main { max-width: 900px; margin: 0 auto; padding: 16px 16px calc(var(--nav-h) + 32px + env(safe-area-inset-bottom)); outline: none; }
@media (orientation: landscape) and (min-width: 640px), (min-width: 1000px) {
  .agenda { min-height: calc(100dvh - 61px - 48px); }
  .tabs { top: 0; bottom: 0; right: auto; width: 92px; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 80px 8px 8px; border-top: 0; border-right: 1px solid var(--line); }
  .tabs a { flex: none; }
  .top { padding-left: 104px; }
  main { padding-left: 108px; padding-bottom: 32px; max-width: 1008px; }   /* même colonne centrée que la chronologie */
  main:has(.gal) { max-width: 1308px; }
  .pending { left: 104px !important; }
}

/* ---------- Éléments communs ---------- */
h2 { font-size: 1.4rem; margin: 4px 0 12px; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.grow { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 12px 0; box-shadow: var(--shadow); }
.card.soft { background: var(--soft); box-shadow: none; }
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.card.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 500;
}
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1d4fd8; }
.btn.danger { color: var(--danger); border-color: var(--warn-line); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: .875rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--soft2); font-size: .85rem; color: var(--text); text-decoration: none; border: 0; cursor: pointer; }
.chip.on { background: var(--blue); color: #fff; }
.seg { display: inline-flex; background: var(--soft2); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; padding: 8px 14px; border-radius: 999px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Aujourd'hui ---------- */
.hero { border-radius: 26px; padding: 22px; background: linear-gradient(135deg, var(--hero-a) 0%, var(--hero-b) 100%); border: 1px solid var(--line); }
.hero .date { font-size: 1.75rem; font-weight: 700; text-transform: capitalize; line-height: 1.2; }
.hero .day-num { color: var(--gold); font-weight: 800; }
.add-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 16px; }
.add-grid button, .add-grid label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 18px;
  background: var(--card); border: 1px solid var(--line); cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--text);
}
.add-grid .c1 svg { color: var(--blue); } .add-grid .c2 svg { color: var(--coral); } .add-grid .c3 svg { color: #0ea5e9; } .add-grid .c4 svg { color: var(--gold); }
.memory { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; color: var(--text); margin: 8px 0; }
.memory img, .memory .ph { width: 76px; height: 76px; border-radius: 14px; object-fit: cover; background: var(--soft2); flex: none; }
.memory .yr { font-weight: 800; color: var(--gold); }

.otd-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }   /* toutes les années visibles, sans défilement de côté */
.otd { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: var(--text); }
.otd img, .otd .ph { width: 100%; aspect-ratio: 1; border-radius: 12px; object-fit: cover; background: var(--soft2); margin-bottom: 4px; }
.otd .yr { font-weight: 800; font-size: 1.1rem; color: var(--gold); }
.otd .t { font-size: .85rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.otd .badge { top: 14px; right: 14px; bottom: auto; }
.otd.empty { background: var(--soft); border-style: dashed; box-shadow: none; }
.otd.empty .ph { background: var(--card); color: var(--blue); aspect-ratio: auto; flex: 1; min-height: 56px; }   /* année vide : carte basse */

/* ---------- Agenda ---------- */
.agenda { display: flex; flex-direction: column; min-height: calc(100dvh - 61px - var(--nav-h) - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
.agenda .cal { flex: 1; grid-template-rows: auto; grid-auto-rows: minmax(48px, 1fr); }
.agenda .cell { aspect-ratio: auto; }
.cal-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.cal-head h2 { margin: 0; flex: 1; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal .dow { text-align: center; font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.cell {
  position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; display: block; text-decoration: none; color: var(--text);
  background: var(--soft); border: 1px solid transparent;
}
.cell.empty { background: var(--card); border: 1.5px dashed var(--line); }
.cell.future { opacity: .45; }
.cell.out { visibility: hidden; }
.cell img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cell .n { position: absolute; top: 4px; left: 7px; font-weight: 800; font-size: 1.05rem; line-height: 1.2; }
.cell.has-img .n { color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .8), 0 0 10px rgb(0 0 0 / .45); }
.cell .marks { position: absolute; right: 3px; bottom: 3px; display: flex; gap: 2px; }
.cell .marks span { display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 9px; background: var(--glass); color: var(--text); font-size: .65rem; font-weight: 700; }
.cell .marks svg.i { width: 12px; height: 12px; }
.cell.today { border: 2.5px solid var(--gold); }
.cell.text-only { background: var(--blue-soft); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: .8rem; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend .sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.year-grid a { position: relative; display: block; aspect-ratio: 4/3; border-radius: 16px; overflow: hidden; background: var(--soft); text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.year-grid img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.year-grid .lbl { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); color: #fff; font-weight: 700; text-transform: capitalize; }
.year-grid a:not(.has-img) .lbl { background: none; color: var(--text); }
.years { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; }

/* ---------- Jour, chronologie ---------- */
.entry { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin: 12px 0; overflow: hidden; box-shadow: var(--shadow); }
.entry .strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 4px; padding: 4px; }
.entry .strip.solo { grid-template-columns: 1fr; }
.entry .strip button { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--soft2); cursor: pointer; }
.entry .strip.solo button { aspect-ratio: auto; max-height: 70vh; }
.entry .strip img { width: 100%; height: 100%; object-fit: cover; display: block; }
.entry .strip.solo img { object-fit: contain; max-height: 70vh; background: var(--soft); }
.entry .body { padding: 12px 16px 16px; }
.entry h4 { margin: 0 0 4px; font-size: 1.1rem; }
.entry .caption { color: var(--muted); font-style: italic; }
.entry .text { white-space: pre-wrap; margin: 8px 0; }
.badge { position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: .75rem; }
.ph { display: grid; place-items: center; color: var(--muted); }
audio { width: 100%; }
.day-head { display: flex; align-items: center; gap: 6px; }
.day-head h2 { flex: 1; margin: 0; text-transform: capitalize; font-size: 1.25rem; }
.tl-day { margin: 18px 0 6px; font-weight: 700; text-transform: capitalize; }
/* Chronologie : une colonne centrée, une pastille de date par jour, les mois en intertitre. */
.tl-list { margin: 0 auto; }
.tl-month { position: sticky; top: calc(61px + env(safe-area-inset-top)); z-index: 5; margin: 18px -16px 8px; padding: 8px 16px;
  background: var(--glass); backdrop-filter: blur(8px); font-size: 1.25rem; text-transform: capitalize; color: var(--blue); }
.tl-item { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; margin-bottom: 14px; }
.tl-date { position: sticky; top: calc(112px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px;
  border-radius: 16px; background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--text); }
.tl-date b { font-size: 1.6rem; line-height: 1; font-weight: 800; }
.tl-date span { font-size: .8rem; color: var(--muted); text-transform: capitalize; }
.tl-cards .entry { margin: 0 0 10px; }
.tl .entry .strip.solo button { width: 100%; }
.tl .entry .strip.solo img { width: 100%; height: min(48vh, 340px); max-height: none; object-fit: cover; }
.tl .entry .strip:not(.solo) { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.gal-head { flex-direction: column; justify-content: center; }   /* Galerie et Chronologie : boutons au même endroit */
@media (min-width: 900px) {                         /* écran large : photo à gauche, texte à droite */
  .tl-item { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; }
  .tl .entry:has(.strip) { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; }
  .tl .entry .strip.solo img { height: 300px; }
}
@media (orientation: landscape) and (max-height: 520px) {   /* téléphone couché */
  .tl .entry:has(.strip) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .tl .entry .strip.solo img { height: 62vh; }
  .tl-month, .tl-date { position: static; }
}

/* ---------- Galerie ---------- */
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
.gal button { position: relative; aspect-ratio: 1; padding: 0; border: 0; overflow: hidden; border-radius: 8px; background: var(--soft2); cursor: pointer; }
.gal img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gal .dn { position: absolute; top: 4px; left: 8px; color: #fff; font-size: 1.3rem; font-weight: 800; line-height: 1.2; pointer-events: none;
  text-shadow: 0 1px 2px rgb(0 0 0 / .8), 0 0 10px rgb(0 0 0 / .45); }
.gal .month { grid-column: 1 / -1; font-weight: 700; margin: 14px 0 4px; text-transform: capitalize; }

/* ---------- Éditeur ---------- */
.media-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.media-item { position: relative; border-radius: 14px; overflow: hidden; background: var(--soft2); aspect-ratio: 1; }
.media-item img { width: 100%; height: 100%; object-fit: cover; }
.media-item .rm { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--glass); cursor: pointer; display: grid; place-items: center; }
.media-item .warn { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 6px; background: var(--warn-bg); color: var(--danger); font-size: .7rem; }
.media-item progress { position: absolute; left: 8px; right: 8px; bottom: 8px; width: calc(100% - 16px); }
.add-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 10px 0; }
.rec { display: flex; align-items: center; gap: 10px; }
.rec .dot { width: 12px; height: 12px; border-radius: 50%; background: #ef4444; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.save-state { font-size: .85rem; color: var(--muted); }

/* ---------- Plus, listes ---------- */
.menu { list-style: none; margin: 0; padding: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 6px; border: 0; border-bottom: 1px solid var(--line); background: none; text-decoration: none; color: var(--text); cursor: pointer; text-align: left; }
.menu .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stats div { background: var(--soft); border-radius: 16px; padding: 12px; }
.stats b { display: block; font-size: 1.4rem; }
table.rep { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.rep td, table.rep th { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.scroll { max-height: 55vh; overflow: auto; }
progress { width: 100%; height: 10px; }
.meter { height: 10px; border-radius: 6px; background: var(--soft2); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--blue); }

/* ---------- Connexion ---------- */
#login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, var(--hero-a), var(--bg) 45%, var(--hero-b)); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 26px; padding: 28px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.login-card .logo { width: 84px; height: 84px; display: block; margin: 0 auto 8px; }
.login-card h1 { text-align: center; margin: 0 0 4px; }
.login-card h1 b { color: var(--gold); }
.login-card .or { text-align: center; color: var(--muted); font-size: .85rem; margin: 14px 0; }
.msg { min-height: 1.4em; color: var(--danger); font-size: .9rem; }

/* ---------- Visionneuse, dialogues, messages ---------- */
.viewer { position: fixed; inset: 0; z-index: 60; background: #0b0f17; color: #fff; display: flex; flex-direction: column; }
.viewer .stage { flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; }
.viewer .stage img { user-select: none; -webkit-user-select: none; will-change: transform; cursor: zoom-in; }
.viewer .stage img.anim { transition: transform .22s ease-out; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer .bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.viewer .bar .icon-btn { color: #fff; }
.viewer .bar .icon-btn:hover { background: rgb(255 255 255 / .1); }
.viewer .info { flex: 1; font-size: .8rem; opacity: .85; text-align: center; }
.dialog-back { position: fixed; inset: 0; z-index: 70; background: rgb(15 23 42 / .45); display: grid; place-items: center; padding: 16px; }
.dialog { background: var(--card); border-radius: 22px; padding: 22px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.dialog h3 { margin-top: 0; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); z-index: 80; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; }
.pending { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 19; background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 14px; padding: 8px 12px; font-size: .85rem; }
.banner { background: var(--gold-soft); border: 1px solid var(--gold-line); border-radius: 14px; padding: 10px 14px; margin-bottom: 12px; }
.mt { margin-top: 10px; } .mb { margin-bottom: 12px; } .center { text-align: center; } .wide { width: 100%; }
.legend .sw-empty { border: 1.5px dashed var(--dash); } .legend .sw-text { background: var(--blue-soft); }
@media (orientation: landscape) and (max-height: 520px) {
  .hero .date { font-size: 1.3rem; }
  .add-grid button, .add-grid label { padding: 8px 4px; }
}

/* ---------- Widgets de la page Aujourd'hui ---------- */
.today { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.widget h3 { margin-top: 24px; }
.h-link { color: var(--text); display: inline-flex; align-items: center; gap: 2px; text-transform: capitalize; }
.h-link svg.i { width: 18px; height: 18px; color: var(--muted); }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.stat { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; padding: 12px; border-radius: var(--radius); background: var(--soft); }
.stat .ico { grid-row: span 2; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--coral-soft); color: var(--coral); }
.stat .ico.gold { background: var(--gold-soft); color: var(--gold); }
.stat b { font-family: var(--font-dates); font-size: 1.6rem; line-height: 1; }
.stat > span:last-child { font-size: .8rem; color: var(--muted); }
.widget progress { -webkit-appearance: none; appearance: none; height: 10px; border: 0; border-radius: 6px; overflow: hidden; background: var(--soft2); }
.widget progress::-webkit-progress-bar { background: var(--soft2); border-radius: 6px; }
.widget progress::-webkit-progress-value { background: linear-gradient(90deg, var(--gold), #f2c14e); border-radius: 6px; }
.widget progress::-moz-progress-bar { background: var(--gold); border-radius: 6px; }
.mini-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mc { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--soft); color: var(--muted); }
.mc img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mc span { position: absolute; top: 2px; left: 5px; font-family: var(--font-dates); font-weight: 800; font-size: .85rem; }
.mc.has { background: var(--blue-soft); color: var(--text); }
.mc.has img + span { color: #fff; text-shadow: 0 1px 2px rgb(0 0 0 / .8), 0 0 8px rgb(0 0 0 / .45); }
.mc.today { outline: 2.5px solid var(--gold); outline-offset: -2.5px; }
.mc.future { opacity: .45; }
.rnd { display: grid; gap: 8px; justify-items: center; }
.rnd a { position: relative; display: block; width: 100%; border-radius: var(--radius); overflow: hidden; background: var(--soft2); }
.rnd img { display: block; width: 100%; height: min(52vh, 380px); object-fit: cover; }
.rnd .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 14px 10px; background: linear-gradient(transparent, rgb(0 0 0 / .55)); color: #fff; font-family: var(--font-dates); font-weight: 700; text-transform: capitalize; }
.dialog-back:has(.sheet) { place-items: end center; padding: 0; }
.sheet { max-width: 560px; max-height: 88dvh; overflow: auto; border-radius: 24px 24px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
@media (min-width: 640px) { .dialog-back:has(.sheet) { place-items: center; padding: 16px; } .sheet { border-radius: 22px; } }
.wlist { list-style: none; margin: 8px 0 16px; padding: 0; }
.wlist li { display: flex; align-items: center; gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--line); opacity: .6; }
.wlist li.on { opacity: 1; }
.wlist label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.wlist input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.wlist .icon-btn:disabled { opacity: .3; cursor: default; }

/* ---------- Aujourd'hui et Agenda : tout centré, police League Spartan ---------- */
.today, .agenda, .year-grid, .years, main > .cal-head { font-family: var(--font-dates); }
.today, .agenda { text-align: center; }
.today h3, .agenda h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: .01em; }
.today .hero .muted { font-size: 1.05rem; }
.today .add-grid label, .today .add-grid button { font-family: var(--font-dates); font-size: .95rem; }
.today .otd { align-items: center; }
.today .otd .t { text-align: center; }
.today .stat { grid-template-columns: 1fr; justify-items: center; row-gap: 4px; }
.today .stat .ico { grid-row: auto; }
.today .h-link { justify-content: center; }
.today .entry .body, .today .entry .chips, .today .entry .row { justify-content: center; text-align: center; }
.today .entry .text { white-space: pre-line; }
.today .btn, .agenda .chip, .agenda .legend { font-family: var(--font-dates); }
.agenda .cal-head h2 { text-align: center; }
.cal-info { justify-content: center; gap: 6px; }
.cal-info .grow { flex: 0 0 100%; font-size: .95rem; }
.cal-info + .cal { margin-top: 4px; }
.agenda .cal .dow { font-weight: 700; letter-spacing: .04em; }
.agenda .cell .n { left: 0; right: 0; text-align: center; }
.agenda .cell .marks { left: 0; right: 0; justify-content: center; }
.agenda .legend { justify-content: center; }
.years { justify-content: center; }
.year-grid .lbl { text-align: center; }
main > .cal-head h2 { text-align: center; }

/* ---------- Toutes les pages : centrées, police League Spartan (choix de l'utilisateur) ---------- */
main, .dialog, #login { text-align: center; }
main .row, main .chips, .dialog .row { justify-content: center; }
main .row > span.grow { flex: 0 0 100%; }                        /* texte d'une rangée : sur sa ligne, centré */
.dialog .row > span.grow { display: none; }
.field > span { text-align: center; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number] { text-align: center; }
input[type=date], input[type=time] { text-align: center; justify-content: center; }
textarea { text-align: left; }
table.rep td, table.rep th { text-align: left; }
.entry .chips { justify-content: center; }
.tl-cards .entry .body { text-align: center; }
.tl-month { text-align: center; }
.gal .month { text-align: center; }
.day-head h2 { text-align: center; }
.stats div { text-align: center; }
details summary { justify-content: center; }
/* Plus : tuiles centrées au lieu d'une liste */
.menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.menu li { display: flex; }
.menu a, .menu button { flex-direction: column; justify-content: flex-start; gap: 8px; padding: 16px 10px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.menu a > svg.i:last-child { display: none; }
.menu .ico { width: 48px; height: 48px; border-radius: 14px; }
.menu b { font-size: 1.05rem; }
#sf .row > .field.grow { flex: 1 1 100%; }                        /* recherche : Lieu sur toute la largeur, Du et Au côte à côte */
#sf .row > .field:not(.grow) { flex: 1 1 40%; margin-top: 0; }
