/* ============================================================
   ToolDeck — 100 Free Online Tools
   Design tokens & global styles
   ============================================================ */
:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #16181d;
  --muted: #5c6470;
  --border: #e4e7ec;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eaf1fe;
  --accent: #f59e0b;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 6px 20px -4px rgba(16, 24, 40, 0.1);
  --shadow-lg: 0 16px 40px -8px rgba(16, 24, 40, 0.16);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; background: var(--bg); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px; gap: 16px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo:hover .logo-mark { transform: rotate(-8deg) scale(1.08); }
.logo-mark svg { width: 18px; height: 18px; }

.main-nav { display: flex; gap: 4px; align-items: center; }
.main-nav a {
  color: var(--muted); font-size: 0.925rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); background: var(--primary-soft); text-decoration: none; }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; cursor: pointer; color: var(--text);
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 10px 16px 16px; box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; animation: slideDown 0.25s ease both; }
}

/* ---------- Hero ---------- */
.hero { padding: 72px 0 48px; text-align: center; position: relative; overflow: hidden; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary-soft); color: var(--primary-dark);
  font-size: 0.8rem; font-weight: 600; padding: 6px 14px;
  border-radius: 999px; margin-bottom: 20px;
  animation: fadeUp 0.6s ease both;
}
.hero h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.12;
  text-wrap: balance;
  animation: fadeUp 0.6s 0.08s ease both;
}
.hero h1 .accent-word { color: var(--primary); position: relative; display: inline-block; }
.hero p.lede {
  max-width: 620px; margin: 18px auto 0; color: var(--muted);
  font-size: 1.08rem; text-wrap: pretty;
  animation: fadeUp 0.6s 0.16s ease both;
}

/* Search */
.search-wrap {
  max-width: 560px; margin: 32px auto 0; position: relative;
  animation: fadeUp 0.6s 0.24s ease both;
}
.search-wrap svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--muted); pointer-events: none;
}
#tool-search {
  width: 100%; padding: 16px 20px 16px 50px;
  font-size: 1rem; font-family: var(--font);
  border: 1.5px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.25s;
}
#tool-search:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), var(--shadow-md);
}
.hero-stats {
  display: flex; justify-content: center; gap: 36px; margin-top: 36px;
  animation: fadeUp 0.6s 0.32s ease both; flex-wrap: wrap;
}
.hero-stats .stat { text-align: center; }
.hero-stats .stat b { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-stats .stat span { font-size: 0.82rem; color: var(--muted); }

/* ---------- Category filter pills ---------- */
.cat-bar {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 8px 0 32px;
}
.cat-pill {
  border: 1.5px solid var(--border); background: var(--surface);
  color: var(--muted); font-family: var(--font); font-size: 0.875rem; font-weight: 600;
  padding: 8px 18px; border-radius: 999px; cursor: pointer;
  transition: all 0.22s ease;
}
.cat-pill:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.cat-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Tool grid ---------- */
.section-title {
  font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em;
  margin: 40px 0 6px; display: flex; align-items: center; gap: 10px;
}
.section-title .count {
  font-size: 0.78rem; font-weight: 700; background: var(--primary-soft);
  color: var(--primary-dark); border-radius: 999px; padding: 3px 10px;
}
.section-sub { color: var(--muted); font-size: 0.95rem; margin-bottom: 20px; }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px; padding-bottom: 8px;
}
.tool-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  display: flex; flex-direction: column; gap: 10px;
  color: var(--text); position: relative; overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
/* scroll-reveal: main.js adds .reveal (hidden) then .revealed when in view */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
.reveal.revealed { opacity: 1; transform: translateY(0); }
.tool-card:hover {
  text-decoration: none; transform: translateY(-4px);
  box-shadow: var(--shadow-lg); border-color: var(--primary);
}
.tool-card:active { transform: translateY(-1px) scale(0.98); }
.tool-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.25s, color 0.25s;
}
.tool-icon svg { width: 21px; height: 21px; }
.tool-card:hover .tool-icon { transform: scale(1.12) rotate(-6deg); background: var(--primary); color: #fff; }
.tool-card h3 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
.tool-card p { font-size: 0.84rem; color: var(--muted); line-height: 1.5; }
.tool-card .cat-tag {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--primary); margin-top: auto;
}

.no-results { text-align: center; color: var(--muted); padding: 60px 0; display: none; }

/* ---------- Tool page ---------- */
.tool-page-head { padding: 44px 0 8px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }
.tool-page-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; letter-spacing: -0.025em;
  display: flex; align-items: center; gap: 14px;
  animation: fadeUp 0.5s ease both;
}
.tool-page-head h1 .tool-icon { width: 52px; height: 52px; flex-shrink: 0; }
.tool-page-head h1 .tool-icon svg { width: 26px; height: 26px; }
.tool-page-head .tool-desc { color: var(--muted); margin-top: 10px; max-width: 700px; animation: fadeUp 0.5s 0.08s ease both; }

.tool-panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; margin: 28px 0;
  box-shadow: var(--shadow-sm);
  animation: fadeUp 0.5s 0.14s ease both;
}
@media (max-width: 560px) { .tool-panel { padding: 18px; } }

.tool-about {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; margin-bottom: 40px;
}
.tool-about h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.tool-about p { color: var(--muted); font-size: 0.95rem; margin-bottom: 12px; }
.tool-about ul { color: var(--muted); font-size: 0.95rem; padding-left: 20px; }
.tool-about li { margin-bottom: 6px; }

/* ---------- Form elements ---------- */
label.field-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--text); }
textarea, input[type="text"], input[type="number"], input[type="date"], input[type="url"], input[type="email"], input[type="time"], select {
  width: 100%; padding: 12px 14px; font-family: var(--font); font-size: 0.95rem;
  border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--bg); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
textarea:focus, input:focus, select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
input[type="color"] { border: none; width: 56px; height: 44px; padding: 0; background: none; cursor: pointer; border-radius: 8px; }
input[type="range"] { width: 100%; accent-color: var(--primary); }
input[type="file"] { font-size: 0.9rem; }

.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 14px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 160px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 0.95rem; font-weight: 600;
  padding: 12px 22px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--primary); color: #fff;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  position: relative; overflow: hidden;
}
.btn:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.96); }
.btn.secondary { background: var(--surface); color: var(--text); border: 1.5px solid var(--border); }
.btn.secondary:hover { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }

/* Ripple click animation */
.btn .ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.45);
  transform: scale(0); animation: ripple 0.55s ease-out forwards; pointer-events: none;
}
.btn.secondary .ripple { background: rgba(37, 99, 235, 0.18); }
@keyframes ripple { to { transform: scale(3.5); opacity: 0; } }

.result-box {
  background: var(--bg); border: 1.5px dashed var(--border); border-radius: 10px;
  padding: 16px; margin-top: 18px; font-size: 0.95rem;
  min-height: 54px; word-break: break-word; white-space: pre-wrap;
}
.result-box.big { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
.result-box:empty::before { content: 'Result will appear here…'; color: var(--muted); font-style: italic; font-weight: 400; font-size: 0.9rem; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 18px; }
.stat-cell {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; text-align: center;
}
.stat-cell b { display: block; font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.stat-cell span { font-size: 0.78rem; color: var(--muted); }

.copy-feedback {
  display: inline-block; font-size: 0.82rem; color: #16a34a; font-weight: 600;
  opacity: 0; transition: opacity 0.25s; margin-left: 8px;
}
.copy-feedback.show { opacity: 1; }

.canvas-preview { max-width: 100%; border: 1px solid var(--border); border-radius: 10px; margin-top: 14px; }
.img-preview { max-width: 100%; max-height: 340px; border-radius: 10px; border: 1px solid var(--border); margin-top: 14px; object-fit: contain; }

.drop-zone {
  border: 2px dashed var(--border); border-radius: 14px; padding: 40px 20px;
  text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.drop-zone:hover, .drop-zone.drag { border-color: var(--primary); background: var(--primary-soft); }
.drop-zone svg { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--primary); }

.file-list { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px; font-size: 0.88rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px;
}
.file-item .size { color: var(--muted); margin-left: auto; font-size: 0.8rem; }

/* ---------- PDF tool extras ---------- */
.file-note { font-size: 0.85rem; color: var(--muted); margin: 12px 0 4px; word-break: break-word; }
.result-box.err { border-color: #dc2626; color: #b91c1c; background: #fef2f2; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 18px; }
.thumb-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.thumb-card img { width: 100%; border-radius: 6px; border: 1px solid var(--border); }
.thumb-card .btn { font-size: 0.8rem; padding: 8px 10px; text-align: center; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.info-item {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 4px;
}
.info-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 600; }
.info-value { font-size: 0.95rem; font-weight: 600; word-break: break-word; }

/* ---------- Related tools ---------- */
.related-wrap { margin-bottom: 48px; }
.related-wrap h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }

/* ---------- Static pages ---------- */
.page-content { max-width: 780px; margin: 0 auto; padding: 48px 0 72px; }
.page-content h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.page-content .updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 28px; }
.page-content h2 { font-size: 1.25rem; font-weight: 700; margin: 28px 0 10px; }
.page-content p, .page-content li { color: #3a4150; font-size: 0.98rem; margin-bottom: 12px; }
.page-content ul { padding-left: 22px; }

/* ---------- Footer ---------- */
.site-footer {
  background: #101623; color: #aab3c2; margin-top: 64px;
  padding: 48px 0 28px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { color: #fff; font-weight: 800; font-size: 1.15rem; display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.footer-brand .logo-mark { width: 30px; height: 30px; }
.footer-grid p { font-size: 0.88rem; line-height: 1.6; }
.footer-grid h4 { color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: #aab3c2; font-size: 0.88rem; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1); margin-top: 36px; padding-top: 22px;
  font-size: 0.82rem; text-align: center; color: #7b8494;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

/* Typing caret for hero */
.type-caret { display: inline-block; width: 3px; height: 0.9em; background: var(--primary); margin-left: 3px; vertical-align: -0.08em; animation: blink 0.9s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Category sections (homepage) ---------- */
.cat-section { padding-top: 8px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin: 40px 0 16px; }
.cat-icon {
  width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.cat-icon svg { width: 21px; height: 21px; }
.cat-head h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.cat-count {
  margin-left: auto; font-size: 0.78rem; font-weight: 700;
  background: var(--primary-soft); color: var(--primary-dark);
  border-radius: 999px; padding: 4px 12px; white-space: nowrap;
}
.tool-arrow {
  margin-top: auto; color: var(--primary); font-weight: 700;
  transition: transform 0.25s ease; align-self: flex-end;
}
.tool-card:hover .tool-arrow { transform: translateX(4px); }

/* ---------- Tool page structure ---------- */
.tool-page { padding-bottom: 40px; }
.tool-head { display: flex; align-items: center; gap: 14px; padding: 36px 0 6px; }
.tool-page-icon {
  width: 52px; height: 52px; border-radius: 12px; flex-shrink: 0;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.tool-page-icon svg { width: 26px; height: 26px; }
.tool-head h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; }
.related { margin: 40px 0 24px; }
.related h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }

/* ---------- Tool UI utilities ---------- */
.hint { color: var(--muted); font-size: 0.85rem; margin-top: 10px; }
.it-controls {
  display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin: 16px 0;
}
.opt { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; font-weight: 600; color: var(--text); }
.opt-row { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: center; margin: 14px 0; }
.input-sm { width: auto !important; min-width: 70px; padding: 8px 10px !important; font-size: 0.88rem !important; }
.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; }
.clip { max-height: 260px; overflow: auto; }
.pre { white-space: pre; overflow-x: auto; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
.tall { min-height: 220px; }
.wrap { flex-wrap: wrap; }

.canvas-holder { margin-top: 16px; display: flex; justify-content: center; }
.preview-canvas {
  max-width: 100%; height: auto; border: 1px solid var(--border);
  border-radius: 10px; box-shadow: var(--shadow-sm);
}
.file-remove {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 4px 6px; border-radius: 6px;
}
.file-remove:hover { color: #dc2626; background: #fee2e2; }
.page-card { margin-top: 18px; }
.dz-slot { margin-bottom: 4px; }

/* status lines used by PDF tools */
.tool-status { color: var(--muted); font-size: 0.88rem; margin-top: 12px; min-height: 1.2em; }
.tool-status.ok { color: #16a34a; font-weight: 600; }
.tool-status.err { color: #dc2626; font-weight: 600; }
.tool-stack { display: flex; flex-direction: column; gap: 4px; }
.tool-output { margin-top: 14px; font-family: ui-monospace, Menlo, monospace; font-size: 0.85rem; }
.file-drop {
  border: 2px dashed var(--border); border-radius: 14px; padding: 36px 20px;
  text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color 0.2s, background 0.2s; margin-bottom: 14px;
}
.file-drop:hover, .file-drop.drag { border-color: var(--primary); background: var(--primary-soft); }
.file-drop.has-file { border-color: var(--primary); }
.file-drop-icon svg { width: 36px; height: 36px; margin: 0 auto 10px; color: var(--primary); }
.file-drop-label { font-weight: 600; color: var(--text); }
.file-drop-hint { font-size: 0.82rem; margin-top: 4px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-small { font-size: 0.82rem; padding: 8px 14px; margin-top: 8px; }
.pdf-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 16px; }
.pdf-thumb { border: 1px solid var(--border); border-radius: 10px; padding: 10px; background: var(--bg); text-align: center; }
.pdf-thumb img { border-radius: 6px; border: 1px solid var(--border); margin-bottom: 4px; }

/* metadata display */
.meta-list, .hash-rows { display: flex; flex-direction: column; gap: 0; }
.meta-row, .hash-row {
  display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--border);
  font-size: 0.9rem; flex-wrap: wrap;
}
.meta-row:last-child, .hash-row:last-child { border-bottom: none; }
.meta-row dt, .hash-row dt { font-weight: 600; min-width: 110px; color: var(--muted); }
.meta-row dd, .hash-row dd { word-break: break-all; flex: 1; min-width: 180px; }

/* data tables */
.table-scroll { overflow-x: auto; margin-top: 14px; }
.data-table { border-collapse: collapse; width: 100%; font-size: 0.88rem; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.data-table th { background: var(--bg); font-weight: 700; }

/* progress meter */
.meter { height: 10px; border-radius: 999px; background: var(--border); overflow: hidden; margin-top: 12px; }
.meter-fill { height: 100%; border-radius: 999px; background: var(--primary); transition: width 0.35s ease, background 0.3s; }

/* ---------- Color tool utilities ---------- */
.swatch, .color-preview {
  border: 1px solid var(--border); border-radius: 10px; min-height: 64px;
  box-shadow: var(--shadow-sm);
}
.color-preview { margin-top: 14px; }
.palette-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.palette-row .swatch { flex: 1; min-width: 60px; height: 72px; cursor: pointer; transition: transform 0.2s; }
.palette-row .swatch:hover { transform: translateY(-3px); }
.shade-row { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.shade-col { flex: 1; min-width: 44px; text-align: center; font-size: 0.7rem; color: var(--muted); }
.shade-col .swatch { height: 52px; margin-bottom: 4px; cursor: pointer; }
.mix-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.mix-swatch { width: 56px; height: 56px; border-radius: 10px; border: 1px solid var(--border); }
.contrast-demo { border-radius: 10px; padding: 18px; margin-top: 14px; font-weight: 600; border: 1px solid var(--border); }
.cb-grid, .name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.cb-cell, .name-cell {
  border: 1px solid var(--border); border-radius: 10px; padding: 10px;
  font-size: 0.8rem; text-align: center; background: var(--surface);
}
.cb-sw, .name-sw { height: 48px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--border); }

/* ---------- Generator tool utilities ---------- */
.qr-holder { display: flex; justify-content: center; padding: 20px 0 6px; }
.qr-holder img, .qr-holder canvas { border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fff; }
.flip-stage { text-align: center; padding: 26px 0 8px; }
.flip-result { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.md-preview { border: 1px solid var(--border); border-radius: 10px; padding: 18px; margin-top: 14px; background: var(--surface); }
.md-preview h1, .md-preview h2, .md-preview h3 { margin: 12px 0 6px; }
.md-preview p { margin-bottom: 10px; }
.md-preview code { background: var(--bg); border-radius: 4px; padding: 2px 6px; font-size: 0.85em; }
.md-preview pre { background: var(--bg); border-radius: 8px; padding: 12px; overflow-x: auto; margin-bottom: 10px; }
.md-preview blockquote { border-left: 3px solid var(--primary); padding-left: 12px; color: var(--muted); margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
