:root {
  --ink: #17262D; --muted: #4A5A62; --line: #DCE2E4; --line-soft: #EDF0F1;
  --ground: #F4F6F6; --card: #FFFFFF; --brand: #1F4E5F; --brand-soft: #DFEEF1;
  --ok: #0F5566; --ok-bg: #DFEEF1; --warn: #7A5200; --warn-bg: #FAEFD2;
  --bad: #A32F0A; --bad-bg: #FBE4DB; --na: #4A5560; --na-bg: #E8EBEC;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 14px/1.45 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; }
h1 { margin: 0; font-size: 20px; } h2 { margin: 0; font-size: 16px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
main:focus { outline: none; }

#banner:not(:empty) { background: var(--warn-bg); color: #5F4000; padding: 8px 24px; font-size: 13px; font-weight: 500; }
.top { background: var(--brand); color: #fff; padding: 12px 24px; display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: center; justify-content: space-between; }
.top-title { font-size: 18px; font-weight: 700; }
.top-sub { font-size: 13px; color: #D5E5EA; }
#nav { display: flex; flex-wrap: wrap; gap: 4px; }
#nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 6px; color: #fff; font-weight: 600; text-decoration: none; }
#nav a[aria-current="page"] { background: #fff; color: var(--brand); }
#nav a:focus-visible { outline-color: #fff; }
#account { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
#account button { min-height: 44px; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: #fff; text-decoration: underline; }
#account button:focus-visible { outline-color: #fff; }
#lang { display: flex; gap: 2px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 6px; padding: 2px; }
#lang button { min-height: 40px; min-width: 44px; padding: 4px 10px; border: 0; border-radius: 4px; background: none; color: #fff; font-size: 13px; font-weight: 600; }
#lang button[aria-pressed="true"] { background: #fff; color: var(--brand); }
#lang button:focus-visible { outline-color: #fff; }
.auth { max-width: 420px; width: 100%; margin: 24px auto; }
.auth .form { display: flex; flex-direction: column; gap: 12px; }

main { max-width: 1360px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.page-note { padding: 10px 14px; border-left: 4px solid var(--brand); border-radius: 4px; background: var(--brand-soft); }
.guide summary { cursor: pointer; font-size: 16px; font-weight: 700; min-height: 28px; }
.guide-body { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 28px; margin-top: 12px; }
.guide h3 { margin: 0 0 6px; font-size: 14px; }
.guide p, .guide ul { margin: 0; }
.guide ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.muted { color: var(--muted); } .small { font-size: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; }
.split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.split > .wide { flex: 999 1 640px; } .split > .narrow { flex: 1 1 320px; }
.scroll { overflow-x: auto; }

.weeks { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 4px; }
.week { padding: 8px 10px; border-radius: 4px; background: var(--line-soft); }
.week.past { background: var(--brand-soft); } .week.now { background: var(--brand); color: #fff; }
.week b { display: block; } .week span { font-size: 12px; }

.verdict { border-radius: 8px; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: center; justify-content: space-between; }
.verdict .big { font-size: 22px; font-weight: 700; }
.verdict.extension { background: var(--ok-bg); color: #0F4552; }
.verdict.ajustements, .verdict.preuve { background: var(--warn-bg); color: #5F4000; }
.verdict.arret { background: var(--bad-bg); color: #7D2306; }
.verdict.attente { background: var(--na-bg); color: #333F46; }

.family { display: flex; flex-direction: column; gap: 8px; }
.family h2 { font-size: 14px; font-weight: 600; color: #3B4C54; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-head { display: flex; gap: 8px; justify-content: space-between; align-items: flex-start; font-weight: 500; }
.tile-value { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }

.chip { white-space: nowrap; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 4px; }
.s-ok { color: var(--ok); } .s-warn { color: var(--warn); } .s-bad { color: var(--bad); } .s-na, .s-nd, .s-info { color: var(--na); }
.chip.s-ok { background: var(--ok-bg); } .chip.s-warn { background: var(--warn-bg); } .chip.s-bad { background: var(--bad-bg); } .chip.s-na, .chip.s-nd, .chip.s-info { background: var(--na-bg); }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 8px 8px 0; border-bottom: 1px solid var(--line); vertical-align: bottom; }
td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
td .small { display: block; font-weight: 400; color: var(--muted); }
.table-wide { min-width: 720px; }

a.link { color: var(--brand); font-weight: 700; }
.btn { min-height: 44px; padding: 8px 14px; border-radius: 6px; font-weight: 600; border: 1px solid var(--brand); background: #fff; color: var(--brand); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.quiet { border-color: #C5CED1; font-weight: 500; }
.btn:disabled { background: var(--line); border-color: var(--line); color: var(--na); cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; }

.action { text-align: left; display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.action:hover { border-color: var(--brand); }
.action b { display: block; }

.entries { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.entry { text-align: left; min-height: 72px; padding: 12px 14px; border: 1px solid var(--brand); border-radius: 8px; background: #fff; color: var(--ink); }
.entry b { display: block; color: var(--brand); }
.entry span { display: block; font-size: 13px; color: var(--muted); }
.entry.danger { border-color: var(--bad); } .entry.danger b { color: var(--bad); }
.entry:hover:not(:disabled) { background: #EEF5F7; }
.entry:disabled { border-color: var(--line); background: var(--line-soft); cursor: not-allowed; }
.entry:disabled b { color: var(--na); }
.notice { padding: 10px 12px; border-radius: 6px; background: var(--warn-bg); color: #5F4000; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.filters label { display: flex; flex-direction: column; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.filters select { min-height: 44px; padding: 6px 8px; border: 1px solid #A9B5BA; border-radius: 6px; background: #fff; color: var(--ink); }
td .btns { flex-wrap: nowrap; }

.alert-row { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.alert-row > div:first-child { flex: 1 1 280px; min-width: 0; }
.alert-title { font-weight: 600; }

.heat { min-width: 480px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.heat div { text-align: center; }
.heat .h { font-size: 12px; font-weight: 600; color: var(--muted); }
.heat .c { padding: 10px 2px; border-radius: 4px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.c.hi { background: var(--brand); color: #fff; } .c.mid { background: #CFE3E8; color: #0F3442; }
.c.lo { background: #E9B9A5; color: #5C1B04; } .c.none { background: var(--ground); color: #5A6A72; }

.fiche div { display: flex; gap: 12px; justify-content: space-between; padding: 7px 0; border-top: 1px solid var(--line-soft); }
.fiche strong { text-align: right; }

.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.outcome { padding: 14px 16px; border-radius: 6px; border: 1px solid var(--line); }
.outcome.on { border: 2px solid var(--brand); background: #EEF5F7; }
.outcome b { display: block; }

dialog { border: 0; border-radius: 10px; padding: 0; width: min(480px, calc(100vw - 24px)); color: var(--ink); }
dialog::backdrop { background: rgba(10, 25, 32, .45); }
.form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.form label, .form fieldset { display: flex; flex-direction: column; gap: 4px; font-weight: 600; border: 0; padding: 0; margin: 0; }
.form input:not([type=radio]):not([type=checkbox]), .form select, .form textarea { width: 100%; min-height: 44px; padding: 8px 10px; border: 1px solid #A9B5BA; border-radius: 6px; background: #fff; font-weight: 400; }
.form .hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.form .choices { display: flex; flex-direction: column; gap: 6px; }
.form .choices label { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border: 1px solid #A9B5BA; border-radius: 6px; font-weight: 500; cursor: pointer; }
.form .choices label:has(input:checked) { border-color: var(--brand); background: #EEF5F7; }
.form-error { color: var(--bad); font-weight: 600; }
.form[data-state="hide"] { display: none; }
.hidden { display: none !important; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 6px; max-width: calc(100vw - 32px); }
#toast:empty { display: none; }

@media (max-width: 640px) {
  main { padding: 16px; gap: 16px; }
  .top, #banner:not(:empty) { padding-left: 16px; padding-right: 16px; }
  #nav { width: 100%; }
  #nav a { flex: 1 1 40%; justify-content: center; padding: 8px; }
  .alert-row .btns, .alert-row .btns .btn { width: 100%; }
}
@media print {
  .top nav, .btn, #banner { display: none; }
}
