:root {
  --bg: #07090f;
  --bg2: #0d1117;
  --bg3: #111827;
  --card: #0f1623;
  --border: #1e2d45;
  --accent: #2563eb;
  --accent2: #3b82f6;
  --accent-glow: rgba(37,99,235,0.2);
  --text: #e8edf5;
  --muted: #6b7fa3;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 12px;
  --radius-lg: 20px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(7,9,15,0.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.3rem;
  color: var(--text); text-decoration: none;
  letter-spacing: -0.02em; display: flex; align-items: center; gap: 0.15rem;
}
.nav-logo .accent { color: var(--accent2); }
.nav-links { display: flex; gap: 0.25rem; align-items: center; }
.nav-links a {
  color: var(--muted); text-decoration: none;
  font-size: 0.85rem; font-weight: 500;
  padding: 0.4rem 0.75rem; border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--bg3); }
.nav-mobile-toggle { display: none; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.3rem; }

/* HERO */
.hero {
  position: relative;
  padding: 6rem 1.5rem 2rem;
  text-align: center;
  overflow: hidden;
}
.hero-glow {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 700px; height: 300px;
  background: radial-gradient(ellipse, rgba(37,99,235,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; margin-bottom: 0.75rem;
}
.hero h1 em { font-style: normal; color: var(--accent2); }
.hero p { font-size: 1rem; color: var(--muted); max-width: 560px; margin: 0 auto 1rem; font-weight: 300; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.25);
  color: var(--accent2); font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.85rem; border-radius: 999px;
  margin-bottom: 1rem; letter-spacing: 0.05em; text-transform: uppercase;
}

/* AD BANNER */
.ad-banner {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  margin: 1rem auto;
  max-width: 740px;
  min-height: 100px;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 0.25rem;
}
.ad-banner .ad-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.5; }
.ad-leaderboard { min-height: 90px; }
.ad-rectangle { min-height: 250px; max-width: 320px; }

/* CATEGORY GRID */
.categories {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  max-width: 1000px; margin: 0 auto; padding: 0 1.5rem 2rem;
}
.category-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-decoration: none; color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden;
  display: block;
}
.category-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity 0.2s;
}
.category-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow); }
.category-card:hover::before { opacity: 1; }
.category-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.category-card h2 { font-family: 'Syne', sans-serif; font-size: 1.2rem; font-weight: 700; margin-bottom: 0.35rem; }
.category-card p { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }
.category-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }
.tool-tag {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.72rem; padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

/* TOOLS GRID */
.tools-section {
  max-width: 1000px; margin: 0 auto; padding: 0 1.5rem 3rem;
}
.tools-section h2 {
  font-family: 'Syne', sans-serif; font-size: 1.4rem; font-weight: 700;
  margin-bottom: 1rem; color: var(--text);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.tool-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.5rem;
  cursor: pointer; text-decoration: none; color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  position: relative; overflow: hidden; display: block;
}
.tool-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0; transition: opacity 0.2s;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 6px 24px var(--accent-glow); }
.tool-card:hover::before { opacity: 1; }
.tool-icon {
  width: 44px; height: 44px;
  background: rgba(37,99,235,0.12); border: 1px solid rgba(37,99,235,0.2);
  border-radius: 11px; display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 1rem;
}
.tool-card h3 { font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem; }
.tool-card p { color: var(--muted); font-size: 0.83rem; line-height: 1.5; }

/* TOOL PAGE LAYOUT */
.tool-page { max-width: 900px; margin: 0 auto; padding: 5rem 1.5rem 3rem; }
.tool-page-header { margin-bottom: 1.5rem; }
.tool-page-header h1 {
  font-family: 'Syne', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800; letter-spacing: -0.02em;
  margin-bottom: 0.4rem;
}
.tool-page-header p { color: var(--muted); font-size: 0.95rem; }
.breadcrumb {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 1rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent2); }
.breadcrumb span { opacity: 0.5; }

/* TOOL INTERFACE */
.tool-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  margin-bottom: 1.5rem;
}
.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 1.25rem; display: block;
}
.dropzone:hover, .dropzone.drag-over { border-color: var(--accent); background: rgba(37,99,235,0.04); }
.dropzone-icon { font-size: 1.75rem; margin-bottom: 0.6rem; }
.dropzone p { color: var(--muted); font-size: 0.9rem; }
.dropzone strong { color: var(--text); }
.dropzone small { display: block; margin-top: 0.3rem; font-size: 0.78rem; color: var(--muted); opacity: 0.7; }

/* INPUTS */
.input-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; align-items: center; flex-wrap: wrap; }
.input-row label { color: var(--muted); font-size: 0.85rem; min-width: 50px; }
input[type="number"], input[type="text"], input[type="range"], select, textarea {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  padding: 0.5rem 0.75rem; font-size: 0.9rem; font-family: 'DM Sans', sans-serif;
}
input[type="number"] { width: 90px; }
input[type="text"] { flex: 1; min-width: 120px; }
input[type="range"] { width: 100%; cursor: pointer; background: none; padding: 0; }
select { cursor: pointer; }
input:focus, select:focus, textarea:focus { outline: 1px solid var(--accent); }
textarea { width: 100%; min-height: 120px; resize: vertical; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: 10px; padding: 0.75rem 1.5rem;
  font-size: 0.95rem; font-weight: 600; font-family: 'DM Sans', sans-serif;
  cursor: pointer; transition: background 0.2s, transform 0.15s;
  width: 100%; justify-content: center;
}
.btn:hover { background: var(--accent2); transform: translateY(-1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; width: auto; }
.btn-outline {
  background: var(--bg3); border: 1px solid var(--border); color: var(--text);
}
.btn-outline:hover { background: var(--border); }

/* STATUS */
.status {
  margin-top: 1rem; padding: 0.75rem 1rem;
  border-radius: 8px; font-size: 0.85rem; display: none;
}
.status.info { background: rgba(37,99,235,0.1); border: 1px solid rgba(37,99,235,0.3); color: var(--accent2); display: block; }
.status.success { background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); color: var(--success); display: block; }
.status.error { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #f87171; display: block; }

/* FILE LIST */
.file-list { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.4rem; }
.file-item {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.55rem 0.8rem;
  font-size: 0.85rem; color: var(--text);
  display: flex; align-items: center; gap: 0.5rem;
  cursor: grab; user-select: none;
  transition: border-color 0.15s, opacity 0.15s;
}
.file-item.dragging { opacity: 0.4; border-color: var(--accent); }
.file-item.drag-target { border-color: var(--accent2); background: rgba(37,99,235,0.08); }
.file-item .drag-handle { color: var(--accent2); cursor: grab; opacity: 0.7; flex-shrink: 0; display: flex; align-items: center; }
.file-item:hover .drag-handle { opacity: 1; }
.order-num {
  background: rgba(37,99,235,0.15); border: 1px solid rgba(37,99,235,0.3);
  color: var(--accent2); font-size: 0.7rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.file-item .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--muted); font-size: 0.75rem; white-space: nowrap; }
.file-item .remove-btn { background: none; border: none; color: #f87171; cursor: pointer; font-size: 0.9rem; padding: 0 0.15rem; flex-shrink: 0; }

/* PREVIEW */
.preview-box {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  margin-bottom: 1rem; text-align: center;
}
.preview-box img { max-width: 100%; max-height: 300px; border-radius: 8px; margin: 0 auto; display: block; }
.preview-info { display: flex; gap: 1rem; justify-content: center; margin-top: 0.75rem; flex-wrap: wrap; }
.preview-stat { text-align: center; }
.preview-stat .val { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--text); }
.preview-stat .lbl { font-size: 0.75rem; color: var(--muted); }

/* RELATED TOOLS */
.related-tools { margin-top: 2rem; }
.related-tools h3 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.8rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }
.related-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1rem;
  text-decoration: none; color: var(--text);
  transition: border-color 0.2s, background 0.2s;
  display: flex; align-items: center; gap: 0.75rem;
}
.related-card:hover { border-color: var(--accent); background: var(--card); }
.related-card .icon { font-size: 1.3rem; flex-shrink: 0; }
.related-card .info h4 { font-size: 0.85rem; font-weight: 600; margin-bottom: 0.1rem; }
.related-card .info p { font-size: 0.75rem; color: var(--muted); }

/* FAQ */
.faq-section { margin-top: 2.5rem; }
.faq-section h2 { font-family: 'Syne', sans-serif; font-size: 1.3rem; font-weight: 700; margin-bottom: 1rem; }
.faq-item { border-bottom: 1px solid var(--border); }
.faq-q {
  width: 100%; background: none; border: none; color: var(--text);
  text-align: left; padding: 1rem 0; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-family: 'DM Sans', sans-serif;
}
.faq-q:hover { color: var(--accent2); }
.faq-q .arrow { color: var(--muted); transition: transform 0.2s; font-size: 0.8rem; }
.faq-q.open .arrow { transform: rotate(180deg); }
.faq-a { color: var(--muted); font-size: 0.88rem; line-height: 1.65; padding-bottom: 1rem; display: none; }
.faq-a.open { display: block; }

/* INFO SECTION */
.info-section { margin-top: 2.5rem; }
.info-section h2 { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; margin-bottom: 0.6rem; }
.info-section p { color: var(--muted); font-size: 0.88rem; line-height: 1.7; margin-bottom: 1rem; }

/* AD OVERLAY */
.ad-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.88); z-index: 500;
  align-items: center; justify-content: center;
}
.ad-overlay.active { display: flex; }
.ad-overlay-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 2rem;
  text-align: center; max-width: 380px; width: 90%;
  animation: fadeUp 0.25s ease;
}
.ad-overlay-box h3 { font-family: 'Syne', sans-serif; font-size: 1.1rem; margin-bottom: 0.4rem; }
.ad-overlay-box p { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.ad-overlay-inner { margin: 1rem auto; min-height: 120px; background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.75rem; }
.countdown { font-size: 2.5rem; font-family: 'Syne', sans-serif; font-weight: 800; color: var(--accent2); margin-bottom: 1rem; }
.ad-note { font-size: 0.72rem; color: var(--muted); margin-top: 0.75rem; opacity: 0.7; }

/* FEATURES STRIP */
.features-strip {
  display: flex; gap: 0; border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  max-width: 1000px; margin: 0 auto 2rem; padding: 0 1.5rem;
}
.feature-item { flex: 1; padding: 1.5rem 1rem; text-align: center; border-right: 1px solid var(--border); }
.feature-item:last-child { border-right: none; }
.feature-icon { font-size: 1.5rem; margin-bottom: 0.5rem; }
.feature-item h4 { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; margin-bottom: 0.25rem; }
.feature-item p { color: var(--muted); font-size: 0.78rem; }

/* SEO TEXT SECTION */
.seo-section { max-width: 1000px; margin: 0 auto; padding: 0 1.5rem 3rem; display: flex; flex-direction: column; gap: 0; }
.seo-row { display: flex; align-items: flex-start; gap: 2rem; padding: 2rem 0; border-bottom: 1px solid var(--border); }
.seo-row:last-child { border-bottom: none; }
.seo-icon-box {
  flex-shrink: 0; width: 60px; height: 60px;
  background: rgba(37,99,235,0.1); border: 1px solid rgba(37,99,235,0.2);
  border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.75rem;
}
.seo-row h2 { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 0.4rem; color: var(--text); }
.seo-row p { color: var(--muted); font-size: 0.88rem; line-height: 1.65; margin: 0; }

/* FOOTER */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem; text-align: center;
  color: var(--muted); font-size: 0.82rem;
}
.footer-links { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin-top: 0.75rem; }
.footer-links a { color: var(--muted); text-decoration: none; padding: 0.2rem 0.5rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text); }

/* UNIT CONVERTER SPECIFIC */
.converter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.unit-input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.unit-input-group label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.unit-input-group input { width: 100%; }
.unit-sep { display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: var(--muted); }
.unit-tabs { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.unit-tab {
  padding: 0.4rem 0.9rem; border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  border: 1px solid var(--border); background: var(--bg3); color: var(--muted);
  cursor: pointer; transition: all 0.15s;
}
.unit-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.unit-tab:hover:not(.active) { border-color: var(--accent2); color: var(--accent2); }
.unit-table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: 0.85rem; }
.unit-table th { text-align: left; padding: 0.5rem 0.75rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
.unit-table td { padding: 0.6rem 0.75rem; border-bottom: 1px solid rgba(30,45,69,0.5); }
.unit-table tr:hover td { background: var(--bg3); }
.unit-table .val-col { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--accent2); }

/* QR SPECIFIC */
.qr-preview { text-align: center; padding: 1.5rem; }
.qr-preview canvas, .qr-preview svg { max-width: 220px; margin: 0 auto; display: block; border-radius: 8px; }
.qr-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.option-group { display: flex; flex-direction: column; gap: 0.4rem; }
.option-group label { font-size: 0.82rem; color: var(--muted); font-weight: 500; }
.color-input { display: flex; align-items: center; gap: 0.5rem; }
.color-input input[type="color"] { width: 40px; height: 36px; padding: 2px; border-radius: 6px; cursor: pointer; }

/* COLOR TOOLS SPECIFIC */
.color-display { height: 80px; border-radius: var(--radius); margin-bottom: 1rem; transition: background 0.2s; }
.color-values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.color-val-box { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; text-align: center; cursor: pointer; transition: border-color 0.2s; }
.color-val-box:hover { border-color: var(--accent2); }
.color-val-box .format { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.25rem; }
.color-val-box .value { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; }

/* PAGES GRID (PDF reorder) */
.pages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 0.5rem; margin-bottom: 1rem; max-height: 300px; overflow-y: auto; }
.page-thumb { background: var(--bg3); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem; text-align: center; cursor: grab; user-select: none; transition: border-color 0.15s, opacity 0.15s; }
.page-thumb.dragging { opacity: 0.4; border-color: var(--accent); }
.page-thumb.drag-target { border-color: var(--accent2); background: rgba(37,99,235,0.1); }
.page-thumb .page-num { font-family: 'Syne', sans-serif; font-weight: 700; color: var(--text); font-size: 1rem; }

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* RESPONSIVE */
@media (max-width: 900px) {
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .converter-grid { grid-template-columns: 1fr; }
  .qr-options { grid-template-columns: 1fr; }
  .color-values { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }
  .tools-grid { grid-template-columns: 1fr; }
  .categories { grid-template-columns: 1fr; }
  .features-strip { flex-direction: column; }
  .feature-item { border-right: none; border-bottom: 1px solid var(--border); }
  .seo-row { flex-direction: column; gap: 1rem; }
}

/* ── LIGHT MODE ── */
[data-theme="light"] {
  --bg: #f4f6fb; --bg2: #ffffff; --bg3: #eef1f8;
  --card: #ffffff; --border: #cbd5e1;
  --accent: #1d4ed8; --accent2: #2563eb;
  --accent-glow: rgba(37,99,235,0.08);
  --text: #0f172a; --muted: #475569;
}
[data-theme="light"] body::before { display: none; }
[data-theme="light"] nav { background: rgba(244,246,251,0.94); }
[data-theme="light"] .hero-glow { background: radial-gradient(ellipse, rgba(37,99,235,0.06) 0%, transparent 70%); }
[data-theme="light"] .tool-card, [data-theme="light"] .category-card, [data-theme="light"] .tool-box,
[data-theme="light"] .related-card, [data-theme="light"] .panel { background: #fff; }
[data-theme="light"] .ad-banner { background: #eef1f8; }
[data-theme="light"] input, [data-theme="light"] select, [data-theme="light"] textarea { background: #eef1f8; color: var(--text); }
[data-theme="light"] .unit-tab { background: #eef1f8; color: var(--muted); }
[data-theme="light"] .unit-tab.active { background: var(--accent); color: #fff; }
[data-theme="light"] .color-val-box, [data-theme="light"] .preview-stat { background: #eef1f8; }

/* ── THEME TOGGLE ── */
.theme-toggle {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); width: 36px; height: 36px;
  border-radius: 8px; cursor: pointer; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent2); color: var(--accent2); }

/* ── COOKIE BANNER ── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: var(--bg2); border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
  transform: translateY(100%); opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}

/* ── HAMBURGER NAV ── */
.nav-hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer; padding: 6px 8px;
  width: 36px; height: 36px; flex-shrink: 0;
}
.nav-hamburger span {
  display: block; width: 18px; height: 2px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s, width 0.2s;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; width: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 700px) {
  .nav-hamburger { display: flex; }
  .nav-links {
    display: none !important;
    position: fixed; top: 60px; left: 0; right: 0;
    background: var(--bg2); border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.5rem 1.25rem; flex-direction: column;
    gap: 0; z-index: 98;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  }
  .nav-links.open { display: flex !important; }
  .nav-links a {
    padding: 0.85rem 0; font-size: 1rem; border-bottom: 1px solid var(--border);
    width: 100%;
  }
  .nav-links a:last-child { border-bottom: none; }
}
