/* ==========================================
   IloveEpub — Turquoise/Green Brand System
   ========================================== */

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

:root {
  --bg: #f4f7f6;
  --surface: #ffffff;
  --text: #0f1a17;
  --text-muted: #5f706a;
  --border: #dce5e2;
  --border-light: #eaf0ed;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(15, 26, 23, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 26, 23, 0.07);
  --shadow-lg: 0 12px 40px rgba(15, 26, 23, 0.1);
  --transition: 0.25s ease;
  --header-h: 64px;

  /* Brand palette — turquoise/green */
  --brand: #2eb89e;
  --brand-dark: #1f9a84;
  --brand-light: #e8f8f4;
  --brand-glow: rgba(46, 184, 158, 0.15);
  --accent: #2eb89e;
  --accent-hover: #1f9a84;

  /* Tool-specific colors (muted, harmonious) */
  --tool-color: var(--brand);

  /* Premium */
  --premium: #0d0e11;
  --premium-accent: #3ecfb2;

  --max-w: 1080px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ==========================================
   Header
   ========================================== */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__logo {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  letter-spacing: -0.03em;
}

.header__heart {
  color: var(--brand);
  display: flex;
  align-items: center;
}

.header__nav {
  flex: 1;
}

.header__dropdown {
  position: relative;
}

.header__nav-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background var(--transition);
}

.header__nav-btn:hover {
  background: var(--brand-light);
}

.header__mega {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  gap: 2rem;
  min-width: 460px;
  grid-template-columns: repeat(4, 1fr);
  z-index: 100;
}

.header__dropdown:hover .header__mega {
  display: grid;
}

.header__mega-col h4 {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
  margin-bottom: 0.6rem;
}

.header__mega-col a {
  display: block;
  padding: 0.3rem 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: color var(--transition);
}

.header__mega-col a:hover {
  color: var(--brand);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.header__link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

.header__mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.25rem;
}

/* Mobile menu overlay */
@media (max-width: 768px) {
  .mobile-menu-open .header__nav,
  .mobile-menu-open .header__actions {
    display: flex !important;
  }

  .mobile-menu-open .header__inner {
    flex-wrap: wrap;
  }

  .mobile-menu-open .header__nav {
    order: 10;
    width: 100%;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
  }

  .mobile-menu-open .header__actions {
    order: 11;
    width: 100%;
    padding: 0.5rem 0 0.75rem;
    justify-content: center;
  }

  .mobile-menu-open .header__mega {
    position: static;
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    min-width: 0;
    box-shadow: none;
    border: none;
    padding: 0.5rem 0;
  }

  .mobile-menu-open .header {
    height: auto;
  }

  .mobile-menu-open .header__mobile-toggle svg path {
    d: path("M18 6L6 18M6 6l12 12");
  }
}

/* ==========================================
   Buttons
   ========================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn--sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
}

.btn--lg {
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
}

.btn--primary {
  background: var(--brand);
  color: white;
}

.btn--primary:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn--accent {
  background: var(--premium-accent);
  color: var(--premium);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem 2rem;
}

.btn--accent:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn--tool {
  background: var(--tool-color);
  color: white;
  padding: 0.8rem 1.75rem;
  font-size: 0.95rem;
}

.btn--tool:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn--download {
  background: var(--brand);
  color: white;
  padding: 0.85rem 2.5rem;
  font-size: 1rem;
}

.btn--download:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
}

/* ==========================================
   Hero — distinct from IlovePDF (left-aligned, minimal)
   ========================================== */

.hero {
  padding: 5rem 2rem 3rem;
  max-width: var(--max-w);
  margin: 0 auto;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  margin-bottom: 1.25rem;
  color: var(--text);
  max-width: 600px;
}

.hero__sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
  max-width: 520px;
}

.hero__sub strong {
  color: var(--brand);
  font-weight: 700;
}

/* ==========================================
   Category Filter Pills
   ========================================== */

.tools-filter {
  display: flex;
  gap: 0.4rem;
  padding: 0 2rem;
  margin-bottom: 1.75rem;
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 0.4rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  background: var(--surface);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.filter-pill.active {
  background: var(--brand);
  border-color: var(--brand);
  color: white;
}

/* ==========================================
   Tools Grid — 2-column wide cards (not IlovePDF 3-col)
   ========================================== */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: var(--max-w);
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  color: var(--text);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--tool-color);
}

.tool-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--tool-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.tool-card:hover .tool-card__icon {
  transform: scale(1.06) rotate(-2deg);
}

.tool-card__icon svg {
  width: 26px;
  height: 26px;
}

.tool-card__body {
  flex: 1;
  min-width: 0;
}

.tool-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tool-card__desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================
   Premium CTA — dark card, turquoise accents
   ========================================== */

.premium-cta {
  max-width: var(--max-w);
  margin: 0 auto 4rem;
  padding: 0 2rem;
}

.premium-cta__content {
  background: var(--premium);
  border-radius: var(--radius);
  padding: 3rem;
  color: white;
  display: flex;
  align-items: center;
  gap: 3rem;
  position: relative;
  overflow: hidden;
}

.premium-cta__content::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--premium-accent) 0%, transparent 70%);
  opacity: 0.08;
  pointer-events: none;
}

.premium-cta__content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.premium-cta__content ul {
  list-style: none;
  margin-bottom: 1.75rem;
}

.premium-cta__content li {
  padding: 0.35rem 0;
  font-size: 0.9rem;
  opacity: 0.85;
  padding-left: 1.5rem;
  position: relative;
}

.premium-cta__content li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--premium-accent);
  font-weight: 700;
}

.premium-cta__visual {
  flex-shrink: 0;
}

.premium-badge {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--premium-accent), #2eb89e);
  color: var(--premium);
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

/* ==========================================
   Trust / Social Proof
   ========================================== */

.trust {
  max-width: var(--max-w);
  margin: 0 auto 3rem;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border);
}

.trust__heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
  letter-spacing: -0.02em;
}

.trust__stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-bottom: 2rem;
}

.trust__stat {
  text-align: center;
}

.trust__stat strong {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--brand);
}

.trust__stat span {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.trust__badges {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.trust__badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
}

/* ==========================================
   SEO Content Block
   ========================================== */

.seo-content {
  max-width: 680px;
  margin: 0 auto 3rem;
  padding: 2rem;
}

.seo-content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.seo-content p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.seo-content a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.seo-content a:hover {
  text-decoration: underline;
}

/* ==========================================
   SEO Article Pages (server-rendered)
   ========================================== */

.seo-page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 3rem;
  align-items: start;
}

.seo-article h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

.seo-article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.01em;
}

.seo-article p {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.seo-article ul,
.seo-article ol {
  margin: 0.5rem 0 1rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.seo-article li {
  margin-bottom: 0.3rem;
}

.seo-article a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.seo-article a:hover {
  text-decoration: underline;
}

.seo-article code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-family: 'SF Mono', Consolas, monospace;
}

.seo-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.seo-cta {
  margin-top: 2.5rem;
  padding: 2rem;
  background: var(--brand-light);
  border-radius: var(--radius);
  text-align: center;
}

.seo-cta h2 {
  margin: 0 0 0.5rem;
  font-size: 1.3rem;
}

.seo-cta p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.seo-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
}

.seo-sidebar h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.seo-sidebar__tools {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (max-width: 768px) {
  .seo-page {
    grid-template-columns: 1fr;
    padding: 2rem 1rem;
  }

  .seo-article h1 {
    font-size: 1.6rem;
  }

  .seo-sidebar {
    position: static;
  }
}

/* ==========================================
   Tool View
   ========================================== */

.tool-header {
  text-align: center;
  padding: 3.5rem 2rem 1.5rem;
}

.tool-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.tool-header p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto;
}

.tool-workspace {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

/* Upload Area */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3.5rem 2rem;
  text-align: center;
  transition: all 0.3s ease;
  background: var(--surface);
  cursor: pointer;
}

.upload-area.dragover {
  border-color: var(--brand);
  background: var(--brand-light);
  transform: scale(1.01);
}

.upload-icon {
  width: 52px;
  height: 52px;
  color: var(--brand);
  margin: 0 auto 1.25rem;
  display: block;
  opacity: 0.6;
}

.upload-text {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.upload-subtext {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* File List */
.file-list {
  margin-top: 1.25rem;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
  animation: slideIn 0.25s ease;
}

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

.file-item-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.file-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.file-item-name {
  font-weight: 600;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-item-size {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.3rem;
  border-radius: 6px;
  transition: all var(--transition);
  flex-shrink: 0;
}

.file-item-remove:hover {
  color: #dc3545;
  background: #fef2f2;
}

/* Metadata Form */
.metadata-form {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.meta-field {
  margin-bottom: 0.9rem;
}

.meta-field:last-child {
  margin-bottom: 0;
}

.meta-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.meta-field input,
.meta-field textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  background: var(--bg);
}

.meta-field input:focus,
.meta-field textarea:focus {
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

/* Compress Options */
.compress-options {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.compress-options > label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  display: block;
  color: var(--text-muted);
}

.compress-levels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
}

.level-btn {
  padding: 0.9rem 0.5rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  font-family: inherit;
}

.level-btn span {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-muted);
}

.level-btn:hover {
  border-color: var(--brand);
}

.level-btn.active {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}

/* Process Button */
.process-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.9rem;
  background: var(--tool-color);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
}

.process-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.process-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* Result Area */
.result-area {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 1.5rem;
}

.result-icon {
  color: var(--brand);
  margin-bottom: 0.75rem;
}

.result-icon svg {
  width: 52px;
  height: 52px;
}

.result-area > p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.start-over-btn {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.start-over-btn:hover {
  color: var(--text);
  background: var(--bg);
}

/* Limit Notice */
.limit-notice {
  margin-top: 1rem;
  padding: 0.7rem 1rem;
  background: var(--brand-light);
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  color: var(--brand-dark);
}

.limit-notice a {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: underline;
}

/* Validation Results */
.validation-results {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.validation-results h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.validation-results.valid {
  border-color: var(--brand);
}

.validation-results.invalid {
  border-color: #dc3545;
}

.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.validation-item:last-child {
  border-bottom: none;
}

.badge {
  flex-shrink: 0;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge.error   { background: #fef2f2; color: #dc2626; }
.badge.warning { background: #fffbeb; color: #d97706; }
.badge.info    { background: #eff6ff; color: #2563eb; }
.badge.pass    { background: var(--brand-light); color: var(--brand-dark); }

/* Related Tools */
.related-tools {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
  border-top: 1px solid var(--border);
}

.related-tools h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.related-tools__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.related-tool-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.84rem;
  transition: all var(--transition);
}

.related-tool-link:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow);
}

.related-tool-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Ad Slot */
.ad-slot {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.5rem;
  text-align: center;
  z-index: 999;
}

.ad-slot__inner {
  max-width: 728px;
  height: 90px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ==========================================
   Footer
   ========================================== */

.footer {
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem 2rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.footer__col h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  margin-bottom: 0.6rem;
}

.footer__col a {
  display: block;
  padding: 0.25rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.footer__col a:hover {
  color: var(--text);
}

.footer__bottom {
  border-top: 1px solid var(--border);
  padding: 1.25rem 2rem;
  text-align: center;
}

.footer__bottom p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================
   Responsive
   ========================================== */

@media (max-width: 768px) {
  .hero {
    padding: 3rem 1.25rem 2rem;
  }

  .hero h1 {
    font-size: 1.9rem;
  }

  .tools-grid {
    grid-template-columns: 1fr;
    padding: 0 1rem;
  }

  .tool-workspace {
    padding: 0 1rem 3rem;
  }

  .compress-levels {
    grid-template-columns: 1fr;
  }

  .header__nav,
  .header__actions {
    display: none;
  }

  .header__mobile-toggle {
    display: block;
  }

  .premium-cta {
    padding: 0 1rem;
  }

  .premium-cta__content {
    flex-direction: column;
    padding: 2rem;
    gap: 1.5rem;
  }

  .trust__stats {
    gap: 1.5rem;
  }

  .trust__stat strong {
    font-size: 1.4rem;
  }

  .footer__inner {
    grid-template-columns: repeat(2, 1fr);
  }

  .tools-filter {
    padding: 0 1rem;
  }
}

/* ==========================================
   Static Pages (privacy, terms, about, faq)
   ========================================== */

.static-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.static-page--wide {
  max-width: 900px;
}

.static-page h1 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.5rem;
  line-height: 1.15;
}

.static-page__content h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.6rem;
  letter-spacing: -0.01em;
}

.static-page__content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.5rem 0 0.4rem;
}

.static-page__content p {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 0.65rem;
}

.static-page__content ul,
.static-page__content ol {
  margin: 0.5rem 0 1rem 1.25rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.75;
}

.static-page__content li {
  margin-bottom: 0.25rem;
}

.static-page__content a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
}

.static-page__content a:hover {
  text-decoration: underline;
}

/* FAQ items */
.faq-item {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border-light);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item h2,
.faq-item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
}

.faq-item p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.pricing-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: relative;
}

.pricing-card--pro {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), var(--shadow-md);
}

.pricing-badge-inline {
  position: absolute;
  top: -0.7rem;
  right: 1.5rem;
  background: var(--brand);
  color: white;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.75rem;
  border-radius: 100px;
}

.pricing-card__header {
  margin-bottom: 1.5rem;
}

.pricing-card__header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.pricing-card__price {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.pricing-card__price span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-card__header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.pricing-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
}

.pricing-card__features li {
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding-left: 1.5rem;
  position: relative;
}

.pricing-card__features li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.pricing-annual {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
}

@media (max-width: 768px) {
  .static-page {
    padding: 2rem 1.25rem 3rem;
  }

  .static-page h1 {
    font-size: 1.6rem;
  }

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

@media (min-width: 769px) and (max-width: 1024px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   Dark Mode
   ========================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --surface: #1a201e;
    --text: #e4ebe8;
    --text-muted: #8a9b95;
    --border: #2a3530;
    --border-light: #232d29;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
    --brand-light: rgba(46, 184, 158, 0.1);
    --brand-glow: rgba(46, 184, 158, 0.2);
  }

  .header {
    background: rgba(15, 21, 18, 0.92);
  }

  .upload-area {
    border-color: var(--border);
  }

  .upload-area.dragover {
    border-color: var(--brand);
    background: var(--brand-light);
  }

  .file-item-remove:hover {
    color: #f87171;
    background: rgba(220, 53, 69, 0.15);
  }

  .badge.error   { background: rgba(220, 38, 38, 0.15); color: #f87171; }
  .badge.warning { background: rgba(217, 119, 6, 0.15); color: #fbbf24; }
  .badge.info    { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }

  .pricing-card--pro {
    box-shadow: 0 0 0 1px var(--brand), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

/* ==========================================
   Skip Link (Accessibility)
   ========================================== */

.skip-link {
  position: absolute;
  top: -100%;
  left: 0.5rem;
  background: var(--brand);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 2000;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0.5rem;
}

/* Focus-visible for keyboard users */
*:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ==========================================
   Toast Notifications
   ========================================== */

.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 0.75rem);
  right: 1rem;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 4.7s forwards;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast--error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.toast--success {
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid var(--brand);
}

.toast--info {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #bfdbfe;
}

@media (prefers-color-scheme: dark) {
  .toast--error {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
    border-color: rgba(220, 38, 38, 0.3);
  }
  .toast--success {
    background: rgba(46, 184, 158, 0.15);
    color: var(--brand);
    border-color: rgba(46, 184, 158, 0.3);
  }
  .toast--info {
    background: rgba(37, 99, 235, 0.15);
    color: #60a5fa;
    border-color: rgba(37, 99, 235, 0.3);
  }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(1rem); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateY(-0.5rem); }
}

/* ==========================================
   Progress Bar
   ========================================== */

.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.75rem;
}

.progress-bar__fill {
  height: 100%;
  background: var(--tool-color, var(--brand));
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-bar__fill--indeterminate {
  width: 30%;
  animation: indeterminate 1.5s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

.progress-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: center;
}

/* ==========================================
   Full-page Drop Zone
   ========================================== */

.drop-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(46, 184, 158, 0.08);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  border: 3px dashed var(--brand);
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay__text {
  background: var(--surface);
  padding: 1.5rem 2.5rem;
  border-radius: var(--radius);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--brand);
  box-shadow: var(--shadow-lg);
}
