/* Clever Web Tools — dark theme (v2.1)
   Black canvas, tool-yellow for actions, one hue per category for wayfinding.
   Display type: Bricolage Grotesque (self-hosted, OFL). Body: the system UI font. */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/bricolage.woff2") format("woff2-variations"), url("/assets/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --surface-1: #111214;
  --surface-2: #18191c;
  --surface-3: #212226;
  --line: #24262a;
  --line-strong: #34363b;
  --text: #f3f2ee;
  --text-2: #a7a9ae;
  --text-3: #81848b;
  --accent: #ffc425;
  --accent-hover: #ffd35c;
  --accent-ink: #000;
  --ok: #6fe0a4;
  --danger: #ff8f8f;
  --hue: #a7a9ae;
  --max: 1440px;
  --gutter: clamp(16px, 4vw, 48px);
  --display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-family: var(--body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Category hues: used only for icon tiles and the result indicator. */
.cat-creator { --hue: #ff6b7f; }
.cat-pdf { --hue: #ff8f57; }
.cat-media { --hue: #ffb35c; }
.cat-date { --hue: #d9de6a; }
.cat-calculator { --hue: #84e08a; }
.cat-business { --hue: #45d3a8; }
.cat-math { --hue: #3fc8db; }
.cat-converter { --hue: #5cb6ff; }
.cat-developer { --hue: #7b93ff; }
.cat-utility { --hue: #a28cff; }
.cat-text { --hue: #c985ff; }
.cat-writing { --hue: #ee80dc; }
.cat-image { --hue: #ff82ad; }
.cat-health { --hue: #b9c3cf; }
.cat-tax { --hue: #f0c35a; }
.cat-housing { --hue: #d7a77c; }
.cat-budget { --hue: #5ee0b8; }

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; overflow-x: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: 0.55; cursor: wait; }
::selection { background: #ffc42559; color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
input:focus, textarea:focus, select:focus { outline: none; }
svg { width: 22px; height: 22px; flex: none; vertical-align: middle; }
img, video { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 {
  font-family: var(--display);
  font-optical-sizing: auto;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.12;
  color: var(--text);
  text-wrap: balance;
}
h2 { font-size: 32px; }
h3 { font-size: 20px; line-height: 1.25; }
p { line-height: 1.65; }
small { font-size: 13px; }
input, select, textarea { min-width: 0; }
[hidden] { display: none !important; }
kbd {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--text-2);
  background: var(--surface-1);
}
.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: fixed; left: 14px; top: -100px; z-index: 100; background: var(--accent); color: var(--accent-ink); padding: 12px 16px; border-radius: 8px; font-weight: 600; }
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  padding: 0 max(var(--gutter), calc((100% - var(--max)) / 2));
  display: flex;
  align-items: center;
  gap: 28px;
  background: #000000d9;
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 3px; }
.brand-mark i { width: 9px; height: 9px; border-radius: 2.5px; background: var(--accent); }
.brand-mark i:nth-child(2) { background: #5cb6ff; }
.brand-mark i:nth-child(3) { background: #ff6b7f; }
.brand-mark i:nth-child(4) { background: #84e08a; }
.brand-name { font-family: var(--display); font-size: 22px; letter-spacing: -0.03em; font-weight: 750; }
.brand-name span { font-weight: 400; color: var(--text-2); }
.brand-name b { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 2px; margin-inline-end: auto; font-size: 14.5px; min-width: 0; }
.main-nav > a, .nav-menu > summary { white-space: nowrap; color: var(--text-2); padding: 8px 9px; border-radius: 8px; transition: color 0.15s, background-color 0.15s; }
.main-nav > a:hover, .nav-menu > summary:hover { color: var(--text); background: var(--surface-1); }
.main-nav > a[aria-current="page"], .nav-menu > summary.is-active { color: var(--text); background: var(--surface-2); }
.nav-menu > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; color: var(--text); font-weight: 550; user-select: none; }
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu .chev { width: 16px; height: 16px; color: var(--text-3); transition: transform 0.2s; }
.nav-menu[open] > summary { background: var(--surface-2); color: var(--text); }
.nav-menu[open] .chev { transform: rotate(180deg); color: var(--text); }
.nav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  background: #0a0a0b;
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 40px 80px -24px #000;
  padding: 20px max(var(--gutter), calc((100% - var(--max)) / 2)) 22px;
  max-height: calc(100vh - 68px);
  overflow: auto;
  animation: panel-in 0.18s ease-out;
}
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-panel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px; }
.nav-cat { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: background-color 0.15s; }
.nav-cat:hover, .nav-cat[aria-current="page"] { background: var(--surface-1); }
.nav-cat .tool-icon { width: 36px; height: 36px; border-radius: 10px; }
.nav-cat .tool-icon svg { width: 19px; height: 19px; }
.nav-cat b { display: block; font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; }
.nav-cat small { display: block; font-size: 13px; color: var(--text-3); }
.nav-panel-all { display: inline-flex; margin: 14px 12px 0; color: var(--accent); font-size: 15px; font-weight: 600; }
.nav-panel-all:hover { text-decoration: underline; text-underline-offset: 3px; }
.language { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-2); padding: 6px 4px 6px 10px; border: 1px solid var(--line); border-radius: 10px; }
.language:hover { border-color: var(--line-strong); }
.language svg { width: 16px; height: 16px; }
.language select { border: 0; background: transparent; max-width: 120px; font-size: 14px; cursor: pointer; color: var(--text); padding: 2px; }
.language select option { background: var(--surface-1); color: var(--text); }
.owner-pill { display: inline-flex; align-items: center; gap: 7px; color: var(--text-2); font-size: 14px; border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; margin-inline-end: auto; }
.owner-pill svg { width: 15px; height: 15px; color: var(--ok); }

/* ---------- Page shell and ad rails ---------- */
.site-shell {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.site-shell.has-rails { max-width: calc(var(--max) + var(--gutter) * 2 + 384px); }
.main-content { flex: 1; min-width: 0; }
.ad-slot { color: var(--text-3); font-size: 11px; text-align: center; }
.ad-label { display: block; letter-spacing: 0.08em; font-size: 10px; margin-bottom: 8px; }
.ad-inner {
  border: 1px solid var(--line);
  background: var(--surface-1);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
}
.ad-inner > span, .ad-inner > small { display: none; }
.ad-left, .ad-right { flex: none; width: 160px; margin-top: 48px; position: sticky; top: 92px; }
.ad-left .ad-inner, .ad-right .ad-inner { height: 600px; width: 160px; }
.ad-bottom, .ad-content, .ad-multiplex { margin: 56px 0 0; }
.ad-content .ad-inner, .ad-multiplex .ad-inner { min-height: 90px; }
.directory-grid > .ad-in-grid { grid-column: 1 / -1; margin: 4px 0; }
.ad-slot:not(.ad-live) { visibility: hidden; }
.ad-slot:not(.ad-live):is(.ad-content, .ad-bottom, .ad-multiplex) { height: 0; margin: 0; overflow: hidden; }
.ad-slot:has(ins[data-ad-status="unfilled"]) { display: none; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.ad-bottom .ad-inner { min-height: 100px; max-width: 970px; margin: 0 auto; }
.ad-inner ins { width: 100%; height: 100%; display: block; }
.ad-inner.ad-loaded { background: transparent; border-color: transparent; }
@media (max-width: 1599px) { .ad-left { display: none; } }
@media (max-width: 1279px) { .ad-right { display: none; } }

/* ---------- Shared text pieces ---------- */
.eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.eyebrow > span { display: inline-flex; align-items: center; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: 13px; }
.text-link { color: var(--accent); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.text-link svg { width: 16px; height: 16px; }
.text-button { background: transparent; border: 0; color: var(--accent); font-size: 14px; padding: 0; text-align: start; cursor: pointer; }
.text-button:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--text-3); font-size: 14px; }
.empty { text-align: center; color: var(--text-2); padding: 48px 20px; line-height: 1.7; }
.updated { font-size: 13px !important; color: var(--text-3) !important; margin-top: 24px; }
.notice {
  font-size: 14px;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--line);
  line-height: 1.7;
  border-radius: 12px;
  padding: 14px 16px;
}
.error-message {
  font-size: 14px;
  line-height: 1.6;
  color: var(--danger);
  border: 1px solid #5a2328;
  background: #1c0d0f;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 16px 0 0;
}

/* ---------- Buttons ---------- */
.button, .search-form button {
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent-ink);
  font-size: 15px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 46px;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s;
}
.button:hover, .search-form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button svg, .search-form button svg { display: none; }
.button.light { margin-top: 8px; }
.secondary {
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 10px;
  padding: 11px 16px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  line-height: 1.3;
  transition: background-color 0.15s, border-color 0.15s;
}
.secondary:hover { background: var(--surface-2); border-color: #45484e; }

/* ---------- Search ---------- */
.search-form {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
  max-width: 760px;
  padding: 7px 7px 7px 18px;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-form > svg { width: 20px; height: 20px; color: var(--text-3); }
.search-form input {
  border: 0;
  outline: 0;
  flex: 1;
  width: 100%;
  font-size: 17px;
  background: transparent;
  padding: 10px 0;
  min-width: 0;
  color: var(--text);
}
.search-form input::placeholder { color: var(--text-3); }
.search-form input::-webkit-search-cancel-button { filter: invert(0.7); }
.search-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px #ffc42530; }
.search-form .kbd { flex: none; }
.search-form:focus-within .kbd { visibility: hidden; }
@media (hover: none) { .search-form .kbd { display: none; } }

/* ---------- Home: hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  align-items: center;
  gap: clamp(32px, 5vw, 88px);
  padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 5vw, 64px);
}
.hero h1 {
  font-size: clamp(46px, 6.6vw, 100px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  font-weight: 740;
  margin: 0 0 28px;
}
.hero h1 em { font-style: normal; }
.hero-desc { color: var(--text-2); font-size: 19px; max-width: 34em; margin-bottom: 32px; line-height: 1.6; }
.hero .search-form { padding: 9px 9px 9px 20px; }
.hero .search-form input { font-size: 18px; padding: 12px 0; }
.hero .search-form button { min-height: 52px; padding: 12px 24px; }
.popular { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; max-width: 760px; }
.popular > span { font-size: 14px; color: var(--text-3); margin-inline-end: 4px; }
.popular a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-2);
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}
.popular a::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hue); }
.popular a:hover { color: var(--text); background: var(--surface-1); border-color: color-mix(in srgb, var(--hue) 55%, var(--line-strong)); }
.trust-row { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; color: var(--text-2); font-size: 14px; }
.trust-row span { display: inline-flex; align-items: center; gap: 7px; }
.trust-row svg { width: 16px; height: 16px; color: var(--ok); }

.hero-visual { position: relative; padding: 40px 0 56px; min-width: 0; isolation: isolate; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(closest-side, #ff6b7f2e, transparent 70%), radial-gradient(closest-side at 80% 85%, #5cb6ff24, transparent 70%);
  filter: blur(30px);
  pointer-events: none;
}
.dot-grid { display: none; }
.visual-chip {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
}
.mini-dot, .online-dot { display: inline-block; background: var(--ok); width: 7px; height: 7px; border-radius: 50%; box-shadow: 0 0 0 3px #6fe0a426; }
.demo-card {
  --hue: #ff6b7f;
  position: relative;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 26px 28px 22px;
  box-shadow: 0 40px 80px -40px #000, 0 0 0 1px #00000080;
}
.demo-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.demo-head b { font-weight: 600; }
.demo-head .tool-icon { width: 34px; height: 34px; border-radius: 9px; }
.demo-head svg { width: 18px; height: 18px; }
.demo-badge { font-size: 12px; color: var(--text-3); margin-inline-start: auto; border: 1px solid var(--line-strong); padding: 3px 9px; border-radius: 999px; }
.demo-card > p { font-size: 14px; color: var(--text-2); margin: 26px 0 2px; }
.demo-value { font-family: var(--display); font-size: clamp(40px, 4vw, 56px); font-weight: 700; letter-spacing: -0.035em; white-space: nowrap; line-height: 1.1; font-variant-numeric: tabular-nums; }
.demo-value > span { color: var(--text-3); font-weight: 300; padding: 0 0.1em; }
.demo-value > small { font-family: var(--body); font-size: 14px; letter-spacing: 0; color: var(--text-2); margin-inline-start: 6px; font-weight: 500; }
.demo-bars { height: 96px; display: flex; gap: 6px; align-items: flex-end; margin: 18px 0 12px; border-bottom: 1px solid var(--line-strong); }
.demo-bars i {
  display: block;
  flex: 1;
  background: #2a2c31;
  border-radius: 4px 4px 0 0;
  transform-origin: bottom;
  animation: bar-rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.demo-bars i:nth-last-child(-n + 3) { background: var(--hue); }
.demo-bars i:nth-child(1) { animation-delay: 0.05s; }
.demo-bars i:nth-child(2) { animation-delay: 0.09s; }
.demo-bars i:nth-child(3) { animation-delay: 0.13s; }
.demo-bars i:nth-child(4) { animation-delay: 0.17s; }
.demo-bars i:nth-child(5) { animation-delay: 0.21s; }
.demo-bars i:nth-child(6) { animation-delay: 0.25s; }
.demo-bars i:nth-child(7) { animation-delay: 0.29s; }
.demo-bars i:nth-child(8) { animation-delay: 0.33s; }
.demo-bars i:nth-child(9) { animation-delay: 0.37s; }
.demo-bars i:nth-child(10) { animation-delay: 0.41s; }
.demo-bars i:nth-child(11) { animation-delay: 0.45s; }
.demo-bars i:nth-child(12) { animation-delay: 0.49s; }
@keyframes bar-rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.demo-foot { font-size: 13px; display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); }
.demo-foot b { font-weight: 600; color: var(--text); }
.demo-note { font-size: 12px; color: var(--text-3); display: block; margin-top: 10px; }
.mini-demo {
  --hue: #5cb6ff;
  position: absolute;
  right: 24px;
  bottom: 0;
  width: 270px;
  max-width: 80%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 24px 48px -16px #000;
}
.mini-demo b { font-size: 15px; font-weight: 600; }
.mini-demo b > span { color: var(--text-3); padding: 0 6px; }
.mini-demo small { display: block; color: var(--text-3); font-size: 13px; margin-top: 2px; }
.mini-demo > .tool-icon { width: 36px; height: 36px; border-radius: 10px; }
.mini-demo > .tool-icon svg { width: 18px; height: 18px; }
.done { margin-inline-start: auto; width: 26px; height: 26px; display: grid; place-items: center; background: #6fe0a41f; color: var(--ok); border-radius: 50%; }
.done svg { width: 14px; height: 14px; }

/* Catalogue facts strip */
.numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 36px;
  align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.numbers > div { display: flex; align-items: baseline; gap: 8px; }
.numbers > div:last-child { display: none; }
.numbers b { font-family: var(--display); font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.numbers span { font-size: 15px; color: var(--text-2); }

/* ---------- Sections ---------- */
.section { padding-top: 72px; }
.section > h2 { margin-bottom: 24px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; }
.section-heading p { font-size: 16px; color: var(--text-2); margin: 8px 0 0; }

/* Category tiles */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 10px; }
@media (min-width: 1240px) { .category-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  padding: 16px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  min-width: 0;
  transition: border-color 0.15s, background-color 0.15s;
}
.category-card > span:nth-child(2) { min-width: 0; }
.category-card b { font-size: 15px; font-weight: 600; display: block; line-height: 1.3; }
.category-card small { display: block; color: var(--text-3); font-size: 13px; margin-top: 4px; }
.category-card > svg { display: none; }
.category-card .tool-icon { width: 36px; height: 36px; border-radius: 10px; }
.category-card .tool-icon svg { width: 19px; height: 19px; }
.category-card:hover, .tool-card:hover, .guide-card:hover { border-color: color-mix(in srgb, var(--hue) 55%, var(--line-strong)); background: var(--surface-2); }

/* Tool cards */
.tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.directory-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 264px), 1fr)); padding-bottom: 8px; }
.tool-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  transition: border-color 0.15s, background-color 0.15s;
}
.card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-arrow { display: none; }
.tool-card h3 { font-size: 19px; font-weight: 620; letter-spacing: -0.015em; margin-bottom: 8px; }
.tool-card p { font-size: 15px; line-height: 1.55; color: var(--text-2); margin-bottom: 18px; flex: 1; }
.card-category { font-size: 13px; color: var(--text-3); }

/* Icon tile, tinted by category */
.tool-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex: none;
  color: var(--hue);
  background: #1d1e22;
  background: color-mix(in srgb, var(--hue) 15%, #0c0c0d);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 22%, transparent);
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-icon { transition: background-color 0.15s, box-shadow 0.15s; }
.tool-card:hover .tool-icon, .category-card:hover .tool-icon, .nav-cat:hover .tool-icon {
  background: color-mix(in srgb, var(--hue) 26%, #0c0c0d);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue) 45%, transparent);
}

/* Creator band */
.creator-banner {
  --hue: #ff6b7f;
  margin-top: 72px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 56px);
  border-radius: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  overflow: hidden;
}
.creator-banner h2 { font-size: clamp(32px, 3.6vw, 52px); letter-spacing: -0.035em; margin: 18px 0 14px; }
.creator-banner p { color: var(--text-2); font-size: 17px; max-width: 34em; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.platforms li { font-size: 13px; color: var(--text-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px; }
.creator-art { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.creator-art span {
  display: grid;
  place-items: center;
  height: 104px;
  border-radius: 16px;
  font-family: var(--display);
  font-size: 34px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--hue);
  background: color-mix(in srgb, var(--hue) 9%, #0c0c0d);
  border: 1px solid color-mix(in srgb, var(--hue) 22%, transparent);
}
.creator-art span:nth-child(2) { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }
.creator-art span:nth-child(3) { color: var(--text); background: var(--surface-2); border-color: var(--line-strong); }

/* Guides */
.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 16px;
  transition: border-color 0.15s, background-color 0.15s;
}
.guide-number { display: none; }
.guide-card h3, .guide-card h2 { font-size: 21px; margin-bottom: 10px; }
.guide-card p { font-size: 15px; color: var(--text-2); flex: 1; margin-bottom: 16px; }
.guide-card > svg { display: none; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 96px;
  border-top: 1px solid var(--line);
  padding: 48px max(var(--gutter), calc((100% - var(--max)) / 2)) 56px;
  display: flex;
  justify-content: space-between;
  gap: 64px;
}
.site-footer p { font-size: 15px; color: var(--text-2); margin: 16px 0 8px; max-width: 380px; }
.site-footer small { font-size: 13px; color: var(--text-3); display: block; max-width: 380px; line-height: 1.6; }
.site-footer nav { display: grid; grid-template-columns: repeat(3, auto); gap: 14px 40px; align-content: start; font-size: 15px; color: var(--text-2); }
.site-footer nav a:hover { color: var(--text); }
.site-footer .text-button { font-size: 15px; color: var(--text-2); }
.site-footer .text-button:hover { color: var(--text); }
.site-footer { flex-wrap: wrap; }
.site-footer nav.footer-langs { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; color: var(--text-3); padding-top: 24px; border-top: 1px solid var(--line, rgba(255,255,255,.08)); }
.site-footer nav.footer-langs span[aria-current] { color: var(--text); }
html:lang(pa) { --body: "Noto Sans Gurmukhi", "Raavi", "Mukta Mahee", system-ui, sans-serif; --display: "Bricolage Grotesque", "Noto Sans Gurmukhi", "Raavi", system-ui, sans-serif; }
html:lang(zh-Hans) { --body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", system-ui, sans-serif; --display: "Bricolage Grotesque", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif; }
html:lang(ar) { --body: "Noto Sans Arabic", "Segoe UI", "Geeza Pro", Tahoma, system-ui, sans-serif; --display: "Noto Sans Arabic", "Segoe UI", "Geeza Pro", Tahoma, system-ui, sans-serif; }

/* ---------- Directory / search ---------- */
.page-heading { padding: 56px 0 28px; }
.page-heading h1 { font-size: clamp(36px, 4.4vw, 60px); letter-spacing: -0.035em; line-height: 1.04; margin: 10px 0 14px; }
.page-heading p { font-size: 17px; color: var(--text-2); max-width: 40em; margin-bottom: 0; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 24px 0 12px; }
.filters button, .filters select {
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  padding: 7px 14px;
  font-size: 14px;
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s;
}
.filters button:hover { color: var(--text); border-color: #4a4d53; }
.filters button.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.filters select { padding-inline-end: 10px; background: var(--surface-1); color: var(--text); }
#filter-status { margin: 0 0 16px; }

/* ---------- Tool page ---------- */
.breadcrumb { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 14px; padding-top: 28px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.tool-heading { display: flex; gap: 22px; padding: 24px 0 24px; align-items: flex-start; }
.tool-heading > .tool-icon { width: 60px; height: 60px; border-radius: 16px; margin-top: 2px; }
.tool-heading > .tool-icon svg { width: 28px; height: 28px; }
.tool-heading h1 { font-size: clamp(34px, 3.8vw, 54px); letter-spacing: -0.035em; line-height: 1.05; margin: 12px 0 12px; }
.tool-heading p { font-size: 18px; color: var(--text-2); max-width: 44em; margin-bottom: 0; }
.privacy-line { display: flex; align-items: flex-start; gap: 10px; color: var(--text-2); font-size: 14px; line-height: 1.6; margin: 0 0 20px; }
.privacy-line svg { width: 17px; height: 17px; margin-top: 2px; color: var(--ok); }
.privacy-line + .notice { margin: -4px 0 20px; color: #f5d27a; border-color: #4a3a12; background: #17130a; }

.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  overflow: hidden;
  min-width: 0;
}
.inputs { padding: 28px; min-width: 0; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 22px; }
.panel-heading h2 { font-size: 20px; margin: 0; }
.panel-heading .text-button { font-size: 14px; }
.example-label { font-size: 14px; color: #f5d27a; background: #17130a; border: 1px solid #3d3112; padding: 10px 12px; border-radius: 10px; margin: -6px 0 20px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 16px; }
.field-grid > .wide, .field.wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > span { font-size: 14px; font-weight: 550; color: var(--text); line-height: 1.4; }
.field input, .field select, .field textarea, #tool-fields > textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  min-height: 48px;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field input::placeholder, .field textarea::placeholder, #tool-fields > textarea::placeholder { color: var(--text-3); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: #46494f; }
.field input:focus, .field select:focus, .field textarea:focus, #tool-fields > textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #ffc42530; }
.field select { cursor: pointer; }
.field select option { background: var(--surface-1); }
.field textarea, #tool-fields > textarea { resize: vertical; font-family: var(--mono); font-size: 14px; line-height: 1.6; min-height: 180px; }
#tool-fields > textarea { grid-column: 1 / -1; }
.field small { font-size: 13px; color: var(--text-3); line-height: 1.5; font-weight: 400; }
.field input[type="file"] { padding: 22px 16px; font-size: 14px; border-style: dashed; min-height: 88px; color: var(--text-2); cursor: pointer; }
.field input[type="file"]::file-selector-button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 14px;
  color: var(--text);
  background: var(--surface-2);
  margin-inline-end: 12px;
  font: inherit;
  cursor: pointer;
}
.field input[type="number"] { font-variant-numeric: tabular-nums; }
.field input[type="date"], .field input[type="time"] { color-scheme: dark; }
.check-field { display: flex; gap: 10px; align-items: flex-start; margin-top: 20px; font-size: 14px; color: var(--text-2); line-height: 1.5; }
.check-field input { accent-color: var(--accent); width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; }
.field-grid > .actions { margin-top: 0; }
#device-preview { display: grid; gap: 12px; }
#device-preview video { border-radius: 12px; background: var(--bg); }
progress { width: 100%; height: 10px; accent-color: var(--accent); }

.result-panel { padding: 28px; background: var(--bg); border-inline-start: 1px solid var(--line-strong); min-width: 0; display: flex; flex-direction: column; }
.result-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hue) 18%, transparent); }
.result-placeholder { min-height: 240px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: var(--text-3); gap: 14px; border: 1px dashed var(--line-strong); border-radius: 14px; padding: 24px; }
.result-placeholder > svg { height: 34px; width: 34px; color: var(--text-3); }
.result-placeholder p { font-size: 15px; margin: 0; }
.result-entry { padding: 14px 0; border-bottom: 1px solid var(--line); }
.result-entry:first-child { padding-top: 0; }
.result-entry > span { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.result-entry > b {
  display: block;
  font-family: var(--display);
  font-size: clamp(30px, 2.8vw, 40px);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 650;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.result-entry:nth-child(n + 3) > b { font-size: 22px; letter-spacing: -0.015em; }
.result-pre {
  font: 14px/1.65 var(--mono);
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 480px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 14px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.result-pre:first-child { margin-top: 0; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; padding-top: 24px; }
.result-preview {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: repeating-conic-gradient(#17181b 0% 25%, #222327 0% 50%) 50% / 16px 16px;
  margin: 14px 0;
  border-radius: 12px;
}

.tool-explainer { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px); margin-top: 64px; }
.tool-explainer > section:first-child { max-width: 760px; }
.tool-explainer h2 { font-size: 26px; margin: 0 0 18px; }
.tool-explainer h2:not(:first-child) { margin-top: 36px; }
.tool-explainer h3 { font-size: 18px; margin: 28px 0 10px; }
.tool-explainer p, .steps { font-size: 16px; color: var(--text-2); line-height: 1.75; }
.steps { list-style: none; counter-reset: steps; padding: 0; margin: 0 0 8px; }
.steps li { counter-increment: steps; position: relative; padding: 0 0 14px 40px; }
.steps li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: grid;
  place-items: center;
}
.formula, .example-block {
  display: block;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  background: var(--surface-1);
  border-radius: 12px;
  padding: 16px;
  margin: 0 0 8px;
  font: 14px/1.7 var(--mono);
  color: var(--text);
}
.tool-faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.tool-faq details:first-of-type { border-top: 1px solid var(--line); }
.tool-faq summary { cursor: pointer; font-size: 16px; font-weight: 600; line-height: 1.5; }
.tool-faq summary::marker { color: var(--text-3); }
.tool-faq details p { margin: 10px 0 0; font-size: 15px; }
.privacy-card {
  margin-top: 28px;
  border: 1px solid var(--line);
  padding: 18px 20px;
  background: var(--surface-1);
  border-radius: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  transition: border-color 0.15s;
}
.privacy-card:hover { border-color: var(--line-strong); }
.privacy-card > svg:first-child { color: var(--ok); }
.privacy-card b { font-size: 15px; font-weight: 600; }
.privacy-card > svg:last-child { width: 18px; margin-inline-start: auto; color: var(--text-3); }

/* ---------- Guides, policies, sitemap ---------- */
.prose { max-width: 720px; margin: 56px auto 0; }
.prose header { margin-bottom: 8px; }
.prose h1 { font-size: clamp(36px, 4.4vw, 56px); letter-spacing: -0.035em; line-height: 1.06; margin: 12px 0 22px; }
.prose h2 { font-size: 26px; margin: 40px 0 12px; }
.prose p { font-size: 17px; line-height: 1.75; color: var(--text-2); margin-bottom: 20px; }
.prose .lead { font-size: 20px; line-height: 1.6; color: var(--text); }
.prose a:not(.button) { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose .secondary { margin-top: 8px; }
.sitemap-section { margin: 36px 0; }
.sitemap-section h2 { font-size: 22px; }
.sitemap-section h2 a:hover { color: var(--accent); }
.main-content > section > ul, .sitemap-section ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px 28px;
  padding-inline-start: 18px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-2);
}
.main-content > section > ul a:hover, .sitemap-section a:hover { color: var(--text); text-decoration: underline; }
.error-page { padding: 96px 20px 40px; }
.error-page > b { display: block; font-family: var(--display); font-size: clamp(96px, 16vw, 200px); letter-spacing: -0.06em; line-height: 1; color: var(--surface-3); }
.error-page h1 { font-size: 32px; margin: 12px 0 28px; }

/* ---------- Consent ---------- */
.consent {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(560px, calc(100vw - 48px));
  z-index: 30;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 80px -20px #000, 0 0 0 1px #000;
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow: auto;
}
.consent h2 { font-size: 19px; margin-bottom: 6px; }
.consent p { font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.consent a { font-size: 14px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions .button, .consent-actions .secondary { font-size: 14px; padding: 9px 14px; min-height: 42px; flex: 1 1 auto; }

/* ---------- Owner dashboard ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); max-width: 1600px; margin: 0 auto; min-height: calc(100vh - 68px); }
.admin-nav { padding: 28px 16px; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.admin-nav > .eyebrow { font-size: 13px; padding: 0 12px; margin-bottom: 14px; color: var(--text-3); }
.admin-nav > button {
  border: 0;
  background: transparent;
  display: flex;
  gap: 10px;
  align-items: center;
  text-align: start;
  color: var(--text-2);
  font-size: 15px;
  padding: 11px 12px;
  border-radius: 10px;
}
.admin-nav > button:hover { background: var(--surface-1); color: var(--text); }
.admin-nav > button svg { width: 18px; height: 18px; }
.admin-nav > button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.admin-nav > button.active svg { color: var(--accent); }
.admin-nav-bottom { margin-top: auto; padding: 32px 12px 8px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 13px; color: var(--text-3); }
.admin-nav-bottom .secondary { width: 100%; margin-top: 8px; }
.admin-main { padding: 36px 40px 64px; min-width: 0; }
.admin-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.admin-heading .eyebrow { font-size: 13px; color: var(--text-3); }
.admin-heading h1 { font-size: 36px; letter-spacing: -0.03em; margin: 6px 0; }
.admin-heading p { color: var(--text-2); font-size: 15px; margin: 0; }
.admin-heading select { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-1); padding: 10px 12px; font-size: 14px; color: var(--text); }
.mobile-owner-logout { display: none; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { background: var(--surface-1); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.metric-card > span { font-size: 14px; display: block; color: var(--text-2); line-height: 1.4; }
.metric-card > b { font-family: var(--display); font-size: 40px; display: block; font-weight: 650; letter-spacing: -0.03em; margin: 10px 0 6px; font-variant-numeric: tabular-nums; }
.metric-card > small { font-size: 13px; color: var(--text-3); }
.admin-two { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 12px; }
.dashboard-card { border: 1px solid var(--line); background: var(--surface-1); border-radius: 16px; padding: 24px; margin-bottom: 12px; min-width: 0; }
.dashboard-card > h2, .dashboard-card .panel-heading h2 { font-size: 20px; margin-bottom: 18px; }
.dashboard-card .panel-heading { margin-bottom: 4px; }
.dashboard-card .panel-heading h2 { margin-bottom: 0; }
.dashboard-card > h3 { font-size: 15px; margin-top: 24px; }
.dashboard-card > p, .dashboard-card form > p { font-size: 14px; color: var(--text-2); line-height: 1.7; }
.dashboard-card .field-grid { max-width: 1000px; }
.dashboard-card .field input, .dashboard-card .field select { background: var(--bg); }
.chart { height: 240px; display: flex; align-items: flex-end; gap: 5px; border-bottom: 1px solid var(--line-strong); position: relative; padding-top: 24px; }
.chart > p { align-self: center; text-align: center; font-size: 15px; color: var(--text-3); width: 100%; }
.chart-bar { position: relative; flex: 1; min-height: 2px; background: #3a3d44; border-radius: 4px 4px 0 0; }
.chart-bar:hover { background: var(--accent); }
.chart-bar:hover::after {
  content: attr(data-label);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, -6px);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 2;
}
.stat-row { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 10px 0; font-size: 14px; color: var(--text-2); }
.stat-row strong { color: var(--text); font-variant-numeric: tabular-nums; }
.table-scroll { overflow: auto; max-height: 650px; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 580px; text-align: start; }
th { font-size: 13px; font-weight: 600; color: var(--text-3); background: var(--surface-1); position: sticky; top: 0; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); }
td { color: var(--text-2); font-variant-numeric: tabular-nums; }
td:first-child { color: var(--text); max-width: 340px; overflow-wrap: anywhere; }
td a { color: var(--accent); }
#save-status { font-size: 14px; color: var(--ok); padding-inline-start: 12px; }
.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.health-grid > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.health-grid span { display: block; font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.health-grid b { font-family: var(--display); font-size: 26px; font-weight: 650; letter-spacing: -0.02em; }
.admin-panel > .notice { margin-top: 12px; }

.login-wrap { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; min-height: calc(100vh - 68px); padding: 48px 20px; }
.login-card { width: min(440px, 100%); border: 1px solid var(--line-strong); border-radius: 22px; background: var(--surface-1); padding: 40px; }
.login-card > .tool-icon { --hue: var(--ok); width: 52px; height: 52px; border-radius: 14px; margin-bottom: 22px; }
.login-card h1 { font-size: 32px; letter-spacing: -0.03em; margin: 0 0 10px; }
.login-card > p { font-size: 15px; color: var(--text-2); line-height: 1.6; }
.login-card form { margin-top: 24px; }
.login-card .field input { background: var(--bg); }
.login-card .button { width: 100%; margin-top: 18px; }
.login-card > a { font-size: 14px; color: var(--text-2); display: inline-block; margin-top: 24px; }
.login-card > a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 1299px) {
  .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  .brand { margin-inline-end: auto; }
  .main-nav {
    order: 3;
    flex-basis: 100%;
    margin: 6px calc(var(--gutter) * -1) 0;
    padding: 2px calc(var(--gutter) - 9px) 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-panel { max-height: 70vh; }
  .ad-left, .ad-right { top: 128px; }
}

/* The one-row header needs a different width per language (measured): below that width the menu moves to its own row. */
@media (min-width: 1300px) and (max-width: 1399px) {
  html:lang(en) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(en) .brand { margin-inline-end: auto; }
  html:lang(en) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1365px) {
  html:lang(de) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(de) .brand { margin-inline-end: auto; }
  html:lang(de) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1321px) {
  html:lang(pa) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(pa) .brand { margin-inline-end: auto; }
  html:lang(pa) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1435px) {
  html:lang(fr) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(fr) .brand { margin-inline-end: auto; }
  html:lang(fr) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1439px) {
  html:lang(ar) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(ar) .brand { margin-inline-end: auto; }
  html:lang(ar) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1477px) {
  html:lang(it) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(it) .brand { margin-inline-end: auto; }
  html:lang(it) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) and (max-width: 1529px) {
  html:lang(es) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(es) .brand { margin-inline-end: auto; }
  html:lang(es) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) {
  html:lang(pt) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(pt) .brand { margin-inline-end: auto; }
  html:lang(pt) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
@media (min-width: 1300px) {
  html:lang(tl) .site-header { height: auto; flex-wrap: wrap; gap: 0 12px; padding-top: 12px; padding-bottom: 0; }
  html:lang(tl) .brand { margin-inline-end: auto; }
  html:lang(tl) .main-nav { order: 3; flex-basis: 100%; margin: 6px 0 0; margin-inline-start: -9px; padding: 2px 0 8px; }
}
/* Fail-safe: if a system font is wider than expected, the menu scrolls instead of overlapping. */
.main-nav { overflow-x: auto; scrollbar-width: none; }
.main-nav::-webkit-scrollbar { display: none; }


@media (max-width: 1180px) {
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr); }
  .admin-shell { grid-template-columns: 196px minmax(0, 1fr); }
  .admin-main { padding: 30px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-visual { max-width: 560px; }
  .tool-workspace { grid-template-columns: minmax(0, 1fr); }
  .result-panel { border-inline-start: 0; border-top: 1px solid var(--line-strong); }
  .tool-explainer { grid-template-columns: minmax(0, 1fr); }
  .creator-banner { grid-template-columns: minmax(0, 1fr); }
  .creator-art { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .creator-art span { height: 84px; font-size: 28px; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
  .admin-two { grid-template-columns: minmax(0, 1fr); }
  .site-footer { flex-direction: column; gap: 32px; }
}

@media (max-width: 720px) {
  .brand-name { font-size: 20px; }
  .language { padding: 5px 2px 5px 8px; }
  .language select { max-width: 96px; font-size: 13px; }
  .owner-pill { display: none; }
  .admin-body .site-header { padding-bottom: 12px; }

  .hero { padding-top: 36px; gap: 28px; }
  .hero h1 { margin-bottom: 20px; }
  .hero-desc { font-size: 17px; margin-bottom: 24px; }
  .search-form, .hero .search-form { padding: 6px 6px 6px 14px; gap: 10px; }
  .search-form input, .hero .search-form input { font-size: 16px; padding: 9px 0; }
  .search-form > svg, .search-form .kbd { display: none; }
  .search-form button, .hero .search-form button { min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .hero-visual { padding: 38px 0 64px; }
  .demo-card { padding: 20px; }
  .mini-demo { right: 0; width: 240px; }
  .numbers { gap: 8px 22px; }
  .numbers b { font-size: 20px; }
  .numbers span { font-size: 14px; }

  .section { padding-top: 52px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  h2 { font-size: 27px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .category-card { flex-direction: row; align-items: center; gap: 12px; padding: 12px; }
  .category-card b { font-size: 14px; }
  .category-card small { font-size: 12px; margin-top: 2px; }
  .category-card .tool-icon { width: 32px; height: 32px; }
  .tool-grid, .directory-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .tool-card { padding: 16px; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; }
  .tool-card .card-top { grid-row: 1 / span 3; margin: 0; align-self: start; }
  .tool-card .card-arrow { display: none; }
  .tool-card h3 { font-size: 17px; margin-bottom: 4px; }
  .tool-card p { font-size: 14px; margin-bottom: 10px; }
  .tool-card .tool-icon { width: 40px; height: 40px; }
  .creator-banner { margin-top: 52px; border-radius: 18px; gap: 24px; }
  .creator-banner p { font-size: 16px; }
  .creator-art span { height: 64px; font-size: 22px; border-radius: 12px; }

  .page-heading { padding: 36px 0 20px; }
  .page-heading p { font-size: 16px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; margin: 20px calc(var(--gutter) * -1) 10px; padding: 0 var(--gutter) 4px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters button, .filters select { flex: none; white-space: nowrap; }

  .breadcrumb { font-size: 13px; padding-top: 20px; }
  .tool-heading { gap: 14px; padding: 18px 0 20px; flex-direction: column; }
  .tool-heading > .tool-icon { width: 48px; height: 48px; }
  .tool-heading h1 { margin: 10px 0; }
  .tool-heading p { font-size: 16px; }
  .tool-workspace { border-radius: 16px; margin: 0 calc(var(--gutter) * -0.5); }
  .inputs, .result-panel { padding: 20px 18px; }
  .field-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .result-placeholder { min-height: 160px; }
  .result-actions .button, .result-actions .secondary { flex: 1; }
  .actions .button { flex: 1; }
  .tool-explainer { margin-top: 44px; gap: 36px; }
  .tool-explainer p, .steps { font-size: 16px; }

  .prose { margin-top: 36px; }
  .prose p { font-size: 16px; }
  .prose .lead { font-size: 18px; }

  .site-footer { margin-top: 64px; padding-top: 36px; padding-bottom: 120px; }
  .site-footer nav { grid-template-columns: repeat(2, auto); gap: 12px 28px; justify-content: start; }
  .ad-bottom { margin-top: 44px; }

  .consent { right: 10px; left: 10px; bottom: 10px; width: auto; padding: 16px; border-radius: 16px; gap: 12px; }
  .consent h2 { font-size: 17px; }
  .consent p { font-size: 14px; line-height: 1.55; }
  .consent-actions .button, .consent-actions .secondary { flex: 1 1 40%; white-space: normal; }
  .consent-actions .button { flex-basis: 100%; }

  .admin-shell { display: block; }
  .admin-nav { padding: 12px var(--gutter); flex-direction: row; gap: 4px; overflow-x: auto; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .admin-nav > .eyebrow, .admin-nav-bottom { display: none; }
  .admin-nav > button { padding: 9px 12px; white-space: nowrap; font-size: 14px; flex: none; gap: 8px; }
  .admin-main { padding: 24px var(--gutter) 48px; }
  .admin-heading { flex-wrap: wrap; gap: 12px; }
  .admin-heading > div { flex-basis: 100%; }
  .admin-heading h1 { font-size: 28px; }
  .mobile-owner-logout { display: inline-flex; }
  .metric-grid { gap: 8px; }
  .metric-card { padding: 16px; }
  .metric-card > b { font-size: 32px; }
  .dashboard-card { padding: 18px 16px; border-radius: 14px; }
  .dashboard-card .panel-heading { align-items: flex-start; }
  .dashboard-card .field-grid .wide { grid-column: auto; }
  .chart { height: 200px; gap: 3px; }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .login-wrap { min-height: calc(100vh - 120px); padding: 32px var(--gutter); }
  .login-card { padding: 28px 22px; border-radius: 18px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 18px; }
  .brand-mark { grid-template-columns: repeat(2, 7px); }
  .brand-mark i { width: 7px; height: 7px; }
  .hero h1 { font-size: 42px; }
  .category-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.dashboard-card form > p { margin-top: 16px; }

/* Right-to-left (Arabic): mirror directional icons and keep numbers readable */
[dir="rtl"] .i-arrow { transform: scaleX(-1); }
[dir="rtl"] .result-value, [dir="rtl"] input[type="number"], [dir="rtl"] .formula, [dir="rtl"] .example-block, [dir="rtl"] pre { direction: ltr; unicode-bidi: plaintext; text-align: start; }
[dir="rtl"] .result-row, [dir="rtl"] .result-list li { unicode-bidi: plaintext; }

/* v3.2: score meter and highlighted text (AI detector) */
.cat-student { --hue: #8fd3ff; }
.result-meter { --meter: var(--text-2); margin-bottom: 6px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.result-meter[data-band="low"] { --meter: var(--ok); }
.result-meter[data-band="mid"] { --meter: #d9de6a; }
.result-meter[data-band="high"] { --meter: #ffb35c; }
.result-meter[data-band="top"] { --meter: var(--danger); }
.result-meter > span { display: block; font-size: 14px; color: var(--text-2); margin-bottom: 6px; }
.meter-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.meter-value b { font-family: var(--display); font-size: clamp(44px, 4.4vw, 60px); font-weight: 650; letter-spacing: -0.035em; line-height: 1; font-variant-numeric: tabular-nums; }
.meter-value em { font-style: normal; color: var(--text-3); font-size: 18px; }
.meter-value small { flex-basis: 100%; font-size: 16px; font-weight: 600; color: var(--meter); }
.meter-track { position: relative; height: 10px; margin-top: 16px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter-track > i { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--meter); }
.meter-scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; direction: ltr; }
.result-entry.compact > b, .result-entry.compact:nth-child(n + 3) > b { font-size: 19px; letter-spacing: -0.01em; }
.result-entry.compact { padding: 11px 0; }
.marks-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px 16px; flex-wrap: wrap; margin-top: 20px; font-size: 14px; color: var(--text-2); }
.marks-head > b { color: var(--text); font-weight: 600; }
.marks-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.marks-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; border-radius: 2px; background: #ffb35c; vertical-align: -1px; }
.marks-legend span.k-transition::before { background: #8fa2ff; }
.result-marked { margin-top: 10px; padding: 14px 16px; max-height: 420px; overflow: auto; font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; }
.result-marked:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.result-marked mark { color: var(--text); background: color-mix(in srgb, #ffb35c 22%, transparent); box-shadow: inset 0 -2px 0 #ffb35c; border-radius: 3px; padding: 0 1px; }
.result-marked mark.k-transition { background: color-mix(in srgb, #8fa2ff 20%, transparent); box-shadow: inset 0 -2px 0 #8fa2ff; }
.field textarea.prose-input { font-family: var(--body); font-size: 15.5px; line-height: 1.7; }
