:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --panel: #101418;
  --ink: #151a1f;
  --muted: #65717d;
  --line: #dce3ea;
  --accent: #0b7f86;
  --accent-dark: #075c61;
  --signal: #31c48d;
  --amber: #9a650d;
  --radius: 6px;
  --shadow: 0 18px 44px rgba(21, 26, 31, .07);
}

/* Premium tool-site treatment for the calculator-first MVP. */
:root {
  --bg: #f3f5f7;
  --surface: #ffffff;
  --panel: #0d1320;
  --panel-soft: #151d2b;
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee8;
  --accent: #2563eb;
  --accent-dark: #1e40af;
  --signal: #2dd4bf;
  --shadow: 0 24px 70px rgba(17, 24, 39, .09);
}

body {
  background:
    radial-gradient(circle at 20% -10%, rgba(37, 99, 235, .12), transparent 32%),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 42%, #eef2f6 100%);
}

.site-header {
  background: rgba(248, 250, 252, .88);
}

.tool-page {
  max-width: 1280px;
  margin: 0 auto;
}

.tool-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 260px;
}

.status-strip span {
  padding: 8px 10px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
}

.tool-shell {
  grid-template-columns: minmax(0, 1fr) 390px;
}

.calculator {
  padding: 24px;
  background: rgba(255, 255, 255, .9);
}

input[type="number"],
select {
  background: #fbfcfe;
}

.result-panel {
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(37, 99, 235, .14), transparent 42%),
    var(--panel);
  border-color: #26334a;
  color: #f8fbff;
}

.result-panel p,
.result-panel span {
  color: #b6c2d2;
}

.mini-stats div {
  background: var(--panel-soft);
  border-color: #26334a;
}

.formula-bar {
  display: grid;
  gap: 8px;
  margin: 0 0 24px;
  padding: 16px 18px;
  background: #0f172a;
  border: 1px solid #23314d;
  border-radius: var(--radius);
  color: #dbeafe;
}

.formula-bar span {
  color: var(--signal);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.formula-bar code {
  white-space: normal;
  color: #f8fafc;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.scenario-grid article {
  padding: 18px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.scenario-grid span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.scenario-grid h2 {
  margin-top: 8px;
  font-size: 20px;
}

.source-note {
  background: #eef6ff;
  border-color: #cfe0ff;
  color: #233b66;
}

.update-log ul {
  margin: 0;
  padding: 18px 22px 18px 38px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.update-log li + li {
  margin-top: 8px;
}

.prompt-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prompt-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 30px;
}

.prompt-filter-bar a {
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.prompt-section {
  margin: 0 0 42px;
}

.prompt-section h2 {
  margin-bottom: 16px;
}

.prompt-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  margin-bottom: 16px;
  padding: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.prompt-card span {
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.prompt-card h3 {
  margin: 6px 0 0;
  font-size: 22px;
}

.prompt-card p {
  margin-bottom: 0;
}

.prompt-card pre {
  grid-column: 1 / -1;
  max-height: 420px;
  margin: 0;
  overflow: auto;
  padding: 18px;
  background: #0f172a;
  border: 1px solid #23314d;
  border-radius: var(--radius);
  color: #e5eefc;
  white-space: pre-wrap;
}

.copy-button {
  align-self: start;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.copy-button.copied {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

@media (max-width: 900px) {
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .tool-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-strip {
    justify-content: flex-start;
  }

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

  .prompt-teaser,
  .prompt-card {
    grid-template-columns: 1fr;
  }

  .prompt-teaser {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font: inherit;
}

a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(244, 246, 248, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

nav a {
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  color: var(--accent-dark);
}

.theme-toggle {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.hero,
.tool-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 32px;
  padding: clamp(46px, 7vw, 92px) clamp(18px, 5vw, 64px);
  align-items: end;
}

.tool-page {
  padding: clamp(34px, 5vw, 70px) clamp(18px, 5vw, 64px) clamp(52px, 7vw, 92px);
}

.tool-hero {
  display: block;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  max-width: 960px;
  font-size: clamp(40px, 6vw, 76px);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(22px, 3vw, 34px);
}

p {
  color: var(--muted);
}

.lede {
  max-width: 720px;
  font-size: clamp(18px, 2vw, 22px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 800;
}

.primary {
  background: var(--accent);
  color: #fff;
}

.secondary {
  background: #e6edf1;
  color: var(--ink);
}

.hero-panel,
.resource-card,
.result-panel,
.tool-card,
.note-list,
.calculator,
.checklist {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 22px;
}

.code-panel {
  background: var(--panel);
  border-color: #26313a;
  color: #e7edf2;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.panel-title {
  margin: 0 0 6px;
  color: var(--signal);
  font-size: 13px;
}

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

.code-panel .metric {
  border-bottom-color: #26313a;
}

.metric:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.metric span,
.card-label,
.tool-card span,
.result-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.code-panel .metric span {
  color: #9fb1bf;
}

.metric strong {
  text-align: right;
}

.code-panel .metric strong {
  color: #f5fafc;
  font-size: 14px;
}

.resource-grid,
.split-section,
.page {
  padding: 0 clamp(18px, 5vw, 64px) clamp(52px, 7vw, 92px);
}

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

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

.resource-card,
.tool-card {
  padding: 22px;
}

.resource-card,
.tool-card,
.calculator,
.result-panel,
.note-list,
.table-wrap,
.checklist {
  box-shadow: none;
}

.resource-card p,
.tool-card p {
  min-height: 72px;
}

.resource-card a {
  color: var(--accent-dark);
  font-weight: 800;
}

.source-note {
  padding: 14px 16px;
  background: #e8f4f4;
  border: 1px solid #c7e1e1;
  border-radius: var(--radius);
  color: #24484c;
  font-weight: 650;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.note-list {
  padding: 22px;
}

.page {
  padding-top: clamp(36px, 6vw, 72px);
}

.page.narrow {
  max-width: 780px;
}

.page-heading {
  margin-bottom: 28px;
}

.tool-layout,
.tool-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-bottom: 34px;
}

.calculator {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 22px;
}

.field-group {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 700;
}

input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
}

.result-panel {
  padding: 24px;
}

.result-panel strong {
  display: block;
  margin: 16px 0;
  font-size: clamp(36px, 5vw, 54px);
}

.mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}

.mini-stats div {
  padding: 12px;
  background: #f4f7f8;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mini-stats strong {
  margin: 4px 0 0;
  font-size: 16px;
}

.content-block {
  margin-top: 24px;
}

.tool-notes {
  max-width: 920px;
}

.faq {
  max-width: 920px;
}

details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 10px;
  padding: 14px 16px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--accent-dark);
  font-size: 13px;
  text-transform: uppercase;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.filter-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.filter-button.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

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

.checklist {
  display: grid;
  gap: 12px;
  padding: 22px;
  max-width: 900px;
}

.checklist label {
  grid-template-columns: 22px 1fr;
  align-items: start;
  font-weight: 650;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 5vw, 64px);
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 680px;
  margin: 0;
}

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

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

@media (max-width: 640px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .resource-grid,
  .resource-grid.compact,
  .tool-grid,
  .calculator {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 42px;
  }
}

body.theme-gold {
  --bg: #070707;
  --surface: #111111;
  --panel: #050505;
  --panel-soft: #17110a;
  --ink: #f5f0e6;
  --muted: #a9a197;
  --line: rgba(214, 168, 79, .24);
  --accent: #d6a84f;
  --accent-dark: #f0c66a;
  --signal: #f0c66a;
  --shadow: 0 26px 80px rgba(0, 0, 0, .38);
  background:
    radial-gradient(circle at 18% -10%, rgba(214, 168, 79, .18), transparent 34%),
    linear-gradient(180deg, #090909 0%, #070707 48%, #0d0a06 100%);
}

body.theme-gold .site-header {
  background: rgba(7, 7, 7, .88);
}

body.theme-gold .brand,
body.theme-gold h1,
body.theme-gold h2,
body.theme-gold h3,
body.theme-gold label,
body.theme-gold summary {
  color: var(--ink);
}

body.theme-gold p,
body.theme-gold nav,
body.theme-gold .lede {
  color: var(--muted);
}

body.theme-gold .theme-toggle,
body.theme-gold .status-strip span,
body.theme-gold .calculator,
body.theme-gold .scenario-grid article,
body.theme-gold .table-wrap,
body.theme-gold details,
body.theme-gold .prompt-teaser,
body.theme-gold .prompt-filter-bar a,
body.theme-gold .prompt-card,
body.theme-gold .update-log ul {
  background: rgba(17, 17, 17, .92);
  border-color: var(--line);
  color: var(--ink);
}

body.theme-gold input[type="number"],
body.theme-gold select {
  background: #0c0c0c;
  border-color: var(--line);
  color: var(--ink);
}

body.theme-gold .result-panel,
body.theme-gold .formula-bar,
body.theme-gold .prompt-card pre {
  background:
    linear-gradient(180deg, rgba(214, 168, 79, .16), transparent 44%),
    #050505;
  border-color: rgba(214, 168, 79, .32);
}

body.theme-gold .result-panel strong {
  color: #f7d987;
}

body.theme-gold .mini-stats div {
  background: #17110a;
  border-color: rgba(214, 168, 79, .24);
}

body.theme-gold .source-note {
  background: rgba(214, 168, 79, .12);
  border-color: rgba(214, 168, 79, .28);
  color: #f4d996;
}

body.theme-gold .button.primary,
body.theme-gold .filter-button.active {
  background: var(--accent);
  color: #090909;
}

body.theme-gold .copy-button {
  background: #17110a;
  border-color: var(--line);
  color: var(--ink);
}
