/* ============================================================
   HandyReckon — main.css
   ============================================================ */

/* ── Design tokens (light theme) ── */
:root {
  --c-bg: #f0f4f8;
  --c-surface: #ffffff;
  --c-surface-2: #e8edf3;
  --c-border: #d1dae6;
  --c-display-bg: #1e3a5f;
  --c-display-text: #e8f4fd;
  --c-accent: #2563eb;
  --c-accent-hover: #1d4ed8;
  --c-text: #1e293b;
  --c-muted: #64748b;
  --c-success: #059669;
  --c-error: #dc2626;

  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Code', Menlo, monospace;
  --font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10), 0 1px 4px rgba(0,0,0,.06);
  --container: 1200px;
  --header-h: 64px;
  --transition: 180ms ease;
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --c-bg: #0f1117;
  --c-surface: #1a1f2e;
  --c-surface-2: #222840;
  --c-border: #2a3145;
  --c-display-bg: #0d2137;
  --c-display-text: #e2f4fd;
  --c-accent: #3b82f6;
  --c-accent-hover: #60a5fa;
  --c-text: #e2e8f0;
  --c-muted: #94a3b8;
  --c-success: #10b981;
  --c-error: #f87171;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0f1117;
    --c-surface: #1a1f2e;
    --c-surface-2: #222840;
    --c-border: #2a3145;
    --c-display-bg: #0d2137;
    --c-display-text: #e2f4fd;
    --c-accent: #3b82f6;
    --c-accent-hover: #60a5fa;
    --c-text: #e2e8f0;
    --c-muted: #94a3b8;
    --c-success: #10b981;
    --c-error: #f87171;
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; padding: 2rem 0 3rem; }
img, svg { display: block; max-width: 100%; }
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; }
h1,h2,h3,h4 { line-height: 1.3; color: var(--c-text); }

/* ── Utility ── */
.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;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; } }

/* ── Focus visible ── */
:focus-visible {
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius);
  border: 1.5px solid transparent;
  font-weight: 600; font-size: .9rem;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--c-accent); color: #fff;
}
.btn-primary:hover { background: var(--c-accent-hover); text-decoration: none; }
.btn-secondary {
  background: var(--c-surface-2); color: var(--c-text);
  border-color: var(--c-border);
}
.btn-secondary:hover { background: var(--c-border); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--c-accent);
  border-color: var(--c-accent);
}
.btn-ghost:hover { background: var(--c-accent); color: #fff; text-decoration: none; }
.btn-sm { padding: .35rem .85rem; font-size: .82rem; }
.btn-danger { background: var(--c-error); color: #fff; }

/* ── Site header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.header-inner {
  display: flex; align-items: center; gap: 1rem;
  height: 100%;
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: 1.2rem;
  color: var(--c-text); text-decoration: none;
  flex-shrink: 0;
}
.brand:hover { text-decoration: none; color: var(--c-accent); }
.brand-icon svg { display: block; }
.site-nav {
  display: none;
  gap: .25rem;
}
@media (min-width: 640px) {
  .site-nav { display: flex; }
}
.nav-link {
  padding: .4rem .8rem; border-radius: var(--radius);
  color: var(--c-muted); font-weight: 500; font-size: .9rem;
  transition: color var(--transition), background var(--transition);
}
.nav-link:hover { color: var(--c-text); background: var(--c-surface-2); text-decoration: none; }
.header-right {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
}

/* ── Search ── */
.search-wrap { position: relative; }
.search-input {
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: 2rem;
  padding: .45rem 1rem .45rem 2.2rem;
  font-size: .875rem;
  color: var(--c-text);
  width: 180px;
  transition: width var(--transition), border-color var(--transition), background var(--transition);
}
.search-input:focus {
  outline: none;
  border-color: var(--c-accent);
  background: var(--c-surface);
  width: 220px;
}
.search-wrap .search-icon,
.hero-search .search-icon {
  position: absolute; top: 50%; transform: translateY(-50%);
  color: var(--c-muted); pointer-events: none; z-index: 1;
}
.search-wrap .search-icon { left: .7rem; }
.hero-search .search-icon { left: .9rem; }
.search-input--hero {
  width: 100%; border-radius: var(--radius-lg);
  padding: .75rem 1rem .75rem 2.8rem;
  font-size: 1rem;
}
.search-input--hero:focus { width: 100%; }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 200; overflow: hidden;
  max-height: 320px; overflow-y: auto;
}
.search-results[hidden] { display: none; }
.search-result-item {
  display: block; padding: .7rem 1rem;
  color: var(--c-text); font-size: .9rem;
  cursor: pointer; text-decoration: none;
  border-bottom: 1px solid var(--c-border);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover,
.search-result-item[aria-selected="true"] {
  background: var(--c-surface-2);
  text-decoration: none;
}
.search-result-cat {
  font-size: .75rem; color: var(--c-muted);
  margin-left: .5rem;
}
.search-no-results { padding: .7rem 1rem; color: var(--c-muted); font-size: .875rem; }

/* ── Theme toggle ── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: var(--c-surface-2); border: 1.5px solid var(--c-border);
  border-radius: 50%; cursor: pointer; color: var(--c-text);
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--c-border); }
.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ── Nav toggle (mobile) ── */
.nav-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  background: none; border: 1.5px solid var(--c-border);
  border-radius: var(--radius); cursor: pointer; color: var(--c-text);
}
@media (min-width: 640px) { .nav-toggle { display: none; } }

/* ── Mobile nav ── */
.mobile-nav {
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: .5rem 1rem;
}
.mobile-nav[hidden] { display: none; }
.mobile-nav-link {
  padding: .75rem .5rem; color: var(--c-text);
  font-weight: 500; border-bottom: 1px solid var(--c-border);
}
.mobile-nav-link:last-child { border-bottom: none; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, var(--c-accent) 0%, #1e3a8a 100%);
  color: #fff; padding: 3.5rem 0 3rem;
  margin-bottom: 3rem;
}
.hero-inner { text-align: center; max-width: 640px; margin: 0 auto; }
.hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800; color: #fff; margin-bottom: .75rem; line-height: 1.2;
}
.hero-accent { color: #bfdbfe; }
.hero-sub { font-size: 1.1rem; opacity: .9; margin-bottom: 1.75rem; color: #e0ecff; }
.hero-search { position: relative; }

/* ── Category sections ── */
.category-section { margin-bottom: 3rem; }
.category-section-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap; gap: .5rem;
}
.category-section-title { font-size: 1.4rem; font-weight: 700; }
.category-section-link { font-size: .875rem; color: var(--c-accent); white-space: nowrap; }

/* ── Tool grid ── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.tools-grid--large { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

/* ── Tool card ── */
.tool-card {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-accent);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) { .tool-card:hover { transform: none; } }
.tool-card-link {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: .75rem; padding: 1.1rem 1.1rem;
  text-decoration: none; color: var(--c-text);
  height: 100%;
}
.tool-card-link:hover { text-decoration: none; color: var(--c-text); }
.tool-card-body { flex: 1; }
.category-badge {
  display: inline-block; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .15rem .5rem; border-radius: 2rem; margin-bottom: .5rem;
  background: var(--c-surface-2); color: var(--c-muted);
}
.category-badge.category-finance { background: #dbeafe; color: #1d4ed8; }
.category-badge.category-dates   { background: #dcfce7; color: #166534; }
.category-badge.category-everyday { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .category-badge.category-finance  { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .category-badge.category-dates    { background: #14532d; color: #86efac; }
[data-theme="dark"] .category-badge.category-everyday { background: #451a03; color: #fcd34d; }
.tool-card-title { font-size: 1rem; font-weight: 600; margin-bottom: .35rem; }
.tool-card-excerpt { font-size: .82rem; color: var(--c-muted); line-height: 1.5; }
.tool-card-arrow { color: var(--c-muted); font-size: 1.1rem; padding-top: .1rem; flex-shrink: 0; }
.tool-card:hover .tool-card-arrow { color: var(--c-accent); }

/* ── Breadcrumb ── */
.breadcrumb { margin-bottom: 1.25rem; }
.breadcrumb-list { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.breadcrumb-item { display: flex; align-items: center; gap: .35rem; font-size: .85rem; color: var(--c-muted); }
.breadcrumb-item::after { content: '/'; color: var(--c-border); }
.breadcrumb-item:last-child::after { content: ''; }
.breadcrumb-item a { color: var(--c-muted); }
.breadcrumb-item a:hover { color: var(--c-accent); text-decoration: none; }
.breadcrumb-current { color: var(--c-text); font-weight: 500; }

/* ── Tool page layout ── */
.tool-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}
@media (min-width: 1024px) {
  .tool-page-layout {
    grid-template-columns: 1fr 260px;
  }
}
.tool-h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; margin-bottom: .5rem; }
.tool-intro { color: var(--c-muted); font-size: 1.05rem; margin-bottom: 1.75rem; }

/* ── Tool widget ── */
.tool-widget {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
}
.tool-inputs { display: flex; flex-direction: column; gap: 1.25rem; margin-bottom: 1.5rem; }
.field-group { display: flex; flex-direction: column; gap: .4rem; }
.field-group label {
  font-size: .875rem; font-weight: 600; color: var(--c-text);
}
.field-group input,
.field-group select,
.field-group textarea {
  min-height: 44px; padding: .55rem .85rem;
  background: var(--c-surface-2);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  color: var(--c-text); font-size: 1rem;
  transition: border-color var(--transition), background var(--transition);
  width: 100%;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none; border-color: var(--c-accent); background: var(--c-surface);
}
.field-group input.invalid,
.field-group select.invalid { border-color: var(--c-error); }
.field-error { font-size: .8rem; color: var(--c-error); min-height: 1.1em; }
.input-with-prefix { position: relative; }
.input-prefix {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--c-muted); pointer-events: none; font-size: 1rem;
}
.input-with-prefix input { padding-left: 1.8rem; }
.input-suffix-wrap { position: relative; }
.input-suffix {
  position: absolute; right: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--c-muted); pointer-events: none; font-size: .875rem;
}
.fields-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 420px) { .fields-row { grid-template-columns: 1fr; } }

/* ── Tool result (LCD panel) ── */
.tool-result {
  background: var(--c-display-bg);
  color: var(--c-display-text);
  border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  min-height: 80px;
  display: flex; align-items: flex-start;
}
.result-placeholder { color: rgba(232,244,253,.5); font-size: .9rem; align-self: center; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  width: 100%;
}
.result-item { display: flex; flex-direction: column; gap: .2rem; }
.result-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-display-text); opacity: .7; }
.result-value {
  font-family: var(--font-mono);
  font-size: 1.4rem; font-weight: 700;
  color: var(--c-display-text);
  line-height: 1.1;
}
.result-value--sm { font-size: 1.05rem; }
.result-value--lg { font-size: 1.75rem; }
.result-note { font-size: .78rem; opacity: .6; margin-top: .15rem; }

/* ── Tool actions ── */
.tool-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-bottom: .75rem; }

/* ── Preset buttons (tip calculator etc.) ── */
.preset-buttons { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.preset-btn {
  padding: .35rem .75rem; font-size: .85rem; font-weight: 600;
  border-radius: var(--radius); border: 1.5px solid var(--c-border);
  background: var(--c-surface-2); color: var(--c-text); cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.preset-btn:hover,
.preset-btn.active { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }

/* ── Tabs ── */
.tabs { display: flex; gap: .25rem; border-bottom: 2px solid var(--c-border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: .5rem 1rem; font-size: .875rem; font-weight: 600;
  background: none; border: none; cursor: pointer;
  color: var(--c-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.active { color: var(--c-accent); border-bottom-color: var(--c-accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Toggle / Radio group ── */
.toggle-group { display: flex; border: 1.5px solid var(--c-border); border-radius: var(--radius); overflow: hidden; }
.toggle-group input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-group label {
  flex: 1; text-align: center; padding: .45rem .75rem;
  font-size: .875rem; font-weight: 600; cursor: pointer;
  background: var(--c-surface-2); color: var(--c-muted);
  transition: background var(--transition), color var(--transition);
  border-right: 1px solid var(--c-border);
}
.toggle-group label:last-of-type { border-right: none; }
.toggle-group input[type="radio"]:checked + label {
  background: var(--c-accent); color: #fff;
}

/* ── Checkbox / Switch ── */
.check-label { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .875rem; font-weight: 500; }
.check-label input[type="checkbox"] {
  width: 18px; height: 18px; min-height: 18px; cursor: pointer;
  accent-color: var(--c-accent);
}

/* ── Range slider ── */
input[type="range"] {
  width: 100%; accent-color: var(--c-accent); cursor: pointer; min-height: 24px;
}

/* ── Amortization table ── */
.amort-toggle { margin-top: .75rem; }
.amort-table-wrap { overflow-x: auto; margin-top: 1rem; }
.amort-table {
  width: 100%; border-collapse: collapse; font-size: .85rem;
}
.amort-table th {
  background: var(--c-surface-2); text-align: right;
  padding: .5rem .75rem; border-bottom: 2px solid var(--c-border);
  font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted);
}
.amort-table th:first-child { text-align: left; }
.amort-table td {
  padding: .5rem .75rem; text-align: right;
  border-bottom: 1px solid var(--c-border);
  font-family: var(--font-mono); font-size: .82rem;
}
.amort-table td:first-child { text-align: left; font-family: var(--font-sans); }
.amort-table tr:last-child td { border-bottom: none; }
.amort-table tr:nth-child(even) td { background: var(--c-surface-2); }

/* ── BMI scale ── */
.bmi-scale { margin-top: 1rem; }
.bmi-scale-bar {
  height: 14px; border-radius: 7px;
  background: linear-gradient(to right, #3b82f6 0%, #22c55e 25%, #f59e0b 60%, #ef4444 100%);
  position: relative; margin-bottom: .4rem;
}
.bmi-marker {
  position: absolute; top: -4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--c-display-text); border: 3px solid var(--c-accent);
  transform: translateX(-50%);
  transition: left .3s ease;
}
.bmi-scale-labels {
  display: flex; justify-content: space-between; font-size: .7rem; color: var(--c-muted);
}

/* ── Password strength bar ── */
.strength-bar { height: 6px; border-radius: 3px; background: var(--c-border); margin-top: .5rem; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 3px; transition: width .3s ease, background .3s ease; width: 0; }
.strength-label { font-size: .78rem; margin-top: .25rem; font-weight: 600; }

/* ── Countdown display ── */
.countdown-grid {
  display: flex; gap: 1.5rem; flex-wrap: wrap; width: 100%; justify-content: center;
}
.countdown-unit { text-align: center; }
.countdown-num {
  font-family: var(--font-mono);
  font-size: 2.2rem; font-weight: 800;
  color: var(--c-display-text); line-height: 1;
}
.countdown-lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; opacity: .65; margin-top: .2rem; }

/* ── FAQ section ── */
.faq-section { margin-top: 2rem; }
.faq-item {
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-question {
  padding: 1rem 1.1rem; font-weight: 600; cursor: pointer;
  list-style: none; display: flex; justify-content: space-between; align-items: center;
  background: var(--c-surface);
  transition: background var(--transition);
}
.faq-question:hover { background: var(--c-surface-2); }
.faq-question::after { content: '+'; font-size: 1.2rem; color: var(--c-accent); flex-shrink: 0; }
details[open] .faq-question::after { content: '−'; }
.faq-answer {
  padding: .75rem 1.1rem 1rem; color: var(--c-muted);
  border-top: 1px solid var(--c-border); background: var(--c-surface);
}

/* ── Tool sections (how it works etc.) ── */
.tool-section { margin-top: 2.5rem; }
.tool-section h2 { font-size: 1.35rem; font-weight: 700; margin-bottom: 1rem; }
.tool-section p { color: var(--c-muted); margin-bottom: .85rem; line-height: 1.75; }
.tool-section p:last-child { margin-bottom: 0; }

/* ── Sidebar ── */
.tool-page-sidebar { }
.sidebar-block {
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  position: sticky; top: calc(var(--header-h) + 1rem);
}
.sidebar-title { font-size: .9rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); margin-bottom: 1rem; }
.related-tool-link {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .7rem .9rem; border-radius: var(--radius);
  background: var(--c-surface-2); margin-bottom: .5rem;
  text-decoration: none; transition: background var(--transition);
}
.related-tool-link:hover { background: var(--c-border); text-decoration: none; }
.related-tool-name { font-size: .875rem; font-weight: 600; color: var(--c-text); }
.related-tool-cat  { font-size: .75rem; color: var(--c-muted); }

/* ── Category page ── */
.page-h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); font-weight: 800; margin-bottom: 1rem; }
.category-intro {
  background: var(--c-surface); border: 1.5px solid var(--c-border);
  border-radius: var(--radius-lg); padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.category-intro p { color: var(--c-muted); line-height: 1.8; }

/* ── Static pages ── */
.page-content { max-width: 720px; margin: 0 auto; }
.page-content h1 { font-size: 2rem; font-weight: 800; margin-bottom: .5rem; }
.page-content h2 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 .75rem; }
.page-content p  { color: var(--c-muted); margin-bottom: 1rem; line-height: 1.8; }
.page-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1rem; color: var(--c-muted); }
.page-content li { margin-bottom: .35rem; }
.page-content a  { color: var(--c-accent); }
.page-content .lead { font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ── Footer ── */
.site-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border);
  padding: 3rem 0 2rem; margin-top: auto;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}
@media (min-width: 640px) { .footer-inner { grid-template-columns: repeat(4, 1fr); } }
.footer-heading {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--c-muted); margin-bottom: .85rem;
}
.footer-links li { margin-bottom: .4rem; }
.footer-links a { font-size: .875rem; color: var(--c-muted); }
.footer-links a:hover { color: var(--c-text); text-decoration: none; }
.footer-meta { }
.footer-copy { font-size: .8rem; color: var(--c-muted); margin-top: 1.5rem; }
.footer-disclaimer { font-size: .75rem; color: var(--c-muted); margin-top: .3rem; opacity: .7; }

/* ── Consent bar ── */
.consent-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: var(--c-surface);
  border-top: 1.5px solid var(--c-border);
  box-shadow: 0 -4px 16px rgba(0,0,0,.12);
  padding: 1rem 0;
}
.consent-bar[hidden] { display: none; }
.consent-inner { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between; }
.consent-text { font-size: .875rem; color: var(--c-muted); }
.consent-text a { color: var(--c-accent); }
.consent-actions { display: flex; gap: .5rem; flex-shrink: 0; }

/* ── Ad placeholder ── */
.ad-placeholder {
  background: var(--c-surface-2);
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  min-height: 90px; display: flex;
  align-items: center; justify-content: center;
  color: var(--c-muted); font-size: .8rem;
  font-style: italic; margin: 1.5rem 0;
}

/* ── 404 page ── */
.error-page { text-align: center; padding: 4rem 1rem; }
.error-code { font-size: 6rem; font-weight: 900; color: var(--c-surface-2); line-height: 1; }
.error-title { font-size: 2rem; font-weight: 800; margin-bottom: .75rem; }
.error-text { color: var(--c-muted); margin-bottom: 1.5rem; }
.error-or { color: var(--c-muted); margin: 1.5rem 0 .75rem; font-size: .9rem; }
.error-cats { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }

/* ── Word counter textarea ── */
.word-counter-area {
  width: 100%; min-height: 200px; resize: vertical;
  background: var(--c-surface-2); border: 1.5px solid var(--c-border);
  border-radius: var(--radius); padding: .75rem;
  color: var(--c-text); font-size: .95rem; line-height: 1.6;
  font-family: var(--font-sans);
}
.word-counter-area:focus { outline: none; border-color: var(--c-accent); }

/* ── Random numbers output ── */
.random-output {
  font-family: var(--font-mono);
  font-size: 1.1rem; word-break: break-all; line-height: 2;
  color: var(--c-display-text);
}

/* ── Unit converter select row ── */
.unit-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: .75rem; align-items: end; }
.unit-swap-btn {
  background: var(--c-surface-2); border: 1.5px solid var(--c-border);
  border-radius: 50%; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--c-text); font-size: 1.1rem;
  flex-shrink: 0; transition: background var(--transition);
}
.unit-swap-btn:hover { background: var(--c-border); }

/* ── Percentage calculator tabs ── */
.pct-tabs { margin-bottom: 1.5rem; }

/* ── Salary rows ── */
.salary-results-table { width: 100%; }
.salary-results-table tr td:first-child { font-weight: 600; font-size: .875rem; }
.salary-results-table tr td:last-child {
  font-family: var(--font-mono); font-size: 1rem; font-weight: 700; text-align: right;
}
.salary-results-table tr td { padding: .5rem .25rem; border-bottom: 1px solid var(--c-border); }
.salary-results-table tr:last-child td { border-bottom: none; }

/* ── Responsive tweaks ── */
@media (min-width: 640px) {
  .tool-inputs { display: grid; grid-template-columns: repeat(2, 1fr); }
  .tool-inputs .field-group--full { grid-column: 1 / -1; }
  .result-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Animations ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tool-result:not(.tool-result--empty) { animation: fadeIn .2s ease; }
@media (prefers-reduced-motion: reduce) { .tool-result { animation: none; } }

/* ── Print ── */
@media print {
  .site-header, .site-footer, .consent-bar, .tool-actions, .ad-placeholder { display: none; }
  .tool-result { box-shadow: none; border: 1px solid #ccc; }
}

/* ── Image tool drop zone ── */
.drop-zone {
  border: 2px dashed var(--c-border); border-radius: var(--radius-md);
  padding: 2.5rem 1.5rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone--active { border-color: var(--c-accent); background: var(--c-accent-muted, rgba(79,70,229,0.05)); }
.drop-zone p { margin: 0; color: var(--c-muted); font-size: .9rem; }
.drop-zone strong { display: block; margin-bottom: .4rem; font-size: 1rem; color: var(--c-text); }
.privacy-note { font-size: .8rem; color: var(--c-muted); margin: .6rem 0; padding: .4rem .75rem; background: var(--c-surface-2, #f0fdf4); border-left: 3px solid #22c55e; border-radius: 2px; }
.img-preview-wrap { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.img-preview-wrap canvas, .img-preview-wrap img { max-width: 100%; max-height: 300px; border: 1px solid var(--c-border); border-radius: var(--radius); object-fit: contain; }

/* ── All Tools page ── */
.all-tools-section { margin-bottom: 2.5rem; }
.all-tools-cat-heading { font-size: 1.25rem; font-weight: 700; margin: 0 0 .75rem; color: var(--c-text); }
.all-tools-cat-heading a { color: inherit; text-decoration: none; }
.all-tools-cat-heading a:hover { color: var(--c-accent); text-decoration: underline; }
.all-tools-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem .75rem; }
.all-tools-list li { font-size: .9rem; line-height: 1.5; }
.all-tools-list a { color: var(--c-accent); text-decoration: none; font-weight: 600; }
.all-tools-list a:hover { text-decoration: underline; }
.all-tools-desc { color: var(--c-text-muted, #666); font-weight: 400; }
.az-letter { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 .4rem; color: var(--c-accent); border-bottom: 2px solid var(--c-accent); display: inline-block; padding-bottom: 2px; }
.all-tools-az { margin-top: 2rem; }

/* ── Category more link ── */
.category-more { margin: .75rem 0 0; font-size: .9rem; }
.category-more a { color: var(--c-accent); font-weight: 600; text-decoration: none; }
.category-more a:hover { text-decoration: underline; }

/* ── Page intro ── */
.page-intro { color: var(--c-text-muted, #555); margin-bottom: 2rem; max-width: 70ch; }
.page-seo-block { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--c-border, #e5e7eb); }
.page-seo-block h2 { font-size: 1.25rem; margin-bottom: .75rem; }
.page-seo-block p { color: var(--c-text-muted, #555); max-width: 70ch; line-height: 1.7; margin-bottom: 1rem; }

/* ── Disclaimer box ── */
.disclaimer-box { background: var(--c-bg-alt, #f9fafb); border-left: 4px solid var(--c-border, #e5e7eb); border-radius: 0 6px 6px 0; padding: .75rem 1rem; margin-bottom: 1.25rem; font-size: .85rem; color: var(--c-text-muted, #555); }
.disclaimer-box p { margin: 0; line-height: 1.5; }
.disclaimer-financial { border-color: #f59e0b; background: #fffbeb; }
.disclaimer-medical   { border-color: #3b82f6; background: #eff6ff; }

/* ── Timezone converter ── */
.tz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.tz-card { background: var(--c-surface, #fff); border: 1px solid var(--c-border, #e5e7eb); border-radius: 8px; padding: 1rem; text-align: center; }
.tz-city { font-size: .85rem; font-weight: 700; color: var(--c-accent); margin-bottom: .25rem; }
.tz-time { font-size: 1.25rem; font-weight: 700; color: var(--c-text); }
.tz-offset { font-size: .8rem; color: var(--c-text-muted, #666); margin-top: .2rem; }

/* ── Wheel spinner ── */
#wheel-result { display: none; font-size: 1.5rem; font-weight: 700; color: var(--c-accent); text-align: center; padding: 1rem; background: var(--c-bg-alt, #f9fafb); border-radius: 8px; margin-top: 1rem; }
#wheel-result:not([hidden]) { display: block; }
