[hidden] { display: none !important; }
/* Toolzed design system */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f0f1f5;
  --ink: #15161a; --ink-2: #565b66; --ink-3: #9aa0ab;
  --line: #e7e8ec; --accent: #4f46e5; --accent-ink: #ffffff;
  --accent-soft: #eef0fe; --accent-2: #0ea5e9;
  --ok: #059669; --warn: #b45309; --err: #dc2626;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16,17,20,.05), 0 8px 24px -12px rgba(16,17,20,.12);
  --shadow-lg: 0 2px 4px rgba(16,17,20,.06), 0 24px 48px -16px rgba(16,17,20,.18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0f1115; --surface: #171a21; --surface-2: #1f232c;
  --ink: #f2f3f6; --ink-2: #a6acb8; --ink-3: #6b7280;
  --line: #272c37; --accent: #818cf8; --accent-ink: #12131a;
  --accent-soft: #22263a; --accent-2: #38bdf8;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.4), 0 24px 48px -16px rgba(0,0,0,.6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
img, svg, canvas { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 19px; color: var(--ink); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; flex: none; }
.brand .mark svg { width: 17px; height: 17px; }
.site-nav { display: flex; gap: 4px; margin-left: 8px; }
.site-nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 550; padding: 7px 11px; border-radius: 8px; }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.header-spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); }
.icon-btn svg { width: 17px; height: 17px; }
[data-theme="dark"] .sun-icon { display: block; } [data-theme="dark"] .moon-icon { display: none; }
.sun-icon { display: none; } .moon-icon { display: block; }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: -.03em; margin: 0 0 14px; font-weight: 800; }
.hero h1 .grad { background: linear-gradient(120deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.sub { color: var(--ink-2); font-size: 17px; max-width: 560px; margin: 0 auto 28px; }
.search-wrap { max-width: 560px; margin: 0 auto; position: relative; }
.search-wrap svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-3); pointer-events: none; }
.search-input { width: 100%; padding: 15px 18px 15px 46px; font-size: 16px; border: 1px solid var(--line);
  border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); outline: none; }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.hero-trust { margin-top: 18px; font-size: 13.5px; color: var(--ink-3); display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.hero-trust svg { width: 14px; height: 14px; color: var(--ok); }

/* Sections */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; letter-spacing: -.02em; margin: 0; font-weight: 750; }
.section-head a { font-size: 14px; font-weight: 550; }

/* Tool grid + cards */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tool-card { display: flex; gap: 13px; padding: 17px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--ink); transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.tool-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.tool-card .icon { width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.tool-card .icon svg { width: 21px; height: 21px; }
.tool-card h3 { margin: 1px 0 3px; font-size: 15.5px; font-weight: 700; letter-spacing: -.01em; }
.tool-card p { margin: 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }

/* Category chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); font-size: 13.5px; font-weight: 550; cursor: pointer; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.no-results { text-align: center; color: var(--ink-2); padding: 40px 0; }

/* Breadcrumbs */
.crumbs { font-size: 13.5px; color: var(--ink-3); padding: 18px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--ink-2); }
.crumbs .sep { opacity: .6; }
.crumbs [aria-current] { color: var(--ink); font-weight: 550; }

/* Tool page */
.tool-head { padding: 26px 0 22px; }
.tool-head .icon { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; margin-bottom: 14px; }
.tool-head .icon svg { width: 26px; height: 26px; }
.tool-head h1 { margin: 0 0 8px; font-size: clamp(26px, 4vw, 34px); letter-spacing: -.025em; font-weight: 800; }
.tool-head .lede { color: var(--ink-2); font-size: 16.5px; max-width: 640px; margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 26px; }
.privacy-note { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2);
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 26px; }
.privacy-note svg { width: 15px; height: 15px; color: var(--ok); flex: none; }

/* Forms */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13.5px; font-weight: 650; margin-bottom: 6px; color: var(--ink); }
.field .hint { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
input[type="text"], input[type="number"], input[type="date"], input[type="url"], input[type="password"], select, textarea {
  width: 100%; padding: 11px 13px; font-size: 15px; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
textarea { resize: vertical; min-height: 140px; font-family: var(--mono); font-size: 13.5px; line-height: 1.55; }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 14px; }
.range-row output { font-weight: 700; min-width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: var(--radius-sm);
  font-size: 14.5px; font-weight: 650; border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: filter .12s ease, transform .12s ease; }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Results */
.result-box { background: var(--surface-2); border-radius: var(--radius-sm); padding: 18px; margin-top: 18px; }
.result-box .big { font-size: clamp(24px, 4vw, 34px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.result-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 13px 15px; }
.result-item .k { font-size: 12px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.result-item .v { font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; word-break: break-word; }
.stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 10px; margin-top: 16px; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; text-align: center; }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11.5px; color: var(--ink-2); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; margin-top: 1px; }
.error-msg { color: var(--err); background: color-mix(in srgb, var(--err) 8%, transparent); border-radius: var(--radius-sm);
  padding: 11px 14px; font-size: 14px; margin-top: 14px; display: none; }
.error-msg.show { display: block; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.meter > div { height: 100%; border-radius: 99px; transition: width .25s ease, background .25s ease; }

/* Tables */
.table-wrap { overflow-x: auto; margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table.data { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { background: var(--surface-2); font-weight: 650; position: sticky; top: 0; }
table.data tbody tr:hover { background: var(--surface-2); }

/* Dropzone */
.dropzone { border: 2px dashed var(--line); border-radius: var(--radius); padding: 38px 20px; text-align: center;
  color: var(--ink-2); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
.dropzone svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 10px; }
.file-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 11px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 13px; font-size: 14px; }
.file-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-item .size { color: var(--ink-3); font-size: 12.5px; }
.file-item button { border: none; background: none; color: var(--ink-3); cursor: pointer; font-size: 16px; padding: 2px 6px; }
.file-item button:hover { color: var(--err); }
.file-item .mv { color: var(--ink-3); cursor: grab; }

/* Content sections on tool pages */
.prose { max-width: 720px; }
.prose h2 { font-size: 21px; letter-spacing: -.02em; margin: 34px 0 10px; font-weight: 750; }
.prose h3 { font-size: 16.5px; margin: 22px 0 6px; font-weight: 700; }
.prose p, .prose li { color: var(--ink-2); font-size: 15px; }
.prose ul { padding-left: 20px; }
details.faq { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); margin-bottom: 10px; }
details.faq summary { padding: 14px 16px; font-weight: 650; font-size: 14.5px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.faq summary::after { content: "+"; font-size: 18px; color: var(--ink-3); font-weight: 400; }
details.faq[open] summary::after { content: "–"; }
details.faq .body { padding: 0 16px 14px; color: var(--ink-2); font-size: 14.5px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 60px; padding: 44px 0 30px; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer-grid h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 0 0 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--ink-2); font-size: 14px; }
.footer-about p { color: var(--ink-2); font-size: 14px; max-width: 300px; margin: 10px 0 0; }
.footer-bottom { margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px); background: var(--ink); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; opacity: 0; transition: all .25s ease; z-index: 100; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* QR */
.qr-preview { display: grid; place-items: center; padding: 20px; background: #fff; border-radius: var(--radius-sm); border: 1px solid var(--line); margin-top: 16px; }
.qr-preview svg, .qr-preview canvas { max-width: 240px; height: auto; }

/* JSON tree */
.json-out { font-family: var(--mono); font-size: 13px; background: var(--surface-2); border-radius: var(--radius-sm); padding: 16px; overflow: auto; max-height: 480px; margin-top: 14px; white-space: pre; }
.json-out .k { color: var(--accent); } .json-out .s { color: #059669; } .json-out .n { color: #d97706; } .json-out .b { color: #dc2626; }

/* Canvas charts */
.chart-box { margin-top: 18px; }
canvas.chart { width: 100%; height: 260px; }

/* Responsive */
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 48px 0 30px; }
  .panel { padding: 18px; }
  .site-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } html { scroll-behavior: auto; } }
