@charset "UTF-8";

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100%;
}

body[data-page="ennuste"] {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--pk-bg-dark, #131313);
  color: var(--pk-text-dark, #dddddd);
  font-family: Roboto, sans-serif;
}

.prediction-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 12px var(--pk-gutter-desktop) 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 0 auto;
  min-height: 0;
  overflow-x: clip;
}

.prediction-hero {
  display: grid;
  gap: 4px;
  margin-bottom: 8px;
}

.prediction-hero h1 {
  margin: 4px 0 8px;
  font-size: var(--pk-page-title-size, clamp(1.35rem, 2.45vw, 2.05rem));
  line-height: 1.15;
  color: #fff;
}

.prediction-subtitle {
  margin: 0;
  color: var(--pk-text-muted-dark, #b7b7b7);
  font-size: var(--pk-page-subtitle-size, clamp(0.84rem, 1.05vw, 0.92rem));
}

.view-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.view-options label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: #c8c8c8;
}

.model-link {
  font-size: 0.85rem;
  color: #cfcfcf;
  text-decoration: none;
  white-space: nowrap;
}

.model-link:hover {
  color: #ffffff;
}

.chart-grid {
  display: grid;
  width: 100%;
  max-width: none;
  margin: 0;
  grid-template-columns: minmax(0, 1fr) minmax(282px, 338px);
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.chart-card,
.forecast-panel {
  min-width: 0;
  min-height: 0;
  border: none;
}

.chart-grid > * {
  min-width: 0;
}

.chart-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

#prediction-chart {
  position: relative;
  height: clamp(420px, 72vh, 920px);
  min-height: 340px;
  background: var(--pk-bg-dark, #131313);
  border-radius: 0;
  overflow: hidden;
}

#prediction-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.forecast-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: start;
  padding: 10px 10px 8px;
  box-sizing: border-box;
  background: var(--pk-surface-muted-dark, rgba(30, 30, 30, 0.6));
  border-radius: var(--pk-card-radius, 8px);
  overflow: visible;
}

.forecast-panel h2 {
  margin: 0;
  font-size: 1rem;
  color: #efefef;
}

.forecast-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr) minmax(0, 0.96fr) minmax(0, 0.72fr);
  column-gap: 6px;
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9d9d9d;
  padding: 0 6px 2px;
  border-bottom: 1px solid #3a3a3a;
  align-items: end;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 4;
  overflow: visible;
}

.forecast-column-label {
  white-space: nowrap;
}

.forecast-column-label[data-help] {
  position: relative;
  cursor: help;
}

.forecast-column-label[data-help]::after {
  content: attr(data-help);
  position: absolute;
  left: 50%;
  right: auto;
  top: calc(100% + 7px);
  width: 220px;
  max-width: min(220px, 90vw);
  padding: 7px 9px;
  border-radius: 6px;
  background: rgba(22, 24, 29, 0.98);
  border: 1px solid rgba(120, 120, 120, 0.35);
  color: #d7d7d7;
  font-size: 0.73rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -3px);
  transition: opacity 120ms ease, transform 120ms ease;
  z-index: 15;
}

.forecast-column-label[data-help]:hover::after,
.forecast-column-label[data-help]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.forecast-columns > .forecast-column-label:last-child[data-help]::after {
  left: auto;
  right: 0;
  transform: translateY(-3px);
}

.forecast-columns > .forecast-column-label:last-child[data-help]:hover::after,
.forecast-columns > .forecast-column-label:last-child[data-help]:focus-visible::after {
  transform: translateY(0);
}

.forecast-column-label--right {
  justify-self: end;
  text-align: right;
}

#forecast-table {
  display: grid;
  gap: 2px;
  align-content: start;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.forecast-row {
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #ececec;
  font: inherit;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.78fr) minmax(0, 0.96fr) minmax(0, 0.72fr);
  align-items: center;
  column-gap: 6px;
  padding: 5px 6px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.forecast-row.is-muted {
  opacity: 0.5;
}

.forecast-row.is-highlighted {
  background: rgba(255, 255, 255, 0.04);
}

.forecast-party {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.76rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-swatch {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  min-width: 9px;
  height: 9px;
  border-radius: 50%;
}

.forecast-median,
.forecast-band,
.forecast-win {
  font-size: 0.76rem;
  text-align: right;
  white-space: nowrap;
  min-width: 0;
}

.forecast-win {
  color: #b8b8b8;
}

.generated-info {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #8f8f8f;
}

.pk-footer .model-link {
  margin: 0 5px;
  color: inherit;
}

.pk-footer .model-link:hover {
  color: #ffffff;
}

#prediction-tooltip {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  max-width: 260px;
  background: var(--pk-surface-dark, rgba(30, 30, 30, 0.98));
  color: #f4f4f4;
  border: none;
  border-radius: 4px;
  padding: 8px 10px;
  box-sizing: border-box;
  font-size: 0.8rem;
  line-height: 1.38;
}

#prediction-tooltip .poll-source {
  color: #b8b8b8;
  margin-top: 4px;
  font-size: 0.76rem;
}

.chart-error {
  margin: 0;
  padding: 16px;
  color: #f3a6a6;
}

.axis path,
.axis line {
  stroke: #444;
}

.axis text {
  fill: #aaa;
  font-size: 0.78rem;
}

.grid-x,
.grid-y {
  stroke: #2a2a2a;
  stroke-width: 1;
}

.grid-x {
  stroke-dasharray: 4 5;
}

.cut-line {
  stroke: #595959;
  stroke-width: 1.2;
}

.marker-label {
  fill: #bfbfbf;
  font-size: 0.73rem;
  font-weight: 500;
}

.hover-vertical {
  stroke: #5b5b5b;
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.78;
}

html[data-theme="light"] body[data-page="ennuste"] {
  background: var(--pk-bg-light, #f4f4f4);
  color: var(--pk-text-light, #202020);
}

html[data-theme="light"] body[data-page="ennuste"] .prediction-subtitle,
html[data-theme="light"] body[data-page="ennuste"] .generated-info {
  color: var(--pk-text-muted-light, #626262);
}

html[data-theme="light"] body[data-page="ennuste"] .prediction-hero h1,
html[data-theme="light"] body[data-page="ennuste"] .forecast-panel h2 {
  color: var(--pk-text-light, #202020);
}

html[data-theme="light"] body[data-page="ennuste"] .eyebrow {
  color: #666666;
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-panel,
html[data-theme="light"] body[data-page="ennuste"] #prediction-tooltip,
html[data-theme="light"] body[data-page="ennuste"] .pk-info-overlay {
  background: var(--pk-surface-light, rgba(255, 255, 255, 0.96));
  color: var(--pk-text-light, #202020);
  box-shadow: 0 2px 10px rgba(24, 24, 24, 0.12);
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-row {
  background: rgba(255, 255, 255, 0.74);
  color: #242424;
  box-shadow: none;
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-row .forecast-win {
  color: #666666;
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-row.is-muted {
  opacity: 0.72;
  color: #3a3a3a;
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-row.is-highlighted {
  background: rgba(80, 80, 80, 0.08);
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-columns {
  color: #636363;
  border-bottom-color: #d0d0d0;
}

html[data-theme="light"] body[data-page="ennuste"] .forecast-column-label[data-help]::after {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(120, 120, 120, 0.45);
  color: #333333;
}

html[data-theme="light"] body[data-page="ennuste"] .axis text {
  fill: #5f646e;
}

html[data-theme="light"] body[data-page="ennuste"] .axis path,
html[data-theme="light"] body[data-page="ennuste"] .axis line,
html[data-theme="light"] body[data-page="ennuste"] .grid-y,
html[data-theme="light"] body[data-page="ennuste"] .grid-x {
  stroke: #d8d8d8;
}

html[data-theme="light"] body[data-page="ennuste"] .cut-line,
html[data-theme="light"] body[data-page="ennuste"] .hover-vertical {
  stroke: #bec3cc;
}

html[data-theme="light"] body[data-page="ennuste"] .marker-label {
  fill: #686868;
}

html[data-theme="light"] body[data-page="ennuste"] .model-link {
  color: #555555;
}

html[data-theme="light"] body[data-page="ennuste"] .model-link:hover {
  color: #323232;
}

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

  .forecast-panel {
    max-height: 460px;
  }
}

@media (max-width: 900px) {
  .prediction-page {
    padding: 10px var(--pk-gutter-mobile) 8px;
  }

  .prediction-subtitle {
    line-height: 1.35;
  }

  .prediction-toolbar {
    flex-wrap: wrap;
  }

  .view-options {
    gap: 14px;
  }

  .marker-label {
    font-size: 0.67rem;
  }

}
