:root {
  --bg: #171633;
  --bg-accent: #232549;
  --panel: rgba(31, 33, 69, 0.9);
  --panel-strong: #232549;
  --line: rgba(151, 241, 82, 0.14);
  --text: #f1f4ff;
  --muted: #b8bfdf;
  --accent: #97f152;
  --accent-soft: #b4fa79;
  --accent-deep: #6fcb3f;
  --success: #97f152;
  --shadow: 0 24px 70px rgba(4, 5, 20, 0.42);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(151, 241, 82, 0.11), transparent 28%),
    radial-gradient(circle at right 20%, rgba(60, 72, 142, 0.28), transparent 30%),
    linear-gradient(180deg, #14132b 0%, #1c1d3f 52%, #171633 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  z-index: -1;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.55;
}

body::before {
  top: 72px;
  right: 8%;
  width: 240px;
  height: 240px;
  background: rgba(151, 241, 82, 0.12);
}

body::after {
  bottom: 48px;
  left: 6%;
  width: 180px;
  height: 180px;
  background: rgba(54, 65, 126, 0.36);
}

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

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

.hero-copy,
.hero-card,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 0;
}

.hero-copy {
  padding: 40px;
}

.hero-card {
  padding: 28px;
  background:
    linear-gradient(145deg, rgba(24, 20, 57, 0.98), rgba(37, 39, 81, 0.98)),
    var(--panel);
  color: #f4ffe8;
}

.eyebrow,
.section-kicker,
.card-label,
.meta-label {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  font-weight: 700;
}

.eyebrow,
.section-kicker,
.meta-label {
  color: var(--accent);
}

.card-label {
  color: rgba(180, 250, 121, 0.74);
}

h1,
h2,
h3,
.results-value {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  margin: 0;
  line-height: 1.02;
}

h1 {
  font-size: clamp(3rem, 6vw, 5rem);
  letter-spacing: -0.04em;
  margin-bottom: 16px;
}

h2 {
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.035em;
}

h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.hero-text,
.mode-description,
.insight-list p,
.info-text,
.note-box,
.form-error,
label span,
.field-help,
.result-caption,
.result-table,
.endurance-table,
.feature-list,
.results-note {
  line-height: 1.55;
}

.hero-text {
  max-width: 56ch;
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.feature-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: rgba(241, 244, 255, 0.92);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.75fr);
  gap: 24px;
  align-items: start;
}

.calculator-panel,
.results-panel {
  grid-column: 1;
}

.results-panel {
  grid-column: 1 / -1;
}

.side-column {
  grid-column: 2;
  display: grid;
  gap: 24px;
}

.panel {
  padding: 28px;
}

.accordion-panel {
  padding: 18px 20px 20px;
}

.panel-header,
.mode-meta,
.form-actions,
.result-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.accordion-trigger:focus-visible {
  outline: 3px solid rgba(151, 241, 82, 0.28);
  outline-offset: 6px;
  border-radius: var(--radius-sm);
}

.accordion-title {
  display: block;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.accordion-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.accordion-icon::before,
.accordion-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 2px;
  background: var(--accent);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease, opacity 180ms ease;
}

.accordion-icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.accordion-trigger[aria-expanded="true"] .accordion-icon::after {
  opacity: 0;
  transform: translate(-50%, -50%) rotate(90deg) scaleX(0.2);
}

.accordion-content {
  padding-top: 10px;
}

.ghost-button,
.primary-button,
.mode-button {
  appearance: none;
  border: none;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.ghost-button,
.mode-button {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost-button {
  padding: 12px 16px;
  font-weight: 700;
}

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

.mode-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 28px 0 22px;
}

.mode-button {
  width: 100%;
  padding: 12px 18px;
  font-weight: 800;
  text-align: center;
}

.mode-button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #14241a;
  box-shadow: 0 12px 24px rgba(151, 241, 82, 0.22);
}

.mode-meta {
  align-items: end;
  margin-bottom: 24px;
}

.mode-meta > * {
  min-width: 0;
}

.mode-description {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
}

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

.field {
  display: grid;
  gap: 8px;
  align-content: start;
}

.field.full {
  grid-column: 1 / -1;
}

label span {
  display: block;
  font-size: 0.92rem;
  font-weight: 700;
}

.field-help {
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 2.6em;
}

.form-control {
  width: 100%;
  min-height: 56px;
  border: 1px solid rgba(151, 241, 82, 0.14);
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0 15px;
  font: inherit;
  color: var(--text);
  outline: none;
  line-height: 1.2;
}

input.form-control {
  padding-top: 14px;
  padding-bottom: 14px;
}

select.form-control {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 42px;
}

.form-control:focus {
  border-color: rgba(151, 241, 82, 0.58);
  box-shadow: 0 0 0 4px rgba(151, 241, 82, 0.12);
}

.form-actions {
  margin-top: 22px;
}

.primary-button {
  padding: 14px 24px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #14241a;
  font-weight: 800;
  box-shadow: 0 18px 30px rgba(151, 241, 82, 0.18);
}

.form-error {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: #ff9184;
  font-weight: 700;
}

.insight-list {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.insight-list article {
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid rgba(151, 241, 82, 0.08);
}

.insight-list p,
.info-text {
  margin: 0;
  color: var(--muted);
}

.note-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px dashed rgba(151, 241, 82, 0.3);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.result-summary {
  flex-wrap: wrap;
  margin-top: 30px;
  margin-bottom: 22px;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  margin-bottom: 4px;
}

.result-action-button {
  appearance: none;
  min-width: 152px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #14241a;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 28px rgba(151, 241, 82, 0.16);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.result-action-button:hover {
  transform: translateY(-1px);
}

.result-action-button:disabled {
  cursor: default;
  opacity: 0.75;
  transform: none;
}

.result-action-button-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(151, 241, 82, 0.12);
  box-shadow: none;
}

.result-chip {
  flex: 1 1 240px;
  min-width: 180px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(45, 48, 96, 0.88), rgba(28, 29, 63, 0.92));
  border: 1px solid rgba(151, 241, 82, 0.08);
  min-width: 0;
}

.result-caption {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.results-value {
  font-size: 2rem;
  overflow-wrap: anywhere;
}

.results-note {
  margin: 0 0 18px;
  color: var(--muted);
}

.result-block {
  margin-top: 22px;
}

.result-block h3 {
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}

.result-disclosure {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(151, 241, 82, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.result-disclosure summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 1.15rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.result-disclosure summary::-webkit-details-marker {
  display: none;
}

.result-disclosure summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.result-disclosure[open] summary::after {
  content: "-";
}

.result-disclosure[open] .table-wrap {
  margin-top: 14px;
}

.table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid rgba(151, 241, 82, 0.08);
}

.result-table,
.endurance-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.03);
}

.result-table th,
.result-table td,
.endurance-table th,
.endurance-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(151, 241, 82, 0.08);
}

.result-table thead,
.endurance-table thead {
  background: rgba(151, 241, 82, 0.12);
}

.recommended-row {
  background: rgba(151, 241, 82, 0.08);
}

.mini-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mini-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(151, 241, 82, 0.08);
  min-width: 0;
}

.mini-card strong {
  display: block;
  margin-bottom: 8px;
}

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

  .calculator-panel,
  .results-panel,
  .side-column {
    grid-column: auto;
  }

  .side-column {
    order: 2;
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 1200px);
    padding-top: 18px;
  }

  .hero-copy,
  .panel,
  .hero-card {
    padding: 22px;
  }

  .accordion-panel {
    padding: 18px;
  }

  .form-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

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

  .panel-header,
  .mode-meta,
  .form-actions,
  .result-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions {
    flex-direction: column;
  }

  .result-action-button {
    width: 100%;
  }

  h1 {
    font-size: 2.5rem;
  }
}
