/* ============================================================
   ImageToolHub — Main Stylesheet
   Mobile-first, clean, minimal
   ============================================================ */

/* --- CSS Variables --- */
:root {
  --primary: #4F46E5;
  --primary-dark: #3730A3;
  --primary-light: #EEF2FF;
  --secondary: #06B6D4;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --bg: #FFFFFF;
  --bg-light: #F8FAFC;
  --bg-gray: #F1F5F9;
  --border: #E2E8F0;
  --border-dark: #CBD5E1;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --transition: 0.2s ease;
  --container: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-dark); }
ul { list-style: none; }
h1,h2,h3,h4,h5,h6 { line-height: 1.3; font-weight: 700; color: var(--text); }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.875rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.375rem); }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* --- Container --- */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
@media (min-width: 768px) { .container { padding: 0 2rem; } }

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 9999;
  background: var(--text); color: #fff; padding: 1rem 0;
  transform: translateY(100%); transition: transform 0.3s ease;
}
.cookie-banner.show { transform: translateY(0); }
.cookie-inner { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.cookie-inner p { margin: 0; font-size: 0.875rem; flex: 1 1 300px; }
.cookie-inner a { color: #A5B4FC; }
.cookie-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

/* --- Site Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 1rem;
}
.site-logo {
  display: flex; align-items: center; gap: 0.625rem;
  font-size: 1.25rem; font-weight: 800; color: var(--text);
  text-decoration: none; flex-shrink: 0;
}
.site-logo:hover { color: var(--primary); }
.site-logo svg { flex-shrink: 0; }

/* Nav */
.main-nav { display: none; }
.main-nav.open { display: block; }
@media (min-width: 768px) {
  .main-nav { display: block; }
  .nav-toggle { display: none; }
}
.main-nav ul { display: flex; align-items: center; gap: 0.25rem; }
.main-nav > ul > li { position: relative; }
.main-nav a {
  display: block; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 500; color: var(--text);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}
.main-nav a:hover, .main-nav a[aria-current] { background: var(--primary-light); color: var(--primary); }
.main-nav a svg { vertical-align: middle; }

/* Dropdown */
.has-dropdown .dropdown {
  display: none; position: absolute; top: calc(100% + 4px); left: 0;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); min-width: 220px; z-index: 200;
  flex-direction: column; padding: 0.5rem;
}
.has-dropdown:hover .dropdown { display: flex; }
.has-dropdown .dropdown a { font-size: 0.875rem; border-radius: 6px; }

/* Mobile nav */
@media (max-width: 767px) {
  .main-nav {
    position: absolute; top: 65px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow); padding: 1rem;
  }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav ul ul { position: static; box-shadow: none; border: none; display: flex; padding-left: 1rem; }
  .has-dropdown .dropdown { display: flex; flex-direction: column; }
}

/* Nav Toggle */
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; border-radius: var(--radius-sm);
  font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  border: 2px solid transparent; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-secondary { background: var(--secondary); color: #fff; border-color: var(--secondary); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1.0625rem; border-radius: var(--radius); }
.btn-sm { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Ad Containers --- */
.ad-container { padding: 0.75rem 0; }
.ad-header { background: var(--bg-light); border-bottom: 1px solid var(--border); }
.ad-footer { background: var(--bg-light); border-top: 1px solid var(--border); }
.ad-placeholder {
  background: var(--bg-gray); border: 1px dashed var(--border-dark);
  border-radius: var(--radius-sm); min-height: 90px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ad-sidebar { margin-bottom: 2rem; }
.ad-content { margin: 2rem 0; }

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7C3AED 100%);
  color: #fff; padding: 4rem 0 3rem; text-align: center;
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero p { font-size: 1.125rem; opacity: 0.9; max-width: 600px; margin: 0 auto 2rem; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { color: #fff; border-color: rgba(255,255,255,.6); }
.hero .btn-outline:hover { background: rgba(255,255,255,.15); }

/* --- Section --- */
.section { padding: 3.5rem 0; }
.section-light { background: var(--bg-light); }
.section-gray { background: var(--bg-gray); }
.section-title { text-align: center; margin-bottom: 2.5rem; }
.section-title h2 { margin-bottom: 0.5rem; }
.section-title p { color: var(--text-muted); font-size: 1.0625rem; max-width: 600px; margin: 0 auto; }

/* --- Cards --- */
.card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: var(--shadow-sm); transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-link:hover { color: inherit; }

/* --- Tool Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.tool-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
  transition: all var(--transition); display: flex; flex-direction: column; gap: 0.875rem;
}
.tool-card:hover {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light), var(--shadow);
  transform: translateY(-2px);
}
.tool-icon {
  width: 48px; height: 48px; background: var(--primary-light);
  border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center;
  color: var(--primary); flex-shrink: 0;
}
.tool-icon svg { width: 24px; height: 24px; }
.tool-card h3 { font-size: 1.0625rem; margin: 0; }
.tool-card p { font-size: 0.875rem; color: var(--text-muted); margin: 0; flex: 1; }
.tool-card .btn { align-self: flex-start; margin-top: auto; }

/* --- Blog Grid --- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.blog-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
  display: flex; flex-direction: column;
}
.blog-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
.blog-card-img {
  aspect-ratio: 16/9; background: var(--primary-light);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-img-placeholder { color: var(--primary); }
.blog-card-img-placeholder svg { width: 48px; height: 48px; }
.blog-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.blog-meta { display: flex; gap: 0.75rem; font-size: 0.8125rem; color: var(--text-muted); flex-wrap: wrap; }
.blog-meta time { display: flex; align-items: center; gap: 0.25rem; }
.blog-category { background: var(--primary-light); color: var(--primary); padding: 0.125rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.blog-card h3 { font-size: 1rem; line-height: 1.4; }
.blog-card p { font-size: 0.875rem; color: var(--text-muted); flex: 1; }
.blog-card .read-more { font-size: 0.875rem; font-weight: 600; color: var(--primary); margin-top: auto; }
.blog-card .read-more:hover { text-decoration: underline; }

/* --- Features Grid --- */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.feature-item { text-align: center; padding: 1.5rem; }
.feature-icon {
  width: 60px; height: 60px; background: var(--primary-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem; color: var(--primary);
}
.feature-icon svg { width: 28px; height: 28px; }
.feature-item h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.feature-item p { font-size: 0.9rem; color: var(--text-muted); }

/* --- Breadcrumb --- */
.breadcrumb {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.875rem; color: var(--text-muted); flex-wrap: wrap;
  padding: 0.75rem 0;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--text-light); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* --- Page Header --- */
.page-header {
  background: var(--bg-gray); border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.5rem;
}
.page-header h1 { margin-bottom: 0.5rem; }
.page-header p { color: var(--text-muted); font-size: 1rem; max-width: 700px; }

/* --- Tool Page Layout --- */
.tool-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .tool-layout { grid-template-columns: 1fr 300px; } }

.tool-main {}
.tool-sidebar {}

/* Tool Box */
.tool-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  box-shadow: var(--shadow);
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border-dark); border-radius: var(--radius);
  padding: 3rem 2rem; text-align: center; cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  background: var(--bg-light);
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary); background: var(--primary-light);
}
.upload-zone svg { width: 48px; height: 48px; color: var(--text-muted); margin: 0 auto 1rem; }
.upload-zone h3 { font-size: 1.0625rem; margin-bottom: 0.5rem; }
.upload-zone p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }
.upload-zone input[type="file"] { display: none; }

/* Tool Controls */
.tool-controls { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.control-group { display: flex; flex-direction: column; gap: 0.375rem; }
.control-group label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.control-group input, .control-group select, .control-group textarea {
  padding: 0.625rem 0.875rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9375rem;
  background: var(--bg); color: var(--text); width: 100%;
  transition: border-color var(--transition);
}
.control-group input:focus, .control-group select:focus, .control-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.range-group { display: flex; align-items: center; gap: 1rem; }
.range-group input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-value { font-weight: 700; color: var(--primary); min-width: 40px; text-align: right; }
.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* Result Box */
.result-box {
  margin-top: 1.5rem; padding: 1.25rem; background: var(--bg-light);
  border: 1px solid var(--border); border-radius: var(--radius); display: none;
}
.result-box.show { display: block; }
.result-preview { max-width: 100%; max-height: 400px; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.result-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1rem; font-size: 0.875rem; }
.stat-item { display: flex; flex-direction: column; gap: 0.125rem; }
.stat-label { color: var(--text-muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-value { font-weight: 700; color: var(--text); }
.stat-value.success { color: var(--success); }

/* Progress Bar */
.progress-bar {
  height: 4px; background: var(--border); border-radius: 2px;
  overflow: hidden; margin: 1rem 0; display: none;
}
.progress-bar.show { display: block; }
.progress-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; width: 0; }

/* --- Sidebar Widgets --- */
.sidebar-widget {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.5rem;
}
.sidebar-widget h3 { font-size: 0.9375rem; margin-bottom: 1rem; color: var(--text); }
.sidebar-widget ul li { padding: 0.375rem 0; border-bottom: 1px solid var(--border); }
.sidebar-widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-widget ul a { font-size: 0.875rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.5rem; }
.sidebar-widget ul a:hover { color: var(--primary); }

/* --- SEO Content Section --- */
.seo-content { padding: 2.5rem 0; }
.seo-content h2 { font-size: 1.5rem; margin-bottom: 1rem; }
.seo-content h3 { font-size: 1.125rem; margin: 1.5rem 0 0.625rem; color: var(--primary); }
.seo-content ul, .seo-content ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.seo-content li { margin-bottom: 0.375rem; font-size: 0.9375rem; line-height: 1.6; }
.seo-content ul li { list-style: disc; }
.seo-content ol li { list-style: decimal; }
.seo-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
.seo-content th { background: var(--bg-gray); padding: 0.75rem 1rem; text-align: left; font-weight: 600; border: 1px solid var(--border); }
.seo-content td { padding: 0.625rem 1rem; border: 1px solid var(--border); }
.seo-content tr:nth-child(even) td { background: var(--bg-light); }

/* FAQ Section */
.faq-section { margin-top: 2.5rem; }
.faq-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 0.75rem; overflow: hidden;
}
.faq-question {
  padding: 1rem 1.25rem; cursor: pointer; display: flex; justify-content: space-between;
  align-items: center; font-weight: 600; font-size: 0.9375rem;
  background: var(--bg); user-select: none;
}
.faq-question:hover { background: var(--bg-light); }
.faq-question svg { width: 18px; height: 18px; flex-shrink: 0; transition: transform var(--transition); color: var(--text-muted); }
.faq-item.open .faq-question svg { transform: rotate(180deg); }
.faq-answer { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.faq-item.open .faq-answer { max-height: 500px; padding: 1rem 1.25rem; }
.faq-answer p { font-size: 0.9375rem; color: var(--text-muted); margin: 0; }

/* --- Blog Layout --- */
.blog-layout { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 1024px) { .blog-layout { grid-template-columns: 1fr 300px; } }

.blog-content {}
.article-header { margin-bottom: 2rem; }
.article-header h1 { margin-bottom: 0.75rem; }
.article-meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; font-size: 0.875rem; color: var(--text-muted); }
.article-body { font-size: 1rem; line-height: 1.8; }
.article-body h2 { font-size: 1.5rem; margin: 2rem 0 0.875rem; }
.article-body h3 { font-size: 1.125rem; margin: 1.5rem 0 0.625rem; color: var(--primary); }
.article-body p { margin-bottom: 1.25rem; }
.article-body ul, .article-body ol { padding-left: 1.75rem; margin-bottom: 1.25rem; }
.article-body li { margin-bottom: 0.5rem; }
.article-body ul li { list-style: disc; }
.article-body ol li { list-style: decimal; }
.article-body a { text-decoration: underline; }
.article-body table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
.article-body th { background: var(--bg-gray); padding: 0.75rem; border: 1px solid var(--border); font-weight: 600; }
.article-body td { padding: 0.625rem 0.75rem; border: 1px solid var(--border); }
.article-body tr:nth-child(even) td { background: var(--bg-light); }
.article-body code { background: var(--bg-gray); padding: 0.125rem 0.375rem; border-radius: 4px; font-size: 0.875em; font-family: monospace; }
.article-body pre { background: var(--text); color: #e2e8f0; padding: 1.25rem; border-radius: var(--radius-sm); overflow-x: auto; margin: 1.5rem 0; }
.article-body pre code { background: none; padding: 0; color: inherit; }

.author-box {
  display: flex; gap: 1.25rem; padding: 1.5rem; background: var(--bg-light);
  border: 1px solid var(--border); border-radius: var(--radius); margin-top: 2rem;
}
.author-avatar {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--primary-light); display: flex; align-items: center; justify-content: center;
  color: var(--primary); font-size: 1.5rem; font-weight: 700;
}
.author-info h4 { margin-bottom: 0.25rem; }
.author-info p { font-size: 0.875rem; color: var(--text-muted); margin: 0; }

/* Tags */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.5rem; }
.tag {
  background: var(--bg-gray); border: 1px solid var(--border);
  padding: 0.25rem 0.75rem; border-radius: 999px;
  font-size: 0.8125rem; color: var(--text-muted);
  transition: all var(--transition);
}
.tag:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* --- Pagination --- */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 0.5rem; margin-top: 2.5rem; flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 500;
  border: 1px solid var(--border); transition: all var(--transition);
}
.pagination a { color: var(--text); }
.pagination a:hover, .pagination .active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.pagination .dots { border: none; color: var(--text-muted); }

/* --- Forms --- */
.form-group { display: flex; flex-direction: column; gap: 0.375rem; margin-bottom: 1.25rem; }
.form-label { font-size: 0.875rem; font-weight: 600; color: var(--text); }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  padding: 0.75rem 1rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 0.9375rem; font-family: var(--font);
  background: var(--bg); color: var(--text); width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-control.error { border-color: var(--danger); }
.form-error { font-size: 0.8125rem; color: var(--danger); }
.form-success { font-size: 0.8125rem; color: var(--success); }
textarea.form-control { resize: vertical; min-height: 120px; }

/* Alert messages */
.alert {
  padding: 0.875rem 1.125rem; border-radius: var(--radius-sm);
  font-size: 0.9375rem; margin-bottom: 1.25rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.alert-success { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0; }
.alert-error { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.alert-info { background: #DBEAFE; color: #1E40AF; border: 1px solid #BFDBFE; }
.alert-warning { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

/* --- Footer --- */
.site-footer {
  background: var(--text); color: #CBD5E1; margin-top: auto;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr;
  gap: 2rem; padding: 3rem 0 2rem;
}
@media (min-width: 576px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand { }
.footer-logo { display: flex; align-items: center; gap: 0.625rem; color: #fff; font-size: 1.125rem; margin-bottom: 0.875rem; }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }
.footer-col h3 { color: #fff; font-size: 0.875rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul a { font-size: 0.875rem; color: #94A3B8; transition: color var(--transition); }
.footer-col ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); padding: 1.25rem 0;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 0.5rem; font-size: 0.8125rem; color: #64748B;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 0.25rem; } .mt-2 { margin-top: 0.5rem; } .mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 2rem; } .mt-6 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.25rem; } .mb-2 { margin-bottom: 0.5rem; } .mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 2rem; }
.d-none { display: none; } .d-block { display: block; } .d-flex { display: flex; }
.gap-2 { gap: 0.5rem; } .gap-3 { gap: 1rem; } .gap-4 { gap: 1.5rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Stats Bar --- */
.stats-bar {
  background: var(--primary); color: #fff;
  padding: 1rem 0;
}
.stats-bar .container { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.stat-box { text-align: center; }
.stat-box .num { font-size: 1.75rem; font-weight: 800; display: block; }
.stat-box .lbl { font-size: 0.8125rem; opacity: 0.85; }

/* --- Lazy Load --- */
img[data-src] { opacity: 0; transition: opacity 0.3s; }
img.loaded { opacity: 1; }

/* --- Base64 Output --- */
.base64-output {
  font-family: monospace; font-size: 0.8rem; word-break: break-all;
  background: #1E293B; color: #A5F3FC; padding: 1rem;
  border-radius: var(--radius-sm); max-height: 200px; overflow-y: auto;
}

/* --- Metadata Table --- */
.meta-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.meta-table tr { border-bottom: 1px solid var(--border); }
.meta-table tr:last-child { border-bottom: none; }
.meta-table th { padding: 0.5rem 0.75rem; text-align: left; background: var(--bg-gray); font-weight: 600; width: 40%; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; }
.meta-table td { padding: 0.5rem 0.75rem; color: var(--text); word-break: break-word; }

/* --- Loader --- */
.loader {
  width: 24px; height: 24px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Scroll to Top --- */
#scrollTop {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 500;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none; cursor: pointer;
  display: none; align-items: center; justify-content: center;
  box-shadow: var(--shadow); transition: background var(--transition);
}
#scrollTop.show { display: flex; }
#scrollTop:hover { background: var(--primary-dark); }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .ad-container, #cookie-banner, #scrollTop { display: none; }
}
