/* =========================================================
   Toolwell — clean & modern
   ========================================================= */

/* ---------- Font: Inter (self-hosted, SIL Open Font Licence) ---------- */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/inter-latin-var.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Arial tuned to Inter's size, so text doesn't jump when Inter finishes loading. */
@font-face {
  font-family: "Inter Fallback"; src: local("Arial");
  ascent-override: 90.49%; descent-override: 22.56%; line-gap-override: 0%; size-adjust: 107.06%;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f4f7;
  --surface-3: #e9ebf0;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6475;
  --border: #e5e7ec;
  --border-strong: #d3d7df;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --accent-text: #ffffff;
  --accent-soft: #eef0ff;
  --accent-soft-text: #4338ca;
  --ok: #15803d;
  --ok-soft: #e8f6ee;
  --danger: #c62828;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06);
  --shadow: 0 1px 2px rgb(15 23 42 / 0.05), 0 6px 24px -6px rgb(15 23 42 / 0.08);
  --shadow-lg: 0 2px 4px rgb(15 23 42 / 0.04), 0 18px 48px -12px rgb(15 23 42 / 0.14);
  --hero-glow: rgb(99 102 241 / 0.13);
  --font: "Inter", "Inter Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  --header-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0d12; --bg-soft: #0f1218; --surface: #13161d; --surface-2: #1a1e27; --surface-3: #242a35;
    --text: #e8eaf0; --text-2: #c3c8d2; --muted: #98a1b0; --border: #252a35; --border-strong: #333a47;
    --accent: #8b93ff; --accent-hover: #a5abff; --accent-text: #0b0d12; --accent-soft: #1d2142; --accent-soft-text: #b4b9ff;
    --ok: #4ade80; --ok-soft: #12291c; --danger: #ff7a73;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4); --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -8px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 0.6); --hero-glow: rgb(129 140 248 / 0.16);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0d12; --bg-soft: #0f1218; --surface: #13161d; --surface-2: #1a1e27; --surface-3: #242a35;
  --text: #e8eaf0; --text-2: #c3c8d2; --muted: #98a1b0; --border: #252a35; --border-strong: #333a47;
  --accent: #8b93ff; --accent-hover: #a5abff; --accent-text: #0b0d12; --accent-soft: #1d2142; --accent-soft-text: #b4b9ff;
  --ok: #4ade80; --ok-soft: #12291c; --danger: #ff7a73;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4); --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -8px rgb(0 0 0 / 0.5);
  --shadow-lg: 0 18px 48px -12px rgb(0 0 0 / 0.6); --hero-glow: rgb(129 140 248 / 0.16);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  overflow-x: clip;
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.65 var(--font); font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4.2vw, 2.5rem); font-weight: 800; margin: 0 0 0.35em; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.5rem); font-weight: 700; margin: 2em 0 0.6em; }
h3 { font-size: 1.05rem; font-weight: 650; margin: 1.4em 0 0.4em; }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
code, pre, .mono { font-family: var(--mono); font-size: 0.9em; }
pre { background: var(--surface-2); padding: 0.75rem 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); margin: 0; max-width: 62ch; }
.accent-text { background: linear-gradient(90deg, #6366f1, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.icon { flex: none; vertical-align: middle; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--accent); color: var(--accent-text); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { left: 8px; }

/* ---------- Controls ---------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45em;
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.2; padding: 0.7em 1.15em;
  border-radius: 10px; border: 1px solid transparent; background: var(--accent); color: var(--accent-text);
  cursor: pointer; text-decoration: none; transition: background-color .15s, border-color .15s, box-shadow .15s, transform .05s;
  box-shadow: var(--shadow-sm);
}
button:hover, .button:hover { background: var(--accent-hover); color: var(--accent-text); }
button:active, .button:active { transform: translateY(1px); }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); color: var(--text); }
button:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 0.6em 0.75em; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=checkbox], input[type=range] { accent-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 100%; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo:hover { color: var(--text); }
.main-nav { display: none; gap: 4px; }
.main-nav a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 0.94rem; padding: 6px 10px; border-radius: 8px; }
.main-nav a:hover, .main-nav a[aria-current] { color: var(--text); background: var(--surface-2); }
.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-search { position: relative; display: none; }
.header-search .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.header-search input { width: 220px; padding: 0.45em 0.8em 0.45em 2.1em; border-radius: 99px; background: var(--surface-2); border-color: transparent; font-size: 0.92rem; }
.header-search input:focus { background: var(--surface); }
.icon-link {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0;
  border-radius: 10px; color: var(--text-2); background: transparent; border: 0; box-shadow: none;
}
.icon-link:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
@media (min-width: 900px) {
  .main-nav { display: flex; }
}
@media (min-width: 1100px) {
  .header-search { display: block; }
  .search-link { display: none; }
}

/* ---------- Footer ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border); background: var(--bg-soft); font-size: 0.94rem; }
.footer-grid { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 32px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand p { max-width: 42ch; margin-top: 12px; }
.site-footer nav { display: flex; flex-direction: column; gap: 8px; }
.site-footer h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 4px; }
.site-footer nav a { color: var(--text-2); text-decoration: none; }
.site-footer nav a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 20px; padding-bottom: 28px; font-size: 0.86rem; }

/* ---------- Home ---------- */
.hero { position: relative; text-align: center; padding: 56px 0 28px; }
.hero::before {
  content: ""; position: absolute; top: -64px; left: 50%; width: min(1200px, 100%); transform: translateX(-50%); height: 420px; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, var(--hero-glow), transparent 70%);
}
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.5rem); max-width: 18ch; margin: 0 auto 0.35em; }
.hero .lead { margin: 0 auto; font-size: clamp(1.02rem, 2vw, 1.18rem); }
.hero.small { padding-top: 40px; text-align: left; }
.hero.small h1, .hero.small .lead { margin-left: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 0 18px; padding: 5px 12px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-soft-text); font-size: 0.85rem; font-weight: 600;
}
.hero-search {
  position: relative; display: flex; align-items: center; gap: 8px; max-width: 620px; margin: 32px auto 0; padding: 6px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow-lg);
}
.hero-search:focus-within { border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft); }
.hero-search > .icon { margin-left: 12px; color: var(--muted); }
.hero-search input { border: 0; box-shadow: none; background: transparent; font-size: 1.05rem; padding: 0.55em 0.25em; }
.hero-search input:focus { box-shadow: none; }
.hero-search button { border-radius: 11px; }
.search-page { margin: 8px 0 24px; max-width: 680px; }
.filter-empty { margin-top: 16px; }

.trust-badges {
  list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 900px) { .trust-badges { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) { .trust-badges li { flex-direction: column; gap: 6px; padding: 12px; font-size: 0.85rem; } }
.trust-badges li {
  display: flex; align-items: flex-start; gap: 10px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border); font-size: 0.92rem; color: var(--muted);
}
.trust-badges .icon { color: var(--accent); margin-top: 2px; }
.trust-badges strong { display: block; color: var(--text); font-weight: 650; }

.home-section h2 { display: flex; align-items: center; gap: 10px; margin-top: 56px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.see-all { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.92rem; text-decoration: none; }

/* ---------- Cards ---------- */
.tool-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.tool-card {
  display: flex; gap: 14px; height: 100%; padding: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); text-decoration: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.tool-card:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card-icon, .category-icon, .page-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-soft-text);
}
.tool-card-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-card-text strong { font-weight: 650; line-height: 1.3; }
.tool-card-text span { color: var(--muted); font-size: 0.88rem; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-grid.compact .tool-card-text span { -webkit-line-clamp: 1; }
.tool-grid li[data-extra] { display: none; }
body.filtering .tool-grid li[data-extra]:not([hidden]) { display: block; }
.category-icon.small { width: 32px; height: 32px; border-radius: 9px; }

.category-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.category-card {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 20px; border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft)); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.category-card:hover { color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); transform: translateY(-2px); }
.category-card .category-icon { margin-bottom: 8px; }
.category-card strong { font-size: 1.08rem; }
.category-card .muted { font-size: 0.9rem; line-height: 1.5; }
.category-count { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 0.88rem; font-weight: 600; color: var(--accent); }

/* ---------- Page headers ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--muted); padding-top: 20px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-hidden] { color: var(--border-strong); }
.page-header, .tool-header { display: flex; align-items: flex-start; gap: 16px; margin: 20px 0 24px; }
.page-header.plain { display: block; }
.page-icon { width: 54px; height: 54px; border-radius: 15px; margin-top: 2px; }
@media (max-width: 640px) {
  .tool-header .page-icon, .page-header .page-icon { display: none; }
  .tool-header, .page-header { margin: 14px 0 12px; }
  .tool-header .lead, .page-header .lead { font-size: 1rem; }
  .breadcrumbs { padding-top: 14px; }
  .breadcrumbs [aria-current], .breadcrumbs span[aria-hidden]:nth-last-child(2) { display: none; }
  .tool-chips { gap: 6px; margin-bottom: 14px; }
  .tool-chips li { font-size: 0.78rem; padding: 4px 9px; }
  .crop-hint { font-size: 0.86rem; padding: 10px 12px; }
  .dropzone { min-height: 170px; padding: 22px 16px; }
  .hero { padding-top: 36px; }
  .trust-badges { margin-top: 28px; gap: 8px; }
}

/* ---------- Tool page ---------- */
.tool-layout { display: grid; gap: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; } }
.tool-main { max-width: 860px; min-width: 0; }
@media (max-width: 1023px) { .tool-sidebar { display: none; } }
.tool-sidebar { padding-top: 20px; }
.sidebar-sticky { position: sticky; top: calc(var(--header-h) + 20px); }
.side-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; background: var(--bg-soft); margin-bottom: 20px; }
.side-card h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 10px; }
.side-card ul { list-style: none; padding: 0; margin: 0 0 12px; }
.side-card li a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 0.92rem; line-height: 1.35; }
.side-card li a:hover { background: var(--surface); color: var(--text); }
.side-card li .icon { color: var(--accent); }
.tool-header { margin-bottom: 14px; }
.tool-header h1 { margin-bottom: 0.25em; }
.tool-chips { list-style: none; padding: 0; margin: 0 0 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tool-chips li {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-2); font-size: 0.84rem; font-weight: 500;
}
.tool-chips li:first-child { background: var(--ok-soft); color: var(--ok); }
.tool-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: clamp(16px, 3vw, 28px);
  min-height: var(--tool-h, 280px); /* reserved per tool so the page doesn't jump while the tool loads */
}
@media (min-width: 900px) { .tool-box { min-height: var(--tool-h-d, 280px); } }
.tool-loading { color: var(--muted); }
.content-section { margin-top: 8px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 16px 12px 56px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.steps li::before {
  content: counter(step); position: absolute; left: 14px; top: 11px; width: 28px; height: 28px; border-radius: 99px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: 0.88rem;
}
.prose { color: var(--text-2); }
.prose > p:first-child { color: var(--text); font-size: 1.05rem; padding: 16px 18px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--radius) var(--radius) 0; }
.prose > p:first-child strong { font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: 0.4em; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 1em 0 1.5em; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; font-size: 0.95rem; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child th, .prose tr:last-child td { border-bottom: 0; }
.prose thead th { background: var(--surface-2); color: var(--text); font-weight: 650; font-size: 0.88rem; }
.prose tbody th { color: var(--text); font-weight: 600; width: 34%; background: var(--bg-soft); }
.table-scroll { overflow-x: auto; }
.prose .muted { font-size: 0.9rem; }
.faq details { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 10px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 44px 14px 18px; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq summary h3 { display: inline; margin: 0; font-size: 1rem; font-weight: 600; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--text-2); }
.preview-banner { background: var(--accent-soft); padding: 10px 14px; border-radius: var(--radius-sm); margin-top: 16px; }
.error { color: var(--danger); }

/* ---------- Ads (space reserved to avoid layout shift) ---------- */
.ad { margin: 28px 0; text-align: center; }
.ad-label { display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.ad-belowTool, .ad-inContent { min-height: 280px; }
.ad-sidebar { min-height: 600px; margin-top: 0; }

/* ---------- Shared tool UI (used by engines) ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 200px; padding: 28px 20px; border: 2px dashed var(--border-strong); border-radius: var(--radius);
  cursor: pointer; background: var(--bg-soft); transition: border-color .15s, background-color .15s;
}
.dropzone::before {
  content: ""; width: 48px; height: 48px; margin-bottom: 6px; border-radius: 14px;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 15V3'/%3E%3Cpath d='m7 8 5-5 5 5'/%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3C/svg%3E") center / 24px no-repeat;
  box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--accent) 55%, transparent);
}
.dropzone.dragging, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone strong { font-size: 1.12rem; }
.dropzone > span:not(.muted) { color: var(--text-2); }
.dropzone .muted { font-size: 0.86rem; margin-top: 4px; }
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-top: 16px; }
.tool-row label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.9rem; }
.tool-result { margin-top: 20px; }
.tool-result img { display: block; max-height: 320px; margin: 12px auto; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); margin: 12px 0; }
.stat { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.stat b { display: block; font-size: 1.4rem; letter-spacing: -0.02em; }
.stat span { color: var(--muted); font-size: 0.84rem; }
.calc-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.calc-grid label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: 0.9rem; }
.input-unit { display: flex; align-items: center; gap: 8px; }
.input-unit span { color: var(--muted); font-weight: 500; white-space: nowrap; }
.calc-outputs { margin-top: 22px; display: grid; gap: 10px; }
.calc-output { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 16px 18px; background: var(--accent-soft); border-radius: var(--radius); margin: 0; }
.calc-output > span:first-child { color: var(--accent-soft-text); font-weight: 600; }
.calc-output .value { font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }
.calc-output .band { font-weight: 600; color: var(--text-2); }
.text-input { min-height: 240px; resize: vertical; line-height: 1.6; }
.crop-hint { background: var(--accent-soft); color: var(--text-2); padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px; font-size: 0.93rem; }
.crop-stage { display: flex; justify-content: center; }
.crop-canvas { display: block; touch-action: none; cursor: grab; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px var(--border-strong), var(--shadow); max-width: 100%; }
.crop-canvas:active { cursor: grabbing; }
.crop-help { text-align: center; font-size: 0.9rem; margin: 12px auto 4px; max-width: 52ch; }
.zoom-row { display: flex; align-items: center; gap: 10px; max-width: 420px; margin: 8px auto; font-weight: 600; font-size: 0.9rem; }
.zoom-row input { padding: 0; border: 0; box-shadow: none; }
.crop-editor .button-row { justify-content: center; }
.crop-outputs-title { text-align: center; margin: 22px 0 0; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.crop-status { text-align: center; font-size: 0.92rem; }
.preset-tabs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 0 auto 16px; padding: 4px; background: var(--surface-2); border-radius: 12px; width: fit-content; max-width: 100%; }
.preset-tabs button { background: transparent; color: var(--text-2); border: 0; box-shadow: none; padding: 0.5em 0.9em; font-size: 0.88rem; border-radius: 9px; }
.preset-tabs button:hover { background: var(--surface-3); color: var(--text); }
.preset-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.file-results { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.file-result { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius); }
.file-result img { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius-sm); flex: none; margin: 0; border: 1px solid var(--border); }
.file-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.file-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-info span { font-size: 0.86rem; }
.icon-button { padding: 0.45em 0.7em; min-width: 2.4em; }
.pdf-options { margin-bottom: 12px; }
.md-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.md-tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; }
.md-tabs button { background: transparent; border: 0; box-shadow: none; color: var(--text-2); padding: 0.45em 0.9em; font-size: 0.88rem; border-radius: 9px; }
.md-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.md-open { cursor: pointer; font-size: 0.88rem; padding: 0.55em 0.9em; }
.md-option { display: inline-flex; align-items: center; gap: 6px; font-size: 0.88rem; font-weight: 600; color: var(--text-2); }
.md-option select { width: auto; padding: 0.4em 0.6em; font-size: 0.88rem; }
.md-panes { display: grid; gap: 12px; }
.md-input { min-height: 420px; resize: vertical; font-size: 0.88rem; line-height: 1.6; tab-size: 2; }
.md-preview { min-height: 420px; max-height: 640px; overflow: auto; padding: 16px 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.md-preview > :first-child { margin-top: 0; }
.md-preview > p:first-child { padding: 0; border: 0; background: none; border-radius: 0; font-size: inherit; color: inherit; }
.md-preview h1 { font-size: 1.7rem; } .md-preview h2 { font-size: 1.3rem; margin-top: 1.4em; }
.md-preview pre { background: var(--surface-2); } .md-preview code { background: var(--surface-2); padding: 0.1em 0.3em; border-radius: 4px; }
.md-preview pre code { padding: 0; background: none; }
.md-preview blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--accent); color: var(--muted); }
.md-preview img { max-width: 100%; }
.md-panes[data-view="write"] .md-preview, .md-panes[data-view="preview"] .md-input { display: none; }
@media (min-width: 900px) {
  .md-tabs { display: none; }
  .md-panes { grid-template-columns: 1fr 1fr; }
  .md-panes[data-view] .md-preview, .md-panes[data-view] .md-input { display: block; }
}
.form-ok { color: var(--ok); font-weight: 600; }

/* ---------- Static pages ---------- */
.static-page { max-width: 760px; }
.static-page h1 { margin-top: 20px; }

/* ---------- Admin ---------- */
.admin .site-header { position: static; }
.admin-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.admin-nav form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; box-shadow: none; }
.link-button:hover { background: none; color: var(--accent-hover); }
.admin-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); display: block; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table th, .admin-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.badge { font-size: 0.76rem; padding: 2px 9px; border-radius: 99px; background: var(--surface-2); font-weight: 600; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.admin-form { display: flex; flex-direction: column; gap: 18px; max-width: 860px; }
.admin-form.narrow { max-width: 380px; margin: 48px auto; }
.admin-form fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; }
.admin-form legend { font-weight: 700; padding: 0 6px; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; }
.admin-form label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }
.admin-form label.check input { width: auto; }
.admin-form small { font-weight: 400; color: var(--muted); }
.field-error, .form-error { color: var(--danger); font-weight: 600; font-size: 0.9rem; }
.char-count { font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.char-count.over { color: var(--danger); }
.examples pre { margin-top: 0; }
.danger-zone { margin-top: 32px; }
button.danger { background: var(--danger); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
