:root {
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #fbfbfe;
  --text: #14181f;
  --muted: #5f6b7d;
  --muted-2: #8993a4;
  --border: #e6e9f0;
  --border-2: #eef0f5;
  --brand: #4338ca;
  --brand-2: #6d28d9;
  --brand-ink: #312e81;
  --accent: #4338ca;
  --accent-soft: #eef0fe;
  --accent-soft-2: #f3effc;
  --star: #f59e0b;
  --success: #0f9d58;
  --success-soft: #e6f7ee;
  --warn: #b45309;
  --warn-soft: #fef3e2;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06);
  --shadow: 0 4px 16px rgba(20, 24, 45, .08);
  --shadow-lg: 0 16px 40px rgba(20, 24, 45, .14);
  --font-display: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --header-h: 64px;
  --container: 1320px;
}
:root[data-theme="dark"] {
  --bg: #0b0d14;
  --surface: #12151f;
  --surface-2: #161a26;
  --text: #eef1f6;
  --muted: #98a2b8;
  --muted-2: #6b7488;
  --border: #232838;
  --border-2: #1c2130;
  --brand: #8180f5;
  --brand-2: #a78bfa;
  --brand-ink: #c7c5ff;
  --accent: #8180f5;
  --accent-soft: #1c1f3a;
  --accent-soft-2: #221d3a;
  --success: #34d399;
  --success-soft: #0f2a20;
  --warn: #fbbf24;
  --warn-soft: #2c2211;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 4px 20px rgba(0, 0, 0, .4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d14;
    --surface: #12151f;
    --surface-2: #161a26;
    --text: #eef1f6;
    --muted: #98a2b8;
    --muted-2: #6b7488;
    --border: #232838;
    --border-2: #1c2130;
    --brand: #8180f5;
    --brand-2: #a78bfa;
    --brand-ink: #c7c5ff;
    --accent: #8180f5;
    --accent-soft: #1c1f3a;
    --accent-soft-2: #221d3a;
    --success: #34d399;
    --success-soft: #0f2a20;
    --warn: #fbbf24;
    --warn-soft: #2c2211;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 4px 20px rgba(0, 0, 0, .4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-display);
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, h4 { letter-spacing: -0.01em; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 200;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-top {
  display: none;
  background: var(--brand-ink); color: #fff; font-size: .78rem; text-align: center;
  padding: 6px 12px;
}
.header-top strong { font-weight: 700; }
.header-inner {
  max-width: var(--container); margin: 0 auto; padding: 0 20px;
  height: var(--header-h);
  display: flex; align-items: center; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 9px; font-size: 1.2rem; font-weight: 800; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 1.05rem; color: #fff;
  box-shadow: 0 3px 10px rgba(67, 56, 202, .35);
}
.logo em { color: var(--brand); font-style: normal; }

/* Featured categories, left of the bar; margin-right:auto pushes favorites + search to the right */
.main-nav { display: flex; align-items: center; gap: 2px; margin-right: auto; min-width: 0; }
.nav-cat-wrap { position: relative; flex-shrink: 0; }
.nav-cat {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 9px; font-weight: 600; font-size: .9rem;
  color: var(--text); white-space: nowrap;
}
.nav-cat .nc-icon { font-size: 1rem; }
.nav-cat .nc-caret { font-size: .58em; opacity: .5; margin-left: 1px; transition: transform .15s; }
.nav-cat:hover, .nav-cat.active,
.nav-cat-wrap:hover .nav-cat { background: var(--accent-soft); color: var(--accent); }
.nav-cat-wrap:hover .nc-caret { transform: rotate(180deg); opacity: .9; }

/* Per-category mega dropdown */
.mega-panel { position: absolute; top: 100%; left: 0; padding-top: 9px; display: none; z-index: 220; }
.mega-panel.mega-panel--right { left: auto; right: 0; }
.nav-cat-wrap:hover .mega-panel { display: block; }
.mega-inner {
  width: 480px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: 18px 20px;
}
.mega-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 24px; }
.mega-inner h4 { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 9px; }
.mega-subs a { display: block; padding: 6px 9px; border-radius: 8px; font-size: .88rem; font-weight: 500; color: var(--text); }
.mega-subs a:hover { background: var(--accent-soft); color: var(--accent); }
.mega-pop a { display: flex; align-items: center; gap: 9px; padding: 5px 8px; border-radius: 8px; font-size: .85rem; color: var(--text); }
.mega-pop a .mp-ic { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); display: grid; place-items: center; font-size: .9rem; flex-shrink: 0; }
.mega-pop a:hover { background: var(--accent-soft); color: var(--accent); }
.mega-viewall { display: inline-block; margin-top: 14px; font-size: .84rem; font-weight: 700; color: var(--accent); }

/* Favorites — second-to-last */
.nav-fav {
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 9px 14px; border-radius: 9px; font-weight: 600; font-size: .9rem;
  color: var(--text); white-space: nowrap; letter-spacing: .01em;
}
.nav-fav:hover { background: var(--accent-soft); color: var(--accent); }

/* Compact search — last item on the bar */
.search-wrap { position: relative; width: 210px; flex-shrink: 0; }
#global-search {
  width: 100%; padding: 8px 14px 8px 34px; font-size: .88rem;
  border: 1.5px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text); outline: none;
}
.search-wrap::before {
  content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: .78rem; opacity: .55; pointer-events: none;
}
#global-search:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-results {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(340px, 80vw);
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 60vh; overflow-y: auto; z-index: 210;
}
.search-results a {
  display: flex; gap: 10px; align-items: center;
  padding: 10px 14px; color: var(--text); border-bottom: 1px solid var(--border-2);
}
.search-results a:last-child { border-bottom: none; }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results .sr-cat { margin-left: auto; font-size: .72rem; color: var(--muted-2); white-space: nowrap; }
.search-results .sr-empty { padding: 14px; color: var(--muted); }

/* ---------- Layout ---------- */
.layout { max-width: var(--container); margin: 0 auto; display: flex; gap: 0; align-items: flex-start; }
.sidebar {
  width: 250px; flex-shrink: 0; padding: 22px 10px 40px 20px;
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.sidebar a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 9px; color: var(--text); font-size: .87rem; font-weight: 500;
}
.sidebar a:hover { background: var(--accent-soft); }
.sidebar a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sidebar .count { margin-left: auto; font-size: .72rem; color: var(--muted-2); }
.main { flex: 1; padding: 26px 24px 60px; min-width: 0; }
.content-col { display: flex; gap: 28px; align-items: flex-start; max-width: 100%; }
.content-col > .content-primary { flex: 1; min-width: 0; }
.content-col > .content-rail { width: 300px; flex-shrink: 0; }

/* ---------- Trust badges ---------- */
.trust-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.trust-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.trust-badge .tb-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

/* ---------- Hero ---------- */
.hero-wrap {
  position: relative; overflow: hidden; border-radius: 22px; margin: 18px 0 8px;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--surface) 55%);
  border: 1px solid var(--border);
}
.hero { position: relative; text-align: center; padding: 56px 24px 40px; z-index: 1; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--brand);
  font-size: .78rem; font-weight: 700; padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-size: clamp(1.9rem, 4.4vw, 3.1rem); font-weight: 800; line-height: 1.12; margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }
.hero-illustration { position: absolute; inset: 0; pointer-events: none; opacity: .9; }
.hero-stats { display: flex; justify-content: center; gap: 34px; margin-top: 30px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats .stat { text-align: center; }
.hero-stats .stat b { display: block; font-size: 1.5rem; font-weight: 800; color: var(--brand); }
.hero-stats .stat span { font-size: .78rem; color: var(--muted); }

.section-title {
  font-size: 1.2rem; font-weight: 800; margin: 40px 0 16px;
  display: flex; align-items: center; gap: 9px; letter-spacing: -0.01em;
}
.section-title .st-sub { font-size: .8rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.section-sub { color: var(--muted); margin-top: -10px; margin-bottom: 18px; font-size: .92rem; max-width: 640px; }

/* ---------- How it works ---------- */
.how-it-works { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin: 18px 0 8px; }
.hiw-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.hiw-num {
  width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--brand); font-weight: 800; display: grid; place-items: center;
}
.hiw-card h3 { font-size: .95rem; margin-bottom: 5px; }
.hiw-card p { font-size: .82rem; color: var(--muted); }

/* ---------- Cards ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 13px; }
.tool-card {
  position: relative; display: block; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 15px 13px; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.tool-card .tc-icon {
  width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 1.25rem; margin-bottom: 10px;
}
.tool-card h3 { font-size: .96rem; font-weight: 700; margin: 0 0 4px; padding-right: 22px; line-height: 1.3; }
.tool-card p { font-size: .8rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tool-card .badge-soon {
  display: inline-block; margin-top: 9px; font-size: .66rem; font-weight: 700;
  color: var(--warn); background: var(--warn-soft); border-radius: 999px; padding: 2px 9px;
}
.fav-btn {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  font-size: 1.1rem; color: var(--border); line-height: 1; z-index: 2;
}
.fav-btn:hover { color: var(--star); }
.fav-btn.faved { color: var(--star); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 13px; }
.cat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 16px; text-align: center; color: var(--text); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.cat-tile:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); box-shadow: var(--shadow); }
.cat-tile .ct-icon {
  width: 52px; height: 52px; margin: 0 auto; border-radius: 14px; font-size: 1.7rem;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-soft-2));
  display: grid; place-items: center;
}
.cat-tile h3 { font-size: .95rem; font-weight: 700; margin-top: 11px; }
.cat-tile p { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ---------- Category page ---------- */
.breadcrumb { font-size: .83rem; color: var(--muted); margin-bottom: 16px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: .5; }
.page-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.page-head .ph-icon {
  width: 46px; height: 46px; border-radius: 13px; font-size: 1.5rem;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-soft-2));
  display: grid; place-items: center; flex-shrink: 0;
}
.page-head h1 { font-size: 1.5rem; font-weight: 800; }
.page-head small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.subcat-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 22px; }
.subcat-tabs button {
  padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: .84rem; font-weight: 600;
}
.subcat-tabs button.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.subcat-tabs button:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ---------- Tool page ---------- */
.tool-page-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.tool-page-head .tp-icon {
  width: 42px; height: 42px; border-radius: 12px; font-size: 1.35rem; flex-shrink: 0;
  background: linear-gradient(150deg, var(--accent-soft), var(--accent-soft-2));
  display: grid; place-items: center; margin-top: 2px;
}
.tool-page-head h1 { font-size: 1.5rem; font-weight: 800; flex: 1; }
.tool-page-head .fav-btn { position: static; font-size: 1.5rem; }
.tool-desc { color: var(--muted); margin-bottom: 22px; max-width: 720px; font-size: .96rem; }
.tool-container {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 24px; box-shadow: var(--shadow);
}
.tool-meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.tool-meta-row .trust-badge { font-size: .74rem; padding: 4px 11px; }
.coming-soon { text-align: center; padding: 54px 20px; }
.coming-soon .cs-icon { font-size: 3rem; }
.coming-soon p { color: var(--muted); max-width: 480px; margin: 10px auto 0; }

/* ---------- SEO content block ---------- */
.seo-content { margin-top: 40px; }
.seo-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px 26px; margin-bottom: 18px;
}
.seo-block h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 12px; letter-spacing: -0.01em; }
.seo-block p { color: var(--muted); font-size: .93rem; max-width: 800px; }
.seo-block p + p { margin-top: 10px; }
.steps-list { counter-reset: step; list-style: none; margin-top: 6px; }
.steps-list li {
  counter-increment: step; position: relative; padding: 10px 0 10px 42px; font-size: .92rem;
  border-bottom: 1px solid var(--border-2);
}
.steps-list li:last-child { border-bottom: none; }
.steps-list li::before {
  content: counter(step); position: absolute; left: 0; top: 8px;
  width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--brand);
  font-weight: 800; font-size: .8rem; display: grid; place-items: center;
}
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 6px; }
.benefit-item { display: flex; gap: 11px; align-items: flex-start; }
.benefit-item .bi-icon {
  width: 30px; height: 30px; border-radius: 9px; background: var(--success-soft); color: var(--success);
  display: grid; place-items: center; flex-shrink: 0; font-size: .95rem;
}
.benefit-item h4 { font-size: .87rem; font-weight: 700; margin-bottom: 2px; }
.benefit-item p { font-size: .8rem; margin: 0; }

.faq-item { border-bottom: 1px solid var(--border-2); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  width: 100%; text-align: left; background: none; border: none; padding: 14px 2px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-weight: 700; font-size: .92rem; color: var(--text);
}
.faq-q .faq-arrow { transition: transform .18s; color: var(--muted-2); flex-shrink: 0; }
.faq-item.open .faq-q .faq-arrow { transform: rotate(180deg); color: var(--accent); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .2s ease; }
.faq-item.open .faq-a { max-height: 400px; }
.faq-a p { padding: 0 2px 14px; color: var(--muted); font-size: .89rem; }

.pro-tip {
  display: flex; gap: 10px; align-items: flex-start; background: var(--accent-soft);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-top: 14px; font-size: .87rem;
}
.pro-tip .pt-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ---------- Related tools ---------- */
.related { margin-top: 34px; }
.related-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.related-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px 7px 9px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  font-size: .84rem; font-weight: 600; color: var(--text);
}
.related-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.related-chip .rc-icon { font-size: .95rem; }

/* ---------- Ad slots (inert until AdSense is enabled — see js/ads.js) ---------- */
.ad-slot { display: none; }
.ad-slot.ad-active {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  margin: 22px auto; overflow: hidden; background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.ad-slot .ad-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); padding-top: 6px; }
.ad-slot--leaderboard { min-height: 100px; max-width: 970px; }
.ad-slot--incontent { min-height: 100px; }
.ad-slot--rail { min-height: 250px; position: sticky; top: calc(var(--header-h) + 16px); }

/* ---------- Empty states / illustrations ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .es-icon { font-size: 3rem; }
.empty-state svg { width: 160px; height: auto; margin: 0 auto 18px; opacity: .9; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; background: var(--surface); }
.footer-inner { max-width: var(--container); margin: 0 auto; padding: 40px 24px 26px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: 26px; }
.footer-brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.footer-col h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 12px; }
.footer-col a { display: block; font-size: .85rem; color: var(--muted); padding: 4px 0; }
.footer-col a:hover { color: var(--accent); }
.footer-desc { font-size: .85rem; color: var(--muted); max-width: 300px; }
.footer-bottom {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: .8rem; color: var(--muted-2);
}
.footer-bottom .trust-row { justify-content: flex-end; margin-top: 0; }

/* ---------- Tool UI primitives (used by tool modules) ---------- */
.t-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.t-field { flex: 1; min-width: 160px; }
.t-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: 5px; }
.t-input, .t-select, .t-textarea {
  width: 100%; padding: 9px 12px; font: inherit; font-size: .95rem;
  border: 1.5px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text); outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.t-input:focus, .t-select:focus, .t-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.t-textarea { min-height: 160px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.t-btn {
  padding: 9px 20px; border-radius: 9px; border: none;
  background: var(--brand); color: #fff; font-weight: 700; font-size: .92rem;
  box-shadow: 0 2px 8px rgba(67, 56, 202, .25);
}
.t-btn:hover { filter: brightness(1.08); }
.t-btn.secondary { background: var(--accent-soft); color: var(--brand); box-shadow: none; }
.t-result {
  margin-top: 16px; padding: 16px; border-radius: 11px;
  background: var(--accent-soft); font-size: 1rem; word-break: break-word;
}
.t-result .big { font-size: 1.6rem; font-weight: 800; color: var(--brand); }
.t-result table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t-result td, .t-result th { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border); }
.t-note { font-size: .78rem; color: var(--muted); margin-top: 12px; }
.t-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.t-canvas-wrap { text-align: center; margin-top: 14px; }
.t-canvas-wrap img, .t-canvas-wrap canvas { max-width: 100%; border-radius: 9px; border: 1px solid var(--border); }
.t-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.t-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 12px; text-align: center; }
.t-stat .val { font-size: 1.35rem; font-weight: 800; color: var(--brand); }
.t-stat .lbl { font-size: .75rem; color: var(--muted); }
.t-swatch { width: 100%; height: 64px; border-radius: 9px; border: 1px solid var(--border); }
.t-copy { font-size: .78rem; padding: 4px 10px; }

/* ---------- Mobile ---------- */
@media (max-width: 1080px) {
  .content-col { flex-direction: column; }
  .content-col > .content-rail { width: 100%; }
  .ad-slot--rail { position: static; }
}
@media (max-width: 860px) {
  .sidebar { display: none; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 14px; row-gap: 10px; column-gap: 10px; }
  /* Row 1: logo ......... Favorites   |   Row 2: category chips (scroll)   |   Row 3: search */
  .logo { order: 1; }
  .nav-fav { order: 2; margin-left: auto; padding: 8px 12px; }
  .main-nav {
    order: 3; flex-basis: 100%; margin-right: 0;
    overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch;
    gap: 4px; padding-bottom: 2px; scrollbar-width: none;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-cat { padding: 8px 12px; }
  .nav-cat .nc-caret { display: none; }
  .mega-panel { display: none !important; } /* tap the chip to open the category page on mobile */
  .search-wrap { order: 4; flex-basis: 100%; width: 100%; }
  .main { padding: 18px 14px 50px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 40px 18px 30px; }
  .hero-stats { gap: 20px; }
}
