/*
 * Pointassmat · thème « feuille de présence ».
 * Passes de design inspirées de unslop par Damir Sokolovsky (@heydamir), CC BY 4.0.
 *
 * Neutres légèrement chauds (papier, crayon), un accent terracotta rare,
 * une couleur par enfant. Grille de 4 px.
 */

@font-face { font-family: "Instrument Sans"; src: url("/static/instrument-sans.woff2") format("woff2");
  font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/geist-mono-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/geist-mono-500.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Jetons ---------- */
:root:not([data-theme=x]) {
  --bg: #f7f6f3; --surface: #ffffff; --raised: #f1efea; --sunken: #efede8;
  --line: rgba(31, 27, 22, .09); --line-strong: rgba(31, 27, 22, .16);
  --text: #1f1b16; --text-2: #5e574d; --text-3: #7b7368;
  --accent: #b4532a; --accent-hover: #9c4521; --accent-ink: #ffffff; --accent-soft: rgba(180, 83, 42, .10);
  --pos: #2f855a; --neg: #c2412d;
  --shadow: 0 1px 2px rgba(31, 27, 22, .05);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px; --r: 8px; --r-card: 12px;

  /* Couleurs par enfant (ordre fixe, l'orange est réservé à l'accent). */
  --kid-1: #2f6fdb; --kid-2: #12936f; --kid-3: #c98a00; --kid-4: #d0548a;
  --kid-5: #6a4ce2; --kid-6: #3f8f2a; --kid-7: #e26a2c; --kid-8: #d23f40;
  /* Rampe séquentielle (carte de chaleur, barres) : du papier vers la terracotta. */
  --heat-0: #efede8; --heat-1: #f6dccd; --heat-2: #eebda1; --heat-3: #e19a74;
  --heat-4: #cc7548; --heat-5: #b4532a; --heat-6: #8a3a19;
  --bar: #cfc9bf; --bar-hi: var(--accent);

  /* Pico */
  --pico-font-family: var(--sans);
  --pico-font-size: 15px;
  --pico-line-height: 1.5;
  --pico-font-weight: 400;
  --pico-border-radius: var(--r);
  --pico-background-color: var(--bg);
  --pico-color: var(--text-2);
  --pico-h1-color: var(--text); --pico-h2-color: var(--text); --pico-h3-color: var(--text);
  --pico-h4-color: var(--text); --pico-h5-color: var(--text); --pico-h6-color: var(--text);
  --pico-muted-color: var(--text-3);
  --pico-muted-border-color: var(--line);
  --pico-primary: var(--accent); --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent); --pico-primary-underline: rgba(180, 83, 42, .4);
  --pico-primary-hover: var(--accent-hover); --pico-primary-hover-background: var(--accent-hover);
  --pico-primary-hover-border: var(--accent-hover); --pico-primary-hover-underline: var(--accent-hover);
  --pico-primary-focus: rgba(180, 83, 42, .25); --pico-primary-inverse: var(--accent-ink);
  --pico-secondary: var(--text-2); --pico-secondary-background: var(--raised);
  --pico-secondary-border: var(--line-strong); --pico-secondary-hover: var(--text);
  --pico-secondary-hover-background: var(--sunken); --pico-secondary-hover-border: var(--line-strong);
  --pico-secondary-focus: var(--line-strong); --pico-secondary-inverse: var(--text);
  --pico-contrast: var(--text); --pico-contrast-background: var(--text); --pico-contrast-border: var(--text);
  --pico-contrast-hover-background: #000; --pico-contrast-inverse: var(--bg);
  --pico-card-background-color: var(--surface);
  --pico-card-sectioning-background-color: var(--surface);
  --pico-card-box-shadow: var(--shadow);
  --pico-box-shadow: var(--shadow);
  --pico-form-element-background-color: var(--surface);
  --pico-form-element-active-background-color: var(--surface);
  --pico-form-element-border-color: var(--line-strong);
  --pico-form-element-active-border-color: var(--accent);
  --pico-form-element-focus-color: var(--pico-primary-focus);
  --pico-form-element-color: var(--text);
  --pico-form-element-placeholder-color: var(--text-3);
  --pico-form-element-spacing-vertical: .5rem;
  --pico-form-element-spacing-horizontal: .75rem;
  --pico-table-border-color: var(--line);
  --pico-del-color: var(--neg);
  --pico-typography-spacing-vertical: 1rem;
  --pico-spacing: 1rem;
  --pico-block-spacing-vertical: 1.25rem;
  --pico-block-spacing-horizontal: 1.25rem;
  --pico-switch-checked-background-color: var(--accent);
  --pico-text-selection-color: var(--accent-soft);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]):not([data-theme=x]) {
    --bg: #151413; --surface: #1c1b19; --raised: #252321; --sunken: #121110;
    --line: rgba(239, 233, 222, .08); --line-strong: rgba(239, 233, 222, .15);
    --text: #efe9de; --text-2: #b0a99e; --text-3: #8f887d;
    --accent: #e0855a; --accent-hover: #ea9771; --accent-ink: #1a1310; --accent-soft: rgba(224, 133, 90, .14);
    --pos: #5cc28f; --neg: #ec6a55;
    --shadow: none;
    --kid-1: #6b9cf0; --kid-2: #32a885; --kid-3: #c48d1c; --kid-4: #d86a9a;
    --kid-5: #9b87f0; --kid-6: #6cb653; --kid-7: #ee8a52; --kid-8: #ec6a6b;
    /* Même sens qu'en clair : plus foncé = plus d'heures. */
    --heat-0: #23211f; --heat-1: #f3d6c5; --heat-2: #eab597; --heat-3: #df9670;
    --heat-4: #cf7749; --heat-5: #b4592f; --heat-6: #85391a;
    --bar: #4a4540; --bar-hi: var(--accent);
    --pico-primary-focus: rgba(224, 133, 90, .3);
    --pico-contrast-hover-background: #fff;
    --pico-form-element-background-color: var(--sunken);
    --pico-form-element-active-background-color: var(--sunken);
    color-scheme: dark;
  }
}

/* ---------- Base ---------- */
html { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--text-2); }
h1, h2, h3, h4, strong, b, th { color: var(--text); }
h1, h2, h3 { font-weight: 500; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; line-height: 1.15; margin-bottom: 1.5rem; }
h2 { font-size: 1.25rem; }
strong, b { font-weight: 600; }
small { font-size: .8125rem; }
a { text-underline-offset: 3px; }
.num, .mono, td, dd { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .8125rem; }
.muted { color: var(--text-3); }
.error, .warn { color: var(--neg); }
main.container { padding-top: 2rem; padding-bottom: 4rem; }
article { border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); margin-bottom: 1.5rem; }
article > header, article > footer { background: transparent; border-color: var(--line); }
article > header { padding-block: .875rem; }
button, [role=button], input, select, textarea { transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); }
button:active, [role=button]:active { transform: scale(.98); }
:is(button, [role=button], input, select):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
details summary { color: var(--text); }
table { font-size: .875rem; }
th { font-weight: 500; }

/* ---------- Navigation ---------- */
.topbar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar nav { min-height: 56px; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 600; font-size: 1rem; text-decoration: none; }
.brand svg { color: var(--accent); }
.topbar nav ul:last-child { gap: 2px; }
.topbar nav ul:last-child li { padding: 0; }
.topbar nav ul:last-child a { display: block; margin: 0; padding: .375rem .75rem; border-radius: var(--r); color: var(--text-2); text-decoration: none; font-size: .9375rem; }
.topbar nav ul:last-child a:hover { background: var(--raised); color: var(--text); }
.topbar nav a[aria-current=page] { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
@media (max-width: 640px) {
  .topbar nav { flex-wrap: wrap; }
  .topbar nav ul:first-child { display: none; }
  .topbar nav ul:last-child { width: 100%; justify-content: space-between; }
  .topbar nav ul:last-child a { padding: .375rem .5rem; font-size: .875rem; }
}

/* En-tête de page : titre et navigation de période. */
.page-head { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; margin-right: auto; }
.page-head h1 small { color: var(--text-3); font-weight: 400; font-size: 1rem; margin-left: .5rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.stepper a { display: grid; place-items: center; width: 36px; height: 36px; color: var(--text-2); text-decoration: none; }
.stepper a:hover { background: var(--raised); color: var(--text); }
.stepper a + a { border-left: 1px solid var(--line-strong); }
.stepper .today-link { width: auto; padding: 0 .75rem; font-size: .875rem; }
.toolbar { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.toolbar a[role=button], .toolbar button { margin: 0; padding: .375rem .875rem; font-size: .875rem; }

/* ---------- Réglette horaire (signature) ---------- */
/* Une journée de 6 h à 19 h : présence de l'enfant, horaire prévu en pointillé. */
.ruler { position: relative; height: 10px; border-radius: 3px; background: var(--sunken); margin: 2px 0; }
.ruler .plan { position: absolute; top: -2px; bottom: -2px; border: 1px dashed var(--text-3); border-radius: 4px; opacity: .7; }
.ruler .seg { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--seg, var(--accent)); }
.ruler .seg.open { background: repeating-linear-gradient(90deg, var(--seg) 0 6px, transparent 6px 9px); }
.ruler-ticks { position: relative; height: 16px; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.ruler-ticks span { position: absolute; transform: translateX(-50%); }
.k1 { --seg: var(--kid-1); } .k2 { --seg: var(--kid-2); } .k3 { --seg: var(--kid-3); } .k4 { --seg: var(--kid-4); }
.k5 { --seg: var(--kid-5); } .k6 { --seg: var(--kid-6); } .k7 { --seg: var(--kid-7); } .k8 { --seg: var(--kid-8); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--seg); flex: none; }

/* ---------- Aujourd'hui ---------- */
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr)); }
.child-card { margin: 0; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.child-card .head { display: flex; align-items: center; gap: .5rem; }
.child-card .head strong { font-size: 1.0625rem; font-weight: 500; }
.child-card .head .mono { margin-left: auto; color: var(--text-2); }
.child-card .slots { margin: 0; padding: 0; list-style: none; display: flex; gap: .25rem .75rem; flex-wrap: wrap; font-family: var(--mono); font-size: .8125rem; color: var(--text-2); }
.child-card .slots li { list-style: none; }
.child-card .status { font-size: .875rem; color: var(--text-3); margin: 0; }
.child-card .big { width: 100%; margin: 0; font-size: 1rem; padding: .75rem; font-weight: 500; }
.meals { display: flex; align-items: center; gap: .75rem; color: var(--text-2); font-size: .875rem; }
.meals .counter { display: inline-flex; align-items: center; margin-left: auto; border: 1px solid var(--line-strong); border-radius: var(--r); }
.meals .counter button { width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text-2); }
.meals .counter button:hover:not(:disabled) { background: var(--raised); color: var(--text); }
.meals .counter strong { min-width: 28px; text-align: center; font-family: var(--mono); font-weight: 500; }

/* ---------- Calendrier ---------- */
.cal { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.cal-head, .cal-week { display: grid; grid-template-columns: 44px repeat(7, minmax(0, 1fr)); }
.cal-head { border-bottom: 1px solid var(--line); }
.cal-head span { padding: .5rem .75rem; font-size: .8125rem; color: var(--text-3); }
.cal-week + .cal-week { border-top: 1px solid var(--line); }
.cal-wk { display: grid; place-items: start center; padding-top: .625rem; font-family: var(--mono); font-size: 11px; color: var(--text-3); text-decoration: none; border-right: 1px solid var(--line); }
.cal-wk:hover { color: var(--accent); background: var(--raised); }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-height: 112px; padding: .5rem .625rem; text-decoration: none; color: var(--text-2); border-left: 1px solid var(--line); }
.cal-wk + .cal-day { border-left: 0; }
.cal-day:hover { background: var(--raised); }
.cal-day .d { display: flex; align-items: baseline; gap: .375rem; }
.cal-day .n { font-family: var(--mono); font-size: .8125rem; color: var(--text); }
.cal-day.out { background: var(--bg); }
.cal-day.out .n { color: var(--text-3); }
.cal-day.today .n { background: var(--accent); color: var(--accent-ink); border-radius: 4px; padding: 0 5px; }
.cal-day.weekend { background: color-mix(in srgb, var(--bg) 60%, var(--surface)); }
.cal-day .holiday { font-size: 11px; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-day .rulers { display: flex; flex-direction: column; gap: 4px; margin-top: auto; }
.cal-day .ruler { height: 6px; margin: 0; }
.cal-day .ruler .plan { top: -2px; bottom: -2px; }
.cal-day .foot { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.cal-day .foot .ot { color: var(--accent); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin: 1rem 0 0; font-size: .8125rem; color: var(--text-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: .375rem; }
.cal-legend .plan-sample { width: 18px; height: 10px; border: 1px dashed var(--text-3); border-radius: 3px; }
.cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .cal-head, .cal-week { grid-template-columns: 28px repeat(7, minmax(0, 1fr)); }
  .cal-head span { padding: .375rem .25rem; text-align: center; font-size: 11px; }
  .cal-day { min-height: 64px; padding: .375rem .25rem; align-items: center; gap: 4px; }
  .cal-day .rulers, .cal-day .holiday, .cal-day .foot .ot { display: none; }
  .cal-day .foot { justify-content: center; font-size: 10px; }
  .cal-day.holiday-day .n { box-shadow: inset 0 -2px 0 var(--accent); }
  .cal-dots { display: flex; justify-content: center; }
  .cal-wk { font-size: 10px; }
}

/* ---------- Journée / semaine : pointages ---------- */
.day-block { margin-bottom: 1.5rem; }
.day-block > h2 { font-size: 1rem; display: flex; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.day-block > h2 .tag { font-size: .8125rem; font-weight: 400; color: var(--accent); }
.entry-row { display: grid; gap: .5rem; align-items: center; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 4rem; padding: .75rem 0; border-top: 1px solid var(--line); margin: 0; }
.entry-row .label { grid-column: 1 / -1; margin: 0; display: flex; align-items: center; gap: .5rem; font-size: .9375rem; }
.entry-row .label .ruler { flex: 1; max-width: 18rem; margin-left: auto; }
.entry-row input, .entry-row button { margin: 0; }
.entry-row input { padding-block: .375rem; font-family: var(--mono); font-size: .875rem; }
.entry-row button { padding: .375rem .75rem; font-size: .875rem; }
.entry-row button[type=submit] { grid-column: 1 / 3; }
@media (min-width: 640px) {
  .entry-row { grid-template-columns: 9rem 9rem 4.5rem auto auto 1fr; }
  .entry-row .label { grid-column: 1 / -1; }
  .entry-row button[type=submit] { grid-column: auto; }
}
.add-entry { border: 1px dashed var(--line-strong); border-radius: var(--r-card); padding: 1rem 1.25rem; margin-top: 1.5rem; }
.add-entry summary { font-weight: 500; }

/* ---------- Récap du mois, fiche ---------- */
.recap dl { display: grid; grid-template-columns: fit-content(60%) 1fr; gap: .5rem 1rem; margin: 0; }
.recap dt { font-weight: 400; color: var(--text-2); }
.recap dd { margin: 0; text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.recap .total { font-size: 1.125rem; border-top: 1px solid var(--line); padding-top: .75rem; margin-top: .25rem; }
.recap .total strong { font-weight: 500; }
.recap details { margin: 1rem 0 0; }
.recap header { display: flex; align-items: center; gap: .5rem; }
.recap header strong { font-weight: 500; font-size: 1.0625rem; }
.recaps { display: grid; gap: 1rem; margin-bottom: 2rem; grid-template-columns: repeat(auto-fill, minmax(min(22rem, 100%), 1fr)); align-items: start; }
.recaps article { margin: 0; }
.child-list { list-style: none; padding: 0; margin: 0 0 2rem; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); }
.child-list li { list-style: none; padding: .875rem 1.25rem; border-top: 1px solid var(--line); display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.child-list li:first-child { border-top: 0; }
.child-list li .ruler { flex-basis: 100%; }
@media print { .topbar, .no-print { display: none !important; } article { box-shadow: none; border: 0; } }

/* ---------- Import ---------- */
.import-ok, .import-skip, .import-error { margin: 0; padding: .5rem 0; border-bottom: 1px solid var(--line); font-size: .875rem; }
.import-error { color: var(--neg); }
.import-skip { color: var(--text-3); }

/* ---------- Stats ---------- */
.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filters select { flex: 0 1 14rem; margin: 0; padding-block: .375rem; font-size: .875rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; margin-bottom: 1.5rem; }
.tile { background: var(--surface); padding: 1rem 1.25rem; display: flex; flex-direction: column; gap: .25rem; }
.tile .label { font-size: .8125rem; color: var(--text-2); }
.tile .value { font-size: 1.75rem; line-height: 1.1; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.tile .note { font-size: .8125rem; color: var(--text-3); }
@media (max-width: 800px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile .value { font-size: 1.375rem; } }
.panel-head { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.panel-head strong { font-weight: 500; }
.panel-head small { color: var(--text-3); }
.stats-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(min(16rem, 100%), 1fr); gap: 1rem; align-items: start; margin-bottom: 1.5rem; }
.stats-grid article { margin: 0; height: 100%; }
@media (max-width: 960px) { .stats-grid { grid-template-columns: 1fr; } }

.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: var(--bar); }
.chart .bar.hi { fill: var(--bar-hi); }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--line); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ref { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .axis { fill: var(--text-3); font-family: var(--mono); font-size: 11px; }
.chart .value { fill: var(--text-2); font-family: var(--mono); font-size: 11px; }
.chart .value.hi { fill: var(--text); }

/* Heures sup : liste classée avec barres fines. */
.ot-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 1rem; }
.ot-list > li { list-style: none; }
.ot-kid .dot { background: var(--seg); }
.ot-kid { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.ot-kid strong { font-weight: 500; }
.ot-kid .mono { margin-left: auto; color: var(--text); }
.ot-rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.ot-rows li { list-style: none; display: grid; grid-template-columns: 3.25rem minmax(0, 1fr) 3rem; align-items: center; gap: .5rem; font-family: var(--mono); font-size: 11px; color: var(--text-3); }
.ot-rows .track { display: block; height: 6px; background: var(--sunken); border-radius: 3px; overflow: hidden; }
.ot-rows .fill { display: block; height: 100%; background: var(--seg); border-radius: 3px; }
.ot-rows .v { text-align: right; color: var(--text-2); }
.ot-note { font-size: .8125rem; color: var(--text-3); margin: 1rem 0 0; }

.heat-wrap { overflow-x: auto; }
.chart.heat { min-width: 560px; }
.h0 { fill: var(--heat-0); } .h1 { fill: var(--heat-1); } .h2 { fill: var(--heat-2); } .h3 { fill: var(--heat-3); }
.h4 { fill: var(--heat-4); } .h5 { fill: var(--heat-5); } .h6 { fill: var(--heat-6); }
.chart.heat rect:hover { stroke: var(--text); stroke-width: 1.5; }
.legend { display: flex; align-items: center; gap: 4px; margin: .75rem 0 0; font-size: .8125rem; color: var(--text-3); }
.legend small { margin: 0 .25rem; }
.swatch { width: 20px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.h1 { background: var(--heat-1); } .swatch.h2 { background: var(--heat-2); } .swatch.h3 { background: var(--heat-3); }
.swatch.h4 { background: var(--heat-4); } .swatch.h5 { background: var(--heat-5); } .swatch.h6 { background: var(--heat-6); }
@media (max-width: 640px) { .chart .axis, .chart .value { font-size: 20px; } .chart.heat .axis { font-size: 12px; } }

/* ---------- Contrat : horaires prévus ---------- */
.schedule { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 0 .75rem; align-items: center; margin-top: .5rem; }
.schedule input { margin-bottom: .5rem; min-width: 0; padding-inline: .5rem; font-family: var(--mono); font-size: .875rem; }
.schedule-days { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.schedule-days label { margin: 0; display: inline-flex; align-items: center; padding: .25rem .625rem .25rem .375rem; border: 1px solid var(--line-strong); border-radius: var(--r); font-size: .875rem; }
.schedule-days label:has(:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.schedule-days input { margin: 0 .375rem 0 0; }
.schedule-box details { margin-top: 1rem; }
.schedule-tpl { grid-template-columns: 1fr 1fr; }
fieldset legend { color: var(--text); font-weight: 500; }
.narrow { max-width: 46rem; }
.day-kid .entry-row .label strong { display: none; }
.day-kid .ruler { margin-top: .5rem; }
.carry { margin-top: .75rem; } .carry button { margin: 0; }

/* Absences */
.tag-abs { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); white-space: nowrap; }
.absence-form { display: flex; flex-wrap: wrap; align-items: end; gap: .5rem .75rem; margin: .75rem 0 0; }
.absence-form label { flex: 1 1 14rem; margin: 0; font-size: .8125rem; color: var(--text-2); }
.absence-form select, .absence-form button { margin: 0; }
.absence-form button { width: auto; }
.assmat-absence { display: flex; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.assmat-absence button { margin: 0; width: auto; }
.cal-day .abs { font-size: 11px; color: var(--accent); }
.periods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .75rem; }
.periods input { margin: 0; }

/* Planning : jours sans accueil, absences, filtre, liste */
:root { --abs-nj: #c8412f; --abs-j: #d98a1e; --abs-am: #3f9a5c; --abs-cp: #4f7fd1; }
.cal-day.off { background: var(--bg); }
.cal-day.off .n { color: var(--text-3); }
.ruler.abs-non_justifiee, .abs-sample.abs-non_justifiee { background: repeating-linear-gradient(135deg, var(--abs-nj) 0 2px, color-mix(in srgb, var(--abs-nj) 18%, transparent) 2px 6px); }
.ruler.abs-justifiee, .abs-sample.abs-justifiee { background: repeating-linear-gradient(135deg, var(--abs-j) 0 2px, color-mix(in srgb, var(--abs-j) 18%, transparent) 2px 6px); }
.ruler.abs-assmat, .abs-sample.abs-assmat { background: repeating-linear-gradient(135deg, var(--abs-am) 0 2px, color-mix(in srgb, var(--abs-am) 18%, transparent) 2px 6px); }
.ruler.abs-conges, .abs-sample.abs-conges { background: repeating-linear-gradient(135deg, var(--abs-cp) 0 2px, color-mix(in srgb, var(--abs-cp) 18%, transparent) 2px 6px); }
.tag-abs.abs-conges { color: var(--abs-cp); background: color-mix(in srgb, var(--abs-cp) 14%, transparent); }
.abs-sample { display: inline-block; width: 18px; height: 10px; border-radius: 3px; }
.tag-abs.abs-non_justifiee { color: var(--abs-nj); background: color-mix(in srgb, var(--abs-nj) 14%, transparent); }
.tag-abs.abs-justifiee { color: var(--abs-j); background: color-mix(in srgb, var(--abs-j) 14%, transparent); }
.tag-abs.abs-assmat { color: var(--abs-am); background: color-mix(in srgb, var(--abs-am) 14%, transparent); }
.kid-toggle { all: unset; display: inline-flex; align-items: center; gap: .375rem; cursor: pointer; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-2); }
.kid-toggle:hover { border-color: var(--text-3); }
.kid-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.kid-toggle[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.seg-toggle { display: inline-flex; width: auto; margin: 0; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; box-shadow: none; }
.seg-toggle a { display: grid; place-items: center; height: 36px; padding: 0 .75rem; border-radius: 0; text-decoration: none; color: var(--text-2); font-size: .875rem; }
.seg-toggle a + a { border-left: 1px solid var(--line-strong); }
.seg-toggle a[aria-current="page"] { background: var(--raised); color: var(--text); }
.plist { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.prow { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 6.5rem; gap: .25rem 1rem; align-items: start; padding: .5rem 1rem; text-decoration: none; color: var(--text); }
.prow + .prow { border-top: 1px solid var(--line); }
.prow:hover { background: var(--raised); }
.prow.weekend, .prow.off { background: var(--bg); color: var(--text-3); }
.prow.today .pdate .mono { color: var(--accent); font-weight: 600; }
.pdate { display: flex; flex-direction: column; font-size: .875rem; }
.pdate .holiday { font-size: 11px; color: var(--accent); }
.pkids { display: flex; flex-direction: column; gap: 2px; font-size: .875rem; }
.pkid { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.pname { min-width: 7rem; }
.pworked { margin-left: auto; color: var(--text-2); }
.ptotal { text-align: right; font-size: .875rem; color: var(--text-2); }
.ptotal .ot { color: var(--accent); }
@media (max-width: 640px) {
  .prow { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .ptotal { grid-column: 2; text-align: left; }
  .pname { min-width: 0; }
}
#planning.hide-k1 .ruler.k1, #planning.hide-k1 .dot.k1, #planning.hide-k1 .pkid.k1 { display: none; }
#planning.hide-k2 .ruler.k2, #planning.hide-k2 .dot.k2, #planning.hide-k2 .pkid.k2 { display: none; }
#planning.hide-k3 .ruler.k3, #planning.hide-k3 .dot.k3, #planning.hide-k3 .pkid.k3 { display: none; }
#planning.hide-k4 .ruler.k4, #planning.hide-k4 .dot.k4, #planning.hide-k4 .pkid.k4 { display: none; }
#planning.hide-k5 .ruler.k5, #planning.hide-k5 .dot.k5, #planning.hide-k5 .pkid.k5 { display: none; }
#planning.hide-k6 .ruler.k6, #planning.hide-k6 .dot.k6, #planning.hide-k6 .pkid.k6 { display: none; }
#planning.hide-k7 .ruler.k7, #planning.hide-k7 .dot.k7, #planning.hide-k7 .pkid.k7 { display: none; }
#planning.hide-k8 .ruler.k8, #planning.hide-k8 .dot.k8, #planning.hide-k8 .pkid.k8 { display: none; }

/* Tous contrats et parts de salaire */
.all-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 1rem 2rem; align-items: start; }
.all-grid .hero { display: flex; flex-direction: column; gap: .25rem; }
.all-grid .hero .label { color: var(--text-2); font-size: .875rem; }
.all-grid .hero .value { color: var(--text); font-size: 2.75rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.all-grid .hero .note { color: var(--text-3); font-size: .8125rem; }
.all-grid dl { display: grid; grid-template-columns: 1fr auto; gap: .375rem 1rem; margin: 0; }
.all-grid dt { color: var(--text-2); font-weight: 400; }
.all-grid dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.share { margin-top: 1.25rem; }
.share-bar { display: flex; gap: 2px; height: 14px; }
.share-bar span { background: var(--seg); min-width: 2px; }
.share-bar span:first-child { border-radius: 4px 0 0 4px; }
.share-bar span:last-child { border-radius: 0 4px 4px 0; }
.share-bar span:only-child { border-radius: 4px; }
.share-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; padding: 0; margin: .625rem 0 0; font-size: .875rem; color: var(--text-2); }
.share-legend li { display: inline-flex; align-items: center; gap: .375rem; list-style: none; }
@media (max-width: 640px) { .all-grid { grid-template-columns: 1fr; } }
.chart.stack .seg { fill: var(--seg); }
.chart.stack .seg:hover { stroke: var(--text); stroke-width: 1.5; }
.share-title { margin: 0 0 .375rem; }
.with-info { display: flex; align-items: center; gap: .625rem; margin-right: auto; }
.with-info h1 { margin: 0; }
.info { position: relative; margin: 0; font-size: 1rem; font-weight: 400; letter-spacing: 0; }
.info summary { list-style: none; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.info summary::-webkit-details-marker, .info summary::after { display: none; }
.info summary:hover, .info[open] summary { color: var(--accent); border-color: var(--accent); }
.info-pop { position: absolute; z-index: 10; top: calc(100% + 8px); left: 0; width: min(28rem, calc(100vw - 32px)); padding: .75rem 1rem; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow); font-size: .875rem; line-height: 1.45; color: var(--text); }
.info-pop ul { margin: .375rem 0; padding-left: 1.1rem; }
.info-pop li { margin: 0; padding: .0625rem 0; list-style: disc; font-weight: 400; }
.info-pop small { display: block; }
@media (max-width: 640px) { .info-pop { position: fixed; top: 11.5rem; left: 16px; right: 16px; width: auto; } }

/* Zone de suppression */
.danger-zone { margin-top: 2.5rem; border-top: 1px solid var(--pico-muted-border-color); padding-top: 1rem; }
.danger-zone summary { color: var(--neg); }
button.danger { background: var(--neg); border-color: var(--neg); color: #fff; }

/* Menu Pointages (import / export) du Planning */
.io-menu { margin: 0; }
.io-menu > summary { padding: .35rem .8rem; height: auto; }
.io-menu ul li { direction: ltr; }
.ok { color: var(--pos); }

/* Simulation en fenêtre modale */
.sim-dialog > article { width: min(760px, 100%); max-width: 760px; max-height: 92vh; overflow-y: auto; }
.sim-table th, .sim-table td { text-align: right; white-space: nowrap; }
.sim-table th[scope=row], .sim-table thead th:first-child { text-align: left; white-space: normal; }
.sim-table .delta { color: var(--pico-muted-color); }
.avenant-box { margin-top: 1rem; border-top: 1px solid var(--pico-muted-border-color); padding-top: 1rem; }
.amend-list { list-style: none; padding: 0; }
.amend-list li { list-style: none; padding: .6rem 0; border-bottom: 1px solid var(--pico-muted-border-color); }
.amend-list form { display: inline; margin: 0; }
.amend-list button { padding: .2rem .6rem; margin: 0 0 0 .5rem; width: auto; }
.amend-changes { margin: .3rem 0 0; font-size: .9rem; }
.tag-future { font-size: .75rem; padding: .1rem .45rem; border-radius: 1rem; border: 1px solid var(--pico-muted-border-color); color: var(--pico-muted-color); margin-left: .4rem; }

/* Pointage : absence depuis la carte, heures en direct */
.card-abs { margin: .6rem 0 0; }
.card-abs summary { font-size: .9rem; color: var(--pico-muted-color); }
.abs-choices { display: flex; gap: .5rem; margin-top: .5rem; }
.abs-choices button, .card-abs-cancel { flex: 1; margin: .5rem 0 0; padding: .4rem .6rem; font-size: .9rem; }
.card-abs-cancel { width: 100%; }
.inline-form { display: inline; margin: 0; }
.inline-form button { margin: 0; width: auto; }
.live-worked::before { content: ""; display: inline-block; width: .5em; height: .5em; border-radius: 50%; background: var(--pos); margin-right: .35em; vertical-align: middle; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-worked::before { animation: none; } }
.danger-outline { color: var(--neg); border-color: var(--neg); }
.dialog-actions { display: flex; gap: .75rem; justify-content: flex-end; }
.dialog-actions button { width: auto; margin: 0; }

/* Boutons d'action de la fiche : même hauteur, sur une ligne, sans marge Pico. */
.sheet-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.sheet-actions > a[role="button"], .sheet-actions > button {
  flex: 1 1 11rem; margin: 0; display: inline-flex; align-items: center; justify-content: center;
  text-align: center; line-height: 1.25; padding: .7rem 1rem; font-size: .95rem;
}
.sheet-actions > .danger-outline { flex: 0 1 auto; margin-left: auto; }
#leave-dialog > article { width: min(520px, 100%); }

/* Simulateur */
.sim-tabs { display: flex; flex-wrap: wrap; margin-bottom: .5rem; }
.sim-pick { margin-bottom: 1.5rem; }
.sim-scenarios { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr)); gap: 1rem; }
.sim-scenarios fieldset { border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius); padding: 1rem; }
.sim-page { max-width: 60rem; }
.table-scroll { overflow-x: auto; }
.end-table td { white-space: normal; min-width: 10rem; }
.history-table .salary-input { margin: 0; max-width: 9rem; text-align: right; padding: .3rem .6rem; height: auto; display: inline-block; }
.history-table tr.unpointed th { color: var(--pico-muted-color); }
.tag-todo { font-size: .75rem; color: var(--neg); border: 1px solid currentColor; border-radius: 999px; padding: .05rem .5rem; margin-left: .5rem; }
.salary-note { margin-bottom: 1.5rem; }
#salary-dialog > article { width: min(480px, 100%); }
.history-table td, .history-table th { vertical-align: middle; }
.start-box .start-date { display: none; }
.start-box:has(input[value="passe"]:checked) .start-date { display: block; }
.start-box > label:not(.start-date) { display: inline-flex; margin-right: 1.5rem; }
.warn-inline { color: var(--neg); }
.salary-cell { display: flex; align-items: center; gap: .75rem; }
.salary-cell small { white-space: nowrap; margin: 0; line-height: 1; }

/* Stats : salaire net */
.chip-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.chip-filter a { padding: .2rem .75rem; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .85rem; color: var(--text-2); text-decoration: none; }
.chip-filter a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--bg, #111); }
.salary-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.salary-bars .chart.stack { max-height: 320px; }
.salary-pie { display: flex; flex-direction: column; align-items: center; }
.chart.pie { max-width: 220px; }
.chart.pie .seg { fill: var(--seg); stroke: var(--surface, var(--pico-background-color)); stroke-width: 2; }
.chart.pie .seg:hover { opacity: .85; }
.chart.pie .pct { fill: #fff; font-family: var(--mono); font-size: 12px; font-weight: 600; }
.chart.pie .total { fill: var(--text); font-family: var(--mono); font-size: 16px; font-weight: 600; }
.pie-legend { flex-direction: column; align-items: flex-start; }
@media (max-width: 760px) { .salary-grid { grid-template-columns: 1fr; } }

/* Boutons de formulaire : même hauteur, Annuler à gauche. */
.form-actions { display: flex; gap: .75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.form-actions > a[role="button"], .form-actions > button { margin: 0; width: auto; min-width: 9rem; display: inline-flex; align-items: center; justify-content: center; line-height: 1.25; padding: .7rem 1.25rem; }
/* Profil */
.nav-profile { display: inline-flex !important; align-items: center; }
.profile-tiles { margin-bottom: .75rem; }
.profile-kids { margin-bottom: .5rem; }
.profile-h2 { font-size: 1.15rem; margin-top: 2rem; }
.chip-filter { justify-content: flex-start; }
.chart.pie .axis { font-size: 11px !important; }
@media (max-width: 760px) { .chart.pie { max-width: 180px; } .chart.pie .pct { font-size: 12px !important; } }
@media (max-width: 640px) {
  .topbar nav ul:last-child { overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .topbar nav ul:last-child a { padding: .375rem .5rem; font-size: .875rem; white-space: nowrap; }
}
.brand-accent { color: var(--accent); }
.brand-mark { flex: none; }

/* Adresse avec complétion */
.address { position: relative; }
.address-suggest {
  position: absolute; z-index: 20; left: 0; right: 0; margin: -0.6rem 0 0; padding: 0.25rem 0;
  list-style: none; background: var(--pico-card-background-color); color: var(--pico-color);
  border: 1px solid var(--pico-muted-border-color); border-radius: var(--pico-border-radius);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.12);
}
.address-suggest li { margin: 0; padding: 0.45rem 0.75rem; cursor: pointer; list-style: none; }
.address-suggest li:hover, .address-suggest li.active { background: color-mix(in srgb, var(--pico-primary) 14%, transparent); }
.address-town { grid-template-columns: 8rem 1fr; }
@media (max-width: 767px) { .address-town { grid-template-columns: 8rem 1fr; display: grid; } }
.check-row { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin-bottom: 0.75rem; }
details.parent2 { margin-bottom: var(--pico-spacing); }
.doc-groups fieldset { margin-bottom: 0.75rem; }
.doc-groups legend { font-weight: 600; font-size: 0.95rem; }
.doc-groups label { font-size: 0.95rem; }
.doc-groups label { display: flex; align-items: flex-start; gap: 0.1rem; }
.doc-groups label input { flex: none; margin-top: 0.2rem; }
input[data-weekly][readonly] { background: var(--pico-form-element-disabled-background-color, transparent); cursor: default; }
:root { --abs-ad: #8a5cc2; }
.ruler.abs-adaptation { background: color-mix(in srgb, var(--abs-ad) 12%, transparent); }
.abs-sample.abs-adaptation { background: color-mix(in srgb, var(--abs-ad) 45%, transparent); }
.tag-abs.abs-adaptation { color: var(--abs-ad); background: color-mix(in srgb, var(--abs-ad) 14%, transparent); }
.declare-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.declare-row form { display: flex; align-items: center; gap: .5rem; margin: 0; }
.declare-row button, .declare-row [role=button] { margin: 0; }
.tag-done { display: inline-block; padding: .15rem .5rem; border-radius: 999px; font-size: .85rem; color: #2f7d4a; background: color-mix(in srgb, #2f7d4a 14%, transparent); }
.vacances { margin-bottom: .75rem; }
.vacances button { width: auto; margin-bottom: .25rem; }
.vacances-result { display: block; }
.backup details { margin-top: 1rem; }
.access header { display: flex; flex-wrap: wrap; gap: .25rem .5rem; align-items: baseline; }
.access form + form { margin-top: .5rem; }
.notice { border-left: 4px solid var(--accent); }
.notice p { margin-bottom: .5rem; }
.notice-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .25rem; }
.notice-actions button { width: auto; margin: 0; padding: .35rem .8rem; font-size: .9rem; }

/* Navigation mobile : barre d'onglets en bas, en-tête réduit au logo et au profil. */
.tabbar { display: none; }
.menu-list { list-style: none; padding: 0; margin: 0 0 1.5rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); }
.menu-list li { list-style: none; margin: 0; border-bottom: 1px solid var(--line); }
.menu-list li:last-child { border-bottom: 0; }
.menu-list a { display: flex; flex-direction: column; gap: .1rem; padding: .875rem 1rem; min-height: 44px; color: var(--text); text-decoration: none; }
.menu-list small { color: var(--text-2); }
@media (max-width: 640px) {
  .topbar { padding: 4px 0; }
  .topbar nav { flex-wrap: nowrap; min-height: 48px; }
  .topbar nav ul, .topbar nav li { padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; }
  .topbar nav ul:first-child { display: flex; }
  .topbar nav ul:last-child { width: auto; overflow: visible; }
  .topbar nav ul:last-child li:not(.profile-li) { display: none; }
  .topbar nav ul:last-child a.nav-profile { padding: .5rem; min-width: 44px; min-height: 44px; justify-content: center; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    background: var(--bg); border-top: 1px solid var(--line);
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-height: 48px; padding: 4px 0; border-radius: var(--r);
    color: var(--text-2); text-decoration: none; font-size: .6875rem;
  }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar a[aria-current=page] { color: var(--accent); font-weight: 600; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media print { .tabbar { display: none !important; } }

/* Fiche enfant : sections repliables, boutons toujours accessibles. */
.form-section { border: 1px solid var(--line); border-radius: var(--r); background: var(--raised); margin-bottom: .75rem; padding: 0 1rem; }
.form-section > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .5rem; min-height: 48px; padding: .75rem 0; margin: 0; }
.form-section > summary small { font-size: .8125rem; }
.form-section > summary::after { margin-left: auto; align-self: center; float: none; }
.form-section[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.form-section > fieldset:last-child, .form-section > details:last-child { margin-bottom: 1rem; }
.form-sticky { position: sticky; bottom: 0; z-index: 5; background: var(--bg); padding: .75rem 0; border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .form-sticky { bottom: calc(57px + env(safe-area-inset-bottom)); }
  .form-sticky > a[role="button"], .form-sticky > button { flex: 1; min-width: 0; }
}

/* Écrans tactiles : cibles d'au moins 44 px. */
@media (pointer: coarse), (max-width: 640px) {
  summary { min-height: 44px; display: flex; align-items: center; }
  summary::after { margin-left: auto; float: none; }
  details.info > summary { display: grid; width: 32px; height: 32px; min-height: 32px; }
  input[type=checkbox], input[type=radio] { width: 1.375rem; height: 1.375rem; }
  label:has(> input[type=checkbox]), label:has(> input[type=radio]) { min-height: 44px; display: flex; align-items: center; gap: .5rem; }
  p > a:only-child, .narrow > p:first-child > a { display: inline-flex; align-items: center; min-height: 44px; }
  .stepper a { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .io-menu ul li a { min-height: 44px; display: flex; align-items: center; }
  .chip-filter a { min-height: 40px; display: inline-flex; align-items: center; }
}
/* Liste des enfants : toute la ligne ouvre la fiche. */
.child-list li { position: relative; }
.child-list li > a[href$="/fiche"]::after { content: ""; position: absolute; inset: 0; }
.child-list li > .tag-todo { position: relative; z-index: 1; }
/* Menu du compte (icône profil), façon LinkedIn. */
.profile-li { position: relative; list-style: none; display: flex; align-items: center; }
.profile-li::marker { content: ""; }
.topbar details.profile-menu { margin: 0; padding: 0; border: 0; }
.topbar .profile-menu > summary { margin: 0; line-height: 1.2; }
.profile-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: .15rem; min-height: 36px; padding: .375rem .625rem; border-radius: var(--r); color: var(--text-2); cursor: pointer; }
.profile-menu > summary::-webkit-details-marker, .profile-menu > summary::after { display: none; }
.profile-menu > summary:hover, .profile-menu[open] > summary { background: var(--raised); color: var(--text); }
.profile-menu .caret { font-size: .7rem; }
.profile-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 280px; padding: .75rem; background: var(--surface); border: 1px solid var(--line); border-radius: calc(var(--r) * 1.5); box-shadow: 0 8px 28px rgba(0,0,0,.14); display: flex; flex-direction: column; }
.profile-pop a:not([role=button]), .profile-pop form button { display: flex; align-items: center; min-height: 40px; padding: .25rem .5rem; margin: 0; border: 0; border-radius: var(--r); background: none; color: var(--text); text-decoration: none; font-size: .9375rem; text-align: left; width: 100%; }
.profile-pop a:not([role=button]):hover, .profile-pop form button:hover { background: var(--raised); }
.profile-pop form { margin: 0; }
.profile-pop form button { color: var(--text-2); }
.profile-pop hr { margin: .5rem 0; }
.pm-head { display: flex; gap: .75rem; align-items: center; padding: .25rem .25rem .75rem; }
.pm-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 600; font-size: 1.1rem; }
.pm-id { display: flex; flex-direction: column; min-width: 0; }
.pm-id small { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-view { margin: 0 0 .5rem; padding: .4rem; font-size: .875rem; border-radius: 999px; }
.pm-title { margin: .5rem .5rem .25rem; font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-2); }
@media (max-width: 640px) {
  .topbar nav ul:last-child li.profile-li { display: block; }
  .profile-menu > summary { min-width: 44px; min-height: 44px; justify-content: center; }
  .profile-pop { position: fixed; top: 56px; right: 8px; left: 8px; width: auto; }
}

/* Invitation par QR code */
.invite-qr .qr { display: flex; justify-content: center; margin: 1rem 0; }
.invite-qr .qr svg { width: min(240px, 70vw); height: auto; border-radius: .5rem; }
.access form { margin-bottom: .5rem; }
.install-card { border-left: 4px solid var(--pico-primary); }
@media (max-width: 480px) {
  /* Valeurs longues (fiche contrat) : plus de place pour la colonne de droite. */
  .recap.sheet dl { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); }
  .recap dt, .recap dd { hyphens: auto; }
  /* Heures : l'icône horloge masquait la fin de l'heure. */
  input[type="time"] { padding-inline: .5rem !important; background-image: none !important; }
  input[type="time"]::-webkit-calendar-picker-indicator { display: none; }
  /* Onglets du simulateur : grille 2 × 2 au lieu de lignes inégales. */
  .sim-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .sim-tabs a + a { border-left: 0; }
  .sim-tabs a:nth-child(even) { border-left: 1px solid var(--line-strong); }
  .sim-tabs a:nth-child(n+3) { border-top: 1px solid var(--line-strong); }
}

/* Espace parent */
.assmat-group > article { margin-bottom: 1rem; }
.cal-day:not([href]), .prow:not([href]), .cal-wk:not([href]) { cursor: default; }
