:root {
  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --line: #e4e7ef;
  --line-strong: #d3d8e4;
  --text: #151a2d;
  --muted: #667085;
  --faint: #98a2b3;
  --brand: #4338ca;
  --brand-dark: #3730a3;
  --brand-soft: #eef0ff;
  --cyan: #0ea5e9;
  --green: #059669;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px -16px rgba(16, 24, 40, .18);
  --radius: 14px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll { overflow: hidden; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }

.app-shell {
  width: min(1400px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 0;
  background: rgba(244, 245, 249, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(228, 231, 239, .9);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #5b4bea, #3730a3);
  box-shadow: 0 6px 14px -6px rgba(67, 56, 202, .7);
}
.brand-mark svg { width: 25px; height: 25px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 18px; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.official-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #065f46;
  background: var(--green-soft);
  border: 1px solid #d1fae5;
  padding: 5px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.official-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #10b981; box-shadow: 0 0 0 3px #d1fae5; }

.year-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.year-picker select {
  height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  font-weight: 700;
  color: var(--text);
}

.source-link { font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.source-link:hover { color: var(--brand); text-decoration: none; }
.source-link svg { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
  margin-top: 2px;
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  padding: 14px 1px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Layout ---------- */
.main { flex: 1; padding: 28px 0 10px; }
.view { animation: fadeUp .25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -.03em;
}
.page-head p { margin: 0; color: var(--muted); font-size: 14px; max-width: 720px; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-secondary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-secondary:hover { background: var(--brand-dark); border-color: var(--brand-dark); text-decoration: none; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: #344054; }
.btn-ghost:hover { background: var(--surface-soft); border-color: #b9c0d0; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: #475467;
  font-size: 15px;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); border-color: #c7c9f5; }
.icon-btn svg { width: 16px; height: 16px; transition: transform .15s; }
.icon-btn.is-asc svg { transform: rotate(180deg); }

:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }

/* ---------- Banner / toast ---------- */
.banner {
  margin-bottom: 18px;
  padding: 12px 15px;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13.5px;
}
.banner strong { display: block; margin-bottom: 2px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #111827;
  color: #f9fafb;
  font-size: 13px;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .45);
  animation: fadeUp .2s ease both;
}

/* ---------- Filters ---------- */
.filters {
  display: grid;
  grid-template-columns: minmax(230px, 2.2fr) repeat(4, minmax(118px, 1fr)) minmax(96px, .7fr) auto;
  gap: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.search-field:focus-within { border-color: #818cf8; box-shadow: 0 0 0 3px #e0e7ff; }
.search-field svg { width: 17px; height: 17px; color: var(--faint); flex: none; }
.search-field input { border: 0; outline: 0; width: 100%; background: transparent; font-size: 13.5px; }
.search-field input::placeholder { color: var(--faint); }

.filters select,
.filters input[type="number"],
.dash-filters select,
.sort-control select,
.year-picker select {
  height: 38px;
  width: 100%;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  background-size: 11px;
  appearance: none;
  -webkit-appearance: none;
  font-size: 12.5px;
  color: #344054;
}
.filters input[type="number"] { background-image: none; padding-right: 10px; }
.filters select:focus,
.filters input:focus,
.dash-filters select:focus,
.sort-control select:focus { outline: 0; border-color: #818cf8; box-shadow: 0 0 0 3px #e0e7ff; }

.filters .btn { height: 38px; }

/* ---------- Results bar ---------- */
.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 2px 10px;
}
.result-count { margin: 0; font-size: 12.5px; color: var(--muted); }
.result-count strong { color: var(--text); }
.sort-control { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.sort-control select { width: auto; min-width: 150px; height: 34px; }
.sort-control .icon-btn { width: 34px; height: 34px; }

/* ---------- Table ---------- */
.table-wrap { position: relative; overflow-x: auto; min-height: 240px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 980px; }

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .055em;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.data-table th.num { text-align: right; }
.data-table th[data-sort] { cursor: pointer; user-select: none; }
.data-table th[data-sort]:hover { color: var(--brand); }
.data-table th.is-sorted { color: var(--brand); }
.arrow {
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
}
.arrow.asc { border-bottom: 4.5px solid currentColor; }
.arrow.desc { border-top: 4.5px solid currentColor; }

.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #eef0f5;
  font-size: 12.5px;
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; transition: background .12s; }
.data-table tbody tr:hover { background: #f7f8ff; }
.data-table tbody tr:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cell-formation { max-width: 360px; }
.formation-name {
  display: block;
  font-weight: 600;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.formation-etab {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
}
.cell-lieu span { display: block; }
.cell-lieu .muted { color: var(--muted); font-size: 11px; }
.cell-filiere { max-width: 190px; }
.chip {
  display: inline-block;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 11px;
  color: #475467;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: .01em;
}
.badge-sel { background: var(--red-soft); color: #b42318; border: 1px solid #fee4e2; }
.badge-non { background: var(--green-soft); color: #047857; border: 1px solid #d1fae5; }
.badge-neutral { background: #f2f4f7; color: #475467; border: 1px solid #eaecf0; }

.rate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rate-hot { color: #b42318; font-weight: 700; }
.rate-warm { color: #b54708; font-weight: 600; }
.rate-cool { color: #344054; }
.est {
  display: inline-block;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 4px;
  background: #f2f4f7;
  color: #667085;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  vertical-align: 1px;
}

.empty-state {
  display: flex;  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.empty-state strong { color: var(--text); font-size: 14px; }

.table-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: blur(1px);
  font-size: 13px;
  color: var(--muted);
  z-index: 3;
}
.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #d9ddf0;
  border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mobile result cards ---------- */
.mobile-results { display: none; }

@media (max-width: 760px) {
  .data-table { display: none; }
  .table-wrap { min-height: 140px; overflow: visible; }
  .mobile-results { display: grid; }
  .mobile-card {
    padding: 14px 16px;
    border-bottom: 1px solid #eef0f5;
    cursor: pointer;
    transition: background .12s;
  }
  .mobile-card:last-child { border-bottom: 0; }
  .mobile-card:hover { background: #f7f8ff; }
  .mobile-card:focus-visible { outline: 2px solid #6366f1; outline-offset: -2px; }
  .mobile-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }
  .mobile-place { font-size: 11px; color: var(--muted); }
  .mobile-card h3 { margin: 7px 0 2px; font-size: 13.5px; line-height: 1.35; letter-spacing: -.01em; }
  .mobile-card p { margin: 0; color: var(--muted); font-size: 11.5px; }
  .mobile-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #eef0f5;
  }
  .mobile-metrics div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
  .mobile-metrics span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .045em;
    color: var(--faint);
    white-space: nowrap;
  }
  .mobile-metrics strong { font-size: 12.5px; font-variant-numeric: tabular-nums; }
  .mobile-foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 10.5px;
    color: var(--muted);
  }
  .mobile-foot span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 42px;
  font-size: 12.5px;
  color: var(--muted);
}
.pagination .btn { height: 34px; }

/* ---------- Dashboard ---------- */
.dash-filters { display: flex; gap: 8px; }
.dash-filters select { width: 190px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.kpi { padding: 14px 15px 13px; }
.kpi-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .055em; font-weight: 700; color: var(--muted); }
.kpi-value { display: block; margin: 5px 0 2px; font-size: 24px; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kpi-sub { display: block; font-size: 10.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi:first-child .kpi-value { color: var(--brand); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.chart-card { padding: 16px 18px 12px; min-width: 0; }
.chart-wide { margin-top: 16px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.chart-head h2 { margin: 0 0 2px; font-size: 14.5px; letter-spacing: -.01em; }
.chart-head p { margin: 0; font-size: 11.5px; color: var(--muted); }
.chart-note { font-size: 11px; color: var(--faint); white-space: nowrap; }
.chart { width: 100%; height: 320px; }
.chart-tall { height: 440px; }
.chart-error {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.prose { padding: 22px 24px; }
.prose h2 { margin: 0 0 10px; font-size: 16.5px; letter-spacing: -.01em; }
.prose p { margin: 0 0 11px; font-size: 13.5px; line-height: 1.65; color: #344054; }
.prose a { font-weight: 600; }
.prose .btn { text-decoration: none; }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.definitions { margin: 0; }
.definitions dt { margin-top: 12px; font-weight: 700; font-size: 13px; }
.definitions dt:first-child { margin-top: 0; }
.definitions dd { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.55; }

.limits { margin: 0; padding-left: 18px; }
.limits li { margin-bottom: 10px; font-size: 12.8px; line-height: 1.55; color: #344054; }
.limits li:last-child { margin-bottom: 0; }
.limits strong { color: var(--text); }

pre {
  margin: 10px 0 14px;
  padding: 13px 15px;
  border-radius: 10px;
  background: #111827;
  color: #e5e7eb;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.65;
}
code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }
p code, li code, dd code { background: #f2f4f7; color: #475467; padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.muted { color: var(--muted); }

/* ---------- Footer ---------- */
.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 2px 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 11.5px;
}

/* ---------- Drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: flex-end; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .46);
  backdrop-filter: blur(2px);
  animation: fadeIn .18s ease both;
}
.drawer-panel {
  position: relative;
  width: min(780px, 100vw);
  height: 100%;
  overflow-y: auto;
  background: var(--bg);
  box-shadow: -20px 0 60px -20px rgba(15, 23, 42, .35);
  animation: slideIn .22s cubic-bezier(.22, .61, .36, 1) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }

.drawer-toolbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  background: rgba(244, 245, 249, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.drawer-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.drawer-content { padding: 20px 22px 44px; }

.detail-hero { padding: 18px 20px; margin-bottom: 14px; }
.detail-hero h2 { margin: 7px 0 5px; font-size: 21px; line-height: 1.25; letter-spacing: -.025em; }
.detail-hero .etab { margin: 0; color: #344054; font-size: 13.5px; font-weight: 600; }
.detail-hero .place { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.detail-badges { display: flex; flex-wrap: wrap; gap: 6px; }

.detail-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.detail-kpis .kpi { padding: 12px 14px; }
.detail-kpis .kpi-value { font-size: 20px; }

.detail-section { padding: 18px 20px; margin-bottom: 14px; }
.detail-section h3 { margin: 0 0 12px; font-size: 14px; letter-spacing: -.01em; }
.detail-chart { width: 100%; height: 240px; }

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 22px;
  margin: 0;
}
.info-grid div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed #eef0f5; font-size: 12px; }
.info-grid dt { color: var(--muted); }
.info-grid dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }

.profile { display: grid; gap: 9px; }
.profile-row { display: grid; grid-template-columns: 150px 1fr 52px; align-items: center; gap: 10px; font-size: 12px; }
.profile-row span:first-child { color: var(--muted); }
.profile-bar { height: 7px; border-radius: 99px; background: #eef0f5; overflow: hidden; }
.profile-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #4338ca); }
.profile-row strong { text-align: right; font-variant-numeric: tabular-nums; }

.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-note { margin: 10px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.detail-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  z-index: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .filters { grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(120px, 1fr)) minmax(100px, .7fr); }
  .filters .btn { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  .app-shell { width: min(100% - 32px, 1400px); }
  .official-badge { display: none; }
  .filters { grid-template-columns: 1fr 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters .btn { grid-column: auto; }
  .chart-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .app-shell { width: calc(100% - 24px); }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 0; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  .source-link { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-text strong { font-size: 16px; }
  .tabs { gap: 16px; overflow-x: auto; }
  .tab { font-size: 12.5px; white-space: nowrap; }
  .main { padding-top: 20px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-head h1 { font-size: 23px; }
  .page-head .btn { align-self: flex-start; }
  .dash-filters { flex-wrap: wrap; }
  .dash-filters select { width: 100%; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-field { grid-column: 1 / -1; }
  .filters .btn { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .kpi-value { font-size: 21px; }
  .kpi-sub { white-space: normal; }
  .results-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .sort-control { justify-content: flex-end; }
  .chart-card { padding: 14px 12px 8px; }
  .chart { height: 280px; }
  .chart-tall { height: 360px; }
  .footer { flex-direction: column; gap: 4px; }
  .detail-kpis { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .profile-row { grid-template-columns: 120px 1fr 46px; }
  .drawer-content { padding: 14px 12px 34px; }
  .drawer-toolbar { padding: 10px 14px; }
  .detail-hero, .detail-section { padding: 15px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
