:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --text: #102a43;
  --muted: #486581;
  --brand: #0b6e4f;
  --brand-2: #ff9f1c;
  --border: #cbd5e1;
  --shadow-soft: 0 10px 28px -22px #0b1f331f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, #ffe9c2 0%, transparent 32%),
    radial-gradient(circle at bottom left, #d9f4e8 0%, transparent 30%),
    var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  width: min(1140px, 92%);
  margin: 0 auto;
}

header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  background: #fffffff0;
  backdrop-filter: blur(8px);
}

.logo {
  display: inline-block;
  margin: 0;
}

.logo-img {
  display: block;
  width: clamp(100px, 16vw, 150px);
  height: auto;
}

.hero {
  padding: 34px 0 20px;
}

.hero h1 {
  font-family: "Merriweather", Georgia, serif;
  line-height: 1.2;
  margin: 0 0 12px;
  font-size: clamp(1.55rem, 2.7vw, 2.25rem);
}

.hero p {
  max-width: 74ch;
  color: #243b53;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-badges span {
  font-size: 0.88rem;
  font-weight: 700;
  background: #e6f4ef;
  color: #0b6e4f;
  border: 1px solid #c5eadb;
  padding: 6px 10px;
  border-radius: 999px;
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.grid .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -24px #000;
  border-color: #b6c6d8;
}

.card p {
  margin-top: 0.45rem;
  margin-bottom: 0.75rem;
}

.card h2,
.card h3 {
  margin-top: 0;
  font-family: "Merriweather", Georgia, serif;
}

a {
  color: var(--brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #f0b429;
  outline-offset: 2px;
  border-radius: 8px;
}

label {
  display: block;
  font-weight: 600;
  margin: 10px 0 4px;
}

input,
select,
button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 700;
  border: none;
  background: linear-gradient(90deg, var(--brand), #0f9970);
  color: #fff;
}

button.secondary {
  background: #fff;
  border: 1px solid var(--brand);
  color: var(--brand);
}

button:hover {
  filter: brightness(1.03);
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #86d3b8;
  background: linear-gradient(180deg, #f4fff9 0%, #ebfff4 100%);
  border-radius: 12px;
  font-weight: 700;
  color: #0f5132;
  box-shadow: 0 8px 18px -18px #0b6e4f;
}

body:not(.app-ready) .result {
  color: transparent;
  border-color: #d8dee7;
  background: linear-gradient(100deg, #f2f4f8 30%, #e8edf5 50%, #f2f4f8 70%);
  background-size: 200% 100%;
  animation: result-pulse 1.4s infinite linear;
}

.ad-slot {
  display: none;
  border: 1px dashed #9fb3c8;
  border-radius: 10px;
  background: #f0f4f8;
  padding: 14px;
  text-align: center;
  color: #486581;
  margin: 18px 0;
}

.ad-slot.has-ad {
  display: block;
}

.ad-slot ins.adsbygoogle {
  display: block;
  min-height: 90px;
}

.faq details {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}

footer {
  margin-top: 34px;
  padding: 20px 0 36px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer {
  margin-top: 30px;
  border-top: 1px solid var(--border);
  padding: 18px 0 30px;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: #334e68;
}

.affiliate-box {
  margin-top: 18px;
}

.affiliate-note {
  font-size: 0.9rem;
  color: var(--muted);
}

.related-calcs {
  margin-top: 18px;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.related-list a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

.related-list a:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.page-meta {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 4px 0 14px;
}

.toc {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  background: #f8fbff;
}

.toc h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
}

.toc-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toc-list a {
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid #d9e2ec;
  padding: 5px 9px;
  border-radius: 999px;
  background: #fff;
  color: #334e68;
}

.toc-list a:hover {
  border-color: #b6c2cf;
}

.back-top {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 1000;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 10px 20px -14px #000;
}

.back-top.show {
  display: inline-flex;
}

@keyframes result-pulse {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.cookie-banner {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 9999;
  background: #102a43;
  color: #f0f4f8;
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 10px 30px -20px #000;
}

.cookie-banner p {
  margin: 0 0 10px;
  font-size: 0.95rem;
}

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

.cookie-actions button {
  width: auto;
  padding: 8px 12px;
}

.cookie-custom-panel {
  margin-top: 10px;
  border: 1px solid #486581;
  border-radius: 10px;
  padding: 10px;
  background: #1f3a56;
}

.cookie-custom-panel label {
  display: block;
  margin: 6px 0;
  font-weight: 400;
  color: #d9e2ec;
}

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

  .hero {
    padding-top: 26px;
  }
}
