:root {
  color-scheme: dark;
  --ink: #e8f1f2;
  --muted: #91a8ad;
  --line: rgba(141, 177, 184, 0.18);
  --panel: #10272e;
  --panel-deep: #091a20;
  --cyan: #37cdea;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 85% -10%, rgba(55, 205, 234, 0.11), transparent 34rem),
    linear-gradient(180deg, #0a1c22 0%, #07171c 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  font: inherit;
}

.app-root {
  width: min(1200px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 24px;
}

.demo-ribbon {
  position: fixed;
  z-index: 1000;
  top: 64px;
  right: -18px;
  display: block;
  width: 220px;
  padding: 9px 0;
  transform: rotate(45deg);
  background: #f5a646;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.34);
  color: #07191e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  padding: 0 2px 27px;
  border-bottom: 1px solid var(--line);
}

.brand-block,
.metric {
  display: flex;
  flex-direction: column;
}

.eyebrow,
.control-label,
.metric-label {
  color: #80c6d2;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.app-title {
  margin-top: 7px;
  color: #f3fbfc;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.app-subtitle {
  max-width: 690px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(105px, 1fr));
  gap: 1px;
  overflow: hidden;
  min-width: 425px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--line);
}

.metric {
  padding: 16px 18px 14px;
  background: rgba(12, 34, 40, 0.9);
}

.metric-value {
  color: #e9f8fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.metric-label {
  margin-top: 6px;
  color: #6f8c92;
  font-size: 8px;
  letter-spacing: 0.12em;
}

.toolbar {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  padding: 20px 2px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-group:nth-child(3) {
  flex: 1;
}

.atlas-select {
  width: 190px;
  height: 40px;
  padding: 0 36px 0 12px;
  border: 1px solid rgba(133, 172, 180, 0.24);
  border-radius: 6px;
  outline: none;
  background-color: #0d252c;
  color: #dcecee;
  font-size: 13px;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.atlas-select:hover,
.atlas-select:focus {
  border-color: rgba(55, 205, 234, 0.68);
  background-color: #102c34;
}

.type-select {
  width: min(360px, 100%);
}

.diff-toggle {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: #b7c9cc;
  font-size: 13px;
  white-space: nowrap;
}

.diff-toggle input {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  accent-color: var(--cyan);
}

.diff-toggle.Wt-disabled,
.diff-toggle:has(input:disabled) {
  opacity: 0.42;
}

.map-viewport {
  width: 1200px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(127, 166, 174, 0.22);
  border-radius: 11px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.map-stage {
  position: relative;
  width: 1200px;
  height: 700px;
  overflow: hidden;
  background:
    linear-gradient(rgba(36, 70, 77, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 70, 77, 0.13) 1px, transparent 1px),
    radial-gradient(circle at 50% 40%, #0d2931, #081b21 72%);
  background-size: 50px 50px, 50px 50px, auto;
}

.cifp-map {
  position: absolute !important;
  inset: 0;
  width: 1200px !important;
  height: 700px !important;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.cifp-map:active {
  cursor: grabbing;
}

.map-navigation {
  position: absolute;
  z-index: 4;
  top: 18px;
  left: 18px;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(139, 179, 187, 0.2);
  border-radius: 8px;
  background: rgba(6, 22, 27, 0.87);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(12px);
}

.map-button {
  height: 31px;
  padding: 0 11px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #a9c1c5;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.map-button:hover {
  background: rgba(55, 205, 234, 0.12);
  color: #e7f9fb;
}

.zoom-button {
  width: 31px;
  padding: 0;
  color: #d8f3f7;
  font-size: 18px;
  font-weight: 400;
}

.download-button {
  margin-left: 3px;
  padding: 0 13px;
  background: rgba(55, 205, 234, 0.1);
  color: #d8f3f7;
}

.map-help,
.map-attribution {
  position: absolute;
  z-index: 3;
  bottom: 14px;
  color: rgba(185, 209, 213, 0.58);
  font-size: 9px;
  letter-spacing: 0.04em;
  pointer-events: none;
}

.map-help { left: 18px; }
.map-attribution { right: 18px; }

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 17px 3px 0;
  color: #698188;
  font-size: 10px;
  line-height: 1.5;
}

.footer-source {
  text-align: right;
}

@media (max-width: 1000px) {
  .app-root {
    width: calc(100% - 24px);
    padding-top: 22px;
  }

  .app-header {
    align-items: stretch;
    flex-direction: column;
    gap: 24px;
  }

  .metrics {
    min-width: 0;
  }

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

  .control-group:nth-child(3) {
    flex: initial;
  }

  .app-footer {
    flex-direction: column;
  }

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