:root {
  color-scheme: dark;
  --bg: #08110d;
  --bg-soft: #101b15;
  --panel: #14221a;
  --panel-strong: #192b21;
  --line: rgba(181, 214, 184, 0.18);
  --text: #f3f7f0;
  --muted: #aebcaf;
  --accent: #7fd66b;
  --accent-strong: #b6f26f;
  --gold: #ffd166;
  --danger: #ff7a7a;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --max: 1120px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(127, 214, 107, 0.12), transparent 34rem),
    linear-gradient(180deg, #08110d 0%, #0b1511 52%, #070d0a 100%);
  line-height: 1.5;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 13, 0.86);
  backdrop-filter: blur(16px);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.2rem;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid rgba(127, 214, 107, 0.4);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(127, 214, 107, 0.24), rgba(255, 209, 102, 0.12));
  color: var(--accent-strong);
  font-size: 1.25rem;
}

.brand-mark img {
  height: inherit;
}

.brand-logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.12rem;
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
}

.brand-logo .logo-number {
  color: var(--accent-strong);
  font-weight: 900;
}

.brand-logo .logo-word {
  color: var(--text);
  font-weight: 800;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.nav-logo {
  display: block;
  height: 28px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem 1.2rem 4rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 2rem;
  align-items: center;
  min-height: 54vh;
  padding: 1rem 0 2.25rem;
}

.hero h1,
.page-title h1 {
  margin: 0;
  max-width: 760px;
  font-size: 5rem;
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p,
.page-title p,
.section-lead {
  max-width: 700px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.7rem;
}

.hero-logo-wrap {
  display: flex;
  justify-content: left;
  margin-bottom: 1rem;
}

.hero-logo {
  display: block;
  height: 72px;
  width: auto;
  max-width: 100%;
  opacity: 0.95;
}

.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(20, 34, 26, 0.94), rgba(17, 28, 22, 0.82));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.status-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 24px rgba(127, 214, 107, 0.8);
}

.metric-stack {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
}

.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.metric-row strong {
  color: var(--accent-strong);
  font-size: 1.25rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(127, 214, 107, 0.45);
  border-radius: 8px;
  background: var(--accent);
  color: #071008;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.button:hover {
  filter: brightness(1.06);
}

.section {
  padding: 2.5rem 0 0;
}

.section h2 {
  margin: 0;
  font-size: 2.35rem;
  letter-spacing: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}

.tool-card {
  display: flex;
  flex-direction: column;
  min-height: 13rem;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 34, 26, 0.72);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(127, 214, 107, 0.48);
  background: rgba(25, 43, 33, 0.88);
}

.tool-card .tag {
  align-self: flex-start;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.tool-card h3 {
  margin: 1rem 0 0.5rem;
  font-size: 1.2rem;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
}

.tool-card .arrow {
  margin-top: auto;
  color: var(--accent-strong);
  font-weight: 900;
}

.about-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 1rem;
  align-items: center;
  margin-top: 1.4rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 34, 26, 0.58);
}

.about-stat {
  display: grid;
  place-items: center;
  min-height: 11rem;
  border-radius: var(--radius);
  background: rgba(127, 214, 107, 0.1);
  color: var(--accent-strong);
  font-size: 3rem;
  font-weight: 900;
}

.about-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.page-title {
  padding: 1rem 0 2rem;
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(320px, 1.2fr);
  gap: 1rem;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 34, 26, 0.78);
  box-shadow: 0 16px 52px rgba(0, 0, 0, 0.22);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.panel-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.calc-form {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  color: var(--text);
  font-weight: 750;
}

.input-wrap {
  display: grid;
  align-items: center;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.input-wrap.prefix {
  grid-template-columns: auto minmax(0, 1fr);
}

.input-wrap.suffix {
  grid-template-columns: minmax(0, 1fr) auto;
}

.input-prefix,
.input-suffix {
  display: grid;
  place-items: center;
  min-width: 2.6rem;
  height: 100%;
  padding: 0 0.75rem;
  color: var(--muted);
  border-right: 1px solid var(--line);
}

.input-suffix {
  border-right: 0;
  border-left: 1px solid var(--line);
}

input,
select {
  width: 100%;
  min-height: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  padding: 0.72rem 0.8rem;
  outline: none;
}

.input-wrap input {
  min-height: 2.9rem;
  border: 0;
  border-radius: 0;
  background: transparent;
}

select {
  appearance: auto;
}

input:focus,
select:focus,
.input-wrap:focus-within {
  border-color: rgba(127, 214, 107, 0.7);
  box-shadow: 0 0 0 3px rgba(127, 214, 107, 0.12);
}

.field-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  padding-top: 0.25rem;
}

.results {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.result-hero {
  display: grid;
  gap: 0.35rem;
  padding: 1.1rem;
  border: 1px solid rgba(127, 214, 107, 0.35);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(127, 214, 107, 0.16), rgba(255, 209, 102, 0.08));
}

.result-hero span {
  color: var(--muted);
  font-weight: 750;
}

.result-hero strong {
  color: var(--accent-strong);
  font-size: 3rem;
  line-height: 1;
}

.result-hero p {
  margin: 0;
  color: var(--muted);
}

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

.result-item {
  min-height: 6rem;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.result-item span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 720;
}

.result-item strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--text);
  font-size: 1.45rem;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.rating {
  color: var(--accent-strong);
}

.rating.warn {
  color: var(--gold);
}

.rating.danger {
  color: var(--danger);
}

.formula-panel {
  margin-top: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 34, 26, 0.58);
}

.formula-panel summary {
  cursor: pointer;
  padding: 1rem;
  color: var(--text);
  font-weight: 800;
}

.formula-content {
  display: grid;
  gap: 0.8rem;
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.formula-content p {
  margin: 0;
}

.formula-content ul {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  padding-left: 1.2rem;
}

.disclaimer {
  flex: 1 1 100%;
  color: var(--gold);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.22);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.1rem 1.2rem;
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hero,
  .calculator-shell,
  .about-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .nav {
    align-items: flex-start;
    flex-direction: column;
    padding: 0.8rem 1rem;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 0.25rem;
    width: 100%;
  }

  .nav-links a {
    padding: 0.48rem 0.6rem;
    font-size: 0.9rem;
  }

  .nav-logo {
    height: 24px;
  }

  .page {
    padding: 2rem 1rem 3rem;
  }

  .hero {
    min-height: auto;
  }

  .hero h1,
  .page-title h1 {
    font-size: 2.85rem;
  }

  .section h2 {
    font-size: 1.85rem;
  }

  .hero-logo {
    height: 60px;
  }

  .result-hero strong {
    font-size: 2.15rem;
  }

  .result-item strong {
    font-size: 1.25rem;
  }

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

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media print {
  @page {
    margin: 0.5in;
  }

  :root {
    color-scheme: light;
  }

  html,
  body {
    min-height: auto;
    background: #ffffff;
    color: #111111;
  }

  body {
    font-size: 11pt;
  }

  .site-header,
  .form-actions,
  .calculator-shell > .panel:first-child {
    display: none !important;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .page-title {
    padding: 0 0 0.35in;
  }

  .page-title h1 {
    max-width: none;
    color: #111111;
    font-size: 24pt;
    line-height: 1.1;
  }

  .page-title p,
  .result-hero p,
  .footer-inner,
  .formula-content {
    color: #333333;
  }

  .calculator-shell {
    display: block;
  }

  .panel,
  .result-hero,
  .result-item,
  .formula-panel {
    border: 1px solid #cccccc;
    background: #ffffff;
    box-shadow: none;
  }

  .panel-header {
    border-bottom: 1px solid #cccccc;
  }

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

  .formula-content {
    display: grid !important;
  }

  details.formula-panel > * {
    display: block;
  }

  .result-hero strong,
  .result-item strong,
  .rating,
  .rating.warn,
  .rating.danger {
    color: #111111;
  }

  .result-hero span,
  .result-item span {
    color: #333333;
  }

  .formula-panel {
    break-inside: avoid;
  }

  .formula-panel summary {
    color: #111111;
  }

  .site-footer {
    margin-top: 0.3in;
    border-top: 1px solid #cccccc;
    background: #ffffff;
  }

  .footer-inner {
    display: block;
    max-width: none;
    padding: 0.15in 0 0;
  }

  .footer-inner span {
    display: block;
    margin-top: 0.08in;
  }
}
