﻿:root {
  color-scheme: light;
  --bg: #eef2ef;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #63706b;
  --line: #d6ded9;
  --soft-line: #e8eeeb;
  --accent: #14834a;
  --accent-dark: #0d5f35;
  --accent-soft: #e8f5ee;
  --positive: #168447;
  --positive-bg: #e7f6ed;
  --either: #b7791f;
  --either-bg: #fff7df;
  --negative: #c83f3f;
  --negative-bg: #fdecec;
  --shadow: 0 24px 70px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Roboto", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #7fcca0 0%, #b6e4c8 46%, #f2faf5 100%);
  background-attachment: fixed;
}

a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px 0 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.brand img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.site-header nav,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-header nav {
  flex: 0 1 auto;
}

.install-button {
  appearance: none;
  border: 1px solid rgba(20, 131, 74, 0.28);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 8px 12px;
}

.install-button:hover {
  background: var(--accent-dark);
}

.install-button[hidden] {
  display: none;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 32px 16px;
}

.calculator {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 44px);
}

.home-shell {
  min-height: calc(100vh - 120px);
}

.home-panel {
  width: min(980px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 44px);
}

.home-intro {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.home-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.home-intro h1 {
  margin-bottom: 10px;
}

.home-intro p:last-child {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

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

.tool-card {
  min-width: 0;
  min-height: 210px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  color: var(--ink);
  padding: 18px;
}

.tool-card:hover {
  border-color: rgba(20, 131, 74, 0.38);
  background: var(--accent-soft);
  text-decoration: none;
}

.tool-card span {
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tool-card strong {
  color: var(--ink);
  font-size: 1.18rem;
  line-height: 1.2;
}

.tool-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.5;
}

.intro {
  max-width: 680px;
  margin-bottom: 28px;
}

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

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

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.55;
}

.ad-slot {
  width: 100%;
  min-height: 90px;
  display: grid;
  place-items: center;
  border: 1px dashed #a7b5ae;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.ad-slot-top {
  margin-bottom: 22px;
}

.ad-slot-bottom {
  width: min(920px, 100%);
}

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

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.field-wrap {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 0 16px;
  color: var(--muted);
  font-size: 1.2rem;
}

.field-wrap.suffix {
  grid-template-columns: 1fr auto;
}

input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 14px 8px;
}

select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  padding: 14px 0;
}

input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(20, 131, 74, 0.2);
  border-radius: 6px;
}

.field-wrap.single {
  grid-template-columns: 1fr;
}

.exchange-form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 48px minmax(0, 1fr);
  align-items: end;
}

.metals-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.swap-button {
  appearance: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 58px;
  border: 1px solid rgba(20, 131, 74, 0.28);
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 1.25rem;
  font-weight: 900;
}

.swap-button:hover {
  background: var(--accent-dark);
}

.swap-button:focus-visible {
  outline: 3px solid rgba(20, 131, 74, 0.2);
}

.results {
  display: grid;
  gap: 16px;
}

.status-card {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #f8faf9;
}

.status-dot {
  width: 14px;
  height: 14px;
  margin-top: 5px;
  border-radius: 999px;
  background: var(--muted);
}

.status-card.positive .status-dot {
  background: var(--positive);
}

.status-card.positive {
  border-color: rgba(22, 132, 71, 0.3);
  background: var(--positive-bg);
}

.status-card.warning .status-dot,
.status-card.negative .status-dot {
  background: var(--negative);
}

.status-card.warning,
.status-card.negative {
  border-color: rgba(200, 63, 63, 0.34);
  background: var(--negative-bg);
}

.status-card.either .status-dot {
  background: var(--either);
}

.status-card.either {
  border-color: rgba(183, 121, 31, 0.38);
  background: var(--either-bg);
}

.status-card h2 {
  margin-bottom: 4px;
  font-size: 1.1rem;
  line-height: 1.3;
}

.status-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}

.result-grid article {
  min-width: 0;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  padding: 16px;
}

.result-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.result-grid strong {
  display: block;
  max-width: 100%;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
}

.result-grid strong.long-value {
  font-size: clamp(1rem, 1.65vw, 1.25rem);
}

.result-grid strong.extra-long-value {
  font-size: clamp(0.9rem, 1.35vw, 1.05rem);
}

.seo-copy {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--soft-line);
}

.seo-copy h2 {
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.seo-copy p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

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

.content-page {
  width: min(900px, calc(100% - 32px));
  margin: 32px auto;
  padding: clamp(22px, 5vw, 44px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.policy {
  max-width: 760px;
}

.policy h1 {
  margin-bottom: 22px;
}

.policy h2 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
}

.policy p {
  color: var(--muted);
  line-height: 1.65;
}

@media (max-width: 760px) {
  .site-header,
  .site-footer {
    width: min(100% - 32px, 920px);
    flex-direction: column;
    align-items: center;
  }

  .site-header nav,
  .site-footer nav {
    justify-content: flex-start;
  }

  .inputs,
  .exchange-form,
  .metals-form,
  .exchange-results,
  .tool-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .home-intro {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .swap-button {
    width: 100%;
  }

  .result-grid strong {
    font-size: clamp(1.25rem, 8vw, 1.75rem);
  }

  .result-grid strong.long-value {
    font-size: clamp(1.1rem, 7vw, 1.45rem);
  }

  .result-grid strong.extra-long-value {
    font-size: clamp(1rem, 6vw, 1.25rem);
  }

  .calculator {
    padding: 22px;
  }
}
