.ag-app { flex: 1; display: flex; min-width: 0; min-height: 0; }
.ag-side { width: 214px; }
.ag-agenda { display: flex; align-items: center; gap: 8px; padding: 5px 9px; border-radius: 7px; font-size: 13px; cursor: pointer; }
.ag-agenda:hover { background: var(--survol); }
.ag-agenda input { position: absolute; opacity: 0; }
.ag-agenda .pastille { width: 13px; height: 13px; flex: none; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--c); }
.ag-agenda input:checked + .pastille { background: var(--c); }
.ag-agenda input:focus-visible + .pastille { outline: 2px solid var(--focus); outline-offset: 2px; }
.ag-agenda .nom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-agenda small { display: block; font-size: 11px; color: var(--leger); }
.ag-agenda .btn { opacity: 0; }
.ag-agenda:hover .btn, .ag-agenda .btn:focus-visible { opacity: 1; }
.ag-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.ag-tete { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--trait); }
.ag-tete h3 { margin: 0 0 0 8px; font: 400 25px/1.1 var(--titre); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-bascules { display: flex; gap: 4px; }
.c-bascules .c-bascule { margin: 0; }
.ag-entetes, .ag-entieres { flex: none; display: grid; grid-template-columns: 52px repeat(var(--n), 1fr); border-bottom: 1px solid var(--trait); }
.ag-entetes span { padding: 7px 8px; font-size: 12px; color: var(--doux); text-align: center; }
.ag-entetes b { font-size: 15px; color: var(--texte); }
.ag-entetes .ag-auj b { color: var(--sur-accent); background: var(--bleu); border-radius: 999px; padding: 1px 7px; }
.ag-entieres > div { padding: 3px; display: grid; gap: 2px; min-width: 0; border-left: 1px solid var(--trait); }
.ag-entieres .ag-ev { position: static; }
.ag-defile { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.ag-grille { position: relative; display: grid; grid-template-columns: 52px repeat(var(--n), 1fr); background-image: linear-gradient(var(--trait) 1px, transparent 1px); background-size: 100% 46px; }
.ag-heures { position: relative; }
.ag-heures span { position: absolute; right: 7px; font-size: 11px; color: var(--leger); transform: translateY(-1px); font-variant-numeric: tabular-nums; }
.ag-col { position: relative; border-left: 1px solid var(--trait); cursor: copy; min-width: 0; }
.ag-col.auj { background: color-mix(in srgb, var(--bleu) 4%, transparent); }
.ag-ev { position: absolute; display: block; overflow: hidden; padding: 3px 7px; border-radius: 7px; text-align: left; font-size: 12px; line-height: 1.25; color: var(--texte); background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 3px 0 0 var(--c); cursor: pointer; transition: background .14s; }
.ag-ev:hover { background: color-mix(in srgb, var(--c) 26%, var(--surface)); }
.ag-ev.provisoire { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 12%, var(--surface)) 0 6px, var(--surface) 6px 12px); }
.ag-ev b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev small { display: block; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-maintenant { position: absolute; left: 0; right: 0; height: 2px; background: var(--rouge); z-index: 2; pointer-events: none; }
.ag-maintenant::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--rouge); }

.ev-form { flex: 1; overflow: auto; padding: 16px 20px; display: grid; gap: 10px; align-content: start; background: var(--surface); }
.ev-form label { display: grid; gap: 4px; font-size: 12px; font-weight: 650; color: var(--doux); }
.ev-titre { border: 0; border-bottom: 1px solid var(--trait-fort); outline: 0; background: none; font: 400 24px/1.3 var(--titre); color: var(--texte); padding: 2px 0 6px; }
.ev-titre:focus { border-bottom-color: var(--bleu); }
.ev-rang { display: flex; flex-wrap: wrap; gap: 10px; }
.ev-rang label { flex: 1 1 120px; }
.ev-form .ev-case { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--texte); font-weight: 500; }
.ev-notes { height: 76px; padding: 8px 10px; resize: vertical; font: inherit; }
.ev-parts { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-parts:empty { display: none; }
.ev-part { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--surface-3); font-size: 12.5px; }
.ev-part small { color: var(--leger); }
.ev-part.accepte small { color: var(--vert); }
.ev-part.refuse small { color: var(--rouge); }
.ev-part button { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--doux); }
.ev-part button:hover { background: var(--survol); }
.ev-form .actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.ev-form .actions .danger { margin-right: auto; }
.ev-form .erreur { color: var(--rouge); font-size: 12.5px; font-weight: 650; }

.cn-app { flex: 1; overflow: auto; padding: 16px 20px; display: grid; gap: 2px; align-content: start; max-width: 720px; margin: 0 auto; width: 100%; }
.cn-app h6 { margin: 18px 0 4px; font-size: 12px; font-weight: 700; color: var(--leger); }
.cn-ligne { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--trait); }
.cn-nom { flex: 1; min-width: 0; }
.cn-nom b { display: block; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-nom small { display: block; color: var(--doux); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cn-vide { margin: 4px 6px; color: var(--leger); font-size: 13px; }

@media (max-width: 760px) {
  .ag-side { display: none; }
  .ag-tete h3 { font-size: 20px; }
  .ag-tete .c-bascules [data-vue="semaine"] { display: none; }
}

/* Vue mois */
.ag-semaine-noms { flex: none; display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--trait); }
.ag-semaine-noms span { padding: 6px 8px; font-size: 12px; color: var(--doux); }
.ag-mois { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(6, minmax(0, 1fr)); overflow: auto; }
.ag-jour { min-width: 0; min-height: 86px; padding: 5px 5px 4px; display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--trait); border-bottom: 1px solid var(--trait); cursor: copy; }
.ag-jour:nth-child(7n) { border-right: 0; }
.ag-jour > b { align-self: flex-start; min-width: 22px; padding: 1px 6px; border-radius: 999px; font-size: 12.5px; font-weight: 650; text-align: center; }
.ag-jour.hors > b { color: var(--leger); font-weight: 500; }
.ag-jour.auj > b { color: var(--sur-accent); background: var(--bleu); }
.ag-jour.auj { background: color-mix(in srgb, var(--bleu) 4%, transparent); }
.ag-puce { display: block; min-width: 0; padding: 2px 6px; border-radius: 6px; text-align: left; font-size: 11.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: color-mix(in srgb, var(--c) 16%, var(--surface)); box-shadow: inset 2px 0 0 var(--c); }
.ag-puce:hover { background: color-mix(in srgb, var(--c) 28%, var(--surface)); }
.ag-puce small { color: var(--doux); font-variant-numeric: tabular-nums; }
.ag-reste { font-size: 11px; color: var(--leger); padding-left: 6px; }
@media (max-width: 760px) {
  .ag-jour { min-height: 58px; padding: 4px 2px; align-items: center; cursor: pointer; }
  .ag-puce { width: 6px; height: 6px; padding: 0; border-radius: 50%; background: var(--c); box-shadow: none; font-size: 0; }
  .ag-jour { flex-flow: row wrap; align-content: flex-start; justify-content: center; gap: 3px; }
  .ag-jour > b { flex-basis: 100%; text-align: center; align-self: auto; }
  .ag-reste { display: none; }
}
