:root {
  color-scheme: light dark;
  --color-bg: #f9f9f7;
  --color-surface: #fcfcfb;
  --color-text-primary: #0b0b0b;
  --color-text-secondary: #52514e;
  --color-text-muted: #898781;
  --color-border: rgba(11, 11, 11, 0.1);
  --color-accent: #2a78d6;
  --color-accent-track: #b7d3f6;
  --color-orb-1: #2a78d6;
  --color-orb-2: #1baf7a;
  --radius-lg: 20px;
  --radius-md: 12px;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #0d0d0d;
    --color-surface: rgba(26, 26, 25, 0.72);
    --color-text-primary: #ffffff;
    --color-text-secondary: #c3c2b7;
    --color-text-muted: #898781;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-accent: #3987e5;
    --color-accent-track: #184f95;
    --color-orb-1: #3987e5;
    --color-orb-2: #199e70;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: -1;
  pointer-events: none;
}

.bg-orb--one {
  width: 420px;
  height: 420px;
  top: -120px;
  left: -100px;
  background: var(--color-orb-1);
}

.bg-orb--two {
  width: 380px;
  height: 380px;
  bottom: -140px;
  right: -100px;
  background: var(--color-orb-2);
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.app-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 4px;
}

.subtitle {
  margin: 0 0 24px;
  color: var(--color-text-secondary);
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.glass-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  padding: 24px;
}

.controls-panel {
  align-self: start;
  position: sticky;
  top: 20px;
}

@media (max-width: 768px) {
  .controls-panel {
    position: static;
  }
}

.preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.preset-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-primary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.preset-btn:hover {
  background: var(--color-border);
}

.form-group {
  margin-bottom: 20px;
}

.form-group--nested {
  margin-top: 12px;
  margin-bottom: 0;
}

.form-group--collapsed summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
}

.value-label {
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  background: var(--color-border);
  cursor: help;
  vertical-align: middle;
}

.form-control {
  width: 100%;
  accent-color: var(--color-accent);
}

.toggle-row {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}

.toggle-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-secondary);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.toggle-btn.is-active {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
}

.hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 6px 0 0;
}

.results-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-value {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: normal;
}

.hero-unit {
  font-size: 16px;
  color: var(--color-text-secondary);
}

.meter {
  width: 100%;
  margin-bottom: 24px;
}

.meter-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: var(--color-accent-track);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  border-radius: 999px;
  transition: width 80ms linear;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.stat-row {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.stat-tile {
  flex: 1;
  background: var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
}

.stat-label {
  font-size: 12px;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
}

.app-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}
