/* SECTION: Design tokens */
:root {
  
  interpolate-size: allow-keywords;
  /* Colors */
  --color-bg: #050814;
  --color-surface: #0b1020;
  --color-surface-alt: #10172b;
  --color-border-subtle: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);
  --color-text: #f5f7ff;
  --color-text-muted: #a4b0d1;
  --color-text-ghost: #6b6e82;
  --color-text-hover: rgba(199, 199, 203, 0.67);
  --color-text-h3: #7d99f4;
  --color-accent: #38bdf8;
  --color-accent-soft: rgba(56, 189, 248, 0.12);
  --color-accent-strong: #0ea5e9;
  --color-danger: #fb7185;
  --color-badge: rgba(148, 163, 184, 0.24);
  --color-button-hover: #cbcbcb;
  --color-text-accordion-title: #75a1bf;
  --color-bg-focus: #465565;
  --color-bg-accordion-tab: #343e4c;
  
  --tabs-bg: rgb(14, 22, 40);
  --tab-bg1: #1c1f26;
  --tab-bg2: #181b21;
  --tab-hover1: #22252d;
  --tab-hover2: #1c1f26;
  --tab-fg: #e4e7f0;
  --tab-active-bg: #242833;
  --tab-active-fg: #ffffff;
  --tab-active-border: #7aa2ff;
  --content-bg: rgb(17, 24, 41);
  
  /* Complex backgrounds & gradients */
  --bg-main: radial-gradient(circle at top, #0b1220 0, #020617 40%, #020617 100%);
  --bg-panel: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.88));
  --bg-panel-sub: radial-gradient(circle at top left, rgba(56, 189, 248, 0.1), rgba(15, 23, 42, 0.9));
  --bg-input: rgba(15, 23, 42, 0.9);
  --bg-map: radial-gradient(circle at 50% 60%, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 1));
  --bg-ascii: #020617;
  --shadow-accent: rgba(56, 189, 248, 0.25);
  --shadow-accent-hover: rgba(56, 189, 248, 0.35);
  
  /* Elevation & effects */
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.65);
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  
  /* Typography */
  --font-body: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  
  --text-xs: 11px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-lg: 18px;
  --text-xl: 24px;
  --text-xxl: 32px;
  
  --gutter: 20px;
  --panel-padding: 18px;
  --header-height: 100px;

  --transition-fast: 0.14s ease-out;
  --transition-med: 0.22s ease;
}

[data-theme="light"] {
  --color-bg: #f1f5f9;
  --color-surface: #ffffff;
  --color-surface-alt: #e2e8f0;
  --color-border-subtle: rgba(15, 23, 42, 0.08);
  --color-border-strong: rgba(15, 23, 42, 0.14);
  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-h3: #5574dd;
  --color-accent: #0ea5e9;
  --color-accent-soft: rgba(14, 165, 233, 0.1);
  --color-accent-strong: #0284c7;
  --color-danger: #e11d48;
  --color-badge: rgba(71, 85, 105, 0.1);
  --color-tab-active: #d7dae1;
  --color-tab-hover: #686870;
  --color-text-accordion-title: #3586b9;
  --color-bg-focus: #748ba1;
  --color-bg-accordion-tab: #d6eff8;
  
  --bg-main: radial-gradient(circle at top, #f8fafc 0, #f1f5f9 40%, #f1f5f9 100%);
  --bg-panel: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  --bg-panel-sub: radial-gradient(circle at top left, rgba(14, 165, 233, 0.05), rgba(255, 255, 255, 0.95));
  --bg-input: #ffffff;
  --bg-map: radial-gradient(circle at 50% 60%, #f8fafc, #f1f5f9);
  --bg-ascii: #f8fafc;
  --shadow-accent: rgba(14, 165, 233, 0.2);
  --shadow-accent-hover: rgba(14, 165, 233, 0.3);
  --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.1);
  
  --tabs-bg: #fafafa;
  --tab-bg1: #ffffff;
  --tab-bg2: #f2f2f2;
  --tab-hover1: #ffffff;
  --tab-hover2: #eaeaea;
  --tab-fg: #222;
  --tab-active-bg: #ffffff;
  --tab-active-fg: #111;
  --tab-active-border: #4a6cff;
  --content-bg: #ffffff;
}

[data-theme="nord"] {
  --color-bg: #2e3440;
  --color-surface: #3b4252;
  --color-surface-alt: #434c5e;
  --color-border-subtle: rgba(236, 239, 244, 0.08);
  --color-border-strong: rgba(236, 239, 244, 0.14);
  --color-text: #eceff4;
  --color-text-muted: #d8dee9;
  --color-text-h3: #7d99f4;
  --color-accent: #88c0d0;
  --color-accent-soft: rgba(0, 0, 0, 0.12);
  --color-accent-strong: #81a1c1;
  --color-danger: #bf616a;
  --color-badge: rgba(76, 86, 106, 0.4);
  --color-text-accordion-title: #77b9dd;
  --color-bg-focus: #465565;
  --color-bg-accordion-tab: #465565;
  
  --bg-main: radial-gradient(circle at top, #3b4252 0, #2e3440 40%, #2e3440 100%);
  --bg-panel: linear-gradient(145deg, rgba(59, 66, 82, 0.96), rgba(59, 66, 82, 0.88));
  --bg-panel-sub: radial-gradient(circle at top left, rgba(136, 192, 208, 0.1), rgba(59, 66, 82, 0.9));
  --bg-input: rgba(46, 52, 64, 0.9);
  --bg-map: radial-gradient(circle at 50% 60%, #3b4252, #2e3440);
  --bg-ascii: #2e3440;
  --shadow-accent: rgba(136, 192, 208, 0.25);
  --shadow-accent-hover: rgba(136, 192, 208, 0.35);
  --shadow-soft: 0 16px 40px rgba(46, 52, 64, 0.65);
  --color-tab-active: #586478;
  --color-tab-hover: #2e3747;
  --color-tab-txt-hover: #63636e;
  
  --tabs-bg: rgba(46, 52, 64, 0.85);
  --tab-bg1: #3b4252;
  --tab-bg2: #2e3440;
  --tab-hover1: #434c5e;
  --tab-hover2: #3b4252;
  --tab-fg: #eceff4;
  --tab-active-bg: #4c566a;
  --tab-active-fg: #eceff4;
  --tab-active-border: #88c0d0;
  --content-bg: #3b4252;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg-main);
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

main.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1.5fr) minmax(260px, 320px);
  gap: var(--gutter);
  padding: 18px 22px 24px;
  max-width: none;
  margin: 0 auto 12px;
}

.panel--sidebar, .panel--status {
  position: sticky;
  top: 0;
  overflow-y: auto;
  align-self: start;
  padding: var(--panel-padding);
  border: 1px solid var(--color-border-subtle);
  border-radius: 9px;
  background: var(--bg-panel-sub);
}

.panel--main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 800px;
  align-self: start;
  max-height: 820px;
}

@media (max-width: 1100px) {
  main.layout {
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  }
  
  .panel--status {
    grid-column: 1 / -1;
  }
}

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

/* SECTION: Header & footer */
.app-header {
  display: flex;
  justify-content: center;
  width: 100%;
}

.app-header__content {
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 14px 6% 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.app-header__title {
  display: flex;
  align-items: center;
  gap: 9px;
}

.app-header__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.app-header__logo {
  height: 90px;
  width: auto;
  max-width: 400px;
  margin-right: auto;
  object-fit: contain;
}

.app-header__title {
  font-size: 30px;
  letter-spacing: -0.03em;
}

.app-header__badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  background: linear-gradient(120deg, rgba(56, 189, 248, 0.16), rgba(56, 189, 248, 0.04));
  color: var(--color-accent);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.app-header__badge--alert {
  color: darkred;
  background: linear-gradient(120deg, rgb(239, 68, 68), rgb(254, 202, 202));
}

.app-footer {
  max-width: 1120px;
  margin: 0 auto 18px;
  padding: 0 22px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

/* SECTION: Panels */
.panel__subtitle {
  margin: 6px 0 12px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.panel--intro {
  grid-column: 1 / -1;
  
  .panel__title {
    display: flex;
    padding-left: 15px;
    padding-top: 10px;
  }
  
  .panel__subtitle {
    font-size: 15px;
    padding-left: 15px;
    padding-bottom: 10px;
  }
}

.panel--left {
  display: flex;
  flex-direction: row;
}

.panel--sub {
  padding: 14px 16px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background: var(--bg-panel-sub);
}

.panel__title {
  margin: 0 0 4px;
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
}

.panel__header {
  margin-bottom: 10px;
}

.panel__content {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.panel__content p {
  margin-top: 0;
  margin-bottom: 12px;
}

.panel--status {
  padding: var(--panel-padding);
  position: sticky;
  top: 0;
  align-self: start;
}

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

.status-panel__section {
  display: grid;
  gap: 10px;
}

.status-panel__row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.status-panel__divider {
  height: 1px;
  margin: 12px 0;
  background: var(--color-border-subtle);
}

.status-panel__details--collapsed {
  display: none;
}

.status-details {
  margin: 8px 0 0;
  width: 100%;
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg-input);
}

.status-details summary {
  font-size: var(--text-sm);
  color: var(--color-text);
}

.status-details__body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--color-border-subtle);
}

.status-item__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}

.status-item__meta {
  margin-top: 2px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.status-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  border: 1px solid var(--color-border-subtle);
  background: var(--color-badge);
  color: var(--color-text-muted);
  white-space: nowrap;
}

.health-badge--ok {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.35);
  color: rgba(134, 239, 172, 1);
}

.health-badge--warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.4);
  color: rgba(253, 230, 138, 1);
}

.health-badge--alert {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.4);
  color: rgba(253, 164, 175, 1);
}

.health-badge--neutral {
  background: rgba(148, 163, 184, 0.16);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--color-text-muted);
}


/* SECTION: Grid layout helper */
.grid-layout {
  display: grid;
  gap: var(--gutter);
}

/* SECTION: Form & fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.field--compact {
  margin-bottom: 0;
}

.field__label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
}

.field__input {
  background: var(--bg-input);
  border-radius: 9px;
  border: 1px solid var(--color-border-subtle);
  padding: 3px 9px;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.field__input:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent-soft);
}

.field__input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.field__help {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.param-form__group {
  margin-bottom: 12px;
}

.param-form__group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.param-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.bounds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

/* SECTION: Buttons & chips */
.btn {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 7px 14px;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  color: var(--color-text);
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn--quick-nav {
  font-size: var(--text-xs);
  padding: 4px 8px;
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.status-panel__nav-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.status-panel__nav-group.hidden {
  display: none;
}

.btn--primary {
  background: var(--color-accent);
  border-color: var(--color-accent);
  box-shadow: 0 12px 28px var(--shadow-accent);
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 40px var(--shadow-accent-hover);
}

.btn--ghost {
  border-color: var(--color-border-subtle);
  background: var(--bg-input);
}

.btn--ghost:hover {
  border-color: #84a3b4;
  background: var(--color-button-hover);
}

.btn:active,
.btn:focus {
  transform: translateY(0);
  box-shadow: none;
  transition: none;
}

.link-button {
  background: transparent;
  border: none;
  padding: 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  cursor: pointer;
}

.chip-group {
  display: inline-flex;
  gap: 6px;
}

.chip {
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-subtle);
  padding: 5px 10px;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--bg-input);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  margin: 0.3rem 0;
}

.chip--active {
  background: #ffb667;
  border-color: #ff9222;
  color: #5c330a;
}

.chip:hover {
  color: #810000;
  background: #ff9222;
  
}

#clearQuery {
  padding: 0.4rem;
  margin-left: 3rem;
}

a {
  &:link {
    text-decoration: none;
  }
  
  &:visited {
    text-decoration: none;
  }
  
  &:hover {
    text-decoration: none;
  }
  
  &:active {
    text-decoration: none;
  }
}

/* SECTION: Dataset info */
.dataset-info {
  margin: 8px 0 14px;
  padding: 10px 11px;
  border-radius: 10px;
  border: 1px dashed var(--color-border-subtle);
  background: var(--bg-input);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  
  .dataset-info__placeholder {
    margin: 0;
    visibility: hidden;
  }
  
  .dataset-info__title {
    margin: 0 0 4px;
    font-size: var(--text-sm);
    color: var(--color-text);
  }
  
  .dataset-info__meta {
    margin: 0;
  }
}

.dataset__provider {
  font-size: var(--text-md);
  color: #92b0ff;
  margin-bottom: 0rem;
  margin-top: 0rem;
  font-weight: 600;
}

.dataset__provider-detail {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

.dataset__section-label {
  font-size: var(--text-lg);
  font-weight: 600;
  margin: 0 0;
}

.dataset__description {
  font-size: var(--text-md);
  color: var(--color-text);
  margin-top: 0.5rem;
  font-weight: normal;
}

.dataset__description--two-columns {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.dataset__description--two-columns img {
  flex-shrink: 0;
}

.dataset__description--two-columns p {
  margin: 0;
}

/* SECTION: Map */
.map-container {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 10px;
}

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

.map-canvas {
  position: relative;
  border-radius: 14px;
  border: 1px solid var(--color-border-strong);
  background: radial-gradient(circle at 50% 0, var(--color-accent-soft), transparent 50%),
  radial-gradient(circle at 50% 100%, var(--color-accent-soft), transparent 50%),
  radial-gradient(circle at 0 50%, rgba(59, 130, 246, 0.12), transparent 45%),
  radial-gradient(circle at 100% 50%, rgba(79, 70, 229, 0.16), transparent 45%),
  var(--bg-map);
  overflow: hidden;
  min-height: 220px;
}

.map-overlay-hint {
  position: absolute;
  top: 10px;
  left: 12px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-input);
  border: 1px solid var(--color-border-subtle);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.selection-box {
  position: absolute;
  border: 1px solid var(--color-accent);
  background: var(--color-accent-soft);
  pointer-events: none;
}

.selection-box.hidden {
  display: none;
}

.map-legend {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.map-legend__list {
  padding-left: 18px;
  margin: 6px 0 0;
}

/* SECTION: Metadata display */
.metadata-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-input);
  border-radius: 8px;
  border: 1px solid var(--color-border-subtle);
}

.metadata-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metadata-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  opacity: 0.8;
}

.metadata-value {
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
}

/* SECTION: Results & Cards */
.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 10px;
}

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

.content-card {
  background: var(--bg-panel);
  padding: 10px;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.content-card--wide {
  grid-column: span 1;
}

.content-card__header {
  margin-bottom: 6px;
}

.content-card__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: 0;
  margin-top: 0.5rem;
}

.content-card__subtitle {
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.content-card__body {
  padding: 0.1rem 0.7rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 9px;
  background: var(--bg-panel-sub);
}

.content-card__description {
  font-size: var(--text-sm);
  line-height: 1.6;
}

.content-card__meta-grid {
  display: flex;
  gap: 1.5rem;
}

.content-card__logo-group {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.content-card__logo {
  max-height: 5rem;
  object-fit: contain;
}

.results-panel { @extend .content-card; }
.dataset { @extend .content-card; }

.dataset--hidden {
  display: none;
}

.hidden {
  display: none;
}

.ascii-view {
  flex: 1;
  border-radius: 9px;
  border: 1px solid var(--color-border-subtle);
  background: var(--bg-ascii);
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text);
  overflow: auto;
  white-space: pre;
}

.image-view {
  flex: 1;
  border-radius: 9px;
  border: 1px dashed var(--color-border-subtle);
  background: var(--bg-panel-sub);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.image-view__placeholder {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.image-view img {
  max-width: 100%;
  height: auto;
  display: block;
}

.plotly-view .js-plotly-plot {
  position: relative;
}

.plotly-view {
  flex: 1;
  border-radius: 9px;
  border: 1px solid var(--color-border-subtle);
  background: var(--bg-panel-sub);
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 450px;
  overflow: hidden;
  position: relative;
}

.plotly-view__clip {
  flex: 1;
  width: 100%;
  min-height: 400px;
  position: relative;
}

#plotlyViewRoot {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
}

.plotly-view__placeholder {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: 20px;
}

/* Plotly theme adjustments */
.plotly-view .modebar {
  display: flex;
  left: auto !important;
  right: 3px !important;
  transform: scale(0.8);
  background: var(--bg-input) !important;
  border-radius: 3px;
  padding: 4px;
  border: 1px solid var(--color-border-subtle);
}

.plotly-view .modebar-btn {
  color: var(--color-text-muted) !important;
}

.plotly-view .modebar-btn:hover {
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
}

.plotly-view .modebar-btn.active {
  background: var(--color-accent-soft) !important;
  color: var(--color-accent) !important;
}

/* SECTION: Utility */
.hidden {
  display: none;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.split {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}

.split--media-text {
  align-items: flex-start;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.text-small {
  font-size: var(--text-sm);
}

.field__label--inline {
  text-transform: none;
  letter-spacing: normal;
  font-size: var(--text-sm);
}

.panel__title--compact {
  margin-bottom: 2px;
}

/* Tabs */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0;
  backdrop-filter: blur(8px);
}

/* Modern tab look */
.tab {
  appearance: none;
  border: none;
  background: linear-gradient(to bottom, var(--tab-bg1), var(--tab-bg2));
  padding: 0.5rem 1rem;
  border-radius: 0.6rem 0.6rem 0 0;
  color: var(--tab-fg);
  font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: background 0.2s, color 0.2s;
}

/* Hover */
.tab:hover {
  background: linear-gradient(to bottom, var(--tab-hover1), var(--tab-hover2));
}

/* Active tab */
.tab--active {
  background: var(--tab-active-bg);
  color: var(--tab-active-fg);
  box-shadow: 0 0 0 1px var(--tab-active-border),
  0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Active indicator line */
.tab--active::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: -1px;
  height: 3px;
  background: var(--tab-active-border);
  border-radius: 2px;
}

.tab svg {
  width: 16px;
  height: 16px;
}

/* Tab Content */
.tab-content {
  margin-top: 0.5rem;
  padding: 1rem;
  background: var(--content-bg);
  border-radius: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.tab-panel {
  display: none;
  margin-top: 0.5rem;
  padding: 1rem;
  background: var(--content-bg);
  border-radius: 0.5rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  min-width: 700px;
}

.tab-panel--active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

html {
  background-color: #CFD8DC;
}

details {
  padding: 0.5rem;
  margin: 0.5rem;
  width: auto;
  max-width: 100%;
  position: relative;
  border: 1px solid var(--color-border-subtle);
  border-radius: 6px;
  background: var(--bg-panel);
  color: var(--color-text-muted);
  font-weight: bold;
  font-size: var(--text-sm);
  overflow: hidden;
  box-shadow: 0 .25em .5em rgba(33, 54, 62, 0.15);
  transition: box-shadow 0.2s;
}

details[open]::details-content {
  background-color: rgba(255, 255, 255, 0);
  width: auto;
  block-size: auto;
  
  &::before {
    opacity: 0;
    width: auto;
  }
}

details:hover {
  background-color: #879ab2;
  border: 1px solid rgb(253, 135, 9);
}

details::details-content {
  block-size: 0;
  transition: block-size 0.4s ease, content-visibility 0.4s ease allow-discrete;
  overflow: hidden;
  
}

summary {
  display: block;
  position: relative;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  
  &::before,
  &::after {
    width: .75em;
    height: 2px;
    position: absolute;
    top: 50%;
    right: 0;
    content: '';
    background-color: currentColor;
    text-align: right;
    transform: translateY(-50%);
    transition: transform .2s ease-in-out;
  }
  
  &::after {
    transform: translateY(-50%) rotate(90deg);
    
    [open] & {
      transform: translateY(-50%) rotate(180deg);
    }
  }
  
  &::-webkit-details-marker {
    display: none;
  }
}

p {
  margin: 0 0 1em;
  line-height: 1.5;
  font-weight: normal;
}

ul {
  margin: 0 0 1em;
  padding: 0 0 0 1em;
}

li:not(:last-child) {
  margin-bottom: 0.5em;
}

code {
  padding: 0.2em;
  border-radius: 3px;
  background-color: #E0E0E0;
  
  pre > & {
    display: block;
    padding: 1em;
    margin: 0;
  }
}

.theme-background .dataset__intro {
  padding: 0.7rem;
  border: 1px solid var(--color-border-subtle);
  border-radius: 9px;
  background: var(--bg-panel-sub);
  margin-bottom: 1rem;
}

.impact-accordion details {
  width: 100%;
  margin: 0.4rem 0;
}

.impact-accordion__body {
  color: var(--color-text);
  font-size: var(--text-sm);
  padding: 0.6rem;
  font-weight: normal;
}

.impact-accordion__title {
  font-size: 1rem;
  font-weight: 700;
  padding: 0.5rem 0.2rem;
  border-bottom: 3px solid var(--color-text-accordion-title);
  border-radius: 4px 4px 0 0;
  margin-bottom: 0;
  color: var(--color-text-accordion-title);
}

.impact-accordion__section {
  background-color: var(--color-bg-accordion-tab);
  border-radius: 0 1rem 1rem 0;
  padding: 0.5rem 1rem 0.5rem 1.5rem;
  border-left: 4px solid #2a6db5;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-h3);
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .dataset__description--two-columns {
    flex-direction: column;
    align-items: center;
  }
}

.cards {
  max-width: 700px;
  margin: 1em auto;
  
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-gap: 20px;
}

.card {
  border: 1px solid #999999;
  border-radius: 3px;
  display: grid;
  padding: 0.2rem;
  max-width: 300px;
}

.card img {
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.card h4 {
  margin: 0;
  padding: 0.5rem;
}

.card-authors {
  font-weight: normal;
  font-style: italic;
  font-size: 0.8rem;
  padding: 0.5rem 0.3rem;
  background: var(--color-accent-soft);
}

.card footer {
  background-color: #333333;
  color: white;
  padding: 0.5rem;
}

.ul_tab {
  display: inline-block;
  margin-left: 2em;
}

h4 {
  margin: 0;
  padding: 0.5rem;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0;
}

.map-grid__item {
  background-color: #c0c2c5;
  border-left: 4px solid #000000;
  border-radius: 0 8px 8px 0;
  overflow: hidden;
  margin: 0;
}

.map-grid__image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.map-grid__caption {
  font-size: 0.85rem;
  color: #444;
  padding: 0.5rem 0.75rem;
}