/* ============================
   EDT — Glassmorphism, mobile-first
   ============================ */

:root {
  --bg: #f2f3f8;
  --bg-grad-1: #eef0fb;
  --bg-grad-2: #f7e9f4;
  --bg-grad-3: #e6f1ff;
  --fg: #0c0d12;
  --fg-soft: #4a4d5a;
  --muted: #8b8f9c;
  --card: rgba(255, 255, 255, 0.62);
  --card-strong: rgba(255, 255, 255, 0.85);
  --border: rgba(20, 22, 36, 0.08);
  --shadow: 0 10px 30px rgba(20, 22, 36, 0.08), 0 2px 6px rgba(20, 22, 36, 0.04);
  --accent: #0a84ff;
  --danger: #ff3b30;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --blur: saturate(180%) blur(22px);

  /* Couleurs par type de cours — palette iOS system */
  --cm: #007AFF;    /* bleu Apple — cours magistral */
  --td: #34C759;    /* vert Apple — travaux dirigés */
  --tp: #FF9500;    /* orange Apple — travaux pratiques */
  --ex: #FF3B30;    /* rouge Apple — examens */
  --other: #AF52DE; /* violet Apple — autres */

  /* Safe areas iOS */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0a0f;
    --bg-grad-1: #0e1020;
    --bg-grad-2: #1a0e22;
    --bg-grad-3: #08131f;
    --fg: #f3f4f8;
    --fg-soft: #c6c8d3;
    --muted: #8a8d99;
    --card: rgba(28, 30, 44, 0.55);
    --card-strong: rgba(28, 30, 44, 0.82);
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 2px 6px rgba(0, 0, 0, 0.35);
    --accent: #0a84ff;

    /* Variantes "Bright" iOS pour le dark mode */
    --cm: #0A84FF;
    --td: #30D158;
    --tp: #FF9F0A;
    --ex: #FF453A;
    --other: #BF5AF2;
  }
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: contain;
  min-height: 100vh;
}

body {
  background:
    radial-gradient(1100px 800px at -10% -20%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 700px at 110% 10%, var(--bg-grad-2), transparent 55%),
    radial-gradient(1200px 900px at 50% 120%, var(--bg-grad-3), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

button { font: inherit; color: inherit; cursor: pointer; }
input, textarea {
  font: inherit; color: inherit;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  width: 100%;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--accent); }

/* === Layout === */
.app {
  max-width: 920px;
  margin: 0 auto;
  padding:
    calc(var(--safe-top) + 12px)
    calc(var(--safe-right) + 12px)
    calc(var(--safe-bottom) + 12px)
    calc(var(--safe-left) + 12px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.glass {
  background: var(--card);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* === Topbar === */
.topbar {
  display: grid;
  grid-template-columns: 40px 1fr 40px 40px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  position: sticky;
  top: calc(var(--safe-top) + 8px);
  z-index: 5;
}
.title-block {
  text-align: center;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 4px 6px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease;
}
.title-block:active { background: var(--card); }
.title-block h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}
.title-block .sub {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* === Sync button === */
.sync-btn { font-size: 16px; }
.sync-icon {
  display: inline-block;
  line-height: 1;
  transition: color .2s ease;
}
.sync-btn.syncing .sync-icon {
  animation: spin 0.9s linear infinite;
  color: var(--accent);
}
.sync-btn.synced .sync-icon { color: var(--td); }
.sync-btn.error .sync-icon  { color: var(--ex); }
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Week pills (Lun 18 / Mar 19 / Mer 20…) === */
.weekpills {
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.weekpills::-webkit-scrollbar { display: none; }
.day-pill {
  flex: 0 0 auto;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 7px 10px;
  border: none;
  background: transparent;
  border-radius: 14px;
  color: var(--fg-soft);
  transition: background .15s ease, color .15s ease;
  font-variant-numeric: tabular-nums;
}
.day-pill .dow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  opacity: 0.8;
}
.day-pill .dnum {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 1px;
}
.day-pill .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 3px;
  opacity: 0;
}
.day-pill.has-events .dot { opacity: 0.7; }
.day-pill.today {
  color: var(--accent);
}
.day-pill.today .dnum { font-weight: 800; }
.day-pill.active {
  background: var(--card-strong);
  color: var(--fg);
  box-shadow: var(--shadow);
}
.day-pill.active.today { color: var(--accent); }
.day-pill.weekend { opacity: 0.6; }

/* === Pull-to-refresh indicator === */
.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  height: 0;
  overflow: hidden;
  transition: height .2s ease, opacity .2s ease;
  opacity: 0;
}
.pull-indicator.pulling { height: 38px; opacity: 1; }
.pull-indicator.ready .pull-arrow { transform: rotate(180deg); color: var(--accent); }
.pull-indicator.loading .pull-arrow { animation: spin 0.9s linear infinite; color: var(--accent); }
.pull-arrow {
  display: inline-block;
  font-size: 14px;
  transition: transform .2s ease;
}
.icon-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--card-strong);
  font-size: 22px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease;
}
.icon-btn:active { transform: scale(0.94); }

/* === Vue switch (segmented) === */
.viewswitch {
  display: flex;
  gap: 6px;
  padding: 6px;
  align-items: center;
}
.seg {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--fg-soft);
  transition: background .15s ease, color .15s ease;
}
.seg.active {
  background: var(--card-strong);
  color: var(--fg);
  box-shadow: var(--shadow);
}
#todayBtn, #settingsBtn { flex: 0 0 auto; padding: 10px 12px; }
#todayBtn { font-size: 16px; color: var(--accent); }

/* Profile chip dans la viewswitch bar */
.profile-chip {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px !important;
  min-width: 0;
  max-width: 50%;
  background: color-mix(in srgb, var(--accent) 12%, transparent) !important;
  color: var(--fg) !important;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.profile-chip .prefix { font-size: 14px; line-height: 1; }
.profile-chip .caret  { font-size: 9px; color: var(--muted); margin-left: 1px; }
.profile-chip #profileName {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
  font-size: 13px;
  font-weight: 700;
}
@media (max-width: 360px) {
  .profile-chip { padding: 10px 8px !important; }
  .profile-chip #profileName { max-width: 70px; }
  .profile-chip .prefix { display: none; }
}

/* === Dialogue Mes classes === */
.profile-dlg {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 520px;
  width: calc(100% - 24px);
}
.profile-dlg::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.profile-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-radius: var(--radius-lg);
}
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.profile-head h2 { margin: 0; font-size: 18px; }

.profile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 60vh;
  overflow-y: auto;
}
.profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--border);
  transition: background .15s ease;
}
.profile-row.active {
  background: color-mix(in srgb, var(--accent) 12%, var(--card-strong));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}
.profile-row .switch {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  background: transparent;
  border: none;
  padding: 0;
  min-width: 0;
}
.profile-row .switch .name {
  font-size: 15px;
  font-weight: 650;
  color: var(--fg);
  letter-spacing: -0.01em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-row .switch .meta {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.profile-row.active .switch .name::after {
  content: '  ●';
  color: var(--accent);
  font-size: 8px;
  vertical-align: middle;
}
.profile-row .del {
  flex: 0 0 auto;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--danger);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.profile-row .del:active { transform: scale(0.92); }

.add-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px dashed var(--border);
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
  text-align: center;
}
.add-summary::-webkit-details-marker { display: none; }
.add-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 4px 0;
}
.profile-empty {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--muted);
}

/* === Content === */
.content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 24px;
  touch-action: pan-y;
}

/* === Carte cours === */
.course {
  position: relative;
  padding: 14px 16px 14px 22px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--type-color, var(--other)) 14%, transparent),
      color-mix(in srgb, var(--type-color, var(--other)) 0%, transparent) 70%),
    var(--card-strong);
  border: 1px solid color-mix(in srgb, var(--type-color, var(--other)) 22%, var(--border));
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.course:active { transform: scale(0.985); }
.course::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 6px;
  background: var(--type-color, var(--other));
}
.course .row1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.course .head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.course .title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.course .time {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg-soft);
  white-space: nowrap;
  font-weight: 600;
}
.course .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--fg-soft);
}
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--type-color, var(--other));
  color: white;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--type-color, var(--other)) 35%, transparent);
}

/* === Cours EN COURS === */
.course.live {
  border-color: var(--type-color, var(--other));
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--type-color, var(--other)) 25%, transparent),
    var(--shadow);
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--type-color, var(--other));
  color: white;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-left: 6px;
}
.live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  animation: live-blink 1.4s ease-in-out infinite;
}
@keyframes live-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.course.past {
  opacity: 0.55;
}

/* === Pause entre cours === */
.pause {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 4px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.pause::before, .pause::after {
  content: '';
  flex: 1;
  border-top: 1.5px dashed color-mix(in srgb, var(--muted) 50%, transparent);
}

/* === Résumé / prochain cours === */
.day-summary {
  display: flex;
  gap: 18px;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--fg-soft);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  align-items: center;
}
.day-summary .stat {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.day-summary .stat strong {
  color: var(--fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.day-summary .stat span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 2px;
}
.next-course {
  display: flex;
  align-items: center;
  gap: 10px;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 70%),
    var(--card-strong);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: var(--fg);
}
.next-course .arrow {
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}
.next-course strong { color: var(--accent); font-weight: 700; }

/* === Empty / Day header === */
.day-section h2 {
  margin: 14px 6px 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 14px;
}
.empty strong { color: var(--fg); display: block; margin-bottom: 6px; }

/* === Vue semaine en TIMELINE (style Google Calendar) === */
.week-timeline {
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
}
.wt-header {
  display: grid;
  grid-template-columns: 36px repeat(6, 1fr);
  background: var(--card-strong);
  position: sticky;
  top: calc(var(--safe-top) + 4px);
  z-index: 4;
  border-bottom: 1px solid var(--border);
}
.wt-corner {}
.wt-daycell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 2px;
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  color: var(--fg-soft);
  font-variant-numeric: tabular-nums;
  transition: background .15s ease;
}
.wt-daycell:active { background: var(--card); }
.wt-daycell .dow {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  opacity: 0.7;
}
.wt-daycell .dnum {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 2px;
  color: var(--fg);
}
.wt-daycell.today .dnum { color: var(--accent); font-weight: 800; }
.wt-daycell.today .dow  { color: var(--accent); opacity: 1; }

.wt-body {
  display: grid;
  grid-template-columns: 36px repeat(6, 1fr);
  position: relative;
  background: var(--card-strong);
}
.wt-hourcol {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.wt-hourrow {
  height: var(--hour-px);
  font-size: 9.5px;
  color: var(--muted);
  text-align: right;
  padding: 2px 4px 0 0;
  font-variant-numeric: tabular-nums;
  border-top: 1px solid var(--border);
}
.wt-hourrow:first-child { border-top: none; padding-top: 0; }

.wt-daycol {
  position: relative;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.wt-daycol:first-of-type { border-left: none; }
.wt-daycol.today {
  background: color-mix(in srgb, var(--accent) 5%, transparent);
}
.wt-hourline {
  height: var(--hour-px);
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}
.wt-hourline:first-child { border-top: none; }

.wt-block {
  position: absolute;
  left: 2px;
  right: 2px;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--type-color) 28%, var(--card-strong)),
      color-mix(in srgb, var(--type-color) 16%, var(--card-strong)));
  border: 1px solid color-mix(in srgb, var(--type-color) 45%, transparent);
  border-left: 3px solid var(--type-color);
  border-radius: 7px;
  padding: 3px 4px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  color: var(--fg);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  z-index: 1;
  box-shadow: 0 1px 3px color-mix(in srgb, var(--type-color) 25%, transparent);
  transition: transform .1s ease;
}
.wt-block:active { transform: scale(0.97); }
.wt-bbadge {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--type-color);
  text-transform: uppercase;
  line-height: 1;
}
.wt-btitle {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.wt-broom {
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
  margin-top: auto;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Trait "maintenant" rouge sur la colonne du jour courant */
.wt-now {
  position: absolute;
  left: -2px;
  right: -2px;
  height: 2px;
  background: var(--ex);
  z-index: 5;
  box-shadow: 0 0 6px color-mix(in srgb, var(--ex) 60%, transparent);
}
.wt-now::before {
  content: '';
  position: absolute;
  left: -4px; top: -3px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ex);
}

/* Mobile : cacher le badge si bloc trop petit (économie d'espace) */
@media (max-width: 380px) {
  .wt-block { font-size: 9.5px; padding: 2px 3px; }
  .wt-btitle { font-size: 10px; -webkit-line-clamp: 2; }
  .wt-broom { font-size: 8.5px; }
  .wt-bbadge { font-size: 8px; }
}

/* === Settings dialog === */
.settings-dlg {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 560px;
  width: calc(100% - 24px);
}
.settings-dlg::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.settings-form {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: var(--radius-lg);
}
.settings-form h2 { margin: 0; font-size: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--fg-soft); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row.right { justify-content: flex-end; }
.btn {
  border: 1px solid var(--border);
  background: var(--card-strong);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
}
.btn.primary { background: var(--accent); color: white; border-color: transparent; }
.btn.danger { background: var(--danger); color: white; border-color: transparent; }
details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  padding: 6px 0;
}
.muted { color: var(--muted); font-size: 12px; }
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.artois-help {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}
.artois-help summary { font-weight: 700; color: var(--fg); }
.tuto {
  margin: 8px 0 4px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--fg-soft);
  line-height: 1.5;
}
.tuto li { margin-bottom: 6px; }
.tuto code {
  font-size: 11px;
  background: var(--card-strong);
  padding: 1px 6px;
  border-radius: 6px;
}

/* === Toast === */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 18px);
  transform: translateX(-50%) translateY(20px);
  background: var(--card-strong);
  border: 1px solid var(--border);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 10;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === Détails d'un cours === */
.details-dlg {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 480px;
  width: calc(100% - 24px);
}
.details-dlg::backdrop {
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.details-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}
.details-content::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--type-color, var(--accent));
}
.details-content h2 {
  margin: 8px 0 0;
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.details-content .kv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.details-content .kv {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.details-content .kv .k {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  font-weight: 700;
}
.details-content .kv .v {
  font-size: 14px;
  color: var(--fg);
  word-break: break-word;
}
.details-content .desc {
  font-size: 13px;
  color: var(--fg-soft);
  white-space: pre-wrap;
  background: var(--card);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
}

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