/* ==========================================================================
   CrispUtils design system
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --navy-900: #071a2e;
  --navy-800: #0c243c;
  --navy-700: #123253;
  --navy-600: #1b456e;

  --bg: #f6f8fa;
  --bg-raised: #ffffff;
  --bg-sunken: #eef1f5;
  --bg-inset: #f9fafb;

  --text: #16202c;
  --text-muted: #566577;
  --text-faint: #7b8795;

  --line: #dfe4ea;
  --line-strong: #c6cedb;

  --accent: #1b456e;
  --accent-hover: #123253;
  --accent-soft: #e8eff6;
  --accent-text: #123253;

  --ok: #0f7a4d;
  --ok-soft: #e6f5ee;
  --warn: #9a5b00;
  --warn-soft: #fdf3e2;
  --danger: #b3261e;
  --danger-soft: #fdecea;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow-sm: 0 1px 2px rgba(16, 27, 40, .06), 0 1px 3px rgba(16, 27, 40, .04);
  --shadow: 0 2px 4px rgba(16, 27, 40, .05), 0 6px 18px rgba(16, 27, 40, .07);
  --shadow-lg: 0 10px 34px rgba(16, 27, 40, .12);

  --container: 1140px;
  --prose: 74ch;
}

:root[data-theme="dark"],
html:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1420;
    --bg-raised: #121e2d;
    --bg-sunken: #0e1826;
    --bg-inset: #162435;

    --text: #e7edf5;
    --text-muted: #9dabbd;
    --text-faint: #7b8a9d;

    --line: #22334a;
    --line-strong: #2f4560;

    --accent: #6ea8dc;
    --accent-hover: #8fbde8;
    --accent-soft: #16273b;
    --accent-text: #9cc6ea;

    --ok: #4ec48b;
    --ok-soft: #10281e;
    --warn: #e0a33e;
    --warn-soft: #2a2113;
    --danger: #f08a80;
    --danger-soft: #2c1613;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
    --shadow-lg: 0 10px 34px rgba(0, 0, 0, .5);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0b1420;
  --bg-raised: #121e2d;
  --bg-sunken: #0e1826;
  --bg-inset: #162435;
  --text: #e7edf5;
  --text-muted: #9dabbd;
  --text-faint: #7b8a9d;
  --line: #22334a;
  --line-strong: #2f4560;
  --accent: #6ea8dc;
  --accent-hover: #8fbde8;
  --accent-soft: #16273b;
  --accent-text: #9cc6ea;
  --ok: #4ec48b;
  --ok-soft: #10281e;
  --warn: #e0a33e;
  --warn-soft: #2a2113;
  --danger: #f08a80;
  --danger-soft: #2c1613;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 10px 34px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img, svg, canvas, video { max-width: 100%; height: auto; }
[hidden] { display: none !important; }

a { color: var(--accent-text); text-decoration-color: color-mix(in srgb, var(--accent-text) 35%, transparent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.015em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 1.35rem + 1.7vw, 2.5rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.3rem, 1.15rem + .6vw, 1.6rem); margin-top: 2.25em; }
h3 { font-size: 1.1rem; margin-top: 1.75em; }
p { margin: 0 0 1em; }

code, kbd, pre { font-family: var(--font-mono); font-size: .9em; }
code { background: var(--bg-sunken); padding: .12em .38em; border-radius: 4px; border: 1px solid var(--line); }
pre { background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }

kbd {
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-bottom-width: 2px;
  border-radius: 5px; padding: .1em .4em; font-size: .78em; color: var(--text-muted);
}

hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.container { width: 100%; max-width: var(--container); 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(--accent);
  color: #fff; padding: 10px 16px; border-radius: var(--radius-sm); transition: top .15s;
}
.skip-link:focus { top: calc(12px + env(safe-area-inset-top, 0px)); color: #fff; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.header-inner { display: flex; align-items: center; gap: 16px; height: 62px; }

.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; font-size: 1.06rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; flex: none; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 28px; height: 28px; border-radius: 7px; flex: none;
  background: linear-gradient(145deg, var(--navy-600), var(--navy-800));
  display: grid; place-items: center; color: #fff; font-size: 15px; font-weight: 800;
}
.brand-mark svg { width: 17px; height: 17px; }
.brand em { font-style: normal; color: var(--text-muted); font-weight: 600; }

.main-nav { display: flex; align-items: center; gap: 2px; margin-left: 8px; }
.main-nav a {
  padding: 7px 11px; border-radius: var(--radius-sm); color: var(--text-muted);
  font-size: .925rem; font-weight: 550; text-decoration: none; white-space: nowrap;
}
.main-nav a:hover { background: var(--bg-sunken); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--bg-sunken); }

.header-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.search-trigger {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 11px;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text-faint); font-size: .875rem; font-family: inherit; cursor: pointer; min-width: 190px;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--text-muted); }
.search-trigger svg { width: 15px; height: 15px; flex: none; }
.search-trigger kbd { margin-left: auto; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--text-muted);
}
.icon-btn:hover { background: var(--bg-sunken); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

.lang-switch { position: relative; }
.lang-switch > button { display: flex; align-items: center; gap: 5px; width: auto; padding: 0 9px; font-family: inherit; font-size: .875rem; font-weight: 550; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 168px; padding: 5px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 110;
}
.lang-menu a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: .9rem; color: var(--text); text-decoration: none;
}
.lang-menu a:hover { background: var(--bg-sunken); }
.lang-menu a[aria-current="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.lang-menu span { color: var(--text-faint); font-size: .8rem; text-transform: uppercase; }

.nav-toggle { display: none; }

@media (max-width: 900px) {
  .main-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0; padding: 8px;
    background: var(--bg-raised); border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 11px 12px; font-size: 1rem; }
  .nav-toggle { display: grid; }
  .search-trigger { min-width: 0; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .search-trigger { width: 36px; justify-content: center; padding: 0; }
}

/* ---------- Search dialog ---------- */

.search-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(9, 18, 30, .45);
  backdrop-filter: blur(3px); display: grid; align-items: start; justify-items: center;
  padding: clamp(16px, 9vh, 90px) 16px 16px;
}
.search-panel {
  width: min(600px, 100%); background: var(--bg-raised); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
}
.search-panel input {
  width: 100%; border: 0; border-bottom: 1px solid var(--line); background: none;
  padding: 16px 18px; font-size: 1.02rem; font-family: inherit; color: var(--text);
}
.search-panel input:focus { outline: none; }
.search-results { max-height: min(56vh, 420px); overflow-y: auto; padding: 6px; }
.search-results a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm); text-decoration: none; color: var(--text);
}
.search-results a:hover, .search-results a.is-active { background: var(--bg-sunken); }
.search-results strong { display: block; font-size: .94rem; font-weight: 600; }
.search-results small { color: var(--text-faint); font-size: .82rem; }
.search-empty { padding: 22px 18px; color: var(--text-faint); font-size: .92rem; text-align: center; }

/* ---------- Breadcrumbs ---------- */

.breadcrumbs { padding: 14px 0 0; font-size: .84rem; color: var(--text-faint); }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumbs a { color: var(--text-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent-text); text-decoration: underline; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--line-strong); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* ---------- Page layout ---------- */

.page { padding-bottom: 72px; }
.page-head { padding: 16px 0 4px; max-width: var(--prose); }
.page-head h1 { margin-bottom: .3em; font-size: clamp(1.6rem, 1.3rem + 1.15vw, 2.15rem); }
.lede { font-size: 1.05rem; color: var(--text-muted); margin-bottom: .9em; line-height: 1.55; }

.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; align-items: start; }
@media (min-width: 1060px) {
  .tool-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; }
  .tool-aside { position: sticky; top: 86px; }
}

/* ---------- Trust chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 18px; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px 4px 8px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: 100px;
  font-size: .8rem; font-weight: 550; color: var(--text-muted);
}
.chip svg { width: 13px; height: 13px; color: var(--ok); flex: none; }

/* ---------- Tool card ---------- */

.tool-card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); overflow: hidden;
}
.tool-card-body { padding: clamp(16px, 3vw, 26px); }
.tool-card-foot {
  padding: 12px clamp(16px, 3vw, 26px); border-top: 1px solid var(--line);
  background: var(--bg-inset); font-size: .84rem; color: var(--text-faint);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tool-card-foot svg { width: 14px; height: 14px; color: var(--ok); flex: none; }

.field { margin-bottom: 15px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field-label {
  display: block; font-size: .875rem; font-weight: 600; margin-bottom: 6px; color: var(--text);
}
.field-hint { font-size: .81rem; color: var(--text-faint); margin-top: 5px; }

.grid-2 { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid-3 { display: grid; gap: 15px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

input[type="text"], input[type="number"], input[type="url"], input[type="email"],
input[type="datetime-local"], input[type="password"], select, textarea {
  width: 100%; padding: 9px 11px; font-family: inherit; font-size: .95rem; color: var(--text);
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
textarea { resize: vertical; min-height: 96px; font-family: var(--font-mono); font-size: .86rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23788' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M4 6.5l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 15px; padding-right: 30px;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
input[type="color"] { width: 100%; height: 38px; padding: 3px; cursor: pointer; }

.check { display: flex; align-items: flex-start; gap: 9px; font-size: .9rem; cursor: pointer; padding: 3px 0; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 17px; font-family: inherit; font-size: .925rem; font-weight: 600; line-height: 1.35;
  border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none;
  background: var(--accent); color: #fff; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-secondary { background: var(--bg-raised); color: var(--text); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--bg-sunken); color: var(--text); border-color: var(--text-faint); }
.btn-ghost { background: transparent; color: var(--text-muted); border-color: transparent; padding: 7px 10px; }
.btn-ghost:hover { background: var(--bg-sunken); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }
.btn-sm { padding: 6px 12px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }

/* Segmented control / tabs inside tools */
.segmented {
  display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-sunken);
  border: 1px solid var(--line); border-radius: var(--radius-sm); flex-wrap: wrap;
}
.segmented button {
  padding: 6px 13px; border: 0; border-radius: 5px; background: none; cursor: pointer;
  font-family: inherit; font-size: .875rem; font-weight: 550; color: var(--text-muted);
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-selected="true"] { background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow-sm); }

/* Dropzone */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: var(--bg-inset);
  padding: 34px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone svg { width: 30px; height: 30px; color: var(--text-faint); margin-bottom: 9px; }
.dropzone strong { display: block; font-size: .98rem; font-weight: 600; margin-bottom: 4px; }
.dropzone small { color: var(--text-faint); font-size: .84rem; }
.dropzone input[type="file"] { display: none; }

/* Output areas */
.output {
  background: var(--bg-inset); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-top: 16px;
}
.output-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin-bottom: 7px; }
.output pre { margin: 0; background: none; border: 0; padding: 0; }
.result-value { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 600; word-break: break-all; }
.result-big { font-size: clamp(1.4rem, 1.2rem + 1vw, 2rem); font-weight: 750; letter-spacing: -.02em; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .9rem; margin: 0; }
.kv dt { color: var(--text-muted); font-weight: 550; }
.kv dd { margin: 0; font-family: var(--font-mono); font-size: .86rem; word-break: break-all; }

.note { border-radius: var(--radius); padding: 11px 14px; font-size: .88rem; margin: 14px 0 0; border: 1px solid; }
.note-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: color-mix(in srgb, var(--ok) 80%, var(--text)); }
.note-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.note-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: color-mix(in srgb, var(--danger) 80%, var(--text)); }
.note-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 28%, transparent); color: var(--accent-text); }
.note strong { font-weight: 700; }

.canvas-stage {
  background:
    linear-gradient(45deg, var(--bg-sunken) 25%, transparent 25%, transparent 75%, var(--bg-sunken) 75%) 0 0/18px 18px,
    linear-gradient(45deg, var(--bg-sunken) 25%, transparent 25%, transparent 75%, var(--bg-sunken) 75%) 9px 9px/18px 18px,
    var(--bg-inset);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  display: grid; place-items: center; overflow: auto; max-height: 68vh;
}
.canvas-stage canvas { max-width: 100%; box-shadow: var(--shadow); border-radius: 3px; display: block; }

.page-strip { display: flex; gap: 9px; overflow-x: auto; padding: 4px 2px 10px; }
.page-thumb {
  flex: none; width: 74px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--bg-raised); padding: 3px; cursor: pointer; position: relative;
}
.page-thumb[aria-selected="true"] { border-color: var(--accent); }
.page-thumb canvas, .page-thumb img { width: 100%; display: block; border-radius: 3px; }
.page-thumb span {
  position: absolute; bottom: 5px; right: 5px; background: rgba(9,18,30,.75); color: #fff;
  font-size: .68rem; padding: 1px 5px; border-radius: 3px; line-height: 1.5;
}

.spinner {
  width: 17px; height: 17px; border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.busy { display: flex; align-items: center; gap: 9px; font-size: .9rem; color: var(--text-muted); margin-top: 14px; }

/* ---------- Prose ---------- */

.prose { max-width: var(--prose); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--text-faint); }
.prose ol.steps { list-style: none; padding-left: 0; counter-reset: step; }
.prose ol.steps > li {
  counter-increment: step; position: relative; padding-left: 40px; margin-bottom: .85em;
}
.prose ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text); font-size: .82rem; font-weight: 700;
}
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 0 0 1.25em; }
.prose th, .prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 650; background: var(--bg-sunken); font-size: .84rem; }
.table-scroll { overflow-x: auto; margin: 0 0 1.25em; }
.table-scroll table { margin: 0; }

.example-box {
  background: var(--bg-raised); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); padding: 15px 18px; margin: 0 0 1.1em;
}
.example-box h3 { margin: 0 0 .4em; font-size: .97rem; }
.example-box p:last-child { margin-bottom: 0; }

.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer; padding: 14px 32px 14px 0; font-weight: 600; font-size: 1rem;
  list-style: none; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: translateY(-65%) rotate(45deg); transition: transform .18s;
}
.faq-item[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq-item .faq-body { padding: 0 0 16px; color: var(--text-muted); }
.faq-item .faq-body p:last-child { margin-bottom: 0; }

.updated { font-size: .84rem; color: var(--text-faint); margin-top: 2.5rem; padding-top: 1.1rem; border-top: 1px solid var(--line); }

/* ---------- Tool cards / grids ---------- */

.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); }
.tool-tile {
  display: flex; flex-direction: column; gap: 5px; padding: 16px 17px;
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--text); transition: border-color .14s, box-shadow .14s, transform .14s;
}
.tool-tile:hover { border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); color: var(--text); }
.tool-tile .tile-top { display: flex; align-items: center; gap: 9px; }
.tool-tile .tile-icon {
  width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.tool-tile .tile-icon svg { width: 16px; height: 16px; }
.tool-tile strong { font-size: .97rem; font-weight: 650; letter-spacing: -.01em; }
.tool-tile p { margin: 0; font-size: .875rem; color: var(--text-muted); line-height: 1.5; }
.tool-tile .tile-tag {
  margin-top: auto; padding-top: 9px; font-size: .74rem; font-weight: 650;
  text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint);
}

.badge-new {
  display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 100px; vertical-align: 2px;
  background: var(--ok-soft); color: var(--ok); font-size: .66rem; font-weight: 750;
  text-transform: uppercase; letter-spacing: .05em;
}

/* Category tabs */
.cat-tabs {
  display: flex; gap: 4px; overflow-x: auto; padding: 4px; margin: 0 0 22px;
  background: var(--bg-sunken); border: 1px solid var(--line); border-radius: var(--radius);
  scrollbar-width: thin;
}
.cat-tabs button {
  flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 8px 15px;
  border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer;
  font-family: inherit; font-size: .9rem; font-weight: 600; color: var(--text-muted); white-space: nowrap;
}
.cat-tabs button:hover { color: var(--text); }
.cat-tabs button[aria-selected="true"] { background: var(--bg-raised); color: var(--text); box-shadow: var(--shadow-sm); }
.cat-tabs .count {
  font-size: .74rem; font-weight: 700; padding: 0 6px; border-radius: 100px;
  background: var(--bg-sunken); color: var(--text-faint); line-height: 1.7;
}
.cat-tabs button[aria-selected="true"] .count { background: var(--accent-soft); color: var(--accent-text); }

.cat-section { margin-bottom: 40px; }
.cat-section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-section-head h2 { margin: 0; font-size: 1.22rem; }
.cat-section-head p { margin: 0; font-size: .9rem; color: var(--text-muted); }

/* ---------- Aside / related ---------- */

.aside-card {
  background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 17px; margin-bottom: 16px;
}
.aside-card h2, .aside-card h3 { margin: 0 0 11px; font-size: .95rem; }
.aside-list { list-style: none; margin: 0; padding: 0; }
.aside-list li { border-top: 1px solid var(--line); }
.aside-list li:first-child { border-top: 0; }
.aside-list a { display: block; padding: 9px 0; font-size: .9rem; text-decoration: none; color: var(--text); }
.aside-list a:hover { color: var(--accent-text); }
.aside-list small { display: block; color: var(--text-faint); font-size: .8rem; line-height: 1.45; }

.toc { list-style: none; margin: 0; padding: 0; font-size: .89rem; }
.toc a { display: block; padding: 5px 0 5px 11px; border-left: 2px solid var(--line); color: var(--text-muted); text-decoration: none; }
.toc a:hover { border-left-color: var(--accent); color: var(--text); }

/* ---------- Ad slots ---------- */

.ad-slot { margin: 26px 0; display: grid; place-items: center; min-height: 90px; }
.ad-slot[data-format="rect"] { min-height: 250px; }
.ad-slot::before {
  content: attr(data-label); font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-faint); opacity: .55;
}
.ad-slot > * { grid-area: 1 / 1; }
.ad-slot ins { width: 100%; }

/* ---------- Home ---------- */

.hero { padding: 46px 0 30px; }
.hero-inner { max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 1.5rem + 2.3vw, 3rem); margin-bottom: .3em; }
.hero p { font-size: clamp(1.02rem, .97rem + .3vw, 1.18rem); color: var(--text-muted); margin-bottom: 1.4em; }
.hero .btn-row { margin-top: 0; }

.value-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 6px 0 44px; }
.value-item { display: flex; gap: 12px; align-items: flex-start; }
.value-item .v-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-text);
}
.value-item .v-icon svg { width: 18px; height: 18px; }
.value-item h3 { margin: 0 0 3px; font-size: .97rem; }
.value-item p { margin: 0; font-size: .89rem; color: var(--text-muted); line-height: 1.55; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line); background: var(--bg-raised);
  padding: 44px 0 30px; margin-top: 40px;
  padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
}
.footer-grid { display: grid; gap: 30px 24px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.5fr repeat(5, minmax(0, 1fr)); } }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 1000px) { .footer-brand { grid-column: auto; } }
.footer-brand p { font-size: .88rem; color: var(--text-muted); margin: 10px 0 0; max-width: 34ch; }
.footer-col h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); margin: 0 0 11px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 7px; }
.footer-col a { font-size: .89rem; color: var(--text-muted); text-decoration: none; }
.footer-col a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-bottom {
  margin-top: 34px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 12px 22px; align-items: center;
  font-size: .82rem; color: var(--text-faint);
}
.footer-bottom p { margin: 0; }
.footer-disclaimer { max-width: 80ch; line-height: 1.6; }

/* ---------- Print ---------- */
@media print {
  .site-header, .site-footer, .ad-slot, .tool-aside, .btn-row, .breadcrumbs { display: none !important; }
  body { background: #fff; color: #000; }
}
