:root {
  color-scheme: light;
  --bg: #0b1020;
  --panel: #0f1730;
  --panel2: #0b132a;
  --text: #e9eeff;
  --muted: #a9b6e8;
  --faint: #7f8cc6;
  --border: rgba(255, 255, 255, 0.12);
  --border2: rgba(255, 255, 255, 0.08);
  --accent: #78a6ff;
  --accent2: #7ef0c1;
  --warn: #ffcc66;
  --danger: #ff6b6b;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --radius2: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 700px at 20% -20%, rgba(120, 166, 255, 0.45), transparent 55%),
    radial-gradient(900px 600px at 110% 10%, rgba(126, 240, 193, 0.22), transparent 60%),
    radial-gradient(900px 700px at 40% 120%, rgba(120, 166, 255, 0.12), transparent 60%), var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border2);
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(12px);
}

.topbar__h1 {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.topbar__sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 48, 0.65);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(120, 166, 255, 0.35);
  background: rgba(15, 23, 48, 0.9);
}

.btn:active {
  transform: translateY(0px);
}

.btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.btn--secondary {
  border-color: rgba(126, 240, 193, 0.28);
}

.btn--ghost {
  background: transparent;
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.16);
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  min-height: calc(100vh - 56px - 44px);
}

.panel {
  border-right: 1px solid var(--border2);
  padding: 14px;
  background: linear-gradient(180deg, rgba(15, 23, 48, 0.42), rgba(15, 23, 48, 0.22));
}

.panel__section {
  padding: 12px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: rgba(11, 19, 42, 0.55);
  box-shadow: var(--shadow);
}

.panel__section + .panel__section {
  margin-top: 12px;
}

.panel__sectionTitle {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 8px;
  padding: 6px 0;
}

.kv__k {
  color: var(--faint);
  font-size: 12px;
}

.kv__v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.plotArea {
  position: relative;
  padding: 14px;
}

.plot {
  width: 100%;
  height: calc(100vh - 56px - 44px - 28px);
  min-height: 520px;
  border-radius: var(--radius);
  border: 1px solid var(--border2);
  background: rgba(11, 19, 42, 0.35);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dropzone {
  position: absolute;
  inset: 14px;
  border-radius: var(--radius);
  border: 1px dashed rgba(120, 166, 255, 0.55);
  background: rgba(11, 16, 32, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dropzone--active {
  display: flex;
}

.dropzone__inner {
  text-align: center;
  padding: 22px 24px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 48, 0.6);
}

.dropzone__title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.dropzone__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.filterCard {
  padding: 10px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 48, 0.55);
}

.filterCard + .filterCard {
  margin-top: 10px;
}

.filterHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.filterTitle {
  font-size: 13px;
  font-weight: 650;
  flex: 1 1 auto;
  min-width: 0;
}

.filterMap {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
  min-width: 0;
}

/* Prevent the "Column" mapping select from stretching past the panel. */
.filterMap select {
  width: auto;
  max-width: 180px;
}

select,
input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"] {
  width: 100%;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 19, 42, 0.55);
  color: var(--text);
  outline: none;
  min-width: 0;
}

select:focus,
input:focus {
  border-color: rgba(120, 166, 255, 0.55);
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 19, 42, 0.45);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.chip[aria-pressed="true"] {
  border-color: rgba(126, 240, 193, 0.55);
  background: rgba(126, 240, 193, 0.12);
}

.details {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.details--empty {
  color: var(--muted);
  font-family: var(--sans);
}

.footer {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-top: 1px solid var(--border2);
  color: var(--muted);
  font-size: 12px;
  background: rgba(11, 16, 32, 0.72);
  backdrop-filter: blur(12px);
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(120, 166, 255, 0.18);
  border: 1px solid rgba(120, 166, 255, 0.28);
  color: var(--text);
  font-size: 11px;
  margin-right: 8px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .panel {
    border-right: none;
    border-bottom: 1px solid var(--border2);
  }
  .plot {
    height: 72vh;
  }
}
