/*
 * ZoImage design system — global styles loaded on every page.
 * Tool-only components (forms, dropzone, preview, progress) live in tool.css.
 *
 * Visual language: warm neutrals, ink-black actions, one orange brand accent,
 * a color per tool category, crisp 1px borders and almost no shadows.
 *
 * 1. Fonts  2. Tokens  3. Reset  4. Typography  5. Layout  6. Header & navigation
 * 7. Tool menu  8. Buttons  9. Cards & tiles  10. Tags  11. Alerts  12. Content blocks
 * 13. Footer  14. Utilities  15. Breadcrumbs & directory  16. Data tables  17. Plans  18. Ad slots
 */

/* 1. Fonts (self-hosted, see scripts/vendor.js) ------------------------------ */

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/plus-jakarta-sans-vietnamese-wght-normal.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

/*
 * Fallback faces sized to Plus Jakarta Sans (measured widths/ascent vs Arial), so text keeps
 * almost the same size and line breaks while the web font loads (less layout shift).
 */
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  font-weight: 200 599;
  src: local("Arial"), local("ArialMT");
  size-adjust: 103.87%;
  ascent-override: 100.13%;
  descent-override: 21.18%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  font-weight: 600 800;
  src: local("Arial Bold"), local("Arial-BoldMT");
  size-adjust: 101.5%;
  ascent-override: 102.46%;
  descent-override: 21.67%;
  line-gap-override: 0%;
}

/* 2. Tokens ----------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --font-sans: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
  --text-3xl: clamp(2rem, 1.4rem + 2.6vw, 3rem);
  --text-display: clamp(2.25rem, 1.4rem + 3.6vw, 3.75rem);
  --leading: 1.6;
  --leading-tight: 1.15;
  --tracking-tight: -0.025em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  --radius-sm: 4px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-full: 999px;

  --container: 76rem;
  --container-narrow: 44rem;
  --header-height: 4rem;
  --touch-target: 2.75rem;
  --duration: 140ms;

  /* Neutrals: warm off-whites and near-black ink. */
  --color-bg: #ffffff;
  --color-surface: #f6f5f1;
  --color-surface-raised: #ffffff;
  --color-border: #e6e4dd;
  --color-border-strong: #c9c6bc;
  --color-text: #17181c;
  --color-text-muted: #5d5f66;
  --color-link: #17181c;

  /* Brand accent (decorative) and its accessible interactive shade (text, borders, focus). */
  --color-brand: #ff5a1f;
  --color-primary: #c2410c;
  --color-primary-hover: #9a3412;
  --color-primary-soft: #fff1ea;
  --color-focus: #c2410c;

  /* Actions (buttons) are ink, not brand-colored. */
  --color-action: #17181c;
  --color-action-hover: #34363d;
  --color-on-action: #ffffff;

  /* Tool categories. */
  --cat-compress: #1e9e5a;
  --cat-edit: #1683d8;
  --cat-convert: #f2b01e;
  --cat-on-compress: #ffffff;
  --cat-on-edit: #ffffff;
  --cat-on-convert: #3b2a00;

  --color-success: #15803d;
  --color-success-text: #166534;
  --color-success-soft: #e8f6ee;
  --color-warning: #b45309;
  --color-warning-text: #7c3d06;
  --color-warning-soft: #fdf4e3;
  --color-danger: #c42b1c;
  --color-danger-text: #9b1c13;
  --color-danger-soft: #fdeceb;
  --color-checker-a: #ffffff;
  --color-checker-b: #eceae4;

  --color-footer-bg: #17181c;
  --color-footer-text: #e9e8e3;
  --color-footer-muted: #a3a4a8;
  --color-footer-border: #2c2e33;

  --shadow-sm: 0 1px 0 rgb(23 24 28 / 0.04);
  --shadow: 0 18px 40px -16px rgb(23 24 28 / 0.22);
}

@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #111214;
    --color-surface: #18191c;
    --color-surface-raised: #1d1e22;
    --color-border: #2b2d32;
    --color-border-strong: #44474e;
    --color-text: #edede9;
    --color-text-muted: #a2a4aa;
    --color-link: #edede9;
    --color-brand: #ff7a45;
    --color-primary: #ff8a5c;
    --color-primary-hover: #ffab88;
    --color-primary-soft: #2c1a12;
    --color-focus: #ff8a5c;
    --color-action: #f1f0ea;
    --color-action-hover: #d9d8d2;
    --color-on-action: #111214;
    --color-success: #4cc283;
    --color-success-text: #7ddca7;
    --color-success-soft: #13271c;
    --color-warning: #e0a93d;
    --color-warning-text: #f2c96f;
    --color-warning-soft: #2a2210;
    --color-danger: #ff7b70;
    --color-danger-text: #ffa39b;
    --color-danger-soft: #2d1614;
    --color-checker-a: #1f2024;
    --color-checker-b: #292b30;
    --color-footer-bg: #0b0c0d;
    --color-footer-border: #222428;
    --shadow-sm: none;
    --shadow: 0 18px 40px -12px rgb(0 0 0 / 0.6);
  }
}

/* 3. Reset ------------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-5);
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  position: relative; /* anchors the desktop ad rail (section 18) */
  flex: 1;
}

main:focus {
  outline: none;
}

img,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 4. Typography ------------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-3);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-3xl);
}

h2 {
  font-size: var(--text-2xl);
}

h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: -0.01em;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-link);
  text-decoration-color: var(--color-brand);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-primary);
}

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

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.lead {
  max-width: 38rem;
  font-size: var(--text-lg);
  color: var(--color-text-muted);
}

.muted {
  color: var(--color-text-muted);
}

.text-sm {
  font-size: var(--text-sm);
}

.eyebrow {
  margin-bottom: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* 5. Layout ----------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

@media (min-width: 48rem) {
  .container {
    padding-inline: var(--space-6);
  }
}

.container--narrow {
  max-width: var(--container-narrow);
}

.section {
  padding-block: var(--space-7);
}

@media (min-width: 48rem) {
  .section {
    padding-block: var(--space-8);
  }
}

.section--alt {
  background: var(--color-surface);
}

.section__header {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.section__header > :last-child {
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

/* Main content + optional sidebar (desktop only), e.g. for a future ad slot. */
.layout-split {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 64rem) {
  .layout-split {
    grid-template-columns: minmax(0, 1fr) 18rem;
  }
}

.prose {
  max-width: var(--container-narrow);
}

.prose h2 {
  margin-top: var(--space-6);
}

/* 6. Header & navigation ---------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -4rem;
  left: var(--space-4);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--color-action);
  color: var(--color-on-action);
}

.skip-link:focus {
  top: var(--space-3);
  color: var(--color-on-action);
}

.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  text-decoration: none;
}

.site-logo:hover {
  color: var(--color-text);
}

.site-logo__accent {
  color: var(--color-brand);
}

.site-nav {
  flex: 1;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-target);
  padding-inline: var(--space-3);
  border: 0;
  border-radius: var(--radius);
  background: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.site-nav__link:hover,
.site-nav__item--mega.is-open > .site-nav__link {
  background: var(--color-surface);
  color: var(--color-text);
}

.site-nav__link[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--color-brand);
  border-radius: 0;
}

.site-nav__chevron {
  width: 1rem;
  height: 1rem;
  transition: transform var(--duration);
}

.site-nav__item--mega.is-open .site-nav__chevron {
  transform: rotate(180deg);
}

/* Mega menu: desktop dropdown under the header; accordion inside the mobile menu. */
.mega {
  display: none;
}

/* Without JavaScript, hover and keyboard focus still open the menu. */
.site-nav__item--mega:not(.is-enhanced):hover > .mega,
.site-nav__item--mega:not(.is-enhanced):focus-within > .mega,
.site-nav__item--mega.is-open > .mega {
  display: block;
}

@media (min-width: 48rem) {
  .site-nav {
    padding-left: var(--space-4);
  }

  .mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    box-shadow: var(--shadow);
  }

  /* Invisible bridge over the gap between the trigger and the panel, so hover isn't lost. */
  .mega::before {
    content: "";
    position: absolute;
    top: -1rem;
    left: 0;
    right: 0;
    height: 1rem;
  }

  .mega__inner {
    padding-block: var(--space-6) var(--space-7);
  }
}

@media (max-width: 47.99rem) {
  .site-nav {
    display: none;
    flex-basis: 100%;
  }

  .site-header.is-nav-open .site-nav {
    display: block;
    padding-bottom: var(--space-3);
  }

  .site-nav__list {
    flex-direction: column;
  }

  .site-nav__link {
    width: 100%;
    justify-content: space-between;
  }

  .mega__inner {
    padding: var(--space-2) 0 var(--space-4) var(--space-3);
  }
}

@media (min-width: 48rem) {
  .nav-toggle {
    display: none !important;
  }
}

.nav-toggle__icon-close,
.is-nav-open .nav-toggle__icon-open {
  display: none;
}

.is-nav-open .nav-toggle__icon-close {
  display: block;
}

.nav-toggle {
  padding-inline: var(--space-3);
}

/* 7. Tool menu (header mega menu, homepage, footer) ------------------------- */

.tool-menu {
  display: grid;
  gap: var(--space-5) var(--space-6);
}

.tool-menu__heading {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-menu__list {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-menu__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--touch-target);
  margin-inline: calc(var(--space-2) * -1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.tool-menu__link:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.tool-menu__link[aria-current="page"] {
  background: var(--color-surface);
}

.tool-menu__text {
  display: grid;
}

.tool-menu__summary {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.tool-menu--mega .tool-menu__name {
  white-space: nowrap;
}

@media (min-width: 48rem) {
  .tool-menu--mega,
  .tool-menu--page {
    grid-template-columns: minmax(10.5rem, 1fr) minmax(9rem, 1fr) minmax(0, 2fr);
  }

  .tool-menu--mega .tool-menu__group--convert .tool-menu__list,
  .tool-menu--page .tool-menu__group--convert .tool-menu__list {
    grid-template-columns: 1fr 1fr;
    column-gap: var(--space-5);
  }
}

@media (min-width: 48rem) and (max-width: 63.99rem) {
  .tool-menu--page {
    grid-template-columns: 1fr 1fr;
  }

  .tool-menu--page .tool-menu__group--convert {
    grid-column: 1 / -1;
  }
}

.tool-menu--page .tool-menu__link {
  align-items: flex-start;
  padding-block: var(--space-2);
}

/* 8. Buttons ---------------------------------------------------------------- */

.btn {
  --btn-fg: var(--color-text);

  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--touch-target);
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--btn-fg);
  font-weight: 700;
  line-height: var(--leading-tight);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    background-color var(--duration),
    border-color var(--duration),
    color var(--duration);
}

.btn svg {
  flex: none;
  width: 1.2em;
  height: 1.2em;
}

.btn--primary {
  --btn-fg: var(--color-on-action);

  background: var(--color-action);
}

.btn--primary:hover {
  background: var(--color-action-hover);
  color: var(--btn-fg);
}

.btn--secondary {
  border-color: var(--color-border-strong);
  background: var(--color-surface-raised);
}

.btn--secondary:hover,
.btn--ghost:hover {
  border-color: var(--color-text);
  background: var(--color-surface-raised);
  color: var(--btn-fg);
}

.btn--ghost:hover {
  border-color: transparent;
  background: var(--color-surface);
}

.btn--sm {
  min-height: 2.25rem;
  padding: 0.375rem 0.875rem;
  font-size: var(--text-sm);
}

.btn--lg {
  min-height: 3.25rem;
  padding-inline: 1.5rem;
  font-size: var(--text-base);
}

.btn--block {
  width: 100%;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state: <button aria-busy="true"> keeps its size and shows a spinner. */
.btn[aria-busy="true"] {
  color: transparent;
  pointer-events: none;
}

.btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--btn-fg);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 9. Cards & tiles ---------------------------------------------------------- */

/* Colored square that identifies a tool category. */
.tile {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 1.875rem;
  height: 1.875rem;
  border-radius: var(--radius);
}

.tile svg {
  width: 1rem;
  height: 1rem;
  stroke-width: 2.25;
}

.tile--lg {
  width: 2.5rem;
  height: 2.5rem;
}

.tile--lg svg {
  width: 1.25rem;
  height: 1.25rem;
}

.tile--compress {
  background: var(--cat-compress);
  color: var(--cat-on-compress);
}

.tile--edit {
  background: var(--cat-edit);
  color: var(--cat-on-edit);
}

.tile--convert {
  background: var(--cat-convert);
  color: var(--cat-on-convert);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.card > * {
  margin: 0;
}

.card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.card__title {
  font-size: var(--text-lg);
}

.card__text {
  color: var(--color-text-muted);
}

.card--muted {
  background: var(--color-surface);
}

.card--interactive {
  transition: border-color var(--duration);
}

.card--interactive:hover {
  border-color: var(--color-text);
}

/* The whole card is clickable through the title link, keeping one real <a> for crawlers and AT. */
.card__link {
  color: inherit;
  text-decoration: none;
}

.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card__link:hover {
  color: inherit;
}

.card__link:focus-visible {
  outline: none;
}

.card__link:focus-visible::after {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* 10. Tags ------------------------------------------------------------------ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.125rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.tag--primary {
  border-color: transparent;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.tag--success {
  border-color: transparent;
  background: var(--color-success-soft);
  color: var(--color-success-text);
}

.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

.privacy-badge svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--cat-compress);
}

/* 11. Alerts ---------------------------------------------------------------- */

.alert {
  --alert-accent: var(--color-text-muted);

  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.alert > svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  color: var(--alert-accent);
}

.alert__body > :last-child {
  margin-bottom: 0;
}

.alert__title {
  margin: 0 0 var(--space-1);
  font-weight: 700;
}

.alert--success {
  --alert-accent: var(--color-success);

  border-color: transparent;
  background: var(--color-success-soft);
}

.alert--warning {
  --alert-accent: var(--color-warning);

  border-color: transparent;
  background: var(--color-warning-soft);
}

.alert--error {
  --alert-accent: var(--color-danger);

  border-color: transparent;
  background: var(--color-danger-soft);
}

/* 12. Content blocks -------------------------------------------------------- */

.hero {
  padding-block: var(--space-7) var(--space-6);
}

@media (min-width: 48rem) {
  .hero {
    padding-block: var(--space-8) var(--space-7);
  }
}

.hero__title {
  max-width: 16ch;
  font-size: var(--text-display);
}

.hero .lead {
  margin-bottom: var(--space-4);
}

.hero__grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 64rem) {
  .hero__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
    gap: var(--space-8);
  }

  .hero__intro {
    padding-top: var(--space-5);
  }
}

.feature {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.feature__icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-brand);
}

.feature__text > :last-child {
  margin-bottom: 0;
}

.panel {
  padding: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

@media (min-width: 48rem) {
  .panel {
    padding: var(--space-6);
  }
}

.panel > :last-child {
  margin-bottom: 0;
}

/* Two columns: heading left, text right (privacy statement). */
.split-statement {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 48rem) {
  .split-statement {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: var(--space-7);
  }
}

.split-statement > * > :last-child {
  margin-bottom: 0;
}

.faq {
  max-width: var(--container-narrow);
  border-top: 1px solid var(--color-border);
}

.faq__item {
  border-bottom: 1px solid var(--color-border);
}

.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--touch-target);
  padding-block: var(--space-4);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.faq__question::-webkit-details-marker {
  display: none;
}

.faq__question::after {
  content: "+";
  flex: none;
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1;
  color: var(--color-text-muted);
}

.faq__item[open] .faq__question::after {
  content: "−";
}

.faq__answer {
  padding-bottom: var(--space-4);
  color: var(--color-text-muted);
}

.faq__answer > :last-child {
  margin-bottom: 0;
}

/* 13. Footer ---------------------------------------------------------------- */

.site-footer {
  padding-block: var(--space-8) var(--space-5);
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  font-size: var(--text-sm);
}

.site-footer a {
  color: var(--color-footer-text);
  text-decoration: none;
}

.site-footer a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--color-brand);
}

.site-footer__inner {
  display: grid;
  gap: var(--space-7);
}

@media (min-width: 64rem) {
  .site-footer__inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
  }
}

.site-footer__brand {
  margin-bottom: var(--space-3);
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.site-footer__about p {
  color: var(--color-footer-muted);
}

.site-footer__privacy {
  display: flex;
  gap: var(--space-2);
}

.site-footer__privacy svg {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  color: var(--cat-compress);
}

.site-footer .tool-menu {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.site-footer .tool-menu__heading {
  color: var(--color-footer-muted);
}

.site-footer .tool-menu__link {
  min-height: 2rem;
  font-weight: 500;
}

.site-footer .tool-menu__link:hover {
  background: transparent;
}

/* The light "current page" background of other menus would hide the light footer text. */
.site-footer .tool-menu__link[aria-current="page"] {
  background: transparent;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-color: var(--color-brand);
  text-underline-offset: 0.25em;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-5);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-footer-border);
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
}

.site-footer__copyright {
  margin: 0;
  color: var(--color-footer-muted);
}

/* 14. Utilities ------------------------------------------------------------- */

.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;
}

.icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
}

.debug pre {
  overflow-x: auto;
  padding: var(--space-4);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: var(--text-sm);
}

/* 15. Breadcrumbs & directory  16. Data tables ---------------------------------------------- */

.breadcrumbs {
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--color-border-strong);
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-color: var(--color-brand);
}

.breadcrumbs [aria-current="page"] {
  color: var(--color-text);
  font-weight: 600;
}

.hero--compact {
  padding-block: var(--space-6) var(--space-5);
}

.section--flush-top {
  padding-top: var(--space-6);
}

.tool-menu__description {
  max-width: 34rem;
  margin: calc(var(--space-2) * -1) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.mega__footer {
  margin: var(--space-5) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border);
}

.mega__footer a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 700;
  text-decoration: none;
}

.mega__footer svg {
  width: 1rem;
  height: 1rem;
}

/* 16. Data tables ---------------------------------------------------------- */

/* Wide tables scroll inside their own box on small screens, never the page. */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}

.data-table th,
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.data-table tbody tr:last-child > * {
  border-bottom: 0;
}

.data-table thead th {
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-table tbody th {
  font-weight: 700;
  white-space: nowrap;
}

/* Small screens: each row becomes a block with column labels, so no column hides behind a scroll. */
@media (max-width: 39.99rem) {
  .data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

  .data-table tr {
    display: block;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--color-border);
  }

  .data-table tbody tr:last-child {
    border-bottom: 0;
  }

  .data-table th,
  .data-table td {
    display: block;
    padding: 0;
    border: 0;
  }

  .data-table tbody th {
    margin-bottom: var(--space-1);
    white-space: normal;
  }

  .data-table td {
    display: grid;
    grid-template-columns: minmax(6rem, 35%) 1fr;
    gap: var(--space-3);
    padding-block: 0.125rem;
  }

  .data-table td::before {
    content: attr(data-label);
    color: var(--color-text-muted);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
}

.guide__note {
  max-width: var(--container-narrow);
  margin: var(--space-4) 0 0;
  color: var(--color-text-muted);
}

/* 17. Plans ---------------------------------------------------------------- */

.plans {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 48rem) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-6);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-raised);
}

.plan > * {
  margin: 0;
}

.plan--free {
  border-color: var(--color-text);
}

.plan__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.plan__name {
  font-size: var(--text-2xl);
}

.plan__tagline {
  color: var(--color-text-muted);
}

.plan__price {
  font-size: var(--text-lg);
  font-weight: 700;
}

.plan__features {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.plan__features li {
  display: flex;
  gap: var(--space-2);
}

.plan__features svg {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.15rem;
  color: var(--cat-compress);
}

.plan--pro .plan__features svg {
  color: var(--color-text-muted);
}

.plan__action {
  margin-top: auto;
}

.plan__notice {
  margin-top: auto;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

/* 18. Ad slots ------------------------------------------------------------- */
/*
 * Only rendered when ADS_ENABLED=true (src/config/ads.js). Each box reserves the height of the
 * creative sizes listed there, so an ad that loads late doesn't move the page.
 */

.ad-slot {
  padding-block: var(--space-5);
}

.ad-slot__label {
  margin: 0 0 var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
}

.ad-slot__box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-inline: auto;
  overflow: hidden;
}

.ad-slot__box--preview {
  padding: var(--space-3);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  text-align: center;
}

/* Mobile sizes: 320x50, 320x100, 300x250. */
.ad-slot--header .ad-slot__box,
.ad-slot--footer .ad-slot__box {
  max-width: 320px;
  min-height: 50px;
}

.ad-slot--below-tool .ad-slot__box {
  max-width: 320px;
  min-height: 100px;
}

.ad-slot--between-content .ad-slot__box {
  max-width: 300px;
  min-height: 250px;
}

/* Desktop: 728x90 leaderboards. */
@media (min-width: 48rem) {
  .ad-slot--header .ad-slot__box,
  .ad-slot--footer .ad-slot__box,
  .ad-slot--below-tool .ad-slot__box,
  .ad-slot--between-content .ad-slot__box {
    max-width: 728px;
    min-height: 90px;
  }
}

/*
 * 160x600 rail in the right-hand margin, only where the margin is wide enough for it
 * (container 76rem + rail + gaps), so it never covers or narrows the content.
 */
.ad-rail {
  display: none;
}

@media (min-width: 102rem) {
  .ad-rail {
    display: block;
    position: absolute;
    inset-block: 0;
    left: calc(50% + var(--container) / 2 + var(--space-5));
    width: 160px;
  }

  .ad-slot--sidebar {
    position: sticky;
    top: calc(var(--header-height) + var(--space-5));
  }

  .ad-slot--sidebar .ad-slot__box {
    min-height: 600px;
  }
}
