/* =====================================================================
   YouTube Creator Tools — design system
   Mobile-first. No framework. Light + dark themes.
   ===================================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --brand-50: #fff1f3;
  --brand-100: #ffe0e5;
  --brand-200: #ffc5ce;
  --brand-400: #ff6b7f;
  --brand-500: #ff2e4d;
  --brand-600: #e8123a;
  --brand-700: #c30b2e;
  --accent-400: #ffc25c;
  --accent-500: #ff9f1c;
  --accent-600: #e07c00;

  --grad-brand: linear-gradient(135deg, #ff2e4d 0%, #ff7a18 100%);
  --grad-soft: linear-gradient(135deg, #ff2e4d 0%, #ff8a3d 100%);

  --bg: #ffffff;
  --bg-alt: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f4f5f8;
  --surface-3: #eceef3;
  --border: #e4e7ee;
  --border-strong: #d2d7e2;
  --text: #0e1117;
  --text-2: #39414f;
  --muted: #646d7d;
  --ring: rgba(255, 46, 77, 0.35);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 14px 40px rgba(16, 24, 40, 0.12);
  --shadow-brand: 0 10px 30px rgba(255, 46, 77, 0.28);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: 'Sora', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --container: 1220px;
  --container-narrow: 780px;
  --header-h: 68px;

  --step: clamp(0.9rem, 0.85rem + 0.2vw, 1rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --t-fast: 140ms var(--ease);
  --t: 220ms var(--ease);
}

[data-theme='dark'] {
  --brand-50: #2a1218;
  --brand-100: #3d1620;
  --brand-200: #5c1c2a;
  --bg: #0b0d12;
  --bg-alt: #0e1117;
  --surface: #131722;
  --surface-2: #191e2a;
  --surface-3: #212736;
  --border: #262d3d;
  --border-strong: #333c50;
  --text: #eef1f7;
  --text-2: #c2c9d6;
  --muted: #94a0b4;
  --ring: rgba(255, 106, 127, 0.4);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.55);
  --shadow-brand: 0 10px 30px rgba(255, 46, 77, 0.32);
}

/* ---------- 2. Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
  margin: 0 0 0.5em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(1.95rem, 1.4rem + 2.4vw, 3.15rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem); }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
[data-theme='dark'] a { color: var(--brand-400); }
[data-theme='dark'] a:hover { color: #ff8b9b; }

img, svg, canvas, video { max-width: 100%; display: block; }
ul, ol { margin: 0 0 1rem; padding-left: 1.15rem; }
small { font-size: 0.82rem; }

button, input, select, textarea { font: inherit; color: inherit; }

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

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 200;
  background: var(--brand-500);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top var(--t);
}
.skip-link:focus { top: 12px; color: #fff; }

.icon { flex: none; }

/* ---------- 3. Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 18px;
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: clamp(2.5rem, 2rem + 2.5vw, 4.5rem); }
.section--tight { padding-block: clamp(1.75rem, 1.5rem + 1.4vw, 2.75rem); }
.section--alt { background: var(--bg-alt); }
.section--prose { padding-block: clamp(2rem, 1.6rem + 2vw, 3.5rem); }

.section__title { margin-bottom: 0.6em; }
.section__intro { color: var(--muted); font-size: 1.06rem; max-width: 62ch; margin-bottom: 1.6rem; }
.section__head { max-width: 68ch; margin-bottom: 2rem; }
.section__head--center { margin-inline: auto; text-align: center; }

/* ---------- 4. Buttons ---------- */
.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-bd: var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  min-height: 46px;
  border: 1px solid var(--btn-bd);
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.96rem;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition: transform var(--t-fast), box-shadow var(--t), background var(--t), border-color var(--t), opacity var(--t);
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); color: var(--btn-fg); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn[aria-disabled='true'] { opacity: 0.5; pointer-events: none; }

.btn--primary {
  --btn-bg: var(--brand-500);
  --btn-fg: #fff;
  --btn-bd: var(--brand-500);
  box-shadow: var(--shadow-brand);
}
.btn--primary:hover { --btn-bg: var(--brand-600); --btn-bd: var(--brand-600); color: #fff; }

.btn--soft { --btn-bg: var(--brand-50); --btn-fg: var(--brand-600); --btn-bd: transparent; }
[data-theme='dark'] .btn--soft { --btn-fg: var(--brand-400); }
.btn--soft:hover { --btn-bg: var(--brand-100); }

.btn--ghost { --btn-bg: transparent; --btn-bd: var(--border-strong); }
.btn--ghost:hover { --btn-bg: var(--surface-2); }

.btn--ghost-light { --btn-bg: rgba(255, 255, 255, 0.14); --btn-fg: #fff; --btn-bd: rgba(255, 255, 255, 0.4); }
.btn--ghost-light:hover { --btn-bg: rgba(255, 255, 255, 0.24); color: #fff; }

.btn--sm { padding: 9px 15px; min-height: 38px; font-size: 0.9rem; }
.btn--xs { padding: 7px 12px; min-height: 34px; font-size: 0.84rem; border-radius: var(--radius-xs); }
.btn--lg { padding: 15px 28px; min-height: 54px; font-size: 1.03rem; }
.btn--block { width: 100%; }
.btn--icon { padding: 10px; min-width: 42px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background var(--t), color var(--t), border-color var(--t);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

[data-theme='light'] .icon-btn__moon,
[data-theme='dark'] .icon-btn__sun { display: none; }

.linklike {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text-2);
  cursor: pointer;
  text-align: left;
  font: inherit;
  text-decoration: none;
}
.linklike:hover { color: var(--brand-600); text-decoration: underline; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.link-arrow .icon { transition: transform var(--t); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- 5. Tags / pills ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
[data-theme='dark'] .tag { color: var(--brand-400); }
.tag--muted { background: var(--surface-2); color: var(--muted); }
.tag--success { background: rgba(16, 185, 129, 0.12); color: #0f8a5f; }
[data-theme='dark'] .tag--success { color: #4ade80; }

/* ---------- 6. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: var(--header-h);
}

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); flex: none; }
.brand:hover { color: var(--text); }
.brand__mark { display: block; line-height: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name { font-family: var(--font-display); font-weight: 700; font-size: 0.98rem; letter-spacing: -0.02em; }
.brand__sub { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }

.nav { display: none; margin-inline: auto; }
.nav__list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-weight: 500;
  font-size: 0.94rem;
  background: none;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--t), color var(--t);
}
.nav__link:hover { background: var(--surface-2); color: var(--text); }
.nav__link.is-active { color: var(--brand-600); font-weight: 600; }
[data-theme='dark'] .nav__link.is-active { color: var(--brand-400); }
.nav__link[aria-expanded='true'] { background: var(--surface-2); color: var(--text); }
.nav__chev { transition: transform var(--t); }
.nav__link[aria-expanded='true'] .nav__chev { transform: rotate(180deg); }

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

/* mega menu */
.mega {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: dropIn 180ms var(--ease);
}
.mega__inner { max-width: var(--container); margin-inline: auto; padding: 22px 18px 18px; }
.mega__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
}
.mega__link {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: var(--text);
  transition: background var(--t);
}
.mega__link:hover, .mega__link.is-active { background: var(--surface-2); color: var(--text); }
.mega__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--brand-600);
}
[data-theme='dark'] .mega__icon { color: var(--brand-400); }
.mega__body { display: flex; flex-direction: column; min-width: 0; }
.mega__title { font-weight: 600; font-size: 0.94rem; }
.mega__desc { font-size: 0.82rem; color: var(--muted); line-height: 1.4; }
.mega__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}
.mega__foot p { display: inline-flex; align-items: center; gap: 7px; margin: 0; }

@keyframes dropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* mobile nav */
.icon-btn--menu { display: inline-flex; }
.mobile-nav {
  border-top: 1px solid var(--border);
  background: var(--surface);
  max-height: calc(100dvh - var(--header-h));
  overflow-y: auto;
  animation: dropIn 180ms var(--ease);
}
.mobile-nav__inner { padding: 16px 18px 26px; display: flex; flex-direction: column; gap: 14px; }
.mobile-nav__search { position: relative; display: flex; align-items: center; }
.mobile-nav__search .icon { position: absolute; left: 12px; color: var(--muted); }
.mobile-nav__search input {
  width: 100%;
  padding: 11px 12px 11px 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.mobile-nav__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.mobile-nav__tools {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
}
.mobile-nav__tools a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
}
.mobile-nav__tools a:hover { background: var(--surface-2); color: var(--text); }
.mobile-nav__icon { color: var(--brand-600); display: grid; place-items: center; }
[data-theme='dark'] .mobile-nav__icon { color: var(--brand-400); }
.mobile-nav__pages { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 8px; }
.mobile-nav__pages a { display: inline-block; padding: 8px 14px; border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-2); font-weight: 500; font-size: 0.9rem; }
.mobile-nav__pages a:hover { color: var(--text); }

@media (min-width: 600px) {
  .mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-nav__tools { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .container { padding-inline: 24px; }
  .nav { display: block; }
  .icon-btn--menu, .mobile-nav { display: none !important; }
  .mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mega__inner { padding: 24px; }
}
@media (min-width: 1120px) {
  .mega__grid { grid-template-columns: repeat(2, minmax(0, 1fr)) 1fr; }
  .mega__grid > .mega__item:nth-child(6) { border-left: 1px solid var(--border); }
}

/* ---------- 7. Ads ---------- */
.ad { display: block; margin-inline: auto; text-align: center; }
.ad__label {
  display: block;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 5px;
}
.ad__surface {
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.78rem;
  overflow: hidden;
}
.ad__hint { padding: 6px 10px; }
.ad__surface > ins { display: block; width: 100%; }
.ad--header { padding-top: 14px; }
.ad--header .ad__surface { min-height: 90px; }
.ad--in-content { margin-block: 10px; }
.ad--in-content .ad__surface { min-height: 120px; }
.ad--sidebar { margin-bottom: 20px; }
.ad--sidebar .ad__surface { min-height: 260px; }
.ad--footer { padding-block: 8px 20px; }
.ad--footer .ad__surface { min-height: 90px; }
.ad--tool { padding-block: 12px; }
.ad--tool .ad__surface { min-height: 100px; }
@media (max-width: 899px) { .ad--sidebar { display: none; } }
body[data-ads='on'] .ad__surface { border-style: solid; border-color: transparent; background: transparent; }
body[data-ads='on'] .ad__hint { display: none; }

/* ---------- 8. Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(2.5rem, 2rem + 3vw, 4rem); }
.hero::before {
  content: '';
  position: absolute;
  inset: -40% 30% 40% -10%;
  background: radial-gradient(closest-side, rgba(255, 46, 77, 0.22), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 20% -20% -50% 55%;
  background: radial-gradient(closest-side, rgba(255, 159, 28, 0.18), transparent 70%);
  pointer-events: none;
}
.hero__inner { position: relative; display: grid; gap: clamp(2rem, 1.5rem + 3vw, 3.5rem); align-items: center; }
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
}
.hero__badge span {
  background: var(--grad-brand);
  color: #fff;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero__title { margin-bottom: 18px; }
.hero__title em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__subtitle { font-size: clamp(1rem, 0.95rem + 0.35vw, 1.2rem); color: var(--text-2); max-width: 56ch; margin-bottom: 26px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; }
.hero__points { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero__points li { display: flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--muted); font-weight: 500; }
.hero__points .icon { color: var(--brand-500); }

.hero__panel { position: relative; }
.hero__card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}
.hero__preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.hero__preview span {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  color: #fff;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  padding: 0 1rem;
  text-align: center;
}
.hero__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.hero__stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.hero__stat b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.hero__stat small { color: var(--muted); font-size: 0.72rem; }

@media (min-width: 900px) {
  .hero__inner { grid-template-columns: 1.05fr 0.95fr; }
}
@media (min-width: 600px) {
  .hero__stats { gap: 14px; }
}

/* ---------- 9. Trust strip ---------- */
.trust { border-block: 1px solid var(--border); background: var(--bg-alt); }
.trust__grid { display: grid; gap: 18px; padding-block: 22px; grid-template-columns: repeat(2, 1fr); }
.trust__item { display: flex; gap: 11px; align-items: flex-start; }
.trust__item .icon { color: var(--brand-500); margin-top: 2px; }
.trust__item b { display: block; font-size: 0.93rem; }
.trust__item small { color: var(--muted); font-size: 0.8rem; line-height: 1.45; display: block; }
@media (min-width: 860px) { .trust__grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 10. Tool cards ---------- */
.tool-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .tool-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tool-grid--compact { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 560px) and (max-width: 999px) { .tool-grid--compact { grid-template-columns: repeat(2, 1fr); } }

.tool-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
  position: relative;
  overflow: hidden;
}
.tool-card::after {
  content: '';
  position: absolute;
  inset: auto -40% -70% 40%;
  height: 160px;
  background: radial-gradient(closest-side, rgba(255, 46, 77, 0.12), transparent 70%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.tool-card:hover::after { opacity: 1; }
.tool-card__link { display: flex; gap: 13px; color: var(--text); flex: 1; }
.tool-card__link:hover { color: var(--text); }
.tool-card__icon {
  display: grid;
  place-items: center;
  width: 46px; height: 46px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--brand-50);
  color: var(--brand-600);
  transition: background var(--t), color var(--t);
}
[data-theme='dark'] .tool-card__icon { color: var(--brand-400); }
.tool-card:hover .tool-card__icon { background: var(--grad-brand); color: #fff; }
.tool-card__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tool-card__name { font-family: var(--font-display); font-weight: 700; font-size: 1.03rem; letter-spacing: -0.01em; }
.tool-card__desc { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.tool-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
.tool-card--compact { padding: 15px; }
.tool-card--compact .tool-card__icon { width: 40px; height: 40px; }
.tool-card--compact .tool-card__name { font-size: 0.96rem; }
.tool-card--compact .tool-card__desc { font-size: 0.82rem; }
.tool-card--compact .tool-card__foot { margin-top: 12px; padding-top: 11px; }

/* ---------- 11. Feature grid (home value props) ---------- */
.value-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .value-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .value-grid { grid-template-columns: repeat(3, 1fr); } }
.value {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.value__icon {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  background: var(--grad-brand);
  color: #fff;
  margin-bottom: 14px;
  box-shadow: var(--shadow-brand);
}
.value h3 { font-size: 1.06rem; margin-bottom: 6px; }
.value p { color: var(--muted); font-size: 0.92rem; }

.split { display: grid; gap: clamp(1.8rem, 1.4rem + 2vw, 3rem); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split--sidebar { grid-template-columns: minmax(0, 1fr) 300px; } }

.checklist { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: 11px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.checklist .icon { color: var(--brand-500); margin-top: 4px; flex: none; }

/* ---------- 12. Steps / features / faq / prose ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: step; }
.steps__item { display: flex; gap: 14px; }
.steps__num {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  flex: none;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--brand-600);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.92rem;
}
[data-theme='dark'] .steps__num { color: var(--brand-400); }
.steps__title { font-size: 1rem; margin-bottom: 3px; }
.steps__text { color: var(--muted); font-size: 0.93rem; margin: 0; }

.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.feature__icon {
  display: grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--brand-600);
  margin-bottom: 11px;
}
[data-theme='dark'] .feature__icon { color: var(--brand-400); }
.feature__title { font-size: 0.99rem; margin-bottom: 4px; }
.feature__text { color: var(--muted); font-size: 0.9rem; margin: 0; }

.faq { display: grid; gap: 10px; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.faq__q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 17px;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q:hover { color: var(--brand-600); }
.faq__chev { color: var(--muted); transition: transform var(--t); flex: none; }
.faq__item[open] .faq__chev { transform: rotate(180deg); }
.faq__a { padding: 0 17px 16px; color: var(--muted); font-size: 0.93rem; }
.faq__a p { margin: 0; }

.prose { color: var(--text-2); font-size: 1rem; }
.prose h2 { margin-top: 1.8em; font-size: 1.42rem; }
.prose h3 { margin-top: 1.6em; font-size: 1.1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li { margin-bottom: 0.4em; }
.prose li::marker { color: var(--brand-500); }
.prose strong { color: var(--text); }
.prose code {
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--brand-500);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; font-size: 0.93rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.prose thead th { background: var(--surface-2); font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; background: var(--surface); }
.table caption { text-align: left; padding: 12px 14px; font-weight: 600; border-bottom: 1px solid var(--border); }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.table thead th { background: var(--surface-2); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.table tbody th { font-weight: 600; }
.table tbody tr:last-child td, .table tbody tr:last-child th { border-bottom: 0; }

/* ---------- 13. CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, #1b1024 0%, #2a0f1c 45%, #33110a 100%);
  color: #fff;
  padding-block: clamp(2.2rem, 1.8rem + 2vw, 3.4rem);
}
.cta-band__inner { display: grid; gap: 20px; align-items: center; }
.cta-band__title { color: #fff; margin-bottom: 6px; }
.cta-band__text { color: rgba(255, 255, 255, 0.78); margin: 0; max-width: 52ch; }
.cta-band__actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (min-width: 860px) { .cta-band__inner { grid-template-columns: 1fr auto; } }

/* ---------- 14. Page hero (tool + content pages) ---------- */
.page-hero { padding-block: clamp(1.6rem, 1.2rem + 2vw, 2.8rem) clamp(1.4rem, 1rem + 1.6vw, 2.2rem); }
.page-hero__inner { display: grid; gap: 20px; }
.page-hero__title { margin-bottom: 12px; }
.page-hero__lead { font-size: clamp(1rem, 0.95rem + 0.3vw, 1.14rem); color: var(--text-2); max-width: 70ch; }
.page-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.breadcrumbs { margin-bottom: 18px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; font-size: 0.84rem; color: var(--muted); }
.breadcrumbs li + li::before { content: '/'; margin-right: 6px; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand-600); }
@media (min-width: 900px) { .page-hero__inner--with-media { grid-template-columns: 1.1fr 0.9fr; align-items: center; } }

.tip {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--text-2);
  margin: 18px 0;
}
.tip .icon { color: var(--brand-500); flex: none; margin-top: 2px; }
.tip p { margin: 0; }
.tip--ok { border-left-color: #10b981; }
.tip--ok .icon { color: #10b981; }

/* =====================================================================
   15. Tool workspace (shared by all image tools)
   ===================================================================== */
.workspace {
  background: var(--bg-alt);
  border-block: 1px solid var(--border);
  padding-block: clamp(1.2rem, 1rem + 1vw, 2rem);
}
.workspace__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.workspace__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin: 0; }
.workspace__badge { padding: 4px 10px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); font-size: 0.76rem; color: var(--muted); font-family: var(--font-sans); font-weight: 600; }
.workspace__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.tool-layout { display: grid; gap: 16px; align-items: start; }
@media (min-width: 1000px) { .tool-layout { grid-template-columns: 330px minmax(0, 1fr); } .tool-layout--wide { grid-template-columns: 360px minmax(0, 1fr); } }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 14px; }
.panel--soft { background: var(--surface-2); box-shadow: none; }
.panel--pad { padding: 22px; }
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.94rem;
}
.panel__head .icon { color: var(--brand-500); }
.panel__body { padding: 16px; }
.panel__body--tight { padding: 12px; }
.panel__note { font-size: 0.82rem; color: var(--muted); margin: 0; }

/* dropzone */
.dropzone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 28px 18px;
  text-align: center;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--t), background var(--t), transform var(--t);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--brand-500); }
.dropzone.is-drag { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme='dark'] .dropzone.is-drag { background: var(--brand-100); }
.dropzone.is-busy { pointer-events: none; opacity: 0.7; }
.dropzone__icon { color: var(--brand-500); }
.dropzone__title { font-weight: 600; font-size: 1rem; }
.dropzone__hint { font-size: 0.84rem; color: var(--muted); }
.dropzone input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* canvas stage */
.stage-wrap { display: grid; gap: 12px; }
.stage {
  position: relative;
  background:
    linear-gradient(45deg, var(--surface-3) 25%, transparent 25%) 0 0 / 18px 18px,
    linear-gradient(-45deg, var(--surface-3) 25%, transparent 25%) 0 9px / 18px 18px,
    linear-gradient(45deg, transparent 75%, var(--surface-3) 75%) 9px -9px / 18px 18px,
    linear-gradient(-45deg, transparent 75%, var(--surface-3) 75%) -9px 0 / 18px 18px,
    var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: auto;
  min-height: 260px;
}
.stage__inner { position: relative; margin: auto; max-width: 100%; }
.stage canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: var(--shadow-md);
  touch-action: none;
  background: #fff;
}
.stage canvas.is-grabbing { cursor: grabbing; }
.stage__overlay { position: absolute; top: 0; left: 0; pointer-events: none; box-shadow: none; background: none; }
.stage__empty { color: var(--muted); text-align: center; display: grid; gap: 8px; place-items: center; padding: 40px 20px; }
.stage__empty .icon { color: var(--border-strong); }

.stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--muted);
}
.stage-bar__group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.zoom { display: flex; align-items: center; gap: 4px; }
.zoom input { width: 110px; }

/* sidebar controls */
.controls { display: grid; gap: 14px; }
.control { display: grid; gap: 6px; }
.control__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
}
.control__value { font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.control__hint { font-size: 0.78rem; color: var(--muted); }

.field { display: grid; gap: 6px; }
.field > label, .field__label { font-size: 0.82rem; font-weight: 600; color: var(--text-2); }
.input, .select, .textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color var(--t), box-shadow var(--t);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-400); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--ring);
}
.textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23646d7d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9.5 12 15.5l6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 34px;
}
.field__row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.field__error { color: #e11d48; font-size: 0.8rem; font-weight: 500; }
[data-theme='dark'] .field__error { color: #ff8b9b; }

.checkbox, .radio { display: flex; gap: 9px; align-items: flex-start; font-size: 0.9rem; cursor: pointer; }
.checkbox input, .radio input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand-500); flex: none; }

.range { width: 100%; height: 26px; appearance: none; background: none; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--surface-3); }
.range::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-3); }
.range::-webkit-slider-thumb {
  appearance: none;
  width: 20px; height: 20px;
  margin-top: -7px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.range::-moz-range-thumb {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand-500);
  border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm);
}

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  border: 0;
  border-radius: var(--radius-xs);
  background: none;
  color: var(--text-2);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t), color var(--t);
}
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-pressed='true'], .seg__btn.is-active { background: var(--surface); color: var(--brand-600); box-shadow: var(--shadow-xs); }
[data-theme='dark'] .seg__btn[aria-pressed='true'], [data-theme='dark'] .seg__btn.is-active { color: var(--brand-400); }
.seg--block { display: flex; }
.seg--block .seg__btn { flex: 1; justify-content: center; }

.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.swatch {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  padding: 0;
  transition: transform var(--t-fast), box-shadow var(--t);
}
.swatch:hover { transform: scale(1.08); }
.swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-500); }

.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type='color'] {
  width: 42px; height: 38px;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.color-field .input { font-variant-numeric: tabular-nums; text-transform: uppercase; }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row--split { justify-content: space-between; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); padding: 0 6px; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: 11px 12px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tab::after {
  content: '';
  position: absolute;
  left: 8px; right: 8px; bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background var(--t);
}
.tab:hover { color: var(--text); }
.tab[aria-selected='true'] { color: var(--brand-600); }
[data-theme='dark'] .tab[aria-selected='true'] { color: var(--brand-400); }
.tab[aria-selected='true']::after { background: var(--brand-500); }
.tabpanel { display: none; }
.tabpanel.is-active { display: block; animation: fadeUp 200ms var(--ease); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* layer list */
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.layer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.88rem;
  transition: border-color var(--t), background var(--t);
}
.layer:hover { border-color: var(--border-strong); }
.layer.is-selected { border-color: var(--brand-500); background: var(--brand-50); }
[data-theme='dark'] .layer.is-selected { background: var(--brand-100); }
.layer__icon { color: var(--muted); display: grid; place-items: center; }
.layer__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.layer__btn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 3px;
  border-radius: 5px;
  display: grid;
  place-items: center;
}
.layer__btn:hover { color: var(--brand-600); background: var(--surface-2); }
.layer__btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* stats / result cards */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.stat__label { display: block; font-size: 0.76rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat__value { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-top: 3px; word-break: break-word; }
.stat--big { grid-column: 1 / -1; }
.stat--big .stat__value { font-size: 1.6rem; }
.stat--good .stat__value { color: #059669; }
[data-theme='dark'] .stat--good .stat__value { color: #34d399; }

.compare { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare__box { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.compare__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px; font-size: 0.8rem; font-weight: 600; border-bottom: 1px solid var(--border); }
.compare__media { display: grid; place-items: center; padding: 10px; min-height: 180px; }
.compare__media img { max-height: 320px; width: auto; border-radius: 6px; box-shadow: var(--shadow-sm); }

.result-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
}
.result:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.result__body { flex: 1; min-width: 0; }
.result__text { font-size: 0.94rem; font-weight: 500; line-height: 1.45; }
.result__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 0.76rem; color: var(--muted); }
.result__actions { display: flex; gap: 6px; flex: none; }
.result__cat { font-size: 0.7rem; }

.gallery { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .gallery--wide { grid-template-columns: repeat(4, 1fr); } }
.chip-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 0.88rem;
  font-weight: 500;
}
.chip-item__tag { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-item__btn { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 3px; border-radius: 5px; display: grid; place-items: center; }
.chip-item__btn:hover { color: var(--brand-600); background: var(--surface-2); }

.chip-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 8px 7px 12px;
  border-radius: var(--radius-full);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 0.86rem;
  font-weight: 600;
}
[data-theme='dark'] .chip { color: var(--brand-400); }
.chip__x { border: 0; background: none; color: inherit; cursor: pointer; padding: 2px; border-radius: 50%; display: grid; place-items: center; opacity: 0.7; }
.chip__x:hover { opacity: 1; background: rgba(255, 46, 77, 0.14); }

.counter { font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.counter.is-warn { color: #d97706; }
.counter.is-over { color: #e11d48; font-weight: 600; }

.templates { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .templates { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .templates { grid-template-columns: repeat(4, 1fr); } }
.template {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.template:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-400); }
.template__art { aspect-ratio: 16 / 9; display: grid; place-items: center; color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.04em; text-align: center; padding: 6px; text-transform: uppercase; }
.template--portrait .template__art { aspect-ratio: 9 / 16; }
.template--square .template__art { aspect-ratio: 1 / 1; }
.template--wide .template__art { aspect-ratio: 16 / 6.2; }
.template__name { display: block; padding: 8px 10px; font-size: 0.8rem; font-weight: 600; }

.preview-frame { display: grid; gap: 16px; }
.frame-card { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); padding: 14px; }
.frame-card__label { font-size: 0.78rem; font-weight: 600; color: var(--muted); margin-bottom: 10px; display: block; text-transform: uppercase; letter-spacing: 0.06em; }
.frame-card img { margin-inline: auto; box-shadow: var(--shadow-sm); border-radius: 4px; max-width: 100%; }
.circle-mask { border-radius: 50%; overflow: hidden; }
.dot-mask {
  -webkit-mask-image: radial-gradient(circle at center, #000 99%, transparent 100%);
  mask-image: radial-gradient(circle at center, #000 99%, transparent 100%);
}
.youtube-frame { background: var(--surface); border-radius: 12px; padding: 10px; display: grid; gap: 10px; }
.youtube-frame__row { display: flex; gap: 10px; align-items: center; }
.youtube-frame__thumb { width: 92px; aspect-ratio: 16/9; border-radius: 6px; background: var(--surface-3); flex: none; }
.youtube-frame__lines { flex: 1; display: grid; gap: 6px; }
.youtube-frame__lines i { display: block; height: 8px; border-radius: 4px; background: var(--surface-3); }
.youtube-frame__lines i:nth-child(2) { width: 70%; }
.youtube-frame__lines i:nth-child(3) { width: 45%; background: var(--surface-2); }

.batch-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.batch-row:last-child { border-bottom: 0; }
.batch-row__thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: none; }
.batch-row__body { flex: 1; min-width: 0; }
.batch-row__name { font-size: 0.88rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-row__meta { font-size: 0.78rem; color: var(--muted); }
.batch-row__actions { display: flex; gap: 6px; flex: none; }

.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress__bar { height: 100%; width: 0; background: var(--grad-brand); transition: width 200ms var(--ease); }

.spinner {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--brand-500);
  animation: spin 700ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast-host { position: fixed; z-index: 120; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  font-weight: 500;
  animation: toastIn 220ms var(--ease);
}
.toast--success .icon { color: #10b981; }
.toast--error .icon { color: #e11d48; }
.toast--info .icon { color: var(--brand-500); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.empty-state { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty-state .icon { color: var(--border-strong); margin: 0 auto 10px; }
.empty-state h3 { font-size: 1.02rem; color: var(--text); }
.empty-state p { font-size: 0.9rem; max-width: 40ch; margin-inline: auto; }

/* ---------- 16. Blog ---------- */
.tool-filter { display: grid; gap: 12px; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.tool-filter__search { font-size: 1rem; }
.tool-filter__summary { margin: 0; font-size: 0.85rem; color: var(--muted); }
.tool-filter .chip[aria-pressed='true'] { background: var(--brand-500); border-color: var(--brand-500); color: #fff; }
[data-tools-hidden] { display: none !important; }

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
  color: var(--text);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--text); }
.post-card__art { display: block; aspect-ratio: 1200 / 630; background: var(--surface-2); overflow: hidden; }
.post-card__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card:hover .post-card__art img { transform: scale(1.03); }
.post-card__art img { transition: transform var(--t); }
.post-card__body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.78rem; color: var(--muted); }

.post-feature {
  display: grid;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  transition: transform var(--t), box-shadow var(--t);
}
.post-feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--text); }
.post-feature__art { display: block; background: var(--surface-2); }
.post-feature__art img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-feature__body { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.post-feature__title { font-family: var(--font-display); font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem); line-height: 1.2; }
.post-feature__excerpt { color: var(--muted); font-size: 0.95rem; margin: 0; max-width: 68ch; }
@media (min-width: 860px) {
  .post-feature { grid-template-columns: 1.15fr 1fr; align-items: center; }
  .post-feature__art { height: 100%; }
  .post-feature__art img { height: 100%; }
}

.post-card__title { font-size: 1.05rem; margin: 0; }
.post-card__excerpt { color: var(--muted); font-size: 0.9rem; margin: 0; }
.post-card__more { margin-top: auto; font-weight: 600; font-size: 0.88rem; display: inline-flex; gap: 6px; align-items: center; }
.post-card:hover .post-card__more .icon { transform: translateX(3px); }
.post-card__more .icon { transition: transform var(--t); }

.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.85rem; color: var(--muted); margin-bottom: 20px; }
.article-head { margin-bottom: 26px; }
.article-head__title { font-size: clamp(1.7rem, 1.3rem + 2vw, 2.6rem); line-height: 1.15; margin: 12px 0 10px; }
.article-head__lead { color: var(--text-2); font-size: 1.04rem; max-width: 62ch; margin: 0 0 14px; }
.article-cover { margin: 0 0 28px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.article-cover img { display: block; width: 100%; height: auto; }
.post-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 680px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1040px) { .post-grid--wide { grid-template-columns: repeat(3, 1fr); } }
.post-card__title a { color: inherit; text-decoration: none; }
.post-card__title a:hover { color: var(--brand-600); }
.toc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 24px; }
.toc h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 8px; font-family: var(--font-sans); }
.toc ol { margin: 0; padding-left: 1.1rem; font-size: 0.9rem; }
.toc li { margin-bottom: 4px; }
.toc a { color: var(--text-2); }

/* ---------- 17. Forms (contact) ---------- */
.form-grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid__full { grid-column: 1 / -1; } }
.form-note { font-size: 0.84rem; color: var(--muted); }
.form-status { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; display: none; }
.form-status.is-visible { display: block; }
.form-status--ok { background: rgba(16, 185, 129, 0.12); color: #0f8a5f; }
.form-status--err { background: rgba(225, 29, 72, 0.1); color: #e11d48; }
[data-theme='dark'] .form-status--ok { color: #4ade80; }
[data-theme='dark'] .form-status--err { color: #ff8b9b; }

/* ---------- 18. Footer ---------- */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); margin-top: 0; }
.site-footer__top { display: grid; gap: 28px; padding-block: clamp(2rem, 1.6rem + 2vw, 3rem); grid-template-columns: 1fr; }
@media (min-width: 620px) { .site-footer__top { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .site-footer__top { grid-template-columns: 1.6fr 1fr 1fr 1fr; } }
.site-footer__tagline { color: var(--text-2); font-weight: 500; margin: 12px 0 10px; }
.site-footer__note { display: flex; gap: 8px; align-items: flex-start; font-size: 0.84rem; color: var(--muted); max-width: 42ch; }
.site-footer__note .icon { color: var(--brand-500); margin-top: 2px; flex: none; }
.site-footer__badges { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.site-footer__badges li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--radius-full); background: var(--surface); border: 1px solid var(--border); font-size: 0.78rem; font-weight: 600; color: var(--text-2); }
.site-footer__badges .icon { color: var(--brand-500); }
.install-btn { margin-top: 14px; }
.install-btn[hidden] { display: none; }
[hidden] { display: none !important; }
.site-footer__title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-family: var(--font-sans); font-weight: 700; margin-bottom: 12px; }
.site-footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer__col a, .site-footer__col .linklike { color: var(--text-2); font-size: 0.9rem; }
.site-footer__col a:hover { color: var(--brand-600); }
.site-footer__bottom { border-top: 1px solid var(--border); padding-block: 18px 26px; display: grid; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.site-footer__bottom p { margin: 0; }
.site-footer__disclaimer { max-width: 80ch; }

/* ---------- 19. Cookie banner ---------- */
.cookie {
  position: fixed;
  z-index: 130;
  left: 0; right: 0; bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(16, 24, 40, 0.12);
  animation: slideUp 260ms var(--ease);
  max-height: 92dvh;
  overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.cookie__inner { display: grid; gap: 14px; padding-block: 16px; }
.cookie__title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin-bottom: 6px; }
.cookie__title .icon { color: var(--brand-500); }
.cookie__text p { font-size: 0.88rem; color: var(--muted); margin: 0; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cookie__prefs { padding-bottom: 18px; }
.cookie__prefs-title { font-size: 0.9rem; margin-bottom: 10px; }
.cookie__list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.cookie__list label { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; cursor: pointer; }
.cookie__list input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand-500); flex: none; }
.cookie__list small { color: var(--muted); }
@media (min-width: 860px) {
  .cookie__inner { grid-template-columns: 1fr auto; align-items: center; padding-block: 18px; }
  .cookie__actions { justify-content: flex-end; }
}

/* ---------- 20. Ad-blocker notice (non-blocking) ---------- */
.adblock-notice {
  position: fixed;
  z-index: 120;
  right: 16px;
  bottom: 16px;
  left: 16px;
  max-width: 460px;
  margin-inline: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--brand-500);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.16);
  animation: slideUp 260ms var(--ease);
}
.adblock-notice__body strong { display: block; font-size: 0.95rem; margin-bottom: 2px; }
.adblock-notice__body p { margin: 0; font-size: 0.85rem; color: var(--text-2); }
.adblock-notice__body a { color: var(--brand-600); text-decoration: underline; }
.adblock-notice__close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.adblock-notice__close:hover { background: var(--surface-3); color: var(--text); }
@media (max-width: 599px) {
  .adblock-notice { right: 10px; left: 10px; bottom: 10px; }
}

/* ---------- 21. Utilities ---------- */
.hide-sm { display: none; }
@media (min-width: 600px) { .hide-sm { display: inline-flex; } }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.divider { height: 1px; background: var(--border); border: 0; margin-block: 18px; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- 21. Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- 22. Print ---------- */
@media print {
  .site-header, .site-footer, .ad, .cookie, .cta-band, .workspace { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- 23. Device previews (banner / shorts / profile) ---------- */
.preview-devices { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .preview-devices { grid-template-columns: repeat(3, 1fr); } }
.preview-devices canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: #0b0d12;
  box-shadow: var(--shadow-sm);
}
.profile-preview { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .profile-preview { grid-template-columns: 220px 1fr; align-items: start; } }

/* ---------- 24. File-tool layout helpers ---------- */
.tool-layout__side { display: grid; gap: 16px; align-content: start; }
.tool-layout__main { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* ---------- 25. "Works Offline" plan page ---------- */
.plan { display: grid; gap: 22px; align-items: start; }
@media (min-width: 900px) { .plan { grid-template-columns: 1.15fr 1fr; gap: 28px; } }

.plan__card,
.plan__side {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}
.plan__card { box-shadow: var(--shadow-sm); }
.plan__price { display: flex; align-items: baseline; gap: 6px; margin: 0; }
.plan__price strong { font-size: 2.6rem; line-height: 1; letter-spacing: -0.02em; color: var(--text); }
.plan__price span { color: var(--muted); font-size: 0.95rem; }
.plan__sub { margin: 8px 0 20px; color: var(--muted); font-size: 0.92rem; }

.plan__features { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 14px; }
.plan__features li { display: flex; gap: 10px; align-items: flex-start; }
.plan__features strong { display: block; color: var(--text); font-size: 0.98rem; }
.plan__features span { color: var(--text-2); font-size: 0.9rem; }
.plan__tick { color: var(--brand-500); flex: none; margin-top: 3px; }

.plan__note { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; color: var(--muted); font-size: 0.84rem; }
.plan__note--soon { color: var(--text-2); font-weight: 600; }
.btn--block { display: block; width: 100%; text-align: center; }

.plan__side h2 { font-size: 1.24rem; margin: 0 0 8px; }
.plan__side > p { color: var(--text-2); font-size: 0.92rem; }
.plan__form { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.plan__form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 11px 13px;
  font: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.84rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.plan__form input:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

.plan__msg { min-height: 1.2em; margin: 10px 0 0; font-size: 0.86rem; }
.plan__msg[data-state='pending'] { color: var(--muted); }
.plan__msg[data-state='ok'] { color: var(--ok, #0f8a4a); font-weight: 600; }
.plan__msg[data-state='err'] { color: var(--danger, #c0392b); }

.plan__status { margin-top: 14px; }
.plan__status:empty { display: none; }
.plan__status > * { display: block; }
.plan__status strong { color: var(--text); font-size: 0.95rem; }
.plan__status span { color: var(--text-2); font-size: 0.87rem; }
.plan__status button,
.plan__status a {
  margin-top: 10px;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brand-500);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}
.plan__status[data-state='expired'] strong { color: var(--danger, #c0392b); }

/* An active license removes the ad slots outright, so no reserved gap and no
   ad script for people who are paying. */
[data-plan='active'] [data-ad-placement] { display: none !important; }
