/* ==========================================================================
   MediaToolkit design system
   Indigo/violet primary · soft surfaces · light & dark themes
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef2ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

  --bg: #f7f8fc;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;

  --red: #ef4444;
  --amber: #f59e0b;
  --blue: #3b82f6;
  --green: #10b981;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 28px -16px rgba(15, 23, 42, .18);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .06), 0 24px 48px -24px rgba(15, 23, 42, .25);
  --ring: 0 0 0 3px rgba(99, 102, 241, .35);

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

[data-theme="dark"] {
  --bg: #0b1220;
  --surface: #121b31;
  --surface-2: #16203a;
  --ink: #e8edf7;
  --ink-2: #c3cddd;
  --muted: #8ea0bd;
  --line: #23304d;
  --primary-soft: #1c2450;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -16px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .45), 0 24px 48px -24px rgba(0, 0, 0, .7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

/* ---------------------------------------------------------------- header -- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  letter-spacing: -.01em;
}
.brand-mark { color: var(--primary); display: inline-flex; }
.brand-name strong { font-weight: 800; color: var(--primary); }

.main-nav { display: flex; gap: 4px; margin-left: 12px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: .92rem;
  transition: background .15s, color .15s;
}
.main-nav a:hover { background: var(--surface-2); color: var(--ink); }
.main-nav a.active { background: var(--primary-soft); color: var(--primary); }

.header-actions { margin-left: auto; display: flex; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  transition: background .15s, transform .1s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 19px; height: 19px; }

.nav-toggle { display: none; }

/* ----------------------------------------------------------------- hero --- */
.hero {
  position: relative;
  padding: 72px 0 34px;
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 480px;
  background:
    radial-gradient(48% 60% at 50% 40%, rgba(99, 102, 241, .18), transparent 70%),
    radial-gradient(40% 55% at 70% 30%, rgba(139, 92, 246, .14), transparent 70%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  margin-bottom: 18px;
}

.hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.3rem);
  line-height: 1.12;
  letter-spacing: -.03em;
  margin: 0 0 14px;
  font-weight: 800;
}
.hero h1 .grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p.lead {
  margin: 0 auto 30px;
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
}

/* search */
.search-wrap { position: relative; max-width: 560px; margin: 0 auto; }
.search-wrap .search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 15px 18px 15px 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring), var(--shadow);
}

/* ------------------------------------------------------------- features --- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 44px 0 6px;
}
.feature {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}
.feature .fi {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
}
.feature .fi svg { width: 19px; height: 19px; }
.feature h3 { margin: 0 0 2px; font-size: .95rem; }
.feature p { margin: 0; color: var(--muted); font-size: .84rem; }

/* ------------------------------------------------------------- sections --- */
.tool-section { padding: 34px 0 6px; }
.tool-section.hidden { display: none; }

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head .chip {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
}
.section-head .chip svg { width: 21px; height: 21px; }
.section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}
.section-head .count {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px 10px;
  border-radius: 999px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

/* ------------------------------------------------------------- tool card -- */
.tool-card {
  position: relative;
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .16s, box-shadow .16s, border-color .16s;
  cursor: pointer;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: color-mix(in srgb, var(--primary) 35%, var(--line));
}
.tool-card.hidden { display: none; }

.tool-card .t-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
}
.tool-card .t-icon svg { width: 22px; height: 22px; }

.tool-card .t-body { min-width: 0; }
.tool-card h3 {
  margin: 1px 0 3px;
  font-size: .98rem;
  letter-spacing: -.01em;
}
.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: .83rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card .t-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
}
.tool-card .t-badge.local { background: #dcfce7; color: #15803d; }
[data-theme="dark"] .tool-card .t-badge.local { background: #143322; color: #4ade80; }

.no-results {
  display: none;
  text-align: center;
  color: var(--muted);
  padding: 60px 0;
  font-size: 1.02rem;
}
.no-results.visible { display: block; }

/* ============================================================ TOOL PAGE === */
.tool-page { padding: 30px 0 70px; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .88rem;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { opacity: .5; }

.tool-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 22px; }
.tool-header .t-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: #fff;
  flex: none;
}
.tool-header .t-icon svg { width: 28px; height: 28px; }
.tool-header h1 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  letter-spacing: -.02em;
}
.tool-header p { margin: 0; color: var(--muted); max-width: 640px; }
.tool-header .meta-row { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.pill {
  font-size: .74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
}
.pill.free { background: #dcfce7; border-color: transparent; color: #15803d; }
[data-theme="dark"] .pill.free { background: #143322; color: #4ade80; }
.pill.credits { background: var(--primary-soft); border-color: transparent; color: var(--primary); }

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* dropzone */
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--primary) 40%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface));
  padding: 42px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.dropzone:hover, .dragover .dropzone, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone .dz-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.dropzone .dz-icon svg { width: 26px; height: 26px; }
.dropzone h3 { margin: 0 0 4px; font-size: 1.05rem; }
.dropzone p { margin: 0; color: var(--muted); font-size: .87rem; }
.dropzone .dz-hint {
  display: inline-block;
  margin-top: 12px;
  font-size: .76rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}
.dropzone input[type="file"] { display: none; }

/* url input */
.url-row { display: flex; gap: 10px; }
.url-row input {
  flex: 1;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .95rem;
}
.url-row input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }

/* file list */
.file-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: .88rem;
}
.file-list .f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-list .f-size { color: var(--muted); font-size: .8rem; flex: none; }
.file-list .f-remove {
  border: none;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 4px;
  border-radius: 6px;
}
.file-list .f-remove:hover { background: rgba(239, 68, 68, .12); color: var(--red); }
.file-list .f-remove svg { width: 15px; height: 15px; }

/* options form */
.options-panel h4 {
  margin: 0 0 14px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.field { margin-bottom: 14px; }
.field.hidden { display: none; }
.field label {
  display: block;
  font-size: .84rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink-2);
}
.field .req { color: var(--red); }
.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font-size: .92rem;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--ring);
}
.field .hint { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.field input[type="range"] { width: 100%; accent-color: var(--primary); }
.field input[type="color"] {
  width: 52px;
  height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}
.field.check { display: flex; align-items: center; gap: 9px; }
.field.check input { width: 17px; height: 17px; accent-color: var(--primary); }
.field.check label { margin: 0; }

/* run button + states */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .95rem;
  padding: 13px 22px;
  transition: transform .1s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  width: 100%;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 8px 20px -10px rgba(99, 102, 241, .8);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 12px 26px -10px rgba(99, 102, 241, .9); }
.btn-ghost {
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--surface); color: var(--primary); }
.btn svg { width: 17px; height: 17px; }

.run-hint { margin: 10px 0 0; font-size: .78rem; color: var(--muted); text-align: center; }

/* progress */
.progress-box { display: none; margin-top: 16px; }
.progress-box.visible { display: block; }
.progress-step {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
}
.progress-step + .progress-step { margin-top: 8px; }
.progress-step.active { color: var(--ink); border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-soft); }
.progress-step.done { color: var(--green); }
.progress-step .step-icon { width: 20px; height: 20px; display: grid; place-items: center; flex: none; }
.progress-step .step-icon svg { width: 17px; height: 17px; }

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2, var(--surface-2));
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--grad);
  transition: width .25s ease;
}
.progress-label { font-size: .78rem; color: var(--muted); margin-top: 5px; }

/* error alert */
.alert {
  display: none;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, #ef4444 10%, var(--surface));
  border: 1px solid color-mix(in srgb, #ef4444 35%, transparent);
  color: #b91c1c;
  font-size: .88rem;
  margin-top: 14px;
}
[data-theme="dark"] .alert { color: #fca5a5; }
.alert.visible { display: flex; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }

/* result */
.result-box { display: none; margin-top: 16px; }
.result-box.visible { display: block; }
.result-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, #10b981 9%, var(--surface));
  border: 1px solid color-mix(in srgb, #10b981 35%, transparent);
}
.result-card .r-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #10b981;
  color: #fff;
  flex: none;
}
.result-card .r-icon svg { width: 22px; height: 22px; }
.result-card .r-body { flex: 1; min-width: 0; }
.result-card .r-title { font-weight: 700; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-card .r-meta { color: var(--muted); font-size: .8rem; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.result-actions .btn { padding: 10px 16px; font-size: .88rem; }

/* ======================================================== LOCAL TOOL UI === */
.local-editor { display: grid; gap: 14px; }
.local-io { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.io-pane {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 340px;
}
.io-pane .io-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.io-pane textarea {
  flex: 1;
  border: none;
  resize: vertical;
  min-height: 280px;
  padding: 14px;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: .85rem;
  line-height: 1.55;
}
.io-pane textarea:focus { outline: none; }
.io-pane .io-actions { display: flex; gap: 6px; }
.io-pane .io-actions button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 7px;
  font-size: .74rem;
  font-weight: 700;
  padding: 4px 9px;
}
.io-pane .io-actions button:hover { background: var(--surface); color: var(--primary); }
.io-error {
  display: none;
  padding: 10px 14px;
  font-size: .84rem;
  color: #b91c1c;
  background: color-mix(in srgb, #ef4444 9%, var(--surface));
  border-top: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
}
[data-theme="dark"] .io-error { color: #fca5a5; }
.io-error.visible { display: block; }

.local-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.local-toolbar .btn { padding: 11px 18px; }
.local-toolbar .spacer { flex: 1; }

/* spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-ghost .spinner { border-color: color-mix(in srgb, var(--primary) 30%, transparent); border-top-color: var(--primary); }

/* ---------------------------------------------------------------- footer -- */
.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 40px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  padding: 42px 0 26px;
}
.footer-brand p {
  color: var(--muted);
  font-size: .87rem;
  max-width: 420px;
  margin: 10px 0 0;
}
.footer-links { display: flex; gap: 60px; }
.footer-links h4 {
  margin: 0 0 10px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}
.footer-links a {
  display: block;
  color: var(--ink-2);
  font-size: .9rem;
  padding: 4px 0;
}
.footer-links a:hover { color: var(--primary); }
.footer-base {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 960px) {
  .tool-layout { grid-template-columns: 1fr; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .local-io { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 10px 20px 16px;
    margin: 0;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 12px; border-radius: 10px; }
  .nav-toggle { display: inline-flex; }

  .hero { padding-top: 52px; }
  .features { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 26px; }
  .footer-links { gap: 40px; }
  .tool-header { flex-direction: column; gap: 12px; }
}

/* --------------------------------------------------------------- prose --- */
.prose {
  max-width: 780px;
  padding: 34px 0 70px;
}
.prose h1 {
  font-size: clamp(1.6rem, 3.4vw, 2.2rem);
  letter-spacing: -.02em;
  margin: 0 0 10px;
}
.prose h2 { font-size: 1.15rem; margin: 30px 0 8px; letter-spacing: -.01em; }
.prose p { color: var(--ink-2); margin: 8px 0; }
.prose p em { color: var(--muted); }
.prose ul { color: var(--ink-2); padding-left: 22px; margin: 8px 0; }
.prose li { margin: 6px 0; }
.prose a { color: var(--primary); font-weight: 600; text-decoration: underline; }

/* -------------------------------------------------------------- consent --- */
.consent-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  max-width: 720px;
  margin-inline: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  display: none;
  gap: 14px;
  align-items: center;
}
.consent-banner.visible { display: flex; }
.consent-banner p { margin: 0; font-size: .85rem; color: var(--ink-2); }
.consent-banner p a { color: var(--primary); font-weight: 700; text-decoration: underline; }
.consent-banner .consent-actions { display: flex; gap: 8px; flex: none; }
.consent-banner .btn { padding: 9px 14px; font-size: .84rem; }
.ad-slot { margin: 18px auto; text-align: center; min-height: 0; }
.ad-slot:empty { display: none; }

/* ============================================================== SEO GUIDE === */
.tool-intro {
  margin: 10px 0 0;
  max-width: 70ch;
  color: var(--ink-2);
  font-size: .98rem;
  line-height: 1.65;
}
.category-page .tool-intro { margin: 6px 0 24px; }
.category-page h1 { margin: 0; }

.tool-guide { margin-top: 34px; display: grid; gap: 30px; }
.guide-block h2 {
  margin: 0 0 14px;
  font-size: 1.22rem;
  letter-spacing: -.01em;
}

.guide-steps {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 11px;
}
.guide-steps li { color: var(--ink-2); line-height: 1.62; padding-left: 4px; }
.guide-steps li::marker { font-weight: 700; color: var(--primary); }

.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.faq-item summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: .96rem;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--primary); font-weight: 700; flex: none; }
.faq-item[open] summary::after { content: '\2013'; }
.faq-item p { margin: 11px 0 0; color: var(--muted); line-height: 1.62; font-size: .94rem; }

.related-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}
.related-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .94rem;
  transition: border-color .16s, transform .16s, box-shadow .16s;
}
.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.related-go { color: var(--primary); }

.category-page .tool-card { flex-direction: column; gap: 7px; text-decoration: none; }
.category-page .tool-card h3 { margin: 0; font-size: 1.02rem; color: var(--ink); }
.category-page .tool-card p { margin: 0; color: var(--muted); font-size: .87rem; line-height: 1.55; }

@media (max-width: 640px) {
  .tool-guide { gap: 26px; }
  .guide-block h2 { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}




