:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #1f2a40;
  --border: #2d3a52;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gradient-1: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
  --gradient-2: linear-gradient(135deg, #0ea5e9 0%, #6366f1 100%);
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(139, 92, 246, 0.1), transparent);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
  z-index: 1;
}

.site-header .container {
  max-width: 1440px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25);
  overflow: visible;
}

.header-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: none;
  z-index: 0;
}

.header-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.65rem 0;
  overflow: visible;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.logo:hover { text-decoration: none; opacity: 0.92; }

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Main Navigation */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  overflow: visible;
}

.nav-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.15rem;
  list-style: none;
  margin: 0;
  padding: 0 0.25rem;
  overflow: visible;
}

.nav-item { position: relative; }

@media (max-width: 1200px) {
  .mega-panel-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
  .nav-mega-panel.mega-full { width: min(960px, calc(100vw - 24px)); }
}

@media (max-width: 1100px) {
  .nav-link { padding: 0.5rem 0.65rem; font-size: 0.76rem; }
  .nav-badge, .nav-count { display: none; }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.nav-item.open > .nav-trigger,
.nav-item.active > .nav-trigger {
  color: #fff;
  background: var(--gradient-1);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
  text-decoration: none;
}

.nav-item.active > .nav-link:not(.nav-trigger) {
  color: #fff;
  background: var(--gradient-1);
}

.nav-icon { font-size: 1rem; line-height: 1; }

.nav-label { display: inline; }

.nav-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.5;
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.nav-item.open .nav-chevron { transform: rotate(180deg); opacity: 1; }

.nav-badge {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: white;
  line-height: 1.4;
}

.nav-count {
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav-item.open .nav-count,
.nav-item.active .nav-count {
  background: var(--accent);
  color: white;
  border-color: transparent;
}

/* Mega dropdown panel — fixed, full layout, no inner scroll */
.nav-mega-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(760px, calc(100vw - 32px));
  background: #1a2234;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 16px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255,255,255,0.06);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 99999;
  transform: translateY(8px);
  overflow: visible;
}

.nav-item.open .nav-mega-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.mega-panel-grid {
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem;
}

.mega-panel-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.mega-panel-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.mega-panel-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.mega-panel-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }

.nav-mega-panel.mega-wide {
  width: min(960px, calc(100vw - 32px));
}

.nav-mega-panel.mega-full {
  width: min(1140px, calc(100vw - 24px));
}

.mega-section {
  padding: 0.35rem;
  border-radius: 10px;
  min-width: 0;
}

.mega-section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.25rem;
  border-radius: 8px;
  text-decoration: none !important;
  background: color-mix(in srgb, var(--cat-color) 14%, transparent);
  border-left: 3px solid var(--cat-color);
  transition: background 0.2s;
}

.mega-section-head:hover {
  background: color-mix(in srgb, var(--cat-color) 24%, transparent);
}

.mega-section-head span { font-size: 1rem; flex-shrink: 0; }

.mega-section-head strong {
  flex: 1;
  font-size: 0.78rem;
  color: var(--text-primary);
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-section-head em {
  font-style: normal;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  flex-shrink: 0;
}

.mega-section-list {
  list-style: none;
  padding: 0 0.15rem;
  margin: 0;
  overflow: visible;
}

.mega-section-list li a {
  display: block;
  padding: 0.32rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mega-section-list li a:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.12);
  text-decoration: none;
  padding-left: 0.75rem;
}

.mega-view-all a {
  color: var(--accent-hover) !important;
  font-weight: 600;
  font-size: 0.7rem !important;
  margin-top: 0.15rem;
}

.mega-view-all a:hover {
  background: rgba(99, 102, 241, 0.18) !important;
}

/* Legacy dropdown — keep for compatibility */
.nav-dropdown {
  display: none;
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

body.nav-open { overflow: hidden; }

body.nav-open .site-header {
  z-index: 260;
}

body.nav-open .header-actions {
  position: relative;
  z-index: 2;
}

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  top: 62px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 140;
  opacity: 0;
  transition: opacity 0.3s;
}

body.nav-open .nav-overlay {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 1023px) {
  .nav-overlay {
    top: 0;
    z-index: 240;
  }
}

/* Search — icon button, expands on click (all screen sizes) */
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 210;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.search-toggle:hover,
.search-wrap.open .search-toggle {
  color: #fff;
  border-color: var(--accent);
  background: var(--gradient-1);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.search-icon {
  width: 20px;
  height: 20px;
  display: block;
  pointer-events: none;
}

.search-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: width 0.28s ease, opacity 0.22s ease;
  z-index: 220;
}

.search-wrap.open .search-panel {
  width: min(340px, calc(100vw - 2rem));
  opacity: 1;
  pointer-events: auto;
  overflow: visible;
}

.search-panel input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  outline: none;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-wrap.open .search-panel input {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--accent-glow);
}

.search-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 0 3px var(--accent-glow);
}

.search-icon-input {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--accent-hover);
  pointer-events: none;
  z-index: 2;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 500;
  overflow: hidden;
  max-height: 360px;
  overflow-y: auto;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  text-decoration: none !important;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.search-result:last-child { border-bottom: none; }
.search-result:hover { background: rgba(99, 102, 241, 0.1); }
.sr-icon { font-size: 1.25rem; flex-shrink: 0; }
.search-result strong { display: block; font-size: 0.875rem; }
.search-result small { color: var(--text-muted); font-size: 0.75rem; }
.search-empty { padding: 1rem; text-align: center; color: var(--text-muted); font-size: 0.875rem; }

/* Hero */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.hero-badge span { color: var(--success); }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-item { text-align: center; }

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-hover);
}

.stat-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Categories */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9375rem;
}

.category-section { margin-bottom: 3rem; }

.category-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow), 0 0 20px var(--accent-glow);
  text-decoration: none;
  color: inherit;
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.375rem;
  margin-bottom: 0.875rem;
}

.tool-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}

.tool-card p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.tool-badge {
  display: inline-block;
  margin-top: 0.625rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-hover);
}

.tool-badge.api { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.tool-badge.ai { background: rgba(168, 85, 247, 0.15); color: #c084fc; }

/* Tool Page */
.tool-page { padding: 2rem 0 4rem; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent-hover); }

.tool-header { margin-bottom: 2rem; }

.tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tool-header p { color: var(--text-secondary); }

.tool-article {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.tool-article h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.tool-article p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}

.tool-article p:last-child { margin-bottom: 0; }

.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.tool-panel h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

textarea, input[type="text"], input[type="number"], input[type="url"], input[type="password"], select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea { min-height: 160px; resize: vertical; font-family: 'Consolas', 'Monaco', monospace; font-size: 0.875rem; }

textarea:focus, input:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-1);
  color: white;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.output-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
  min-height: 80px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.875rem;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text-primary);
}

.output-box.empty { color: var(--text-muted); font-style: italic; font-family: var(--font); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.stat-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.875rem;
  text-align: center;
}

.stat-box .value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-hover);
}

.stat-box .label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.alert {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.alert-info { background: rgba(99, 102, 241, 0.1); border: 1px solid rgba(99, 102, 241, 0.3); color: var(--accent-hover); }
.alert-success { background: rgba(34, 197, 94, 0.1); border: 1px solid rgba(34, 197, 94, 0.3); color: var(--success); }
.alert-error { background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--warning); }

.loading {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* QR Preview */
.qr-preview {
  display: flex;
  justify-content: center;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  margin-top: 1rem;
}

.qr-preview img { max-width: 256px; }

/* Password strength */
.strength-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin-top: 0.5rem;
  overflow: hidden;
}

.strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}

/* Color preview */
.color-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px solid var(--border);
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
  background: rgba(17, 24, 39, 0.5);
  text-align: left;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.footer-desc {
  line-height: 1.7;
  max-width: 360px;
}

.footer-col h4 {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.footer-col a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.3rem 0;
  font-size: 0.875rem;
  transition: color 0.15s;
}

.footer-col a:hover { color: var(--accent-hover); }

.footer-disclaimer,
.footer-adsense {
  padding: 1rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.8125rem;
}

.footer-disclaimer strong,
.footer-adsense strong { color: var(--text-secondary); }

.footer-adsense a { color: var(--accent-hover); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
}

.footer-bottom-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-bottom-links a:hover { color: var(--accent-hover); }

/* Legal pages */
.legal-page {
  padding: 2.5rem 0 3rem;
  max-width: 860px;
}

.legal-page h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.legal-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--accent);
}

.legal-updated {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.legal-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
}

.legal-toc h2 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.legal-toc ol {
  padding-left: 1.25rem;
  margin: 0;
}

.legal-toc li {
  margin-bottom: 0.35rem;
}

.legal-toc a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
}

.legal-toc a:hover { color: var(--accent-hover); }

.legal-page section {
  margin-bottom: 2.5rem;
  scroll-margin-top: 5rem;
}

.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-page h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 1.25rem 0 0.5rem;
}

.legal-page p,
.legal-page li {
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.legal-page ul,
.legal-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.legal-page a { color: var(--accent-hover); }

.legal-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.legal-table th,
.legal-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.legal-table th {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
}

.legal-table tr:last-child td { border-bottom: none; }

.legal-related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.legal-related h2 {
  border: none;
  padding: 0;
  font-size: 1rem;
  margin-bottom: 0.75rem;
}

.legal-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.legal-related-links a {
  font-size: 0.875rem;
}

.contact-hero {
  margin-bottom: 2rem;
}

.contact-hero p {
  font-size: 1.05rem;
  line-height: 1.8;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.contact-card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.contact-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem;
}

.contact-card p {
  font-size: 0.875rem;
  margin: 0;
}

.contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.contact-box h2 { margin-bottom: 1rem; }

.contact-faq {
  margin-top: 2.5rem;
}

.contact-faq details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
}

.contact-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-primary);
  list-style: none;
}

.contact-faq summary::-webkit-details-marker { display: none; }

.contact-faq details[open] summary {
  margin-bottom: 0.75rem;
  color: var(--accent-hover);
}

.contact-faq details p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 1.5rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.4);
}

.cookie-banner p {
  flex: 1;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
  min-width: 200px;
}

.cookie-banner a { color: var(--accent-hover); }

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .cookie-banner { flex-direction: column; text-align: center; }
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive */
@media (max-width: 1023px) {
  .main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    flex: none;
    background: rgba(10, 14, 23, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    justify-content: flex-start;
    align-items: stretch;
    overflow-y: auto;
    padding: calc(58px + 0.75rem) 1rem 2rem;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 250;
    visibility: hidden;
    pointer-events: none;
  }

  .main-nav.open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }

  .nav-menu {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    align-content: flex-start;
    width: 100%;
    gap: 0.35rem;
    flex-wrap: nowrap;
    min-height: 0;
  }

  .nav-label { max-width: none; }

  .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.85rem 1rem;
    font-size: 0.9375rem;
  }

  .nav-chevron { margin-left: auto; }

  .nav-mega-panel {
    position: static !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    transform: none !important;
    box-shadow: none;
    border: 1px solid var(--border);
    margin: 0.35rem 0 0.75rem;
    display: none;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .nav-item.open .nav-mega-panel {
    display: block;
  }

  .mega-panel-grid,
  .mega-panel-grid.cols-2,
  .mega-panel-grid.cols-3,
  .mega-panel-grid.cols-4,
  .mega-panel-grid.cols-5 {
    grid-template-columns: 1fr;
  }

  .mega-section-list {
    overflow: visible;
  }

  .nav-toggle { display: flex; }

  .search-wrap.open .search-panel {
    position: fixed;
    top: 62px;
    left: 1rem;
    right: 1rem;
    width: auto !important;
    z-index: 300;
  }
}

@media (max-width: 768px) {
  .header-inner { flex-wrap: nowrap; }
  .logo span { font-size: 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .logo span { display: none; }
  .search-wrap.open .search-panel { left: 0.75rem; right: 0.75rem; }
}

/* No results */
.no-results {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.no-results h3 { margin-bottom: 0.5rem; color: var(--text-secondary); }

/* File Dropzone */
.file-dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: all 0.2s;
  margin-bottom: 1rem;
  background: var(--bg-secondary);
}

.file-dropzone.dragover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
}

.dropzone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

.file-dropzone p { color: var(--text-secondary); font-size: 0.9375rem; }

.dropzone-link {
  color: var(--accent-hover);
  cursor: pointer;
  font-weight: 600;
}

.file-list { margin-top: 1rem; text-align: left; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
}

.file-remove {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.25rem;
}

.file-remove:hover { opacity: 0.8; }

input[type="color"] { cursor: pointer; }
input[type="file"] { font-size: 0.875rem; color: var(--text-secondary); }
canvas#sig-canvas { touch-action: none; }
