/* ========== Polices ========== */
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('/fonts/atkinson-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Atkinson'; src: url('/fonts/atkinson-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }

/* ========== Thème ========== */
:root {
  --paper: #f4f6fa;
  --surface: #ffffff;
  --ink: #1a2236;
  --ink-2: #5a6582;
  --line: #e0e5ee;
  --line-strong: #c5cddc;
  --fluo: #ffe24a;          /* le surligneur : maintenant, aujourd'hui, bouton + */
  --fluo-ink: #241f00;
  --focus: #4c5bff;
  --bad: #d63b3b;
  --ok: #1f9d63;
  --overlay: rgba(14, 20, 38, .45);
  --shadow: 0 10px 30px -12px rgba(20, 30, 60, .35);
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --display: 'Bricolage', 'Segoe UI', system-ui, sans-serif;
  --text: 'Atkinson', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #10172a;
    --surface: #18213a;
    --ink: #e7ecf7;
    --ink-2: #9aa6c2;
    --line: #26304b;
    --line-strong: #364264;
    --fluo: #f5d93f;
    --focus: #8f9bff;
    --bad: #ff6b6b;
    --ok: #4fd18f;
    --overlay: rgba(3, 6, 15, .6);
    --shadow: 0 12px 34px -10px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.45 var(--text);
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 650; letter-spacing: -.01em; }
.icon { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2.5px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }

/* Le surligneur */
.marker {
  background: var(--fluo);
  color: var(--fluo-ink);
  border-radius: .35em .6em .45em .25em;
  padding: 0 .22em;
  margin: 0 -.08em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.boot { padding: 40vh 0; text-align: center; color: var(--ink-2); }

/* ========== Structure ========== */
.shell { min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px); }
.view { padding: 0 16px; max-width: 1240px; margin: 0 auto; }

.nav {
  position: fixed; inset: auto 0 0 0; z-index: 40;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in oklab, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.nav-brand { display: none; }
.nav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ink-2); font-size: 12px;
}
.nav-link.active { color: var(--ink); font-weight: 700; }
.nav-link.active .icon { stroke-width: 2.3; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 208px 1fr; padding-bottom: 40px; }
  .nav {
    position: sticky; top: 0; height: 100vh; padding: 22px 12px;
    display: flex; flex-direction: column; gap: 2px;
    border-top: 0; border-right: 1px solid var(--line); background: var(--surface);
  }
  .nav-brand { display: block; font: 700 22px var(--display); padding: 0 12px 22px; letter-spacing: -.02em; }
  .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 15px; }
  .nav-link:hover { background: var(--paper); }
  .nav-link.active { background: var(--paper); }
  .nav-link:last-child { margin-top: auto; }
  .view { padding: 0 32px; width: 100%; }
}

/* ========== En-têtes ========== */
.day-head {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  padding: 14px 0 10px;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px;
}
.day-title-row { display: flex; align-items: center; gap: 4px; }
.day-title { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; flex: 0 1 auto; padding: 0 4px; }
.day-weekday { font: 500 15px var(--text); color: var(--ink-2); text-transform: capitalize; letter-spacing: 0; }
.day-date { font-size: clamp(24px, 6.4vw, 32px); font-weight: 700; white-space: nowrap; align-self: flex-start; }
.head-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.page-head { padding: 22px 0 14px; }
.page-title { font-size: 32px; font-weight: 700; }

@media (min-width: 900px) {
  .day-head { margin: 0 -32px; padding: 22px 32px 12px; }
}

.icon-btn {
  width: 42px; height: 42px; flex: none;
  display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink);
}
.icon-btn:hover { background: color-mix(in oklab, var(--ink) 7%, transparent); }
.icon-btn.danger { color: var(--bad); }
.spinning .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Bandeau des 7 jours */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 12px; }
.strip-day {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 0 5px; border-radius: 12px; color: var(--ink-2);
}
.strip-wd { font-size: 12px; text-transform: capitalize; }
.strip-num { font: 650 18px var(--display); color: var(--ink); padding: 0 .3em; border-radius: .35em .6em .45em .25em; }
.strip-day.is-today .strip-num { background: var(--fluo); color: var(--fluo-ink); }
.strip-day.selected { background: var(--ink); color: var(--paper); }
.strip-day.selected .strip-num { color: var(--paper); }
.strip-day.selected.is-today .strip-num { color: var(--fluo-ink); }
.strip-dots { display: flex; gap: 3px; height: 6px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.dot-item { background: var(--ink-2); }
.strip-day.selected .dot { background: var(--paper); opacity: .7; }

/* ========== Vue jour ========== */
.day-body { display: grid; gap: 24px; }
.day-side { display: none; }
@media (min-width: 1100px) {
  .day-body { grid-template-columns: minmax(0, 1fr) 330px; align-items: start; }
  .day-side { display: block; position: sticky; top: 150px; }
}

.section-title { font: 700 14px var(--text); color: var(--ink-2); margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; letter-spacing: 0; }
.count { font-weight: 400; }
.allday { margin-bottom: 8px; }

.warning {
  display: block; margin: 8px 0; padding: 10px 12px; border-radius: 12px; text-decoration: none;
  background: color-mix(in oklab, var(--bad) 12%, var(--surface)); color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--bad) 40%, transparent); font-size: 14px;
}
.offline-bar { position: sticky; top: 0; z-index: 60; background: var(--ink); color: var(--paper); text-align: center; font-size: 13px; padding: 6px; }

/* ========== Grille horaire ========== */
.timeline { margin-top: 10px; }
.tl-grid { display: grid; grid-template-columns: 46px; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); padding: 10px 0 20px; }
.tl-gutter { position: relative; }
.tl-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: 12px; color: var(--ink-2); }
.tl-col { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.tl-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); pointer-events: none; }

.timeline-week { overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 0 0; }
.timeline-week .tl-gutter, .timeline-week .tl-head-gutter { position: sticky; left: 0; z-index: 6; background: var(--paper); }
.timeline-week .ev-title { white-space: nowrap; }
.timeline-week .ev { font-size: 12.5px; }
.timeline-week .tl-grid, .timeline-week .tl-head { min-width: 760px; }
.tl-head { display: grid; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); }
.tl-head-day { padding: 0 3px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tl-head-link { display: flex; align-items: baseline; gap: 6px; text-decoration: none; padding: 2px 4px; color: var(--ink-2); }
.tl-head-num { font: 650 20px var(--display); color: var(--ink); padding: 0 .22em; border-radius: .35em .6em .45em .25em; }
.tl-head-num.marker { color: var(--fluo-ink); }
.chip-allday {
  text-align: left; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 6px;
  background: color-mix(in oklab, var(--c) 22%, var(--surface)); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip-allday.done { opacity: .5; text-decoration: line-through; }

.ev {
  position: absolute; z-index: 2; overflow: hidden; text-align: left;
  border-radius: 9px; font-size: 13px; line-height: 1.25; cursor: pointer;
}
.ev-title { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.ev-meta { display: block; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.compact .ev-title { white-space: nowrap; }

/* Cours Pronote : fiche avec liseré de couleur de la matière */
.ev-course {
  padding: 4px 7px 4px 9px;
  background: color-mix(in oklab, var(--c) 11%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--c) 28%, var(--line));
  border-left: 4px solid var(--c);
  display: flex; flex-direction: column; align-items: stretch;
}
.ev-course.canceled {
  background: repeating-linear-gradient(135deg, var(--surface) 0 7px, color-mix(in oklab, var(--bad) 12%, var(--surface)) 7px 14px);
  border-left-color: var(--bad);
}
.ev-course.canceled .ev-title { text-decoration: line-through; color: var(--ink-2); }
.ev-badge {
  align-self: flex-start; margin-top: 3px; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 99px;
  background: color-mix(in oklab, var(--c) 25%, var(--surface));
}
.ev-badge.badge-bad { background: var(--bad); color: #fff; }

/* Mes éléments : bloc plein, couleur de catégorie */
.ev-item {
  display: flex; gap: 6px; align-items: flex-start; padding: 5px 7px 5px 5px;
  background: color-mix(in oklab, var(--c) 30%, var(--surface));
  border: 1.5px solid color-mix(in oklab, var(--c) 75%, transparent);
}
.ev-item.done { opacity: .55; }
.ev-item.done .ev-title { text-decoration: line-through; }
.ev-check { flex: none; padding: 1px; }
.ev-open { flex: 1; min-width: 0; text-align: left; }
.ev-repeat { display: inline-block; margin-left: 4px; vertical-align: -1px; opacity: .7; }
.ev.compact { padding-top: 2px; padding-bottom: 2px; }
.ev.compact .ev-check .check { width: 16px; height: 16px; }

/* Ligne "maintenant" */
.now-line { position: absolute; left: -5px; right: 0; z-index: 5; border-top: 3px solid var(--fluo); pointer-events: none; }
.now-line::before { content: ''; position: absolute; left: -2px; top: -7px; width: 11px; height: 11px; border-radius: 50%; background: var(--fluo); }
.now-label {
  position: absolute; right: calc(100% + 6px); top: -11px;
  background: var(--fluo); color: var(--fluo-ink); font: 700 11px var(--text); padding: 2px 5px; border-radius: 6px; white-space: nowrap;
}

/* ========== Tâches ========== */
.task-list { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task-check { padding: 12px 8px 12px 2px; }
.task-main { flex: 1; min-width: 0; text-align: left; padding: 10px 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 700; overflow-wrap: anywhere; }
.task-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.task.done .task-title { text-decoration: line-through; color: var(--ink-2); font-weight: 400; }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; display: inline-block; }

.check {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--c, var(--line-strong)); position: relative; background: var(--surface);
  transition: background .15s;
}
.check.checked { background: var(--c, var(--ok)); border-color: var(--c, var(--ok)); }
.check.checked::after {
  content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.ev-item .check { --c: color-mix(in oklab, var(--ink) 70%, transparent); }

.todo { max-width: 720px; }
.todo-compact { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.side-title { font-size: 20px; margin-bottom: 10px; }
.todo-section.tone-late .section-title { color: var(--bad); }
.todo-done { margin-top: 18px; color: var(--ink-2); }
.todo-done summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 6px 0; }
.quick-add { display: flex; gap: 8px; margin: 4px 0 6px; }
.quick-input {
  flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface);
}
.quick-input:focus { outline: none; border-color: var(--focus); }
.todo-compact .quick-input { min-height: 40px; }
.empty { color: var(--ink-2); padding: 24px 0; max-width: 46ch; }

/* ========== Bouton + ========== */
.fab {
  position: fixed; z-index: 30; right: 18px; bottom: calc(var(--nav-h) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 20px 24px 22px 18px;
  display: grid; place-items: center;
  background: var(--fluo); color: var(--fluo-ink); box-shadow: var(--shadow);
}
.fab .icon { stroke-width: 2.6; }
.fab:active { transform: scale(.96); }
@media (min-width: 900px) { .fab { right: 32px; bottom: 32px; } }

/* ========== Formulaires ========== */
.input {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: 11px;
  border: 1.5px solid var(--line); background: var(--surface);
}
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in oklab, var(--focus) 22%, transparent); }
.input:disabled { opacity: .5; }
.input-title { font: 650 22px var(--display); border-color: transparent; padding-left: 2px; background: transparent; }
.input-title:focus { box-shadow: none; border-color: transparent; border-bottom-color: var(--focus); border-radius: 0; }
.input-inline { width: auto; min-height: 38px; }
.input-pin { font: 700 30px var(--display); letter-spacing: .5em; text-align: center; max-width: 220px; margin: 0 auto; display: block; }
.textarea { resize: vertical; line-height: 1.5; }
select.input { appearance: auto; }
.label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-top: 14px; }
.hint { color: var(--ink-2); font-size: 14px; margin: 12px 0 0; }
.form-error { color: var(--bad); font-size: 14px; margin: 6px 0; min-height: 0; }
.form-error:empty { display: none; }
.grid-3 { display: grid; grid-template-columns: 1fr; column-gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (min-width: 560px) { .grid-3 { grid-template-columns: 1fr 1.4fr; } }
.row { display: flex; align-items: center; gap: 10px; }
.row .input { width: auto; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.switch-label { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch-label input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 11px;
  border: 1.5px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: 15px;
}
.btn:hover { border-color: var(--ink-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-small { min-height: 34px; padding: 0 11px; font-size: 14px; }
.btn-primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover { border-color: var(--ink); opacity: .92; }
.btn-danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn-ghost-danger { color: var(--bad); }
.btn-done { border-color: var(--ok); color: var(--ok); }
.btn-block { width: 100%; }
.btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px;
  border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14px;
}
.chip .cat-dot { --c: inherit; }
.chip.on { border-color: var(--c, var(--ink)); background: color-mix(in oklab, var(--c, var(--ink)) 20%, var(--surface)); font-weight: 700; }
.chips-small .chip { min-height: 32px; padding: 0 10px; font-size: 13px; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; border-radius: 12px; background: color-mix(in oklab, var(--ink) 7%, var(--surface)); }
.seg { min-height: 38px; border-radius: 9px; font-size: 14px; color: var(--ink-2); }
.seg.on { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }

.days-row { display: flex; gap: 6px; margin-top: 10px; }
.day-toggle { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--line); font-weight: 700; font-size: 14px; }
.day-toggle.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }

.editor-actions { display: flex; align-items: center; gap: 8px; margin-top: 22px; justify-content: flex-end; flex-wrap: wrap; }
.editor-actions .icon-btn { margin-right: auto; }

/* ========== Fenêtres ========== */
.overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .16s ease-out;
}
.sheet {
  width: 100%; max-height: 92vh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px 22px 0 0;
  padding: 6px 18px calc(22px + var(--safe-b));
  animation: up .22s cubic-bezier(.2, .8, .3, 1);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -6px; background: var(--surface); padding: 8px 0 4px; z-index: 2; }
.sheet-head h2 { font-size: 18px; }
.overlay.closing { opacity: 0; transition: opacity .15s; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 700px) {
  .overlay { align-items: center; }
  .sheet { max-width: 540px; border-radius: 20px; padding-bottom: 22px; max-height: 88vh; }
  .sheet-wide { max-width: 760px; }
}
.confirm-text { margin: 6px 0 4px; }

/* Détail d'un cours */
.course-head { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.course-bar { width: 6px; align-self: stretch; min-height: 30px; border-radius: 3px; background: var(--c); }
.course-head h3 { font-size: 24px; }
.course-status { font-weight: 700; margin: 12px 0 0; }
.course-status.bad { color: var(--bad); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 20px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 700; }

/* ========== Notes ========== */
.search { position: relative; max-width: 520px; margin-bottom: 16px; color: var(--ink-2); }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); }
.search-input { padding-left: 38px; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; align-items: start; }
.note-card {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 6px;
  padding: 13px 14px; border-radius: 14px; min-height: 96px;
  background: color-mix(in oklab, var(--c, var(--surface)) 30%, var(--surface));
  border: 1.5px solid color-mix(in oklab, var(--c, var(--line)) 55%, var(--line));
}
.note-pin { position: absolute; top: 10px; right: 10px; color: var(--ink-2); }
.note-title { font: 650 17px var(--display); padding-right: 18px; overflow-wrap: anywhere; }
.note-body { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.note-date { font-size: 12px; color: var(--ink-2); margin-top: auto; }
.note-editor { display: flex; flex-direction: column; gap: 8px; }
.note-textarea { min-height: 220px; resize: none; border-color: transparent; padding-left: 2px; font-size: 16px; }
.note-textarea:focus { box-shadow: none; border-color: transparent; }
.note-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
.note-status { font-size: 13px; color: var(--ink-2); }
.color-row { display: flex; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 1.5px solid var(--line-strong); }
.swatch.on { outline: 2.5px solid var(--ink); outline-offset: 2px; }

/* ========== Réglages ========== */
.settings { max-width: 720px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px 18px; margin-bottom: 14px; }
.card-title { font-size: 19px; margin-bottom: 6px; }
.card p { margin: 6px 0; }
.muted { color: var(--ink-2); font-size: 14px; }
.status-line.ok { font-weight: 700; color: var(--ok); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.cat-list { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; }
.color-input { width: 44px; height: 44px; border: 1.5px solid var(--line); border-radius: 11px; padding: 3px; background: var(--surface); flex: none; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.details summary { cursor: pointer; color: var(--ink-2); font-size: 14px; margin-bottom: 8px; }
.details .btn { margin-top: 8px; }
.qr-cam { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1; max-height: 50vh; }
.qr-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-frame { position: absolute; inset: 18%; border: 3px solid var(--fluo); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* ========== Connexion ========== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 6px; }
.login-title { font-size: 44px; font-weight: 750; margin-bottom: 4px; align-self: flex-start; }
.login-sub { color: var(--ink-2); margin: 0 0 18px; }
.login-card .btn { margin-top: 12px; min-height: 48px; }

/* ========== Messages ========== */
.toasts { position: fixed; z-index: 200; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--safe-b) + 90px); display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: var(--ink); color: var(--paper); padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 15px;
  animation: up .2s ease-out;
}
.toast-error { background: var(--bad); color: #fff; }
.toast-btn { font-weight: 700; color: var(--fluo); white-space: nowrap; }
@media (min-width: 900px) { .toasts { bottom: 32px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
