:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #eef2f0;
  --border: #d9dfdc;
  --text: #172027;
  --muted: #66737a;
  --blue: #2563eb;
  --green: #0f8b5f;
  --red: #c2412d;
  --gold: #b98213;
  --violet: #7c3aed;
  --cyan: #12809c;
  --shadow: 0 10px 32px rgba(23, 32, 39, 0.08);
  --sticky-ad-height: 128px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  padding-bottom: var(--sticky-ad-height);
  background: var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 78px;
  padding: 16px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--border);
  background: #fbfcfa;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 720px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: 0;
}

.source-note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.shell {
  display: grid;
  gap: 16px;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 2.5vw, 32px) 32px;
}

.page-nav {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(118px, 1fr));
  justify-self: start;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.page-tab {
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.page-tab:last-child {
  border-right: 0;
}

.page-tab.is-active {
  background: var(--text);
  color: #fff;
}

.page-panel {
  display: grid;
  gap: 16px;
}

.page-panel[hidden] {
  display: none;
}

.home-panel {
  gap: 14px;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 16px;
  align-items: stretch;
  min-height: 360px;
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-copy {
  display: grid;
  align-content: center;
  gap: 14px;
  max-width: 940px;
}

.home-kickers {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.home-kickers span {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-copy h2 {
  max-width: 900px;
  font-size: clamp(28px, 4.1vw, 52px);
  line-height: 1.04;
}

.home-copy p {
  max-width: 860px;
  color: #34444d;
  font-size: 16px;
  line-height: 1.55;
}

.home-warning {
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: #fff6f3;
  color: var(--text) !important;
  font-weight: 800;
}

.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 850;
}

.home-action.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.home-action svg {
  width: 18px;
  height: 18px;
}

.home-notice {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfa;
}

.home-notice span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.home-notice strong {
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1;
}

.home-notice p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.home-grid article {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-grid p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 2px;
}

.field {
  display: grid;
  gap: 6px;
  min-width: min(100%, 220px);
}

.date-field {
  min-width: min(100%, 320px);
}

.date-stepper {
  display: grid;
  grid-template-columns: 40px minmax(180px, 1fr) 40px;
  gap: 6px;
  align-items: center;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

select,
.segment,
.icon-button {
  min-height: 38px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

select {
  width: 100%;
  border-radius: 7px;
  padding: 0 36px 0 12px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.segment {
  min-width: 86px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
}

.segment:last-child {
  border-right: 0;
}

.segment.is-active {
  background: var(--text);
  color: #fff;
}

.delta-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  margin: 10px 0 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
}

.delta-segment {
  min-height: 34px;
  border: 0;
  border-right: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
}

.delta-segment:last-child {
  border-right: 0;
}

.delta-segment.is-active {
  background: var(--text);
  color: #fff;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  border-radius: 7px;
  cursor: pointer;
}

.icon-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kpis article,
.panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.kpis article {
  display: grid;
  gap: 8px;
  min-height: 84px;
  padding: 15px;
}

.kpis span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.kpis strong {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.08;
}

.grid-main,
.grid-context {
  display: grid;
  gap: 16px;
}

.grid-main {
  grid-template-columns: minmax(0, 1.65fr) minmax(360px, 0.75fr);
}

.grid-context {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  align-items: start;
}

.stacked-panels {
  display: grid;
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.panel-heading.compact {
  margin-bottom: 8px;
}

.panel-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.legend-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 7px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

.chart-legend {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.swatch {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
}

.chart {
  width: 100%;
  height: min(56vh, 520px);
  min-height: 370px;
}

.small-chart {
  width: 100%;
  height: 270px;
}

.polls-panel {
  display: grid;
  gap: 12px;
}

.poll-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.poll-tab {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
}

.poll-tab.is-active {
  border-color: var(--text);
  background: var(--text);
  color: #fff;
}

.poll-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.poll-field {
  width: min(100%, 460px);
}

.poll-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.62fr);
  gap: 16px;
  align-items: start;
}

.poll-chart-area {
  min-width: 0;
}

.poll-chart-area .legend-chips {
  justify-content: flex-start;
}

.poll-chart {
  width: 100%;
  height: 380px;
}

.poll-aside {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.poll-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fbfcfa;
  font-size: 14px;
  line-height: 1.45;
}

.poll-summary p {
  color: var(--muted);
}

.poll-summary strong {
  color: var(--text);
}

.poll-table-wrap {
  max-height: 280px;
}

.poll-candidate {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.poll-sources {
  display: grid;
  gap: 8px;
  padding-top: 2px;
}

.poll-sources h3 {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

#pollSources {
  display: grid;
  gap: 7px;
}

#pollSources a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

#pollSources a:hover {
  text-decoration: underline;
}

.digest {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.digest-status {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.digest ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.digest a {
  color: var(--blue);
  text-decoration: none;
}

.digest a:hover {
  text-decoration: underline;
}

.table-wrap {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 7px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fbfcfa;
  color: var(--muted);
  font-size: 12px;
}

td:nth-child(2) {
  width: 100%;
  white-space: normal;
}

.delta-up {
  color: var(--green);
  font-weight: 800;
}

.delta-down {
  color: var(--red);
  font-weight: 800;
}

.moves-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.move-item {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr auto;
  width: 100%;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.moves-list li:last-child .move-item {
  border-bottom: 0;
}

.move-item:hover .move-date,
.move-item:hover .move-name {
  color: var(--blue);
}

.move-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.move-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.move-value {
  font-weight: 900;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.news-panel {
  min-height: 360px;
}

.news-list {
  display: grid;
  gap: 10px;
}

.news-item {
  display: grid;
  gap: 4px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
}

.news-item:first-child {
  padding-top: 0;
}

.news-item:last-child {
  border-bottom: 0;
}

.news-item a {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.32;
  text-decoration: none;
}

.news-item a:hover {
  color: var(--blue);
  text-decoration: underline;
}

.news-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  width: min(1520px, 100%);
  margin: 0 auto;
  padding: 0 clamp(12px, 2.5vw, 32px) 24px;
}

.legal-links a,
.static-nav a,
.back-link,
.text-link {
  color: var(--blue);
  font-weight: 800;
  text-decoration: none;
}

.legal-links a:hover,
.static-nav a:hover,
.back-link:hover,
.text-link:hover {
  text-decoration: underline;
}

.static-shell {
  display: grid;
  width: min(940px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px) clamp(14px, 3vw, 28px) 48px;
}

.static-card {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.static-card h1 {
  max-width: 820px;
  font-size: clamp(32px, 5vw, 52px);
}

.static-card h2 {
  margin-top: 8px;
}

.static-card p {
  color: #34444d;
  font-size: 16px;
  line-height: 1.6;
}

.static-alert {
  padding: 12px 14px;
  border-left: 4px solid var(--red);
  border-radius: 7px;
  background: #fff6f3;
  color: var(--text) !important;
  font-weight: 800;
}

.back-link {
  width: fit-content;
}

.contact-mail {
  color: var(--text);
  font-size: clamp(22px, 4vw, 34px);
  font-weight: 900;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.contact-mail:hover {
  color: var(--blue);
}

.static-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  border-top: 1px solid var(--border);
  background: rgba(251, 252, 250, 0.96);
  padding: 10px clamp(12px, 2.5vw, 32px);
  box-shadow: 0 -12px 30px rgba(23, 32, 39, 0.1);
  backdrop-filter: blur(10px);
}

.ad-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  gap: 10px;
  width: min(1520px, 100%);
  margin: 0 auto;
}

.ad-slot {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
  min-height: 94px;
  padding: 8px 10px;
  border: 1px dashed #c6cfca;
  border-radius: 8px;
  background: var(--surface);
}

.ad-slot span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.ad-slot .adsbygoogle {
  width: 100%;
  min-height: 58px;
}

.ad-slot-wide .adsbygoogle {
  min-height: 68px;
}

.ad-slot-compact {
  min-height: 94px;
}

.ad-slot-compact .adsbygoogle {
  min-height: 68px;
}

@media (max-width: 1050px) {
  :root {
    --sticky-ad-height: 108px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .source-note {
    text-align: left;
  }

  .grid-main,
  .home-hero,
  .poll-grid,
  .grid-context {
    grid-template-columns: 1fr;
  }

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

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

  .ad-row {
    grid-template-columns: 1fr;
  }

  .ad-slot-compact {
    display: none;
  }

  .ad-slot,
  .ad-slot-wide .adsbygoogle {
    min-height: 72px;
  }
}

@media (max-width: 680px) {
  :root {
    --sticky-ad-height: 96px;
  }

  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
  }

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

  .page-tab {
    padding: 0 10px;
  }

  .home-hero {
    min-height: 0;
  }

  .home-copy h2 {
    font-size: 31px;
  }

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

  .home-action {
    flex: 1 1 100%;
  }

  .field {
    flex: 1 1 100%;
  }

  .date-field {
    min-width: 100%;
  }

  .date-stepper {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

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

  .segment {
    min-width: 0;
  }

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

  .panel-heading {
    display: grid;
  }

  .legend-chips {
    justify-content: flex-start;
  }

  .chart {
    height: 390px;
    min-height: 320px;
  }

  .poll-chart {
    height: 340px;
  }

  .move-item {
    grid-template-columns: 1fr auto;
  }

  .move-date {
    grid-column: 1 / -1;
  }

  .site-footer {
    padding: 8px;
  }

  .ad-slot {
    min-height: 70px;
    padding: 7px 8px;
  }

  .ad-slot span {
    font-size: 10px;
  }

  .ad-slot .adsbygoogle,
  .ad-slot-wide .adsbygoogle {
    min-height: 48px;
  }
}
