/* ToolHare main stylesheet */

/* Tokens — light (default) */
:root {
  --bg: #FAFAF9;
  --surface: #FFFFFF;
  --surface-2: #F6F6F3;
  --border: #E6E7EB;
  --border-strong: #D7D8DD;
  --accent: #2563EB;
  --accent-strong: #1D4ED8;
  --accent-soft: #EBF1FE;
  --accent-link: #2563EB;
  --success: #059669;
  --success-soft: #E7F6EF;
  --result-bg: #E7F6EF;
  --result-border: #A7E3CA;
  --result-label: #047857;
  --result-value: #065F46;
  --text: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-faint: #9CA3AF;
  --code-bg: #F3F4F6;
  --error: #DC2626;
  --error-soft: #FBE9E9;
  --warning: #D97706;
  --focus-soft: #EBF1FE;

  --font-ui: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-sm: 6px;
  --r: 8px;
  --r-card: 10px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-pill: 999px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  --shadow-sm: 0 1px 2px rgba(17,24,39,.06);
  --shadow: 0 8px 24px -8px rgba(17,24,39,.18);
  --shadow-float: 0 8px 24px -12px rgba(17,24,39,.15);

  --maxw: 1120px;
  --maxw-inner: 1040px;
  --reading: 700px;
}

/* Tokens — dark (system) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1116;
    --surface: #161A21;
    --surface-2: #1C212B;
    --border: #262C36;
    --border-strong: #2E3642;
    --accent: #3B82F6;
    --accent-strong: #2563EB;
    --accent-soft: #15233B;
    --accent-link: #60A5FA;
    --success: #34D399;
    --success-soft: #0C2E22;
    --result-bg: #0C2E22;
    --result-border: #14532D;
    --result-label: #34D399;
    --result-value: #6EE7B7;
    --text: #E8EAED;
    --text-secondary: #9BA3AF;
    --text-muted: #6B7280;
    --text-faint: #6B7280;
    --code-bg: #1C212B;
    --error: #F87171;
    --error-soft: #2A1416;
    --warning: #FBBF24;
    --focus-soft: #15233B;
  }
}

/* Tokens — dark (explicit override) */
:root[data-theme="dark"] {
  --bg: #0E1116;
  --surface: #161A21;
  --surface-2: #1C212B;
  --border: #262C36;
  --border-strong: #2E3642;
  --accent: #3B82F6;
  --accent-strong: #2563EB;
  --accent-soft: #15233B;
  --accent-link: #60A5FA;
  --success: #34D399;
  --success-soft: #0C2E22;
  --result-bg: #0C2E22;
  --result-border: #14532D;
  --result-label: #34D399;
  --result-value: #6EE7B7;
  --text: #E8EAED;
  --text-secondary: #9BA3AF;
  --text-muted: #6B7280;
  --text-faint: #6B7280;
  --code-bg: #1C212B;
  --error: #F87171;
  --error-soft: #2A1416;
  --warning: #FBBF24;
  --focus-soft: #15233B;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #BBD0FB; }
img, svg { display: block; max-width: 100%; }
a { color: var(--accent-link); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Focus */
:focus-visible { outline: none; }
a:focus-visible,
.btn:focus-visible,
.segmented button:focus-visible,
.toggle:focus-visible,
.tool-card:focus-visible,
.category-card:focus-visible,
.copy-btn:focus-visible,
.pill-toggle:focus-visible,
.chip:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
  border-radius: var(--r);
}
input:focus-visible,
textarea:focus-visible,
select:focus-visible { outline: none; }
input[type="range"]:focus-visible { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); border-radius: var(--r-pill); }

/* Layout */
.container { max-width: var(--maxw-inner); margin: 0 auto; padding: 0 28px; }
.reading { max-width: var(--reading); margin: 0 auto; padding: 36px 28px; }
.page { min-height: 100vh; display: flex; flex-direction: column; }
.page-main { flex: 1; }
.tool-layout {
  max-width: var(--maxw-inner);
  margin: 0 auto;
  padding: 28px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
.tool-layout .reading { max-width: var(--reading); min-width: 0; margin: 0; padding: 0; }
.stack > * + * { margin-top: var(--space-4); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--maxw-inner);
  margin: 0 auto;
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.logo { display: inline-flex; align-items: center; gap: 9px; flex: none; }
.logo:hover { text-decoration: none; }
.logo__mark {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: var(--r);
  background: var(--accent);
  color: #fff;
  align-items: center;
  justify-content: center;
  flex: none;
}
.logo__word { font-weight: 700; font-size: 17px; letter-spacing: -.4px; color: var(--text); }
.logo__word b { color: var(--accent); font-weight: 700; }

.header-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 420px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 8px 12px;
  background: var(--surface);
  color: var(--text-faint);
  font-size: 13px;
  cursor: text;
}
.header-search svg { stroke: var(--text-faint); flex: none; }
.header-search .kbd { margin-left: auto; }

.main-nav { display: flex; gap: 4px; }
.main-nav a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 7px 11px;
  border-radius: var(--r);
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-toggle { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 6px; }

.kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--accent-link); }
.breadcrumb .sep { color: var(--text-faint); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }

/* Typography */
h1, h2, h3 { color: var(--text); margin: 0; }
.page-title { font-size: 36px; font-weight: 700; letter-spacing: -1.2px; line-height: 1.08; margin: 0 0 8px; }
.page-lead { font-size: 17px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 24px; }

.article { color: var(--text-secondary); }
.article h2 { font-size: 22px; font-weight: 600; letter-spacing: -.4px; color: var(--text); margin: 28px 0 12px; }
.article h3 { font-size: 18px; font-weight: 600; color: var(--text); margin: 20px 0 10px; }
.article > :first-child { margin-top: 0; }
.article p { font-size: 16px; line-height: 1.7; margin: 0 0 16px; }
.article ul, .article ol { font-size: 16px; line-height: 1.7; margin: 0 0 16px; padding-left: 20px; }
.article li { margin-bottom: 4px; }
.article strong { font-weight: 600; color: var(--text); }
.article a { color: var(--accent-link); }
.article code, .inline-code {
  font-family: var(--font-mono);
  font-size: 14px;
  background: var(--code-bg);
  color: var(--text);
  padding: 2px 6px;
  border-radius: 5px;
}
.article blockquote {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 14px 18px;
  margin: 0 0 16px;
  font-size: 15px;
  color: var(--accent-strong);
  line-height: 1.6;
}
.reviewed-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 20px;
}
.reviewed-note a { color: var(--accent-link); }
.formula {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 18px 20px;
  margin: 0 0 20px;
}
.formula__label { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.formula__body { font-family: var(--font-mono); font-size: 15px; color: var(--text); }

/* Widget panel */
.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}
.widget__fields {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.widget__field { flex: 1; min-width: 120px; }
/* Password generator stacks its option groups vertically — space them out. */
[data-th-tool="password-generator"] > .segmented { margin-bottom: 22px; }
[data-th-tool="password-generator"] [data-th-panel] > .widget__field,
[data-th-tool="password-generator"] [data-th-panel] > [data-th-output="strength"] { margin-top: 22px; }
.widget__joiner { padding-bottom: 13px; color: var(--text-faint); font-size: 15px; font-weight: 500; }
.widget__actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

/* Forms */
.field { display: block; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.label .hint { color: var(--text-muted); font-weight: 400; }
.label .hint--error { color: var(--error); font-weight: 400; }

.input {
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 0 12px;
  background: var(--surface);
}
.input input,
.input-text {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 4px;
  width: 100%;
  background: transparent;
  color: var(--text);
  min-height: 44px;
}
.input__affix { color: var(--text-muted); font-size: 15px; flex: none; }
.input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-soft); }
.input--error { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }
.input--error:focus-within { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }
.input--error input { color: var(--error); }
.field-error {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  color: var(--error);
  font-size: 12.5px;
}

.textarea {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
.textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-soft); }

/* Select */
.select {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
}
.select select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  padding: 11px 36px 11px 12px;
  width: 100%;
  min-height: 44px;
  cursor: pointer;
}
.select__chevron { position: absolute; right: 12px; pointer-events: none; stroke: var(--text-muted); }
.select:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus-soft); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--r);
  padding: 11px 18px;
  min-height: 44px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn--primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn--secondary { color: var(--text); background: var(--surface); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { color: var(--accent-link); background: transparent; border-color: transparent; padding: 11px 12px; }
.btn--ghost:hover { background: var(--accent-soft); text-decoration: none; }
.btn--block { width: 100%; }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[disabled] {
  color: var(--text-faint);
  background: var(--code-bg);
  border-color: transparent;
  cursor: not-allowed;
}

/* Segmented control */
.segmented {
  display: inline-flex;
  background: var(--code-bg);
  border-radius: var(--r);
  padding: 3px;
  gap: 0;
}
.segmented button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  min-height: 38px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.segmented button[aria-selected="true"],
.segmented button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(17,24,39,.08);
}

/* Pill toggle — on/off option buttons (tap-friendly alternative to checkboxes) */
.pill-toggle {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
}
.pill-toggle::before { content: "\2713"; margin-right: 6px; opacity: 0; }
.pill-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.pill-toggle[aria-pressed="true"]::before { opacity: 1; }

/* Toggle switch */
.toggle {
  position: relative;
  width: 42px;
  height: 24px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--border-strong);
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: background-color .15s ease;
}
.toggle__thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s ease;
}
.toggle[aria-checked="true"] { background: var(--accent); }
.toggle[aria-checked="true"] .toggle__thumb { left: 20px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.toggle-row .label { margin-bottom: 0; }

/* Slider */
.slider-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.slider-head__value { font-family: var(--font-mono); color: var(--accent); }
input[type="range"].slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: var(--r-pill);
  accent-color: var(--accent);
  cursor: pointer;
}
input[type="range"].slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(17,24,39,.2);
  cursor: pointer;
}
input[type="range"].slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(17,24,39,.2);
  cursor: pointer;
}

/* Result block */
.result {
  background: var(--result-bg);
  border: 1px solid var(--result-border);
  border-radius: var(--r-card);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.result__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--result-label);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 5px;
}
.result__value { font-size: 40px; font-weight: 700; color: var(--result-value); letter-spacing: -.8px; line-height: 1; }
.result__meta { font-size: 14px; color: var(--result-label); text-align: right; }
.result__meta .sub { font-size: 12.5px; opacity: .8; }
.result--sm { display: block; }
.result--sm .result__value { font-size: 30px; letter-spacing: -.5px; }

/* Stat tiles (Live archetype) */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px;
  text-align: center;
}
.stat__value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.stat__label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* Mono output + copy */
.output {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 10px 12px;
}
.output code, .output__value {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-link);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  cursor: pointer;
  flex: none;
}
.copy-btn:hover { background: var(--surface-2); }
.copy-btn.is-copied { color: var(--success); }
.copied-flag { font-size: 13px; color: var(--success); align-self: center; opacity: 0; transition: opacity .15s ease; }
.copied-flag.is-shown { opacity: 1; }

.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  cursor: pointer;
  flex: none;
}
.reset-btn:hover { background: var(--surface-2); color: var(--text); }
.reset-btn[hidden] { display: none; }

/* Transform / swap */
.swap-btn {
  display: inline-flex;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--accent-link);
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.swap-btn--soft { background: var(--accent-soft); border-color: transparent; }
.swap-row { display: flex; justify-content: center; margin: 8px 0; }

/* Cards */
.card-grid { display: grid; gap: 14px; }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }

.tool-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tool-card:hover { border-color: var(--accent); box-shadow: 0 4px 14px -6px rgba(37,99,235,.3); text-decoration: none; }
.tool-card__head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.tool-card__title { font-size: 15px; font-weight: 600; color: var(--text); }
.tool-card__desc { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.icon-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  flex: none;
}
.icon-chip--sm { width: 32px; height: 32px; border-radius: 7px; }
.icon-chip--neutral { background: var(--surface-2); color: var(--text); }

.category-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 16px;
  cursor: pointer;
  transition: border-color .12s ease;
}
.category-card:hover { border-color: var(--accent); text-decoration: none; }
.category-card__body { flex: 1; min-width: 0; }
.category-card__title { font-size: 15px; font-weight: 600; color: var(--text); }
.category-card__meta { font-size: 12.5px; color: var(--text-muted); }
.category-card__chevron { stroke: var(--text-faint); flex: none; }
.category-card--stacked { display: block; }
.category-card--stacked .icon-chip { margin-bottom: 12px; }
.category-card--stacked .category-card__chevron { display: none; }

/* Chips / tags */
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 500;
  color: #374151;
  background: var(--code-bg);
  border-radius: var(--r-pill);
  padding: 6px 12px;
  border: 1px solid transparent;
}
.chip--accent { color: var(--accent); background: var(--accent-soft); }
.chip--outline { color: #374151; background: var(--surface); border-color: var(--border); }
a.chip:hover { text-decoration: none; border-color: var(--border-strong); }
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .chip--outline { color: var(--text-secondary); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .chip,
  :root:not([data-theme="light"]) .chip--outline { color: var(--text-secondary); }
}

/* Related tools */
.related__title { font-size: 18px; font-weight: 600; margin: 0 0 14px; }

/* Ad slot */
.ad-slot {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-card);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 90px;
  margin: 24px 0;
}
.ad-slot__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.ad-slot__note { font-size: 11.5px; color: var(--text-faint); }
.ad-slot--rect { width: 300px; height: 250px; margin: 0; }
.ad-sidebar { position: sticky; top: 84px; }

/* Consent banner */
.consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  padding: 16px;
}
.consent__inner {
  max-width: var(--maxw-inner);
  margin: 0 auto;
  background: #111827;
  border-radius: 12px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.consent__text { flex: 1; min-width: 260px; }
.consent__title { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.consent__body { color: #9CA3AF; font-size: 12.5px; line-height: 1.5; }
.consent__body a { color: #93B4FB; }
.consent__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.consent .btn { min-height: 40px; padding: 9px 16px; font-size: 13px; }
.consent .btn--manage { color: #fff; background: transparent; border-color: #374151; }
.consent .btn--manage:hover { background: rgba(255,255,255,.06); }
.consent .btn--reject { color: #111827; background: #fff; border-color: #fff; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); }
.site-footer__inner {
  max-width: var(--maxw-inner);
  margin: 0 auto;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}
.site-footer__inner strong { color: var(--text-secondary); font-weight: 600; }
.site-footer__links { display: flex; gap: 18px; }
.site-footer__links a { color: var(--text-muted); }

/* Homepage hero */
.hero { max-width: 760px; margin: 0 auto; padding: 64px 28px 40px; text-align: center; }
.hero__title { font-size: 48px; font-weight: 700; letter-spacing: -1.8px; line-height: 1.04; margin: 0 0 16px; }
.hero__subtitle { font-size: 18px; color: var(--text-secondary); line-height: 1.55; margin: 0 0 32px; }
.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 8px 8px 8px 18px;
  box-shadow: var(--shadow-float);
  max-width: 600px;
  margin: 0 auto;
}
.hero-search svg { stroke: var(--text-muted); flex: none; }
.hero-search input,
.hero-search__placeholder {
  flex: 1;
  text-align: left;
  font-size: 17px;
  color: var(--text-faint);
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  padding: 0;
}
.hero-search input { color: var(--text); }
.hero-search .btn { min-height: 44px; }
.reading .hero-search { margin-bottom: 24px; }
.popular-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Homepage sections */
.home-section { max-width: var(--maxw-inner); margin: 0 auto; padding: 8px 28px 16px; }
.home-section--featured { padding: 24px 28px 36px; }
.section-title { font-size: 15px; font-weight: 600; margin: 0 0 16px; }

/* Search overlay */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  padding-top: 10vh;
  background: rgba(17,24,39,.18);
  backdrop-filter: blur(1.5px);
}
.search-overlay[hidden] { display: none; }
.search-panel {
  width: 460px;
  max-width: calc(100vw - 32px);
  height: fit-content;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 60px -16px rgba(17,24,39,.35);
  overflow: hidden;
}
.search-panel__input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-panel__input svg { stroke: var(--text-muted); flex: none; }
.search-panel__input input {
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  flex: 1;
  background: transparent;
  color: var(--text);
}
.search-results { padding: 8px; max-height: 60vh; overflow-y: auto; }
.search-results__count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 6px 10px;
}
.search-result {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 10px;
  border-radius: var(--r);
  cursor: pointer;
}
.search-result:hover { background: var(--surface-2); text-decoration: none; }
.search-result[aria-selected="true"], .search-result.is-active { background: var(--surface-2); }
.search-result__body { flex: 1; min-width: 0; }
.search-result__name { font-size: 14px; font-weight: 600; color: var(--text); }
.search-result__cat { font-size: 12px; color: var(--text-muted); }
.search-result__enter { font-size: 11px; font-family: var(--font-mono); color: transparent; }
.search-result[aria-selected="true"] .search-result__enter,
.search-result.is-active .search-result__enter { color: var(--accent); }
.search-empty { padding: 36px 20px; text-align: center; }
.search-empty__mark { display: inline-flex; color: var(--border-strong); margin-bottom: 10px; }
.search-empty__title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.search-empty__hint { font-size: 13px; color: var(--text-muted); }

/* 404 */
.notfound { padding: 44px 32px; text-align: center; }
.notfound__mark { display: inline-flex; color: var(--accent); margin-bottom: 18px; }
.notfound__code { font-family: var(--font-mono); font-size: 13px; color: var(--text-faint); margin-bottom: 6px; }
.notfound__title { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin: 0 0 8px; }
.notfound__body { font-size: 15px; color: var(--text-secondary); line-height: 1.55; margin: 0 auto 24px; max-width: 380px; }
.notfound .hero-search { max-width: 380px; margin-bottom: 20px; }

/* Content / trust page */
.content-page { max-width: var(--reading); margin: 0 auto; padding: 36px 28px; }
.content-page h1 { font-size: 30px; font-weight: 700; letter-spacing: -1px; line-height: 1.1; margin: 0 0 16px; }
.content-page .article p,
.content-page .article ul { line-height: 1.75; }
.content-page .article h2 { font-size: 19px; }

/* Loading spinner (server-backed archetypes) */
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  display: inline-block;
  animation: th-spin .7s linear infinite;
}
.loading-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--r);
  padding: 8px 10px;
}
@keyframes th-spin { to { transform: rotate(360deg); } }

/* Visualization */
.viz { display: flex; gap: 16px; align-items: center; }
.viz svg { flex: none; }
.viz__result { flex: 1; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .tool-layout { grid-template-columns: 1fr; }
  .ad-sidebar { display: none; }
}
@media (max-width: 720px) {
  .container, .site-header__inner, .home-section, .home-section--featured, .site-footer__inner, .reading { padding-left: 18px; padding-right: 18px; }
  .main-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-search { max-width: none; }
  .hero { padding: 28px 18px 22px; }
  .hero__title { font-size: 28px; letter-spacing: -1px; line-height: 1.08; }
  .hero__subtitle { font-size: 14px; }
  .page-title { font-size: 25px; letter-spacing: -.8px; }
  .card-grid--3, .card-grid--2 { grid-template-columns: 1fr 1fr; }
  .result__value { font-size: 34px; letter-spacing: -.6px; }
  .content-page { padding: 24px 18px; }
}
@media (max-width: 460px) {
  .card-grid--3, .card-grid--2 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Article tables (e.g. cookie policy) */
.article table { width: 100%; border-collapse: collapse; margin: var(--space-4) 0; font-size: .9375rem; }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.article th { font-weight: 600; color: var(--text); border-bottom-color: var(--border-strong); }
.article td { color: var(--text-secondary); }

/* Word Unscrambler results */
.wu-results { margin-top: var(--space-4); }
.wu-count { font-size: .875rem; color: var(--text-secondary); margin: 0 0 var(--space-3); }
.wu-group { margin-bottom: var(--space-4); }
.wu-group__title { font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 0 0 var(--space-2); }
.wu-empty { color: var(--text-secondary); }

/* Sudoku grid */
.sudoku-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 0;
  border: 2px solid var(--text);
  border-radius: var(--r-sm);
  width: 100%;
  max-width: 400px;
  aspect-ratio: 1;
}
.sudoku-grid input {
  width: 100%;
  aspect-ratio: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  padding: 0;
  outline: none;
  caret-color: transparent;
}
.sudoku-grid input:focus { background: var(--accent-soft); border-color: var(--accent); z-index: 1; position: relative; }
.sudoku-grid input.is-given { color: var(--text); font-weight: 700; background: var(--surface-2); }
.sudoku-grid input.is-solved { color: var(--accent); font-weight: 500; }
.sudoku-grid input.is-conflict { color: var(--error); background: var(--error-soft); }
.sudoku-grid input:nth-child(9n+3),
.sudoku-grid input:nth-child(9n+6) { border-right: 2px solid var(--text); }
.sudoku-grid input:nth-child(n+19):nth-child(-n+27),
.sudoku-grid input:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--text); }

/* Stopwatch */
.stopwatch-display { font-family: var(--font-mono); font-size: 48px; font-weight: 700; color: var(--result-value); letter-spacing: -.5px; text-align: center; padding: 16px 0; }
.stopwatch-ms { font-size: 32px; opacity: .7; }
.stopwatch-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lap-list { margin-top: 16px; }
.lap-list table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lap-list th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-strong); }
.lap-list td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.lap-list td:first-child { color: var(--text); font-weight: 600; }
.lap-list .lap-best { color: var(--success); }
.lap-list .lap-worst { color: var(--error); }

/* Anagram Solver results */
.as-results { margin-top: var(--space-4); }
.as-count { font-size: .875rem; color: var(--text-secondary); margin: 0 0 var(--space-3); }
.as-empty { color: var(--text-secondary); }
.as-list { display: flex; flex-direction: column; gap: 6px; }
.as-result { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.as-result__words { font-family: var(--font-mono); font-size: .9375rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; }
.as-result__score { font-size: .8125rem; color: var(--text-muted); white-space: nowrap; }
