/* ============================================================
   Harrysof LAIR — Design System
   Teal/Amber dark theme, distinct from FMHY
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Rajdhani:wght@500;600;700&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-deep:     #09090f;
  --bg-surface:  #0f0f1a;
  --bg-card:     #13131f;
  --bg-card-hover: #181827;
  --bg-sidebar:  #0b0b14;
  --bg-elevated: #1a1a2e;

  /* Accent — Teal */
  --teal-100: #ccfbf1;
  --teal-300: #5eead4;
  --teal-400: #2dd4bf;
  --teal-500: #14b8a6;
  --teal-600: #0d9488;
  --teal-900: #042f2e;

  /* Accent — Amber */
  --amber-300: #fcd34d;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  /* Semantic */
  --accent:        var(--teal-400);
  --accent-dim:    var(--teal-600);
  --accent-glow:   rgba(45, 212, 191, 0.10);
  --accent-glow-strong: rgba(45, 212, 191, 0.20);
  --star:          var(--amber-400);
  --star-glow:     rgba(251, 191, 36, 0.15);
  --danger:        #f87171;
  --danger-bg:     rgba(248, 113, 113, 0.08);

  /* Text */
  --text-primary:  #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:    #475569;
  --text-link:     var(--teal-400);

  /* Borders */
  --border:        #1e293b;
  --border-muted:  #152032;
  --border-accent: rgba(45, 212, 191, 0.25);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(45, 212, 191, 0.08);

  /* Layout */
  --sidebar-w: 260px;
  --toc-w: 210px;
  --header-h: 54px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  /* Font */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  /* Subtle grid background — the "LAIR" character */
  background-image:
    linear-gradient(rgba(45,212,191,0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,212,191,0.015) 1px, transparent 1px);
  background-size: 40px 40px;
}

a { color: var(--text-link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--teal-600); }

::selection { background: rgba(45,212,191,0.25); color: var(--text-primary); }

/* Custom scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #2d3f55; }

/* ── Layout Shell ──────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr;
  grid-template-columns: var(--sidebar-w) 1fr var(--toc-w);
  grid-template-areas:
    "header  header  header"
    "sidebar content toc";
  min-height: 100vh;
}

/* ── Header ────────────────────────────────────────────────── */
#header {
  grid-area: header;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  background: rgba(9, 9, 15, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

/* Hamburger — hidden on desktop */
#menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-md);
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
  line-height: 0;
}
#menu-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

#logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}
#logo:hover { text-decoration: none; opacity: 0.9; }

.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(45,212,191,0.35));
  flex-shrink: 0;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--teal-400), var(--teal-300));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--teal-600);
}

#btn-random {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
#btn-random:hover {
  background: var(--accent-glow);
  border-color: var(--border-accent);
  color: var(--teal-400);
}

/* Search bar */
#search-bar {
  flex: 1;
  max-width: 420px;
  position: relative;
}

#search-input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 7px 12px 7px 34px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
#search-input:focus, #search-input.active {
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
  cursor: text;
}
#search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 14px;
}

.search-kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
}

/* Header stats */
#header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
  flex-shrink: 0;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--teal-400);
  font-weight: 500;
}

.ws-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}
.ws-dot.connected { background: var(--teal-400); box-shadow: 0 0 6px var(--teal-400); }
.ws-dot.disconnected { background: var(--danger); }

/* Admin link in header */
#admin-link {
  font-size: 12px;
  color: var(--text-muted);
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
#admin-link:hover {
  color: var(--amber-400);
  border-color: rgba(251,191,36,0.3);
  background: var(--star-glow);
  text-decoration: none;
}

/* ── Sidebar ────────────────────────────────────────────────── */
#sidebar {
  grid-area: sidebar;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-muted);
  padding: 12px 0;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.15s;
  position: relative;
  color: var(--text-secondary);
  font-size: 13px;
  user-select: none;
}
.sidebar-item:hover {
  background: var(--accent-glow);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-item.active {
  border-left-color: var(--accent);
  background: var(--accent-glow);
  color: var(--teal-300);
  font-weight: 500;
}

.sidebar-item-icon { font-size: 14px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; width: 18px; }

.subfolder-dot {
  width: 6px;
  height: 6px;
  background-color: var(--text-primary);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
}
.sidebar-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sidebar-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 1px 5px;
  border-radius: 99px;
  flex-shrink: 0;
}
.sidebar-item.active .sidebar-badge {
  background: rgba(45,212,191,0.15);
  color: var(--teal-400);
}

/* Sub-items */
.sidebar-sub-item {
  padding-left: 36px;
  font-size: 12.5px;
  opacity: 0.85;
}

/* ── Main Content ───────────────────────────────────────────── */
#content {
  grid-area: content;
  padding: 28px 32px;
  min-width: 0;
}

/* ── Home view ─────────────────────────────── */
#home-view { display: none; }
#home-view.visible { display: block; }

/* Two-column hero row */
.home-hero-row {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-muted);
}

.home-hero {
  flex: 1;
  min-width: 0;
}

.home-hero h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--teal-400) 0%, var(--teal-300) 50%, var(--amber-300) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.home-hero p {
  color: var(--text-secondary);
  font-size: 15px;
}

.home-stats {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.home-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.home-stat strong {
  font-family: var(--font-mono);
  color: var(--teal-400);
  font-weight: 500;
}

/* ── Site Preview Card (Discover) ─────────────────────────────── */
.site-preview-card {
  position: relative;
  width: 280px;
  flex-shrink: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* Glassmorphism base */
  background: linear-gradient(135deg,
    rgba(45, 212, 191, 0.06) 0%,
    rgba(13, 17, 30, 0.85) 60%,
    rgba(45, 212, 191, 0.04) 100%);
  border: 1px solid rgba(45, 212, 191, 0.18);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
}
.site-preview-card:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.6),
    0 0 30px rgba(45, 212, 191, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(45, 212, 191, 0.35);
}

/* Animated ambient glow ring */
.spc-glow-ring {
  position: absolute;
  top: -40%;
  left: -20%;
  width: 140%;
  height: 140%;
  background: radial-gradient(ellipse at 60% 40%, rgba(45,212,191,0.12) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
  animation: spc-pulse 4s ease-in-out infinite;
}
@keyframes spc-pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}

/* Glossy top-edge sheen */
.site-preview-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  z-index: 2;
}
/* Bottom fade sheen */
.site-preview-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: linear-gradient(to top, rgba(9,9,15,0.9), transparent);
  z-index: 2;
  pointer-events: none;
}

.spc-inner {
  position: relative;
  z-index: 3;
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.spc-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--teal-500);
}

.spc-cover-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 120px;
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(13, 17, 30, 0.5));
  box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}
.spc-cover-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.5));
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spc-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}
.spc-favicon {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
}
.spc-info { min-width: 0; flex: 1; }
.spc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.spc-domain {
  font-size: 10px;
  color: var(--teal-600);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spc-refresh {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(9,9,15,0.6);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 4;
}
.spc-refresh:hover { color: var(--teal-400); border-color: var(--border-accent); }
.spc-refresh svg { width: 13px; height: 13px; }
.spc-refresh.spinning svg { animation: spin 0.6s linear; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* Responsive: stack on small screens */
@media (max-width: 860px) {
  .home-hero-row { flex-direction: column; }
  .site-preview-card { width: 100%; max-width: 340px; }
  .spc-cover-wrap { height: 140px; }
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.category-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  right: 0; height: 2px;
  background: linear-gradient(90deg, var(--teal-600), transparent);
  opacity: 0;
  transition: opacity 0.2s;
}
.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.category-card:hover::before { opacity: 1; }

.card-icon { font-size: 24px; margin-bottom: 10px; display: block; }

.card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.card-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-count {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--teal-600);
}

/* ── Category view ─────────────────────────── */
#category-view { display: none; }
#category-view.visible { display: block; }

.category-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-muted);
}

.category-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb-sep { opacity: 0.4; }

.breadcrumb-item { cursor: pointer; transition: color 0.15s; }
.breadcrumb-item:hover { color: var(--teal-400); }

.category-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text-primary);
}

.category-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* Section within category */
.section-block { margin-bottom: 32px; }

.section-anchor {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-muted);
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  scroll-margin-top: calc(var(--header-h) + 12px);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 2px 7px;
  border-radius: 99px;
}

/* Bookmark list */
.bookmark-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  position: relative;
}
.bookmark-item::before {
  content: '•';
  color: var(--teal-700, #115e59);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.bookmark-item:hover { background: var(--accent-glow); }

.favicon-wrapper {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favicon {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  object-fit: contain;
}

.favicon-placeholder {
  width: 26px;
  height: 26px;
  background: var(--bg-elevated);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.bookmark-link {
  color: var(--teal-400);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
.bookmark-link:hover {
  color: var(--teal-300);
  text-decoration-color: var(--teal-600);
}

.bookmark-domain {
  white-space: nowrap;
}

/* Copy button */
.copy-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  border-radius: 4px;
}
.bookmark-item:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--teal-400); background: var(--bg-elevated); }

.copy-btn svg { width: 14px; height: 14px; }

/* Tags */
.tags-list {
  display: flex;
  gap: 4px;
  margin-left: 8px;
}
.tag-badge {
  font-size: 10px;
  background: rgba(45, 212, 191, 0.08);
  color: var(--teal-500);
  border: 1px solid rgba(45, 212, 191, 0.15);
  padding: 0 5px;
  border-radius: 4px;
  white-space: nowrap;
}

/* Pin indicator */
.pinned-indicator {
  color: var(--amber-500);
  font-size: 10px;
  margin-right: 4px;
}

/* Recent link widget */
.recent-link-card {
  margin-top: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(45, 212, 191, 0.03) 100%);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 400px;
}
.recent-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}
.recent-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.recent-url {
  font-size: 11px;
  color: var(--teal-600);
  font-family: var(--font-mono);
}

/* Direct links at top of category (no sub-section) */
.direct-links-block { margin-bottom: 24px; }
.direct-links-block .section-title { color: var(--text-muted); font-size: 13px; font-weight: 500; }

/* ── Table of Contents (right sidebar) ─────── */
#toc {
  grid-area: toc;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 20px 14px 20px 10px;
  border-left: 1px solid var(--border-muted);
  background: var(--bg-sidebar);
}

#toc-inner { display: none; }
#toc-inner.visible { display: block; }

.toc-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.toc-list { list-style: none; display: flex; flex-direction: column; gap: 1px; }

.toc-item {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toc-item:hover { color: var(--text-primary); background: var(--accent-glow); }
.toc-item.active { color: var(--teal-400); border-left-color: var(--teal-400); background: var(--accent-glow); }

/* ── Search Overlay ─────────────────────────── */
#search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(5,5,12,0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: flex-start;
  justify-content: center;
  padding-top: 70px;
  padding-left: 12px;
  padding-right: 12px;
}
#search-overlay.open { display: flex; }

#search-modal {
  width: 100%;
  max-width: 580px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 40px rgba(45,212,191,0.1);
  overflow: hidden;
  animation: modal-in 0.15s ease;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.search-modal-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  color: var(--text-muted);
  flex-shrink: 0;
}

#search-modal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 0;
  outline: none;
  min-width: 0;
}
#search-modal-input::placeholder { color: var(--text-muted); }

.search-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

#search-results {
  max-height: 400px;
  overflow-y: auto;
  padding: 8px 0;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background 0.12s;
}
.search-result-item:hover, .search-result-item.focused {
  background: var(--accent-glow);
}

.result-favicon { width: 16px; height: 16px; border-radius: 2px; flex-shrink: 0; }

.result-info { flex: 1; min-width: 0; }
.result-name { font-size: 13px; font-weight: 500; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.result-url  { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.result-path { font-size: 11px; color: var(--text-muted); }

.search-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.search-footer {
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--text-muted);
}

.search-hint kbd {
  background: var(--bg-elevated);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

/* ── Loading / Status ───────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--teal-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

#loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 20px;
  color: var(--text-muted);
}

/* ── Admin panel shared styles ──────────────── */
.admin-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 24px;
  background: rgba(9,9,15,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.admin-topbar .logo-name { font-size: 16px; }

.admin-badge {
  background: rgba(251,191,36,0.1);
  color: var(--amber-400);
  border: 1px solid rgba(251,191,36,0.2);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.05em;
}

.admin-body { padding: 24px 32px; max-width: 960px; margin: 0 auto; }

.admin-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 24px;
}

.admin-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.admin-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.admin-stat-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--teal-400); }

/* Admin search + filters */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-search {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.2s;
}
.admin-search:focus { border-color: var(--border-accent); }
.admin-search::placeholder { color: var(--text-muted); }

.btn {
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-card-hover); color: var(--text-primary); border-color: var(--border-accent); }
.btn.active { background: var(--accent-glow); border-color: var(--border-accent); color: var(--teal-400); }
.btn.danger { border-color: rgba(248,113,113,0.3); color: var(--danger); }
.btn.danger:hover { background: var(--danger-bg); }
.btn-back { color: var(--text-muted); }

/* ── Admin Tree ──────────────────────────────── */
.admin-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.tree-node { border-top: 1px solid var(--border-muted); }
.tree-node:first-child { border-top: none; }

.tree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  transition: background 0.12s;
}
.tree-row:hover { background: var(--bg-card-hover); }

.tree-indent { flex-shrink: 0; }

.tree-toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10px;
  border-radius: 3px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.tree-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.leaf { cursor: default; opacity: 0; }

.tree-icon { font-size: 13px; flex-shrink: 0; }

.tree-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-name.is-link { color: var(--teal-400); }

.tree-url {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 0;
}

.tree-kind {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 99px;
  flex-shrink: 0;
}
.tree-kind.folder { background: rgba(45,212,191,0.1); color: var(--teal-400); }
.tree-kind.link { background: var(--bg-elevated); color: var(--text-muted); }

.tree-hide-btn {
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  transition: all 0.15s;
  flex-shrink: 0;
}
.tree-hide-btn.visible-btn {
  background: transparent;
  border-color: var(--border);
  color: var(--text-muted);
}
.tree-hide-btn.visible-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}
.tree-hide-btn.hidden-btn {
  background: var(--danger-bg);
  border-color: rgba(248,113,113,0.3);
  color: var(--danger);
}
.tree-hide-btn.hidden-btn:hover {
  background: rgba(248,113,113,0.15);
}

/* Hidden rows */
.tree-row.is-hidden .tree-name { opacity: 0.4; text-decoration: line-through; }
.tree-row.is-hidden .tree-url  { opacity: 0.4; }
.tree-row.is-hidden { background: var(--danger-bg); }

.tree-children { display: none; }
.tree-children.open { display: block; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 1100px) {
  #toc { display: none; }
  #app {
    grid-template-columns: var(--sidebar-w) 1fr;
    grid-template-areas:
      "header  header"
      "sidebar content";
  }
}

/* Tablet: hide random button, slim header */
@media (max-width: 820px) {
  #btn-random span { display: none; }
  #btn-random { padding: 6px 10px; font-size: 18px; }
}

/* Mobile: full drawer navigation */
@media (max-width: 720px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-areas:
      "header"
      "content";
  }

  #menu-toggle { display: flex; }

  /* Sidebar becomes a fixed off-canvas drawer */
  #sidebar {
    position: fixed;
    top: var(--header-h);
    left: -100%;
    bottom: 0;
    width: min(80vw, 280px);
    z-index: 500;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-muted);
    transition: left 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
  }

  body.menu-open #sidebar { left: 0; }

  /* Dark overlay when drawer is open */
  #sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--header-h);
    inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(2px);
    z-index: 400;
    transition: opacity 0.28s;
  }
  body.menu-open #sidebar-overlay { display: block; }

  /* Content gets full width and comfy padding */
  #content { padding: 16px; }

  /* Category grid: single column */
  .category-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  /* Bigger tap targets */
  .sidebar-item { padding: 11px 16px; font-size: 14px; }
  .bookmark-item { padding: 8px 10px; }

  /* Tighter header on mobile */
  #header { padding: 0 14px; gap: 10px; }
  #header-stats { display: none; }
  #search-bar { max-width: unset; }

  /* Full-screen search on mobile */
  #search-overlay { padding-top: 0; }
  #search-modal { border-radius: 0; height: 100vh; display: flex; flex-direction: column; }
  #search-results { flex: 1; }

  /* Home grid: 1 column on very small screens */
  @media (max-width: 420px) {
    .category-grid { grid-template-columns: 1fr; }
  }

  /* ── Fix 2: Mobile section headers ── */
  .section-title {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--teal-400);
    letter-spacing: 0.02em;
  }

  .section-anchor {
    margin-top: 1.5rem;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(45, 212, 191, 0.20);
  }

  .section-count {
    font-size: 12px;
    background: rgba(45, 212, 191, 0.10);
    color: var(--teal-400);
    border: 1px solid rgba(45, 212, 191, 0.20);
  }
}

/* ── Animations ─────────────────────────────── */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fade-in 0.2s ease; }

/* Update flash */
@keyframes flash-border {
  0%   { border-color: var(--teal-400); }
  100% { border-color: var(--border); }
}
.updated { animation: flash-border 1s ease; }

/* Admin Pinned & Tags */
.pinned-btn {
  background: var(--star-glow) !important;
  color: var(--amber-400) !important;
  border-color: rgba(251,191,36,0.3) !important;
}

.tags-editor {
  margin-left: 10px;
  flex-shrink: 0;
}
.tags-input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  width: 140px;
  outline: none;
}
.tags-input:focus { border-color: var(--teal-500); }

/* ── Sub-Footer ──────────────────────────────────────────────── */
#site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 32px;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-muted);
  font-size: 12px;
  color: var(--text-muted);
}

.footer-brand {
  font-weight: 700;
  color: var(--teal-500);
  font-size: 13px;
}

.footer-sep { opacity: 0.3; margin: 0 4px; }

.footer-center {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  opacity: 0.6;
}

.footer-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.footer-btn:hover {
  border-color: var(--border-accent);
  color: var(--teal-400);
  background: var(--accent-glow);
}
.footer-btn.active {
  border-color: var(--teal-600);
  color: var(--teal-400);
  background: var(--accent-glow);
}
.footer-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.footer-right { flex-shrink: 0; }

/* ── Scroll to Top ───────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 80px;
  right: 24px;
  z-index: 900;
  width: 40px;
  height: 40px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, border-color 0.2s, color 0.2s;
}
#scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#scroll-top:hover {
  border-color: var(--teal-500);
  color: var(--teal-400);
  background: var(--accent-glow);
}
#scroll-top svg { width: 18px; height: 18px; }

/* ── Compact Mode ────────────────────────────────────────────── */
body.compact .bookmark-item { padding: 2px 8px; gap: 6px; }
body.compact .sidebar-item  { padding: 4px 16px; }
body.compact .section-block { margin-bottom: 18px; }
body.compact .category-card { padding: 12px; }
body.compact .bookmark-list { gap: 0; }

/* ── Keyboard Shortcuts Modal ────────────────────────────────── */
#shortcuts-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5,5,12,0.88);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}
#shortcuts-overlay.open { display: flex; }

#shortcuts-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 0 40px rgba(45,212,191,0.1);
  width: min(480px, 92vw);
  animation: modal-in 0.15s ease;
  overflow: hidden;
}

.shortcuts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.shortcuts-header h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.shortcuts-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.shortcuts-close:hover { background: var(--bg-elevated); color: var(--text-primary); }

.shortcuts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 12px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}
.shortcut-item:hover { background: var(--accent-glow); }

.shortcut-item kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--teal-400);
  white-space: nowrap;
  flex-shrink: 0;
}

.shortcut-item span {
  font-size: 12px;
  color: var(--text-secondary);
}

@media (max-width: 720px) {
  #site-footer { flex-direction: column; align-items: flex-start; padding: 14px 16px; }
  .footer-center { gap: 12px; }
  .shortcuts-grid { grid-template-columns: 1fr; }
  #scroll-top { bottom: 140px; right: 16px; }
}

/* ============================================================
   Public Dashboard Refresh
   ============================================================ */
:root {
  --bg-deep: #080a0d;
  --bg-surface: #0d1117;
  --bg-card: #111720;
  --bg-card-hover: #151d28;
  --bg-sidebar: #090d13;
  --bg-elevated: #161f2b;
  --text-primary: #edf2f7;
  --text-secondary: #a8b3c2;
  --text-muted: #687586;
  --border: #243041;
  --border-muted: #172131;
  --border-accent: rgba(45, 212, 191, 0.28);
  --shadow-md: 0 16px 42px rgba(0, 0, 0, 0.34);
  --shadow-glow: 0 14px 34px rgba(0, 0, 0, 0.28);
  --header-h: 62px;
  --radius-lg: 8px;
}

body {
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.32), rgba(8, 10, 13, 0) 260px),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    var(--bg-deep);
  background-size: auto, 44px 44px, 44px 44px, auto;
}

#header {
  height: 62px;
  background: rgba(8, 10, 13, 0.86);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.logo-img {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 8px 18px rgba(45, 212, 191, 0.22));
}

.logo-name {
  font-size: 18px;
  letter-spacing: 0;
  -webkit-text-fill-color: currentColor;
  background: none;
  color: var(--text-primary);
}

.logo-sub {
  color: var(--amber-400);
  letter-spacing: 0.18em;
}

#search-bar {
  max-width: 540px;
}

#search-input {
  height: 38px;
  background: rgba(17, 24, 34, 0.84);
  border-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 72px 8px 38px;
}

#search-input:hover,
#search-input:focus {
  border-color: rgba(45, 212, 191, 0.38);
  background: rgba(21, 29, 40, 0.96);
}

.search-icon {
  width: 17px;
  height: 17px;
  left: 13px;
  color: var(--text-muted);
}

.search-kbd {
  right: 10px;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

#admin-link,
.footer-btn,
.btn {
  border-radius: 6px;
}

#sidebar,
#toc {
  background: rgba(9, 13, 19, 0.92);
}

#content {
  padding: 34px clamp(22px, 4vw, 46px);
}

.home-hero-row {
  align-items: stretch;
  gap: 22px;
  margin-bottom: 26px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.10), rgba(245, 158, 11, 0.06) 48%, rgba(17, 24, 34, 0.82));
  box-shadow: var(--shadow-md);
}

.home-hero {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-eyebrow {
  width: fit-content;
  margin-bottom: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 6px;
  color: var(--amber-300);
  background: rgba(251, 191, 36, 0.07);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1;
  letter-spacing: 0;
  -webkit-text-fill-color: currentColor;
  background: none;
  color: var(--text-primary);
}

.home-hero p {
  max-width: 680px;
  font-size: 15px;
  color: var(--text-secondary);
}

.home-stats {
  gap: 10px;
  margin-top: 20px;
}

.home-stat {
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  background: rgba(8, 10, 13, 0.35);
}

.home-stat strong {
  color: var(--amber-300);
}

.site-preview-card {
  width: 300px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0)),
    #0f151e;
  border-color: rgba(255, 255, 255, 0.09);
  box-shadow: none;
}

.site-preview-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.spc-glow-ring {
  display: none;
}

.spc-label {
  color: var(--amber-300);
}

.spc-cover-wrap {
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(45, 212, 191, 0.16), rgba(245, 158, 11, 0.10)),
    #0b1118;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.spc-refresh {
  border-radius: 6px;
  background: rgba(8, 10, 13, 0.72);
}

.category-grid {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.category-card {
  min-height: 154px;
  padding: 16px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0)),
    var(--bg-card);
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: none;
}

.category-card::before {
  height: 100%;
  width: 3px;
  right: auto;
  background: linear-gradient(180deg, var(--card-accent, var(--teal-400)), transparent);
  opacity: 0.85;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.card-icon {
  width: 38px;
  height: 38px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.12);
  background: color-mix(in srgb, var(--card-accent, var(--teal-400)) 16%, transparent);
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 800;
}

.card-title-group {
  min-width: 0;
}

.card-name {
  margin: 0 0 2px;
  font-size: 14px;
}

.card-count {
  margin: 0;
  color: var(--card-accent, var(--teal-400));
}

.card-sub {
  min-height: 34px;
  color: var(--text-secondary);
}

.card-preview {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}

.card-preview img,
.card-preview span {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: var(--bg-elevated);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.category-header {
  padding: 18px 0;
}

.section-anchor {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.bookmark-list {
  gap: 5px;
}

.bookmark-item {
  min-height: 42px;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
}

.bookmark-item::before {
  display: none;
}

.bookmark-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.08);
}

.favicon-wrapper,
.favicon {
  width: 26px;
  height: 26px;
}

.bookmark-link {
  color: var(--text-primary);
  font-size: 13px;
}

.bookmark-link:hover {
  color: var(--teal-300);
}

.bookmark-domain {
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.copy-btn {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 6px;
}

.bookmark-item:hover .copy-btn {
  border-color: rgba(255, 255, 255, 0.08);
}

.recent-link-card {
  margin-top: 18px;
  max-width: 520px;
  border-radius: 8px;
  border-left: none;
  background: rgba(8, 10, 13, 0.34);
  border-color: rgba(255, 255, 255, 0.07);
}

.recent-label {
  color: var(--amber-300);
}

#search-modal {
  max-width: 720px;
  border-radius: 8px;
  background: #0f151e;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.56);
}

.search-result-item {
  min-height: 52px;
  margin: 0 8px;
  border-radius: 8px;
}

.search-result-item:hover,
.search-result-item.focused {
  background: rgba(45, 212, 191, 0.08);
}

#site-footer {
  background: #080a0d;
  border-top-color: rgba(255, 255, 255, 0.07);
}

body.compact .bookmark-item {
  min-height: 32px;
  padding: 4px 8px;
}

@media (max-width: 860px) {
  .home-hero-row {
    padding: 20px;
  }

  .site-preview-card {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 720px) {
  #header {
    height: var(--header-h);
  }

  .search-kbd {
    display: none;
  }

  #search-input {
    padding-right: 12px;
  }

  #content {
    padding: 16px;
  }

  .home-hero-row {
    gap: 18px;
    margin-bottom: 18px;
  }

  .home-hero h1 {
    font-size: 36px;
  }

  .home-stat {
    flex: 1 1 130px;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .bookmark-item {
    align-items: flex-start;
  }

  .bookmark-domain,
  .tags-list {
    display: none;
  }

  .search-footer {
    flex-wrap: wrap;
  }
}

.sidebar-item-icon {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--text-secondary);
}

.sidebar-item.active .sidebar-item-icon {
  color: var(--teal-300);
}

.card-preview img,
.card-preview span {
  display: inline-block;
}

.bookmark-main {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.pinned-indicator {
  margin-right: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 5px;
  background: rgba(251, 191, 36, 0.08);
  color: var(--amber-300);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
