:root {
  --ep-blue: #1F5577;
  --ep-blue-light: #2A6B94;
  --ep-green: #1AC668;
  --ep-green-dark: #15A857;
  --ep-green-light: #E8F9F0;
  --ep-teal: #1BCEAC;
  --ep-teal-dark: #17B598;
  --ep-teal-light-bg: #F0FDF9;
  --ep-teal-lightest: #E6FFFA;
  --ep-bg-dark: #1A1A2E;
  --ep-bg-dark-surface: #16213E;
  --ep-bg-light: #F8F9FA;
  --ep-bg-white: #FFFFFF;
  --ep-text-heading: #1F5577;
  --ep-text-body: #2C3E50;
  --ep-text-secondary: #555555;
  --ep-text-muted: #6B7280;
  --ep-text-white: #FFFFFF;
  --ep-text-footer: #BDC3C7;
  --ep-amber: #FFC107;
  --ep-amber-text: #856404;
  --ep-border-light: #E5E7EB;
  --ep-gradient-blue: linear-gradient(135deg, #1F5577 0%, #2A6B94 100%);
  --ep-gradient-green-teal: linear-gradient(90deg, #1AC668, #1BCEAC);
  --ep-gradient-teal-bg: linear-gradient(135deg, #F0FDF9 0%, #E6FFFA 100%);
  --ep-gradient-amber: linear-gradient(135deg, #FFF3CD 0%, #FFEAA7 100%);
  --ep-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --ep-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --ep-shadow-email: 0 8px 30px rgba(31, 85, 119, 0.15);
  --ep-shadow-green: 0 4px 14px rgba(26, 198, 104, 0.3);
  --ep-radius-sm: 4px;
  --ep-radius-md: 6px;
  --ep-radius-lg: 8px;
  --ep-radius-xl: 12px;
  --ep-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ep-bg-light);
  color: var(--ep-text-body);
  font-family: var(--ep-font-family);
  letter-spacing: 0;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(27, 206, 172, 0.16), transparent 340px),
    linear-gradient(180deg, #F6F8FA 0%, #FFFFFF 52%, #F8F9FA 100%);
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.page-shell {
  width: min(1180px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.report-brief {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  gap: 36px;
  align-items: end;
  padding: 34px;
  border-radius: var(--ep-radius-xl);
  background: var(--ep-gradient-blue);
  box-shadow: var(--ep-shadow-email);
  overflow: hidden;
}

.report-brief::after {
  content: "";
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 0;
  height: 5px;
  border-radius: 9999px 9999px 0 0;
  background: var(--ep-gradient-green-teal);
}

.title-block {
  position: relative;
  min-width: 0;
  z-index: 1;
}

.brand-logo-link {
  display: inline-block;
  margin-bottom: 26px;
}

.brand-logo {
  display: block;
  width: 196px;
  max-width: 54vw;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.14));
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--ep-teal-lightest);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  color: var(--ep-text-white);
  font-size: clamp(2.4rem, 5.4vw, 5rem);
  font-weight: 800;
  line-height: 0.95;
}

.report-meta {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.98rem;
}

.report-meta span {
  color: var(--ep-text-white);
  font-weight: 750;
}

.brief-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.brief-stats span {
  min-height: 104px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--ep-radius-lg);
  background: rgba(255, 255, 255, 0.12);
  padding: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.brief-stats small,
.brief-stats em {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.brief-stats strong {
  display: block;
  margin: 12px 0 6px;
  color: var(--ep-text-white);
  font-size: 1.75rem;
  line-height: 1;
}

.brief-stats em {
  color: rgba(255, 255, 255, 0.72);
  text-transform: none;
  font-weight: 500;
}

.executive-note {
  position: relative;
  max-width: 990px;
  margin: 28px 0 34px;
  padding-left: 18px;
  color: var(--ep-text-body);
  font-size: 1.05rem;
  font-weight: 650;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.executive-note::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 5px;
  border-radius: 9999px;
  background: var(--ep-gradient-green-teal);
}

.totals-section,
.controls-band {
  margin-top: 32px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-heading h2 {
  color: var(--ep-text-heading);
  font-size: 1.12rem;
  font-weight: 800;
}

.section-heading span {
  color: var(--ep-text-muted);
  font-size: 0.84rem;
}

.totals-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-xl);
  background: var(--ep-bg-white);
  box-shadow: var(--ep-shadow-sm);
}

.totals-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.totals-table th {
  background: var(--ep-blue);
  color: var(--ep-text-white);
  text-align: left;
  padding: 15px 18px;
  font-size: 0.76rem;
  font-weight: 800;
}

.totals-table td {
  padding: 16px 18px;
  border-top: 1px solid var(--ep-border-light);
  color: var(--ep-text-body);
  background: var(--ep-bg-white);
}

.totals-table td:not(:first-child),
.totals-table th:not(:first-child) {
  text-align: right;
}

.totals-table tr:nth-child(even) td {
  background: #F8FFFE;
}

.totals-table tr.is-success td {
  background: var(--ep-green-light);
  color: var(--ep-text-body);
}

.totals-table tr.is-total td {
  background: var(--ep-gradient-teal-bg);
  color: var(--ep-text-heading);
  font-weight: 800;
}

.totals-table small {
  display: inline-block;
  margin-left: 8px;
  color: var(--ep-text-muted);
  font-size: 0.64rem;
  font-weight: 800;
  text-transform: uppercase;
}

.table-note {
  margin-top: 12px;
  color: var(--ep-text-muted);
  text-align: right;
  font-size: 0.82rem;
}

.controls-band {
  padding-top: 8px;
}

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(170px, 220px);
  gap: 12px;
  align-items: end;
  max-width: 100%;
}

.search-box,
.select-box {
  display: grid;
  gap: 7px;
  color: var(--ep-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input,
.select-box select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-md);
  background: var(--ep-bg-white);
  color: var(--ep-text-body);
  padding: 0 13px;
  outline: none;
  box-shadow: var(--ep-shadow-sm);
}

.search-box input:focus,
.select-box select:focus {
  border-color: var(--ep-teal);
  box-shadow: 0 0 0 3px rgba(27, 206, 172, 0.16);
}

.segmented {
  display: flex;
  height: 44px;
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-md);
  background: var(--ep-bg-white);
  box-shadow: var(--ep-shadow-sm);
  overflow: hidden;
}

.segmented button {
  border: 0;
  border-right: 1px solid var(--ep-border-light);
  background: transparent;
  color: var(--ep-text-secondary);
  padding: 0 16px;
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button.is-active {
  background: var(--ep-green);
  color: var(--ep-text-white);
  font-weight: 800;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.territory-card {
  position: relative;
  min-height: 690px;
  border: 1px solid var(--ep-border-light);
  border-left: 5px solid var(--ep-teal);
  border-radius: var(--ep-radius-xl);
  background: var(--ep-bg-white);
  box-shadow: var(--ep-shadow-md);
  overflow: hidden;
}

.territory-card::before {
  content: "";
  display: block;
  height: 6px;
  background: var(--ep-gradient-green-teal);
}

.territory-card.is-watch {
  border-left-color: var(--ep-amber);
}

.territory-card.is-watch::before {
  background: var(--ep-gradient-amber);
}

.card-header,
.attainment-row,
.hero-metrics,
.mini-metrics,
.progress-rail,
.mix-heading,
.mix-bar,
.mix-labels,
.card-footer {
  margin-left: 18px;
  margin-right: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0 15px;
  border-bottom: 1px solid var(--ep-border-light);
}

.card-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
}

.territory-code {
  color: var(--ep-blue);
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: underline;
}

.card-kicker span {
  border: 1px solid rgba(26, 198, 104, 0.28);
  border-radius: var(--ep-radius-sm);
  background: var(--ep-green-light);
  color: var(--ep-green-dark);
  padding: 4px 8px;
  font-size: 0.62rem;
  font-weight: 850;
  text-transform: uppercase;
}

.is-watch .card-kicker span {
  border-color: rgba(255, 193, 7, 0.4);
  background: #FFF8E6;
  color: var(--ep-amber-text);
}

.card-header h3 {
  margin-top: 18px;
  color: var(--ep-text-heading);
  font-size: 1.18rem;
  line-height: 1.2;
}

.card-header p {
  margin-top: 6px;
  color: var(--ep-text-secondary);
  font-size: 0.82rem;
}

.rank-stack {
  min-width: 92px;
  color: var(--ep-text-muted);
  text-align: right;
}

.rank-stack span {
  display: block;
  color: var(--ep-green-dark);
  font-size: 1.95rem;
  font-weight: 850;
  line-height: 1;
}

.is-watch .rank-stack span {
  color: var(--ep-amber-text);
}

.rank-stack small {
  display: block;
  margin-top: 7px;
  color: var(--ep-text-muted);
  font-size: 0.76rem;
}

.attainment-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.attainment-row span {
  color: var(--ep-text-muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.attainment-row strong {
  color: var(--ep-text-heading);
  font-size: 2.42rem;
  line-height: 1;
}

.progress-rail {
  height: 10px;
  margin-top: 12px;
  border-radius: 9999px;
  background: #E8EEF2;
  overflow: hidden;
}

.progress-rail span {
  display: block;
  height: 100%;
  border-radius: 9999px;
  background: var(--ep-gradient-green-teal);
}

.is-watch .progress-rail span {
  background: linear-gradient(90deg, #FFC107, #D48806);
}

.hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.metric-block,
.mini-block {
  position: relative;
  border: 1px solid #DCE8EA;
  border-radius: var(--ep-radius-lg);
  background: #F8FFFE;
  padding: 14px 12px 38px;
}

.metric-block {
  min-height: 132px;
}

.metric-block b {
  display: block;
  color: var(--ep-blue);
  font-size: 1.95rem;
  line-height: 1;
}

.metric-block.is-accent b {
  color: var(--ep-green-dark);
}

.metric-block span,
.mini-block span {
  display: block;
  margin-top: 13px;
  color: var(--ep-text-body);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-block small,
.mini-block small {
  display: block;
  max-width: 94%;
  margin-top: 5px;
  color: var(--ep-text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.metric-block em,
.mini-block em {
  position: absolute;
  right: 10px;
  bottom: 10px;
  color: var(--ep-blue);
  font-size: 0.86rem;
  font-style: normal;
  font-weight: 850;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.mini-block {
  min-height: 112px;
}

.mini-block:first-child {
  grid-column: 1 / -1;
}

.mini-block b {
  color: var(--ep-blue);
  font-size: 1.18rem;
}

.mix-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  color: var(--ep-text-muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.mix-heading small {
  color: var(--ep-text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: none;
}

.mix-bar {
  display: flex;
  height: 18px;
  margin-top: 10px;
  border-radius: 9999px;
  background: #E8EEF2;
  overflow: hidden;
}

.mix-bar span {
  display: block;
  min-width: 2px;
}

.mix-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-top: 14px;
  margin-bottom: 22px;
  color: var(--ep-text-secondary);
  font-size: 0.74rem;
  line-height: 1.3;
}

.mix-labels b {
  color: var(--ep-text-body);
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 13px 0 18px;
  color: var(--ep-text-muted);
  border-top: 1px solid var(--ep-border-light);
  font-size: 0.78rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 48px;
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-xl);
  background: var(--ep-bg-white);
  color: var(--ep-text-muted);
  text-align: center;
  box-shadow: var(--ep-shadow-sm);
}

@media (max-width: 1020px) {
  .report-brief {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .brief-stats {
    width: 100%;
    max-width: 620px;
  }

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

@media (max-width: 760px) {
  .page-shell {
    width: 100%;
    margin: 0;
    padding: 0 10px 56px;
  }

  .report-brief {
    width: calc(100% + 20px);
    margin-left: -10px;
    border-radius: 0 0 var(--ep-radius-xl) var(--ep-radius-xl);
    gap: 24px;
    padding: 28px 20px 34px;
  }

  h1,
  .executive-note,
  .controls,
  .totals-section,
  .controls-band,
  .cards-grid {
    width: 100%;
    max-width: 100%;
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.1rem);
    line-height: 0.98;
  }

  .brand-logo {
    width: 172px;
  }

  .brief-stats {
    grid-template-columns: 1fr 1fr;
  }

  .brief-stats span:last-child {
    grid-column: 1 / -1;
    min-height: 78px;
  }

  .executive-note {
    margin-top: 24px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .controls {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .search-box,
  .select-box,
  .segmented,
  .totals-table-wrap {
    max-width: 100%;
    min-width: 0;
  }

  .totals-table-wrap {
    overflow: visible;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .totals-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 9px;
    font-size: 0.84rem;
  }

  .totals-table thead {
    display: none;
  }

  .totals-table,
  .totals-table tbody,
  .totals-table tr,
  .totals-table td {
    display: block;
    width: 100%;
  }

  .totals-table tr {
    border: 1px solid var(--ep-border-light);
    border-radius: var(--ep-radius-lg);
    background: var(--ep-bg-white);
    box-shadow: var(--ep-shadow-sm);
    overflow: hidden;
  }

  .totals-table td {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-top: 1px solid var(--ep-border-light);
  }

  .totals-table td:first-child {
    display: block;
    border-top: 0;
  }

  .totals-table td:not(:first-child)::before {
    color: var(--ep-text-muted);
    font-weight: 850;
    text-transform: uppercase;
  }

  .totals-table td:nth-child(2)::before {
    content: "Actual";
  }

  .totals-table td:nth-child(3)::before {
    content: "Budget";
  }

  .totals-table td:nth-child(4)::before {
    content: "Attainment";
  }

  .table-note {
    text-align: left;
    line-height: 1.45;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .segmented button {
    min-width: 0;
    padding: 0 8px;
  }

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

  .territory-card {
    min-height: 0;
  }

  .mix-labels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .page-shell {
    max-width: 390px;
  }

  .mini-metrics {
    grid-template-columns: 1fr;
  }

  .mini-block {
    min-height: 96px;
  }
}

.refresh-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ep-gradient-green-teal);
  color: var(--ep-text-white);
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--ep-shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, opacity 0.1s ease;
}

.refresh-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--ep-shadow-md);
}

.refresh-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.refresh-btn svg {
  flex-shrink: 0;
}

.refresh-btn.spinning svg {
  animation: refresh-spin 1s linear infinite;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.refresh-status {
  font-size: 12px;
  color: var(--ep-text-muted);
}

.refresh-status.ok {
  color: var(--ep-green-dark);
}

.refresh-status.err {
  color: #B91C1C;
}

.rankings-section {
  margin-top: 36px;
}

.rankings-header {
  margin-bottom: 18px;
}

.rankings-header h2 {
  color: var(--ep-text-heading);
  font-size: 1.5rem;
  font-weight: 800;
}

.rankings-meta {
  margin-top: 4px;
  color: var(--ep-text-muted);
  font-size: 0.88rem;
}

.rankings-meta span {
  color: var(--ep-text-body);
  font-weight: 700;
}

.rankings-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ep-border-light);
  color: var(--ep-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.rankings-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rk-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.rk-dot-leader { background: var(--ep-amber); }
.rk-dot-top    { background: var(--ep-green); }
.rk-dot-rest   { background: #C7CDD3; }

.rankings-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.rk-col {
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-lg);
  background: var(--ep-bg-white);
  box-shadow: var(--ep-shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.rk-head {
  background: var(--ep-blue);
  color: var(--ep-text-white);
  padding: 12px 14px;
}

.rk-head h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rk-head small {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.7rem;
  font-weight: 500;
}

.rk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rk-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #F1F4F7;
  font-size: 0.84rem;
  color: var(--ep-text-body);
}

.rk-row:last-child {
  border-bottom: none;
}

.rk-num {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--ep-text-muted);
  text-align: center;
}

.rk-name {
  font-weight: 600;
  color: var(--ep-text-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rk-name small {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #EEF2F6;
  color: var(--ep-text-muted);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

.rk-val {
  font-weight: 800;
  color: var(--ep-text-heading);
  white-space: nowrap;
}

.rk-tier-leader {
  background: #FFF8E1;
}

.rk-tier-leader .rk-num {
  color: #B07A00;
}

.rk-tier-top {
  background: var(--ep-green-light);
}

.rk-tier-top .rk-num {
  color: var(--ep-green-dark);
}

.rankings-foot {
  margin-top: 14px;
  text-align: center;
  color: var(--ep-text-muted);
  font-size: 0.8rem;
}

.archive-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--ep-border-light);
  font-size: 0.78rem;
}

.archive-nav:empty {
  display: none;
}

.archive-nav-label {
  color: var(--ep-text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
}

.archive-link {
  color: var(--ep-blue);
  font-weight: 700;
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 4px;
  background: #EEF2F6;
}

.archive-link:hover {
  background: var(--ep-teal-lightest);
  color: var(--ep-blue);
}

.archive-link.is-active {
  background: var(--ep-blue);
  color: var(--ep-text-white);
  cursor: default;
}

.archive-link-back {
  background: var(--ep-green);
  color: var(--ep-text-white);
}

.archive-link-back:hover {
  background: var(--ep-green-dark);
  color: var(--ep-text-white);
}

.rk-loading {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px solid var(--ep-border-light);
  border-radius: var(--ep-radius-lg);
  background: var(--ep-bg-white);
  color: var(--ep-text-muted);
  text-align: center;
  font-size: 0.9rem;
}

.rk-loading a {
  color: var(--ep-blue);
  font-weight: 700;
}

/* Closed-month archive view: only header + rankings remain visible. */
body.archive-view .report-brief,
body.archive-view .executive-note,
body.archive-view .totals-section,
body.archive-view .controls-band,
body.archive-view .cards-grid,
body.archive-view .definitions {
  display: none;
}

body.archive-view .rankings-section {
  margin-top: 24px;
}

@media (max-width: 1080px) {
  .rankings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rankings-grid {
    grid-template-columns: 1fr;
  }
}

.definitions {
  margin-top: 36px;
  background: var(--ep-bg-white);
  border-radius: 14px;
  padding: 28px 32px 16px;
  box-shadow: var(--ep-shadow-sm);
}

.definitions h2 {
  margin: 0 0 4px;
  color: var(--ep-text-heading);
  font-size: 22px;
}

.definitions article {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--ep-border-light);
}

.definitions article:first-of-type {
  border-top: none;
}

.definitions h3 {
  margin: 0 0 8px;
  color: var(--ep-text-heading);
  font-size: 16px;
}

.definitions p {
  margin: 6px 0;
  color: var(--ep-text-body);
  font-size: 14px;
  line-height: 1.55;
}

.definitions p strong {
  color: var(--ep-text-heading);
}

.definitions code {
  background: var(--ep-bg-light);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 12.5px;
  color: var(--ep-text-heading);
}

.classifier-list {
  margin: 10px 0 14px 22px;
  padding: 0;
  color: var(--ep-text-body);
  font-size: 14px;
  line-height: 1.6;
}

.classifier-list li {
  margin: 4px 0;
}

.classifier-list strong {
  color: var(--ep-text-heading);
}

@media (max-width: 720px) {
  .definitions {
    padding: 20px;
  }
}
