/* ==========================================================================
   Toolzuki — design system
   Pure CSS. System font stack, no frameworks, no web fonts.
   Light + dark themes via [data-theme] with prefers-color-scheme fallback.
   ========================================================================== */

:root {
  --bg: #f4f5fb;
  --bg-blob-1: rgba(99, 102, 241, .22);
  --bg-blob-2: rgba(236, 72, 153, .16);
  --bg-blob-3: rgba(34, 211, 238, .18);
  --surface: rgba(255, 255, 255, .72);
  --surface-solid: #ffffff;
  --surface-2: rgba(99, 102, 241, .06);
  --glass-border: rgba(255, 255, 255, .75);
  --text: #0f1424;
  --muted: #5d6478;
  --border: rgba(15, 20, 36, .09);
  --primary: #5b5bf0;
  --primary-2: #a855f7;
  --primary-ink: #4338ca;
  --primary-soft: rgba(99, 102, 241, .12);
  --accent: #06b6d4;
  --success: #15a35a;
  --success-soft: rgba(21, 163, 90, .12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, .1);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, .12);
  --shadow-sm: 0 1px 2px rgba(15, 20, 36, .05), 0 2px 8px rgba(15, 20, 36, .05);
  --shadow: 0 2px 4px rgba(15, 20, 36, .04), 0 12px 32px -8px rgba(15, 20, 36, .14);
  --shadow-lg: 0 8px 16px -6px rgba(15, 20, 36, .12), 0 30px 60px -20px rgba(79, 70, 229, .25);
  --glow: 0 0 0 4px rgba(99, 102, 241, .18);
  --radius: 18px;
  --radius-sm: 11px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --max: 1120px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

/* Dark theme — explicit toggle or system preference */
:root[data-theme="dark"],
:root:not([data-theme="light"]).sys-dark { --_d: 1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0d18;
    --bg-blob-1: rgba(99, 102, 241, .28);
    --bg-blob-2: rgba(236, 72, 153, .16);
    --bg-blob-3: rgba(6, 182, 212, .16);
    --surface: rgba(22, 26, 42, .62);
    --surface-solid: #161a2a;
    --surface-2: rgba(255, 255, 255, .05);
    --glass-border: rgba(255, 255, 255, .09);
    --text: #e9ecf5;
    --muted: #98a0b8;
    --border: rgba(255, 255, 255, .09);
    --primary: #8b8bff;
    --primary-2: #c084fc;
    --primary-ink: #c7c7ff;
    --primary-soft: rgba(139, 139, 255, .14);
    --success: #34d399;
    --success-soft: rgba(52, 211, 153, .12);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 36px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 10px 20px -8px rgba(0, 0, 0, .5), 0 30px 70px -20px rgba(99, 102, 241, .35);
    --glow: 0 0 0 4px rgba(139, 139, 255, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0d18;
  --bg-blob-1: rgba(99, 102, 241, .28);
  --bg-blob-2: rgba(236, 72, 153, .16);
  --bg-blob-3: rgba(6, 182, 212, .16);
  --surface: rgba(22, 26, 42, .62);
  --surface-solid: #161a2a;
  --surface-2: rgba(255, 255, 255, .05);
  --glass-border: rgba(255, 255, 255, .09);
  --text: #e9ecf5;
  --muted: #98a0b8;
  --border: rgba(255, 255, 255, .09);
  --primary: #8b8bff;
  --primary-2: #c084fc;
  --primary-ink: #c7c7ff;
  --primary-soft: rgba(139, 139, 255, .14);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, .12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .12);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .12);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 14px 36px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 10px 20px -8px rgba(0, 0, 0, .5), 0 30px 70px -20px rgba(99, 102, 241, .35);
  --glow: 0 0 0 4px rgba(139, 139, 255, .22);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
/* Soft gradient backdrop — static radial gradients, cheap to paint */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 10% 0%, var(--bg-blob-1), transparent 70%),
    radial-gradient(50% 45% at 95% 10%, var(--bg-blob-2), transparent 70%),
    radial-gradient(55% 50% at 50% 100%, var(--bg-blob-3), transparent 70%);
}
main { flex: 1; }
img, canvas, svg { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.02em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin-top: 1.4em; }
h3 { font-size: 1.1rem; font-weight: 700; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .12em .4em; border-radius: 6px; }
[hidden] { display: none !important; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Icons (inline SVG, stroke-based) */
.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -.15em; flex: none; }
i[data-icon] { display: inline-flex; width: 1em; height: 1em; vertical-align: -.15em; }

/* Glass surface */
.glass {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}

/* ---------- Header ---------- */
site-header { display: block; min-height: 65px; } /* reserve space before JS renders it (no layout shift) */
site-footer { display: block; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--glass-border);
}
/* Glass backdrop lives on a pseudo-element so the mobile menu (which overflows
   the header) is not composited into the filtered layer. */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--surface);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}
.nav-wrap { display: flex; align-items: center; gap: 10px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 1.05rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 6px 16px -6px rgba(99, 102, 241, .7);
}
.site-nav { margin-left: auto; display: flex; gap: 2px; }
.site-nav a { padding: 8px 13px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .92rem; transition: background .2s, color .2s; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; }
.hdr-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--border); color: var(--text); font-size: 1.15rem; transition: background .2s, transform .2s var(--ease);
}
.hdr-btn:hover { background: var(--primary-soft); transform: rotate(-12deg) scale(1.06); }
.nav-toggle { display: none; }
.theme-toggle .ic-sun, .theme-toggle .ic-moon { position: absolute; transition: transform .4s var(--ease), opacity .3s; }
.theme-toggle { position: relative; overflow: hidden; }
.theme-toggle .ic-moon { opacity: 0; transform: translateY(14px) rotate(-40deg); }
:root[data-theme="dark"] .theme-toggle .ic-sun { opacity: 0; transform: translateY(-14px) rotate(40deg); }
:root[data-theme="dark"] .theme-toggle .ic-moon { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .ic-sun { opacity: 0; transform: translateY(-14px) rotate(40deg); }
  :root:not([data-theme="light"]) .theme-toggle .ic-moon { opacity: 1; transform: none; }
}
/* Mobile menu: a fixed panel outside the glass header */
.mobile-nav {
  position: fixed; left: 12px; right: 12px; top: 72px; z-index: 60; display: flex; flex-direction: column; gap: 2px; padding: 8px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  animation: drop .25s var(--ease);
}
.mobile-nav a { padding: 12px 14px; border-radius: var(--radius-sm); color: var(--text); font-weight: 600; }
.mobile-nav a:hover, .mobile-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-ink); text-decoration: none; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .site-nav { display: none; }
}
@media (min-width: 861px) { .mobile-nav { display: none !important; } }
@keyframes drop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 72px; padding: 48px 0 28px; font-size: .92rem; background: var(--surface); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; }
.footer-grid h4 { margin: 0 0 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 7px 0; }
.footer-grid a { color: var(--text); opacity: .85; }
.footer-grid a:hover { opacity: 1; color: var(--primary); }
.footer-bottom { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 440px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 36px; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--primary-ink); background: var(--primary-soft); border: 1px solid var(--glass-border); margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); max-width: 760px; margin: 0 auto .4em; }
.grad-text {
  background: linear-gradient(90deg, var(--primary), var(--primary-2) 50%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: 1.15rem; color: var(--muted); max-width: 620px; margin: 0 auto 28px; }
.search { max-width: 580px; margin: 0 auto; position: relative; }
.search input {
  width: 100%; padding: 16px 18px 16px 50px; font: inherit; font-size: 1.02rem; border: 1px solid var(--glass-border); border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow); outline: none; transition: box-shadow .2s, border-color .2s;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.search input:focus { border-color: var(--primary); box-shadow: var(--shadow), var(--glow); }
.search > .ic { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); text-align: left; overflow: hidden; z-index: 20; animation: drop .2s var(--ease); }
.search-results a { display: flex; align-items: center; gap: 10px; padding: 11px 16px; color: var(--text); border-top: 1px solid var(--border); }
.search-results a:first-child { border-top: 0; }
.search-results a:hover { background: var(--primary-soft); text-decoration: none; }
.search-results .ic { color: var(--primary); width: 18px; height: 18px; }
.search-results .cat { color: var(--muted); font-size: .8rem; margin-left: auto; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--glass-border); font-size: .85rem; font-weight: 600; color: var(--muted); }
.badge .ic { color: var(--primary); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card {
  position: relative; display: block; padding: 22px; color: var(--text); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--glass-border); box-shadow: var(--shadow-sm);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card::after { /* gradient hairline on hover */
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: linear-gradient(135deg, var(--primary), var(--primary-2), var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
a.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); text-decoration: none; }
a.card:hover::after { opacity: 1; }
.card .icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px; color: var(--primary-ink);
  background: var(--primary-soft); transition: transform .35s var(--ease);
}
.card .icon .ic { width: 24px; height: 24px; }
a.card:hover .icon { transform: scale(1.1) rotate(-6deg); }
.card h3 { margin-bottom: 4px; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }
.card .arrow { position: absolute; right: 18px; top: 22px; color: var(--muted); opacity: 0; transform: translateX(-6px); transition: all .3s var(--ease); }
a.card:hover .arrow { opacity: 1; transform: none; color: var(--primary); }
.card .soon { display: inline-block; margin-top: 10px; font-size: .72rem; padding: 3px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.card.disabled { opacity: .75; }
/* category tints */
.cat-pdf .icon { background: rgba(244, 63, 94, .13); color: #e11d48; }
.cat-image .icon { background: rgba(14, 165, 233, .13); color: #0284c7; }
.cat-text .icon { background: rgba(139, 92, 246, .13); color: #7c3aed; }
.cat-calculators .icon { background: rgba(34, 197, 94, .13); color: #16a34a; }
.cat-converters .icon { background: rgba(245, 158, 11, .14); color: #d97706; }
.cat-generators .icon { background: rgba(236, 72, 153, .13); color: #db2777; }
:root[data-theme="dark"] .cat-pdf .icon { color: #fb7185; } :root[data-theme="dark"] .cat-image .icon { color: #38bdf8; }
:root[data-theme="dark"] .cat-text .icon { color: #a78bfa; } :root[data-theme="dark"] .cat-calculators .icon { color: #4ade80; }
:root[data-theme="dark"] .cat-converters .icon { color: #fbbf24; } :root[data-theme="dark"] .cat-generators .icon { color: #f472b6; }

.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }

/* ---------- Tool page ---------- */
.breadcrumb { font-size: .85rem; color: var(--muted); padding: 22px 0 10px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "/"; margin-right: 6px; opacity: .4; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.tool-head { margin-bottom: 22px; }
.tool-head .lead { font-size: 1.1rem; color: var(--muted); max-width: 720px; }
.tool-panel {
  position: relative; padding: 24px; border-radius: 24px;
  background: var(--surface); border: 1px solid var(--glass-border); box-shadow: var(--shadow-lg);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%);
}
@media (max-width: 560px) { .tool-panel { padding: 16px; border-radius: 18px; } }

/* Drop zone — the friendly empty state */
.dropzone {
  position: relative; border: 2px dashed var(--border); border-radius: var(--radius); padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--surface-2); transition: border-color .25s, background .25s, transform .25s var(--ease), box-shadow .25s;
  overflow: hidden;
}
.dropzone::before { /* soft spotlight */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(60% 80% at 50% 0%, var(--primary-soft), transparent 70%);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--primary); background: var(--surface-2); outline: none; }
.dropzone:hover::before, .dropzone.drag::before { opacity: 1; }
.dropzone.drag { border-color: var(--primary); border-style: solid; transform: scale(1.01); box-shadow: var(--glow); background: var(--primary-soft); }
.dz-icon {
  width: 68px; height: 68px; margin: 0 auto 14px; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 12px 24px -10px rgba(99, 102, 241, .8);
  transition: transform .35s var(--ease);
}
.dz-icon .ic { width: 30px; height: 30px; }
.dropzone:hover .dz-icon { transform: translateY(-3px) scale(1.04); }
.dropzone.drag .dz-icon { animation: bob .7s var(--ease) infinite alternate; }
@keyframes bob { from { transform: translateY(-2px) scale(1.04); } to { transform: translateY(-10px) scale(1.1); } }
.dropzone strong { display: block; font-size: 1.12rem; margin-bottom: 4px; font-weight: 700; }
.dropzone .dz-hint { color: var(--muted); font-size: .9rem; }
.dropzone .dz-or { display: inline-block; margin-top: 14px; padding: 9px 16px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--primary-ink); background: var(--primary-soft); }
.dropzone input[type="file"] { display: none; }

/* File list */
.file-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  animation: rise .35s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.file-item .thumb { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; background: var(--surface-2); flex: none; border: 1px solid var(--border); }
.file-item .f-icon { width: 46px; height: 46px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); flex: none; }
.file-item .f-icon .ic { width: 22px; height: 22px; }
.file-item .f-meta { flex: 1; min-width: 0; }
.file-item .f-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.file-item .f-size { color: var(--muted); font-size: .84rem; }
.file-item .f-actions { display: flex; gap: 4px; flex: none; }
.icon-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; color: var(--muted);
  display: grid; place-items: center; transition: all .2s var(--ease);
}
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); transform: translateY(-1px); }
.icon-btn:disabled { opacity: .35; cursor: default; transform: none; }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

/* Options */
.options { display: grid; gap: 16px; margin-top: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); animation: rise .35s var(--ease); }
.field label, .field > span.lbl { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; }
.field .help { color: var(--muted); font-size: .82rem; margin-top: 5px; }
input[type="text"], input[type="number"], select {
  width: 100%; padding: 11px 13px; font: inherit; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-solid); color: var(--text); transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: var(--glow); }
.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-group label { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-solid); transition: all .2s; }
.radio-group label:hover { border-color: var(--primary); }
.radio-group label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.radio-group input { margin-top: 4px; accent-color: var(--primary); }
.radio-group small { display: block; color: var(--muted); font-weight: 400; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { accent-color: var(--primary); width: 16px; height: 16px; }
.range-row { display: flex; align-items: center; gap: 12px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; font: inherit; font-weight: 700;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface-solid); color: var(--text); cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s, background .2s, border-color .2s;
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { background: var(--primary-soft); border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { color: #fff; border: 0; background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .9); }
.btn-primary:hover { background: linear-gradient(135deg, var(--primary), var(--primary-2)); box-shadow: 0 14px 28px -10px rgba(99, 102, 241, 1); filter: brightness(1.05); }
.btn-success { color: #fff; border: 0; background: linear-gradient(135deg, #16a34a, #059669); box-shadow: 0 10px 24px -10px rgba(22, 163, 74, .9); }
.btn-success:hover { filter: brightness(1.06); background: linear-gradient(135deg, #16a34a, #059669); }
.btn-lg { padding: 14px 28px; font-size: 1.04rem; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }

/* Progress */
.progress { margin-top: 20px; animation: rise .3s var(--ease); }
.progress .bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.progress .bar > span {
  display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s var(--ease);
  background: linear-gradient(90deg, var(--primary), var(--primary-2), var(--accent), var(--primary)); background-size: 300% 100%;
  animation: flow 2s linear infinite;
}
@keyframes flow { to { background-position: -300% 0; } }
.progress .status { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--muted); font-size: .9rem; }
.progress .status::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--primary-soft); border-top-color: var(--primary); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerts / results */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); margin-top: 16px; border: 1px solid transparent; font-size: .95rem; animation: rise .3s var(--ease); }
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-info { background: var(--primary-soft); color: var(--primary-ink); }
.result {
  margin-top: 20px; padding: 22px; border-radius: var(--radius); position: relative; overflow: hidden;
  background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  animation: pop .45s var(--ease);
}
@keyframes pop { 0% { opacity: 0; transform: scale(.96) translateY(10px); } 60% { transform: scale(1.01) translateY(0); } 100% { opacity: 1; transform: none; } }
.result h3 { color: var(--success); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.result h3 .ic { width: 22px; height: 22px; }
.result .stats { color: var(--muted); font-size: .92rem; margin-bottom: 12px; }
.result .actions { margin-top: 8px; }

/* Thumbnails */
.thumbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-top: 16px; }
.thumbs figure { margin: 0; background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; display: flex; flex-direction: column; animation: rise .35s var(--ease) both; transition: transform .25s var(--ease), box-shadow .25s; }
.thumbs figure:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.thumbs img { width: 100%; height: 170px; object-fit: contain; background: #fff; display: block; }
.thumbs figcaption { padding: 8px 10px; font-size: .8rem; display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); }

/* ---------- Content sections ---------- */
.content { max-width: 780px; }
.content ol, .content ul { padding-left: 22px; }
.content li { margin: 6px 0; }
.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--glass-border); }
.steps li::before { content: counter(step); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2)); }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 12px; }
.feature { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 18px; transition: transform .3s var(--ease), box-shadow .3s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.feature .icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 10px; background: var(--primary-soft); color: var(--primary-ink); }
.feature .icon .ic { width: 20px; height: 20px; }
.feature h3 { font-size: 1rem; margin-bottom: 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .9rem; }

.faq details { background: var(--surface); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 0 16px; margin-bottom: 8px; transition: border-color .2s; }
.faq details[open] { border-color: var(--primary); }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary); font-size: 1.4rem; font-weight: 400; line-height: 1; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 14px; margin: 0; }

.related .grid { margin-top: 12px; }
.page-head { padding: 40px 0 8px; }
.page-head p { color: var(--muted); font-size: 1.1rem; max-width: 700px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(10px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-size: .9rem; box-shadow: var(--shadow-lg); z-index: 100; opacity: 0; transition: opacity .25s, transform .25s var(--ease); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
