/* ───────────── My Timetable ───────────── */
:root {
  --bg: #f4f5fa;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e6e8f0;
  --line-strong: #d5d9e6;
  --text: #171a2b;
  --muted: #6b7189;
  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-soft: #eef0ff;
  --danger: #dc2626;
  --success: #16a34a;
  --warn-bg: #fff7e6;
  --warn-text: #8a5300;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 24, 50, .05), 0 6px 24px rgba(20, 24, 50, .06);
  --shadow-lg: 0 20px 60px rgba(20, 24, 50, .25);
  --time-col: 58px;
  color-scheme: light;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1120; --surface: #171a2e; --surface-2: #1c2036; --line: #272b45; --line-strong: #343a5c;
    --text: #e9ebf7; --muted: #9aa0bd; --primary: #818cf8; --primary-2: #a78bfa; --primary-soft: #23264a;
    --warn-bg: #3a2c10; --warn-text: #ffd48a;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 24px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }
.muted { color: var(--muted); }
.spacer { flex: 1; }

/* ───── Boutons ───── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line-strong); background: var(--surface); padding: 9px 16px;
  border-radius: 10px; cursor: pointer; font-weight: 600; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn.small { padding: 6px 12px; font-size: 13.5px; border-radius: 9px; }
.btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-color: transparent; box-shadow: 0 4px 14px rgba(79,70,229,.3); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--danger); }
.btn.exit { border-color: var(--primary); color: var(--primary); }
.btn:disabled { opacity: .6; cursor: wait; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; cursor: pointer; font-size: 22px; line-height: 1; color: var(--muted);
}
.icon-btn:hover { background: var(--primary-soft); color: var(--primary); }
.icon-btn.danger:hover { background: #fde8e8; color: var(--danger); }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font-size: 13.5px; }

/* ───── En-tête ───── */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
  padding: 12px 20px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img { border-radius: 10px; box-shadow: 0 4px 12px rgba(79,70,229,.25); }
.brand-text { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand h1 { font-size: 18px; margin: 0; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--warn-bg); color: var(--warn-text); white-space: nowrap; }
.weeknav { display: flex; align-items: center; gap: 4px; }
.week-label {
  display: flex; flex-direction: column; align-items: center; min-width: 210px; padding: 4px 12px; border-radius: 10px;
  border: 0; background: transparent; cursor: pointer;
}
.week-label:hover { background: var(--primary-soft); }
.week-label span { font-weight: 800; font-size: 16px; }
.week-label small { color: var(--muted); font-size: 12.5px; }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }

/* ───── Barre de gestion ───── */
.admin-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin: 14px 20px 0; padding: 10px 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--primary); box-shadow: var(--shadow);
}
.admin-left, .admin-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.admin-tag { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: var(--primary); padding: 4px 8px; border-radius: 6px; }
.admin-bar select, .admin-bar input { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 9px; padding: 6px 10px; font-size: 13.5px; }
.admin-bar input { width: 260px; max-width: 100%; }
.admin-hint { width: 100%; margin: 0; font-size: 12.5px; color: var(--muted); }

main { padding: 14px 20px 32px; max-width: 1500px; margin: 0 auto; }

/* ───── Bandeau de semaine ───── */
.week-banner {
  display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 12px; padding: 10px 16px;
  border-radius: var(--radius); background: var(--primary-soft); color: var(--text); border: 1px solid var(--line);
}
.week-banner.type-entreprise { background: #e8f6ef; border-color: #bfe8d2; }
.week-banner.type-vacances { background: #fff4e0; border-color: #ffdfa6; }
.week-banner.type-examens { background: #fde9ec; border-color: #f8c4ce; }
@media (prefers-color-scheme: dark) {
  .week-banner.type-entreprise { background: #12301f; border-color: #1d4d33; }
  .week-banner.type-vacances { background: #3a2c10; border-color: #5a4518; }
  .week-banner.type-examens { background: #3a1820; border-color: #5c2633; }
}
.week-banner.big { padding: 28px; justify-content: center; text-align: center; flex-direction: column; font-size: 18px; }
.week-banner.big strong { font-size: 24px; }

/* ───── Grille ───── */
.timetable {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; transition: opacity .2s;
}
.timetable.loading { opacity: .55; }
.tt-head { display: grid; position: sticky; top: 0; background: var(--surface); border-bottom: 1px solid var(--line); z-index: 2; }
.day-h { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 10px 4px; border-left: 1px solid var(--line); color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.day-h b { font-size: 20px; color: var(--text); letter-spacing: 0; }
.day-h.today { color: var(--primary); }
.day-h.today b { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; border-radius: 99px; min-width: 32px; text-align: center; padding: 0 6px; }
.tt-body { display: grid; position: relative; }
.times { position: relative; }
.times .t { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.times .t:first-child { transform: none; top: 2px !important; }
.day-col {
  position: relative; border-left: 1px solid var(--line);
  background-image:
    repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px var(--hour-px)),
    repeating-linear-gradient(to bottom, transparent 0 calc(var(--hour-px) / 2), color-mix(in srgb, var(--line) 50%, transparent) calc(var(--hour-px) / 2) calc(var(--hour-px) / 2 + 1px), transparent calc(var(--hour-px) / 2 + 1px) var(--hour-px));
}
.day-col.today { background-color: color-mix(in srgb, var(--primary) 4%, transparent); }
body.is-admin .day-col { cursor: copy; }
body.is-admin .day-col:hover { background-color: color-mix(in srgb, var(--primary) 6%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: #ef4444; z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }

.sess {
  position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 1px; text-align: left; overflow: hidden;
  padding: 6px 8px 6px 10px; border-radius: 10px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent);
  border-left: 4px solid var(--c);
  color: var(--text); transition: transform .1s, box-shadow .15s;
}
.sess:hover { transform: translateY(-1px); box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 30%, transparent); z-index: 4; }
.sess-title { font-weight: 700; font-size: 13.5px; line-height: 1.2; color: color-mix(in srgb, var(--c) 55%, var(--text)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sess-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.sess-time em { font-style: normal; font-weight: 700; font-size: 10.5px; padding: 0 6px; border-radius: 99px; background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 60%, var(--text)); }
.sess-meta { font-size: 12px; color: var(--text); opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess-note { font-size: 11.5px; color: var(--muted); font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sess.sm .sess-note, .sess.xs .sess-note, .sess.xs .sess-meta { display: none; }
.sess.xs { flex-direction: row; gap: 6px; align-items: center; padding-top: 2px; padding-bottom: 2px; }
.sess.xs .sess-title { -webkit-line-clamp: 1; font-size: 12px; }
.sess.xs .sess-time em { display: none; }
.sess.exam { background-image: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--c) 10%, transparent) 8px 16px); }

/* ───── Liste mobile ───── */
.day-list { display: none; }
.dl-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.dl-day.today { border-color: var(--primary); }
.dl-day h3 { margin: 0 0 8px; font-size: 16px; display: flex; align-items: baseline; gap: 8px; }
.dl-day h3 small { color: var(--muted); font-weight: 500; font-size: 13px; }
.dl-day.today h3 { color: var(--primary); }
.dl-sess {
  display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px; margin-bottom: 8px; border-radius: 12px; cursor: pointer;
  background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 25%, transparent); border-left: 4px solid var(--c);
}
.dl-time { display: flex; flex-direction: column; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 48px; }
.dl-time small { color: var(--muted); font-weight: 500; }
.dl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-body b { color: color-mix(in srgb, var(--c) 55%, var(--text)); }
.dl-body span { font-size: 13px; color: var(--muted); }
.dl-body i { font-size: 12.5px; color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; margin: 4px 0 8px; }

/* ───── Résumé ───── */
.summary { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; color: var(--muted); font-size: 14px; }
.summary .total b { color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.chip b { color: var(--muted); font-weight: 600; }
.empty-week { width: 100%; text-align: center; padding: 8px; }

/* ───── Dialogues ───── */
.modal {
  border: 0; padding: 0; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px);
}
.modal.small { width: min(430px, calc(100vw - 24px)); }
.modal.large { width: min(680px, calc(100vw - 24px)); }
.modal::backdrop { background: rgba(15, 17, 35, .45); backdrop-filter: blur(3px); }
.modal[open] { animation: pop .18s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.modal h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 10px 18px 6px; }
.modal footer { display: flex; align-items: center; gap: 8px; padding: 12px 18px 16px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-weight: 500; font-size: 14.5px;
}
.field input:focus, .field select:focus, .field textarea:focus, .admin-bar input:focus, .admin-bar select:focus, #libSearch:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}
.field textarea { resize: vertical; }
.with-add { display: flex; gap: 6px; }
.with-add select { flex: 1; min-width: 0; }
.with-add .icon-btn { border: 1px solid var(--line-strong); background: var(--surface-2); width: 40px; height: auto; }
.repeat { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; font-weight: 500; color: var(--text); }
.repeat input[type=number] { width: 70px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 500; cursor: pointer; margin: 6px 0; }
.check input[type=number] { width: 64px; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.check input[type=date] { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.check input[type=radio], .check input[type=checkbox] { accent-color: var(--primary); width: 16px; height: 16px; }
.radios { border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px 8px; margin: 0 0 12px; }
.radios legend { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 0 6px; }
.warn { background: var(--warn-bg); color: var(--warn-text); padding: 8px 12px; border-radius: 10px; font-size: 13px; }
.form-error { color: var(--danger); font-size: 13.5px; margin: 4px 0; font-weight: 600; }
.detail .drow { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.detail .drow:last-child { border-bottom: 0; margin-bottom: 10px; }
.detail .drow span { color: var(--muted); }
.detail .drow b { text-align: right; font-weight: 600; }
.detail .drow small { color: var(--muted); font-weight: 500; }
.detail a { color: var(--primary); }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }

/* Couleurs */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.sw.on { box-shadow: 0 0 0 2px var(--text); }
.swatches input[type=color] { width: 40px; height: 32px; padding: 2px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-2); cursor: pointer; }

/* Bibliothèque */
.tabs { display: flex; gap: 4px; padding: 4px 18px 0; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 10px 14px; cursor: pointer; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.lib-tools { display: flex; gap: 8px; margin: 6px 0 12px; }
#libSearch { flex: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.lib-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 55vh; overflow: auto; }
.lib-list li { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); }
.lib-list li:last-child { border-bottom: 0; }
.lib-list li.empty { justify-content: center; color: var(--muted); padding: 20px; }
.lib-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib-main small { color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 13px; background: var(--primary-soft); color: var(--primary); flex: none; }

/* Toasts */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 100; pointer-events: none; }
.toast { background: #1d2140; color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: .25s; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast.success { background: #15803d; }
.toast.error { background: #b91c1c; }

/* ───── Responsive ───── */
@media (max-width: 980px) {
  .topbar { grid-template-columns: 1fr auto; }
  .weeknav { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .admin-bar { margin: 10px 12px 0; }
  main { padding: 12px; }
}
@media (max-width: 760px) {
  .timetable { display: none; }
  .day-list { display: block; }
  .topbar { padding: 10px 12px; }
  .week-label { min-width: 0; flex: 1; }
  .actions .btn span { display: none; }
  .actions .btn { padding: 9px 11px; }
  .admin-bar input { width: 100%; }
  .admin-left { width: 100%; }
  .admin-left select { flex: 1; }
  .admin-hint { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .summary { justify-content: center; }
}

/* ───── Impression ───── */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fff; --text: #000; color-scheme: light; }
  body { background: #fff; font-size: 12px; }
  .topbar { position: static; border: 0; backdrop-filter: none; }
  .actions, .weeknav .icon-btn, #todayBtn, .admin-bar, .toasts, .day-list { display: none !important; }
  .timetable { display: block !important; box-shadow: none; }
  .sess { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .now-line { display: none; }
  main { padding: 0; max-width: none; }
}

/* ───── Import PDF / photo ───── */
.modal.xl { width: min(1400px, calc(100vw - 24px)); height: calc(100vh - 32px); }
.modal.xl > .import { display: flex; flex-direction: column; height: 100%; }
#importBody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.import-status { padding: 30px 18px; text-align: center; color: var(--muted); }
.import-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.45fr); gap: 16px; padding: 12px 18px 0; }
.import-img { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.import-img-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.import-img-wrap img { display: block; width: 100%; }
.import-img-wrap.zoomed img { width: 220%; }
.import-img figcaption { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 6px 2px; }
.import-side { display: flex; flex-direction: column; min-height: 0; gap: 8px; }
.import-week { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.import-week .field { margin: 0; }
.import-week .muted { font-size: 13px; padding-bottom: 10px; }
.import-msg { margin: 0; padding: 8px 12px; border-radius: 10px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.import-msg.info { background: var(--primary-soft); }
.import-msg.warn { background: var(--warn-bg); color: var(--warn-text); }
.import-msg.ok { background: color-mix(in srgb, var(--success) 12%, var(--surface)); }
.import-table-wrap { flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.import-table { width: 100%; min-width: 660px; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.import-table th { position: sticky; top: 0; background: var(--surface-2); text-align: left; padding: 6px; font-size: 12px; color: var(--muted); z-index: 1; }
.import-table td { padding: 5px 3px 3px; border-top: 1px solid var(--line); vertical-align: middle; }
.import-table input, .import-table select { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); font-size: 13px; }
.import-table tr.bad td { background: color-mix(in srgb, var(--danger) 8%, transparent); }
.cell-tag { position: relative; }
.new-tag { position: absolute; right: 2px; top: -3px; font-size: 8.5px; line-height: 1.3; font-weight: 800; text-transform: uppercase; color: var(--primary); background: var(--primary-soft); padding: 1px 5px; border-radius: 5px; pointer-events: none; }
.import-tools { display: flex; gap: 8px; padding-bottom: 4px; }
.import-tools .btn:disabled { opacity: .5; }
#importTabs { padding: 0 18px; }
#importTabs .tab small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 900px) {
  .modal.xl { height: auto; }
  .import-grid { grid-template-columns: 1fr; }
  .import-img-wrap { max-height: 40vh; }
  .import-table-wrap { max-height: 50vh; }
  .import-table thead, .import-table colgroup { display: none; }
  .import-table { min-width: 0; }
  .import-table tr { display: grid; grid-template-columns: 70px 1fr 1fr 36px; gap: 3px; padding: 6px 0; border-top: 1px solid var(--line); }
  .import-table td { border: 0; }
  .import-table td:nth-child(4), .import-table td:nth-child(5), .import-table td:nth-child(6), .import-table td:nth-child(7) { grid-column: span 2; }
}

/* ───── Divers ───── */
.offline-badge { background: #fde8e8; color: #b91c1c; }
.noscript { text-align: center; padding: 24px; color: var(--muted); }
html { scroll-padding-top: 90px; -webkit-tap-highlight-color: transparent; }
main { touch-action: pan-y; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.btn:focus-visible, .icon-btn:focus-visible, .sess:focus-visible, .dl-sess:focus-visible, .tab:focus-visible, .week-label:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px;
}
@media (max-width: 760px) {
  .brand { gap: 9px; }
  .brand-text { flex-direction: column; align-items: flex-start; gap: 2px; }
  .brand-text .badge { font-size: 10px; padding: 1px 6px; }
  .brand h1 { font-size: 16.5px; }
}
