/* ─────────────────────────────────────────────
   Free Image Tools — Apple-inspired design system
   ───────────────────────────────────────────── */

:root {
  /* Apple color palette */
  --primary:        #007AFF;
  --primary-dark:   #0062CC;
  --primary-light:  rgba(0, 122, 255, 0.10);
  --primary-mid:    rgba(0, 122, 255, 0.18);
  --secondary:      #5856D6;
  --green:          #34C759;
  --green-bg:       rgba(52, 199, 89, 0.10);
  --orange:         #FF9500;

  /* Backgrounds */
  --bg:             #f2f2f7;   /* iOS system background */
  --bg-elevated:    #ffffff;
  --bg-secondary:   #f2f2f7;
  --white:          #ffffff;

  /* Text — iOS label hierarchy */
  --text:           #1c1c1e;
  --text-secondary: #48484a;
  --text-muted:     #8e8e93;
  --text-placeholder: #aeaeb2;

  /* Borders / separators */
  --border:         rgba(60, 60, 67, 0.13);
  --border-strong:  rgba(60, 60, 67, 0.25);

  /* Semantic */
  --success:        #34C759;
  --success-text:   #157a36;
  --success-bg:     rgba(52, 199, 89, 0.10);
  --warning-bg:     rgba(255, 149, 0, 0.10);

  /* Shadows — soft, diffuse, macOS-style */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow:    0 2px 10px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.09), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);

  /* Border radius — Apple-sized */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Glass */
  --glass-bg:     rgba(255,255,255,0.78);
  --glass-border: rgba(255,255,255,0.55);

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #000000;
    --bg-elevated:    #1c1c1e;
    --bg-secondary:   #1c1c1e;
    --white:          #1c1c1e;
    --text:           #ffffff;
    --text-secondary: rgba(235,235,245,0.85);
    --text-muted:     rgba(235,235,245,0.55);
    --text-placeholder: rgba(235,235,245,0.30);
    --border:         rgba(84,84,88,0.55);
    --border-strong:  rgba(84,84,88,0.75);
    --primary-light:  rgba(0,122,255,0.18);
    --primary-mid:    rgba(0,122,255,0.28);
    --success-bg:     rgba(52,199,89,0.16);
    --success-text:   #66e083;
    --warning-bg:     rgba(255,149,0,0.16);
    --glass-bg:       rgba(28,28,30,0.82);
    --glass-border:   rgba(255,255,255,0.10);
    --shadow:         0 2px 10px rgba(0,0,0,0.35), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md:      0 4px 20px rgba(0,0,0,0.4), 0 2px 6px rgba(0,0,0,0.25);
    --shadow-lg:      0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
  }
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ── Base ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ──────────────────────────────────────────────
   NAV — frosted glass, macOS menu bar style
   ────────────────────────────────────────────── */
.nav {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,122,255,0.55), rgba(255,221,0,0.58), transparent);
  background-size: 200% 100%;
  background-position: 100% 0;
  opacity: 0.55;
  animation: navLightSweep 8s ease-in-out infinite;
  pointer-events: none;
}
.nav-inner {
  max-width: 1220px;
  margin: 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  position: relative;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.08rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 0;
}
.logo img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: contain;
  border-radius: 7px;
}
.logo span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-links {
  display: flex;
  gap: 0.2rem;
  list-style: none;
  align-items: center;
  min-width: 0;
}
.nav-links a {
  padding: 0.38rem 0.8rem;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s var(--ease-out), color 0.15s;
  letter-spacing: -0.01em;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links a.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}
.nav-tools-original {
  display: none;
}
.nav-discovery {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.nav-tool-dropdown,
.nav-support-menu,
.nav-memory-menu,
.nav-language-menu {
  position: relative;
}
.nav-tool-trigger,
.nav-memory-trigger,
.nav-coffee-button,
.nav-qr-toggle,
.nav-language-menu {
  min-height: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.nav-tool-trigger,
.nav-memory-trigger,
.nav-qr-toggle,
.nav-language-menu {
  color: var(--text);
  background: var(--white);
}
.nav-tool-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.7rem;
  overflow: hidden;
  position: relative;
}
.nav-memory-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  overflow: hidden;
  position: relative;
}
.nav-memory-trigger svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-memory-trigger b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 0.28rem;
  color: #ffffff;
  background: var(--primary);
  border-radius: 99px;
  font-size: 0.66rem;
  line-height: 1;
}
.nav-memory-trigger:hover,
.nav-memory-menu.is-open .nav-memory-trigger {
  border-color: var(--primary-mid);
  color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-1px);
}
.nav-tool-trigger::after,
.nav-coffee-button::after {
  content: '';
  position: absolute;
  inset: -40% auto -40% -80%;
  width: 55%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: skewX(-20deg);
  transition: left 0.45s var(--ease-out);
  pointer-events: none;
}
.nav-tool-trigger:hover::after,
.nav-coffee-button:hover::after {
  left: 130%;
}
.nav-tool-trigger:hover,
.nav-tool-dropdown.is-open .nav-tool-trigger,
.nav-qr-toggle:hover,
.nav-support-menu.is-open .nav-qr-toggle {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-1px);
}
.nav-tool-trigger svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.18s var(--ease-out);
}
.nav-tool-dropdown.is-open .nav-tool-trigger svg {
  transform: rotate(180deg);
}
.nav-tool-spark {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffdd00 0 34%, var(--primary) 38% 100%);
  box-shadow: 0 0 14px rgba(0,122,255,0.42);
}
.nav-coffee-button {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.35rem 0.72rem;
  color: #111827;
  background: linear-gradient(135deg, #ffdd00, #ffe96b 45%, #ffbd2e);
  border-color: rgba(17,24,39,0.12);
  box-shadow: 0 6px 18px rgba(255,189,46,0.22);
  position: relative;
  overflow: hidden;
}
.nav-coffee-button:hover {
  color: #111827;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255,189,46,0.32);
}
.nav-qr-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  padding: 0;
}
.nav-qr-toggle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.nav-language-menu {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0 0.45rem;
}
.nav-language-menu span {
  font-size: 0.9rem;
  line-height: 1;
}
.nav-language-menu select {
  width: 96px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  padding-right: 1.35rem;
  outline: none;
  cursor: pointer;
}
.nav-language-menu:hover,
.nav-language-menu:focus-within {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 4px var(--primary-light);
  transform: translateY(-1px);
}
.nav-tool-panel,
.nav-memory-panel,
.nav-qr-popover {
  position: absolute;
  top: calc(100% + 0.75rem);
  background:
    linear-gradient(135deg, rgba(0,122,255,0.05), rgba(255,221,0,0.035)),
    color-mix(in srgb, var(--bg-elevated) 96%, transparent);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(26px) saturate(180%);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  opacity: 0;
  transform: translateY(-6px) scale(0.985);
  transform-origin: top;
  transition: opacity 0.16s var(--ease-out), transform 0.16s var(--ease-out);
  z-index: 120;
}
.nav-tool-dropdown.is-open .nav-tool-panel,
.nav-memory-menu.is-open .nav-memory-panel,
.nav-support-menu.is-open .nav-qr-popover {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.nav-tool-panel {
  left: 0;
  width: min(880px, calc(100vw - 2rem));
  border-radius: var(--radius-xl);
  padding: 1rem;
}
.nav-memory-panel {
  left: 50%;
  width: min(350px, calc(100vw - 2rem));
  padding: 0.8rem;
  border-radius: var(--radius-lg);
  transform: translate(-50%, -6px) scale(0.985);
}
.nav-memory-menu.is-open .nav-memory-panel {
  transform: translate(-50%, 0) scale(1);
}
.nav-memory-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.1rem 0.25rem 0.65rem;
  border-bottom: 1px solid var(--border);
}
.nav-memory-head strong {
  font-size: 0.88rem;
}
.nav-memory-head a {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}
.nav-memory-list {
  display: grid;
  gap: 0.25rem;
  padding-top: 0.45rem;
}
.nav-memory-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem;
  border-radius: var(--radius);
}
.nav-memory-item:hover {
  background: var(--primary-light);
}
.nav-memory-item > a {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
  padding: 0.52rem 0.55rem;
  color: var(--text);
  text-decoration: none;
}
.nav-memory-item > a span {
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-memory-item > a small {
  color: var(--text-muted);
  font-size: 0.7rem;
}
.nav-memory-item > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 0.25rem;
  border: 0;
  border-radius: 8px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
}
.nav-memory-item > button:hover {
  color: var(--text);
  background: var(--white);
}
.nav-memory-item > button svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.nav-memory-empty {
  padding: 0.8rem 0.35rem 0.35rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}
.nav-tool-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0.15rem 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.8rem;
}
.nav-tool-panel-head strong {
  color: var(--text);
  font-size: 0.9rem;
}
.nav-tool-panel-head a {
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  text-decoration: none;
}
.nav-tool-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}
.nav-tool-group {
  display: grid;
  gap: 0.3rem;
  align-content: start;
}
.nav-tool-group h3 {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 0.45rem 0.15rem;
}
.nav-tool-group a {
  display: grid;
  gap: 0.08rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 0.5rem 0.55rem;
  border: 1px solid transparent;
  transition: background 0.16s var(--ease-out), border-color 0.16s, transform 0.16s var(--ease-out);
}
.nav-tool-group a:hover {
  background: var(--white);
  border-color: var(--primary-mid);
  transform: translateX(2px);
}
.nav-tool-group span {
  font-size: 0.82rem;
  font-weight: 800;
}
.nav-tool-group small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.35;
}
.nav-qr-popover {
  right: 0;
  width: min(320px, calc(100vw - 2rem));
  border-radius: var(--radius-lg);
  padding: 0.85rem;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.8rem;
  align-items: center;
}
.nav-qr-popover img {
  width: 96px;
  height: 96px;
  border-radius: var(--radius);
  border: 1px solid rgba(60,60,67,0.16);
  background: #fff;
}
.nav-qr-popover strong {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}
.nav-qr-popover p {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
  margin-bottom: 0.3rem;
}
.nav-qr-popover a {
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 750;
  text-decoration: none;
  overflow-wrap: anywhere;
}

/* ── Page wrapper ── */
.page { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem 5rem; }

/* ──────────────────────────────────────────────
   HERO — index page
   ────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 3rem 1rem 1.5rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero h1 span {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
  letter-spacing: -0.01em;
  line-height: 1.65;
}
/* The umbrella pages list every format they accept and link each one, so the
   intro can hold eight links at once. Colour alone keeps that readable. */
.hero p a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 550;
}
.hero p a:hover {
  text-decoration: underline;
}
.badge-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.28rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  box-shadow: var(--shadow-xs);
  letter-spacing: -0.01em;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge .dot.green  { background: var(--green); }
.badge .dot.blue   { background: var(--primary); }
.badge .dot.purple { background: var(--secondary); }

/* ──────────────────────────────────────────────
   HOMEPAGE — stronger first viewport and discovery
   ────────────────────────────────────────────── */
.home-page .nav::after {
  background: var(--border);
  opacity: 1;
  transform: none;
  animation: none;
}
.home-page .nav-inner {
  max-width: 1240px;
  height: 64px;
  justify-content: flex-start;
}
.home-page .logo { order: 1; }
.home-page .nav-links {
  order: 2;
  margin-left: 1rem;
  margin-right: auto;
}
.home-page .nav-links a {
  position: relative;
  border-radius: 0;
}
.home-page .nav-links a:hover {
  color: var(--primary);
  background: transparent;
}
.home-page .nav-links a.active {
  color: var(--primary);
  background: transparent;
}
.home-page .nav-links a.active::after {
  content: '';
  position: absolute;
  right: 0.65rem;
  bottom: -0.78rem;
  left: 0.65rem;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
.home-page .nav-discovery {
  order: 3;
  margin-left: auto;
}
.home-page .page {
  max-width: 1240px;
  padding-top: 0;
}
.home-page .home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.94fr) minmax(430px, 0.86fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: 540px;
  padding: 3.6rem 0 3rem;
  scroll-margin-top: 80px;
}
.home-page .home-hero::before,
.home-page .home-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border: 1px solid var(--border);
  border-radius: 8px;
  pointer-events: none;
}
.home-page .home-hero::before {
  width: 76px;
  height: 58px;
  top: 4.5rem;
  left: -6.5rem;
  background: #dbeafe;
  transform: rotate(-12deg);
}
.home-page .home-hero::after {
  width: 68px;
  height: 28px;
  right: -5rem;
  top: 5.5rem;
  background: #bbf7d0;
  transform: rotate(18deg);
}
.home-page .home-hero-copy {
  position: relative;
  max-width: 590px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}
.home-page .home-hero h1 {
  max-width: 610px;
  margin-bottom: 1.15rem;
  font-size: clamp(2.55rem, 3.7vw, 3.2rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: 0;
}
.home-page .home-hero h1 span { display: block; }
.home-page .home-hero p {
  color: var(--text-secondary);
  max-width: 570px;
  font-size: 1.06rem;
  line-height: 1.65;
  letter-spacing: 0;
}
.hero-spark {
  position: absolute;
  top: -2.5rem;
  right: 1.4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 52px;
  color: #ffb000;
  transform: rotate(8deg);
  animation: heroSparkBounce 3.2s ease-in-out infinite;
}
.hero-spark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: #de8d00;
  stroke-width: 0.5;
  stroke-linejoin: round;
}
.home-page .hero-actions {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  flex-wrap: wrap;
  margin-top: 1.65rem;
}
.hero-primary-action {
  gap: 0.52rem;
  min-height: 50px;
  padding-inline: 1.2rem;
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(0, 122, 255, 0.23);
}
.hero-primary-action svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}
.hero-browse-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  color: var(--primary);
  font-size: 0.94rem;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: 0;
}
.hero-browse-link svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s var(--ease-out);
}
.hero-browse-link:hover svg { transform: translateX(3px); }
.hero-browse-link:focus-visible {
  outline: 3px solid var(--primary-mid);
  outline-offset: 4px;
}
.home-page .hero-proof {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
  list-style: none;
}
.home-page .hero-proof li {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0;
}
.home-page .hero-proof svg {
  width: 20px;
  height: 20px;
  padding: 3px;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 50%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.home-page .hero-proof li:nth-child(2) svg {
  color: #bb7a00;
  background: rgba(255, 214, 10, 0.2);
}
.home-page .hero-proof li:nth-child(3) svg {
  color: #18853a;
  background: rgba(52, 199, 89, 0.14);
}
.hero-task-launcher {
  position: relative;
  padding: 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 39, 92, 0.13), var(--shadow);
}
.hero-task-launcher::before {
  content: '';
  position: absolute;
  inset: -1px -1px auto;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #007aff 0 28%, #ffbd00 28% 52%, #20b85a 52% 76%, #ff4d73 76%);
}
.hero-task-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  padding: 0.1rem 0.1rem 0;
}
.hero-task-heading h2 {
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1.2;
  letter-spacing: 0;
}
.hero-task-heading > span {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
}
.hero-task-list {
  display: grid;
  gap: 0.55rem;
}
.hero-task {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 72px;
  padding: 0.65rem 0.75rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  transition: transform 0.18s var(--ease-out), border-color 0.18s, box-shadow 0.18s;
}
.hero-task:hover {
  transform: translateY(-2px);
  border-color: var(--task-color);
  box-shadow: 0 9px 22px color-mix(in srgb, var(--task-color) 16%, transparent);
}
.hero-task:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--task-color) 24%, transparent);
  outline-offset: 2px;
}
.hero-task-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  color: var(--task-color);
  background: var(--task-bg);
  border-radius: 8px;
}
.hero-task-icon svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hero-task-copy {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}
.hero-task-copy strong {
  font-size: 0.94rem;
  font-weight: 820;
  letter-spacing: 0;
}
.hero-task-copy small {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.hero-task-arrow {
  width: 19px;
  height: 19px;
  margin-left: auto;
  flex-shrink: 0;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s var(--ease-out), stroke 0.16s;
}
.hero-task:hover .hero-task-arrow {
  stroke: var(--task-color);
  transform: translateX(3px);
}
.hero-task-blue { --task-color: #007aff; --task-bg: #eaf4ff; }
.hero-task-yellow { --task-color: #b97800; --task-bg: #fff7d1; }
.hero-task-green { --task-color: #16843a; --task-bg: #e9f9ee; }
.hero-task-pink { --task-color: #e93662; --task-bg: #fff0f3; }
.home-section {
  scroll-margin-top: 82px;
}
@media (prefers-color-scheme: dark) {
  .home-page {
    --bg: #0d0e11;
    --bg-elevated: #191a1f;
    --white: #191a1f;
    --glass-bg: rgba(25, 26, 31, 0.88);
  }
  .home-page .home-hero::before { background: #15375d; }
  .home-page .home-hero::after { background: #164a2b; }
  .hero-task-blue { --task-bg: #102f53; }
  .hero-task-yellow { --task-color: #ffd34d; --task-bg: #453700; }
  .hero-task-green { --task-color: #58d77a; --task-bg: #133a20; }
  .hero-task-pink { --task-color: #ff6d8e; --task-bg: #4c1825; }
}
@media (prefers-reduced-motion: reduce) {
  .hero-spark { animation: none; }
}
.home-section {
  margin: 2rem 0 1rem;
}
.home-section > .section-heading h2 {
  font-size: 1.65rem;
  line-height: 1.2;
  letter-spacing: 0;
}
.home-section > .section-heading .eyebrow {
  color: var(--text-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

/* Shared split hero retained for the dedicated PDF overview page. */
body:not(.home-page) .home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 2rem;
  align-items: center;
  padding: 4.5rem 0 3.35rem;
  position: relative;
}
body:not(.home-page) .home-hero::before {
  content: '';
  position: absolute;
  inset: 1.2rem -1.5rem auto;
  height: min(520px, 82%);
  background:
    linear-gradient(135deg, rgba(255, 214, 10, 0.28), transparent 36%),
    linear-gradient(225deg, rgba(0, 122, 255, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(52, 199, 89, 0.12), transparent 70%);
  border: 1px solid rgba(60, 60, 67, 0.08);
  border-radius: 28px;
  z-index: -1;
}
body:not(.home-page) .home-hero-copy { max-width: 590px; }
body:not(.home-page) .home-hero h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  font-size: clamp(2.4rem, 6vw, 4.65rem);
  font-weight: 850;
  line-height: 1.02;
  letter-spacing: 0;
}
body:not(.home-page) .home-hero h1::after {
  content: '';
  display: block;
  width: min(260px, 56%);
  height: 10px;
  margin-top: 0.85rem;
  background: linear-gradient(90deg, #ffd60a, #34c759, #007aff);
  border-radius: 999px;
  box-shadow: 0 10px 26px rgba(0, 122, 255, 0.22);
}
body:not(.home-page) .home-hero p {
  max-width: 560px;
  color: var(--text-secondary);
  font-size: 1.08rem;
  line-height: 1.7;
}
body:not(.home-page) .hero-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.6rem;
}
body:not(.home-page) .hero-proof {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
body:not(.home-page) .hero-proof span {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--white) 88%, #ffd60a 12%);
  border: 1px solid rgba(255, 214, 10, 0.42);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  font-size: 0.82rem;
}
body:not(.home-page) .hero-proof strong {
  color: var(--text);
  font-size: 1rem;
}
.hero-workbench {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.92)), var(--white);
  border: 1px solid rgba(0, 122, 255, 0.18);
  border-radius: var(--radius-xl);
  box-shadow: 0 28px 80px rgba(0, 39, 92, 0.18), var(--shadow-lg);
  animation: workbenchFloat 7s ease-in-out infinite;
}
.hero-workbench::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0 38%, rgba(255,255,255,0.22) 48%, transparent 58% 100%);
  transform: translateX(-125%);
  animation: workbenchShine 6s ease-in-out infinite;
  pointer-events: none;
}
.workbench-top {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elevated) 80%, var(--bg) 20%);
}
.window-dot { width: 11px; height: 11px; border-radius: 50%; }
.window-dot.red { background: #ff5f57; }
.window-dot.yellow { background: #ffbd2e; }
.window-dot.green { background: #28c840; }
.workbench-title {
  margin-left: 0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.workbench-body {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 1rem;
  padding: 1.1rem;
}
.drop-preview {
  min-height: 214px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(255,214,10,0.18), transparent 42%), linear-gradient(225deg, rgba(52,199,89,0.14), transparent 58%), var(--bg);
  border: 1.5px dashed rgba(0, 122, 255, 0.42);
  border-radius: var(--radius-lg);
}
.file-stack {
  position: relative;
  width: 86px;
  height: 68px;
  margin-bottom: 0.9rem;
}
.file-stack span {
  position: absolute;
  width: 58px;
  height: 44px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-xs);
}
.file-stack span:nth-child(1) { left: 4px; top: 18px; background: #fef3c7; }
.file-stack span:nth-child(2) { left: 22px; top: 9px; background: #dcfce7; }
.file-stack span:nth-child(3) { left: 40px; top: 0; background: #dbeafe; }
.drop-preview strong { font-size: 0.95rem; }
.drop-preview p { margin-top: 0.15rem; color: var(--text-muted); font-size: 0.78rem; }
.workflow-list { display: grid; gap: 0.7rem; }
.workflow-list a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  color: var(--text);
  text-decoration: none;
  background: color-mix(in srgb, var(--bg-elevated) 88%, #ffffff 12%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.18s var(--ease-out), border-color 0.18s;
}
.workflow-list a:hover { transform: translateX(3px); border-color: var(--primary-mid); }
.workflow-icon {
  width: 46px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary-dark);
  background: linear-gradient(135deg, rgba(0,122,255,0.14), rgba(255,214,10,0.25));
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 850;
}
.workflow-list strong { display: block; font-size: 0.9rem; }
.workflow-list small { color: var(--text-muted); font-size: 0.76rem; }
.workbench-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.1rem;
  background: linear-gradient(135deg, rgba(255,214,10,0.22), rgba(52,199,89,0.13), rgba(0,122,255,0.10));
  border-top: 1px solid var(--border);
}
.result-label {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.workbench-result strong { font-size: 0.88rem; }
.result-pill {
  padding: 0.35rem 0.7rem;
  color: #ffffff;
  background: #111827;
  border: 1px solid rgba(17, 24, 39, 0.18);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}
.problem-finder {
  position: relative;
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.25rem 2rem;
  margin: 0 0 2rem;
  padding: 1.35rem;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  scroll-margin-top: 78px;
}
.problem-finder::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #007aff 0 28%, #ffbd00 28% 52%, #20b85a 52% 76%, #ff4d73 76%);
}
.problem-finder-heading {
  align-self: center;
}
.problem-finder-heading h2 {
  max-width: 420px;
  font-size: 1.55rem;
  font-weight: 850;
  line-height: 1.16;
  margin-bottom: 0.55rem;
}
.problem-finder-heading p {
  max-width: 430px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}
.problem-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.65rem;
  min-height: 54px;
  padding: 0.35rem 0.4rem 0.35rem 0.8rem;
  background: var(--bg);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}
.problem-search:focus-within {
  background: var(--white);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}
.problem-search > svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.problem-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
}
.problem-search input::placeholder {
  color: var(--text-placeholder);
  font-weight: 500;
}
.problem-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 7px;
  color: #ffffff;
  background: var(--primary);
  cursor: pointer;
  transition: transform 0.16s var(--ease-out), background 0.16s;
}
.problem-search button:hover {
  background: var(--primary-dark);
  transform: translateX(2px);
}
.problem-search button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.finder-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  grid-column: 2;
  margin-top: -0.6rem;
}
.finder-quick button,
.phone-install-action {
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 0.38rem 0.62rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 750;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.finder-quick button:hover,
.phone-install-action:hover {
  color: var(--primary);
  border-color: var(--primary-mid);
  background: var(--primary-light);
  transform: translateY(-1px);
}
.finder-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  grid-column: 1 / -1;
  padding-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
}
.finder-status a,
.finder-empty a {
  color: var(--primary);
  text-decoration: none;
}
.finder-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
}
.finder-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  min-height: 76px;
  padding: 0.7rem 0.55rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s, padding 0.15s;
}
.finder-result:hover {
  padding-inline: 0.7rem 0.4rem;
  background: var(--primary-light);
}
.finder-code,
.home-memory-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 38px;
  border-radius: 9px;
  color: #111827;
  background: linear-gradient(135deg, #ffd60a, #fff1a8);
  font-size: 0.7rem;
  font-weight: 900;
}
.finder-result-copy {
  display: grid;
  min-width: 0;
}
.finder-result-copy strong {
  font-size: 0.87rem;
  font-weight: 850;
}
.finder-result-copy small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.finder-result > svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.finder-empty {
  grid-column: 1 / -1;
  padding: 1rem 0.55rem 0.25rem;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.6;
}
.home-memory {
  margin: 0 0 2rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, rgba(52, 199, 89, 0.12), rgba(255, 214, 10, 0.12) 48%, rgba(0, 122, 255, 0.08)),
    var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  scroll-margin-top: 78px;
}
.home-memory[hidden] {
  display: none;
}
.home-memory-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.home-memory-heading h2 {
  font-size: 1.25rem;
  font-weight: 850;
  line-height: 1.2;
}
.home-memory-heading p {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
}
.home-memory-heading small {
  display: block;
  margin-top: 0.35rem;
  color: var(--success-text);
  font-size: 0.73rem;
  font-weight: 800;
}
.home-memory-heading > a {
  flex-shrink: 0;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 800;
  text-decoration: none;
}
.home-memory-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}
.home-memory-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  min-height: 86px;
  padding: 0.75rem;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition: transform 0.18s var(--ease-out), border-color 0.18s, box-shadow 0.18s;
}
.home-memory-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary-mid);
  box-shadow: var(--shadow);
}
.home-memory-card > span:last-child {
  display: grid;
  min-width: 0;
}
.home-memory-card small {
  color: var(--success-text);
  font-size: 0.66rem;
  font-weight: 850;
  text-transform: uppercase;
}
.home-memory-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.home-memory-card em {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-style: normal;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.section-heading h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.16;
  font-weight: 850;
}
.section-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  white-space: nowrap;
}
.featured-tools .tool-card:first-child {
  border-color: rgba(0,122,255,0.32);
  box-shadow: 0 20px 48px rgba(0, 122, 255, 0.12), var(--shadow-md);
  transform: translateY(-2px);
}
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 2rem 0;
}
.trust-strip div {
  background:
    linear-gradient(135deg, rgba(255, 214, 10, 0.12), transparent 48%),
    var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-xs);
}
.trust-strip strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}
.trust-strip span {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}
.home-trust-workflows {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  align-items: start;
}
.phone-qr-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  margin: 0 0 2rem;
  padding: 1.25rem;
  background:
    linear-gradient(135deg, rgba(255,214,10,0.18), rgba(0,122,255,0.11), rgba(52,199,89,0.08)),
    var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.phone-qr-copy {
  max-width: 700px;
}
.phone-qr-copy .eyebrow {
  margin-bottom: 0.35rem;
}
.phone-qr-copy h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.18;
  font-weight: 850;
  margin-bottom: 0.45rem;
}
.phone-qr-copy p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.65;
}
.phone-qr-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.phone-qr-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--primary);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: var(--shadow-xs);
}
.phone-qr-links a:hover {
  border-color: var(--primary-mid);
  transform: translateY(-1px);
}
.phone-install-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 36px;
  color: #111827;
  background: linear-gradient(135deg, #ffd60a, #ffe780);
  border-color: rgba(17, 24, 39, 0.12);
}
.phone-install-action svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phone-install-action:hover {
  color: #111827;
  background: #ffd60a;
}
.ios-install-tip {
  width: fit-content;
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  color: var(--text);
  background: var(--warning-bg);
  border: 1px solid rgba(255, 149, 0, 0.24);
  border-radius: var(--radius);
  font-size: 0.8rem !important;
  font-weight: 700;
}
.phone-qr-card {
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.phone-qr-card img {
  width: 132px;
  height: 132px;
  padding: 0.45rem;
  background: #ffffff;
  border: 1px solid rgba(60, 60, 67, 0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.phone-qr-card span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}
.people-paths {
  margin: 2.25rem 0 2.5rem;
  padding: 1.25rem;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 45, 85, 0.13), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(88, 86, 214, 0.13), transparent 28%),
    linear-gradient(135deg, rgba(255, 214, 10, 0.12), rgba(0, 122, 255, 0.08)),
    var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}
.people-path-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}
.people-card {
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.15rem;
  overflow: hidden;
  color: var(--text);
  text-decoration: none;
  background: var(--white);
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), border-color 0.18s;
}
.people-card::after {
  content: '';
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 126px;
  height: 126px;
  border-radius: 999px;
  background: var(--people-glow, rgba(0, 122, 255, 0.14));
  opacity: 0.9;
}
.people-card:hover {
  transform: translateY(-4px) rotate(-0.35deg);
  border-color: var(--primary-mid);
  box-shadow: var(--shadow-md);
}
.people-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 38px;
  padding: 0 0.65rem;
  margin-bottom: 0.9rem;
  background: #111827;
  color: #ffffff;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.14);
}
.people-card h3,
.people-card p,
.people-card strong {
  position: relative;
  z-index: 1;
}
.people-card h3 {
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.2;
  margin-bottom: 0.45rem;
}
.people-card p {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.people-card strong {
  margin-top: auto;
  color: var(--primary);
  font-size: 0.86rem;
}
.people-card-pink { --people-glow: rgba(255, 45, 85, 0.17); }
.people-card-yellow { --people-glow: rgba(255, 214, 10, 0.24); }
.people-card-blue { --people-glow: rgba(0, 122, 255, 0.17); }
.people-card-green { --people-glow: rgba(52, 199, 89, 0.18); }
.people-card-red { --people-glow: rgba(255, 59, 48, 0.16); }
.people-card-purple { --people-glow: rgba(88, 86, 214, 0.17); }

@media (max-width: 860px) {
  .home-page .home-hero,
  body:not(.home-page) .home-hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    min-height: 0;
    padding: 3.5rem 0 2.5rem;
  }
  .home-page .home-hero::before,
  .home-page .home-hero::after {
    display: none;
  }
  .hero-task-launcher {
    max-width: 620px;
  }
  .trust-strip {
    grid-template-columns: 1fr;
  }
  .home-trust-workflows {
    grid-template-columns: 1fr;
  }
  .phone-qr-strip {
    grid-template-columns: 1fr;
  }
  .phone-qr-card {
    justify-items: start;
  }
  .people-path-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .problem-finder {
    grid-template-columns: 1fr;
  }
  .finder-quick {
    grid-column: 1;
    margin-top: -0.35rem;
  }
  .home-memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .home-page .page {
    padding-inline: 1rem;
  }
  .home-page .home-hero {
    gap: 1.6rem;
    padding: 3rem 0 2rem;
  }
  .home-page .home-hero h1 {
    max-width: 350px;
    font-size: 2.15rem;
    line-height: 1.1;
  }
  .home-page .home-hero p {
    font-size: 0.96rem;
    line-height: 1.58;
  }
  .hero-spark {
    top: -2.1rem;
    right: 0.25rem;
    width: 34px;
    height: 42px;
  }
  .home-page .hero-actions .btn {
    width: 100%;
  }
  .hero-browse-link {
    justify-content: center;
    width: 100%;
  }
  .home-page .hero-proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
    margin-top: 1.35rem;
  }
  .home-page .hero-proof li {
    align-items: flex-start;
    font-size: 0.72rem;
    line-height: 1.35;
  }
  .hero-task-launcher {
    padding: 1rem 0.8rem 0.8rem;
  }
  .hero-task-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.12rem;
    padding-inline: 0.1rem;
  }
  .hero-task-heading h2 {
    font-size: 1.2rem;
  }
  .hero-task {
    min-height: 66px;
    padding: 0.55rem;
  }
  .hero-task-icon {
    width: 44px;
    height: 44px;
  }
  .hero-task-copy strong {
    font-size: 0.88rem;
  }
  .hero-task-copy small {
    font-size: 0.72rem;
  }
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .phone-qr-strip {
    padding: 1rem;
  }
  .phone-qr-card img {
    width: 118px;
    height: 118px;
  }
  .people-paths {
    padding: 1rem;
  }
  .people-path-grid {
    grid-template-columns: 1fr;
  }
  .people-card {
    min-height: 164px;
  }
  .problem-finder {
    padding: 1.1rem;
  }
  .problem-finder-heading h2 {
    font-size: 1.3rem;
  }
  .finder-results {
    grid-template-columns: 1fr;
  }
  .finder-result-copy small {
    white-space: normal;
  }
  .home-memory-heading {
    display: grid;
  }
  .home-memory-grid {
    grid-template-columns: 1fr;
  }
}

/* ──────────────────────────────────────────────
   TOOL CARDS
   ────────────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.5rem 0;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.6rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.2s var(--ease-out), border-color 0.15s;
  box-shadow: var(--shadow);
  display: block;
  position: relative;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 0%, var(--primary-light), transparent 38%);
  opacity: 0;
  transition: opacity 0.2s var(--ease-out);
  pointer-events: none;
}
.tool-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 122, 255, 0.3);
}
.tool-card:hover::before {
  opacity: 1;
}
.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  background: var(--primary-light);
}
.tool-card h3 {
  font-size: 1.02rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.tool-card p {
  font-size: 0.855rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.tool-card .arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

/* ──────────────────────────────────────────────
   UPLOAD ZONE
   ────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  background: var(--white);
  position: relative;
  overflow: hidden;
}
.upload-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-light), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.upload-zone:hover::before,
.upload-zone.drag-over::before { opacity: 1; }
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--primary);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--primary-light), var(--shadow-md);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-icon {
  font-size: 2.75rem;
  margin-bottom: 0.85rem;
  display: block;
  line-height: 1;
}
.upload-zone h3 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}
.upload-zone p {
  font-size: 0.855rem;
  color: var(--text-muted);
}
.upload-zone .formats {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.format-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.18rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ──────────────────────────────────────────────
   SETTINGS PANEL — macOS preferences style
   ────────────────────────────────────────────── */
.settings-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.settings-panel h3 {
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 1.1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-label {
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  letter-spacing: -0.01em;
}
.setting-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* ──────────────────────────────────────────────
   RANGE SLIDER — macOS style
   ────────────────────────────────────────────── */
.slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 180px;
}
input[type="range"] {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--border-strong);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
  accent-color: var(--primary);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.08);
  transition: transform 0.1s var(--ease-spring);
}
input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.15);
}
.slider-val {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary);
  min-width: 32px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ──────────────────────────────────────────────
   SELECT
   ────────────────────────────────────────────── */
select {
  padding: 0.42rem 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238e8e93' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2rem;
}
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* ──────────────────────────────────────────────
   TOGGLE — exact iOS style
   ────────────────────────────────────────────── */
.toggle {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(120,120,128,0.32);
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.22s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: white;
  left: 2px;
  top: 2px;
  transition: transform 0.22s var(--ease-spring);
  box-shadow: 0 2px 6px rgba(0,0,0,0.22), 0 1px 2px rgba(0,0,0,0.12);
}
.toggle input:checked + .toggle-slider {
  background: var(--green);
}
.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ──────────────────────────────────────────────
   BUTTONS — pill/rounded, Apple style
   ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.3rem;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: transform 0.15s var(--ease-spring), box-shadow 0.15s var(--ease-out), opacity 0.15s;
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(0,122,255,0.32);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 5px 16px rgba(0,122,255,0.38);
}
.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: 0 1px 4px rgba(0,122,255,0.2);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}
.btn-success {
  background: var(--green);
  color: white;
  box-shadow: 0 2px 8px rgba(52,199,89,0.3);
}
.btn-lg {
  padding: 0.88rem 2.2rem;
  font-size: 1rem;
  border-radius: 14px;
  letter-spacing: -0.02em;
}
.btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ──────────────────────────────────────────────
   CARDS
   ────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* ──────────────────────────────────────────────
   RESULTS
   ────────────────────────────────────────────── */
.results-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.result-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s;
}
.result-item:hover { box-shadow: var(--shadow); }
.result-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.result-info { flex: 1; min-width: 0; }
.result-name {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.result-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.size-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 99px;
  font-size: 0.72rem;
}
.size-badge.saved { background: var(--success-bg); color: var(--success); }
.size-badge.original {
  background: var(--bg);
  color: var(--text-muted);
  text-decoration: line-through;
}
.tool-share-panel {
  margin-top: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1rem;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
}
.tool-share-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: var(--success-text);
  background: color-mix(in srgb, var(--success-bg) 82%, #ffffff 18%);
  border: 1px solid color-mix(in srgb, var(--success) 32%, transparent);
  border-radius: 50%;
  box-shadow: 0 8px 20px rgba(52, 199, 89, 0.14);
}
.tool-share-success svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tool-share-starter .tool-share-success {
  color: var(--primary);
  background: var(--primary-light);
  border-color: var(--primary-mid);
}
.tool-share-copy {
  display: grid;
  gap: 0.18rem;
}
.tool-share-copy strong {
  font-size: 0.9rem;
  color: var(--text);
}
.tool-share-copy span {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tool-share-streak {
  display: inline-flex;
  width: fit-content;
  margin-top: 0.35rem;
  color: var(--success-text);
  font-size: 0.72rem;
  font-weight: 800;
}
.tool-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  grid-column: 1 / -1;
}
.tool-share-actions button {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.48rem 0.7rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.tool-share-actions button:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}
.tool-share-actions button.is-saved {
  color: var(--success-text);
  background: var(--success-bg);
  border-color: color-mix(in srgb, var(--success) 36%, transparent);
}
.tool-share-phone {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  grid-column: 1 / -1;
}
.tool-share-phone img {
  width: 74px;
  height: 74px;
  background: #fff;
  border-radius: 8px;
  padding: 0.35rem;
  border: 1px solid var(--border);
}
.tool-share-phone p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
}
.tool-share-next {
  display: grid;
  gap: 0.45rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border);
  grid-column: 1 / -1;
}
.tool-share-next strong {
  color: var(--text);
  font-size: 0.82rem;
}
.tool-share-next div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.tool-share-next a {
  display: inline-flex;
  align-items: center;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius);
  padding: 0.38rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}
.audit-recommendation-card p {
  min-height: 4.2em;
}

/* ──────────────────────────────────────────────
   SUPPORT
   ────────────────────────────────────────────── */
.support-section {
  max-width: 1180px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}
.support-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  padding: 1.15rem;
}
.support-copy {
  display: grid;
  gap: 0.45rem;
}
.support-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.support-copy h2 {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
}
.support-copy p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.65;
  max-width: 680px;
  margin: 0;
}
.support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  margin-top: 0.25rem;
  background: #ffdd00;
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}
.support-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.support-qr {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.support-qr img {
  width: 112px;
  height: 112px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
@media (max-width: 640px) {
  .support-section {
    margin-top: 2rem;
    padding: 0 1rem;
  }
  .support-inner {
    grid-template-columns: 1fr;
    justify-items: start;
  }
  .support-qr {
    grid-template-columns: auto 1fr;
    align-items: center;
    text-align: left;
  }
  .support-qr img {
    width: 86px;
    height: 86px;
  }
}

/* ──────────────────────────────────────────────
   PROGRESS BAR
   ────────────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 99px;
  transition: width 0.3s var(--ease-out);
}

/* ──────────────────────────────────────────────
   LAYOUT
   ────────────────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav {
    padding: 0 1rem;
  }
  .nav-inner {
    height: 62px;
  }
  .nav-discovery {
    margin-left: auto;
  }
  .nav-tool-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 72px;
    width: auto;
    max-height: calc(100vh - 92px);
    overflow: auto;
    background:
      linear-gradient(135deg, rgba(0,122,255,0.04), rgba(255,221,0,0.025)),
      color-mix(in srgb, var(--bg-elevated) 98%, transparent);
  }
  .nav-tool-groups {
    grid-template-columns: 1fr;
  }
  .nav-qr-popover {
    position: fixed;
    right: 1rem;
    top: 72px;
  }
  .nav-memory-panel {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: 72px;
    width: auto;
    max-height: calc(100vh - 92px);
    overflow: auto;
    transform: translateY(-6px) scale(0.985);
  }
  .nav-memory-menu.is-open .nav-memory-panel {
    transform: translateY(0) scale(1);
  }
  .nav-memory-trigger {
    width: 38px;
    justify-content: center;
    padding: 0;
  }
  .nav-memory-trigger > span {
    display: none;
  }
  .nav-memory-trigger b {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 14px;
    height: 14px;
    padding: 0 0.2rem;
    font-size: 0.56rem;
  }
}
@media (max-width: 560px) {
  .nav-coffee-button {
    width: 38px;
    justify-content: center;
    padding: 0;
  }
  .nav-coffee-button span:last-child {
    display: none;
  }
  .nav-tool-trigger {
    padding-inline: 0.58rem;
  }
  .nav-tool-trigger span:nth-child(2) {
    font-size: 0.78rem;
  }
  .nav-language-menu {
    width: 38px;
    justify-content: center;
    padding: 0;
  }
  .nav-language-menu select {
    position: absolute;
    inset: 0;
    width: 100%;
    opacity: 0;
  }
  .logo span {
    font-size: 0.95rem;
  }
}
@media (max-width: 400px) {
  .logo span {
    display: none;
  }
}
@media (max-width: 1500px) and (min-width: 769px) {
  .nav-links a {
    padding-inline: 0.55rem;
    font-size: 0.82rem;
  }
}
.section { margin: 2.5rem 0; }
.section:is(#faq, #contact) { scroll-margin-top: 5.25rem; }
.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  letter-spacing: -0.03em;
}
.page-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}
.page-desc {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 1.75rem;
  line-height: 1.65;
  max-width: 640px;
}

/* ──────────────────────────────────────────────
   PRIVACY BANNER
   ────────────────────────────────────────────── */
.privacy-banner {
  background: linear-gradient(135deg, rgba(52,199,89,0.08), rgba(52,199,89,0.04));
  border: 1px solid rgba(52, 199, 89, 0.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin: 1.25rem 0;
}
.privacy-banner .icon { font-size: 1.35rem; flex-shrink: 0; margin-top: 0.05rem; }
.privacy-banner h4 {
  font-size: 0.875rem;
  font-weight: 650;
  color: #1a7a3a;
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}
.privacy-banner p {
  font-size: 0.8rem;
  color: #2d7a4a;
  line-height: 1.5;
}
@media (prefers-color-scheme: dark) {
  .privacy-banner h4 { color: #4cd964; }
  .privacy-banner p  { color: #52d364; }
}

/* ──────────────────────────────────────────────
   BULK BAR
   ────────────────────────────────────────────── */
.bulk-bar {
  background: var(--primary-light);
  border: 1px solid var(--primary-mid);
  border-radius: var(--radius);
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.bulk-bar span {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.01em;
}

/* ──────────────────────────────────────────────
   FOOTER
   ────────────────────────────────────────────── */
footer {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.5rem 1.5rem;
  margin-top: 5rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.footer-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}
.footer-group {
  min-width: 0;
}
.footer-heading {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 650;
  margin-bottom: 0.75rem;
}
.footer-links {
  display: grid;
  gap: 0.25rem;
  list-style: none;
  min-width: 0;
}
.footer-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  width: fit-content;
  max-width: 100%;
  padding-block: 0.5rem;
  overflow-wrap: anywhere;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  transition: color 0.15s;
  letter-spacing: -0.01em;
}
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-copy {
  border-top: 1px solid var(--border);
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

@media (max-width: 640px) {
  footer {
    padding: 1.5rem;
  }
  .footer-groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .footer-tools-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
  }
}

/* ──────────────────────────────────────────────
   TOAST
   ────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(28,28,30,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: white;
  padding: 0.65rem 1.35rem;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  transition: all 0.35s var(--ease-spring);
  white-space: nowrap;
  pointer-events: none;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ──────────────────────────────────────────────
   COMPARE SLIDER
   ────────────────────────────────────────────── */
.compare-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  user-select: none;
  cursor: col-resize;
  max-height: 420px;
  box-shadow: var(--shadow-md);
}
.compare-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.compare-after {
  position: absolute;
  top: 0; left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
}
.compare-after img { width: 200%; max-width: none; }
.compare-divider {
  position: absolute;
  top: 0; left: 50%;
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.9);
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(0,0,0,0.4);
}
.compare-handle {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 38px; height: 38px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 3px 14px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.compare-label {
  position: absolute;
  top: 0.65rem;
  padding: 0.2rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 99px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(6px);
  color: white;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.compare-label.before { left: 0.65rem; }
.compare-label.after  { right: 0.65rem; }

/* ──────────────────────────────────────────────
   AI RESULT
   ────────────────────────────────────────────── */
.ai-result {
  background: linear-gradient(135deg, var(--primary-light), rgba(88,86,214,0.06));
  border: 1px solid rgba(0,122,255,0.2);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  margin-top: 1rem;
}
.ai-result h4 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.ai-result p {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.65;
}
.ai-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: var(--white);
  border: 1px solid rgba(0,122,255,0.2);
  border-radius: 99px;
  padding: 0.18rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin: 0.2rem;
}
.ai-control-panel {
  margin-top: 1rem;
  display: grid;
  gap: 0.85rem;
}
.ai-control-panel label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ai-control-panel textarea {
  min-height: 82px;
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
  line-height: 1.55;
  resize: vertical;
}
.ai-control-panel > p {
  margin-top: -0.45rem;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.55;
}
.ai-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.7rem;
}
.ai-mode-card {
  text-align: left;
  border: 1.5px solid var(--border);
  background: var(--white);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.15s var(--ease-out), box-shadow 0.15s;
}
.ai-mode-card:hover {
  border-color: var(--primary-mid);
  transform: translateY(-1px);
}
.ai-mode-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.ai-mode-card strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
}
.ai-mode-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  line-height: 1.4;
}
.ai-output-grid {
  display: grid;
  gap: 0.7rem;
}
.ai-output-card {
  background: var(--white);
  border: 1px solid rgba(0,122,255,0.16);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem;
}
.ai-output-card h5 {
  color: var(--primary);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}
.ai-output-card p {
  font-size: 0.9rem;
  line-height: 1.65;
}
.ai-output-card code {
  display: inline-block;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.25rem 0.45rem;
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}
@media (prefers-color-scheme: dark) {
  .ai-output-card {
    background: var(--bg-elevated);
    border-color: var(--border);
  }
}

/* ──────────────────────────────────────────────
   AD SLOT
   ────────────────────────────────────────────── */
.ad-slot {
  background: var(--bg);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
}

/* ──────────────────────────────────────────────
   MISC
   ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 2rem 0;
}
.hidden { display: none !important; }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }
@keyframes navLightSweep {
  0% { background-position: 100% 0; opacity: 0.28; }
  50% { opacity: 0.72; }
  100% { background-position: -100% 0; opacity: 0.28; }
}
@keyframes heroSparkBounce {
  0%, 100% { transform: translateY(0) rotate(8deg); }
  50% { transform: translateY(-6px) rotate(11deg); }
}
@keyframes workbenchFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes workbenchShine {
  0%, 55% { transform: translateX(-125%); opacity: 0; }
  68% { opacity: 1; }
  84%, 100% { transform: translateX(125%); opacity: 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.875rem; }

/* Number inputs */
input[type="number"] {
  padding: 0.42rem 0.65rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"]:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* Color input */
input[type="color"] {
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1.5px solid var(--border);
}

/* Textarea */
textarea {
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
}

/* Table refinements */
table { border-radius: var(--radius); overflow: hidden; }
th { background: var(--bg) !important; }

/* Guide pages define some light callout panels locally. Keep them readable in dark mode. */
@media (prefers-color-scheme: dark) {
  .guide-body .callout {
    background: rgba(0, 122, 255, 0.16) !important;
    border-left-color: var(--primary) !important;
    color: var(--text-secondary) !important;
  }
  .guide-body .callout-warn {
    background: rgba(255, 149, 0, 0.16) !important;
    border-left-color: var(--orange) !important;
    color: var(--text-secondary) !important;
  }
  .guide-body .callout-tip,
  .guide-body .callout-success {
    background: rgba(52, 199, 89, 0.16) !important;
    border-left-color: var(--green) !important;
    color: var(--text-secondary) !important;
  }
  .guide-body .example-box,
  .guide-body .guide-ai-tool,
  .guide-body .checklist li,
  .guide-body .cwv-item,
  .guide-body details,
  .guide-body a[style*="background:var(--bg-elevated)"] {
    background: var(--bg-elevated) !important;
    border-color: var(--border) !important;
    color: var(--text-secondary) !important;
  }
  .guide-body .guide-ai-tool {
    box-shadow: var(--shadow) !important;
  }
  .guide-body code {
    background: rgba(255, 255, 255, 0.10) !important;
    color: var(--text) !important;
  }
  .guide-body pre code {
    background: transparent !important;
    color: inherit !important;
  }
  .guide-body summary,
  .guide-body strong,
  .guide-body .example-label,
  .guide-body .tool-name,
  .guide-body a[style*="color:var(--text)"] {
    color: var(--text) !important;
  }
  .guide-body .tool-desc,
  .guide-body p[style*="color:var(--text-muted)"],
  .guide-body div[style*="color:var(--text-muted)"] {
    color: var(--text-secondary) !important;
  }
}

.i18n-faq-answer {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.75;
  padding: 0.25rem 1.25rem 1rem;
}

.card > .i18n-faq-answer {
  padding: 0.85rem 0 0;
}

/* Smooth scroll */
html { scroll-behavior: smooth; }

/* Focus visible — accessibility */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}


/* Tool directory: one column on phones, four on a wide screen. */
@media (min-width: 640px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1200px) {
  .tools-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Homepage categories reuse the cards, with up to three columns per group. */
.tools-grid.tools-grid-directory {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
}

.tool-directory [hidden] {
  display: none;
}
.tool-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tool-filter-bar button {
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--white);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tool-filter-bar button:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.tool-filter-bar button[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.tool-filter-bar button:focus-visible {
  border-radius: 99px;
}
.tool-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.tool-card-meta .tool-icon {
  flex-shrink: 0;
  margin-bottom: 0;
}
.tool-category-label {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
  letter-spacing: normal;
  text-transform: none;
}
.tools-grid[data-filtered-grid] {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
}

/* Tool cards carry a line icon rather than a text label. */
.tool-icon {
  background: var(--primary-light);
  color: var(--primary);
}
.tool-icon svg {
  width: 22px;
  height: 22px;
}

.logo img {
  display: block;
}

/* FAQ accordion, no script needed. */
.faq-list {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item summary {
  position: relative;
  padding: 1.1rem 2.2rem 1.1rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.faq-item p {
  max-width: 62ch;
  margin: 0 0 1.15rem;
  color: var(--text-secondary);
}

/* Tool workspace: upload zone, queue and batch actions. */
.tool-shell {
  margin: 1.5rem 0;
}
.upload-zone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-hint {
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.tool-error {
  margin: 1rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: rgba(255, 59, 48, 0.08);
  color: #b3261e;
  font-size: 0.9rem;
}
.tool-summary {
  margin: 1.25rem 0 0;
  font-weight: 600;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.25rem;
}
.result-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.result-actions .btn {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}
.steps-list {
  margin: 1.25rem 0 0;
  padding-left: 1.35rem;
  max-width: 70ch;
}
.steps-list li {
  margin-bottom: 0.7rem;
  line-height: 1.65;
}

/* A class-level display must not defeat the hidden attribute. */
[hidden] {
  display: none !important;
}

/* Language switcher: a plain <details> menu, no script needed. */
.locale-menu {
  position: relative;
  flex-shrink: 0;
}
.locale-menu summary,
.nav-tools-menu summary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  transition: background 0.15s ease;
}
.locale-menu summary::-webkit-details-marker,
.nav-tools-menu summary::-webkit-details-marker {
  display: none;
}
.locale-menu summary:hover,
.locale-menu[open] summary,
.nav-tools-menu summary:hover,
.nav-tools-menu[open] summary {
  background: var(--bg-secondary);
}
.locale-menu-panel,
.nav-tools-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 70;
  width: 16rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.35rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg, 0 12px 32px rgba(0, 0, 0, 0.14));
}
.locale-menu-panel ul,
.nav-tools-panel ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.locale-menu-panel a,
.nav-tools-panel a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 44px;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius);
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
}
.locale-menu-panel a:hover,
.nav-tools-panel a:hover {
  background: var(--bg-secondary);
}
.locale-menu-flag {
  width: 22px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(60, 60, 67, 0.12);
}
.locale-menu-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.locale-menu-current {
  color: var(--primary);
}

/* Shared tool navigation: keep the existing bar height and page alignment. */
.nav-inner > .logo { order: 1; }
.nav-inner > .nav-links {
  order: 2;
  margin: 0;
}
.nav-inner > .nav-tools-menu { order: 3; }
.nav-inner > .locale-menu {
  order: 4;
  margin-left: auto;
}
.nav .nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
  color: var(--text-secondary);
}
.nav .nav-links a:hover,
.nav .nav-links a.active,
.nav-tools-panel a.active {
  color: var(--text);
  background: var(--primary-light);
}
.nav-tools-panel a.active { font-weight: 600; }
.nav-tools-menu {
  position: relative;
  flex-shrink: 0;
}
.nav-tools-menu summary {
  width: auto;
  min-height: 44px;
  height: auto;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.nav-tools-menu summary svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.nav-tools-menu[open] summary svg { transform: rotate(180deg); }
.nav-tools-menu:has(.nav-secondary-links [aria-current="page"]) > summary {
  color: var(--text);
  background: var(--primary-light);
}
.nav-mobile-label,
.nav-primary-mobile { display: none; }
.nav-tools-panel {
  width: 18rem;
  max-height: calc(100vh - 90px);
  max-height: calc(100dvh - 90px);
  overscroll-behavior: contain;
}
.nav-tools-panel a { overflow-wrap: anywhere; }
.nav-tools-panel .nav-all-tools {
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
  padding-top: 0.35rem;
}
@media (max-width: 1100px) {
  .nav .nav-links { display: none; }
  .nav-inner > .nav-tools-menu {
    position: static;
  }
  .nav-more-label { display: none; }
  .nav-mobile-label { display: inline; }
  .nav-tools-menu summary,
  .nav-tools-panel a { font-size: 1rem; }
  .nav-tools-panel {
    width: auto;
    left: 0;
    right: 0;
  }
  .nav-tools-panel .nav-primary-mobile {
    display: block;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.35rem;
    padding-bottom: 0.35rem;
  }
}

/* Related tools: a row of sibling pages under the FAQ. */
.related-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.related-tools a {
  font-weight: 500;
}

/* Conversion results: the source format, the format it became, and the state
   of the file while it is still in the queue. */
.result-meta {
  flex-wrap: wrap;
  gap: 0.4rem;
}
.result-detail {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.result-detail + .result-detail::before {
  content: '·';
  margin-right: 0.4rem;
}
.format-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.14rem 0.5rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.format-badge.is-target {
  border-color: color-mix(in srgb, var(--success) 34%, transparent);
  background: var(--success-bg);
  color: var(--success-text);
}
.format-badge.is-failed {
  border-color: rgba(255, 59, 48, 0.32);
  background: rgba(255, 59, 48, 0.08);
  color: #b3261e;
}
.format-arrow {
  color: var(--text-muted);
  margin: 0 -0.1rem;
}
.result-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}
.result-item.is-processing {
  border-color: var(--primary-mid, var(--primary));
  box-shadow: 0 0 0 3px var(--primary-light);
}
.result-item.is-processing .result-thumb {
  animation: result-pulse 1.1s ease-in-out infinite;
}
.result-item.is-ready {
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
}
.result-item.is-failed {
  border-color: rgba(255, 59, 48, 0.3);
}
@keyframes result-pulse {
  50% { opacity: 0.45; }
}
.btn-icon {
  padding: 0.35rem 0.7rem;
  font-size: 1rem;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  .result-item.is-processing .result-thumb { animation: none; }
}

/* PDF layout controls: three short choices each, so segmented buttons beat a
   dropdown — every option is visible and one tap away. */
.pdf-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  margin-top: 1.25rem;
  padding: 1.1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.pdf-option {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
}
.pdf-option legend {
  padding: 0;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px;
  gap: 2px;
}
.segmented label {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.34rem 0.8rem;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 550;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + span {
  color: var(--primary);
}
.segmented label:has(input:checked) {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}
.segmented label:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.segmented label:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Page order: the images as the pages they will become, in reading order. */
.pdf-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}
.pdf-page {
  position: relative;
  border-radius: var(--radius);
  cursor: grab;
}
.pdf-page.is-dragging { opacity: 0.4; }
.pdf-page.is-drop-target .pdf-page-sheet {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.pdf-page-sheet {
  position: relative;
  aspect-ratio: 1 / 1.294;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.15s, border-color 0.15s;
}
.pdf-page:hover .pdf-page-sheet { box-shadow: var(--shadow-md); }
.pdf-page-sheet img {
  max-width: 88%;
  max-height: 88%;
  object-fit: contain;
  transition: transform 0.2s var(--ease-out);
}
.pdf-page-placeholder {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.pdf-page-number {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  min-width: 1.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 99px;
  background: var(--text);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.pdf-page-tools {
  position: absolute;
  left: 50%;
  bottom: 2.1rem;
  transform: translateX(-50%);
  display: flex;
  gap: 1px;
  padding: 2px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--white) 88%, transparent);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.15s;
  backdrop-filter: blur(8px);
}
.pdf-page:hover .pdf-page-tools,
.pdf-page:focus-within .pdf-page-tools { opacity: 1; }
.pdf-page-button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}
.pdf-page-button:hover { background: var(--bg); color: var(--primary); }
.pdf-page-button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
}
.pdf-page-name {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* A touch screen has no hover, so the controls stay visible there. */
@media (hover: none) {
  .pdf-page-tools { opacity: 1; }
}

/* The finished PDF. */
.pdf-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--success-bg);
  border: 1px solid color-mix(in srgb, var(--success) 34%, transparent);
  border-radius: var(--radius-lg);
}
.pdf-result-title {
  margin: 0;
  font-weight: 650;
  color: var(--success-text);
}
.pdf-result-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.pdf-result .btn { margin-left: auto; }

/* Resize settings: the same panel as the PDF one, plus number fields. */
.field-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.field > span {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.field input[type="number"] {
  width: 7.5rem;
  padding: 0.42rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.field input[type="number"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.field input[type="number"]:disabled {
  background: var(--bg);
  color: var(--text-muted);
}
.field-times {
  padding-bottom: 0.5rem;
  color: var(--text-muted);
}
.field-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.field-lock input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

/* Image resizer: once files are selected, previews stay beside one focused
   settings panel. The existing cards, controls and color tokens remain the
   same; only the workflow hierarchy changes. */
.resize-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(19rem, 0.55fr);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}
.resize-images-pane {
  min-width: 0;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.resize-pane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.resize-pane-head .tool-summary {
  margin: 0;
  color: var(--text-secondary);
}
.resize-pane-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.resize-pane-actions .btn {
  min-height: 44px;
}
.resize-results.results-grid {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}
.resize-controls-pane {
  position: sticky;
  top: 4.75rem;
  min-width: 0;
}
.resize-settings.pdf-settings {
  display: grid;
  gap: 1rem;
  margin-top: 0;
  padding: 1.15rem;
}
.resize-settings-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.resize-settings .pdf-option,
.resize-setting-group {
  display: grid;
  gap: 0.55rem;
}
.resize-settings .segmented label {
  min-height: 44px;
}
.resize-settings .pdf-option legend {
  margin-bottom: 0;
}
.resize-dimensions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 0.55rem;
}
.resize-dimensions .field input[type="number"],
.resize-percent-fields .field input[type="number"] {
  width: 100%;
  min-height: 44px;
}
.resize-dimensions .field-times {
  padding-bottom: 0.65rem;
}
.resize-dimensions .field-lock {
  grid-column: 1 / -1;
  min-height: 44px;
  padding: 0;
  white-space: normal;
}
.resize-size-hint {
  margin: -0.15rem 0 0;
  padding: 0.6rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}
.resize-size-hint.is-warning {
  background: var(--warning-bg);
}
.resize-percent-fields {
  display: grid;
  gap: 0.65rem;
}
.resize-scale-presets {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.resize-scale-presets > span {
  flex-basis: 100%;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}
.resize-scale-chip {
  min-width: 52px;
  min-height: 44px;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.resize-scale-chip:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text);
}
.resize-scale-chip[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: var(--primary-light);
  color: var(--primary);
}
.resize-scale-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.resize-scale-chip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.resize-check {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}
.resize-check input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: var(--primary);
}
.resize-check:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}
.resize-controls-pane .tool-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.resize-controls-pane .tool-actions .btn {
  width: 100%;
  min-height: 44px;
}
.resize-tool .result-actions .btn {
  min-height: 44px;
}
.resize-tool .result-actions .btn-icon {
  min-width: 44px;
}

@media (max-width: 900px) {
  .resize-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .resize-controls-pane {
    position: static;
  }
}
@media (max-width: 520px) {
  .resize-images-pane,
  .resize-settings.pdf-settings {
    padding: 0.85rem;
  }
  .resize-pane-head {
    align-items: flex-start;
  }
  .resize-pane-actions {
    width: 100%;
  }
  .resize-pane-actions .btn {
    flex: 1 1 0;
  }
  .resize-tool .result-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: start;
    padding: 0.85rem;
  }
  .resize-tool .result-thumb {
    width: 48px;
    height: 48px;
  }
  .resize-tool .result-actions {
    grid-column: 2;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .resize-tool .result-detail {
    white-space: normal;
  }
}

/* Meme editor: the picture on the left, the words that go on it on the right. */
.meme-editor {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr);
  gap: 1.5rem;
  align-items: start;
  margin-top: 1.5rem;
}
@media (max-width: 860px) {
  .meme-editor { grid-template-columns: minmax(0, 1fr); }
}
.meme-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  min-height: 220px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.meme-canvas {
  max-width: 100%;
  max-height: 32rem;
  height: auto;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.meme-panel {
  display: grid;
  gap: 1.1rem;
  padding: 1.25rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.meme-panel > h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.meme-field { display: grid; gap: 0.35rem; }
.meme-field > span,
.meme-field > legend {
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0;
}
.meme-field input[type="text"] {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
}
.meme-field input[type="text"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
  border-color: var(--primary);
}
.meme-field input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
}
fieldset.meme-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.meme-field .segmented { display: flex; flex-wrap: wrap; }
.meme-range-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.meme-range-head b {
  font-size: 0.78rem;
  font-weight: 650;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-transform: none;
  letter-spacing: 0;
}
.meme-colors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.meme-field input[type="color"] {
  width: 100%;
  height: 2.2rem;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--white);
  cursor: pointer;
}
.meme-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.meme-actions .btn { flex: 1 1 auto; }
.meme-info {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Pixel art keeps its hard edges when the browser scales the canvas down. */
.pixel-canvas {
  max-width: 100%;
  max-height: 30rem;
  height: auto;
  width: auto;
  image-rendering: pixelated;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.meme-field.is-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.meme-field.is-toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}
.meme-field.is-toggle > span {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Pixelate: the picture is the canvas you draw the hidden areas onto. */
.pixelate-canvas {
  max-width: 100%;
  max-height: 30rem;
  height: auto;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  touch-action: none;
}
.pixelate-canvas.is-drawable { cursor: crosshair; }
.selection-hint {
  margin: 0.6rem 0 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* GIF maker: the two sources are tabs, the result plays where it was made. */
.gif-tabs {
  margin: 1.5rem 0 1.25rem;
  width: fit-content;
  max-width: 100%;
}
.gif-editor { scroll-margin-top: 4.75rem; }
.gif-editor.is-ready {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1.25rem;
  align-items: start;
}
.gif-editor > .tool-error {
  grid-column: 1 / -1;
  margin-top: 0;
}
.gif-editor.is-ready .upload-zone {
  display: none;
}
.gif-editor.is-ready .gif-source-pane {
  min-width: 0;
  padding: 1rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.gif-source-pane .tool-summary {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.gif-tool .pdf-pages {
  grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
  justify-content: start;
  gap: 0.75rem;
  margin-top: 0;
}
.gif-frame .pdf-page-sheet {
  aspect-ratio: 4 / 3;
}
.gif-frame .pdf-page-tools {
  position: static;
  transform: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(44px, 1fr));
  gap: 4px;
  padding: 4px 0 0;
  border: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
}
.gif-frame .pdf-page-button {
  width: 100%;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  touch-action: manipulation;
}
.gif-frame .pdf-page-button:hover {
  background: var(--primary-light);
}
.gif-frame .pdf-page-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.gif-frame-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: end;
  gap: 4px;
  margin-top: 0.5rem;
}
.gif-frame-delay {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.gif-frame-delay input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.4rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}
.gif-copy-frame {
  display: flex;
  align-items: center;
  justify-content: center;
}
.gif-control-hint {
  display: block;
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}
.gif-video-trim { margin-top: 1rem; }
.gif-video-trim > strong { font-size: 0.88rem; }
.gif-trim-timeline { position: relative; height: 96px; }
.gif-trim-track {
  position: absolute;
  top: 44px;
  right: 22px;
  left: 22px;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
}
.gif-trim-selection {
  position: absolute;
  inset: 0 calc(100% - var(--trim-end)) 0 var(--trim-start);
  background: var(--primary);
}
.gif-trim-playhead {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 14px;
  background: var(--text);
  pointer-events: none;
}
.gif-trim-handle {
  position: absolute;
  top: -44px;
  left: var(--trim-start);
  display: flex;
  justify-content: center;
  align-items: end;
  width: 44px;
  height: 44px;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--primary);
  cursor: ew-resize;
  touch-action: none;
}
.gif-trim-handle.is-end {
  top: 6px;
  left: var(--trim-end);
  align-items: start;
}
.gif-trim-handle.is-end svg { transform: rotate(180deg); }
.gif-trim-handle:hover { background: var(--primary-light); }
.gif-trim-handle:disabled { opacity: 0.45; cursor: not-allowed; }
.gif-trim-handle:focus-visible,
.gif-frame-delay input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.gif-video-trim .field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.gif-video-trim .field { min-width: 0; }
.gif-video-trim .field input { min-height: 44px; font-size: 1rem; }
.gif-video-trim .gif-preview-toolbar { flex-wrap: wrap; }
.gif-video-trim .tool-error { margin: 0.5rem 0 0; }
.gif-live-preview {
  margin-bottom: 1rem;
}
.gif-live-stage {
  min-width: 0;
  padding: 0.75rem;
}
.gif-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.gif-preview-toolbar .btn { min-height: 44px; }
.gif-preview-toolbar output,
.gif-dimensions {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.gif-width-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.gif-width-control > span {
  min-width: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.gif-width-number {
  width: 6rem;
  min-width: 0;
  min-height: 44px;
  flex-shrink: 0;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}
.gif-width-number:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.gif-dimensions { display: block; margin-top: 0.5rem; }
.gif-controls-pane .pdf-result {
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 1rem;
}
.gif-controls-pane .pdf-result .btn { min-height: 44px; }
.gif-source-pane .gif-result-stage:not(:empty) {
  margin: 0 0 1rem;
}
.gif-controls-pane {
  min-width: 0;
}
.gif-settings.pdf-settings {
  display: block;
  margin-top: 0;
  padding: 1.15rem;
}
.gif-primary-settings,
.gif-advanced-settings-grid {
  display: grid;
  gap: 1rem;
}
.gif-advanced-settings {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.gif-advanced-settings summary {
  position: relative;
  min-height: 44px;
  display: flex;
  align-items: center;
  padding-right: 1.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.gif-advanced-settings summary::-webkit-details-marker {
  display: none;
}
.gif-advanced-settings summary::after {
  content: '+';
  position: absolute;
  right: 0.2rem;
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}
.gif-advanced-settings[open] summary::after {
  transform: rotate(45deg);
}
.gif-advanced-settings summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.gif-advanced-settings-grid {
  padding-top: 0.85rem;
}
.gif-controls-pane .tool-actions {
  margin-top: 0.75rem;
}
.gif-controls-pane .tool-actions [data-create] {
  flex: 1 0 100%;
}
.gif-controls-pane .tool-actions .btn {
  min-height: 44px;
}
.gif-result-stage:not(:empty) {
  margin-top: 1.25rem;
}
.gif-preview,
.gif-video {
  max-width: 100%;
  max-height: 26rem;
  height: auto;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.gif-result-stage:empty { display: none; }
@media (max-width: 860px) {
  .gif-editor.is-ready {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .gif-tool .pdf-pages {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Collage editor: fast upload-to-canvas flow with count-aware templates. */
.collage-editor.meme-editor {
  scroll-margin-top: 4.75rem;
}
.collage-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow);
}
.collage-toolbar-start,
.collage-history-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.collage-count {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collage-toolbar .btn,
.collage-photo-toolbar .btn,
.collage-crop-bar .btn,
.collage-order-actions .btn,
.collage-reset-button {
  min-height: 44px;
}
.collage-history-actions { justify-self: center; }
.collage-history-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}
.collage-download-button { justify-self: end; }
.collage-main { min-width: 0; }
.collage-tool .meme-stage {
  position: relative;
  min-height: 24rem;
  overflow: hidden;
  transition: border-color 0.18s var(--ease-out), background 0.18s var(--ease-out);
}
.collage-tool .meme-stage.is-dragging {
  border-color: var(--primary);
  background: var(--primary-light);
}
.collage-canvas-wrap {
  --collage-ratio: 1;
  position: relative;
  width: min(100%, calc(32rem * var(--collage-ratio)));
  aspect-ratio: var(--collage-ratio);
  max-height: 32rem;
  line-height: 0;
}
.collage-canvas {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}
.collage-cell-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.collage-cell-button {
  position: absolute;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background 0.15s var(--ease-out);
}
.collage-cell-button:hover {
  border-color: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.collage-cell-button.is-selected {
  z-index: 2;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--primary);
}
.collage-cell-button.is-cropping {
  cursor: grab;
  touch-action: none;
  background: rgba(0, 122, 255, 0.04);
}
.collage-cell-button.is-cropping:active { cursor: grabbing; }
.collage-cell-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.collage-photo-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: var(--shadow-md);
  line-height: 1.2;
}
.collage-photo-actions {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.collage-photo-toolbar .meme-field {
  flex: 1 1 100%;
  margin-top: 0.25rem;
}
.collage-photo-toolbar .segmented label {
  flex: 1 1 auto;
  min-height: 44px;
}
.collage-selected-name {
  max-width: 9rem;
  overflow: hidden;
  padding: 0 0.45rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collage-photo-toolbar .btn {
  padding: 0.55rem 0.7rem;
  font-size: 0.8rem;
}
.collage-delete-button { font-weight: 650; }
.collage-crop-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 0.75rem;
  margin-top: 0;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.collage-crop-bar[hidden],
.collage-photo-toolbar[hidden],
.collage-tab-panel[hidden] { display: none; }
.collage-crop-hint {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}
.collage-zoom {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.35rem;
}
.collage-zoom > .meme-range-head {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
}
.collage-zoom input {
  width: 100%;
  min-height: 24px;
  accent-color: var(--primary);
}
.collage-thumbs-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 650;
}
.collage-drag-hint {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
}
.collage-thumbs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
  margin: 0.45rem 0 0;
  padding: 0.2rem 0.15rem 0.45rem;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  list-style: none;
  scrollbar-width: thin;
}
.collage-thumb {
  position: relative;
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  cursor: grab;
  transition: border-color 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), opacity 0.15s var(--ease-out);
}
.collage-thumb.is-selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.collage-thumb-button {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: calc(var(--radius-sm) - 1px);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.collage-thumb-button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}
.collage-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collage-thumb-number {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  display: grid;
  width: 1.25rem;
  height: 1.25rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
}
.collage-thumb.is-dragging { opacity: 0.4; }
.collage-thumb.is-drop-target {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.collage-add-thumb { border-style: dashed; }
.collage-add-thumb .collage-thumb-button {
  display: grid;
  place-content: center;
  gap: 0.2rem;
  padding: 0.35rem;
}
.collage-add-thumb-icon {
  color: var(--primary);
  font-size: 1.4rem;
  font-weight: 400;
  line-height: 1;
}
.collage-add-thumb-label {
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 1.2;
}
.collage-add-thumb .collage-thumb-button:hover:not(:disabled) { background: var(--primary-light); }
.collage-add-thumb .collage-thumb-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.collage-controls.meme-panel {
  gap: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
}
.collage-controls.meme-panel > h3 {
  padding: 1rem 1rem 0.8rem;
}
.collage-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0 0.65rem;
  border-bottom: 1px solid var(--border);
}
.collage-tab {
  position: relative;
  min-width: 0;
  min-height: 44px;
  padding: 0.55rem 0.35rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  touch-action: manipulation;
}
.collage-tab::after {
  content: '';
  position: absolute;
  right: 0.45rem;
  bottom: -1px;
  left: 0.45rem;
  height: 2px;
  border-radius: 999px;
  background: transparent;
}
.collage-tab:hover { color: var(--text); }
.collage-tab[aria-selected="true"] { color: var(--primary); }
.collage-tab[aria-selected="true"]::after { background: var(--primary); }
.collage-tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  border-radius: var(--radius-sm);
}
.collage-tab-panel {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}
.collage-panel-label {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 650;
}
.collage-templates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.collage-template {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  min-height: 92px;
  padding: 0.45rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.collage-template:hover { border-color: var(--border-strong); }
.collage-template[aria-pressed="true"] {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: inset 0 0 0 1px var(--primary);
  color: var(--primary);
}
.collage-template:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.collage-template-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 96 / 68;
  overflow: hidden;
  border-radius: 6px;
  background: color-mix(in srgb, var(--bg) 76%, var(--white));
}
.collage-template-sheet {
  position: absolute;
  overflow: hidden;
  border-radius: 4px;
  background: var(--white);
}
.collage-template-cell {
  position: absolute;
  border-radius: 2px;
  background: color-mix(in srgb, var(--primary) 58%, var(--white));
}
.collage-template-cell:nth-child(even) {
  background: color-mix(in srgb, var(--secondary) 45%, var(--white));
}
.collage-template-name {
  overflow: hidden;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collage-controls .meme-field { gap: 0.45rem; }
.collage-controls .segmented label { min-height: 44px; }
.collage-controls .meme-field input[type="color"] { min-height: 44px; }
.collage-dimensions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.collage-dimensions input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  font-size: 1rem;
}
.collage-size-hint {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.5;
}
.collage-controls [data-size-error] { margin: 0.35rem 0 0; }
.collage-select-hint,
.collage-selected-summary {
  min-height: 2.5rem;
  padding: 0.65rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.collage-selected-summary:empty { display: none; }
.collage-order-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.collage-more-settings {
  padding-top: 0.2rem;
  border-top: 1px solid var(--border);
}
.collage-more-settings > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}
.collage-more-settings > summary::-webkit-details-marker { display: none; }
.collage-more-settings > summary::after {
  content: '+';
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform 0.15s var(--ease-out);
}
.collage-more-settings[open] > summary::after { transform: rotate(45deg); }
.collage-more-settings > summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.collage-more-settings-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 5rem;
  gap: 0.75rem;
  padding: 0.75rem 0 0.25rem;
}
.collage-reset-button { width: 100%; }

@media (max-width: 860px) {
  .collage-templates {
    display: flex;
    gap: 0.65rem;
    margin-inline: -1rem;
    padding: 0.15rem 1rem 0.5rem;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x proximity;
  }
  .collage-template {
    flex: 0 0 124px;
    scroll-snap-align: start;
  }
}

@media (max-width: 520px) {
  .collage-editor.meme-editor { gap: 0.85rem; }
  .collage-toolbar {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 0.4rem;
    margin-inline: -0.35rem;
    padding: 0.5rem;
    border-radius: var(--radius);
  }
  .collage-toolbar .btn {
    min-height: 44px;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
  }
  .collage-count,
  .collage-action-label { display: none; }
  .collage-history-actions { gap: 0.25rem; }
  .collage-history-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 1rem;
  }
  .collage-download-button { max-width: 100%; }
  .collage-tool .meme-stage {
    min-height: 18rem;
    padding: 0.65rem;
  }
  .collage-photo-actions { width: 100%; }
  .collage-selected-name { display: none; }
  .collage-photo-toolbar .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 0.45rem;
  }
  .collage-crop-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
  .collage-crop-bar .btn { width: 100%; }
  .collage-drag-hint { display: none; }
  .collage-thumb {
    flex-basis: 72px;
    width: 72px;
    height: 72px;
  }
  .collage-controls.meme-panel > h3 { padding-inline: 0.85rem; }
  .collage-tabs { padding-inline: 0.4rem; }
  .collage-tab-panel { padding: 0.85rem; }
  .collage-templates {
    margin-inline: -0.85rem;
    padding-inline: 0.85rem;
  }
  .collage-template { flex-basis: 116px; }
  .collage-more-settings-body { grid-template-columns: minmax(0, 1fr); }
}

/* Colour picker: the picture is the control, the readings sit beside it. */
.picker-canvas {
  max-width: 100%;
  max-height: 30rem;
  height: auto;
  width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  cursor: crosshair;
  touch-action: none;
}
.picker-canvas:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}
.picker-loupe {
  display: block;
  margin: 0.75rem auto 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  image-rendering: pixelated;
}
.color-selected {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.color-selected-swatch {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.color-row > span:first-child {
  width: 2.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}
.color-row code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  background: var(--bg);
  border-radius: 8px;
}
.color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
}
.color-swatch:hover { transform: scale(1.06); }
.color-swatch:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.saved-color {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.4rem 0.2rem 0.2rem;
  border: 1px solid var(--border);
  border-radius: 99px;
}
.saved-color code { font-size: 0.76rem; }
.saved-color .color-swatch { width: 24px; height: 24px; border-radius: 50%; }
.tool-error.is-notice {
  background: var(--success-bg);
  color: var(--success-text);
}
