/* Designed by Kapil Pidhwani: Fox-inspired Editorial Design System for Toolity.in */

:root {
  /* Environment & Surfaces (Light Theme) */
  --background: #FFFFFF;
  --surface: #F7F7F5;
  --surface-elevated: #FFFFFF;
  --surface-soft-orange: #FFF1EB;

  /* Typography (Charcoal System) */
  --text-primary: #17191C;
  --text-secondary: #62666B;
  --text-muted: #92969B;
  --text-inverse: #FFFFFF;

  /* Borders & Hairlines */
  --border: #E8E8E6;
  --border-subtle: rgba(23, 25, 28, 0.06);

  /* Brand / Signal (Orange Highlighter ~2%) */
  --brand: #F4511E;
  --brand-hover: #D84315;
  --brand-soft: #FFF1EB;
  --brand-cream: #FFF4E8;
  --brand-peach: #FFD1B8;
  --brand-gold: #F9B72B;

  /* Shadow Tokens (Subtle, Sub-0.08 opacity) */
  --shadow-sm: 0 1px 2px rgba(23, 25, 28, 0.04);
  --shadow-md: 0 4px 12px rgba(23, 25, 28, 0.05);
  --shadow-card: 0 0 0 1px var(--border), 0 2px 6px rgba(23, 25, 28, 0.03);
  --shadow-card-hover: 0 0 0 1px var(--border), 0 8px 24px rgba(23, 25, 28, 0.07);
  --shadow-btn-brand: 0 2px 8px rgba(244, 81, 30, 0.24);
  --shadow-btn-brand-hover: 0 4px 14px rgba(244, 81, 30, 0.32);

  /* Typography Stack */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Radii Scale */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Layout Constants */
  --container-max-width: clamp(1140px, 80vw, 1440px); /* 1140 up to 1440 wide, 1440 cap on ultrawide */
  --header-height: 68px;
  --content-max: 72ch;   /* prose line-length cap (FAQ, guides, descriptions) */
  --touch: 44px;         /* min hit size on coarse pointers */
}

[data-theme="dark"] {
  /* Environment & Surfaces (Dark Theme) */
  --background: #0D0D0D;
  --surface: #151515;
  --surface-elevated: #1B1B1B;
  --surface-soft-orange: #32170F;

  /* Typography (Charcoal / Off-White System) */
  --text-primary: #F5F5F2;
  --text-secondary: #A5A7AA;
  --text-muted: #73767A;
  --text-inverse: #0D0D0D;

  /* Borders & Hairlines */
  --border: #292B2E;
  --border-subtle: rgba(245, 245, 242, 0.07);

  /* Brand / Signal (Elevated Contrast) */
  --brand: #FF6A2A;
  --brand-hover: #FF7A3D;
  --brand-soft: #32170F;
  --brand-cream: #2A1D16;
  --brand-peach: #4A281E;
  --brand-gold: #E5A820;

  /* Shadow Tokens */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 0 0 1px var(--border), 0 2px 6px rgba(0, 0, 0, 0.25);
  --shadow-card-hover: 0 0 0 1px var(--border), 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-btn-brand: 0 2px 8px rgba(255, 106, 42, 0.28);
  --shadow-btn-brand-hover: 0 4px 16px rgba(255, 106, 42, 0.4);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a, a:visited {
  color: inherit;
  text-decoration: none;
}

html {
  font-size: clamp(16px, 0.84rem + 0.18vw, 18px); /* 16px ≤1440 → 18px at 2560 */
  scroll-behavior: smooth;
}

@keyframes fadeInPage {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  min-height: 100vh;
  font-family: var(--font-family);
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
  animation: fadeInPage 0.2s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
  }
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-height);
  background: transparent;
  transition: background-color 0.25s ease, border-color 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease;
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  /* Designed by Kapil Pidhwani: header bar stays transparent on scroll — only the nav capsule, logo and buttons float.
     pointer-events pass through the empty strip so content under it stays clickable. */
  background: transparent;
  pointer-events: none;
}

.site-header.scrolled .nav-left,
.site-header.scrolled .nav-center,
.site-header.scrolled .nav-right { pointer-events: auto; }

.nav-container {
  width: 100%;
  padding: 0 clamp(1rem, 2.5vw, 2.5rem);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  justify-self: start;
}

.nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-self: end;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.15s ease;
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-tld {
  color: var(--text-muted);
  font-weight: 500;
}

/* Navigation Capsule (Frosted Glass Aesthetic) */
.nav-glass-capsule {
  display: inline-flex;
  align-items: center;
  padding: 4px 6px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 4px 20px -2px rgba(0, 0, 0, 0.06), 
    0 1px 3px rgba(0, 0, 0, 0.04), 
    inset 0 1px 1px rgba(255, 255, 255, 1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
}

[data-theme="dark"] .nav-glass-capsule {
  background: rgba(22, 22, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    0 8px 32px -4px rgba(0, 0, 0, 0.55), 
    0 2px 6px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 3px;
  list-style: none;
  white-space: nowrap;
}

.nav-link,
.nav-link:visited {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.38rem 0.85rem;
  border-radius: var(--radius-pill);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-link:hover,
.nav-link:visited:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-link,
[data-theme="dark"] .nav-link:visited {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link:visited:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}

.nav-link.active,
.nav-link.active:visited {
  color: var(--brand);
  font-weight: 600;
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 2.5px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, #F4511E 0%, #FF6A2A 100%);
}

.nav-link.active:hover,
.nav-link.active:visited:hover {
  color: var(--brand);
  background: rgba(244, 81, 30, 0.05);
}

[data-theme="dark"] .nav-link.active,
[data-theme="dark"] .nav-link.active:visited {
  color: #FF7A3D;
  background: transparent;
  border: none;
  box-shadow: none;
}

[data-theme="dark"] .nav-link.active::after {
  background: linear-gradient(90deg, #FF6A2A 0%, #FF8A50 100%);
  box-shadow: 0 0 8px rgba(255, 106, 42, 0.45);
}

[data-theme="dark"] .nav-link.active:hover,
[data-theme="dark"] .nav-link.active:visited:hover {
  color: #FF7A3D;
  background: rgba(255, 106, 42, 0.08);
}

/* Mobile Navigation Button & Drawer (Frosted Glass Aesthetic) */
#mobile-menu-toggle {
  display: none;
}

.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.12);
  z-index: 99;
  display: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .mobile-nav-drawer {
  background: rgba(18, 18, 18, 0.94);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 20px 48px -4px rgba(0, 0, 0, 0.65);
}

.mobile-nav-drawer.open {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-content {
  padding: 1.25rem 1.25rem 1.5rem;
  max-height: calc(100dvh - var(--header-height));
  overflow-y: auto;
}

.mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.mobile-nav-link,
.mobile-nav-link:visited {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 500;
  transition: all 0.15s ease;
}

.mobile-nav-link:hover,
.mobile-nav-link:visited:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
}

.mobile-nav-link.active,
.mobile-nav-link.active:visited {
  background: var(--brand-soft);
  border-color: rgba(244, 81, 30, 0.35);
  color: var(--brand);
  font-weight: 600;
}

.mobile-nav-link iconify-icon {
  color: var(--brand);
  font-size: 1.1rem;
}

.mobile-nav-footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-sublink,
.mobile-nav-sublink:visited {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.mobile-nav-sublink:hover,
.mobile-nav-sublink:visited:hover {
  color: var(--brand);
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 98;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-nav-backdrop.open {
  display: block;
  opacity: 1;
}

/* Category Page Hero & Breadcrumbs */
.page-hero {
  padding: calc(var(--header-height) + 3rem) 0 3.5rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb-link:hover {
  color: var(--brand);
}

.breadcrumb-separator {
  color: var(--text-muted);
  opacity: 0.6;
}

.breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

.page-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.page-header-content {
  max-width: 680px;
}

.page-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.page-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.page-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  background: var(--background);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

/* Tools Showcase Grid (4-Column Layout matching Homepage Explore) */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(max(250px, calc(25% - 9px)), 1fr)); /* 1→4 cols, see #category-cards */
  gap: 12px;
  width: 100%;
}

.tools-grid:hover > .category-glow-card::after {
  opacity: 1;
}

/* Category Hub Tool Cards (Clean UX without Ghost Icons) */
.tools-grid .category-glow-card {
  height: 250px;
}

.tools-grid .category-glow-card > .glow-card-content {
  position: absolute;
  inset: 1px;
  padding: 1.15rem 1.15rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  border-radius: calc(var(--radius-lg) - 1px);
}

.tool-card-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.category-glow-card:hover .tool-card-icon-badge {
  color: var(--brand);
  border-color: var(--brand-peach);
  background: var(--brand-soft);
  transform: scale(1.06);
}

.tool-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
  transition: color 0.15s ease;
}

.category-glow-card:hover .tool-card-title {
  color: var(--brand);
}

.tool-card-desc {
  color: var(--text-secondary);
  font-size: 0.83rem;
  line-height: 1.45;
  margin: 0 0 0.5rem 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-card-action {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: color 0.15s ease;
  margin-top: auto;
}

.tool-card-action iconify-icon {
  color: var(--text-muted);
  transition: transform 0.2s ease, color 0.2s ease;
}

.category-glow-card:hover .tool-card-action {
  color: var(--brand);
}

.category-glow-card:hover .tool-card-action iconify-icon {
  transform: translateX(4px);
  color: var(--brand);
}

/* Category Workspace Empty State */
.workspace-empty-card {
  background: var(--background);
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(3rem, 6vw, 4.5rem) 2rem;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.workspace-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  margin-bottom: 1.25rem;
}

.workspace-empty-title {
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
  letter-spacing: -0.015em;
}

.workspace-empty-desc {
  font-size: 0.94rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  max-width: 440px;
}

/* Theme Toggle Button (Frosted Glass Pill) */
.btn-icon-pill {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 
    0 4px 16px -2px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 1);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .btn-icon-pill {
  background: rgba(22, 22, 22, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
}

.btn-icon-pill:hover {
  background: #FFFFFF;
  border-color: rgba(244, 81, 30, 0.25);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 20px -2px rgba(244, 81, 30, 0.15),
    0 2px 6px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .btn-icon-pill:hover {
  background: rgba(35, 35, 35, 0.9);
  border-color: rgba(255, 106, 42, 0.4);
  color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 
    0 6px 24px -2px rgba(255, 106, 42, 0.25);
}

.btn-icon-pill:active {
  transform: translateY(0);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 42px;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

/* Primary CTA — Designed by Kapil Pidhwani: tonal brand (soft fill, brand text), no glow.
   Orange stays an accent, matching active nav links and callouts. */
.btn-primary-signal,
.btn-primary-signal:visited {
  background-color: var(--brand-soft);
  color: var(--brand-hover);
  border-color: rgba(244, 81, 30, 0.22);
}

.btn-primary-signal:hover {
  background-color: rgba(244, 81, 30, 0.14);
  border-color: rgba(244, 81, 30, 0.4);
  color: var(--brand-hover);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-primary-signal,
[data-theme="dark"] .btn-primary-signal:visited {
  color: var(--brand-hover);
  border-color: rgba(255, 106, 42, 0.3);
}

[data-theme="dark"] .btn-primary-signal:hover {
  background-color: rgba(255, 106, 42, 0.2);
  border-color: rgba(255, 106, 42, 0.5);
}

.btn-primary-signal:active {
  transform: translateY(0);
}

/* Secondary — same frosted-glass recipe as .nav-glass-capsule / .btn-icon-pill */
.btn-secondary-neutral,
.btn-secondary-neutral:visited {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-color: rgba(0, 0, 0, 0.06);
  color: var(--text-secondary);
  box-shadow:
    0 4px 16px -2px rgba(0, 0, 0, 0.05),
    0 1px 2px rgba(0, 0, 0, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 1);
}

.btn-secondary-neutral:hover {
  background: #FFFFFF;
  color: var(--text-primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-secondary-neutral,
[data-theme="dark"] .btn-secondary-neutral:visited {
  background: rgba(22, 22, 22, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow:
    0 8px 24px -4px rgba(0, 0, 0, 0.5),
    inset 0 1px 1px rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .btn-secondary-neutral:hover {
  background: rgba(35, 35, 35, 0.9);
  color: #FFFFFF;
}

.btn-secondary-neutral:active {
  transform: translateY(0);
}

/* ==========================================================================
   Hero Section (Editorial, Clean, Minimalist)
   ========================================================================== */
.hero-section {
  position: relative;
  min-height: 100dvh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--header-height) 0 3.5rem;
  box-sizing: border-box;
  overflow: hidden;
  background-color: var(--background);
}

#hero-waves-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Atmospheric Vignette & Seamless Bottom Section Blending */
.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 20%, rgba(13, 13, 13, 0.4) 65%, rgba(13, 13, 13, 0.85) 100%),
    linear-gradient(to bottom, transparent 30%, rgba(21, 21, 21, 0.4) 65%, var(--surface) 100%);
}

[data-theme="light"] .hero-section::after {
  background:
    radial-gradient(ellipse at 50% 45%, transparent 30%, rgba(255, 255, 255, 0.2) 65%, rgba(247, 247, 245, 0.75) 100%),
    linear-gradient(to bottom, transparent 30%, rgba(247, 247, 245, 0.45) 65%, var(--surface) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 840px;
  transform: translateY(-2.5rem);
}

.hero-title {
  font-size: clamp(2.4rem, 5.2vw, 3.75rem);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  max-width: 820px;
  margin: 0 auto 1.15rem;
  text-wrap: balance;
}

.hero-subtitle {
  font-size: clamp(1.02rem, 1.7vw, 1.18rem);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  max-width: 620px;
  margin: 0 auto 1.65rem;
}

/* Inline links in prose (Privacy, Terms, Credits…) */
.prose-card a:not(.btn-pill) {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.prose-card a:not(.btn-pill):hover {
  text-decoration: underline;
}

/* 404 mascot */
.error-mascot {
  margin-bottom: 1.5rem;
}

.error-mascot img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.1));
}

/* CTA row inside content pages (Partner, About) */
.prose-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* Hero CTAs: Explore Categories (solid brand) + View All Tools (quiet ghost) */
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
}
/* Designed by Kapil Pidhwani: hero-only buttons. 12px radius (not the nav's pill), one solid primary with a
   soft brand glow, one ghost secondary with no fill/glass so it can't be mistaken for the header capsule. */
.hero-btn,
.hero-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .25s ease, transform .2s cubic-bezier(.16, 1, .3, 1);
}
.hero-btn iconify-icon { transition: transform .2s cubic-bezier(.16, 1, .3, 1); }
.hero-btn:active { transform: translateY(0) scale(.985); }
.hero-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }

/* Designed by Kapil Pidhwani: tonal brand, same palette as .btn-primary-signal (soft fill, deep brand text,
   tinted hairline) — orange stays an accent, not a block. No glow; depth comes from the lift + a neutral shadow. */
.hero-btn-primary,
.hero-btn-primary:visited {
  background: var(--brand-soft);
  color: var(--brand-hover);
  border-color: rgba(244, 81, 30, 0.28);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.hero-btn-primary:hover {
  background: rgba(244, 81, 30, 0.14);
  border-color: rgba(244, 81, 30, 0.45);
  color: var(--brand-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .18);
}
[data-theme="dark"] .hero-btn-primary,
[data-theme="dark"] .hero-btn-primary:visited { border-color: rgba(255, 106, 42, 0.32); }
[data-theme="dark"] .hero-btn-primary:hover { background: rgba(255, 106, 42, 0.2); border-color: rgba(255, 106, 42, 0.5); }
.hero-btn-primary:hover iconify-icon { transform: translateY(3px); }

.hero-btn-ghost,
.hero-btn-ghost:visited {
  background: transparent;
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-primary) 22%, transparent);
}
.hero-btn-ghost:hover {
  color: var(--text-primary);
  border-color: color-mix(in srgb, var(--text-primary) 55%, transparent);
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
  .hero-btn, .hero-btn iconify-icon { transition: none; }
  .hero-btn:hover, .hero-btn:hover iconify-icon { transform: none; }
}

/* Smooth-scroll target clears the fixed header */
#categories { scroll-margin-top: var(--header-height); }

/* ==========================================================================
   Site Search (header popover on desktop, top of mobile drawer) & Top-3 Launcher
   ========================================================================== */
.search-popover {
  /* Designed by Kapil Pidhwani: native [popover] — top layer, Esc + click-outside built in.
     pointer-events re-enabled because .site-header.scrolled passes clicks through. */
  position: fixed;
  inset: calc(var(--header-height) - 0.25rem) clamp(1rem, 2.5vw, 2.5rem) auto auto;
  margin: 0;
  width: min(420px, calc(100vw - 2rem));
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  pointer-events: auto;
}

.site-search {
  position: relative;
  text-align: left;
}

.mobile-nav-content .site-search {
  margin-bottom: 1.25rem;
}

.minimal-clear-btn[hidden],
.minimal-search-results[hidden] {
  display: none;
}

.minimal-search-bar {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  padding-bottom: 0.55rem;
  border-bottom: 1.5px solid #4A4D52;
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .minimal-search-bar {
  border-bottom-color: #6E737A;
}

.minimal-search-bar:focus-within {
  border-bottom-color: var(--brand) !important;
}

.minimal-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--text-primary);
  min-width: 0;
  padding: 0 0.5rem 0 0;
}

.minimal-search-input::placeholder {
  color: var(--text-muted);
  font-weight: 300;
  font-size: 0.95rem;
}

.minimal-search-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.minimal-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}

.minimal-clear-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
}

[data-theme="dark"] .minimal-clear-btn {
  background: rgba(255, 255, 255, 0.12);
}

.minimal-clear-btn:hover {
  background: rgba(244, 81, 30, 0.15);
  color: var(--brand);
}

.minimal-submit-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  color: var(--brand);
}

.minimal-submit-btn:hover,
.minimal-search-bar:focus-within .minimal-submit-btn {
  color: var(--brand-hover);
  transform: scale(1.1);
}

.minimal-submit-btn:active {
  transform: scale(0.95);
}

/* Background-Free Minimalist Top-3 Results (Absolutely Positioned to Prevent Hero Layout Shift) */
.minimal-search-results {
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
  z-index: 100;
  pointer-events: auto;
  animation: minimal-fade-in 0.15s ease-out;
}

@keyframes minimal-fade-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.minimal-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 500;
  background: transparent;
  transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.minimal-result-item:hover,
.minimal-result-item.selected {
  color: var(--brand);
  background: rgba(244, 81, 30, 0.06);
  transform: translateX(3px);
}

[data-theme="dark"] .minimal-result-item:hover,
[data-theme="dark"] .minimal-result-item.selected {
  color: var(--brand);
  background: rgba(255, 106, 42, 0.1);
}

.minimal-result-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.minimal-result-arrow {
  opacity: 0;
  color: var(--brand);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.minimal-result-item:hover .minimal-result-arrow,
.minimal-result-item.selected .minimal-result-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.minimal-search-empty {
  padding: 0.5rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* ==========================================================================
   Section Headers & Seamless Transitions
   ========================================================================== */
.section-wrapper {
  padding: 5.5rem 0;
  border-top: 1px solid var(--border);
}


.hero-section + .section-wrapper,
#categories,
#categories + .section-wrapper,
#features {
  border-top: none;
}

.section-wrapper-alt {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface) 65%, var(--background) 100%);
  position: relative;
}

#categories {
  padding-bottom: 5rem;
}

#categories + .section-wrapper,
#features {
  padding-top: 2.25rem;
}

.section-header {
  margin-bottom: 2.75rem;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.section-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   Category Spotlight Grid (Linear Glowing Card Effect - 4x2 Layout)
   ========================================================================== */
#category-cards {
  display: grid;
  /* Designed by Kapil Pidhwani: auto-fill with a 33% floor = 1→3 columns, so six categories sit in a neat 3×2 */
  grid-template-columns: repeat(auto-fill, minmax(max(250px, calc(33.333% - 8px)), 1fr));
  gap: 12px;
  width: 100%;
}

#category-cards:hover > .category-glow-card::after {
  opacity: 1;
}

.category-glow-card {
  background-color: var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: flex;
  height: 250px;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease;
}

[data-theme="dark"] .category-glow-card {
  background-color: rgba(255, 255, 255, 0.08);
}

.category-glow-card:hover::before {
  opacity: 1;
}

.category-glow-card::before,
.category-glow-card::after {
  border-radius: inherit;
  content: "";
  height: 100%;
  left: 0;
  opacity: 0;
  position: absolute;
  top: 0;
  transition: opacity 400ms ease;
  width: 100%;
  pointer-events: none;
}

/* Inner Surface Glow */
.category-glow-card::before {
  background: radial-gradient(
    600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(244, 81, 30, 0.06),
    transparent 40%
  );
  z-index: 3;
}

[data-theme="dark"] .category-glow-card::before {
  background: radial-gradient(
    600px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(255, 106, 42, 0.08),
    transparent 40%
  );
}

/* Border Spotlight Glow */
.category-glow-card::after {
  background: radial-gradient(
    500px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(244, 81, 30, 0.55),
    rgba(23, 25, 28, 0.15) 35%,
    transparent 65%
  );
  z-index: 1;
}

[data-theme="dark"] .category-glow-card::after {
  background: radial-gradient(
    500px circle at var(--mouse-x, -999px) var(--mouse-y, -999px),
    rgba(255, 106, 42, 0.75),
    rgba(255, 255, 255, 0.2) 35%,
    transparent 65%
  );
}

/* Inner Card Content */
.category-glow-card > .glow-card-content {
  background-color: var(--background);
  border-radius: calc(var(--radius-lg) - 1px);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  inset: 1px;
  padding: 1.25rem;
  position: absolute;
  z-index: 2;
  overflow: hidden;
  transition: background-color 0.2s ease;
}

[data-theme="dark"] .category-glow-card > .glow-card-content {
  background-color: #141414;
}

/* Big Ghost Icon in Top Half */
.glow-card-image {
  align-items: center;
  display: flex;
  height: 110px;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.glow-card-image iconify-icon {
  font-size: 5rem;
  width: 80px;
  height: 80px;
  color: var(--text-primary);
  opacity: 0.09;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, color 0.3s ease;
}

.category-glow-card:hover .glow-card-image iconify-icon {
  opacity: 0.18;
  transform: scale(1.08);
  color: var(--brand);
}

/* Bottom Information Area */
.glow-card-info-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex-grow: 1;
  z-index: 2;
}

.glow-card-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.glow-card-mini-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.category-glow-card:hover .glow-card-mini-icon {
  color: var(--brand);
  border-color: var(--brand-peach);
  background: var(--brand-soft);
}

.glow-card-title-group {
  flex: 1;
  min-width: 0;
}

.glow-card-title-group h3 {
  font-size: 1.02rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  transition: color 0.15s ease;
}

.category-glow-card:hover .glow-card-title-group h3 {
  color: var(--brand);
}

.glow-card-title-group p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Phone card sizing (columns come from auto-fill above) */
@media (max-width: 580px) {
  #category-cards .category-glow-card {
    height: 200px;
  }

  .tools-grid .category-glow-card {
    height: auto;
    min-height: 220px;
  }

  .glow-card-image {
    height: 80px;
  }

  .glow-card-image iconify-icon {
    font-size: 3.5rem;
    width: 56px;
    height: 56px;
  }
}

/* ==========================================================================
   Editorial Brand & Features Showcase (Strategic Fox Mascot)
   ========================================================================== */
.editorial-brand-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: clamp(2rem, 4vw, 3.5rem);
  margin-bottom: 3rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
}

.editorial-brand-left {
  max-width: 620px;
}

.editorial-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.editorial-brand-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

.editorial-brand-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.62;
}

.editorial-mascot-wrapper {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-xl);
  background: var(--surface-soft-orange);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  flex-shrink: 0;
}

.editorial-mascot-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.features-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}

.feature-col {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.feature-col-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--background);
  border: 1px solid var(--border);
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feature-col-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.feature-col-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ==========================================================================
   Global Editorial Multi-Column Footer
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border);
  background-color: var(--surface);
  padding: 4.5rem 0 2.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  /* Designed by Kapil Pidhwani: brand absorbs the free space (left); link columns size to content so the
     group sits flush right, on the same edge as the bottom-bar socials. ≤768px switches to 2 columns below. */
  grid-template-columns: minmax(0, 1fr) repeat(3, max-content);
  gap: 2.5rem clamp(2.5rem, 5vw, 5rem);
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}

.footer-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.footer-col-brand {
  max-width: 340px;
}

.footer-mission {
  margin-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Social links sit under the mission text in the brand column (they used to live in the bottom bar) */
.footer-col-brand .footer-social { margin-top: 1rem; }
/* FoundrList badge: right edge of the bottom bar (where the socials used to be); centred under the legal links on phones */
.footer-badge { line-height: 0; }
.footer-badge a { display: inline-block; opacity: 0.9; transition: opacity 0.15s; }
.footer-badge a:hover, .footer-badge a:focus-visible { opacity: 1; }
.footer-badge img { width: 150px; height: auto; }
@media (min-width: 769px) { .footer-bottom .footer-badge { margin-left: auto; } }

.footer-heading {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  margin-bottom: 1.1rem;
}

.footer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  padding: 0;
  margin: 0;
}

.footer-nav-list a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-block;
}

.footer-nav-list a:hover {
  color: var(--brand);
  transform: translateX(2px);
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  font-size: 0.86rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.footer-copy {
  margin: 0;
}


/* ==========================================================================
   Content & Editorial Prose Pages (About, Privacy, Terms, Credits, 404)
   ========================================================================== */
/* Designed by Kapil Pidhwani: content pages mirror .page-hero (category pages) — left-aligned on the
   container edge so breadcrumbs/title sit where users already look for them. */
.content-page-hero {
  padding: calc(var(--header-height) + 3rem) 0 3.5rem;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.content-page-title {
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
}

.content-page-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 680px;
  line-height: 1.6;
}

/* Keeps .container width/padding so the card starts on the same edge as the hero */
.prose-container {
  padding-top: 3.5rem;
  padding-bottom: 5rem;
}

.prose-card {
  max-width: calc(var(--content-max) + 5.5rem); /* 72ch measure + card padding */
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.75rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}

.prose-section {
  margin-bottom: 2.5rem;
}

.prose-section:last-child {
  margin-bottom: 0;
}

.prose-heading {
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.prose-heading iconify-icon {
  color: var(--brand);
}

.prose-subheading {
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 1.5rem 0 0.65rem;
}

.prose-text {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.prose-text strong {
  color: var(--text-primary);
  font-weight: 500;
}

.prose-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.prose-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prose-list li::before {
  content: "•";
  position: absolute;
  left: 0.4rem;
  color: var(--brand);
  font-weight: bold;
  font-size: 1.1rem;
}

.prose-callout {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  margin: 1.5rem 0;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.prose-callout iconify-icon {
  color: var(--brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.prose-callout-text {
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--text-primary);
}

.credits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.credit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.15s ease, border-color 0.15s ease;
  text-decoration: none;
  color: inherit;
}

.credit-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-peach);
}

.credit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.credit-title {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.credit-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: var(--surface-soft-orange);
  color: var(--brand);
  font-weight: 600;
}

.credit-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.credit-link {
  font-size: 0.84rem;
  color: var(--brand);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* 404 Error Page */
.error-hero {
  min-height: calc(100vh - var(--header-height) - 180px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--header-height) + 2rem) 1.5rem 3rem;
  text-align: center;
}

.error-container {
  max-width: 520px;
  margin: 0 auto;
}

.error-code-badge {
  display: inline-block;
  font-size: 4rem;
  font-weight: 300;
  letter-spacing: -0.05em;
  line-height: 1;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.error-title {
  font-size: 1.85rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.error-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.error-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Standard Unified Tool Page Layout (Toolity.in Standard)
   ========================================================================== */
.tool-hero {
  padding: calc(var(--header-height) + 1.75rem) 0 2.25rem;
  border-bottom: 1px solid var(--border);
  background-color: var(--surface);
}

.tool-hero .breadcrumbs {
  margin-bottom: 1rem;
}

.tool-hero-content {
  max-width: 760px;
}

/* Prose never runs past a comfortable line length on wide screens */
.section-subtitle,
.guide-step-card p,
.faq-item p,
.tool-hero-desc {
  max-width: var(--content-max);
}

.tool-hero-title {
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 0.45rem;
}

.tool-hero-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Tool Main Workspace Area (White Background containing Cards) */
.tool-workspace-section {
  padding: 2.25rem 0 3.5rem;
  background-color: var(--background);
}

/* Unified Main Tool Card */
.tool-workspace-card {
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 2rem;
  container-type: inline-size; /* panes/toolbar adapt to card width, see @container below */
}

/* Action Toolbar */
.tool-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  min-width: 0;    /* let it shrink so a wide .segmented-group scrolls instead of overflowing */
  max-width: 100%;
}

.btn-toolbar-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-toolbar-sm:hover {
  background: var(--surface-elevated);
  border-color: var(--text-muted);
}

.btn-toolbar-sm:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-toolbar-sm.btn-brand-sm {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

.btn-toolbar-sm.btn-brand-sm:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

/* Floating Dropdown Action Menu (Top-Right Universal Pattern) */
.dropdown-menu-wrapper {
  position: relative;
  display: inline-flex;
}

.dropdown-arrow {
  transition: transform 0.2s ease;
}

.dropdown-menu-wrapper.open .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 5px;
  z-index: 100;
  display: none;
  flex-direction: column;
  gap: 2px;
  animation: dropdown-pop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] .dropdown-popup {
  background: #1C1C1C;
  border-color: var(--border);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

@keyframes dropdown-pop {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dropdown-menu-wrapper.open .dropdown-popup {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.dropdown-item:hover {
  background: var(--surface);
  color: var(--brand);
}

[data-theme="dark"] .dropdown-item:hover {
  background: #282828;
}

.dropdown-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dropdown-item-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Settings & Options Accordion */
.tool-settings-accordion {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.tool-settings-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.15rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tool-settings-summary::-webkit-details-marker {
  display: none;
}

.tool-settings-summary-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tool-settings-chevron {
  transition: transform 0.2s ease;
  color: var(--text-muted);
}

.tool-settings-accordion[open] .tool-settings-chevron {
  transform: rotate(180deg);
}

.tool-settings-panel {
  padding: 0.85rem 1.15rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--background);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-size: 0.84rem;
}

.control-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

.control-item label {
  cursor: pointer;
}

.select-clean {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

/* 2-Column Split Pane Grid (Optimized for At-A-Glance Desktop View) */
.split-pane-grid {
  display: grid;
  grid-template-columns: 1fr; /* stacked; 2 columns from @container (min-width: 820px) */
  gap: 1rem;
  margin-bottom: 0.5rem;
}

/* Narrow card (phone, tablet portrait): toolbar stacks */
@container (max-width: 819px) {
  .tool-actions-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-group {
    justify-content: flex-start;
  }
}

@container (min-width: 820px) {
  .split-pane-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  /* Optional ratio when the preview deserves more room than the form */
  .tool-workspace-card[data-split="40/60"] .split-pane-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .tool-workspace-card[data-split="60/40"] .split-pane-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .tool-workspace-card[data-split="35/65"] .split-pane-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 13fr); }
}

.tool-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pane-badge {
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.pane-editor {
  width: 100%;
  height: clamp(240px, 36vh, 360px);
  padding: 0.85rem 1rem;
  border: none;
  background: var(--background);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.pane-editor:focus {
  background: var(--surface-elevated);
}

.pane-output-preview {
  width: 100%;
  height: clamp(240px, 36vh, 360px);
  padding: 0.85rem 1rem;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.55;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Tool Form & Pane Content Layout */
.pane-content {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
  flex: 1;
  background: var(--background);
}

/* Sleek Segmented Control System (Non-Boxy Pill Switches) */
.segmented-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 100%;
  min-width: 0;                  /* flex-item default min-width:auto would block shrinking */
  overflow-x: auto;              /* Designed by Kapil Pidhwani: native scroll, no mask/JS — */
  scroll-snap-type: x proximity; /* a half-visible last pill is the scroll affordance */
  scrollbar-width: none;
}

.segmented-group::-webkit-scrollbar {
  display: none;
}

.segmented-group .seg-pill {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.segmented-group-pill {
  border-radius: var(--radius-pill);
  padding: 3px 4px;
}

.seg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.38rem 0.75rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.segmented-group-pill .seg-pill {
  border-radius: var(--radius-pill);
}

.seg-pill:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .seg-pill:hover {
  background: rgba(255, 255, 255, 0.04);
}

.seg-pill.active {
  background: var(--background);
  color: var(--text-primary);
  font-weight: 600;
  border-color: var(--border-subtle);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .seg-pill.active {
  background: var(--surface-elevated);
  color: var(--text-primary);
  border-color: var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.type-tabs-scrollable {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  margin-bottom: 0.25rem;
  scrollbar-width: none;
}

.type-tabs-scrollable::-webkit-scrollbar {
  display: none;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-desc {
  font-size: 0.74rem;
  font-weight: 400;
  color: var(--text-muted);
}

.input-clean,
.textarea-clean {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 0.86rem;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea-clean {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.input-clean:focus,
.textarea-clean:focus,
.select-clean:focus {
  border-color: var(--brand);
  background: var(--surface-elevated);
  box-shadow: 0 0 0 3px rgba(244, 81, 30, 0.12);
}

.form-row-2col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); /* minmax(0) lets a long <select> label shrink instead of overflowing the pane */
  gap: 0.85rem;
}
.form-row-2col .select-clean, .form-row-2col .input-clean { max-width: 100%; min-width: 0; }

@media (max-width: 600px) {
  .form-row-2col {
    grid-template-columns: 1fr;
  }
}

/* Sleek Settings Sections in Accordion */
.settings-sections-wrapper {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.settings-section-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.settings-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.settings-row-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Row items never exceed the row: a wide .segmented-group inside scrolls instead of pushing out */
.settings-row-wrap > * {
  min-width: 0;
  max-width: 100%;
}

/* Modern Color Swatch Pill & Palette */
.color-picker-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-picker-pill:hover {
  border-color: var(--text-muted);
}

.color-preview-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  display: inline-block;
  flex-shrink: 0;
}

.color-hex-text {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-primary);
}

.color-input-hidden {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.color-quick-palette {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.quick-palette-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.quick-palette-dot:hover {
  transform: scale(1.15);
}

.quick-palette-dot.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-peach);
}

/* Range Slider */
.range-slider-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-slider-clean {
  flex: 1;
  accent-color: var(--brand);
  cursor: pointer;
  height: 6px;
  border-radius: 3px;
}

.range-val-badge {
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--brand);
  min-width: 34px;
  text-align: right;
}

/* QR Live Preview Container */
.qr-preview-pane-content {
  padding: 1.25rem;
  background: var(--background);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  min-height: clamp(280px, 40vh, 400px);
}

.qr-canvas-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 250px;
  max-height: 250px;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.qr-canvas-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.qr-canvas-wrapper.transparent-bg {
  background-image: linear-gradient(45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(-45deg, #e5e5e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e5e5e5 75%),
    linear-gradient(-45deg, transparent 75%, #e5e5e5 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.qr-canvas-wrapper svg,
.qr-canvas-wrapper canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-preview-actions-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

/* Instruction Guide Cards (1-2-3 Visual Step Grid) */
.guide-section {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
}

.guide-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.guide-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.step-num-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}

.step-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.step-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Keyboard Shortcuts */
.shortcuts-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.85rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 2.5rem;
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.shortcut-pill kbd {
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--background);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-primary);
  box-shadow: 0 1px 0 var(--border);
}

/* Maintenance-Free Category Cross-Promotion CTA Card */
.category-workspace-cta {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.category-workspace-cta-left {
  max-width: 600px;
}

.category-workspace-cta-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  letter-spacing: -0.015em;
}

.category-workspace-cta-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Toast Notification */
.tool-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--text-primary);
  color: var(--text-inverse);
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tool-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Responsive Adaptations
   Breakpoints (suggestions.txt §7.2): phone ≤639 · tablet 640–1023 ·
   laptop 1024–1439 · wide ≥1440 · ultrawide ≥1920. Tool panes adapt with
   @container, so new tools never need a media query.
   ========================================================================== */

/* Tablet & below: 9 nav links need ~1100px, so the top capsule goes away
   at 1023 and the hamburger + bottom pill nav take over. */
@media (max-width: 1023px) {
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-center,
  #search-toggle {
    display: none;
  }

  .nav-right {
    gap: 0.4rem;
  }

  #mobile-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Reserve room for the fixed bottom pill nav so footer/CTA stay reachable */
  body {
    padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
  }

  .tool-toast {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem);
    right: 1rem;
    left: 1rem;
    text-align: center;
  }
}

/* Touch devices: 44px hit areas and 16px inputs (prevents iOS focus-zoom).
   Scoped to (pointer: coarse) so the compact desktop look is untouched. */
@media (pointer: coarse) {
  .btn,
  .btn-icon-pill,
  .btn-toolbar-sm,
  .seg-pill,
  .nav-link,
  .pill-nav-item,
  .mobile-nav-link,
  .mobile-nav-sublink,
  .minimal-action-btn,
  .quality-card-btn,
  summary,
  select,
  button:not(.faq-item summary) {
    min-height: var(--touch);
  }

  .breadcrumbs {
    gap: 0.35rem;
  }

  .breadcrumb-link,
  .mobile-nav-sublink {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding-inline: 0.25rem;
  }

  .input-clean,
  .select-clean,
  .textarea-clean,
  .minimal-search-input,
  input:not([type="range"]):not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: 16px !important; /* must beat per-tool class sizes: <16px = iOS focus-zoom */
    min-height: var(--touch);
  }
}

/* Small laptop / tablet landscape: tighten the 9-link capsule so it clears the brand */
@media (min-width: 1024px) and (max-width: 1180px) {
  .nav-link,
  .nav-link:visited {
    font-size: 0.8rem;
    padding: 0.38rem 0.55rem;
  }
}

/* No stuck hover states on touch: hover transforms only where hover exists */
@media (hover: none) {
  *:hover {
    transform: none;
  }
}

/* Phone: compact tool/category hero so the tool is above the fold */
@media (max-width: 639px) {
  .page-hero {
    padding: calc(var(--header-height) + 1.25rem) 0 1.75rem;
  }

  .page-hero .breadcrumbs {
    margin-bottom: 0.9rem;
  }
}

@media (min-width: 1920px) {
  .hero-section {
    min-height: min(100dvh, 820px);
    height: auto;
  }
}

@media (max-width: 768px) {
  .hero-section {
    min-height: 100dvh;
    height: 100dvh;
    padding: calc(var(--header-height) + 1rem) 0 3.5rem;
  }

  .editorial-brand-card {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 1.75rem;
  }

  .editorial-mascot-wrapper {
    width: 80px;
    height: 80px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem 1.5rem;
    padding-bottom: 2.5rem;
  }

  .footer-col-brand {
    grid-column: 1 / -1;
    max-width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .prose-container {
    padding-top: 2.5rem;
    padding-bottom: 4rem;
  }

  .prose-card {
    padding: 1.75rem 1.25rem;
  }

  .credits-grid {
    grid-template-columns: 1fr;
  }

  .search-shortcut-badge {
    display: none;
  }

  .search-result-desc {
    max-width: 220px;
  }
}

/* ==========================================================================
   SHARED TOOL WORKSPACE COMPONENTS
   Extracted from per-tool inline <style> blocks — common across all tools.
   Designed by Kapil Pidhwani: Update here once; applies everywhere.
   ========================================================================== */

/* URL / Text Input with inline clear button */
.url-input-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  margin-bottom: 0.65rem;
}

.url-input-container .input-clean {
  padding-right: 2.5rem;
}

.btn-input-clear {
  position: absolute;
  right: 0.65rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: color 0.15s ease;
}

.btn-input-clear:hover {
  color: var(--text-primary);
}

/* Sample / Quick-fill chips row */
.sample-chips-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sample-label {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sample-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

/* Quality / Option selector card grid */
.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 540px) {
  .quality-grid {
    grid-template-columns: 1fr;
  }
}

.quality-card-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
}

.quality-card-btn:hover {
  border-color: var(--brand);
  background: var(--surface-elevated);
}

.quality-card-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand);
}

.quality-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quality-title {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.quality-tag-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: var(--brand);
  color: #ffffff;
  font-family: var(--font-mono);
}

.quality-tag-badge.subtle {
  background: var(--border);
  color: var(--text-secondary);
}

.quality-dimensions {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Tool output preview viewport */
.preview-viewport-box {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.preview-viewport-box.empty {
  background: var(--surface);
  box-shadow: none;
}

.empty-preview-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem;
}

.empty-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.preview-floating-pill {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  background: rgba(13, 13, 13, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: none;
  align-items: center;
  gap: 0.35rem;
  z-index: 5;
}

/* Formats / info reference table card */
.formats-table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  overflow-x: auto;
}

.formats-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.84rem;
}

.formats-table th {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.formats-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.formats-table tr:last-child td {
  border-bottom: none;
}

.formats-table code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
}

/* ==========================================================================
   EMPTY STATE MICRO-ANIMATION
   Designed by Kapil Pidhwani: Subtle breathing pulse for idle tool states
   ========================================================================== */
@keyframes breatheState {
  0%, 100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 0.95;
    transform: scale(1.04);
  }
}

.empty-preview-icon,
.workspace-empty-icon,
.media-empty-placeholder iconify-icon {
  animation: breatheState 3.5s ease-in-out infinite;
  will-change: transform, opacity;
}

@media (prefers-reduced-motion: reduce) {
  .empty-preview-icon,
  .workspace-empty-icon,
  .media-empty-placeholder iconify-icon {
    animation: none !important;
  }
}

/* ==========================================================================
   MOBILE FLOATING BOTTOM PILL NAV (Non-Home Pages)
   Designed by Kapil Pidhwani: Thumb-friendly 4-action bottom pill bar for mobile
   ========================================================================== */
.mobile-bottom-pill-nav {
  display: none;
}

@media (max-width: 1023px) {
  .mobile-bottom-pill-nav {
    display: flex;
    position: fixed;
    bottom: max(0.85rem, env(safe-area-inset-bottom, 0.85rem));
    left: 50%;
    transform: translateX(-50%);
    z-index: 990;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
    background: var(--surface-elevated);
    background: color-mix(in srgb, var(--surface-elevated) 88%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.15);
  }

  .mobile-bottom-pill-nav .pill-nav-item,
  .mobile-bottom-pill-nav .pill-nav-item:visited {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.4rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 500;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    line-height: 1;
    min-width: 52px;
  }

  .mobile-bottom-pill-nav .pill-nav-item iconify-icon {
    font-size: 1.15rem;
    width: 1.15rem;
    height: 1.15rem;
  }

  .mobile-bottom-pill-nav .pill-nav-item:hover,
  .mobile-bottom-pill-nav .pill-nav-item:active,
  .mobile-bottom-pill-nav .pill-nav-item:visited:hover,
  .mobile-bottom-pill-nav .pill-nav-item:visited:active {
    color: var(--brand);
    background: var(--brand-soft);
    transform: translateY(-1px);
  }
}

/* ==========================================================================
   TOOL PAGE STANDARD v2 — Layout variants, states, FAQ
   Designed by Kapil Pidhwani: see /templates/tool-page.html for the contract.
   ========================================================================== */

/* Layout variants on the unified card. Toolbar + settings stay identical.
   split   : input | output (default)
   stacked : input above output, both full width (wide editors / tables)
   single  : one full-width pane (notepad-style editors) */
.tool-workspace-card[data-layout="stacked"] .split-pane-grid,
.tool-workspace-card[data-layout="single"] .split-pane-grid {
  grid-template-columns: 1fr;
}

/* Busy state (set by Toolity.setBusy) */
.tool-workspace-card.is-busy .split-pane-grid {
  opacity: 0.7;
  pointer-events: none;
}

/* Pane idle / empty state — same look on every tool */
.pane-empty {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.pane-empty iconify-icon {
  font-size: 2.25rem;
  color: var(--text-muted);
  animation: breatheState 3.5s ease-in-out infinite;
}

.pane-empty[hidden] { display: none; }

/* Inline error strip under a pane header */
.pane-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  color: #B42318;
  background: rgba(240, 68, 56, 0.08);
  border-bottom: 1px solid rgba(240, 68, 56, 0.25);
}

[data-theme="dark"] .pane-error { color: #FDA29B; }

.pane-error[hidden] { display: none; }

/* Determinate progress bar for media processing */
.pane-progress {
  height: 4px;
  width: 100%;
  background: var(--border);
  overflow: hidden;
}

.pane-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  transition: width 0.15s linear;
}

.pane-progress[hidden] { display: none; }

/* Dropzone — one look for every file tool */
.tool-dropzone {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.86rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tool-dropzone:hover,
.tool-dropzone:focus-visible,
.tool-dropzone.dragover {
  border-color: var(--brand);
  background: var(--surface-elevated);
  outline: none;
}

.tool-dropzone iconify-icon {
  font-size: 2rem;
  color: var(--brand);
}

.tool-dropzone strong { color: var(--text-primary); font-weight: 600; }

.tool-dropzone small { font-size: 0.74rem; color: var(--text-muted); }

.tool-dropzone input[type="file"] { display: none; }

/* Reference / specs section (optional block 5) */
.reference-section {
  padding: 0 0 2rem;
}

/* FAQ section (block 6) — native <details>, no JS */
.faq-section {
  padding: 2.5rem 0 2rem;
  border-top: 1px solid var(--border);
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 820px;
  margin: 0 auto;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.faq-item[open] { border-color: var(--text-muted); }

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  flex-shrink: 0;
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p {
  padding: 0 1.15rem 1rem;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

.faq-item p + p { margin-top: -0.4rem; }

.faq-item code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
}


/* Tool page section wrapper (replaces the inline style every page carried) */
.section-wrapper.tool-section {
  border-top: none;
  padding-top: 3.5rem;
}

/* Compact section header used below the workspace (guide / reference / FAQ) */
.section-header-compact {
  margin-bottom: 1.5rem;
}

.section-heading-sm {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-top: 0.25rem;
}

.section-header-compact .section-desc {
  font-size: 0.92rem;
  margin-top: 0.35rem;
  max-width: 640px;
}

/* Helper text under a form field */
.form-helper {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-required { color: var(--brand); }

/* Shared utility classes that replaced repeated inline style="" attributes */
.form-group-grow { flex: 1; }
.form-group-grow .textarea-clean { flex: 1; min-height: 120px; }
.pane-content-tall { min-height: 380px; }

/* Full-height code/text output filling the right pane */
.pane-output-fill {
  flex: 1;
  height: 100%;
  min-height: 380px;
  margin: 0;
  padding: 1.15rem 1.25rem;
  border: none;
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
  user-select: text;
}

.step-desc code,
.pane-badge code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

/* Filter / quick-action chip row (used under inputs) */
.filter-chips-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.btn-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  font-weight: 500;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-filter-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.btn-filter-chip.chip-signal {
  color: var(--brand);
  border-color: rgba(244, 81, 30, 0.3);
  background: rgba(244, 81, 30, 0.06);
}

/* ==========================================================================
   MEDIA TOOL COMPONENTS (shared by image/video/GIF converters)
   Promoted from six identical per-page <style> blocks.
   ========================================================================== */
.media-canvas-viewport {
  width: 100%;
  height: 280px;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-dropzone {
  width: 100%;
  height: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px dashed var(--border);
  border-radius: calc(var(--radius-md) - 2px);
  margin: 4px;
  box-sizing: border-box;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.video-dropzone:hover,
.video-dropzone:focus-visible,
.video-dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
  outline: none;
}

.video-dropzone[hidden] { display: none; }

.video-drop-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.video-drop-title { font-size: 0.95rem; font-weight: 500; color: var(--text-primary); margin-bottom: 0.25rem; }
.video-drop-subtitle { font-size: 0.78rem; color: var(--text-muted); }

.source-video-player,
.video-converted-preview,
.media-preview-img {
  width: 100%;
  height: 100%;
  max-height: 280px;
  object-fit: contain;
  display: none;
}

.source-video-player,
.video-converted-preview { background: #000; }

.media-empty-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.media-empty-placeholder iconify-icon { margin-bottom: 0.6rem; opacity: 0.4; }
.media-empty-placeholder p { font-size: 0.86rem; }

/* Full-width primary action under the output viewport */
.btn-primary-action {
  width: 100%;
  justify-content: center;
  height: 42px;
  font-size: 0.9rem;
  border-radius: var(--radius-sm);
  margin-top: 0.85rem;
}

.btn-primary-action:disabled { opacity: 0.5; cursor: not-allowed; }

.slim-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.slim-progress-bar.active { opacity: 1; }

.slim-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-gold));
  transition: width 0.15s ease;
}

/* Trim range (video tools) */
.minimal-trimmer-wrap { margin-top: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; padding: 0 0.15rem; }
.minimal-trimmer-header { display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; font-weight: 500; color: var(--text-secondary); }
.trimmer-timestamps { display: flex; align-items: center; gap: 0.35rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--brand); font-weight: 600; }
.trim-sliders-row { display: flex; flex-direction: column; gap: 0.35rem; }
.trim-slider-line { display: flex; align-items: center; gap: 0.5rem; }
.trim-slider-tag { font-size: 0.7rem; color: var(--text-muted); width: 32px; text-transform: uppercase; font-weight: 600; }
.trim-range-slider { flex: 1; accent-color: var(--brand); cursor: pointer; height: 4px; }
.trim-range-slider:disabled { cursor: not-allowed; opacity: 0.45; }

/* Settings panel labels & sliders */
.settings-label { font-size: 0.75rem; }
.settings-label-row { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.settings-range { width: 100%; accent-color: var(--brand); }
.pane-content-between { justify-content: space-between; }
.media-canvas-viewport input[type="file"] { display: none; }
.pane-footnote { margin-top: 0.85rem; display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: var(--text-muted); padding: 0 0.25rem; }
.pane-footnote .btn-toolbar-sm { padding: 0.25rem 0.6rem; font-size: 0.75rem; }
.pane-footnote .btn-toolbar-sm[hidden],
.btn-toolbar-sm[hidden] { display: none; }
.trim-duration-badge { color: var(--text-muted); font-size: 0.72rem; }
.stat-accent { color: var(--brand); font-weight: 600; }
.flex-wrap { flex-wrap: wrap; }
.mt-sm { margin-top: 0.5rem; }

/* ---- Reference: shortcuts table + keyboard chips (notepad, json-visualizer) ---- */
.shortcuts-table-wrapper { width: 100%; overflow-x: auto; margin-top: 1.25rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
.shortcuts-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 0.86rem; }
.shortcuts-table th, .shortcuts-table td { padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--border); }
.shortcuts-table th { background: var(--surface-elevated); font-weight: 600; color: var(--text-secondary); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.shortcuts-table tr:last-child td { border-bottom: none; }
.kbd-chip { display: inline-block; padding: 0.15rem 0.45rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.75rem; font-weight: 600; color: var(--text-primary); background: var(--surface-elevated); border: 1px solid var(--border); border-radius: 4px; box-shadow: 0 1px 0 var(--border); }
.icon-success { color: #10B981; }
.icon-brand { color: var(--brand); }

/* ==========================================================================
   Shared wizard / picker components (first used by Photo Booth)
   ========================================================================== */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.step-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.step-item + .step-item::before {
  content: "";
  width: 14px;
  height: 1px;
  margin-right: 0.35rem;
  background: var(--border);
}

.step-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface);
}

.step-item.is-current { color: var(--text-primary); font-weight: 600; }
.step-item.is-current .step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.step-item.is-done .step-dot { background: var(--text-primary); border-color: var(--text-primary); color: var(--background); }

/* Colour swatch radio grid */
.swatch-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px var(--background);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.swatch:hover { transform: scale(1.08); }
.swatch[aria-checked="true"] { box-shadow: inset 0 0 0 2px var(--background), 0 0 0 2px var(--brand); }

.color-input-clean {
  width: 34px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
}

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

/* Thumbnail rail (captured shots / multi-file previews) */
.thumb-rail {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.thumb-slot {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--border);
  background: var(--surface);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: default;
  padding: 0;
}

.thumb-slot.is-filled { border-style: solid; cursor: pointer; }
.thumb-slot.is-next { border-color: var(--brand); color: var(--brand); }
.thumb-slot.is-dragging { opacity: 0.5; }
.thumb-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-slot .thumb-num {
  position: absolute;
  top: 4px;
  left: 4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb-slot .thumb-retake {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.74rem;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.thumb-slot.is-filled:hover .thumb-retake,
.thumb-slot.is-filled:focus-visible .thumb-retake { opacity: 1; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #10B981; display: inline-block; }

/* ─── PDF tool shared pieces (page grid, viewer, file list) — used by /utilities/*pdf* via scripts/pdf-common.js ─── */
.media-canvas-viewport.pdf-tall { height: auto; min-height: 280px; max-height: 520px; align-items: stretch; justify-content: flex-start; }
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 0.75rem; width: 100%; overflow: auto; padding: 0.6rem; }
.pdf-grid[hidden] { display: none; }
.pdf-thumb { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.4rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pdf-thumb canvas { max-width: 100%; height: auto; background: #fff; box-shadow: var(--shadow-sm); transition: transform 0.2s ease; }
.pdf-thumb-num { font-size: 0.72rem; color: var(--text-muted); font-family: var(--font-mono); }
.pdf-thumb-actions { display: flex; gap: 0.25rem; }
.pdf-thumb-btn { width: 26px; height: 26px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-elevated); color: var(--text-secondary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.pdf-thumb-btn:hover, .pdf-thumb-btn:focus-visible { color: var(--brand); border-color: var(--brand); outline: none; }
.pdf-thumb.is-selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.pdf-thumb.is-dragging { opacity: 0.4; }
.pdf-thumb.is-removed { display: none; }
.pdf-viewer { position: relative; width: 100%; overflow: auto; padding: 0.6rem; display: flex; justify-content: center; }
.pdf-viewer[hidden] { display: none; }
.pdf-viewer-stage { position: relative; display: inline-block; line-height: 0; }
.pdf-viewer-stage canvas { display: block; max-width: 100%; height: auto; background: #fff; box-shadow: var(--shadow-sm); }
.pdf-pager { display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-secondary); font-family: var(--font-mono); padding: 0.4rem 0 0; }
.pdf-pager[hidden] { display: none; }
.pdf-files { list-style: none; margin: 0; padding: 0.6rem; width: 100%; display: flex; flex-direction: column; gap: 0.4rem; overflow: auto; }
.pdf-files[hidden] { display: none; }
.pdf-file { display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.82rem; }
.pdf-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-file-meta { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.72rem; white-space: nowrap; }
.pdf-page-canvas { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; background: #fff; box-shadow: var(--shadow-sm); }
.pdf-page-canvas[hidden], .media-empty-placeholder[hidden] { display: none; }
.pdf-result-badge { font-weight: 600; }
.pdf-result-badge.is-win { color: #15803d; background: rgba(22, 163, 74, 0.1); }
[data-theme="dark"] .pdf-result-badge.is-win { color: #4ade80; }
/* PDF batch 2: Images to PDF list thumbs · PDF to Text output · Metadata / Form Filler inline forms · custom size row */
.pdf-file-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: var(--radius-xs); background: var(--surface-elevated); flex: none; }
.pdf-text-out { width: 100%; flex: 1 1 auto; min-height: 280px; max-height: 520px; padding: 0.85rem 1rem; border: none; resize: vertical; background: var(--background); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.55; outline: none; white-space: pre-wrap; }
.pdf-text-out[hidden], .pdf-meta-form[hidden], #output-img[hidden] { display: none; }
.pdf-meta-form { width: 100%; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.85rem; overflow: auto; align-self: stretch; text-align: left; }
.pdf-two-inputs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.5rem; }
#output-img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; background: #fff; box-shadow: var(--shadow-sm); }
.pdf-files + #output-img, #output-img + .pdf-files { margin-top: 0.5rem; }

/* ─── Category pages: section headings between tool grids ─── */
.tools-section-title { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); margin: 0 0 1.25rem; }
.tools-grid + .tools-section-title { margin-top: 3rem; }
.section-wrapper.category-tools { border-top: none; padding-top: 3.5rem; }

/* ─── Metadata tools (viewer + remover × image/audio/video/PDF) — shared by 8 pages ─── */
.meta-out { width: 100%; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0.85rem; display: flex; flex-direction: column; gap: 0.75rem; align-self: stretch; text-align: left; } /* min-height:0 lets the flex child scroll inside the capped viewport instead of being clipped */
.meta-out[hidden] { display: none; }
.meta-flags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.meta-flag { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.55rem; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); background: var(--surface); }
.meta-flag.is-hot { color: #b45309; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.meta-flag.is-clear { color: #15803d; background: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.3); text-decoration: line-through; }
[data-theme="dark"] .meta-flag.is-hot { color: #fbbf24; }
[data-theme="dark"] .meta-flag.is-clear { color: #4ade80; }
.meta-section { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-elevated); overflow: hidden; }
.meta-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.75rem; font-size: 0.82rem; font-weight: 600; cursor: pointer; list-style: none; }
.meta-section > summary::-webkit-details-marker { display: none; }
.meta-section > summary::before { content: ''; width: 0.4rem; height: 0.4rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); margin-right: 0.4rem; transition: transform 0.15s; flex: none; }
.meta-section[open] > summary::before { transform: rotate(45deg); }
.meta-section > summary > span:first-child { flex: 1; }
.meta-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; table-layout: fixed; }
.meta-table th, .meta-table td { padding: 0.4rem 0.75rem; border-top: 1px solid var(--border-subtle); vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.meta-table th { width: 38%; font-weight: 500; color: var(--text-secondary); }
.meta-table td { font-family: var(--font-mono); color: var(--text-primary); }
.meta-table a { color: var(--brand); text-decoration: none; }
.meta-table a:hover { text-decoration: underline; }
.meta-summary { display: flex; gap: 0.7rem; align-items: flex-start; padding: 0.8rem 0.9rem; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-elevated); font-size: 0.82rem; }
.meta-summary p { margin: 0.15rem 0 0; color: var(--text-secondary); font-size: 0.76rem; }
.meta-summary iconify-icon { flex: none; margin-top: 0.1rem; color: var(--brand); }
.meta-summary.is-ok iconify-icon { color: #15803d; }
.meta-summary.is-warn iconify-icon { color: #b45309; }
.meta-note, .meta-empty { margin: 0; font-size: 0.76rem; color: var(--text-muted); }
.media-canvas-viewport.meta-tall { height: auto; min-height: 280px; max-height: 560px; align-items: stretch; justify-content: flex-start; }
.meta-out > * { flex: none; } /* sections must not shrink inside the column flex — they'd clip rows (bug seen with 20+ fields) */
#result-badge.meta-hot { color: #b45309; background: rgba(245, 158, 11, 0.12); font-weight: 600; }
[data-theme="dark"] #result-badge.meta-hot { color: #fbbf24; }

/* ==========================================================================
   VIDEO TOOLS (shared by scripts/video-common.js pages)
   ========================================================================== */
.source-video-player.is-shown, .video-converted-preview.is-shown, .media-preview-canvas.is-shown, .media-preview-img.is-shown { display: block; }
.media-preview-canvas.gif-stage { background: var(--surface-elevated); }
.control-item[hidden] { display: none; }
.gft-num { width: 110px; font-family: var(--font-mono); }
.media-preview-canvas { width: 100%; height: 100%; max-height: 280px; object-fit: contain; display: none; background: #000; }
.vdt-range { display: grid; gap: 0.45rem; margin-top: 0.7rem; min-width: 0; }
.vdt-range[hidden] { display: none; }
.vdt-range-row { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.5rem; font-size: 0.8rem; min-width: 0; }
.vdt-range-row label { color: var(--text-muted); }
.vdt-range-row .range-val-badge { font-family: var(--font-mono); min-width: 4.4rem; text-align: center; }
.vdt-range-len { font-size: 0.76rem; color: var(--text-muted); text-align: right; font-family: var(--font-mono); }
.vdt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0.5rem; padding: 0.6rem; width: 100%; overflow: auto; }
.vdt-grid[hidden] { display: none; }
.vdt-thumb { position: relative; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: #000; cursor: pointer; aspect-ratio: 16 / 9; }
.vdt-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vdt-thumb figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 0.1rem 0.3rem; font-size: 0.66rem; font-family: var(--font-mono); color: #fff; background: rgba(0, 0, 0, 0.55); }

/* ==========================================================================
   CROP OVERLAY (shared by GIF, Video and Image Cropper) — viewport px projected from source px by JS
   ========================================================================== */
.vcr-box { position: absolute; box-sizing: border-box; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45); cursor: move; touch-action: none; z-index: 2; }
.vcr-box[hidden] { display: none; }
.vcr-box::before, .vcr-box::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.vcr-box::before { border-left: 1px solid rgba(255, 255, 255, 0.35); border-right: 1px solid rgba(255, 255, 255, 0.35); left: 33.33%; right: 33.33%; }
.vcr-box::after { border-top: 1px solid rgba(255, 255, 255, 0.35); border-bottom: 1px solid rgba(255, 255, 255, 0.35); top: 33.33%; bottom: 33.33%; }
.vcr-handle { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--brand); border: 2px solid #fff; cursor: nwse-resize; touch-action: none; }
.vcr-handle::after { content: ""; position: absolute; inset: -13px; } /* 44px touch target without enlarging the visible dot */
.vcr-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.vcr-nums .input-clean { min-width: 0; font-family: var(--font-mono); padding-inline: 0.4rem; }

/* ==========================================================================
   AUDIO TOOLS (shared by scripts/audio-common.js pages)
   ========================================================================== */
.aud-player { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; height: 100%; padding: 0.8rem; min-width: 0; }
.aud-player[hidden] { display: none; }
.aud-player audio { width: 100%; max-width: 420px; }
.aud-wave { display: none; width: 100%; height: 72px; border-radius: var(--radius-sm); background: var(--surface-elevated); }
.aud-wave.is-shown { display: block; }
.aud-name { font-size: 0.78rem; color: var(--text-muted); font-family: var(--font-mono); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aud-meter { width: 100%; max-width: 420px; height: 6px; border-radius: 3px; background: var(--surface-elevated); overflow: hidden; }
.aud-meter-fill { height: 100%; width: 0; background: var(--brand); transition: width 80ms linear; }
.aud-clock { font-family: var(--font-mono); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.aud-rec-row { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }

/* ==========================================================================
   WIDGET BUILDERS & LIVE PREVIEWS (shared by /widgets/* via scripts/widget-common.js)
   ========================================================================== */
.widget-preview-out {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  height: 100%;
  min-width: 0;
}

/* Preview-width pills live in the pane header; compact on wide cards, wrapped below the label on narrow ones */
.pane-header > .segmented-group { min-width: 0; max-width: 60%; overflow-x: auto; }
.pane-header > .segmented-group .seg-pill { padding-block: 0.2rem; }
@container (max-width: 560px) {
  .pane-header:has(> .segmented-group) { flex-wrap: wrap; gap: 0.45rem; }
  .pane-header > .segmented-group { max-width: 100%; }
}

.widget-preview-stage {
  width: 100%;
  min-height: 230px;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0) 0 0 / 16px 16px,
    var(--surface);
  overflow: hidden;
}

.widget-preview-frame {
  width: 100%;
  height: 200px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  transition: width 0.2s ease, height 0.2s ease;
}

.widget-preview-stage[data-canvas-size="half"] .widget-preview-frame { width: min(100%, 380px); height: 180px; }
.widget-preview-stage[data-canvas-size="compact"] .widget-preview-frame { width: min(100%, 300px); height: 130px; }

.widget-url-input { font-family: var(--font-mono); font-size: 0.82rem; }

.widget-color-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.widget-color-picker {
  width: 36px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface-elevated);
  cursor: pointer;
  flex: none;
}

.widget-checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.45rem 0.75rem;
}

.widget-how-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 2.25rem;
  padding: 1rem 1.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.widget-how-step {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.widget-how-step strong {
  color: var(--text-primary);
  font-weight: 600;
}


/* ═══════════ Web utilities family (Labs) — shared by gen_web_pages.js pages ═══════════ */
.web-form .form-label { gap: 0.5rem; }
.web-form .input-clean, .web-form .textarea-clean { font-size: 16px; }
.web-form .textarea-clean { font-family: var(--font-mono); font-size: 0.86rem; }
.web-form .btn-primary-action { align-self: flex-start; }
.web-inline { display: flex; align-items: center; gap: 0.5rem; min-width: 0; max-width: 100%; }
.web-inline > .input-clean { flex: 1; min-width: 0; }
.web-color-input { width: 44px; height: 44px; flex-shrink: 0; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.web-output-pane { min-width: 0; }
.web-output { display: flex; flex-direction: column; gap: 1rem; min-width: 0; flex: 1; }
.web-output[hidden] { display: none; }
.web-status-badge.is-win { color: #15803d; background: rgba(22, 163, 74, 0.1); }
[data-theme="dark"] .web-status-badge.is-win { color: #4ade80; }
.web-code { margin: 0; padding: 0.85rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-primary); max-height: 520px; overflow: auto; }
.web-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; table-layout: fixed; }
.web-table th, .web-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.web-table th { width: 34%; font-weight: 600; color: var(--text-secondary); }
.web-table td { font-family: var(--font-mono); color: var(--text-primary); }
.web-table td.is-empty { color: var(--text-muted); font-style: italic; font-family: var(--font-family); }
.web-table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.web-tag { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.55rem; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--text-secondary); }
.web-tag.pass { color: #15803d; background: rgba(22, 163, 74, 0.1); border-color: transparent; }
.web-tag.fail { color: #b91c1c; background: rgba(220, 38, 38, 0.1); border-color: transparent; }
.web-tag.warn { color: #a16207; background: rgba(202, 138, 4, 0.12); border-color: transparent; }
[data-theme="dark"] .web-tag.pass { color: #4ade80; }
[data-theme="dark"] .web-tag.fail { color: #f87171; }
[data-theme="dark"] .web-tag.warn { color: #facc15; }
.web-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.web-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.6rem; }
.web-swatch { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); padding: 0; cursor: pointer; text-align: left; font: inherit; color: inherit; min-height: 44px; }
.web-swatch:hover { border-color: var(--text-muted); }
.web-swatch-chip { height: 64px; }
.web-swatch-label { padding: 0.4rem 0.55rem; font-family: var(--font-mono); font-size: 0.74rem; color: var(--text-primary); overflow-wrap: anywhere; }
.web-preview { min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.web-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.web-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.5rem; min-width: 0; }
.web-row .input-clean { min-width: 0; }
.web-row-btn { width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-secondary); cursor: pointer; }
.web-row-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.web-list { display: flex; flex-direction: column; gap: 0.5rem; }
.web-list-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.6rem; align-items: start; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 0.82rem; overflow-wrap: anywhere; }
.web-list-item .web-list-url { font-family: var(--font-mono); color: var(--text-primary); }
.web-list-item .web-list-sub { color: var(--text-muted); font-size: 0.76rem; margin-top: 0.15rem; }
.web-big { font-size: 2.6rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text-primary); line-height: 1; font-family: var(--font-mono); }
.web-muted { color: var(--text-muted); font-size: 0.8rem; }
.web-grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem; }
.web-stat { padding: 0.65rem 0.75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; color: var(--text-secondary); }
.web-stat strong { color: var(--text-primary); font-size: 0.86rem; }
.web-file-row { display: flex; align-items: center; flex-wrap: wrap; gap: 0.6rem; min-width: 0; }
.tool-pane.dragover { outline: 2px dashed var(--brand); outline-offset: -4px; }
.web-group { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.web-convert-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 0.5rem; min-width: 0; }
.web-convert-row-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.web-checks { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; min-width: 0; }
.web-checks .control-item { margin: 0; }
.web-group-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
/* Pixel-width meters shared by SERP Snippet Preview and Meta Tag Generator (JS sets width + is-near / is-over) */
.serp-meters { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.serp-meter { display: grid; grid-template-columns: 88px minmax(0, 1fr) auto; align-items: center; gap: 0.6rem; font-size: 0.78rem; color: var(--text-secondary); }
.serp-meter b { font-family: var(--font-mono); font-weight: 500; color: var(--text-primary); white-space: nowrap; font-variant-numeric: tabular-nums; }
.serp-bar { height: 6px; border-radius: var(--radius-pill); background: var(--surface-elevated); border: 1px solid var(--border); overflow: hidden; }
.serp-bar i { display: block; height: 100%; width: 0; background: #16a34a; transition: width 0.15s ease, background 0.15s ease; }
.serp-bar i.is-near { background: #ca8a04; }
.serp-bar i.is-over { background: #dc2626; }

/* ═══════════ Games family — shared stage, score bar, overlay & board primitives ═══════════ */
.game-pane-wrap { gap: 0.75rem; align-items: center; }
.game-stage { position: relative; width: min(100%, 480px); display: flex; flex-direction: column; align-items: center; gap: 0.65rem; min-width: 0; }
.game-stage-wide { width: min(100%, 720px); }
.game-score { display: inline-flex; align-items: baseline; gap: 0.45rem; font-family: var(--font-mono); font-size: 0.92rem; font-weight: 600; color: var(--text-primary); flex-wrap: wrap; }
.game-score i { font-style: normal; color: var(--text-muted); font-weight: 400; }
.game-score span { color: var(--text-secondary); font-weight: 500; font-size: 0.82rem; }
.game-score b { color: var(--text-primary); font-weight: 600; }
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; text-align: center; padding: 1.25rem; border-radius: var(--radius-md); background: color-mix(in srgb, var(--surface) 84%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); z-index: 5; }
.game-overlay[hidden] { display: none; }
.game-overlay strong { font-size: clamp(1.35rem, 5cqw, 2.2rem); font-weight: 500; letter-spacing: -0.02em; color: var(--text-primary); }
.game-overlay span { font-size: 0.86rem; color: var(--text-secondary); max-width: 38ch; }
.game-hint { text-align: center; margin: 0; }
.game-bar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0.4rem; width: 100%; min-width: 0; }
.game-key { min-width: 38px; min-height: 38px; padding: 0.35rem 0.6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-primary); font-family: var(--font-mono); font-size: 0.92rem; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 0.3rem; transition: background-color .12s, border-color .12s, transform .08s; }
.game-key:hover:not(:disabled) { background: var(--surface-elevated); border-color: var(--text-muted); }
.game-key.is-on { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 12%, var(--surface)); }
.game-cell-focus:focus-visible, .game-key:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
#status-badge.is-win { color: #15803d; background: rgba(22, 163, 74, 0.12); }
[data-theme="dark"] #status-badge.is-win { color: #4ade80; }
@media (pointer: coarse) {
  .game-key { min-width: 44px; min-height: 44px; font-size: 1rem; }
}

/* ═══════════ Scrollbars — thin brand-orange thumb on a clear track: the page itself + every inner scroll area (EQ bank, lists, tables, panes) ═══════════
 * Designed by Kapil Pidhwani: standard scrollbar-color/-width (Chrome 121+, Firefox) with the ::-webkit-scrollbar fallback for Safari.
 * Pills/tabs that hide their bar (.segmented-group, .type-tabs-scrollable) keep scrollbar-width: none — their class rules win on specificity.
 * The page scrollbar (html) matches; it skips the :hover brighten because the page is always hovered — Safari still brightens via the webkit thumb. */
html, body * { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--brand) 55%, transparent) transparent; }
body *:hover { scrollbar-color: var(--brand) transparent; }
html::-webkit-scrollbar, body *::-webkit-scrollbar { width: 6px; height: 6px; }
html::-webkit-scrollbar-track, body *::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb, body *::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 999px; }
html::-webkit-scrollbar-thumb:hover, body *::-webkit-scrollbar-thumb:hover { background: var(--brand); }
html::-webkit-scrollbar-corner, body *::-webkit-scrollbar-corner { background: transparent; }

/* ═══════════ Text selection — brand orange instead of the browser's blue ═══════════
 * Designed by Kapil Pidhwani: translucent brand tint, text keeps its own colour, so contrast holds in light and dark themes
 * (white-on-orange would fall to ~3:1). Applies to page text, inputs and textareas alike. */
::selection { background: color-mix(in srgb, var(--brand) 30%, transparent); }

/* ═══════════ Platform pages: footer socials · contact · blog · careers · press · tools A–Z ═══════════ */
.footer-social, .mobile-nav-social { display: flex; gap: 0.5rem; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.25rem; }
.footer-legal a { color: var(--text-muted); transition: color .15s; }
.site-footer .footer-legal a:hover { color: var(--brand); }
@media (pointer: coarse) { .footer-legal a { display: inline-flex; align-items: center; min-height: var(--touch); } }
.footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-pill); color: var(--text-secondary); transition: color .15s, border-color .15s; }
.footer-social a:hover { color: var(--brand); border-color: var(--brand); }
.mobile-nav-social { padding-top: 0.75rem; }
@media (pointer: coarse) { .footer-social a { width: var(--touch); height: var(--touch); } }

/* Contact: email row + topic cards */
.contact-email-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.contact-email { font-size: clamp(1.25rem, 2.5vw, 1.6rem); font-weight: 500; letter-spacing: -0.01em; }
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 0.75rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.prose-card .contact-card { display: flex; flex-direction: column; gap: 0.3rem; height: 100%; padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-primary); font-weight: 400; transition: border-color .15s; }
.prose-card .contact-card:hover { border-color: var(--brand); text-decoration: none; }
.contact-card strong { display: flex; align-items: center; gap: 0.45rem; font-weight: 600; }
.contact-card strong iconify-icon { color: var(--brand); }
.contact-card span { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.5; }

/* Blog list (the empty state hides itself once a post <li> exists — keep the <ul> free of whitespace while empty) */
.blog-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.blog-list:not(:empty) + .blog-empty { display: none; }
.prose-card .blog-card { display: block; padding: 1.25rem 1.4rem; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text-primary); font-weight: 400; transition: border-color .15s; }
.prose-card .blog-card:hover { border-color: var(--brand); text-decoration: none; }
.blog-card time, .blog-meta { font-size: 0.82rem; color: var(--text-muted); }
.blog-card h2 { font-size: 1.15rem; font-weight: 600; margin: 0.3rem 0 0.4rem; }
.blog-card p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); line-height: 1.55; }

/* Press: brand colour swatches + logo tiles */
.press-assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 0.75rem; list-style: none; padding: 0; margin: 1rem 0 0; }
.press-assets li { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); padding: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; text-align: center; font-size: 0.86rem; }
.press-assets img { width: 64px; height: 64px; object-fit: contain; }
.press-swatch { width: 100%; height: 56px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.press-swatch-brand { background: #F4511E; }
.press-swatch-ink { background: #17191C; }
.press-swatch-paper { background: #F7F7F5; }
.press-swatch-gold { background: #F9B72B; }

/* Tools A–Z */
.tools-index-controls { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.75rem; }
.tools-index-filter { width: 100%; max-width: 420px; padding: 0.65rem 0.9rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-primary); font: inherit; font-size: 0.92rem; }
.tools-index-filter:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tools-index-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tools-index-chip { padding: 0.35rem 0.85rem; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-secondary); font: inherit; font-size: 0.82rem; cursor: pointer; }
.tools-index-chip[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--surface)); }
.tools-index-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.tools-index-count { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.tools-index-group + .tools-index-group { margin-top: 1.75rem; }
.tools-index-letter { font-size: 1rem; font-weight: 600; color: var(--brand); border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin: 0 0 0.6rem; }
.tools-index-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0.15rem 1.25rem; }
.prose-card .tools-index-list a { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0; color: var(--text-primary); font-weight: 400; font-size: 0.92rem; }
.tools-index-list a iconify-icon { color: var(--brand); flex-shrink: 0; }
.tools-index-cat { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }
.prose-card.prose-card-wide { max-width: none; }
