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

:root {
  --bg:            #0d0f1a;
  --surface:       #151827;
  --surface2:      #1c2035;
  --surface3:      #222640;
  --border:        #242840;
  --border2:       #2e3355;
  --primary:       #6c63ff;
  --primary-h:     #5a52e0;
  --primary-glow:  rgba(108,99,255,0.15);
  --text:          #e2e8f0;
  --text2:         #b0bac8;
  --muted:         #8892a4;
  --ok:            #48bb78;
  --err:           #fc8181;
  --warn:          #f6ad55;
  --hot:           #f6ad55;
  --new:           #68d391;
  --info:          #63b3ed;
  --surface-alt:   #1c2035;
  --font-mono:     'JetBrains Mono','Fira Code','Consolas',monospace;
  --font-sans:     -apple-system,BlinkMacSystemFont,'Segoe UI','Noto Sans SC',sans-serif;
  --r:             8px;
  --r-lg:          14px;
  --r-xl:          20px;
  --nav-h:         60px;
  --sidebar-w:     260px;
  --left-nav-w:    220px;
  --content-max:   1280px;
  --transition:    0.18s ease;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Body lock when sidebar open */
body.sidebar-lock { overflow: hidden; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
h1,h2,h3,h4 { line-height: 1.3; }
button { font-family: inherit; }

.container {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ═══════════════════════════════════════════════════════════
   Custom Scrollbar
═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
* { scrollbar-width: thin; scrollbar-color: var(--border2) var(--bg); }

/* ═══════════════════════════════════════════════════════════
   Focus Styles (Accessible)
═══════════════════════════════════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════
   Header / Nav
═══════════════════════════════════════════════════════════ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  backdrop-filter: blur(8px);
}

.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.logo:hover { text-decoration: none; }
.logo-icon { font-size: 1.3rem; }
.logo-text { color: var(--primary); }

/* Nav Search */
.nav-search {
  position: relative;
  flex: 0 1 320px;
  display: flex;
  align-items: center;
}
.nav-search .search-icon {
  position: absolute;
  left: 12px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}
.nav-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--text);
  font-size: .875rem;
  padding: 7px 40px 7px 36px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.nav-search input::placeholder { color: var(--muted); }
.search-kbd {
  position: absolute;
  right: 12px;
  font-size: .7rem;
  color: var(--muted);
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-sans);
  pointer-events: none;
}

/* Main Nav (top bar — simplified, no dropdown) */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: 8px;
}
.main-nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: var(--r);
  color: var(--muted);
  font-size: .82rem;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
}
.nav-link:hover { background: var(--primary-glow); color: var(--text); text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link--ext { color: var(--info); border: 1px solid var(--border2); border-radius: var(--r); }
.nav-link--ext:hover { border-color: var(--info); background: rgba(99,179,237,.1); color: var(--info); }

/* Language dropdown */
.lang-dropdown { position: relative; flex-shrink: 0; }
.lang-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: var(--r);
  font-size: .78rem; font-weight: 600; color: var(--muted); background: transparent;
  cursor: pointer; letter-spacing: .04em;
  transition: color var(--transition), border-color var(--transition), background var(--transition);
}
.lang-btn:hover { color: var(--primary); border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.lang-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: 0 8px 24px rgba(0,0,0,.4); min-width: 140px; padding: 4px 0; z-index: 999;
  max-height: 320px; overflow-y: auto;
}
.lang-dropdown.open .lang-menu { display: block; }
.lang-opt {
  display: block; padding: 7px 16px; font-size: 13px; color: var(--text2);
  text-decoration: none; white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.lang-opt:hover { background: var(--surface2); color: var(--text); }
.lang-active { color: var(--primary); font-weight: 600; }
.lang-active::before { content: "✓ "; }

/* Hamburger */
.hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  border-radius: var(--r);
  color: var(--text);
  transition: background var(--transition);
}
.hamburger:hover { background: var(--surface2); }

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  text-align: left;
  z-index: 500;
  max-height: 400px;
  overflow-y: auto;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-size: .875rem;
  transition: background var(--transition);
  text-decoration: none;
}
.search-item:hover {
  background: var(--primary-glow);
  text-decoration: none;
}
.search-item-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.search-item-name { font-weight: 500; }
.search-item-desc { color: var(--muted); font-size: .8rem; }
.search-empty {
  padding: 14px;
  color: var(--muted);
  text-align: center;
  font-size: .875rem;
}

/* ═══════════════════════════════════════════════════════════
   Mobile Sidebar (slide-in from left)
═══════════════════════════════════════════════════════════ */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 300;
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity var(--transition);
}
.sidebar-overlay.is-visible {
  display: block;
  opacity: 1;
}

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(var(--sidebar-w), 85vw);
  background: var(--surface);
  border-right: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(-110%);
  transition: transform 0.26s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
}
.mobile-sidebar.is-open {
  transform: translateX(0);
  box-shadow: 4px 0 32px rgba(0,0,0,.5);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}
.sidebar-logo:hover { text-decoration: none; }
.sidebar-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 8px;
  border-radius: var(--r);
  transition: background var(--transition), color var(--transition);
  line-height: 1;
}
.sidebar-close:hover { background: var(--surface2); color: var(--text); }

.sidebar-search-wrap {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.sidebar-search-wrap input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: .875rem;
  padding: 8px 12px;
  outline: none;
  transition: border-color var(--transition);
}
.sidebar-search-wrap input:focus { border-color: var(--primary); }
.sidebar-search-wrap .search-results {
  position: absolute;
  top: calc(100% - 12px);
  left: 16px;
  right: 16px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}
.sidebar-nav a {
  display: block;
  padding: 9px 18px;
  color: var(--text2);
  font-size: .9rem;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.sidebar-nav a:hover {
  background: var(--primary-glow);
  color: var(--text);
  text-decoration: none;
}
.sidebar-nav a.active {
  color: var(--primary);
  background: var(--primary-glow);
}
.sidebar-divider {
  padding: 12px 18px 4px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* FAB Button */
.fab-menu {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 250;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(108,99,255,.4);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.fab-menu:hover {
  background: var(--primary-h);
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(108,99,255,.55);
}
.fab-menu:active { transform: scale(.95); }

/* Hide FAB on desktop */
@media (min-width: 769px) {
  .fab-menu { display: none; }
}

/* ═══════════════════════════════════════════════════════════
   Hero Section
═══════════════════════════════════════════════════════════ */
.hero {
  background: linear-gradient(135deg, var(--surface) 0%, #0e1124 50%, #12152a 100%);
  border-bottom: 1px solid var(--border);
  padding: 64px 0 56px;
  text-align: center;
  position: relative;
  overflow: visible;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 80% at 50% 0%, rgba(108,99,255,.08) 0%, transparent 70%);
  pointer-events: none;
}
.hero-title {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--primary) 70%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 14px;
  position: relative;
}
.hero-sub {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 32px;
  position: relative;
}
.hero-sub strong { color: var(--primary); }

/* Hero Stats */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.hero-stat-label { font-size: .75rem; color: var(--muted); margin-top: 2px; }

/* Hero Search */
.hero-search {
  position: relative;
  max-width: 580px;
  margin: 0 auto;
}
.hero-search input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: 30px;
  color: var(--text);
  font-size: 1.05rem;
  padding: 15px 56px 15px 24px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search-icon {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.hero-search .search-results { top: calc(100% + 10px); }

/* ═══════════════════════════════════════════════════════════
   Left Navigation (desktop persistent sidebar)
═══════════════════════════════════════════════════════════ */
.left-nav {
  position: fixed;
  top: var(--nav-h);
  left: 0;
  width: var(--left-nav-w);
  height: calc(100vh - var(--nav-h));
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) transparent;
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.left-nav::-webkit-scrollbar { width: 4px; }
.left-nav::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }

.left-nav-inner {
  padding: 10px 0 24px;
  display: flex;
  flex-direction: column;
}

/* Home link */
.left-nav-home {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.left-nav-home:hover,
.left-nav-home.active { color: var(--primary); background: var(--primary-glow); text-decoration: none; }

/* Category group */
.left-nav-group { border-bottom: 1px solid var(--border); }

.left-nav-cat {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text2);
  font-size: .82rem;
  font-family: var(--font-sans);
  text-align: left;
  transition: background var(--transition), color var(--transition);
}
.left-nav-cat:hover { background: var(--surface2); color: var(--text); }
.left-nav-group.open > .left-nav-cat { color: var(--primary); background: var(--primary-glow); }

.left-nav-cat-icon { font-size: .9rem; flex-shrink: 0; }
.left-nav-cat-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.left-nav-chevron {
  flex-shrink: 0;
  color: var(--muted);
  transition: transform var(--transition);
}
.left-nav-group.open > .left-nav-cat .left-nav-chevron { transform: rotate(90deg); }

/* Tools list inside group */
.left-nav-tools {
  display: none;
  background: var(--bg);
  padding: 2px 0 4px;
}
.left-nav-group.open > .left-nav-tools { display: block; }

.left-nav-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px 5px 28px;
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.left-nav-tool:hover { background: var(--surface2); color: var(--text); text-decoration: none; }
.left-nav-tool-icon { font-size: .8rem; flex-shrink: 0; }
.left-nav-tool--all {
  color: var(--primary);
  font-size: .75rem;
  padding-left: 28px;
  margin-top: 2px;
}
.left-nav-tool--all:hover { background: var(--primary-glow); }

/* ═══════════════════════════════════════════════════════════
   Site Main  (left-nav offset handled via padding on desktop)
═══════════════════════════════════════════════════════════ */
.site-main {
  flex: 1;
  padding-bottom: 72px;
}
/* When .container is applied directly to site-main (tool/category pages) */
.site-main.container {
  max-width: var(--content-max);
  margin-left: 0;
  margin-right: auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* ═══════════════════════════════════════════════════════════
   Section Headers
═══════════════════════════════════════════════════════════ */
.section { margin-top: 52px; }
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 8px;
}

/* Category sections on home */
.cat-section { margin-top: 56px; }
.cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.cat-more {
  font-size: .85rem;
  color: var(--primary);
  white-space: nowrap;
  transition: opacity var(--transition);
}
.cat-more:hover { opacity: .7; text-decoration: none; }

/* ═══════════════════════════════════════════════════════════
   Tool Grid & Cards
═══════════════════════════════════════════════════════════ */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.tool-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
}

.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition), background var(--transition);
  overflow: hidden;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), 0 6px 24px rgba(0,0,0,.35);
  transform: translateY(-3px);
  background: var(--surface2);
  text-decoration: none;
}
.tool-card .tool-icon { font-size: 1.6rem; line-height: 1; }
.tool-card .tool-name { font-size: .9rem; font-weight: 600; color: var(--text); }
.tool-card .tool-desc {
  font-size: .78rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Badges */
.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .6rem;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
}
.badge--hot { background: rgba(246,173,85,.15); color: var(--hot); border: 1px solid rgba(246,173,85,.3); }
.badge--new { background: rgba(104,211,145,.15); color: var(--new); border: 1px solid rgba(104,211,145,.3); }
.badge--info { background: rgba(99,179,237,.15); color: var(--info); border: 1px solid rgba(99,179,237,.3); }

.tool-card--rec { border-color: rgba(99,102,241,.25); }
.tool-card--rec:hover { border-color: var(--primary); }

/* ═══════════════════════════════════════════════════════════
   Breadcrumb
═══════════════════════════════════════════════════════════ */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.breadcrumb-nav a { color: var(--muted); transition: color var(--transition); }
.breadcrumb-nav a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb-sep { opacity: .45; }
.tool-page-h1 { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 12px 0 16px; }

/* ═══════════════════════════════════════════════════════════
   Tool Page Layout (single column, full width)
═══════════════════════════════════════════════════════════ */
.tool-page-wrap {
  display: block;
}

.tool-page-content { min-width: 0; }

/* Right sidebar — kept for legacy but hidden */
.tool-right-sidebar { display: none !important; }
.right-sidebar-box { display: none; }
.right-sidebar-box-title { display: none; }
.right-sidebar-cat { display: none; }
.right-sidebar-cat-icon { display: none; }
.right-sidebar-cat-name { display: none; }
.right-sidebar-cat-link { display: none; }
.right-sidebar-tools { display: none; }

/* ═══════════════════════════════════════════════════════════
   Related Tools Grid (bottom, 2 rows on desktop)
═══════════════════════════════════════════════════════════ */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
@media (min-width: 1024px) {
  .related-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
@media (max-width: 640px) {
  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════
   Tool Page Header
═══════════════════════════════════════════════════════════ */
.tool-page-header {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 28px;
}
.tool-page-icon {
  font-size: 2.4rem;
  line-height: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tool-page-title { font-size: 1.65rem; font-weight: 700; margin-bottom: 6px; }
.tool-page-desc { color: var(--muted); font-size: .95rem; }

/* ═══════════════════════════════════════════════════════════
   Editor / Code Panels
═══════════════════════════════════════════════════════════ */
.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}
.editor-panel { display: flex; flex-direction: column; gap: 8px; min-width: 0; overflow: hidden; }
.editor-panel label {
  font-size: .82rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: .02em;
}
.editor-panel textarea {
  width: 100%;
  min-height: 440px;
  max-height: calc(100vh - 220px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: .875rem;
  padding: 12px;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition);
  line-height: 1.6;
}
.editor-panel textarea:focus { border-color: var(--primary); }

.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ═══════════════════════════════════════════════════════════
   Buttons
═══════════════════════════════════════════════════════════ */
button {
  padding: 8px 18px;
  border: none;
  border-radius: var(--r);
  background: var(--primary);
  color: #fff;
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
button:hover { background: var(--primary-h); }
button:active { transform: scale(.97); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--r);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.btn-primary:hover { background: var(--primary-h); text-decoration: none; transform: translateY(-1px); }
.btn-primary:active { transform: scale(.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border2);
  border-radius: var(--r);
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-secondary:hover { background: var(--surface3); border-color: var(--primary); text-decoration: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: var(--r);
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition);
  text-decoration: none;
}
.btn-ghost:hover { background: var(--primary-glow); text-decoration: none; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: rgba(252,129,129,.12);
  color: var(--err);
  border: 1px solid rgba(252,129,129,.3);
  border-radius: var(--r);
  font-size: .875rem;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-danger:hover { background: rgba(252,129,129,.2); }

/* ═══════════════════════════════════════════════════════════
   Status Messages
═══════════════════════════════════════════════════════════ */
.status-msg {
  font-size: .875rem;
  min-height: 1.5em;
  margin-top: 6px;
  padding: 0;
  border-radius: var(--r);
}
.status-msg.ok { color: var(--ok); }
.status-msg.err { color: var(--err); }
.status-msg.warn { color: var(--warn); }

.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--r);
  font-size: .875rem;
  margin-top: 12px;
}
.alert-ok  { background: rgba(72,187,120,.1); border: 1px solid rgba(72,187,120,.25); color: var(--ok); }
.alert-err { background: rgba(252,129,129,.1); border: 1px solid rgba(252,129,129,.25); color: var(--err); }
.alert-warn { background: rgba(246,173,85,.1); border: 1px solid rgba(246,173,85,.25); color: var(--warn); }
.alert-info { background: rgba(99,179,237,.1); border: 1px solid rgba(99,179,237,.25); color: var(--info); }

/* Mode select (radio group) */
.mode-select {
  display: flex;
  gap: 20px;
  margin-bottom: 14px;
  font-size: .875rem;
  flex-wrap: wrap;
}
.mode-select label {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   WIP Box
═══════════════════════════════════════════════════════════ */
.wip-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  background: var(--surface);
  border: 1px dashed var(--border2);
  border-radius: var(--r-xl);
  padding: 64px 32px;
  margin-bottom: 40px;
}
.wip-icon { font-size: 3.5rem; }
.wip-title { font-size: 1.35rem; font-weight: 700; }
.wip-desc { color: var(--muted); max-width: 380px; line-height: 1.7; }

/* ═══════════════════════════════════════════════════════════
   Related Tools Section
═══════════════════════════════════════════════════════════ */
.related-section { margin-top: 52px; }

/* ═══════════════════════════════════════════════════════════
   Category Page
═══════════════════════════════════════════════════════════ */
.cat-page-header {
  padding: 40px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.cat-page-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.cat-page-icon-wrap {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}
.cat-page-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.cat-page-desc { color: var(--muted); font-size: .95rem; }
.cat-page-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cat-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: .82rem;
  color: var(--text2);
}

/* Category filter search */
.cat-filter-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.cat-filter-input {
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: .9rem;
  padding: 9px 14px;
  outline: none;
  transition: border-color var(--transition);
}
.cat-filter-input:focus { border-color: var(--primary); }
.cat-filter-input::placeholder { color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   Page Header (generic)
═══════════════════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--muted);
  margin-top: 24px;
  margin-bottom: 20px;
}
.page-header a { color: var(--muted); }
.page-header a:hover { color: var(--primary); }
.page-title {
  font-size: 1.7rem;
  font-weight: 800;
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════════
   CodeMirror Overrides (dark theme integration)
═══════════════════════════════════════════════════════════ */
.CodeMirror {
  min-height: 440px;
  max-height: calc(100vh - 220px);
  height: auto;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font-mono) !important;
  font-size: .875rem !important;
  background: var(--surface2) !important;
}
.CodeMirror-scroll {
  padding: 4px 0;
  overflow-x: hidden !important;
  /* Prevent horizontal expansion beyond container */
  max-width: 100%;
}
/* Force sizer to not exceed container width so lineWrapping works */
.CodeMirror-sizer {
  min-width: 0 !important;
  max-width: 100% !important;
}
/* Soft-wrap: visual line wrap without adding line numbers.
   word-break + overflow-wrap ensures even single-line minified content wraps */
.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
  word-break: break-all;
  overflow-wrap: break-word;
  white-space: pre-wrap !important;
}
.CodeMirror-focused {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
}
.CodeMirror-gutters {
  background: var(--surface) !important;
  border-right: 1px solid var(--border) !important;
}
.CodeMirror-linenumber {
  color: var(--muted) !important;
  font-size: .8rem !important;
}
/* Make CM match editor-panel heights */
.editor-panel .CodeMirror { min-height: 440px; height: auto; width: 100% !important; }
.editor-panel.cm-tall .CodeMirror { min-height: 560px; }

/* ═══════════════════════════════════════════════════════════
   Footer
═══════════════════════════════════════════════════════════ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .95rem;
}
.footer-copy {
  color: var(--muted);
  font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════════
   Error Page
═══════════════════════════════════════════════════════════ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  text-align: center;
  gap: 16px;
}
.error-code { font-size: 5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.error-msg { font-size: 1.1rem; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════
   Desktop left-nav layout (>1024px)
═══════════════════════════════════════════════════════════ */
@media (min-width: 1025px) {
  /* Left nav follows content: on wide screens, nav sits right next to content */
  .left-nav {
    left: max(0px, calc(50vw - (var(--content-max) + var(--left-nav-w)) / 2));
  }
  /* Dynamic padding so content starts right after the nav */
  .site-main:not(.container) {
    padding-left: max(var(--left-nav-w), calc(50vw - (var(--content-max) - var(--left-nav-w)) / 2));
  }
  /* Containers align left (no centering gap between nav and content) */
  .site-main:not(.container) .container {
    margin-left: 0;
    margin-right: auto;
  }
  /* Tool/category pages: site-main.container also starts after nav */
  .site-main.container {
    margin-left: max(var(--left-nav-w), calc(50vw - (var(--content-max) - var(--left-nav-w)) / 2));
    margin-right: auto;
  }
  /* Footer aligned with content */
  .site-footer {
    padding-left: max(var(--left-nav-w), calc(50vw - (var(--content-max) - var(--left-nav-w)) / 2));
  }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Tablet (≤1024px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .left-nav { display: none; }
  /* Reset all left-nav offsets */
  .site-main:not(.container) { padding-left: 0; }
  .site-main.container { max-width: var(--content-max); padding-left: 24px; }
  .site-footer { padding-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Mobile (≤768px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .container { padding: 0 16px; }

  .search-kbd { display: none; }

  .editor-layout { grid-template-columns: 1fr; }
  .tool-page-header { flex-direction: column; gap: 12px; }

  .hero { padding: 40px 0 36px; }
  .hero-title { font-size: 1.8rem; }
  .hero-stats { gap: 20px; }

  .cat-page-title { font-size: 1.5rem; }
  .cat-page-icon-wrap { width: 52px; height: 52px; font-size: 1.6rem; }

  .tool-page-wrap { gap: 24px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════
   Responsive — Small Mobile (≤480px)
═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
  .tool-grid-sm { grid-template-columns: repeat(2, 1fr); }

  .hero-search input { font-size: .95rem; padding: 12px 48px 12px 18px; }

  .btn-row { gap: 6px; }
  button { font-size: .82rem; padding: 7px 14px; }
}

/* ═══════════════════════════════════════════════════════════
   Utility Classes
═══════════════════════════════════════════════════════════ */
.hidden { display: none !important; }
.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;
}
.text-muted { color: var(--muted); }
.text-ok { color: var(--ok); }
.text-err { color: var(--err); }
.text-warn { color: var(--warn); }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ═══════════════════════════════════════════════════════════
   Tool UI Container
═══════════════════════════════════════════════════════════ */
.tool-ui {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-bottom: 24px;
}

/* Calculator Grid */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

/* Result Box */
.result-box {
  background: var(--surface2);
  font-family: var(--font-mono);
  padding: 16px;
  border-radius: var(--r);
  min-height: 60px;
  font-size: .875rem;
  color: var(--text);
  border: 1px solid var(--border);
  white-space: pre-wrap;
  word-break: break-all;
}

/* Input Group */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: .82rem;
  color: var(--muted);
}

/* Form Input / Select */
.form-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--primary); }
.form-select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color var(--transition);
  cursor: pointer;
}
.form-select:focus { border-color: var(--primary); }

/* Tag Grid */
.tag-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: .8rem;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  color: var(--text2);
}
.tag:hover { border-color: var(--primary); color: var(--text); }
.tag.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Output Stats */
.output-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.stat-item strong { color: var(--text); }

/* Reference Table */
.reference-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.reference-table th,
.reference-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.reference-table th { background: var(--surface2); font-weight: 600; color: var(--text2); }
.reference-table tr:hover td { background: rgba(255,255,255,.03); }

/* Status Badges */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.status-1xx { background: rgba(99,179,237,.15); color: var(--info); }
.status-2xx { background: rgba(72,187,120,.15); color: var(--ok); }
.status-3xx { background: rgba(246,173,85,.15); color: var(--warn); }
.status-4xx { background: rgba(252,129,129,.15); color: var(--err); }
.status-5xx { background: rgba(246,173,85,.15); color: var(--warn); }

/* Morse Output */
.morse-output { font-family: var(--font-mono); font-size: 1.1rem; letter-spacing: .15em; word-spacing: .5em; }

/* Color Preview */
.color-preview { width: 100%; height: 80px; border-radius: var(--r); border: 1px solid var(--border); margin-bottom: 8px; }
.gradient-preview { width: 100%; height: 100px; border-radius: var(--r); border: 1px solid var(--border); }

/* Frequency Bar */
.freq-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .875rem; }
.freq-bar-wrap { flex: 1; margin: 0 12px; background: var(--surface2); border-radius: 4px; height: 8px; align-self: center; }
.freq-bar { height: 100%; background: var(--primary); border-radius: 4px; transition: width .3s; }

/* Time display */
.current-time-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.time-block { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; }
.time-label { font-size: .78rem; color: var(--muted); margin-bottom: 8px; }
.time-value { font-family: var(--font-mono); font-size: .95rem; color: var(--primary); word-break: break-all; }
.convert-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; margin-bottom: 16px; }

/* Tab Bar */
.tab-bar { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn { padding: 6px 16px; border-radius: var(--r); background: var(--surface2); border: 1px solid var(--border); color: var(--muted); cursor: pointer; font-size: .85rem; transition: .15s; }
.tab-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.tab-btn:hover:not(.active) { border-color: var(--primary); color: var(--text); }

/* Stat Cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.stat-card { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--r); padding: 16px; text-align: center; }
.stat-card-value { font-size: 1.6rem; font-weight: 700; color: var(--primary); font-family: var(--font-mono); }
.stat-card-label { font-size: .75rem; color: var(--muted); margin-top: 4px; }

/* BMI Scale */
.bmi-scale { height: 16px; border-radius: 8px; background: linear-gradient(to right, #63b3ed, #68d391, #f6ad55, #fc8181); margin: 16px 0; position: relative; }
.bmi-marker { position: absolute; top: -6px; width: 4px; height: 28px; background: #fff; border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--primary); transition: left .3s; }

/* URL Parts Table */
.url-parts-table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: .875rem; }
.url-parts-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.url-parts-table td:first-child { color: var(--muted); font-family: var(--font-mono); font-size: .8rem; width: 120px; white-space: nowrap; }
.url-parts-table td:last-child { font-family: var(--font-mono); color: var(--text); word-break: break-all; }

/* Match Highlight */
.match-highlight { background: rgba(108,99,255,.3); border-radius: 2px; }

/* Strength Bar */
.strength-bar-wrap { height: 6px; background: var(--surface2); border-radius: 3px; margin: 8px 0; overflow: hidden; }
.strength-bar { height: 100%; border-radius: 3px; transition: width .3s, background .3s; }

/* ── Back-to-top FAB ───────────────────────────────────── */
.btt-fab {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s;
  transform: translateY(8px);
}
.btt-fab.btt-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.btt-fab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
@media (max-width: 1024px) {
  .btt-fab {
    right: 16px;
    bottom: 80px; /* above mobile FAB menu button */
  }
}

/* ── Global code block style (applies to all guide/reference pages) ── */
pre:not(.CodeMirror-line):not([class*="CodeMirror"]) {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono, 'JetBrains Mono', 'Fira Code', monospace);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
pre:not(.CodeMirror-line):not([class*="CodeMirror"]) code {
  background: none;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
  font-family: inherit;
}
/* .code-block: used by agent-generated templates inline — same dark style */
.code-block {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono, 'JetBrains Mono', 'Fira Code', monospace);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0 12px;
  border: 1px solid rgba(255,255,255,0.06);
}
/* Inline code snippets */
:not(pre) > code {
  background: var(--surface2, #23243a);
  color: var(--primary, #6c63ff);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  font-size: 0.85em;
}
/* ref-code / bp-code: variant classes from some templates */
.ref-code, .bp-code, .sc-code {
  background: #1e1e2e;
  color: #cdd6f4;
  border-radius: 8px;
  padding: 14px 16px;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
  margin: 8px 0 12px;
}

/* ═══════════════════════════════════════════════════════════
   Table of Contents (auto-generated by toc.js)
═══════════════════════════════════════════════════════════ */
.toc-nav {
  position: fixed;
  top: calc(var(--nav-h) + 24px);
  /* Position just left of the content area (content-max centered) */
  left: max(8px, calc((100vw - var(--content-max)) / 2 - 216px));
  width: 200px;
  max-height: calc(100vh - var(--nav-h) - 48px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 0;
  z-index: 90;
  scrollbar-width: thin;
  font-size: 12px;
}
.toc-title {
  font-weight: 700;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 14px 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-item { margin: 0; }
.toc-item.toc-sub { padding-left: 12px; }
.toc-link {
  display: block;
  padding: 4px 14px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-link:hover { color: var(--text); }
.toc-link.active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
/* Hide TOC on narrow screens or when left-nav is present */
@media (max-width: 1400px) { .toc-nav { display: none; } }

/* Portal pages (ecommerce / webdev) use .left-nav class directly,
   no extra portal-sidebar CSS needed. The #left-nav from foot partial
   is hidden via inline style, and #portal-nav takes over. */
