:root {
  color-scheme: light;
  --bg: #eef1f6;
  --bg-2: #e4ebf5;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --text: #15202b;
  --muted: #556373;
  --line: rgba(21, 32, 43, 0.12);
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: rgba(15, 118, 110, 0.12);
  --shadow: 0 24px 60px rgba(15, 23, 42, 0.08);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(15, 118, 110, 0.08), transparent 26%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, 0.9fr);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 20px;
}

.hero-copy,
.hero-aside,
.panel {
  background: var(--panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 34px;
}

.hero-aside {
  padding: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 10ch;
  margin-bottom: 16px;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.3rem, 2vw, 1.8rem);
  letter-spacing: -0.02em;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  gap: 18px;
}

.mode-switch {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.mode-tab {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mode-tab.is-active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 118, 110, 0.18);
}

.mode-tab:focus-visible,
.button:focus-visible,
.text-button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  outline-offset: 2px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 18px;
}

.panel {
  padding: 24px;
}

.panel-heading {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
}

.panel-hint {
  max-width: 24ch;
  margin: 0;
  color: var(--muted);
  text-align: right;
}

.calculator-form {
  display: grid;
  gap: 18px;
}

.mode-pane.is-hidden {
  display: none;
}

.field-grid,
.benchmark-grid,
.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.field span {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
}

.field.inline {
  min-width: 220px;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text);
}

input:focus,
select:focus {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.1);
}

.benefit-block,
.advanced {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.48);
  padding: 16px;
}

.advanced summary {
  cursor: pointer;
  font-weight: 700;
}

.advanced-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
}

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

.benefit-head h3 {
  margin: 0;
  font-size: 1rem;
}

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

.benefit-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
}

.benefit-chip input {
  width: auto;
  min-height: auto;
  margin: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.text-button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.button {
  padding: 0 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.button.secondary {
  background: rgba(15, 118, 110, 0.09);
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.2);
}

.button.ghost {
  background: transparent;
  color: var(--accent-strong);
  border-color: rgba(15, 118, 110, 0.18);
}

.text-button {
  background: transparent;
  color: var(--accent-strong);
}

.button:hover,
.text-button:hover,
.mode-tab:hover {
  transform: translateY(-1px);
}

.results-panel {
  display: grid;
  gap: 18px;
}

.result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.result-card,
.benchmark-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
}

.result-card-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.result-card-value {
  font-size: 1.45rem;
  letter-spacing: -0.03em;
}

.placeholder {
  margin: 0;
  color: var(--muted);
}

.result-body {
  padding: 6px 2px 2px;
}

.result-summary h3 {
  margin-bottom: 6px;
  font-size: 1.05rem;
}

.result-meta {
  color: var(--muted);
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: 10px 16px;
  margin: 16px 0;
}

.detail-list dt {
  color: var(--muted);
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
}

.detail-list.compact {
  gap: 8px 12px;
}

.result-note,
.error-copy,
.benchmark-subtitle {
  color: var(--muted);
}

.benchmarks-panel .panel-heading {
  align-items: center;
}

.footer {
  padding: 22px 8px 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.stack {
  display: grid;
  gap: 12px;
}

.doc-card {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.doc-card h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.doc-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.benchmark-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.benchmark-card h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.benchmark-subtitle {
  margin-bottom: 12px;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.95em;
}

@media (max-width: 980px) {
  .hero,
  .workspace-grid,
  .benchmark-grid {
    grid-template-columns: 1fr;
  }

  .panel-hint {
    text-align: left;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1240px);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-aside,
  .panel {
    padding: 18px;
  }

  h1 {
    max-width: none;
  }

  .field-grid,
  .result-grid,
  .benefit-grid {
    grid-template-columns: 1fr;
  }

  .detail-list {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }
}
