/* Shared with elemento.cloud and electros.cloud (themes.css). */
:root {
  color-scheme: light;
  --yellow-light: #FAB83A;
  --yellow: #FFA600;
  --yellow-dark: #F28E00;
  --magenta-light: #FF77FF;
  --magenta: #FF00FF;
  --magenta-dark: #8B008B;
  --green: #28A745;
  --red: #DC3545;
  --orange: #FF7F50;
  --blue: #007BFF;
  --black: #181720;
  --black-light: #2F3338;
  --grey-darker: #4a4e53;
  --grey: #8A8D95;
  --grey-light: #B0B5BA;
  --white-light: #fff;
  --white-medium: #FAFAFF;
  --white: #F5F5FA;
  --white-dark: #E6E6F0;
  --ink: var(--black);
  --muted: var(--grey-darker);
  --line: var(--white-dark);
  --paper: var(--white);
  --card: var(--white-light);
  --accent: var(--magenta);
  --accent-ink: var(--magenta-dark);
  --accent-soft: color-mix(in srgb, var(--magenta) 18%, var(--white-light));
  --bar: var(--magenta);
  --high: var(--red);
  --warn: var(--red);
  --chart-bar: var(--magenta);
  --chart-mark: var(--magenta-dark);
  --chart-cheap: #28A745;
  --chart-high: #DC3545;
  --chart-band: color-mix(in srgb, var(--magenta) 16%, var(--white-light));
  --font: "Red Hat Display", "Open Sans", sans-serif;
  --radius: 6px;
}

/* Dark matches Electros Ayu Mirage. Midnight is the high-contrast theme labeled Midnight there. */
.theme-dark {
  color-scheme: dark;
  --ink: var(--white);
  --muted: var(--grey-light);
  --line: #3d4248;
  --paper: #1A1C20;
  --card: #2F3338;
  --white-medium: #3a3f45;
  --accent-ink: var(--magenta);
  --accent-soft: color-mix(in srgb, var(--magenta) 18%, var(--card));
  --chart-mark: var(--magenta);
  --chart-band: color-mix(in srgb, var(--magenta) 28%, transparent);
}

.theme-midnight {
  color-scheme: dark;
  --ink: var(--white-light);
  --muted: var(--grey-light);
  --line: #2c2a33;
  --paper: #0F0E14;
  --card: #181720;
  --white-medium: #221f2a;
  --accent-ink: var(--magenta);
  --accent-soft: color-mix(in srgb, var(--magenta) 16%, var(--card));
  --chart-mark: var(--magenta);
  --chart-band: color-mix(in srgb, var(--magenta) 24%, transparent);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  border-top: 3px solid var(--accent);
  font: 15px/1.5 var(--font);
  color: var(--muted);
  background: var(--paper);
}

h1, h2, h3 { color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }

a { color: var(--ink); }
a:hover { color: var(--accent-ink); }

.kicker, .kicker a {
  color: var(--accent-ink);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input, select, button { font: inherit; color: inherit; }

input, select {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

button.nav, a.nav, button.primary {
  border-radius: var(--radius);
}

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--black);
  font-weight: 700;
}

.provider-name-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.6rem;
  white-space: nowrap;
  font-weight: 650;
  color: var(--ink);
}

.offer .provider-name-cell { margin-top: 4px; }

.theme-dark .provider-name-cell__badge,
.theme-midnight .provider-name-cell__badge {
  --provider-badge-bg: color-mix(in srgb, var(--provider-color) 22%, var(--card));
  --provider-badge-border: color-mix(in srgb, var(--provider-color) 50%, var(--line));
}

.provider-name-cell__badge {
  --provider-badge-bg: color-mix(in srgb, var(--provider-color) 14%, color-mix(in srgb, var(--white-light) 65%, var(--white)));
  --provider-badge-border: color-mix(in srgb, var(--provider-color) 40%, var(--grey-darker));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: var(--provider-badge-bg);
  border: 1px solid var(--provider-badge-border);
}

.provider-name-cell__badge--wide {
  width: 4.5rem;
  height: 2.125rem;
  padding: 0.2rem 0.35rem;
}

.provider-name-cell__icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  object-fit: contain;
}

.provider-name-cell__badge--wide .provider-name-cell__icon {
  width: 100%;
  height: 1.15rem;
  max-width: 4rem;
}

.provider-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-menu__button .service-icon {
  width: 18px;
  height: 18px;
  margin-right: 0.35rem;
}

.service-icon { display: block; }

.icon-select { position: relative; display: block; }
.icon-select__native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.icon-select__button,
.icon-select__option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
}
.icon-select__button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 8px 10px;
  cursor: pointer;
}
.icon-select__menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--black) 18%, transparent);
}
.icon-select__menu[hidden] { display: none; }
.icon-select__option {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 8px;
  cursor: pointer;
}
.icon-select__option[aria-selected="true"] { background: var(--accent); color: var(--black); }
.icon-select .service-icon { width: 22px; height: 22px; }

.region-card { position: relative; overflow: hidden; }
.region-card .map-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--ink);
  opacity: 0.14;
  pointer-events: none;
}
.theme-dark .region-card .map-bg,
.theme-midnight .region-card .map-bg { opacity: 0.08; }
.region-card .map-land { fill: currentColor; stroke: none; }
.region-card .map-grid { display: none; }
.region-card > :not(.map-bg) { position: relative; z-index: 1; }

.globe {
  position: relative;
  display: grid;
  justify-items: center;
  width: 100vw;
  margin: 4px 0 8px;
  margin-left: calc(50% - 50vw);
}
.globe-probe {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
}
.globe canvas {
  width: 100%;
  height: min(520px, 100vw);
  aspect-ratio: auto;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.globe.is-wide canvas {
  height: 50vh;
  pointer-events: none;
  cursor: default;
}
.globe.is-wide .globe-hit {
  position: absolute;
  z-index: 1;
  top: 0;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.globe.is-wide .globe-hit.is-dragging { cursor: grabbing; }
.globe.is-wide .globe-legend { max-width: 100%; }
.globe canvas.is-dragging { cursor: grabbing; }
.globe-note {
  margin: 0;
  min-height: 1.35em;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.globe-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  max-width: 680px;
  margin: 6px 0 0;
}
.globe-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.globe-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.globe-menu {
  position: absolute;
  z-index: 5;
  display: grid;
  min-width: 160px;
  padding: 4px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--black) 18%, transparent);
}
.globe-menu[hidden] { display: none; }
.globe-menu a {
  padding: 7px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
}
.globe-menu a:hover { background: var(--accent); color: var(--black); }

.catalog-slice {
  width: min(1100px, calc(100% - 32px));
  margin: 18px auto 0;
}
.catalog-slice__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.catalog-slice .nav-drop { position: relative; }
.catalog-slice .nav-menu__button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.catalog-slice .nav-menu__button.active { border-color: var(--accent); }
.catalog-slice .nav-menu__button--stable {
  display: inline-grid;
  grid-template-columns: 10.6rem auto;
  justify-items: start;
  align-items: center;
}
.catalog-slice .nav-menu__button--stable .nav-menu__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
  text-align: left;
}
.catalog-slice .dropdown-arrow {
  font-size: 0.7rem;
  line-height: 1;
}
.catalog-slice .nav-drop.is-open .dropdown-arrow { transform: rotate(180deg); }
.catalog-slice .nav-panel {
  display: none;
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  min-width: max(100%, 220px);
  max-width: min(360px, 80vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--black) 18%, transparent);
}
.catalog-slice .nav-drop:last-child .nav-panel { left: auto; right: 0; }
.catalog-slice .nav-drop.is-open .nav-panel { display: block; }
.catalog-slice .nav-panel ul { list-style: none; margin: 0; padding: 0; }
.catalog-slice .dropdown-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  font-weight: 650;
}
.catalog-slice .dropdown-link img,
.catalog-slice .dropdown-link .service-icon {
  width: 20px;
  height: 20px;
  margin: 0;
  object-fit: contain;
  flex-shrink: 0;
}
.catalog-slice .dropdown-link:hover,
.catalog-slice .dropdown-link.active { background: var(--accent); color: var(--black); }

.nav-panel p {
  margin: 0;
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.series { margin-top: 14px; }
.series h3 {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.series ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.series li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: baseline;
  font-size: 13px;
}
.series-when { color: var(--muted); }
.series-amount { font-variant-numeric: tabular-nums; text-align: right; }
.series-delta { grid-column: 2; color: var(--muted); font-size: 12px; text-align: right; }

a.provider-name-cell { text-decoration: none; }
a.region-link { font-weight: 650; text-decoration: none; }
.offer a.title { color: inherit; text-decoration: none; font-weight: 700; }
.offer a.title:hover { color: var(--accent-ink); }

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

.header-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.currency-switch {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.theme-switch,
.notation-switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
}

.theme-switch button,
.notation-switch button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  padding: 4px 10px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
}

.theme-switch button:last-child,
.notation-switch button:last-child { border-right: 0; }

.theme-switch button[aria-pressed="true"],
.notation-switch button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--black);
}

@media (max-width: 860px) {
  .header-tools { align-items: flex-start; }
}

.estimate {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.estimate h3 { margin: 0; font-size: 13px; letter-spacing: 0; }
.estimate label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.estimate input,
.estimate select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  padding: 6px 8px;
  font: inherit;
}
.estimate p { margin: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
.estimate .muted { color: var(--muted); }
