/* ==========================================================
   Radio école .tl — feuille de style principale
   Mobile-first : 1 colonne par défaut, multi-colonnes >= 768px
   ========================================================== */

:root {
  --brand: #7c3aed;
  --brand-dark: #5b21b6;
  --brand-soft: #f3ecff;
  --accent: #f59e0b;
  --accent-soft: #fff4e0;
  --ink: #171326;
  --ink-soft: #5c5670;
  --line: #e8e4f2;
  --bg: #ffffff;
  --bg-alt: #f7f5fc;
  --white: #ffffff;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --shadow: 0 10px 30px rgba(35, 20, 80, .08);
  --shadow-sm: 0 2px 10px rgba(35, 20, 80, .06);
  --tabbar-h: 62px;
  --player-h: 64px;
  --topbar-h: 58px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 16px);
}

body.has-player { padding-bottom: calc(var(--tabbar-h) + var(--player-h) + env(safe-area-inset-bottom, 0px) + 16px); }

body.is-locked { overflow: hidden; }

img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75rem; }
ul { margin: 0; padding: 0; list-style: none; }

.icon { flex: none; vertical-align: middle; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 18px; }
.muted { color: var(--ink-soft); }
.h2-line { margin-bottom: 1rem; }
.center { text-align: center; }

/* ------------------------- Boutons ------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  text-decoration: none;
  background: var(--bg-alt);
  color: var(--ink);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(124, 58, 237, .28); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-accent { background: var(--accent); color: #3b2500; }
.btn-ghost { background: rgba(255, 255, 255, .14); color: inherit; border-color: currentColor; }
.btn-light { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn-sm { padding: .45rem .75rem; font-size: .82rem; }
.btn-block { width: 100%; margin-top: .75rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-icon { padding: .5rem; width: 38px; height: 38px; border-radius: 12px; background: #fff; border-color: var(--line); color: var(--ink-soft); }

.link-more { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .9rem; white-space: nowrap; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .88rem; margin-bottom: .75rem; }

/* ------------------------- Pills / badges ------------------------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.pill-live { background: #ffe4e4; color: #b91c1c; }
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; display: inline-block;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, .7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
.badge { display: inline-block; padding: .18rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-attente { background: var(--accent-soft); color: #92400e; }
.badge-approuve { background: #e7f8ee; color: #15803d; }
.badge-refuse { background: #fdecec; color: #b91c1c; }
.badge-actif { background: #e7f8ee; color: #15803d; }
.badge-suspendu { background: #fdecec; color: #b91c1c; }

/* ------------------------- Barre du haut ------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: .6rem 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  min-height: var(--topbar-h);
}
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff; flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 800; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { display: flex; align-items: center; gap: .35rem; font-size: .74rem; color: var(--ink-soft); font-weight: 600; }

.btn-install {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .5rem .8rem; border-radius: 999px;
  border: 1px solid var(--brand);
  background: #fff; color: var(--brand);
  font: inherit; font-weight: 700; font-size: .82rem; cursor: pointer;
  white-space: nowrap;
}
.btn-install:hover { background: var(--brand-soft); }
.btn-install-lg { font-size: .9rem; padding: .65rem 1rem; margin-top: .5rem; }

/* ------------------------- Navigation basse ------------------------- */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  display: flex;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tabbar .tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: .5rem .15rem;
  min-height: var(--tabbar-h);
  color: var(--ink-soft);
  font-size: .68rem;
  font-weight: 600;
  text-decoration: none;
}
.tabbar .tab:hover { text-decoration: none; }
.tabbar .tab.is-active { color: var(--brand); }
.tabbar .tab.is-active .icon { transform: translateY(-1px); }

/* ------------------------- Lecteur audio ------------------------- */
.player-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  z-index: 55;
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .55rem 14px;
  background: linear-gradient(135deg, #2b1a52, #4c1d95);
  color: #fff;
  box-shadow: 0 -8px 24px rgba(20, 10, 50, .25);
}
.pb-toggle, .pb-mute {
  border: none; background: rgba(255, 255, 255, .16); color: #fff;
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.pb-toggle { background: var(--accent); color: #3b2500; }
.pb-info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.pb-title { font-weight: 700; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-sub { font-size: .72rem; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-mute.is-muted { background: rgba(239, 68, 68, .5); }

/* ------------------------- Sections ------------------------- */
.section { padding: 2rem 0; }
.section-alt { background: var(--bg-alt); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}
.page-hero { padding: 1.6rem 0 0; }
.page-hero h1 { font-size: 1.9rem; }
.section .card + .card { margin-top: 1rem; }

/* ------------------------- Héros accueil ------------------------- */
.hero { position: relative; overflow: hidden; color: #fff; padding: 3rem 0 2.5rem; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(160deg, rgba(76, 29, 149, .94), rgba(124, 58, 237, .82) 55%, rgba(245, 158, 11, .75));
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-size: 2.15rem; color: #fff; margin-top: .7rem; }
.hero-tagline { font-size: 1.02rem; max-width: 46ch; opacity: .95; }
.hero-onair {
  background: rgba(255, 255, 255, .14);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: .6rem .8rem;
  font-size: .9rem;
  margin: .4rem 0 1.1rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.hero-actions .btn-primary { background: #fff; color: var(--brand-dark); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }
.hero-actions .btn-primary:hover { background: #f6f2ff; }
.hero-actions .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .08); }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .7rem;
  margin-top: 1.6rem;
}
.hero-stats .stat {
  background: rgba(255, 255, 255, .13);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  display: flex;
  flex-direction: column;
}
.hero-stats .stat strong { font-size: 1.35rem; }
.hero-stats .stat span { font-size: .76rem; opacity: .85; text-transform: uppercase; letter-spacing: .05em; }

/* ------------------------- Cartes ------------------------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.card h2 { font-size: 1.15rem; }
.card h3 { font-size: 1rem; }

.grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }

.emission-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.emission-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.emission-card .thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--brand-soft); }
.emission-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.emission-card .thumb .pill { position: absolute; left: .6rem; top: .6rem; background: rgba(255, 255, 255, .92); }
.emission-card .body { padding: .95rem 1rem 1.1rem; display: flex; flex-direction: column; flex: 1 1 auto; }
.emission-card h3 { margin-bottom: .35rem; }
.emission-card p { font-size: .88rem; color: var(--ink-soft); margin-bottom: .7rem; }
.emission-card .meta { margin-top: auto; display: flex; align-items: center; justify-content: space-between; font-size: .78rem; color: var(--ink-soft); gap: .5rem; }

.idea-card, .today-item, .msg-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: .9rem 1rem;
  box-shadow: var(--shadow-sm);
}
.idea-card h3 { font-size: .98rem; margin-bottom: .3rem; }
.idea-card p { font-size: .87rem; color: var(--ink-soft); margin-bottom: .5rem; }
.idea-card .who { font-size: .76rem; color: var(--brand); font-weight: 700; }

/* ------------------------- Épisodes ------------------------- */
.episode-list { display: flex; flex-direction: column; gap: .7rem; }
.episode {
  display: flex;
  align-items: center;
  gap: .8rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .7rem .8rem;
  box-shadow: var(--shadow-sm);
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.episode:hover { border-color: #d6c9f7; }
.episode .ep-thumb { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; background: var(--brand-soft); }
.episode .ep-main { flex: 1 1 auto; min-width: 0; }
.episode .ep-title { font-weight: 700; font-size: .95rem; display: block; }
.episode .ep-sub { font-size: .78rem; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: .15rem .5rem; }
.episode .ep-play {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; flex: none; border: none; cursor: pointer;
}
.episode .ep-play.is-playing { background: var(--accent); color: #3b2500; }
.episode .ep-desc { font-size: .82rem; color: var(--ink-soft); margin: .25rem 0 0; display: none; }
.episode.is-open .ep-desc { display: block; }

/* ------------------------- Grille ------------------------- */
.day-tabs {
  display: flex;
  gap: .4rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  margin-bottom: 1rem;
  scrollbar-width: none;
}
.day-tabs::-webkit-scrollbar { display: none; }
.day-tab {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: .5rem 1rem;
  font: inherit;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
}
.day-tab.is-active { background: var(--brand); color: #fff; border-color: var(--brand); }

.schedule-list { display: flex; flex-direction: column; gap: .7rem; }
.slot {
  display: flex;
  gap: .9rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem .95rem;
  box-shadow: var(--shadow-sm);
}
.slot-time {
  flex: none;
  font-weight: 800;
  font-size: .9rem;
  color: var(--brand);
  min-width: 72px;
}
.slot-body h3 { font-size: .98rem; margin-bottom: .15rem; }
.slot-body p { font-size: .83rem; color: var(--ink-soft); margin: 0; }
.slot.is-today { border-color: var(--brand); background: linear-gradient(135deg, #faf7ff, #fff); }

.today-card { display: flex; flex-direction: column; gap: .7rem; }

/* ------------------------- Toolbar / chips ------------------------- */
.toolbar { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.1rem; }
.field { display: flex; align-items: center; gap: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .9rem; color: var(--ink-soft); }
.field-search input { border: none; outline: none; font: inherit; flex: 1 1 auto; background: transparent; color: var(--ink); }
.chips { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; }
.chip {
  flex: none;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: .4rem .85rem;
  font: inherit;
  font-size: .82rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip.is-active { background: var(--brand-soft); color: var(--brand-dark); border-color: #d6c9f7; }

/* ------------------------- Contact ------------------------- */
.contact-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.contact-list li { display: flex; gap: .7rem; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.contact-list li:last-child { border-bottom: none; }
.ci-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.contact-list strong { display: block; font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.info-note { display: flex; gap: .6rem; background: var(--accent-soft); border-radius: var(--radius); padding: .8rem; margin-top: .9rem; color: #7c4a03; }
.info-note p { margin: 0; font-size: .84rem; }

.form-card { display: flex; flex-direction: column; }
.field-label { font-size: .82rem; font-weight: 700; color: var(--ink-soft); margin: .6rem 0 .25rem; }
.input {
  width: 100%;
  font: inherit;
  font-size: .95rem;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(124, 58, 237, .14); }
textarea.input { resize: vertical; }
.form-status { font-size: .85rem; margin: .7rem 0 0; min-height: 1.2rem; }
.form-status.is-error { color: var(--danger); }
.form-status.is-ok { color: var(--success); }

/* ------------------------- Contribuer ------------------------- */
.contrib-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.contrib-main { display: flex; flex-direction: column; gap: 1rem; }
.contrib-side { display: flex; flex-direction: column; gap: 1rem; }
.grid-steps { gap: .8rem; }
.step-card { position: relative; }
.step-num {
  display: inline-grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 800; font-size: .9rem;
  margin-bottom: .5rem;
}
.tabs { display: flex; gap: .3rem; background: var(--bg-alt); padding: .3rem; border-radius: 999px; margin-bottom: .8rem; }
.tab-btn {
  flex: 1 1 0; border: none; background: transparent; font: inherit; font-weight: 700; font-size: .85rem;
  color: var(--ink-soft); padding: .5rem .6rem; border-radius: 999px; cursor: pointer;
}
.tab-btn.is-active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.auth-panel { display: flex; flex-direction: column; }
.member-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: .8rem; margin-bottom: .4rem; }
.ideas-mine { display: flex; flex-direction: column; gap: .6rem; }
.idea-cards { display: flex; flex-direction: column; gap: .7rem; }
.reporters-list li { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .88rem; }
.reporters-list li:last-child { border-bottom: none; }
.rep-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.rep-id { display: flex; align-items: center; gap: .55rem; min-width: 0; }

/* ------------------------- Bandeau CTA ------------------------- */
.cta-band {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: linear-gradient(135deg, var(--brand), #4c1d95 70%, #2b1a52);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1.6rem 1.3rem;
}
.cta-band h2 { color: #fff; }
.cta-band p { opacity: .92; margin: 0; }
.cta-band .btn-primary { background: #fff; color: var(--brand-dark); align-self: flex-start; }

/* ------------------------- Pied de page ------------------------- */
.site-footer { background: #1b1233; color: #e7e1f7; margin-top: 2rem; padding: 2rem 0 1.2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.site-footer h3 { font-size: .95rem; color: #fff; margin-bottom: .6rem; }
.site-footer .muted { color: #b6accd; }
.footer-brand { display: flex; align-items: center; gap: .5rem; font-size: 1rem; margin-bottom: .5rem; }
.footer-links li { padding: .25rem 0; }
.footer-links a, .footer-links span { color: #d9d1f0; display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; }
.footer-links a:hover { color: #fff; }
.store-logos { display: flex; gap: .5rem; margin-top: .7rem; }
.store-logo { display: inline-flex; align-items: center; gap: .35rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .3rem .7rem; font-size: .8rem; font-weight: 600; }
.footer-bottom {
  display: flex; flex-direction: column; gap: .4rem;
  border-top: 1px solid rgba(255, 255, 255, .12);
  margin-top: 1.4rem; padding-top: 1rem; font-size: .8rem; color: #b6accd;
}

/* ------------------------- Modale / toast / skeleton ------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(18, 10, 40, .55);
  display: grid; place-items: center;
  padding: 1rem;
}
.modal-card {
  position: relative;
  background: #fff; border-radius: var(--radius-lg);
  padding: 1.4rem 1.2rem;
  width: 100%; max-width: 460px;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
}
.modal-close { position: absolute; top: .7rem; right: .7rem; border: none; background: var(--bg-alt); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.install-steps { display: flex; flex-direction: column; gap: .7rem; margin: 1rem 0; }
.install-step { display: flex; gap: .7rem; background: var(--bg-alt); border-radius: var(--radius); padding: .75rem; }
.install-step p { margin: 0; font-size: .85rem; color: var(--ink-soft); }
.install-badge { width: 40px; height: 40px; border-radius: 12px; background: #fff; color: var(--brand); display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); }

.toast-host { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 18px); z-index: 110; display: flex; flex-direction: column; gap: .4rem; width: min(92vw, 420px); }
.toast {
  background: #22183d; color: #fff; border-radius: var(--radius-sm);
  padding: .7rem .9rem; font-size: .88rem; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
  animation: toastIn .2s ease;
}
.toast.is-error { background: #7f1d1d; }
.toast.is-ok { background: #14532d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.skeleton-card, .skeleton-row, .skeleton-line {
  background: linear-gradient(90deg, #f1edfa 25%, #e7e0f7 37%, #f1edfa 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius);
}
.skeleton-card { height: 220px; }
.skeleton-row { height: 74px; }
.skeleton-line { height: 14px; margin-bottom: .5rem; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.empty-state { text-align: center; color: var(--ink-soft); padding: 1.5rem 1rem; font-size: .92rem; }

/* ------------------------- Détail émission ------------------------- */
.detail-hero { position: relative; overflow: hidden; color: #fff; padding: 1.4rem 0 2rem; }
.detail-bg { position: absolute; inset: 0; z-index: 0; }
.detail-bg img { width: 100%; height: 100%; object-fit: cover; }
.detail-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(160deg, rgba(27, 18, 51, .93), rgba(76, 29, 149, .85)); }
.detail-head { position: relative; z-index: 1; }
.detail-head h1 { color: #fff; font-size: 1.9rem; }
.detail-head .pill { background: rgba(255, 255, 255, .2); color: #fff; }
.detail-head .back-link { color: #fff; }
.detail-desc { max-width: 60ch; opacity: .95; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; opacity: .9; margin: 0; }
.detail-meta span { display: inline-flex; align-items: center; gap: .35rem; }

/* ------------------------- Mentions légales ------------------------- */
.legal .card { margin-bottom: 1rem; }
.legal-list li { padding: .3rem 0; font-size: .92rem; }

/* ==========================================================
   Administration
   ========================================================== */
.admin-body { background: var(--bg-alt); }
.admin-shell { padding: 1rem 0 2rem; }
.admin-topbar { background: linear-gradient(135deg, #2b1a52, #4c1d95); color: #fff; }
.admin-topbar .brand-name, .admin-topbar .brand-sub { color: #fff; }
.admin-topbar .brand-sub { opacity: .8; }
.admin-topbar .btn-install { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .5); }

.admin-head { display: flex; flex-direction: column; gap: .8rem; margin-bottom: 1.1rem; }
.admin-head h1 { font-size: 1.5rem; margin: 0; }
.admin-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; margin-bottom: 1rem; }
.stat-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem .9rem; box-shadow: var(--shadow-sm); }
.stat-box .sb-top { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.stat-box .sb-value { font-size: 1.6rem; font-weight: 800; margin-top: .15rem; }
.stat-box .sb-note { font-size: .78rem; color: var(--ink-soft); }
.stat-box .sb-ico { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }

.chart-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.chart-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow-sm); }
.chart-box h3 { font-size: .98rem; margin-bottom: .7rem; }
.chart-canvas { position: relative; height: 260px; }

.bar-list { display: flex; flex-direction: column; gap: .6rem; }
.bar-row { display: flex; flex-direction: column; gap: .25rem; }
.bar-row .bar-label { display: flex; justify-content: space-between; font-size: .84rem; font-weight: 600; }
.bar-track { height: 8px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 999px; }

.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table.data { width: 100%; border-collapse: collapse; min-width: 620px; }
table.data th, table.data td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); font-size: .87rem; vertical-align: middle; }
table.data th { background: var(--bg-alt); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
table.data tr:last-child td { border-bottom: none; }
table.data td.actions { display: flex; gap: .35rem; flex-wrap: wrap; }
.td-title { font-weight: 700; }
.td-sub { font-size: .78rem; color: var(--ink-soft); }
.row-unread { background: #fffdf5; }

.list-cards { display: flex; flex-direction: column; gap: .7rem; }
.panel { display: none; }
.panel.is-active { display: block; }
.admin-toolbar { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.pager { display: flex; align-items: center; justify-content: center; gap: .8rem; padding: .9rem 0; font-size: .88rem; font-weight: 600; }

.login-screen { min-height: 70vh; display: grid; place-items: center; padding: 1.5rem 0; }
.login-card { width: 100%; max-width: 420px; }
.login-logo { width: 54px; height: 54px; border-radius: 16px; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; margin-bottom: .8rem; }

.field-grid { display: grid; grid-template-columns: 1fr; gap: .5rem .9rem; }
.form-row { display: flex; flex-direction: column; }
.modal-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.modal-card .form-card { padding: 0; border: none; box-shadow: none; }
.switch { display: flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 600; margin-top: .8rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--brand); }
.tag-list { display: flex; flex-wrap: wrap; gap: .35rem; }

/* ==========================================================
   Tablette et desktop
   ========================================================== */
@media (min-width: 600px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .field-grid { grid-template-columns: 1fr 1fr; }
  .grid-steps { grid-template-columns: repeat(3, 1fr); }
  .footer-bottom { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 768px) {
  body { padding-bottom: 2rem; }
  body.has-player { padding-bottom: calc(var(--player-h) + 1.5rem); }
  h1 { font-size: 2.3rem; }
  h2 { font-size: 1.6rem; }
  .hero { padding: 4.5rem 0 3.5rem; }
  .hero h1 { font-size: 3rem; }
  .section { padding: 3rem 0; }
  .grid-emissions { grid-template-columns: repeat(2, 1fr); }
  .grid-ideas { grid-template-columns: repeat(2, 1fr); }
  .contact-layout { grid-template-columns: 1fr 1.1fr; align-items: start; }
  .contrib-layout { grid-template-columns: 1.35fr 1fr; align-items: start; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .cta-band { flex-direction: row; align-items: center; justify-content: space-between; padding: 2rem 2.2rem; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .tabbar {
    position: sticky;
    bottom: auto;
    top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
    justify-content: center;
    gap: .4rem;
    padding: .5rem 18px;
    border-top: none;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .96);
  }
  .tabbar .tab {
    flex: 0 0 auto;
    flex-direction: row;
    gap: .4rem;
    min-height: 42px;
    padding: .45rem .9rem;
    border-radius: 999px;
    font-size: .86rem;
  }
  .tabbar .tab.is-active { background: var(--brand-soft); }
  .player-bar { bottom: 0; border-radius: 0; }
  .toast-host { bottom: 88px; }
  .detail-head h1 { font-size: 2.4rem; }
  .admin-head { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 1024px) {
  .grid-emissions { grid-template-columns: repeat(3, 1fr); }
  .grid-ideas { grid-template-columns: repeat(3, 1fr); }
  .chart-grid { grid-template-columns: 1.4fr 1fr; }
}

@media print {
  .tabbar, .player-bar, .topbar, .site-footer { display: none !important; }
  body { padding: 0; }
}

/* ==========================================================
   Tableaux de l'administration sur téléphone
   Sous 768px : on garde l'essentiel et on masque les colonnes
   secondaires, pour qu'aucun tableau ne soit écrasé.
   ========================================================== */
@media (max-width: 767px) {
  table.data { min-width: 0; }
  table.data th, table.data td { padding: .6rem .55rem; font-size: .82rem; }
  table.data th { font-size: .7rem; }

  /* Emissions : on masque Categorie et nombre d'episodes */
  #sub-emissions table.data tr > *:nth-child(2),
  #sub-emissions table.data tr > *:nth-child(3) { display: none; }

  /* Episodes : on masque Emission, Duree et Ecoutes */
  #sub-episodes table.data tr > *:nth-child(2),
  #sub-episodes table.data tr > *:nth-child(3),
  #sub-episodes table.data tr > *:nth-child(5) { display: none; }

  /* Grille : on masque la colonne Emission */
  #panel-grille table.data tr > *:nth-child(4) { display: none; }

  /* Membres : on masque Classe et nombre d'idees */
  #sub-users table.data tr > *:nth-child(2),
  #sub-users table.data tr > *:nth-child(3) { display: none; }

  .reporters-list li { font-size: .84rem; }
  .admin-tab span { font-size: .6rem; }
  .tabbar .tab { min-height: 58px; }
}
