/* ==========================================================================
   UtilityNest design system — soft, restrained neumorphism.
   Mobile-first. No external fonts. One stylesheet for the whole public site.
   ========================================================================== */

:root {
  --bg: #edf1f6;
  --surface: #f3f6fa;
  --surface-2: #e6ebf2;
  --ink: #17202c;
  --ink-2: #3a4556;
  --muted: #566274;
  --line: #d5dce6;
  --accent: #0e7468;
  --accent-strong: #0a5d54;
  --accent-soft: #d8efeb;
  --accent-ink: #ffffff;
  --amber: #b45309;
  --amber-soft: #fcefd9;
  --danger: #b42318;
  --danger-soft: #fde8e6;
  --success: #0e7468;

  --shadow-dark: rgba(150, 165, 188, 0.42);
  --shadow-light: rgba(255, 255, 255, 0.95);
  --raise: 6px 6px 16px var(--shadow-dark), -6px -6px 16px var(--shadow-light);
  --raise-sm: 3px 3px 8px var(--shadow-dark), -3px -3px 8px var(--shadow-light);
  --raise-hover: 9px 9px 22px rgba(150, 165, 188, 0.5), -8px -8px 20px var(--shadow-light);
  --inset: inset 3px 3px 7px rgba(150, 165, 188, 0.38), inset -3px -3px 7px rgba(255, 255, 255, 0.9);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --container: 1160px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.22; color: var(--ink); margin: 0 0 .6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.85rem, 1.3rem + 2.4vw, 2.85rem); font-weight: 750; }
h2 { font-size: clamp(1.4rem, 1.15rem + 1vw, 1.8rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 680; }
h4 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1.05em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1.1em; }
li { margin-bottom: .35em; }
hr { border: 0; height: 1px; background: var(--line); margin: 2rem 0; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--surface-2); padding: .12em .38em; border-radius: 6px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #bfe6df; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: .6rem 1rem; border-radius: var(--r-sm); text-decoration: none; }
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
.container--narrow { max-width: 820px; }
.icon { width: 1.25em; height: 1.25em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(237, 241, 246, .96); border-bottom: 1px solid rgba(213, 220, 230, .7); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(237, 241, 246, .86); backdrop-filter: saturate(1.4) blur(10px); } }
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 760; font-size: 1.14rem; letter-spacing: -0.02em; margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: var(--raise-sm); }
.brand-name .accent { color: var(--accent); }
.brand img.brand-logo { max-height: 38px; width: auto; }

.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink); }
.nav-toggle .icon-close { display: none; }
.nav-open .nav-toggle .icon-open { display: none; }
.nav-open .nav-toggle .icon-close { display: block; }
.site-nav { position: fixed; inset: 66px 0 auto 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 12px 16px 20px; box-shadow: 0 18px 30px rgba(120, 135, 160, .18); display: none; max-height: calc(100vh - 66px); overflow-y: auto; }
.nav-open .site-nav { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-nav a { display: flex; align-items: center; min-height: 46px; padding: 0 14px; border-radius: 12px; text-decoration: none; color: var(--ink-2); font-weight: 560; }
.site-nav a:hover { background: var(--surface); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
.header-search { display: none; }
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .site-nav { position: static; display: block; background: none; border: 0; padding: 0; box-shadow: none; max-height: none; overflow: visible; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { min-height: 40px; padding: 0 14px; font-size: .96rem; }
  .header-search { display: block; }
}
.header-search form { position: relative; }
.header-search input { width: 210px; height: 40px; padding: 0 14px 0 38px; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); font-size: .92rem; }
.header-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.mobile-search { margin-top: 12px; }
.mobile-search input { width: 100%; }
@media (min-width: 900px) { .mobile-search { display: none; } }

/* ---------- Buttons ---------- */
.btn { --btn-bg: var(--bg); display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: .6rem 1.2rem; border: 0; border-radius: 13px; background: var(--btn-bg); color: var(--ink); font-weight: 620; font-size: .98rem; line-height: 1.2; text-decoration: none; box-shadow: var(--raise-sm); transition: box-shadow .18s var(--ease), transform .18s var(--ease), background-color .18s; white-space: nowrap; }
.btn:hover { color: var(--ink); box-shadow: var(--raise); transform: translateY(-1px); }
.btn:active { box-shadow: var(--inset); transform: none; }
.btn .icon { width: 18px; height: 18px; }
.btn-primary { --btn-bg: var(--accent); color: var(--accent-ink); box-shadow: 4px 4px 12px rgba(14, 116, 104, .32), -3px -3px 9px var(--shadow-light); }
.btn-primary:hover { --btn-bg: var(--accent-strong); color: #fff; box-shadow: 6px 6px 16px rgba(14, 116, 104, .38), -4px -4px 12px var(--shadow-light); }
.btn-primary:active { box-shadow: inset 3px 3px 8px rgba(0, 0, 0, .25); }
.btn-sm { min-height: 38px; padding: .4rem .85rem; font-size: .9rem; border-radius: 11px; }
.btn-ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface); box-shadow: none; transform: none; }
.btn-danger { color: var(--danger); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- Cards & surfaces ---------- */
.card { background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--raise); padding: 22px; }
.card--flat { box-shadow: none; background: var(--surface); border: 1px solid var(--line); }
.surface-inset { background: var(--bg); border-radius: var(--r); box-shadow: var(--inset); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .82rem; font-weight: 650; letter-spacing: .01em; }
.badge .icon { width: 15px; height: 15px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .8rem; font-weight: 600; text-decoration: none; }
a.pill:hover { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Sections ---------- */
.section { padding: 44px 0; }
@media (min-width: 768px) { .section { padding: 64px 0; } }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 60ch; }
.eyebrow { display: block; color: var(--accent-strong); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 6px; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 34px; }
@media (min-width: 768px) { .hero { padding: 72px 0 56px; } }
.hero-grid { display: grid; gap: 36px; align-items: center; }
@media (min-width: 960px) { .hero-grid { grid-template-columns: 1.15fr .85fr; } }
.hero h1 { margin: 16px 0 14px; max-width: 16ch; }
.hero-lead { font-size: clamp(1.04rem, 1rem + .35vw, 1.2rem); color: var(--ink-2); max-width: 54ch; margin-bottom: 24px; }
.finder { position: relative; max-width: 560px; margin-bottom: 20px; }
.finder label { display: block; }
.finder input { width: 100%; height: 56px; padding: 0 18px 0 50px; border: 0; border-radius: 16px; background: var(--bg); box-shadow: var(--inset); font-size: 1.02rem; }
.finder > .icon { position: absolute; left: 18px; top: 28px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.finder-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 20; list-style: none; margin: 0; padding: 8px; background: var(--surface); border-radius: var(--r); box-shadow: var(--raise); max-height: 320px; overflow-y: auto; }
.finder-results[hidden] { display: none; }
.finder-results li { margin: 0; }
.finder-results a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.finder-results a:hover, .finder-results a.is-active { background: var(--accent-soft); }
.finder-results .muted { font-size: .85rem; }
.finder-empty { padding: 10px 12px; color: var(--muted); }
.hero-visual { display: none; }
@media (min-width: 960px) { .hero-visual { display: block; } }
.hero-panel { padding: 22px; }
.hero-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.hero-stat { padding: 14px 10px; text-align: center; border-radius: 14px; background: var(--bg); box-shadow: var(--inset); }
.hero-stat strong { display: block; font-size: 1.45rem; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: .78rem; color: var(--muted); }
.hero-text-sample { padding: 16px; border-radius: 14px; box-shadow: var(--inset); color: var(--ink-2); font-size: .95rem; line-height: 1.6; min-height: 110px; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.hero-chips span { padding: 6px 12px; border-radius: 10px; background: var(--bg); box-shadow: var(--raise-sm); font-size: .8rem; font-weight: 600; color: var(--ink-2); }

/* ---------- Tool cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.tool-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); color: var(--ink); text-decoration: none; transition: box-shadow .2s var(--ease), transform .2s var(--ease); height: 100%; }
.tool-card:hover { color: var(--ink); box-shadow: var(--raise-hover); transform: translateY(-2px); }
.tool-card h3 { font-size: 1.06rem; margin: 0; }
.tool-card p { margin: 0; color: var(--muted); font-size: .93rem; line-height: 1.55; }
.tool-card .card-foot { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; font-size: .85rem; font-weight: 620; color: var(--accent-strong); }
.tool-card .card-foot .icon { width: 18px; height: 18px; transition: transform .2s var(--ease); }
.tool-card:hover .card-foot .icon { transform: translateX(3px); }
.tool-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 14px; background: var(--bg); box-shadow: var(--inset); color: var(--accent); }
.tool-icon .icon { width: 22px; height: 22px; }
.tool-card[hidden] { display: none; }

.cat-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); }
.cat-card h3 { margin: 0; }
.cat-card h3 a { color: var(--ink); text-decoration: none; }
.cat-card h3 a:hover { color: var(--accent-strong); }
.cat-card ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.cat-card li a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--ink-2); text-decoration: none; font-size: .95rem; }
.cat-card li a:hover { color: var(--accent-strong); }
.cat-card li .icon { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Feature list ---------- */
.feature { display: flex; gap: 14px; align-items: flex-start; padding: 20px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); }
.feature h3 { font-size: 1.02rem; margin: 2px 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 18px 0 0; font-size: .88rem; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; color: var(--muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.breadcrumbs li + li::before { content: "/"; color: #9aa5b5; margin-right: 4px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-strong); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink-2); }

/* ---------- Page header ---------- */
.page-head { padding: 22px 0 10px; }
.page-head h1 { margin: 10px 0 12px; }
.page-head .lead { font-size: 1.1rem; color: var(--ink-2); max-width: 70ch; }
.page-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: .9rem; }

/* ---------- Tool application ---------- */
.tool-app { margin: 18px 0 8px; padding: 18px; border-radius: 22px; background: var(--bg); box-shadow: var(--raise); }
@media (min-width: 768px) { .tool-app { padding: 26px; } }
.tool-app__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.tool-app__title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1rem; margin: 0; }
.tool-app__title .tool-icon { width: 38px; height: 38px; border-radius: 12px; }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--accent-strong); font-weight: 600; }
.privacy-note .icon { width: 16px; height: 16px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > label, .field-label { font-weight: 620; font-size: .92rem; color: var(--ink-2); }
.hint { font-size: .84rem; color: var(--muted); }
.textarea, .input, .select {
  width: 100%; border: 1px solid transparent; border-radius: 14px; background: var(--bg); box-shadow: var(--inset);
  padding: 14px 16px; font-size: 1rem; line-height: 1.6; color: var(--ink); transition: box-shadow .15s, border-color .15s;
}
.input, .select { height: 50px; padding: 0 14px; }
.select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566274' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.textarea { min-height: 220px; resize: vertical; }
.textarea--sm { min-height: 140px; }
.textarea:focus, .input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--inset), 0 0 0 3px rgba(14, 116, 104, .16); }
.textarea[readonly] { background: var(--surface); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.field-row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row--2 { grid-template-columns: 1fr 1fr; } .field-row--3 { grid-template-columns: repeat(3, 1fr); } }
.field-row .field { margin-bottom: 0; }
.input-affix { position: relative; }
.input-affix .affix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.input-affix .input { padding-right: 38px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.options { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 6px 0 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .94rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }

.segmented { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.segmented legend { width: 100%; padding: 0; margin-bottom: 8px; font-weight: 620; font-size: .92rem; color: var(--ink-2); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 11px; background: var(--bg); box-shadow: var(--raise-sm); font-size: .9rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: box-shadow .15s, color .15s, background-color .15s; user-select: none; }
.segmented input:checked + span { box-shadow: var(--inset); color: var(--accent-strong); background: #e3f1ee; }
.segmented input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.segmented span:hover { color: var(--ink); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0 6px; }
@media (min-width: 620px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .stats--6 { grid-template-columns: repeat(6, 1fr); } .stats--4 { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 14px 12px; border-radius: 14px; background: var(--bg); box-shadow: var(--inset); text-align: center; min-width: 0; }
.stat output, .stat .stat-value { display: block; font-size: 1.55rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.stat .stat-label { display: block; font-size: .8rem; color: var(--muted); margin-top: 3px; }

.result { margin-top: 16px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.result__label { font-size: .84rem; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 0 0 6px; }
.result__value { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 760; color: var(--accent-strong); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.25; }
.result__detail { margin: 8px 0 0; color: var(--ink-2); font-size: .95rem; }
.result--empty .result__value { color: var(--muted); font-size: 1rem; font-weight: 500; }
.result-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .result-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .result-grid--3 { grid-template-columns: repeat(3, 1fr); } }
.formula { font-family: var(--mono); font-size: .9rem; background: var(--surface-2); padding: 8px 12px; border-radius: 10px; display: inline-block; margin-top: 8px; color: var(--ink-2); overflow-wrap: anywhere; }

.feedback { min-height: 1.5em; font-size: .9rem; font-weight: 600; color: var(--accent-strong); margin: 8px 0 0; }
.feedback.is-error { color: var(--danger); }
.feedback:empty { min-height: 0; margin: 0; }

.calc-block { padding: 18px; border-radius: 18px; background: var(--bg); box-shadow: var(--raise-sm); }
.calc-block + .calc-block { margin-top: 16px; }
.calc-block h3 { font-size: 1.02rem; margin-bottom: 12px; }
.calc-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-weight: 600; color: var(--ink-2); }
.calc-inline .input { width: 130px; flex: 1 1 110px; max-width: 180px; }
.calc-inline .calc-out { font-weight: 750; color: var(--accent-strong); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.calc-note { margin: 10px 0 0; font-size: .88rem; color: var(--muted); }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 6px; margin: 0 0 16px; border-radius: 14px; box-shadow: var(--inset); scrollbar-width: thin; }
.tabs button { flex: none; min-height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: transparent; font-weight: 620; font-size: .9rem; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--bg); box-shadow: var(--raise-sm); color: var(--accent-strong); }

/* Dropzone & image tools */
.dropzone { display: grid; place-items: center; gap: 8px; text-align: center; padding: 34px 18px; border-radius: 18px; background: var(--bg); box-shadow: var(--inset); border: 2px dashed #c3ccd9; cursor: pointer; transition: border-color .15s, background-color .15s; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: #e6f2f0; }
.dropzone .icon { width: 36px; height: 36px; color: var(--accent); }
.dropzone strong { font-size: 1.05rem; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.preview-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 700px) { .preview-grid { grid-template-columns: 1fr 1fr; } }
.preview { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.preview h3 { font-size: .95rem; margin-bottom: 8px; }
.preview-frame { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background-color: #fff; background-image: linear-gradient(45deg, #eef1f5 25%, transparent 25%), linear-gradient(-45deg, #eef1f5 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef1f5 75%), linear-gradient(-45deg, transparent 75%, #eef1f5 75%); background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.preview-frame img { max-height: 100%; object-fit: contain; }
.preview-frame .muted { padding: 12px; text-align: center; font-size: .9rem; }
.preview dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: .9rem; }
.preview dt { color: var(--muted); }
.preview dd { margin: 0; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); height: 30px; }
.range-row output { min-width: 3.5ch; font-weight: 700; font-variant-numeric: tabular-nums; }
.savings { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-strong); }
.savings.is-worse { background: var(--amber-soft); color: var(--amber); }

/* ---------- Layout with sidebar ---------- */
.layout { display: grid; gap: 40px; padding-bottom: 56px; }
@media (min-width: 1024px) { .layout--sidebar { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; } }
.sidebar { display: grid; gap: 22px; align-content: start; }
@media (min-width: 1024px) { .sidebar-sticky { position: sticky; top: 90px; } }
.side-box { padding: 20px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); }
.side-box h2, .side-box h3 { font-size: 1rem; margin-bottom: 10px; }
.side-box ul { list-style: none; padding: 0; margin: 0; }
.side-box li { margin: 0; }
.side-box li a { display: flex; gap: 8px; align-items: center; padding: 7px 0; font-size: .94rem; text-decoration: none; color: var(--ink-2); }
.side-box li a:hover { color: var(--accent-strong); }
.side-box li .icon { width: 16px; height: 16px; color: var(--accent); }

/* ---------- Prose (articles & tool guides) ---------- */
.prose { font-size: 1.05rem; line-height: 1.75; color: #212b38; max-width: 74ch; }
.prose > * + h2 { margin-top: 2.2em; }
.prose > * + h3 { margin-top: 1.7em; }
.prose h2 { scroll-margin-top: 90px; }
.prose h3 { scroll-margin-top: 90px; }
.prose a { font-weight: 560; }
.prose img { border-radius: var(--r); margin: 1.6em 0; }
.prose figure { margin: 1.8em 0; }
.prose figcaption { font-size: .88rem; color: var(--muted); margin-top: .5em; text-align: center; }
.prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink-2); }
.prose blockquote p:last-child { margin: 0; }
.prose pre { background: #1e2733; color: #e8edf3; padding: 16px; border-radius: 12px; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose li::marker { color: var(--accent); }
.prose .callout, .callout { margin: 1.6em 0; padding: 16px 18px; border-radius: var(--r); background: var(--accent-soft); color: #173f3a; font-size: .98rem; }
.callout p:last-child { margin: 0; }
.callout--warn { background: var(--amber-soft); color: #5a3408; }
.prose .formula-block, .formula-block { font-family: var(--mono); background: var(--surface); border: 1px solid var(--line); padding: 14px 16px; border-radius: 12px; font-size: .95rem; overflow-x: auto; margin: 1.2em 0; color: var(--ink); }
.table-wrap { width: 100%; overflow-x: auto; margin: 1.5em 0; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table-wrap table { margin: 0; border: 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 460px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 680; color: var(--ink); font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
caption { caption-side: bottom; padding: 8px 14px; font-size: .85rem; color: var(--muted); text-align: left; }

.toc { padding: 18px 20px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--inset); margin: 0 0 30px; }
.toc summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary .icon { width: 18px; height: 18px; transition: transform .2s; }
.toc[open] summary .icon { transform: rotate(180deg); }
.toc ol { margin: 12px 0 0; padding-left: 1.2em; font-size: .95rem; }
.toc li { margin: .3em 0; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent-strong); text-decoration: underline; }

/* FAQ */
.faq { display: grid; gap: 12px; margin: 1.2em 0; }
.faq details { border-radius: var(--r); background: var(--bg); box-shadow: var(--raise-sm); padding: 0; }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 18px; cursor: pointer; font-weight: 650; list-style: none; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { width: 20px; height: 20px; color: var(--accent); transition: transform .2s var(--ease); }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq .faq-body { padding: 0 18px 16px; color: var(--ink-2); }
.faq .faq-body p:last-child { margin: 0; }
.faq h3 { font-size: 1.02rem; margin: 0; font-weight: 650; }

/* Steps list */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 58px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); margin: 0; }
.steps li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; font-size: .9rem; }

.example { margin: 1.2em 0; padding: 16px 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.example-title { display: block; font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent-strong); margin-bottom: 6px; }
.example p:last-child { margin: 0; }

/* ---------- Blog ---------- */
.post-card { display: flex; flex-direction: column; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); overflow: hidden; height: 100%; transition: box-shadow .2s var(--ease), transform .2s var(--ease); }
.post-card:hover { box-shadow: var(--raise-hover); transform: translateY(-2px); }
.post-card__img { display: block; aspect-ratio: 1200 / 630; background: var(--surface-2); }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.post-card h3 { font-size: 1.1rem; margin: 0; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card h3 a:hover { color: var(--accent-strong); }
.post-card p { margin: 0; color: var(--muted); font-size: .94rem; }
.post-card .pill { position: relative; z-index: 1; align-self: flex-start; }
.post-card__meta { margin-top: auto; font-size: .84rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.post-featured { display: grid; gap: 0; border-radius: 24px; overflow: hidden; background: var(--bg); box-shadow: var(--raise); position: relative; }
@media (min-width: 860px) { .post-featured { grid-template-columns: 1.1fr 1fr; } }
.post-featured__img { aspect-ratio: 1200 / 630; background: var(--surface-2); }
@media (min-width: 860px) { .post-featured__img { aspect-ratio: auto; min-height: 100%; } }
.post-featured__img img { width: 100%; height: 100%; object-fit: cover; }
.post-featured__body { padding: 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
@media (min-width: 860px) { .post-featured__body { padding: 36px; } }
.post-featured h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.9rem); }
.post-featured h2 a { color: var(--ink); text-decoration: none; }
.post-featured h2 a::after { content: ""; position: absolute; inset: 0; }
.post-featured .pill { position: relative; z-index: 1; align-self: flex-start; }
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 26px; }
.cat-nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.cat-nav a:hover { color: var(--accent-strong); }
.cat-nav a[aria-current="page"] { box-shadow: var(--inset); color: var(--accent-strong); }

.article-head { padding: 20px 0 8px; max-width: 820px; }
.article-head h1 { margin: 12px 0 14px; }
.article-lead { font-size: 1.15rem; color: var(--ink-2); }
.article-hero { margin: 22px 0 34px; border-radius: 22px; overflow: hidden; box-shadow: var(--raise); aspect-ratio: 1200 / 630; background: var(--surface-2); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
.byline { display: flex; align-items: center; gap: 12px; font-size: .92rem; color: var(--muted); flex-wrap: wrap; }
.byline a { color: var(--ink-2); font-weight: 620; text-decoration: none; }
.byline a:hover { color: var(--accent-strong); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-weight: 700; flex: none; }
.author-box { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--raise-sm); margin: 40px 0; }
.author-box .avatar { width: 56px; height: 56px; font-size: 1.3rem; }
.author-box h2 { font-size: 1.05rem; margin: 0 0 6px; }
.author-box p { margin: 0 0 6px; color: var(--ink-2); font-size: .96rem; }
.related-block { margin: 44px 0 0; }
.related-block h2 { font-size: 1.35rem; }

.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 40px 0 0; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); text-decoration: none; color: var(--ink-2); font-weight: 650; }
.pagination [aria-current="page"] { box-shadow: var(--inset); color: var(--accent-strong); }
.pagination a:hover { color: var(--accent-strong); }

/* ---------- Forms (contact) ---------- */
.form-card { padding: 22px; border-radius: 22px; background: var(--bg); box-shadow: var(--raise); }
@media (min-width: 768px) { .form-card { padding: 30px; } }
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 14px 16px; border-radius: 14px; margin: 0 0 18px; font-weight: 560; }
.alert--success { background: var(--accent-soft); color: #134e46; }
.alert--error { background: var(--danger-soft); color: #7a1a12; }
.field-error { color: var(--danger); font-size: .86rem; font-weight: 600; }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 32px auto; padding: 10px 0; text-align: center; min-height: 100px; clear: both; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.ad-label { display: block; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot--sidebar { margin: 0; min-height: 250px; border: 0; }

/* ---------- 404 & search ---------- */
.error-hero { padding: 56px 0 30px; text-align: center; }
.error-code { font-size: clamp(4rem, 3rem + 6vw, 7rem); font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -0.04em; margin: 0 0 10px; text-shadow: 4px 4px 10px var(--shadow-dark), -4px -4px 10px var(--shadow-light); }
.error-hero .finder { margin: 24px auto; }
.error-hero .btn-row { justify-content: center; }
.search-page-form { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 28px; }
.search-page-form .input { flex: 1 1 240px; }
.result-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.result-list li { margin: 0; }
.result-item { display: block; padding: 16px 18px; border-radius: var(--r); background: var(--bg); box-shadow: var(--raise-sm); text-decoration: none; color: var(--ink); }
.result-item:hover { color: var(--ink); box-shadow: var(--raise); }
.result-item strong { display: block; color: var(--accent-strong); font-size: 1.04rem; }
.result-item span { display: block; color: var(--muted); font-size: .93rem; }

/* ---------- Filters (tools directory) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 10px 0 28px; }
.filters .finder { flex: 1 1 280px; margin: 0; }
.filters .finder input { height: 50px; }
.filters .finder > .icon { top: 25px; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-chips button { min-height: 42px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--bg); box-shadow: var(--raise-sm); font-weight: 620; font-size: .9rem; color: var(--ink-2); }
.filter-chips button[aria-pressed="true"] { box-shadow: var(--inset); color: var(--accent-strong); }
.no-results { padding: 30px; text-align: center; color: var(--muted); }
.tool-group { margin-bottom: 44px; }
.tool-group__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.tool-group__head h2 { margin: 0; font-size: 1.4rem; display: flex; align-items: center; gap: 10px; }
.tool-group[hidden] { display: none; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 30px; padding: 48px 0 26px; background: #e4e9f0; border-top: 1px solid var(--line); font-size: .94rem; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr 1fr; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; } }
.footer-about { grid-column: 1 / -1; }
@media (min-width: 860px) { .footer-about { grid-column: auto; } }
.footer-about p { color: var(--muted); max-width: 36ch; margin-top: 12px; }
.site-footer h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 4px 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0; }
.site-footer li a { display: inline-block; padding: 5px 0; color: var(--muted); text-decoration: none; }
.site-footer li a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .86rem; }

/* ---------- Misc ---------- */
.intro-split { display: grid; gap: 26px; align-items: start; }
@media (min-width: 900px) { .intro-split { grid-template-columns: 1fr 1fr; gap: 40px; } }
.trust-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.trust-list li { display: flex; gap: 12px; align-items: flex-start; margin: 0; }
.trust-list .icon { color: var(--accent); margin-top: 3px; }
.cta-band { padding: 30px; border-radius: 24px; background: var(--bg); box-shadow: var(--raise); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.cta-band h2 { margin: 0 0 6px; font-size: 1.4rem; }
.cta-band p { margin: 0; color: var(--muted); }
.legal-updated { color: var(--muted); font-size: .92rem; }
.kbd-hint { font-size: .8rem; color: var(--muted); }
noscript .alert { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .tool-app, .sidebar, .toc { display: none !important; }
  body { background: #fff; }
}
.pt-0 { padding-top: 0 !important; }
.pt-sm { padding-top: 12px !important; }
.h-sm { font-size: 1.15rem; }
.guide-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; }
.guide-row > span { flex: 1 1 320px; }
.guide-row a strong { color: var(--accent-strong); }
.m-0 { margin: 0 !important; }
.select--inline, .input--inline { width: auto; height: 40px; min-width: 90px; }
.input--inline { width: 96px; }
.mt-sm { margin-top: 14px; }
.h-author { font-size: 1.7rem; margin: 0 0 6px; }
.layout > *, .editor-grid > *, .intro-split > * { min-width: 0; }
@media (max-width: 420px) {
  .btn { white-space: normal; text-align: center; }
  .calc-inline .select { flex: 1 1 100%; }
  .calc-inline .input { max-width: none; }
  .tool-app { padding: 14px; }
  .calc-block { padding: 14px; }
}
.layout { padding-top: 28px; }

/* Embed-this-tool box on tool pages */
.embed-box { margin: 1.6em 0; padding: 14px 18px; border-radius: var(--r); background: var(--bg); box-shadow: var(--raise-sm); }
.embed-box summary { cursor: pointer; font-weight: 600; }
.embed-box .embed-code { margin-top: 10px; font-family: ui-monospace, monospace; font-size: .82rem; }

/* Seasonal tools: countdown digits and Secret Santa link list */
.countdown .stat output { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.6rem); color: var(--accent-strong); }
.ss-links { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.ss-links li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 8px 12px; border-radius: 12px; background: var(--bg); box-shadow: var(--inset); overflow-wrap: anywhere; }
.ss-reveal .result__value { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); }
[hidden] { display: none !important; }

/* Working tool shown at the top of calculator-style guides */
.inline-tool { margin: 8px 0 28px; }
.inline-tool .tool-app { margin-top: 0; }
.inline-tool__more { margin: 10px 4px 0; }
