/* =====================================================================
   Couleurs du Luxembourg : rouge #EF3340, blanc, bleu ciel #00A3E0.
   Teintes vives réservées au décor (filet, graduation) ; teintes foncées
   pour le texte et les boutons afin de respecter le contraste WCAG AA.
   Style : instrument de mesure. Aplats, filets fins, chiffres à rouleaux.
   ===================================================================== */
:root {
  color-scheme: light;
  --lu-red: #ef3340;
  --lu-blue: #00a3e0;

  --bg: #f2f3f5;
  --surface: #ffffff;
  --surface-2: #f2f3f5;
  --text: #121417;
  --muted: #555c66;
  --border: #d5d9df;
  --rule: #e6e8ec;

  --accent: #00699a; /* bleu ciel foncé : 5,9:1 sur blanc */
  --accent-text: #ffffff;
  --accent-soft: #e3f3fa;

  --ok: #1b7a3d;
  --ok-fill: #23a050;
  --ok-soft: #e6f4ea;
  --warn: #8c4a00;
  --warn-fill: #e08a00;
  --warn-soft: #fdf1df;
  --danger: #c1121f; /* rouge drapeau foncé : 6,1:1 sur blanc */
  --danger-fill: #ef3340;
  --danger-soft: #fde8ea;

  --drum-bg: #16191d;
  --drum-text: #ffffff;
  --tick-off: #e2e5e9;

  --tw: #00699a;
  --tw-text: #ffffff;
  --tc: #22305a;
  --tc-text: #ffffff;
  --off: #e2e5e9;
  --off-text: #2b2f35;

  --radius: 8px;
  --radius-sm: 6px;
  --tabbar-h: 64px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Roboto Mono', 'Cascadia Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --bg: #0d0f12;
    --surface: #16191d;
    --surface-2: #1d2126;
    --text: #eef0f2;
    --muted: #a3aab4;
    --border: #2c3138;
    --rule: #23272d;
    --accent: #4cc3f0;
    --accent-text: #06121a;
    --accent-soft: #0f2a38;
    --ok: #6fd896;
    --ok-fill: #3cbf6b;
    --ok-soft: #12261a;
    --warn: #f5c060;
    --warn-fill: #f0a020;
    --warn-soft: #2e2210;
    --danger: #ff7b84;
    --danger-soft: #34151a;
    --drum-bg: #000000;
    --tick-off: #2c3138;
    --tw: #4cc3f0;
    --tw-text: #06121a;
    --tc: #9fb0e6;
    --tc-text: #0b1020;
    --off: #2c3138;
    --off-text: #eef0f2;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #16191d;
  --surface-2: #1d2126;
  --text: #eef0f2;
  --muted: #a3aab4;
  --border: #2c3138;
  --rule: #23272d;
  --accent: #4cc3f0;
  --accent-text: #06121a;
  --accent-soft: #0f2a38;
  --ok: #6fd896;
  --ok-fill: #3cbf6b;
  --ok-soft: #12261a;
  --warn: #f5c060;
  --warn-fill: #f0a020;
  --warn-soft: #2e2210;
  --danger: #ff7b84;
  --danger-soft: #34151a;
  --drum-bg: #000000;
  --tick-off: #2c3138;
  --tw: #4cc3f0;
  --tw-text: #06121a;
  --tc: #9fb0e6;
  --tc-text: #0b1020;
  --off: #2c3138;
  --off-text: #eef0f2;
}

/* ===== Base ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  min-height: 100dvh;
}
/* Filet tricolore discret en haut d'écran */
body::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--lu-red) 0 33.3%, #fff 33.3% 66.6%, var(--lu-blue) 66.6%);
  border-bottom: 1px solid var(--border);
}
h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1rem;
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--accent);
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 8px;
  z-index: 100;
  background: var(--surface);
  padding: 8px 12px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

/* ===== Structure ===== */
.topbar {
  padding: calc(10px + env(safe-area-inset-top)) 16px 6px;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.brand {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}
.topbar-date {
  font-size: 0.8125rem;
  color: var(--muted);
}
.topbar-date::first-letter {
  text-transform: uppercase;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 16px 16px;
  outline: none;
}
.disclaimer {
  max-width: 560px;
  margin: 0 auto;
  padding: 4px 16px 24px;
  font-size: 0.8125rem;
  color: var(--muted);
}
.disclaimer a {
  color: inherit;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 20;
}
.tabbar a {
  position: relative;
  min-height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.tabbar .ico {
  display: grid;
  place-items: center;
}
.tabbar svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tabbar a[aria-current='page'] {
  color: var(--accent);
}
.tabbar a[aria-current='page']::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 25%;
  right: 25%;
  height: 3px;
  background: var(--accent);
}
.tabbar.hidden {
  display: none;
}

/* ===== Composants ===== */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}
.eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.875rem;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.section-title h3 {
  margin: 0;
}
.chip-ico {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--accent);
}
.chip-ico svg,
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.btn:hover {
  border-color: var(--muted);
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.btn.danger {
  color: var(--danger);
  border-color: currentColor;
  background: transparent;
}
.btn.block {
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-row .btn {
  flex: 1 1 140px;
}

/* ===== Compteur (accueil) ===== */
.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 14px;
}
.meter-head .eyebrow {
  margin: 0;
}
.meter-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.odometer {
  display: inline-flex;
  gap: 3px;
  padding: 4px;
  background: var(--drum-bg);
  border-radius: 6px;
  flex: none;
}
.drum {
  width: 46px;
  height: 64px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--drum-text);
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 30%, transparent 70%, rgba(255, 255, 255, 0.06)),
    #23272d;
  position: relative;
}
.drum::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.45);
}
.drum.dim {
  color: #6b727c;
}
.level-exceeded .drum {
  color: #ff8a92;
}
.meter-of {
  font-size: 0.9375rem;
  color: var(--muted);
  line-height: 1.2;
  padding-bottom: 4px;
}
.meter-of .mono {
  color: var(--text);
  font-size: 1.375rem;
  font-weight: 700;
}
.meter-left {
  margin-left: auto;
  text-align: right;
  padding-bottom: 4px;
  line-height: 1.15;
}
.meter-left .mono {
  display: block;
  font-size: 1.75rem;
  font-weight: 700;
}
.meter-left span:last-child {
  font-size: 0.8125rem;
  color: var(--muted);
}

/* Graduation : un trait par jour du quota, zones verte / orange / rouge */
.ticks {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  height: 22px;
  margin: 16px 0 4px;
  align-items: end;
}
.ticks i {
  display: block;
  height: 14px;
  background: var(--tick-off);
}
.ticks i.major {
  height: 22px;
}
.ticks i.on.z1 {
  background: var(--ok-fill);
}
.ticks i.on.z2 {
  background: var(--warn-fill);
}
.ticks i.on.z3 {
  background: var(--danger-fill);
}
.ticks-scale {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.6875rem;
  color: var(--muted);
}
.meter-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 10px 0 0;
}

.alert {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 0.9375rem;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-left: 4px solid currentColor;
}
.alert strong {
  display: block;
}
.alert .dot {
  display: none;
}
.alert > div,
.alert > span {
  color: var(--text);
}
.alert.green {
  background: var(--ok-soft);
  color: var(--ok);
}
.alert.orange {
  background: var(--warn-soft);
  color: var(--warn);
}
.alert.red,
.alert.exceeded {
  background: var(--danger-soft);
  color: var(--danger);
}
.alert.info {
  background: var(--accent-soft);
  color: var(--accent);
}
.alert.green strong {
  color: var(--ok);
}
.alert.orange strong {
  color: var(--warn);
}
.alert.red strong,
.alert.exceeded strong {
  color: var(--danger);
}

.quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.quick .btn {
  min-height: 52px;
  justify-content: flex-start;
}
.quick .btn svg {
  color: var(--tw);
}
.quick .btn.tc svg {
  color: var(--tc);
}
.quick .btn[aria-pressed='true'].tw {
  background: var(--tw);
  border-color: var(--tw);
  color: var(--tw-text);
}
.quick .btn[aria-pressed='true'].tc {
  background: var(--tc);
  border-color: var(--tc);
  color: var(--tc-text);
}
.quick .btn[aria-pressed='true'] svg {
  color: inherit;
}

.projection .big {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 700;
}
.mini-bar {
  position: relative;
  height: 8px;
  background: var(--tick-off);
  margin: 10px 0 6px;
}
.mini-bar > span {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
}
.mini-bar > span.proj {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, transparent 3px 6px);
  opacity: 0.6;
}
.mini-bar > i {
  position: absolute;
  top: -5px;
  bottom: -5px;
  width: 2px;
  background: var(--danger-fill);
}
.mini-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: var(--mono);
}

.ss-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ss-pct {
  font-family: var(--mono);
  font-size: 1.625rem;
  font-weight: 700;
}
.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.tag.ok {
  background: var(--ok-soft);
  color: var(--ok);
}
.tag.warning {
  background: var(--warn-soft);
  color: var(--warn);
}
.tag.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

/* ===== Calendrier ===== */
.cal-card {
  padding: 12px 10px;
}
.month-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.month-nav h2 {
  margin: 0;
  font-size: 1.0625rem;
}
.month-nav h2::first-letter {
  text-transform: uppercase;
}
.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}
.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.brushes {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 2px 4px;
  margin-bottom: 8px;
  scrollbar-width: none;
}
.brushes button {
  flex: none;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.brushes button[aria-pressed='true'] {
  background: var(--text);
  color: var(--surface);
  border-color: var(--text);
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
  flex: none;
}
.swatch.tw {
  background: var(--tw);
}
.swatch.tc {
  background: var(--tc);
}
.swatch.off {
  background: var(--off);
  border: 1px solid var(--muted);
}
.swatch.none {
  background: transparent;
  border: 1px dashed var(--muted);
}
.weekdays,
.grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
.weekdays {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
  font-weight: 700;
}
.day {
  position: relative;
  min-width: 0;
  height: 50px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.9375rem;
}
.day .t {
  font-family: var(--font);
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 2px;
}
.day .note-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  background: var(--lu-red);
  box-shadow: 0 0 0 1.5px var(--surface);
}
.day.weekend {
  background: var(--surface-2);
  color: var(--muted);
}
.day.today {
  box-shadow: inset 0 0 0 2px var(--text);
}
.day.tw {
  background: var(--tw);
  color: var(--tw-text);
  border-color: var(--tw);
}
.day.tc {
  background: var(--tc);
  color: var(--tc-text);
  border-color: var(--tc);
}
.day.off {
  background: repeating-linear-gradient(135deg, var(--off) 0 4px, var(--surface-2) 4px 8px);
  color: var(--off-text);
  border-color: var(--border);
}
.day:disabled {
  opacity: 0.35;
  cursor: default;
}
.day.blank {
  visibility: hidden;
}
.month-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 12px 4px 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.month-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cal-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.cal-actions .btn {
  flex: 1;
}

/* Feuilles (dialogues en bas d'écran) */
dialog.sheet {
  border: none;
  border-top: 4px solid var(--accent);
  padding: 0;
  margin: auto auto 0;
  width: 100%;
  max-width: 560px;
  max-height: 92dvh;
  border-radius: 10px 10px 0 0;
  background: var(--surface);
  color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}
dialog.sheet::backdrop {
  background: rgba(10, 12, 15, 0.5);
}
.sheet-inner {
  padding: 14px 16px 16px;
}
.sheet-inner h3 {
  font-size: 1.0625rem;
}
.sheet-inner h3::first-letter {
  text-transform: uppercase;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
}
.choice .swatch {
  width: 18px;
  height: 18px;
}
.choice[aria-current='true'] {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
}
.choice small {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}
.weekday-pick {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}
.weekday-pick label {
  position: relative;
  margin: 0;
}
.weekday-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.weekday-pick span {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
}
.weekday-pick input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.weekday-pick input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.preview-count {
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  font-size: 0.9375rem;
  margin-bottom: 12px;
}

/* ===== Formulaires ===== */
.field {
  margin-bottom: 16px;
}
.field label,
.field legend {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.field .hint {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 4px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.field textarea {
  resize: vertical;
  min-height: 64px;
}
.field input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 6px;
  font-size: 0.9375rem;
}
.row-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}
fieldset {
  border: none;
  padding: 0;
  margin: 0;
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.segmented.four {
  grid-template-columns: repeat(2, 1fr);
}
.segmented label {
  margin: 0;
  position: relative;
}
.segmented input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.segmented input + span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
  text-align: center;
}
.segmented input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.segmented input:focus-visible + span {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.field .switch,
.switch {
  display: flex;
  margin-bottom: 0;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  font-weight: 600;
  cursor: pointer;
}
.switch input {
  width: 22px;
  height: 22px;
  min-height: 0;
  flex: none;
  accent-color: var(--accent);
}
.errors {
  color: var(--danger);
  background: var(--danger-soft);
  border-left: 4px solid currentColor;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.errors ul {
  margin: 0;
  padding-left: 18px;
}

/* ===== À propos / récap ===== */
.sources {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sources li {
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  font-size: 0.9375rem;
}
.sources li:first-child {
  border-top: none;
}
.sources .meta {
  display: block;
  font-size: 0.8125rem;
  color: var(--muted);
}
.table-wrap {
  overflow-x: auto;
  margin: 0 -4px;
}
table.recap {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
table.recap td {
  font-family: var(--mono);
}
table.recap th,
table.recap td {
  padding: 7px 6px;
  text-align: right;
  border-bottom: 1px solid var(--rule);
}
table.recap th:first-child,
table.recap td:first-child {
  text-align: left;
  text-transform: capitalize;
  font-family: var(--font);
}
table.recap thead th {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  border-bottom: 2px solid var(--text);
}
table.recap tfoot td {
  font-weight: 800;
  border-top: 2px solid var(--text);
  border-bottom: none;
}
.day-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}
.day-list li {
  display: flex;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.day-list li:first-child {
  border-top: none;
}
.day-list .d {
  flex: none;
  width: 7.5em;
  font-family: var(--mono);
  font-size: 0.8125rem;
}
.day-list .swatch {
  align-self: center;
}
.recap-head dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0;
  font-size: 0.9375rem;
}
.recap-head dt {
  color: var(--muted);
}
.recap-head dd {
  margin: 0;
  font-weight: 600;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom));
  max-width: 528px;
  margin: 0 auto;
  background: var(--text);
  color: var(--surface);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  z-index: 30;
}

.print-only {
  display: none;
}

@media (max-width: 400px) {
  main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .drum {
    width: 40px;
    height: 56px;
    font-size: 2.375rem;
  }
}

/* ===== Impression (récapitulatif) ===== */
@media print {
  :root {
    color-scheme: light;
  }
  body {
    background: #fff !important;
    color: #000;
    padding: 0;
    font-size: 11pt;
  }
  body::before,
  .tabbar,
  .topbar,
  .toast,
  .no-print,
  .skip {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  .card {
    border: 1px solid #bbb;
    break-inside: avoid;
    background: #fff;
  }
  .disclaimer {
    max-width: none;
    padding: 8px 0;
    color: #333;
  }
  a {
    color: #000;
  }
}

/* =====================================================================
   Couche « vivante » : fond bleu ciel léger, barre d'en-tête bleue,
   cartes plus généreuses, tuiles colorées. Toujours sans dégradés décoratifs.
   ===================================================================== */
:root {
  --bg: #eaf5fb;
  --bar: #00699a;
  --bar-text: #ffffff;
  --tile-tw: #dff1fa;
  --tile-tc: #e6e9f3;
  --radius: 14px;
  --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d0f12;
    --bar: #0b2a3a;
    --tile-tw: #0f2a38;
    --tile-tc: #1b2135;
  }
}
:root[data-theme='dark'] {
  --bg: #0d0f12;
  --bar: #0b2a3a;
  --tile-tw: #0f2a38;
  --tile-tc: #1b2135;
}

/* En-tête pleine largeur, bleu */
.topbar {
  max-width: none;
  background: var(--bar);
  color: var(--bar-text);
  padding: calc(14px + env(safe-area-inset-top)) max(16px, calc((100% - 528px) / 2)) 14px;
  margin-bottom: 12px;
}
.brand {
  font-size: 1.0625rem;
  font-weight: 800;
}
.topbar-date {
  color: rgba(255, 255, 255, 0.85);
}
body::before {
  border-bottom: none;
}

.card {
  border: none;
  box-shadow: 0 1px 2px rgba(0, 50, 80, 0.06), 0 2px 8px rgba(0, 50, 80, 0.05);
  padding: 18px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .card {
    box-shadow: none;
    border: 1px solid var(--border);
  }
}
:root[data-theme='dark'] .card {
  box-shadow: none;
  border: 1px solid var(--border);
}

h3 {
  font-size: 1.0625rem;
  font-weight: 800;
}

/* Compteur : bandeau titre rouge Luxembourg, phrase claire */
.meter {
  border-top: 5px solid var(--lu-red);
}
.meter-head {
  border-bottom: none;
  margin-bottom: 10px;
  padding-bottom: 0;
}
.meter-head .eyebrow:first-child {
  color: var(--text);
}
.drum {
  width: 52px;
  height: 72px;
  font-size: 3.125rem;
}
.meter-left .mono {
  color: var(--accent);
  font-size: 2rem;
}
.meter-say {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 14px 0 0;
}
.meter-say strong {
  color: var(--accent);
}
.level-orange .meter-say strong {
  color: var(--warn);
}
.level-red .meter-say strong,
.level-exceeded .meter-say strong {
  color: var(--danger);
}
.ticks i {
  border-radius: 2px;
}

/* Icônes de section dans une pastille */
.chip-ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
}

/* Tuiles de marquage rapide */
.quick .btn {
  min-height: 64px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  gap: 10px;
}
.quick .btn.tw {
  background: var(--tile-tw);
}
.quick .btn.tc {
  background: var(--tile-tc);
}
.quick .btn svg {
  width: 22px;
  height: 22px;
}

.btn {
  border-radius: var(--radius-sm);
}
.btn.primary {
  min-height: 52px;
  font-size: 1.0625rem;
}

/* Onglet actif en pastille */
.tabbar a[aria-current='page']::before {
  display: none;
}
.tabbar .ico {
  width: 56px;
  height: 30px;
  border-radius: 999px;
}
.tabbar a[aria-current='page'] .ico {
  background: var(--accent-soft);
}
.tabbar a[aria-current='page'] {
  color: var(--accent);
  font-weight: 700;
}

/* Calendrier un peu plus doux */
.day {
  border-radius: 8px;
}
.brushes button,
.icon-btn,
.segmented input + span,
.field input,
.field select,
.field textarea,
.choice {
  border-radius: var(--radius-sm);
}
dialog.sheet {
  border-radius: 18px 18px 0 0;
}
@media (max-width: 400px) {
  .drum {
    width: 46px;
    height: 64px;
    font-size: 2.75rem;
  }
}
@media print {
  .card {
    box-shadow: none;
  }
}
.level-orange .meter-left .mono {
  color: var(--warn);
}
.level-red .meter-left .mono,
.level-exceeded .meter-left .mono {
  color: var(--danger);
}
