/* ==========================================================================
   Toolkit Grid — friendly static styles
   ========================================================================== */

:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --accent: #4f6ef7;
  --accent-soft: #eef2ff;
  --accent-hover: #3b57d9;
  --money: #0d9488;
  --money-soft: #ccfbf1;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgb(30 41 59 / 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 44rem;
  --max-width-wide: 52rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* Header */
.site-header {
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 3px rgb(30 41 59 / 0.04);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav-link {
  padding: 0.4rem 0.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
}

.site-nav-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

.site-nav-link.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  line-height: 1;
}

.site-logo-icon {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  display: block;
}

.site-logo:hover {
  color: var(--accent);
  text-decoration: none;
}

/* Page layout */
.page {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-narrow {
  max-width: var(--max-width);
}

/* Typography */
h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
}

.lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumb li + li::before {
  content: "›";
  margin-right: 0.35rem;
  color: #cbd5e1;
}

.breadcrumb a {
  color: var(--text-muted);
}

.breadcrumb a:hover {
  color: var(--accent);
}

/* Homepage */
.hero {
  text-align: center;
  padding: 2.5rem 0 1rem;
}

.hero .lead {
  margin-left: auto;
  margin-right: auto;
}

.tools-section {
  margin-top: 1rem;
}

.tools-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.tools-toolbar h2 {
  margin: 0;
  font-size: 1.125rem;
}

.search-field {
  flex: 1 1 14rem;
  max-width: 22rem;
}

.search-field input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.search-field input:focus {
  outline: 2px solid var(--accent-soft);
  border-color: var(--accent);
}

.search-empty {
  margin: 1rem 0 0;
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

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

.app-list {
  display: grid;
  gap: 1rem;
  margin-top: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .app-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.app-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 30px rgb(79 110 247 / 0.1);
}

.app-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.app-card a:hover {
  text-decoration: none;
}

.app-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  color: var(--accent);
}

.app-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.app-card .tag {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
}

/* Calculator layout */
.calculator {
  display: grid;
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (min-width: 720px) {
  .calculator {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.panel-title {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Form fields */
.field {
  margin-bottom: 1.25rem;
}

.field:last-child {
  margin-bottom: 0;
}

label,
.label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.fixed-value {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

/* Choice boxes — 3 across, one line each */
.choice-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}

.choice-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  min-width: 0;
}

.choice-box:hover {
  border-color: #c7d2fe;
  background: var(--surface);
}

.choice-box input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  margin: 0;
}

.choice-box:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.choice-box:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.choice-box-title {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  white-space: nowrap;
}

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

@media (max-width: 420px) {
  .choice-group {
    grid-template-columns: 1fr;
  }

  .choice-box {
    justify-content: flex-start;
    padding: 0.5rem 0.75rem;
  }
}

.hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
  line-height: 1.45;
}

/* Advanced accordion */
.advanced-accordion {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  overflow: hidden;
}

.advanced-accordion summary {
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.advanced-accordion summary::-webkit-details-marker {
  display: none;
}

.advanced-accordion summary::after {
  content: "+";
  float: right;
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.2;
}

.advanced-accordion[open] summary::after {
  content: "−";
}

.advanced-accordion[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.advanced-body {
  padding: 1rem;
}

.advanced-body .field:last-child {
  margin-bottom: 0;
}

select {
  width: 100%;
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

select:hover {
  border-color: #cbd5e1;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(79 110 247 / 0.15);
}

.choice-group-compact .choice-box-title {
  font-size: 0.75rem;
}

input[type="number"] {
  width: 100%;
  font-family: var(--font);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="number"]:hover {
  border-color: #cbd5e1;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(79 110 247 / 0.15);
  background: var(--surface);
}

/* Slider + number combo */
.input-slider-wrap {
  width: 100%;
}

.input-slider-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.input-slider-track {
  flex: 1;
  min-width: 0;
}

.input-slider-track input[type="range"] {
  display: block;
  width: 100%;
  height: 6px;
  margin: 0.5rem 0 0.25rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-ticks {
  position: relative;
  height: 1.75rem;
  margin-top: 0.35rem;
  user-select: none;
  padding: 0 0.125rem;
}

.slider-ticks .tick {
  position: absolute;
  transform: translateX(-50%);
  text-align: center;
}

.slider-ticks .tick::before {
  content: "";
  display: block;
  width: 1px;
  height: 6px;
  margin: 0 auto 0.2rem;
  background: #cbd5e1;
}

.slider-ticks .tick-major::before {
  height: 8px;
  background: #94a3b8;
}

.slider-ticks .tick-major {
  font-size: 0.6875rem;
  color: var(--text-muted);
  min-width: 1.75rem;
  line-height: 1.2;
}

.slider-ticks .tick-start {
  transform: none;
  text-align: left;
}

.slider-ticks .tick-start::before {
  margin-left: 0;
}

.slider-ticks .tick-end {
  transform: translateX(-100%);
  text-align: right;
}

.slider-ticks .tick-end::before {
  margin-right: 0;
  margin-left: auto;
}

.input-slider-row input[type="number"] {
  width: 7.5rem;
  flex-shrink: 0;
  margin-top: 0.15rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
  .input-slider-row {
    flex-direction: column;
    align-items: stretch;
  }

  .input-slider-row input[type="number"] {
    width: 100%;
    margin-top: 0;
    text-align: left;
  }
}

/* Results */
.results-panel {
  background: linear-gradient(160deg, #f0fdf9 0%, var(--surface) 55%);
  border-color: #99f6e4;
}

.result-hero {
  text-align: center;
  padding: 1rem 0 1.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px dashed #99f6e4;
}

.result-hero-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--money);
  margin-bottom: 0.25rem;
}

.result-hero-value {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  color: var(--money);
  letter-spacing: -0.02em;
}

.results-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.results-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9375rem;
}

.results-list li:last-child {
  border-bottom: none;
}

.results-list span:first-child {
  color: var(--text-muted);
}

.results-list span:last-child {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Info box */
.info-box {
  background: var(--accent-soft);
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 2rem;
}

.info-box h2 {
  margin-top: 0;
  font-size: 1.0625rem;
}

.info-box p {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.info-box p:last-child {
  margin-bottom: 0;
  color: var(--text-muted);
}

.info-box code {
  font-size: 0.875em;
  background: rgb(255 255 255 / 0.7);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Footer */
.site-footer {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--max-width-wide);
  margin: 0 auto;
  margin-top: auto;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.site-footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1rem;
  margin-bottom: 0.65rem;
}

.site-footer-nav a {
  color: var(--text-muted);
  font-weight: 500;
  text-decoration: none;
}

.site-footer-nav a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.site-footer-nav a[aria-current="page"] {
  color: var(--accent);
}

.site-footer-copy {
  margin: 0;
}

/* FAQ (SEO + UX) */
.faq-section {
  margin-top: 2rem;
}

.faq-section > h2 {
  margin-top: 0;
}

.faq-intro {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0 0 1rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.faq-item summary {
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item[open] summary {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.faq-body {
  padding: 0.75rem 1rem 0.85rem;
}

.faq-body p {
  margin: 0 0 0.65rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.faq-body p:last-child {
  margin-bottom: 0;
}

.faq-body strong {
  color: var(--text);
  font-weight: 600;
}

/* Articles */
.post-list {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.post-card:hover {
  border-color: #c7d2fe;
  box-shadow: 0 8px 30px rgb(79 110 247 / 0.1);
}

.post-card a {
  display: block;
  padding: 1.25rem 1.5rem;
  color: inherit;
  text-decoration: none;
}

.post-card a:hover {
  text-decoration: none;
}

.post-card time {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.post-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  color: var(--accent);
}

.post-card p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.article-header {
  margin-bottom: 1.5rem;
}

.article-meta {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.article h2 {
  margin-top: 2.5rem;
}

.article-figure {
  margin: 0 0 2.25rem;
  padding: 0;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
}

.article-callout {
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.article-callout p {
  margin: 0;
}

.article-table-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
}

.article-table {
  width: 100%;
  min-width: 20rem;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.article-table th,
.article-table td {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article-table th {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 600;
}

.article-table td {
  color: var(--text-muted);
  background: var(--surface);
}

.article p,
.article li {
  color: var(--text-muted);
}

.article ul,
.article ol {
  padding-left: 1.35rem;
}

.article li + li {
  margin-top: 0.35rem;
}

.article code {
  font-size: 0.875em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.article-cta {
  margin-top: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--accent-soft);
  border-radius: var(--radius);
  border: 1px solid #c7d2fe;
}

.article-cta p {
  margin: 0 0 0.75rem;
}

.article-cta p:last-child {
  margin-bottom: 0;
}

.article-cta .btn + .btn {
  margin-left: 0.5rem;
}

@media (max-width: 480px) {
  .article-cta .btn {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0 0 0.5rem;
  }

  .article-cta .btn + .btn {
    margin-left: 0;
  }
}

.btn {
  display: inline-block;
  padding: 0.65rem 1.1rem;
  font-weight: 600;
  font-size: 0.9375rem;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}

.btn-secondary {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  color: var(--text);
}

button.btn {
  cursor: pointer;
  font-family: inherit;
  border: none;
}

button.btn-secondary {
  border: 1px solid var(--border);
}

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgb(30 41 59 / 0.08);
}

.cookie-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  max-width: var(--max-width-wide);
  margin: 0 auto;
}

.cookie-banner-text {
  flex: 1;
  min-width: 0;
}

.cookie-banner-title {
  margin: 0 0 0.25rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.cookie-banner-desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.cookie-banner-actions {
  display: flex;
  flex-shrink: 0;
  gap: 0.5rem;
}

@media (max-width: 640px) {
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .cookie-banner-actions {
    flex-direction: column;
  }

  .cookie-banner-actions .btn {
    width: 100%;
    text-align: center;
  }
}