/* ============================================
   FreeTools24x7 — Shared Stylesheet
   Brand: Emerald/Teal · No indigo/blue
   ============================================ */

/* ===== CSS Variables / Theme ===== */
:root {
  --radius: 0.75rem;
  --bg: #f7fdfa;
  --fg: #1a2520;
  --card: #ffffff;
  --card-fg: #1a2520;
  --muted: #f0f7f4;
  --muted-fg: #5a6b65;
  --border: #d8e8e0;
  --primary: #0d9488;
  --primary-fg: #ffffff;
  --primary-hover: #0f766e;
  --primary-light: #ccfbf1;
  --secondary: #e6f4f0;
  --secondary-fg: #1a2520;
  --accent: #d1fae5;
  --accent-fg: #064e3b;
  --destructive: #dc2626;
  --destructive-light: #fee2e2;
  --amber: #f59e0b;
  --amber-light: #fef3c7;
  --ring: #0d9488;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;
}

[data-theme="dark"] {
  --bg: #0f1a16;
  --fg: #e8f5ef;
  --card: #1a2a24;
  --card-fg: #e8f5ef;
  --muted: #16221d;
  --muted-fg: #8aa39a;
  --border: #2a3a33;
  --primary: #14b8a6;
  --primary-fg: #0f1a16;
  --primary-hover: #2dd4bf;
  --primary-light: #134e4a;
  --secondary: #1f2e28;
  --secondary-fg: #e8f5ef;
  --accent: #1a3a30;
  --accent-fg: #6ee7b7;
  --destructive: #ef4444;
  --destructive-light: #450a0a;
  --amber: #f59e0b;
  --amber-light: #451a03;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-md: 0 4px 6px rgba(0,0,0,.25);
  --shadow-lg: 0 10px 15px rgba(0,0,0,.3);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, color 0.2s;
  /* Anti-scrape: disable text selection outside tool areas */
  -webkit-user-select: none;
  user-select: none;
}
/* Re-enable selection where users need it (tool outputs, inputs) */
input, textarea, select, [contenteditable="true"],
.card, .tool-content, pre, code, .file-chip-name {
  -webkit-user-select: text;
  user-select: text;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ===== Anti-scrape: no image dragging ===== */
img { -webkit-user-drag: none; user-drag: none; }

/* ===== Brand gradient ===== */
.brand-gradient {
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 50%, #059669 100%);
}
.brand-gradient-text {
  background: linear-gradient(135deg, #0d9488, #0f766e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }

main { flex: 1; }

/* ===== Header ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 4rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  flex-shrink: 0;
}
.logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
}
.logo-icon svg { width: 1.25rem; height: 1.25rem; }
.logo-img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Search */
.search-box {
  position: relative;
  flex: 1;
  max-width: 28rem;
  margin-left: 0.5rem;
}
.search-box svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1rem;
  height: 1rem;
  color: var(--muted-fg);
}
.search-input {
  width: 100%;
  height: 2.25rem;
  padding: 0 0.75rem 0 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }

/* Theme toggle */
.theme-toggle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-fg);
  transition: background 0.2s, color 0.2s;
}
.theme-toggle:hover { background: var(--muted); color: var(--fg); }
.theme-toggle svg { width: 1rem; height: 1rem; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
  border: 1px solid transparent;
  min-height: 2.25rem;
}
.btn svg { width: 1rem; height: 1rem; }
.btn-primary {
  background: var(--primary);
  color: var(--primary-fg);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--fg);
}
.btn-outline:hover { background: var(--muted); }
.btn-ghost {
  background: transparent;
  color: var(--muted-fg);
}
.btn-ghost:hover { background: var(--muted); color: var(--fg); }
.btn-danger {
  background: var(--destructive);
  color: white;
}
.btn-danger:hover { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 0.25rem 0.75rem; min-height: 2rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; min-height: 2.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* ===== Cards ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
@media (min-width: 640px) { .card { padding: 1.75rem; } }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
  min-height: 2.25rem;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--primary); }
.form-textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
.form-select { cursor: pointer; }
.form-hint { font-size: 0.75rem; color: var(--muted-fg); margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: var(--destructive); margin-top: 0.25rem; }

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 0.375rem;
  background: var(--border);
  border-radius: 9999px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
input[type="range"]::-moz-range-thumb {
  width: 1.25rem;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid white;
}

/* Checkbox/Switch */
.switch { position: relative; display: inline-block; width: 2.75rem; height: 1.5rem; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0;
  background: var(--border);
  border-radius: 9999px;
  transition: 0.2s;
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 1.125rem; height: 1.125rem;
  left: 0.1875rem; top: 0.1875rem;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(1.25rem); }

/* Color input */
input[type="color"] {
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  cursor: pointer;
  background: var(--card);
  padding: 2px;
}

/* ===== Dropzone ===== */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--muted);
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--muted));
}
.dropzone-icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  transition: transform 0.2s;
}
.dropzone:hover .dropzone-icon { transform: scale(1.1); }
.dropzone-icon svg { width: 1.75rem; height: 1.75rem; }
.dropzone-label { font-size: 0.875rem; font-weight: 500; }
.dropzone-hint { font-size: 0.75rem; color: var(--muted-fg); margin-top: 0.25rem; }

/* ===== File chip ===== */
.file-chip {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
}
.file-chip-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.375rem;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.file-chip-info { flex: 1; min-width: 0; }
.file-chip-name {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-chip-size { font-size: 0.6875rem; color: var(--muted-fg); }
.file-chip-remove {
  padding: 0.25rem;
  color: var(--muted-fg);
  border-radius: 0.25rem;
  transition: all 0.15s;
}
.file-chip-remove:hover { background: var(--destructive-light); color: var(--destructive); }

/* ===== Badge ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--secondary);
  color: var(--secondary-fg);
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: var(--amber-light); color: #92400e; }
.badge-danger { background: var(--destructive-light); color: var(--destructive); }

/* ===== Progress bar ===== */
.progress {
  width: 100%;
  height: 0.5rem;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
  transition: width 0.3s;
}

/* ===== Alert/Note ===== */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
}
.alert svg { width: 1rem; height: 1rem; flex-shrink: 0; margin-top: 0.125rem; }
.alert-info { background: var(--primary-light); color: var(--accent-fg); }
.alert-warning { background: var(--amber-light); color: #92400e; }
.alert-error { background: var(--destructive-light); color: var(--destructive); }
.alert-success { background: #d1fae5; color: #065f46; }

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}
.toast {
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toast-in 0.3s ease-out;
  pointer-events: auto;
  max-width: 90vw;
}
.toast-success { border-left: 3px solid #10b981; }
.toast-error { border-left: 3px solid var(--destructive); }
.toast-info { border-left: 3px solid var(--primary); }
.toast svg { width: 1rem; height: 1rem; flex-shrink: 0; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  overflow-x: auto;
}
.tab {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== Tool page layout ===== */
.tool-page { padding: 1.5rem 1rem 4rem; }
@media (min-width: 640px) { .tool-page { padding: 1.5rem 1.5rem 4rem; } }
.tool-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}
.tool-icon {
  width: 3.5rem; height: 3.5rem;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tool-icon svg { width: 1.75rem; height: 1.75rem; }
.tool-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }
@media (min-width: 640px) { .tool-title { font-size: 1.875rem; } }
.tool-desc { color: var(--muted-fg); font-size: 0.875rem; margin-top: 0.25rem; }
.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--muted-fg);
  font-size: 0.8125rem;
  margin-bottom: 1.5rem;
  transition: color 0.15s;
}
.tool-back:hover { color: var(--fg); }
.tool-back svg { width: 1rem; height: 1rem; }

/* ===== Home page ===== */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0;
  text-align: center;
}
@media (min-width: 640px) { .hero { padding: 3.5rem 0; } }
.hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(13,148,136,.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(13,148,136,.04) 1px, transparent 1px);
  background-size: 32px 32px;
}
.tool-seo {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  line-height: 1.7;
}
.tool-seo h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}
.tool-seo h2:first-child { margin-top: 0; }
.tool-seo p {
  color: var(--muted-fg);
  margin-bottom: 0.75rem;
  font-size: 0.9375rem;
}
.tool-seo ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.25rem;
  color: var(--muted-fg);
  font-size: 0.9375rem;
}
.tool-seo li { margin-bottom: 0.35rem; }
.tool-seo .faq-item {
  border-top: 1px solid var(--border);
  padding: 0.75rem 0;
}
.tool-seo .faq-item:first-of-type { border-top: none; }
.tool-seo .faq-q {
  font-weight: 600;
  color: var(--fg);
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
}
.tool-seo .faq-a {
  color: var(--muted-fg);
  font-size: 0.875rem;
  margin: 0;
}
.tool-seo .related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.tool-seo .related-links a {
  font-size: 0.8125rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  color: var(--primary);
  text-decoration: none;
}
.tool-seo .related-links a:hover {
  background: rgba(13,148,136,.08);
  border-color: var(--primary);
}
.hero-blob {
  position: absolute;
  top: -6rem; left: 50%;
  width: 42rem; height: 18rem;
  transform: translateX(-50%);
  background: rgba(13,148,136,.15);
  border-radius: 50%;
  filter: blur(60px);
}
.hero-content { position: relative; max-width: 48rem; margin: 0 auto; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(13,148,136,.3);
  background: rgba(13,148,136,.05);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1.25rem;
}
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
@media (min-width: 640px) { .hero-title { font-size: 3rem; } }
@media (min-width: 1024px) { .hero-title { font-size: 3.75rem; } }
.hero-subtitle {
  max-width: 36rem;
  margin: 1.25rem auto 0;
  font-size: 1rem;
  color: var(--muted-fg);
}
@media (min-width: 640px) { .hero-subtitle { font-size: 1.125rem; } }
.hero-search {
  position: relative;
  max-width: 28rem;
  margin: 2rem auto 0;
}
.hero-search svg {
  position: absolute;
  left: 1rem; top: 50%;
  transform: translateY(-50%);
  width: 1.25rem; height: 1.25rem;
  color: var(--muted-fg);
}
.hero-search input {
  width: 100%;
  height: 3rem;
  padding: 0 1rem 0 3rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 1rem;
  outline: none;
}
.hero-search input:focus { border-color: var(--primary); }
.hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.75rem;
  color: var(--muted-fg);
}
.hero-features span { display: flex; align-items: center; gap: 0.375rem; }
.hero-features svg { width: 1rem; height: 1rem; color: var(--primary); }

/* Stats */
.stats {
  border-bottom: 1px solid var(--border);
  background: var(--muted);
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 1.5rem 0.5rem; text-align: center; }
.stat-num { font-size: 1.875rem; font-weight: 800; }
@media (min-width: 640px) { .stat-num { font-size: 2.25rem; } }
.stat-label { font-size: 0.75rem; color: var(--muted-fg); margin-top: 0.25rem; }
@media (min-width: 640px) { .stat-label { font-size: 0.875rem; } }

/* Category section */
.category-section { margin-bottom: 3.5rem; }
.category-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.category-title-wrap { display: flex; align-items: center; gap: 0.75rem; }
.category-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.category-icon svg { width: 1.25rem; height: 1.25rem; }
.category-title { font-size: 1.25rem; font-weight: 700; }
@media (min-width: 640px) { .category-title { font-size: 1.5rem; } }
.category-desc { font-size: 0.8125rem; color: var(--muted-fg); }

/* Tool grid */
.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 640px) { .tool-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .tool-grid { grid-template-columns: repeat(4, 1fr); } }

.tool-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: all 0.2s;
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: rgba(13,148,136,.4);
  box-shadow: var(--shadow-md);
}
.tool-card-icon {
  width: 2.75rem; height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}
.tool-card:hover .tool-card-icon { transform: scale(1.1); }
.tool-card-icon svg { width: 1.25rem; height: 1.25rem; }
.tool-card-info { flex: 1; min-width: 0; }
.tool-card-name { font-size: 0.8125rem; font-weight: 600; }
.tool-card-desc {
  font-size: 0.6875rem;
  color: var(--muted-fg);
  margin-top: 0.125rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--muted);
  padding: 2.5rem 0;
}
.footer-grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: 2fr 3fr; } }
.footer-brand { font-size: 1.125rem; font-weight: 800; }
.footer-desc { font-size: 0.8125rem; color: var(--muted-fg); margin-top: 0.75rem; max-width: 24rem; }
.footer-cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem 1.5rem; }
.footer-cat-link { font-size: 0.8125rem; color: var(--muted-fg); transition: color 0.15s; cursor: pointer; }
.footer-cat-link:hover { color: var(--primary); }
.footer-bottom {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--muted-fg);
}
@media (min-width: 640px) { .footer-bottom { flex-direction: row; } }

/* Category color classes */
.cat-pdf { background: #fee2e2; color: #dc2626; }
[data-theme="dark"] .cat-pdf { background: rgba(220,38,38,.15); color: #f87171; }
.cat-image { background: #d1fae5; color: #059669; }
[data-theme="dark"] .cat-image { background: rgba(5,150,105,.15); color: #34d399; }
.cat-convert { background: #fef3c7; color: #d97706; }
[data-theme="dark"] .cat-convert { background: rgba(217,119,6,.15); color: #fbbf24; }
.cat-qr { background: #ede9fe; color: #7c3aed; }
[data-theme="dark"] .cat-qr { background: rgba(124,58,237,.15); color: #a78bfa; }
.cat-archive { background: #ffedd5; color: #ea580c; }
[data-theme="dark"] .cat-archive { background: rgba(234,88,12,.15); color: #fb923c; }
.cat-text { background: #ccfbf1; color: #0d9488; }
[data-theme="dark"] .cat-text { background: rgba(13,148,136,.15); color: #2dd4bf; }
.cat-calc { background: #fce7f3; color: #db2777; }
[data-theme="dark"] .cat-calc { background: rgba(219,39,119,.15); color: #f472b6; }
.cat-video { background: #fae8ff; color: #c026d3; }
[data-theme="dark"] .cat-video { background: rgba(192,38,211,.15); color: #e879f9; }

/* ===== Utilities ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.grid { display: grid; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 640px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--muted-fg); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.hidden { display: none; }
.relative { position: relative; }
.overflow-auto { overflow: auto; }
.max-h-96 { max-height: 24rem; }
.cursor-pointer { cursor: pointer; }
.rounded { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Scrollbar */
.scrollbar-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scrollbar-thin::-webkit-scrollbar-track { background: transparent; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(13,148,136,.3); border-radius: 9999px; }
.scrollbar-thin::-webkit-scrollbar-thumb:hover { background: rgba(13,148,136,.5); }

/* Result area */
.result-area {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--muted);
}

/* Cute QR frame */
.cute-qr-box {
  background: #fff;
  border-radius: 1rem;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.14), 0 2px 8px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(13, 148, 136, 0.1);
  min-height: 200px;
  min-width: 200px;
  line-height: 0;
}
.cute-qr-box canvas,
.cute-qr-box img {
  display: block;
  border-radius: 0.65rem;
  max-width: 100%;
  height: auto;
}
.cute-qr-box > div {
  line-height: 0;
  border-radius: 0.65rem;
  overflow: hidden;
}
[data-theme="dark"] .cute-qr-box {
  background: #ffffff;
  border-color: rgba(45, 212, 191, 0.18);
  box-shadow: 0 10px 28px rgba(13, 148, 136, 0.22), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.result-img {
  max-width: 100%;
  border-radius: 0.5rem;
  box-shadow: var(--shadow);
}
.result-list {
  max-height: 24rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--card);
}
.result-thumb {
  width: 3rem; height: 3rem;
  border-radius: 0.375rem;
  object-fit: cover;
  flex-shrink: 0;
}

/* Spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 2.5rem; height: 2.5rem; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Fade in animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.4s ease-out both; }

/* Privacy note */
.privacy-note {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}
.privacy-note svg { width: 0.875rem; height: 0.875rem; color: var(--primary); }

/* Dashboard grid: JS sets grid-template-columns inline at load (1 col if innerWidth < 640).
   Force 1 col on narrow viewports so desktop->mobile resize never overflows. */
@media (max-width: 639.98px) {
  #dashboard-grid { grid-template-columns: 1fr !important; }
}

/* ===== Mobile phone refinements (audit fixes) ===== */
@media (max-width: 389.98px) {
  .logo-text { font-size: 0.95rem; }
  .header-inner { gap: 0.5rem; }
  .btn-ghost.btn-sm { padding: 0.3rem 0.5rem; font-size: 0.75rem; }
}
@media (max-width: 359.98px) {
  .logo-text { display: none; }
}
@media (max-width: 639.98px) {
  .theme-toggle { width: 2.75rem; height: 2.75rem; }
  .btn-sm { min-height: 2.5rem; }
  .tool-back { min-height: 2.5rem; padding: 0.5rem 0; align-items: center; }
  .footer-cat-link { display: inline-block; padding: 0.45rem 0; }
  .footer-bottom a { display: inline-block; padding: 0.5rem 0; }
}