:root {
  --bg: #f3f7f4;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #65717d;
  --line: #d7e0da;
  --accent: #087f8c;
  --accent-dark: #055e68;
  --accent-soft: #e4f5f3;
  --sun: #f4b942;
  --sun-soft: #fff3cf;
  --coral: #d75d4a;
  --coral-soft: #ffe9e2;
  --blue: #3867d6;
  --blue-soft: #e8efff;
  --history: #b94b3f;
  --geo: #15825f;
  --hggsp: #4e63c8;
  --intro: #a37a1c;
  --focus: #f4b942;
}

body.dark-theme {
  --bg: #101617;
  --panel: #1b2426;
  --ink: #edf1ef;
  --muted: #aeb8b5;
  --line: #314144;
  --accent: #65d4cf;
  --accent-dark: #a6efeb;
  --accent-soft: #173638;
  --sun: #ffd166;
  --sun-soft: #342b15;
  --coral: #ff8b78;
  --coral-soft: #3b211e;
  --blue: #9bb2ff;
  --blue-soft: #1f2944;
  --history: #ff9b88;
  --geo: #88d8ae;
  --hggsp: #b7c3ff;
  --intro: #f1d36f;
  --focus: #ffd166;
}

body.dark-theme {
  background:
    linear-gradient(180deg, rgba(16, 22, 23, 0.2) 0, rgba(16, 22, 23, 0) 240px),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, transparent) 0 22%, transparent 22% 100%),
    linear-gradient(315deg, color-mix(in srgb, var(--sun) 9%, transparent) 0 18%, transparent 18% 100%),
    var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84) 0, rgba(255, 255, 255, 0) 240px),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 13%, transparent) 0 22%, transparent 22% 100%),
    linear-gradient(315deg, color-mix(in srgb, var(--sun) 16%, transparent) 0 18%, transparent 18% 100%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.app-header {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, #fff), #ffffff 42%, color-mix(in srgb, var(--sun) 12%, #fff));
  box-shadow: 0 12px 34px rgba(31, 41, 51, 0.08);
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, var(--accent), var(--sun), var(--coral), var(--blue));
}

body.dark-theme .app-header,
body.dark-theme .filters,
body.dark-theme .detail-panel {
  background: #172123;
}

body.dark-theme .app-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 12%, #172123), #172123 44%, color-mix(in srgb, var(--sun) 10%, #172123));
  box-shadow: none;
}

.brand-block {
  min-width: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.4rem);
  line-height: 1.08;
}

.title-icon {
  width: 1.35em;
  height: 1.35em;
  flex: 0 0 auto;
  border-radius: 999px;
  object-fit: cover;
  box-shadow: 0 8px 18px color-mix(in srgb, #1f2937 22%, transparent);
}

.subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.35;
  white-space: nowrap;
}

.header-note {
  display: flex;
  align-items: center;
  width: min(620px, 100%);
  min-height: 92px;
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
}

h2 {
  font-size: 0.92rem;
}

.header-stats {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-height: 92px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
  white-space: nowrap;
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.header-stats strong {
  color: var(--ink);
  font-size: 1.8rem;
}

.header-stats small {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 800;
}

.theme-toggle,
.info-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
  border-color: var(--line);
  background: var(--sun-soft);
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 900;
}

.info-toggle {
  background: #ffffff;
  color: var(--accent-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.theme-toggle:hover,
.info-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.info-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 10;
  width: min(340px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgba(31, 41, 51, 0.16);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.info-panel p {
  margin-bottom: 8px;
}

.info-panel p:last-child {
  margin-bottom: 0;
}

.info-panel strong {
  color: var(--ink);
}

.info-panel a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.info-panel a:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - 94px);
}

.filters {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  align-items: end;
  gap: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(8px);
}

.detail-panel {
  display: none;
}

.filters,
.results-panel {
  padding: 20px;
}

.filters {
  padding-top: 10px;
  padding-bottom: 10px;
}

.filter-drawer {
  align-self: end;
  min-width: 150px;
}

.filter-drawer summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, #ffffff);
  color: var(--accent-dark);
  font-size: 0.86rem;
  font-weight: 900;
  cursor: pointer;
  list-style: none;
}

.filter-drawer summary::-webkit-details-marker {
  display: none;
}

.filter-drawer summary::before {
  content: "+";
  margin-right: 8px;
  font-weight: 900;
}

.filter-drawer[open] {
  grid-column: 1 / -1;
}

.filter-drawer[open] summary {
  width: auto;
  margin-bottom: 10px;
}

.filter-drawer[open] summary::before {
  content: "−";
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
  align-items: end;
  gap: 8px 10px;
}

.search-block {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 11%, #ffffff), color-mix(in srgb, var(--blue) 8%, #ffffff));
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 800;
}

.search-block input {
  min-height: 42px;
  border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
  font-size: 0.96rem;
}

input,
select,
button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

body.dark-theme input,
body.dark-theme select,
body.dark-theme button,
body.dark-theme .podcast-card,
body.dark-theme .sheet-block,
body.dark-theme .generated-box,
body.dark-theme .podcast-player,
body.dark-theme .audio-missing {
  background: var(--panel);
  color: var(--ink);
}

body.dark-theme .header-stats {
  background: color-mix(in srgb, var(--panel) 86%, var(--sun));
}

body.dark-theme .search-block {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, var(--panel)), color-mix(in srgb, var(--blue) 11%, var(--panel)));
}

body.dark-theme .header-note {
  background: var(--panel);
  color: var(--muted);
}

body.dark-theme .info-toggle,
body.dark-theme .info-panel {
  background: var(--panel);
}

body.dark-theme .filter-drawer summary {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
  color: var(--accent-dark);
}

body.dark-theme .podcast-card.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel));
}

body.dark-theme .podcast-card.card-seconde {
  border-left-color: #88d8ae;
  background: linear-gradient(90deg, color-mix(in srgb, #24a865 12%, var(--panel)) 0, var(--panel) 130px);
}

body.dark-theme .podcast-card.card-premiere {
  border-left-color: #9bb2ff;
  background: linear-gradient(90deg, color-mix(in srgb, #3867d6 13%, var(--panel)) 0, var(--panel) 130px);
}

body.dark-theme .podcast-card.card-hggsp {
  border-left-color: #b7c3ff;
  background: linear-gradient(90deg, color-mix(in srgb, #8060c8 14%, var(--panel)) 0, var(--panel) 130px);
}

body.dark-theme .podcast-card.card-terminale {
  border-left-color: #f1d36f;
  background: linear-gradient(90deg, color-mix(in srgb, #d88624 14%, var(--panel)) 0, var(--panel) 130px);
}

body.dark-theme .podcast-player {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--panel)), var(--panel));
  box-shadow: none;
}

body.dark-theme .series-link {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: color-mix(in srgb, var(--accent) 16%, var(--panel));
  color: var(--accent-dark);
}

body.dark-theme .series-link:hover {
  background: color-mix(in srgb, var(--accent) 24%, var(--panel));
  color: #ffffff;
}

body.dark-theme .sheet-note {
  background: color-mix(in srgb, var(--sun) 14%, var(--panel));
  color: #f7df95;
}

body.dark-theme .sheet-block,
body.dark-theme .quiz-item {
  box-shadow: none;
}

body.dark-theme .secondary-button,
body.dark-theme .chip,
body.dark-theme .tag,
body.dark-theme .quiz-item,
body.dark-theme .podcast-player.unavailable {
  background: #20282d;
}

body.dark-theme .tag,
body.dark-theme .chip {
  color: var(--muted);
}

body.dark-theme .chip.active,
body.dark-theme .primary-button {
  background: var(--accent);
  color: #061315;
}

input,
select {
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.86rem;
}

button {
  min-height: 32px;
  padding: 0 10px;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 35%, transparent);
  outline-offset: 2px;
}

.filter-block {
  min-width: 0;
  margin-top: 0;
}

.filter-block h2 {
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  letter-spacing: 0;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  width: auto;
  min-height: 28px;
  padding: 0 9px;
  border-color: color-mix(in srgb, var(--accent) 18%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, #ffffff);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.chip.active {
  border-color: var(--accent);
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 72%, var(--blue)));
  color: #ffffff;
}

.secondary-button {
  width: auto;
  min-width: 116px;
  min-height: 34px;
  margin-top: 0;
  border-color: color-mix(in srgb, var(--coral) 24%, var(--line));
  background: color-mix(in srgb, var(--coral) 10%, #ffffff);
  color: color-mix(in srgb, var(--coral) 75%, var(--ink));
  font-weight: 700;
}

.results-panel {
  min-width: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.toolbar p {
  margin-bottom: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px;
}

.inline-detail-card {
  display: block;
  grid-column: 1 / -1;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 26px rgba(31, 41, 51, 0.08);
}

.detail-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.detail-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
}

.detail-close:hover {
  border-color: color-mix(in srgb, var(--coral) 35%, var(--line));
  background: var(--coral-soft);
  color: var(--coral);
}

.load-more-row {
  display: flex;
  justify-content: center;
  grid-column: 1 / -1;
  padding: 8px 0 4px;
}

.load-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 42px;
  padding: 0 18px;
  border-color: color-mix(in srgb, var(--accent) 26%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, #ffffff);
  color: var(--accent-dark);
  font-weight: 900;
}

.load-more-button span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.load-more-button:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, #ffffff);
}

.podcast-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.podcast-card.card-seconde {
  border-left-color: #24a865;
  background: linear-gradient(90deg, #f3fcf7 0, var(--panel) 120px);
}

.podcast-card.card-premiere {
  border-left-color: #3867d6;
  background: linear-gradient(90deg, #f4f7ff 0, var(--panel) 120px);
}

.podcast-card.card-hggsp {
  border-left-color: #8060c8;
  background: linear-gradient(90deg, #faf5ff 0, var(--panel) 120px);
}

.podcast-card.card-terminale {
  border-left-color: #d88624;
  background: linear-gradient(90deg, #fff8ed 0, var(--panel) 120px);
}

.card-open {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.podcast-card:hover,
.podcast-card.active {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.11);
  transform: translateY(-1px);
}

.podcast-card.active {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, #ffffff), #ffffff);
}

.podcast-card.card-seconde.active {
  background: linear-gradient(90deg, #ecfbf3 0, #ffffff 150px);
}

.podcast-card.card-premiere.active {
  background: linear-gradient(90deg, #eef4ff 0, #ffffff 150px);
}

.podcast-card.card-hggsp.active {
  background: linear-gradient(90deg, #f7efff 0, #ffffff 150px);
}

.podcast-card.card-terminale.active {
  background: linear-gradient(90deg, #fff3df 0, #ffffff 150px);
}

.podcast-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.card-teaser {
  margin: -2px 0 0;
  color: color-mix(in srgb, var(--ink) 72%, var(--muted));
  font-size: 0.88rem;
  line-height: 1.38;
}

.availability-icons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.availability-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f1f4f2;
  color: var(--muted);
  line-height: 1;
}

.availability-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.availability-icon.available {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, #ffffff);
  color: var(--accent-dark);
}

.availability-icon.missing {
  opacity: 0.48;
}

body.dark-theme .availability-icon {
  background: color-mix(in srgb, var(--panel) 78%, #ffffff);
}

body.dark-theme .availability-icon.available {
  background: color-mix(in srgb, var(--accent) 15%, var(--panel));
  color: var(--accent-dark);
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-action-tools {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
}

.check-control input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--accent);
}

.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  color: #8a8f91;
  font-size: 1.1rem;
  line-height: 1;
}

.favorite-button.active {
  border-color: color-mix(in srgb, var(--coral) 42%, var(--line));
  background: var(--coral-soft);
  color: var(--coral);
}

.card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.card-facts span {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.card-facts span:not(:last-child)::after {
  content: "·";
  margin-left: 10px;
  color: #a7afa8;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef4ef;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.tag.level-tag {
  border: 1px solid transparent;
}

.level-seconde {
  background: #e4f8ee;
  color: #147a45;
  border-color: #91dbb2;
}

.level-premiere {
  background: #e8f0ff;
  color: #245aa8;
  border-color: #a8c4f6;
}

.level-hggsp {
  background: #f4e9ff;
  color: #7550a8;
  border-color: #d4b4f3;
}

.level-terminale {
  background: #fff1df;
  color: #9b5a13;
  border-color: #edc283;
}

select option.level-seconde {
  background: #e4f8ee;
  color: #147a45;
}

select option.level-premiere {
  background: #e8f0ff;
  color: #245aa8;
}

select option.level-hggsp {
  background: #f4e9ff;
  color: #7550a8;
}

select option.level-terminale {
  background: #fff1df;
  color: #9b5a13;
}

.tag.history {
  background: color-mix(in srgb, var(--history) 13%, #fff);
  color: var(--history);
}

.tag.geo {
  background: color-mix(in srgb, var(--geo) 13%, #fff);
  color: var(--geo);
}

.tag.hggsp {
  background: #f4e9ff;
  color: #7550a8;
  border-color: #d4b4f3;
}

.tag.intro {
  background: color-mix(in srgb, var(--intro) 18%, #fff);
  color: var(--intro);
}

.tag.draft-status {
  background: var(--sun-soft);
  color: color-mix(in srgb, var(--intro) 72%, var(--ink));
}

.tag.validated-status {
  background: color-mix(in srgb, var(--accent) 16%, #fff);
  color: var(--accent-dark);
}

.tag.audio-status {
  background: var(--blue-soft);
  color: var(--blue);
}

.card-section {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.empty-detail,
.detail-content {
  position: sticky;
  top: 20px;
}

.empty-detail {
  color: var(--muted);
}

.hidden {
  display: none;
}

.detail-content h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
  line-height: 1.18;
  color: var(--accent-dark);
}

.original-title {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

.detail-description,
.revision-sheet {
  color: var(--muted);
  line-height: 1.5;
}

.listen-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 40px;
  margin: 14px 0;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

.listen-link:hover {
  background: var(--accent-dark);
}

.detail-list {
  display: grid;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}

.detail-list li {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.detail-list span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-facts {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.4;
}

.detail-facts div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 34px;
}

.detail-facts span {
  min-width: 0;
}

.detail-facts strong {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
}

.revision-sheet {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.sheet-note {
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--focus) 45%, #ffffff);
  border-left: 4px solid var(--focus);
  border-radius: 8px;
  background: color-mix(in srgb, var(--focus) 16%, #ffffff);
  color: #5c481b;
  font-size: 0.84rem;
  font-weight: 700;
}

.validated-note {
  border-color: color-mix(in srgb, var(--accent) 38%, #ffffff);
  background: color-mix(in srgb, var(--accent) 10%, #ffffff);
  color: var(--accent-dark);
}

.validated-note a {
  color: var(--accent-dark);
  font-weight: 900;
}

.sheet-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-top: 4px solid color-mix(in srgb, var(--accent) 72%, var(--blue));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 41, 51, 0.05);
}

.sheet-block h3 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1rem;
}

.sheet-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sheet-heading-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 8%, #ffffff);
  color: var(--accent-dark);
  flex: 0 0 auto;
}

.sheet-heading-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.dark-theme .sheet-heading-icon {
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--accent-dark);
}

.sheet-block p:last-child,
.sheet-block ol:last-child,
.sheet-block ul:last-child {
  margin-bottom: 0;
}

.key-points {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

.structured-key-points {
  list-style: none;
  padding-left: 0;
}

.structured-key-points li {
  display: grid;
  grid-template-columns: minmax(112px, 0.28fr) 1fr;
  gap: 10px;
  align-items: start;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.structured-key-points li:last-child {
  border-bottom: 0;
}

.structured-key-points strong {
  color: var(--accent);
  font-size: 0.86rem;
}

.structured-key-points span {
  min-width: 0;
}

@media (max-width: 640px) {
  .structured-key-points li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.key-points li::marker {
  color: var(--accent);
  font-weight: 900;
}

.pending-content {
  margin-bottom: 0;
  color: var(--muted);
  font-style: italic;
}

.quiz-list {
  display: grid;
  gap: 8px;
}

.quiz-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: color-mix(in srgb, var(--blue) 4%, #ffffff);
}

.quiz-item summary {
  padding: 10px 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.quiz-options {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0 12px 10px;
}

.quiz-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  min-height: 0;
  padding: 9px 10px;
  border-color: color-mix(in srgb, var(--blue) 22%, var(--line));
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
}

.quiz-option span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 900;
}

.quiz-option:hover,
.quiz-option.selected {
  border-color: var(--blue);
  background: color-mix(in srgb, var(--blue) 7%, #ffffff);
}

.quiz-option.correct {
  border-color: var(--geo);
  background: color-mix(in srgb, var(--geo) 12%, #ffffff);
}

.quiz-option.incorrect {
  border-color: var(--coral);
  background: color-mix(in srgb, var(--coral) 12%, #ffffff);
}

.quiz-check {
  width: auto;
  min-height: 34px;
  margin: 0 12px 10px;
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

.quiz-check:disabled {
  border-color: var(--line);
  background: color-mix(in srgb, var(--line) 45%, #ffffff);
  color: var(--muted);
  cursor: not-allowed;
}

.quiz-feedback {
  margin: 0;
  padding: 0 16px 12px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
}

.quiz-feedback.correct {
  color: var(--geo);
}

.quiz-feedback.incorrect {
  color: var(--coral);
}

audio {
  width: 100%;
  margin: 12px 0 0;
}

.podcast-player {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--line));
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, #ffffff), #ffffff);
  box-shadow: 0 10px 22px rgba(31, 41, 51, 0.07);
}

.podcast-player.unavailable {
  border-color: var(--line);
  background: #fbfbf8;
}

.player-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}

.player-track + .player-track {
  padding-top: 14px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line));
}

.player-layout.has-thumbnail {
  grid-template-columns: minmax(92px, 128px) 1fr;
}

.player-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.player-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
  background: var(--accent-soft);
}

.player-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.player-header strong {
  display: block;
  color: var(--ink);
  font-size: 1.05rem;
}

.player-label {
  display: block;
  margin-bottom: 2px;
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.podcast-player audio {
  margin: 0;
}

.radiofrance-player {
  display: block;
  width: 100%;
  min-height: 144px;
  border: 0;
  border-radius: 8px;
  background: #eef1ec;
}

.podcast-player p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.podcast-player code {
  color: var(--ink);
  font-size: 0.86rem;
}

.source-link {
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.series-link {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  margin: 0 0 12px;
  padding: 9px 13px;
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 8%, #ffffff);
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.series-link:hover {
  background: color-mix(in srgb, var(--accent) 14%, #ffffff);
}

.site-footer {
  padding: 18px 32px 22px;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 6%, #ffffff);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-footer p {
  max-width: 960px;
  margin: 0 auto;
  text-align: center;
}

.license-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 10px auto 0;
}

.license-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
}

.site-footer a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

body.dark-theme .site-footer {
  background: color-mix(in srgb, var(--accent) 8%, var(--panel));
}

.sheet-block ol {
  padding-left: 20px;
}

@media (max-width: 1280px) {
  .filter-grid {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .secondary-button {
    min-height: 34px;
  }
}

@media (max-width: 980px) {
  .filters {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .secondary-button {
    width: 100%;
  }

  .empty-detail,
  .detail-content {
    position: static;
  }
}

@media (max-width: 760px) {
  .app-header {
    display: grid;
    gap: 16px;
    padding: 22px 18px 16px;
  }

  .header-tools {
    align-items: start;
    justify-content: space-between;
    width: 100%;
  }

  .header-stats {
    justify-items: start;
    white-space: normal;
  }

  .subtitle {
    white-space: normal;
  }

  .layout {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .filters,
  .results-panel,
  .site-footer {
    padding: 16px;
  }

  input,
  select {
    min-height: 42px;
    font-size: 0.95rem;
  }

  button {
    min-height: 36px;
  }

  .filters {
    grid-template-columns: 1fr;
    border-bottom: 1px solid var(--line);
  }

  .filter-drawer,
  .filter-drawer[open] {
    grid-column: auto;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-block {
    margin-top: 0;
  }

  .chip-group {
    gap: 7px;
  }

  .chip {
    min-height: 34px;
    font-size: 0.86rem;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar select {
    width: 100%;
  }

  .player-layout {
    grid-template-columns: 1fr;
  }

  .player-thumbnail {
    max-height: 180px;
    aspect-ratio: 16 / 9;
  }

  .player-header,
  .card-actions {
    align-items: center;
  }

  .podcast-card {
    padding: 13px;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .card-facts {
    display: grid;
    gap: 4px;
  }

  .card-facts span:not(:last-child)::after {
    content: "";
    margin-left: 0;
  }

  .detail-list li {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 480px) {
  .app-header {
    padding: 18px 14px 14px;
  }

  h1 {
    font-size: 1.45rem;
  }

  .header-tools {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .header-stats strong {
    font-size: 1.45rem;
  }

  .filters,
  .results-panel,
  .site-footer {
    padding: 14px;
  }

  .meta-row {
    gap: 5px;
  }

  .tag {
    max-width: 100%;
    white-space: normal;
  }

  .card-actions {
    display: grid;
    grid-template-columns: 1fr auto;
  }

  .card-action-tools {
    gap: 6px;
  }

  .favorite-button,
  .theme-toggle {
    width: 38px;
    min-height: 38px;
  }

  .podcast-player,
  .sheet-block {
    padding: 12px;
  }

  .radiofrance-player {
    min-height: 160px;
  }

  .player-header {
    display: grid;
    gap: 8px;
  }

  .player-header .tag {
    width: fit-content;
  }
}
