/* ============================================================
   Tools — Design System
   Brand: green #22874F + blue #035D9B
   Vanilla CSS. Light + dark theme via [data-theme].
   ============================================================ */

/* ---------- Theme tokens ---------- */
:root {
  --brand-blue: #035D9B;
  --brand-green: #22874F;

  --bg: #f3f6f9;
  --surface: #ffffff;
  --surface-2: #eef2f6;
  --surface-3: #e4eaf0;
  --border: #d8e0e8;
  --border-strong: #c2ccd6;

  --text: #10222f;
  --text-muted: #566573;
  --text-faint: #8a97a3;

  --primary: #035D9B;
  --primary-hover: #024a7d;
  --primary-soft: #e5f0f8;
  --primary-contrast: #ffffff;

  --green: #22874F;
  --green-hover: #1b6e40;
  --green-soft: #e4f3ea;

  --danger: #cf3238;
  --danger-soft: #fbe8e9;
  --warning: #b8770a;
  --warning-soft: #fbf1dd;
  --success: #22874F;

  --accent-grad: linear-gradient(135deg, #035D9B 0%, #12775f 55%, #22874F 100%);

  --ring: rgba(3, 93, 155, 0.32);
  --shadow-sm: 0 1px 2px rgba(16, 34, 47, 0.06), 0 1px 3px rgba(16, 34, 47, 0.08);
  --shadow-md: 0 4px 12px rgba(16, 34, 47, 0.08), 0 2px 4px rgba(16, 34, 47, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 34, 47, 0.12);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Fira Code", Consolas, "Liberation Mono", Menlo, monospace;

  --header-h: 62px;
  --maxw: 1200px;
}

[data-theme="dark"] {
  --bg: #0b1420;
  --surface: #121f2d;
  --surface-2: #17293a;
  --surface-3: #1f3547;
  --border: #26394c;
  --border-strong: #35506a;

  --text: #e7eef5;
  --text-muted: #a2b3c3;
  --text-faint: #7c8ea0;

  --primary: #2f9be0;
  --primary-hover: #4bb0ef;
  --primary-soft: #12324a;
  --primary-contrast: #05263c;

  --green: #35c07d;
  --green-hover: #52d495;
  --green-soft: #10362a;

  --danger: #f0666b;
  --danger-soft: #3a1c1f;
  --warning: #e0a53a;
  --warning-soft: #352a15;

  --accent-grad: linear-gradient(135deg, #0a4f80 0%, #147a63 55%, #1f9a5c 100%);

  --ring: rgba(47, 155, 224, 0.4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset / 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.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, canvas, video { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.3rem, 1rem + 1vw, 1.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 8px;
  transition: top .2s;
}
.skip-link:focus { top: 12px; }
.muted { color: var(--text-muted); }
.text-center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.18rem; color: var(--text); letter-spacing: -0.02em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--accent-grad); display: grid; place-items: center; color: #fff;
  box-shadow: var(--shadow-sm);
}
.brand-mark svg { width: 19px; height: 19px; }
.nav-spacer { flex: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--text-muted); font-weight: 600; font-size: .95rem;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.theme-toggle .moon { display: none; }
[data-theme="dark"] .theme-toggle .sun { display: none; }
[data-theme="dark"] .theme-toggle .moon { display: block; }

.mobile-menu {
  display: none; border-top: 1px solid var(--border); background: var(--surface);
  padding: 8px 0;
}
.mobile-menu.open { display: block; }
.mobile-menu a {
  display: block; padding: 12px 20px; color: var(--text); font-weight: 600;
}
.mobile-menu a:hover { background: var(--surface-2); text-decoration: none; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text); --btn-bd: var(--border);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1;
  padding: 11px 18px; border-radius: 10px; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd);
  transition: transform .04s ease, background .15s, border-color .15s, box-shadow .15s, opacity .15s;
  user-select: none; text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-primary { --btn-bg: var(--primary); --btn-fg: var(--primary-contrast); --btn-bd: transparent; box-shadow: var(--shadow-sm); }
.btn-primary:hover { --btn-bg: var(--primary-hover); }
.btn-green { --btn-bg: var(--green); --btn-fg: #fff; --btn-bd: transparent; box-shadow: var(--shadow-sm); }
.btn-green:hover { --btn-bg: var(--green-hover); }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-outline { --btn-bg: transparent; }
.btn-outline:hover { --btn-bg: var(--surface-2); --btn-bd: var(--border-strong); }
.btn-danger { --btn-bg: transparent; --btn-fg: var(--danger); --btn-bd: var(--border); }
.btn-danger:hover { --btn-bg: var(--danger-soft); }
.btn-sm { padding: 8px 12px; font-size: .875rem; border-radius: 8px; }
.btn-lg { padding: 14px 24px; font-size: 1.03rem; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { padding: 10px; }
.btn-icon svg { margin: 0; }

.btn-grad {
  --btn-fg: #fff; --btn-bd: transparent; background: var(--accent-grad);
  box-shadow: var(--shadow-md);
}
.btn-grad:hover { filter: brightness(1.06); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.card-pad { padding: clamp(18px, 3vw, 28px); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text); }
.hint { font-size: .82rem; color: var(--text-muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 10px; padding: 11px 13px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 120px; font-family: var(--font); line-height: 1.6; }
.textarea.mono { font-family: var(--mono); font-size: .92rem; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23566573' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input.error, .textarea.error, .select.error { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 5px; display: flex; gap: 6px; align-items: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row.middle { align-items: center; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* checkbox / radio */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-weight: 500; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: none; }
.check.disabled { opacity: .5; cursor: not-allowed; }

/* range */
input[type="range"] {
  width: 100%; accent-color: var(--primary); height: 26px; cursor: pointer;
}

/* switch */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: .2s; cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px var(--ring); }

/* segmented control / tabs */
.tabs { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.tab {
  border: none; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600;
  padding: 8px 15px; border-radius: 8px; cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm); }

/* ---------- Badges / pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 650;
  padding: 3px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.badge.cat { color: var(--primary); background: var(--primary-soft); border-color: transparent; }
.badge.green { color: var(--green); background: var(--green-soft); border-color: transparent; }
.badge.warn { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.badge.danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: var(--surface-2); padding: 32px 20px; text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s; color: var(--text-muted);
}
.dropzone:hover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); color: var(--text); transform: scale(1.005); }
.dropzone:focus-visible { border-color: var(--primary); }
.dropzone .dz-icon { width: 46px; height: 46px; margin: 0 auto 10px; color: var(--primary); }
.dropzone .dz-title { font-weight: 700; color: var(--text); font-size: 1.05rem; }
.dropzone .dz-sub { font-size: .88rem; margin-top: 4px; }
.dropzone .dz-browse { color: var(--primary); font-weight: 700; text-decoration: underline; }

.filelist { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fileitem {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.fileitem .fi-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: none; }
.fileitem .fi-icon svg { width: 18px; height: 18px; }
.fileitem .fi-main { flex: 1; min-width: 0; }
.fileitem .fi-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileitem .fi-meta { font-size: .8rem; color: var(--text-muted); }
.fileitem .fi-thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); flex: none; }
.fileitem .drag-handle { cursor: grab; color: var(--text-faint); touch-action: none; }
.fileitem.dragging { opacity: .5; }

/* ---------- Result / output blocks ---------- */
.result {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-top: 4px;
}
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat .stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stat .stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; margin-top: 2px; word-break: break-word; }
.stat.primary { background: var(--primary-soft); border-color: transparent; }
.stat.primary .stat-value { color: var(--primary); }
.stat.green { background: var(--green-soft); border-color: transparent; }
.stat.green .stat-value { color: var(--green); }

.output {
  font-family: var(--mono); font-size: .9rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px;
  white-space: pre-wrap; word-break: break-word; overflow: auto; max-height: 460px; color: var(--text);
}
.output.code { white-space: pre; }

.copy-wrap { position: relative; }
.copy-wrap .copy-btn { position: absolute; top: 8px; right: 8px; }

/* ---------- Toast ---------- */
.toast-region {
  position: fixed; z-index: 300; bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 32px));
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--primary);
  border-radius: 12px; box-shadow: var(--shadow-lg); animation: toast-in .22s ease;
  color: var(--text);
}
.toast.success { border-left-color: var(--green); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.toast .toast-ic { flex: none; margin-top: 1px; }
.toast.success .toast-ic { color: var(--green); }
.toast.error .toast-ic { color: var(--danger); }
.toast.warn .toast-ic { color: var(--warning); }
.toast .toast-ic svg { width: 20px; height: 20px; }
.toast .toast-body { font-size: .9rem; flex: 1; }
.toast .toast-title { font-weight: 700; }
.toast.leaving { animation: toast-out .2s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

/* ---------- Spinner / loading ---------- */
.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--border-strong);
  border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block;
}
.spinner.lg { width: 34px; height: 34px; border-width: 3.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing { display: inline-flex; align-items: center; gap: 10px; color: var(--text-muted); font-weight: 600; }

/* ---------- Empty state ---------- */
.empty {
  text-align: center; padding: 34px 18px; color: var(--text-muted);
}
.empty svg { width: 42px; height: 42px; margin: 0 auto 10px; color: var(--text-faint); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 10px 13px; text-align: left; border-bottom: 1px solid var(--border); }
table.data th { background: var(--surface-2); font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-muted); position: sticky; top: 0; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }

/* ---------- Hero (homepage) ---------- */
.hero { padding: clamp(40px, 7vw, 76px) 0 clamp(28px, 4vw, 40px); text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700;
  color: var(--green); background: var(--green-soft); padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero h1 { max-width: 20ch; margin-inline: auto; }
.hero .lede { font-size: clamp(1rem, .95rem + .4vw, 1.18rem); color: var(--text-muted); max-width: 60ch; margin: 10px auto 26px; }
.hero .grad-text { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.searchbar { max-width: 620px; margin: 0 auto; position: relative; }
.searchbar input {
  width: 100%; font-size: 1.05rem; padding: 16px 18px 16px 50px; border-radius: 14px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-md);
}
.searchbar input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring), var(--shadow-md); }
.searchbar .search-ic { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.searchbar .search-ic svg { width: 21px; height: 21px; }
.searchbar .clear-search { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

.hero-stats { display: flex; gap: 26px; justify-content: center; flex-wrap: wrap; margin-top: 26px; color: var(--text-muted); font-size: .9rem; }
.hero-stats b { color: var(--text); font-size: 1.05rem; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin: 30px 0 26px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font: inherit; font-weight: 600; font-size: .9rem; padding: 8px 15px; border-radius: 999px; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 7px;
}
.chip:hover { border-color: var(--primary); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--primary); color: #fff; border-color: transparent; }
.chip .chip-count { font-size: .78rem; opacity: .8; }

/* ---------- Tool card grid ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.tool-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; transition: transform .12s ease, box-shadow .15s, border-color .15s;
  color: var(--text); overflow: hidden;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); text-decoration: none; }
.tool-card:focus-within { border-color: var(--primary); }
.tool-card .tc-top { display: flex; align-items: center; justify-content: space-between; }
.tool-card .tc-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  color: #fff; box-shadow: var(--shadow-sm);
}
.tool-card .tc-icon svg { width: 23px; height: 23px; }
.tool-card h3 { margin: 0; font-size: 1.06rem; }
.tool-card h3 a { color: var(--text); }
.tool-card h3 a::after { content: ""; position: absolute; inset: 0; }
.tool-card h3 a:hover { text-decoration: none; }
.tool-card p { margin: 0; color: var(--text-muted); font-size: .9rem; }
.tool-card .tc-cat { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.fav-btn {
  position: relative; z-index: 2; border: none; background: transparent; cursor: pointer;
  color: var(--text-faint); padding: 4px; border-radius: 8px; line-height: 0;
}
.fav-btn:hover { color: var(--warning); background: var(--surface-2); }
.fav-btn.active { color: var(--warning); }
.fav-btn svg { width: 20px; height: 20px; }

/* category accent colors (icon backgrounds) */
.cat-pdf     { background: linear-gradient(135deg,#e2483d,#b5231a); }
.cat-image   { background: linear-gradient(135deg,#2aa568,#187a45); }
.cat-calc    { background: linear-gradient(135deg,#0a74c0,#035d9b); }
.cat-text    { background: linear-gradient(135deg,#7a5cf0,#5b3fd6); }
.cat-dev     { background: linear-gradient(135deg,#12333f,#0c2530); }
.cat-student { background: linear-gradient(135deg,#e08a1e,#c26a08); }
.cat-seo     { background: linear-gradient(135deg,#12897a,#0c6b5f); }
.cat-utility { background: linear-gradient(135deg,#546274,#3b4756); }
[data-theme="dark"] .cat-dev { background: linear-gradient(135deg,#2b5566,#1c3d4b); }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 34px 0 14px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.no-results { text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* ---------- Tool page ---------- */
.breadcrumb { font-size: .85rem; color: var(--text-muted); padding: 18px 0 4px; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb li:not(:last-child)::after { content: "/"; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; }

.tool-hero { padding: 8px 0 22px; display: flex; gap: 16px; align-items: flex-start; }
.tool-hero .th-icon { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: var(--shadow-sm); }
.tool-hero .th-icon svg { width: 28px; height: 28px; }
.tool-hero h1 { margin: 0 0 4px; }
.tool-hero .th-desc { color: var(--text-muted); margin: 0; max-width: 70ch; }

.tool-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 26px; align-items: start; padding-bottom: 40px; }
.tool-main { min-width: 0; }
.tool-side { position: sticky; top: calc(var(--header-h) + 16px); display: flex; flex-direction: column; gap: 18px; }

.content-section { margin-top: 30px; }
.content-section h2 { display: flex; align-items: center; gap: 9px; }
.content-section h2 svg { width: 20px; height: 20px; color: var(--primary); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list li svg { width: 19px; height: 19px; color: var(--green); flex: none; margin-top: 2px; }
.howto-list { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.howto-list li { display: flex; gap: 12px; align-items: flex-start; }
.howto-list li::before {
  counter-increment: step; content: counter(step);
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  font-weight: 800; font-size: .9rem; display: grid; place-items: center; flex: none;
}

.privacy-note {
  display: flex; gap: 12px; align-items: flex-start; padding: 15px 17px;
  background: var(--green-soft); border: 1px solid transparent; border-radius: var(--radius); color: var(--text);
}
.privacy-note svg { width: 22px; height: 22px; color: var(--green); flex: none; margin-top: 1px; }
.privacy-note strong { color: var(--green); }

/* FAQ accordion */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 15px 17px; font-weight: 650; list-style: none; display: flex;
  align-items: center; justify-content: space-between; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); transition: transform .2s; flex: none; }
.faq details[open] summary::after { transform: rotate(-135deg); }
.faq .faq-body { padding: 0 17px 16px; color: var(--text-muted); }

/* related tools (sidebar) */
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.side-card h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px; }
.related-list { display: flex; flex-direction: column; gap: 6px; }
.related-item { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 10px; color: var(--text); }
.related-item:hover { background: var(--surface-2); text-decoration: none; }
.related-item .ri-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: #fff; flex: none; }
.related-item .ri-icon svg { width: 18px; height: 18px; }
.related-item .ri-name { font-weight: 600; font-size: .9rem; }
.related-item .ri-cat { font-size: .76rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 30px; padding: 40px 0 30px; }
.footer-grid h4 { font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: 12px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer-grid a { color: var(--text-muted); font-size: .92rem; }
.footer-grid a:hover { color: var(--primary); }
.footer-brand p { color: var(--text-muted); font-size: .92rem; max-width: 34ch; margin-top: 10px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-muted); font-size: .86rem; }

/* ---------- Misc utilities ---------- */
.divider-or { display: flex; align-items: center; gap: 12px; color: var(--text-faint); font-size: .85rem; margin: 14px 0; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.kbd { display: inline-block; padding: 2px 7px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface-2); font-family: var(--mono); font-size: .82rem; }
.color-swatch { width: 100%; height: 120px; border-radius: var(--radius); border: 1px solid var(--border); }
.mono-inline { font-family: var(--mono); background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.tag-remove { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
