@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('polices/inter-tight-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;
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('polices/inter-tight-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;
}

:root {
  --noir: #0b0b0b;
  --noir-2: #151515;
  --noir-3: #1d1d1d;
  --trait: #262626;
  --blanc: #f2f2f2;
  --gris: #8a8a8a;
  --rouge: #ff6b5e;
  --vert: #7bd88f;
  --jaune: #f5c65b;
  --courbe: cubic-bezier(.22, 1, .36, 1);
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--noir); color: var(--blanc); }
body {
  font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
h1, h2, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

.logo { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin: 28px 0 10px; }
.s { color: var(--gris); font-size: 14px; }
.petit { font-size: 13px; color: var(--gris); }
h1 { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }

/* ---------------------------------------------------------------- Structure */
#appli { padding: calc(var(--haut) + 12px) 16px calc(var(--bas) + 96px); max-width: 640px; margin: 0 auto; }
.haut { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.synchro { font-size: 12px; color: var(--gris); margin-top: 2px; }
.rond {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--noir-2); border: 1px solid var(--trait); font-size: 20px; line-height: 1; text-align: center;
}
.rond.plein { background: var(--blanc); color: var(--noir); border-color: var(--blanc); font-size: 24px; font-weight: 400; }
.rond.tourne { animation: tour 0.9s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }
.titre-page { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px calc(var(--bas) + 6px);
  background: rgba(11, 11, 11, .86); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--trait);
}
.onglets button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 500; color: var(--gris); padding: 4px 0; }
.onglets button span { font-size: 20px; line-height: 1.1; }
.onglets button.actif { color: var(--blanc); }

/* ---------------------------------------------------------------- Listes */
.liste { display: flex; flex-direction: column; background: var(--noir-2); border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; min-height: 58px; }
.ligne + .ligne { border-top: 1px solid var(--trait); }
.ligne:active { background: var(--noir-3); }
.ligne .g { flex: 0 0 auto; }
.ligne .m { flex: 1 1 auto; min-width: 0; }
.ligne .t { font-weight: 600; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
.ligne .s { font-size: 13.5px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.ligne .s b { color: var(--blanc); font-weight: 600; }
.ligne .d { flex: 0 0 auto; }
.ligne.passe { opacity: .5; }
.vide { color: var(--gris); padding: 18px 14px; font-size: 14px; }
.liste .vide { padding: 18px 14px; }

.jour { display: flex; flex-direction: column; align-items: center; width: 40px; line-height: 1; }
.jour .jj { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.jour .mm { font-size: 11px; color: var(--gris); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }
.jour.retard .jj, .jour.retard .mm { color: var(--rouge); }
.hh { display: block; width: 46px; font-weight: 700; font-variant-numeric: tabular-nums; }
.initiale { width: 36px; height: 36px; border-radius: 50%; background: var(--noir-3); display: grid; place-items: center; font-weight: 600; color: var(--gris); }
.nb { font-size: 13px; color: var(--gris); }
.tag { display: inline-block; font-size: 11px; font-weight: 500; color: var(--gris); border: 1px solid var(--trait); border-radius: 99px; padding: 1px 7px; margin-left: 4px; vertical-align: 2px; }

.statut { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--noir-3); color: var(--gris); white-space: nowrap; }
.statut.acceptee { color: var(--vert); background: rgba(123, 216, 143, .1); }
.statut.demandee, .statut.sans_reponse { color: var(--jaune); background: rgba(245, 198, 91, .1); }
.statut.refusee { color: var(--gris); }
.statut.chaud { color: var(--noir); background: var(--rouge); }
.coche { font-size: 13px; font-weight: 600; border: 1px solid var(--trait); border-radius: 99px; padding: 6px 11px; display: inline-block; }
.coche:active { background: var(--blanc); color: var(--noir); }

/* ---------------------------------------------------------------- Aujourd'hui */
.meteo { margin-top: 16px; background: var(--noir-2); border: 1px solid var(--trait); border-radius: 14px; padding: 14px; }
.m-g { display: flex; align-items: center; gap: 12px; }
.m-g .ic { font-size: 34px; line-height: 1; }
.m-g .t { font-size: 20px; font-weight: 700; }
.heures { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--trait); }
.heures span { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 18px; }
.heures small { font-size: 11px; color: var(--gris); }
.heures b { font-size: 13px; font-weight: 600; }
.pastilles { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.pastilles:empty { display: none; }
.pastilles button { background: var(--noir-2); border: 1px solid var(--trait); border-radius: 99px; padding: 8px 14px; font-size: 14px; }
.pastilles b { color: var(--rouge); }
.carte { display: block; width: 100%; background: var(--noir-2); border: 1px solid var(--trait); border-radius: 14px; padding: 16px; }
.carte.urssaf { margin-top: 28px; }
.carte .label { margin: 0 0 6px; }
.gros { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin: 2px 0; }
.jauge { height: 6px; border-radius: 3px; background: var(--noir-3); margin: 10px 0 8px; overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--blanc); border-radius: 3px; }

/* ---------------------------------------------------------------- Accréds / contacts */
.recherche {
  width: 100%; background: var(--noir-2); border: 1px solid var(--trait); border-radius: 12px;
  padding: 11px 14px; font-size: 16px; outline: none; -webkit-appearance: none;
}
.recherche:focus { border-color: #444; }
.puces { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 14px; padding: 0 16px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puces button { flex: 0 0 auto; border: 1px solid var(--trait); border-radius: 99px; padding: 7px 14px; font-size: 14px; color: var(--gris); }
.puces button.actif { background: var(--blanc); color: var(--noir); border-color: var(--blanc); font-weight: 600; }
#c-liste { margin-top: 14px; }

/* ---------------------------------------------------------------- Feuille du bas */
.voile { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 20; opacity: 0; transition: opacity .25s; }
.voile.ouvert { opacity: 1; }
.feuille {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-height: 88dvh; overflow-y: auto;
  background: var(--noir-2); border-top: 1px solid var(--trait); border-radius: 20px 20px 0 0;
  padding: 8px 18px calc(var(--bas) + 24px); max-width: 640px; margin: 0 auto;
  transform: translateY(100%); transition: transform .3s var(--courbe); overscroll-behavior: contain;
}
.feuille.ouvert { transform: translateY(0); }
.poignee { width: 38px; height: 5px; border-radius: 3px; background: #3a3a3a; margin: 0 auto 16px; }
.feuille .label:first-child { margin-top: 0; }
.grand { font-size: 26px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; margin: 4px 0 4px; }
.feuille .statut { margin-top: 12px; }
.bloc { background: var(--noir); border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; margin-top: 14px; display: flex; flex-direction: column; gap: 4px; }
.bloc .label { margin: 0; }
.liens { display: flex; flex-direction: column; gap: 4px; }
.liens a { color: var(--blanc); text-decoration: none; border-bottom: 1px solid #444; align-self: flex-start; }
.histo small { color: var(--gris); margin-right: 6px; }
.histo p { font-size: 14px; }
.feuille .liste { margin-top: 0; }
.feuille .ligne .t { font-size: 15px; }

.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.actions:empty { display: none; }
.bouton {
  display: block; width: 100%; text-align: center; text-decoration: none;
  border: 1px solid var(--trait); border-radius: 12px; padding: 13px; font-weight: 600; font-size: 16px; background: var(--noir);
}
.bouton.plein { background: var(--blanc); color: var(--noir); border-color: var(--blanc); }
.bouton.danger { background: var(--rouge); border-color: var(--rouge); }
.bouton.discret { border: 0; background: none; color: var(--gris); font-weight: 500; font-size: 14px; margin-top: 32px; }
.bouton:active { opacity: .8; }
.feuille > div > .bouton { margin-top: 10px; }
.choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choix button { border: 1px solid var(--trait); border-radius: 12px; padding: 11px 12px; font-size: 15px; text-align: center; background: var(--noir); }
.choix button.actif { background: var(--blanc); color: var(--noir); border-color: var(--blanc); font-weight: 600; }

.formulaire { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.formulaire label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--gris); font-weight: 500; min-width: 0; }
.formulaire input, .formulaire select, .formulaire textarea, #f-cle textarea {
  width: 100%; min-width: 0; background: var(--noir); border: 1px solid var(--trait); border-radius: 10px; padding: 11px 12px;
  font-size: 16px; color: var(--blanc); outline: none; -webkit-appearance: none; appearance: none;
}
.formulaire input:focus, .formulaire select:focus, .formulaire textarea:focus { border-color: #555; }
.formulaire .deux { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.formulaire .bouton { margin-top: 6px; }

/* ---------------------------------------------------------------- Liaison */
.liaison { padding: calc(var(--haut) + 48px) 24px 48px; max-width: 460px; margin: 0 auto; }
.liaison h1 { margin: 40px 0 20px; }
.liaison ol { padding-left: 20px; margin: 0 0 28px; display: flex; flex-direction: column; gap: 12px; color: #cfcfcf; }
.liaison summary { color: var(--gris); font-size: 14px; cursor: pointer; }
#f-cle { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
#f-cle textarea { font-family: ui-monospace, monospace; font-size: 13px; }
#liaison-erreur { margin-top: 20px; color: var(--rouge); }

/* ---------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bas) + 84px); z-index: 30;
  transform: translate(-50%, 12px); opacity: 0; transition: .25s var(--courbe);
  background: var(--blanc); color: var(--noir); font-weight: 600; font-size: 14px;
  padding: 10px 16px; border-radius: 99px; white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
.toast.vu { opacity: 1; transform: translate(-50%, 0); }

/* Fiche du soir */
.bloc small { color: var(--gris); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
.bloc details { margin-top: 8px; }
.bloc summary { color: var(--gris); font-size: 14px; cursor: pointer; }
.bloc ol { margin: 8px 0 0; padding-left: 22px; line-height: 1.6; }

/* Work */
.resume { margin: 0 2px 10px; }
.resume b { color: var(--blanc); }
.onglets button { min-width: 0; }
