/* ==========================================================================
   OnionLinkHub theme layer
   Loaded after styles.css (Bootstrap 5.2 + legacy rules). Re-themes Bootstrap
   through its CSS variables so every template picks up the same look without
   per-page edits. No external fonts: system stack keeps the site fast and
   private on Tor (no third-party requests).
   ========================================================================== */

:root {
  /* Surfaces */
  --olh-bg: #0a0d14;
  --olh-bg-2: #0e121c;
  --olh-surface: #131826;
  --olh-surface-2: #1a2032;
  --olh-surface-3: #222a3f;
  --olh-border: rgba(255, 255, 255, 0.08);
  --olh-border-strong: rgba(255, 255, 255, 0.14);

  /* Text */
  --olh-text: #e7e9f0;
  --olh-text-2: #b4bacb;
  --olh-muted: #8790a6;

  /* Brand (onion violet) */
  --olh-brand: #b67cdc;
  --olh-brand-rgb: 182, 124, 220;
  --olh-brand-strong: #9a58c7;
  --olh-brand-soft: rgba(182, 124, 220, 0.14);
  --olh-brand-text: #d7b6f0;

  /* Status */
  --olh-success: #3ccf8e;
  --olh-success-rgb: 60, 207, 142;
  --olh-danger: #f2676b;
  --olh-danger-rgb: 242, 103, 107;
  --olh-warning: #f5b94a;
  --olh-warning-rgb: 245, 185, 74;
  --olh-info: #6cb6ff;

  --olh-radius-sm: 8px;
  --olh-radius: 12px;
  --olh-radius-lg: 18px;
  --olh-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --olh-shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 18px 48px rgba(0, 0, 0, 0.45);
  --olh-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --olh-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Bootstrap variable mapping */
  --bs-body-bg: var(--olh-bg);
  --bs-body-color: var(--olh-text);
  --bs-body-font-family: var(--olh-font);
  --bs-emphasis-color: #fff;
  --bs-secondary-color: var(--olh-muted);
  --bs-border-color: var(--olh-border);
  --bs-primary: var(--olh-brand);
  --bs-primary-rgb: var(--olh-brand-rgb);
  --bs-info: var(--olh-brand);
  --bs-info-rgb: var(--olh-brand-rgb);
  --bs-success-rgb: var(--olh-success-rgb);
  --bs-danger-rgb: var(--olh-danger-rgb);
  --bs-warning-rgb: var(--olh-warning-rgb);
  --bs-link-color: var(--olh-brand-text);
  --bs-link-hover-color: #fff;
  --bs-border-radius: var(--olh-radius-sm);
  color-scheme: dark;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
/* Belt-and-braces against stray horizontal scroll on phones (clip, unlike hidden, keeps position: sticky working). */
html, body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  font-family: var(--olh-font);
  background-color: var(--olh-bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(var(--olh-brand-rgb), 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(80, 120, 255, 0.07), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--olh-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--olh-font);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
p { color: inherit; }
code, kbd, pre, .font-monospace { font-family: var(--olh-mono); }

a { color: var(--olh-brand-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }

::selection { background: rgba(var(--olh-brand-rgb), 0.45); color: #fff; }

:focus-visible { outline: 2px solid var(--olh-brand); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(var(--olh-brand-rgb), 0.35) !important;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--olh-bg); }
::-webkit-scrollbar-thumb { background: var(--olh-surface-3); border-radius: 10px; border: 2px solid var(--olh-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--olh-brand-strong); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 2000;
  background: var(--olh-brand); color: #fff; padding: .5rem 1rem; border-radius: var(--olh-radius-sm);
}
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Colour utilities (unify legacy teal/blue onto brand) ---------- */
.text-primary, .text-info, .link-info { color: var(--olh-brand-text) !important; }
.text-muted, .text-secondary { color: var(--olh-muted) !important; }
.text-white-50 { color: rgba(231, 233, 240, 0.62) !important; }
.text-light { color: var(--olh-text) !important; }
.text-success { color: var(--olh-success) !important; }
.text-danger { color: var(--olh-danger) !important; }
.text-warning { color: var(--olh-warning) !important; }
.text-gradient {
  background: linear-gradient(90deg, #fff 0%, var(--olh-brand-text) 60%, var(--olh-brand) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.bg-primary, .bg-info { background-color: var(--olh-brand-strong) !important; color: #fff !important; }
.bg-secondary { background-color: rgba(255, 255, 255, 0.08) !important; }
.bg-dark { background-color: var(--olh-surface) !important; }
.bg-success { background-color: rgba(var(--olh-success-rgb), 0.18) !important; color: var(--olh-success) !important; }
.bg-danger { background-color: rgba(var(--olh-danger-rgb), 0.18) !important; color: var(--olh-danger) !important; }
.bg-warning { background-color: rgba(var(--olh-warning-rgb), 0.18) !important; color: var(--olh-warning) !important; }
.border-secondary, .border-light, .border-dark { border-color: var(--olh-border) !important; }

/* ---------- Buttons ---------- */
.btn {
  --bs-btn-font-weight: 600;
  --bs-btn-border-radius: 10px;
  padding: .5rem 1rem;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .005em;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn-sm { padding: .3rem .7rem; font-size: .82rem; border-radius: 8px; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.02rem; border-radius: 12px; }
.btn:active { transform: translateY(1px); }

.btn-primary, .btn-info {
  color: #fff !important;
  background: linear-gradient(180deg, var(--olh-brand) 0%, var(--olh-brand-strong) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 6px 18px rgba(var(--olh-brand-rgb), 0.25);
}
.btn-primary:hover, .btn-info:hover, .btn-primary:focus, .btn-info:focus {
  color: #fff !important;
  background: linear-gradient(180deg, #c590e6 0%, var(--olh-brand) 100%);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 8px 24px rgba(var(--olh-brand-rgb), 0.35);
}
.btn-success {
  color: #062b1b !important; background: var(--olh-success); border-color: var(--olh-success);
}
.btn-success:hover { color: #062b1b !important; background: #5bdca2; border-color: #5bdca2; }
.btn-danger { background: var(--olh-danger); border-color: var(--olh-danger); color: #fff; }

.btn-outline-light, .btn-outline-secondary, .btn-outline-info, .btn-outline-primary, .btn-dark-custom, .btn-ghost {
  color: var(--olh-text) !important;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--olh-border-strong);
}
.btn-outline-light:hover, .btn-outline-secondary:hover, .btn-outline-info:hover, .btn-outline-primary:hover, .btn-dark-custom:hover, .btn-ghost:hover {
  color: #fff !important;
  background: rgba(var(--olh-brand-rgb), 0.14);
  border-color: rgba(var(--olh-brand-rgb), 0.55);
}
.btn-outline-success { color: var(--olh-success); border-color: rgba(var(--olh-success-rgb), 0.45); background: transparent; }
.btn-outline-success:hover { color: #062b1b; background: var(--olh-success); border-color: var(--olh-success); }
.btn-outline-danger { color: var(--olh-danger); border-color: rgba(var(--olh-danger-rgb), 0.45); background: transparent; }
.btn-outline-danger:hover { color: #fff; background: var(--olh-danger); border-color: var(--olh-danger); }
.btn-outline-warning { color: var(--olh-warning); border-color: rgba(var(--olh-warning-rgb), 0.45); }
.btn-outline-warning:hover { color: #2b1d02; background: var(--olh-warning); border-color: var(--olh-warning); }
.btn.active { background: rgba(var(--olh-brand-rgb), 0.2); border-color: rgba(var(--olh-brand-rgb), 0.6); color: #fff; }
.btn-close-white, .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }

/* ---------- Cards & surfaces ---------- */
.card {
  margin: 0;
  background: var(--olh-surface);
  color: var(--olh-text);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  box-shadow: var(--olh-shadow);
  transform: none;
}
.card:hover { transform: none; box-shadow: var(--olh-shadow); }
.card-header, .card-footer {
  background: transparent;
  color: var(--olh-text);
  border-color: var(--olh-border);
  font-size: 1rem;
}
.card.down { border-color: rgba(var(--olh-danger-rgb), 0.35); }
.card.verified { border-color: var(--olh-border); }
.offline-overlay::before { display: none; }
.surface {
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius-lg);
  box-shadow: var(--olh-shadow);
}

/* ---------- Forms ---------- */
.form-control, .form-select, .bg-dark-input {
  background-color: var(--olh-bg-2) !important;
  color: var(--olh-text) !important;
  border: 1px solid var(--olh-border-strong) !important;
  border-radius: 10px;
  padding: .6rem .85rem;
}
.form-select { padding-right: 2.25rem; }
.form-control-sm, .form-select-sm { padding: .35rem .65rem; font-size: .875rem; border-radius: 8px; }
.form-control::placeholder { color: #6a7287; }
.form-control:focus, .form-select:focus {
  border-color: rgba(var(--olh-brand-rgb), 0.7) !important;
  background-color: var(--olh-bg-2) !important;
}
.form-label, label { color: var(--olh-text-2); font-weight: 500; }
.form-text, .helptext { color: var(--olh-muted) !important; }
.form-check-input { background-color: var(--olh-surface-2); border-color: var(--olh-border-strong); }
.form-check-input:checked { background-color: var(--olh-brand-strong); border-color: var(--olh-brand-strong); }
.input-group-text { background: var(--olh-surface-2); color: var(--olh-text-2); border-color: var(--olh-border-strong); }
.invalid-feedback, .errorlist { color: var(--olh-danger); }
ul.errorlist { list-style: none; padding: 0; margin: .25rem 0; font-size: .875rem; }

/* ---------- Badges ---------- */
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 999px; padding: .35em .7em; }
.badge.bg-primary { font-size: .72rem; text-transform: none; letter-spacing: .02em; }

/* ---------- Dropdowns, nav, pagination, alerts, tables ---------- */
.dropdown-menu, .dropdown-menu-dark {
  --bs-dropdown-bg: var(--olh-surface-2);
  --bs-dropdown-link-color: var(--olh-text);
  --bs-dropdown-link-hover-bg: rgba(var(--olh-brand-rgb), 0.16);
  --bs-dropdown-link-hover-color: #fff;
  --bs-dropdown-link-active-bg: var(--olh-brand-strong);
  --bs-dropdown-divider-bg: var(--olh-border);
  background: var(--olh-surface-2);
  border: 1px solid var(--olh-border-strong) !important;
  border-radius: var(--olh-radius);
  box-shadow: var(--olh-shadow-lg);
  padding: .4rem;
}
.dropdown-item { border-radius: 8px; padding: .5rem .75rem; color: var(--olh-text); font-size: .925rem; }
.dropdown-item:hover, .dropdown-item:focus { background: rgba(var(--olh-brand-rgb), 0.16); color: #fff; }

.nav-tabs { border-bottom-color: var(--olh-border); }
.nav-tabs .nav-link { color: var(--olh-muted); border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link:hover { color: #fff; border-color: transparent; }
.nav-tabs .nav-link.active { color: #fff; background: transparent; border-bottom-color: var(--olh-brand); }
.nav-pills .nav-link { background: rgba(255, 255, 255, 0.04); color: var(--olh-text-2); border-radius: 999px; font-weight: 600; }
.nav-pills .nav-link:hover { background: rgba(var(--olh-brand-rgb), 0.15); color: #fff; }
.nav-pills .nav-link.active { background: var(--olh-brand-strong); color: #fff; }

.pagination { --bs-pagination-bg: var(--olh-surface); --bs-pagination-border-color: var(--olh-border); gap: .3rem; }
.page-link, .page-link.bg-dark {
  background: var(--olh-surface) !important;
  color: var(--olh-text) !important;
  border: 1px solid var(--olh-border) !important;
  border-radius: 8px !important;
  min-width: 2.25rem; text-align: center;
}
.page-link:hover { background: rgba(var(--olh-brand-rgb), 0.15) !important; color: #fff !important; }
.page-item.active .page-link { background: var(--olh-brand-strong) !important; border-color: var(--olh-brand-strong) !important; color: #fff !important; }
.page-item.disabled .page-link { color: var(--olh-muted) !important; background: transparent !important; }

.alert { border-radius: var(--olh-radius); border: 1px solid var(--olh-border); background: var(--olh-surface); color: var(--olh-text); }
.alert-success { border-color: rgba(var(--olh-success-rgb), .35); background: rgba(var(--olh-success-rgb), .08); }
.alert-danger, .alert-error { border-color: rgba(var(--olh-danger-rgb), .35); background: rgba(var(--olh-danger-rgb), .08); }
.alert-warning { border-color: rgba(var(--olh-warning-rgb), .35); background: rgba(var(--olh-warning-rgb), .08); }
.alert-info, .alert-secondary { border-color: rgba(var(--olh-brand-rgb), .3); background: rgba(var(--olh-brand-rgb), .07); }
.alert .btn-close { filter: invert(1); }

.table { --bs-table-bg: transparent; --bs-table-color: var(--olh-text); --bs-table-border-color: var(--olh-border); --bs-table-striped-bg: rgba(255,255,255,.02); --bs-table-hover-bg: rgba(var(--olh-brand-rgb), .06); color: var(--olh-text); }

.tooltip-inner { background: var(--olh-surface-3); color: #fff; border: 1px solid var(--olh-border-strong); }
.modal-content { background: var(--olh-surface); color: var(--olh-text); border: 1px solid var(--olh-border-strong); border-radius: var(--olh-radius-lg); }
.modal-header, .modal-footer { border-color: var(--olh-border); }
.list-group-item { background: var(--olh-surface); color: var(--olh-text); border-color: var(--olh-border); }
.progress { background: rgba(255,255,255,.07); border-radius: 999px; }
.progress-bar { background: var(--olh-brand); }
hr { border-color: var(--olh-border); opacity: 1; }

/* ==========================================================================
   Site chrome
   ========================================================================== */

/* Top notice bar */
.olh-topbar {
  font-size: .82rem;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--olh-border);
  color: var(--olh-text-2);
}
.olh-topbar .container { min-height: 36px; }
.olh-topbar a { color: var(--olh-brand-text); text-decoration: none; font-weight: 600; }
.olh-topbar a:hover { color: #fff; }
.olh-topbar .onion-addr { font-family: var(--olh-mono); font-size: .76rem; color: var(--olh-muted); }
.olh-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.olh-dot.on { background: var(--olh-success); box-shadow: 0 0 0 3px rgba(var(--olh-success-rgb), .2); }
.olh-dot.off { background: var(--olh-danger); box-shadow: 0 0 0 3px rgba(var(--olh-danger-rgb), .2); }
.olh-dot.warn { background: var(--olh-warning); box-shadow: 0 0 0 3px rgba(var(--olh-warning-rgb), .2); }

/* Navbar */
.olh-nav {
  background: rgba(10, 13, 20, 0.78);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--olh-border);
  padding-top: .6rem; padding-bottom: .6rem;
}
.olh-nav .navbar-brand { font-weight: 800; letter-spacing: -0.02em; font-size: 1.2rem; color: #fff; gap: .55rem; }
.olh-nav .navbar-brand img { filter: drop-shadow(0 4px 12px rgba(var(--olh-brand-rgb), .45)); }
.olh-nav .nav-link {
  color: var(--olh-text-2);
  font-weight: 500;
  font-size: .94rem;
  padding: .45rem .8rem !important;
  border-radius: 8px;
  transition: color .15s, background-color .15s;
}
.olh-nav .nav-link:hover, .olh-nav .nav-link:focus, .olh-nav .nav-link.show { color: #fff; background: rgba(255, 255, 255, 0.05); }
.olh-nav .nav-link.active { color: #fff; background: rgba(var(--olh-brand-rgb), 0.14); }
.olh-nav .navbar-toggler { border: 1px solid var(--olh-border-strong); padding: .35rem .55rem; border-radius: 8px; }
.olh-nav .navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(var(--olh-brand-rgb), .35); }
.olh-nav .dropdown-menu { margin-top: .5rem; min-width: 14rem; }
.olh-nav .dropdown-item i { width: 1.25rem; color: var(--olh-brand-text); }
.olh-nav .user-chip {
  display: inline-flex; align-items: center; gap: .5rem;
}
.olh-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: linear-gradient(135deg, var(--olh-brand), #6b7cff);
  color: #fff; font-weight: 700; font-size: .8rem;
}
.olh-nav-search { position: relative; }
.olh-nav-search .form-control { padding-left: 2.1rem; width: 230px; font-size: .88rem; padding-top: .4rem; padding-bottom: .4rem; }
.olh-nav-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--olh-muted); font-size: .85rem; pointer-events: none; }
@media (max-width: 991.98px) {
  .olh-nav .navbar-collapse { padding: .75rem 0 .5rem; }
  .olh-nav-search .form-control { width: 100%; }
  .olh-nav .navbar-nav .dropdown-menu { background: transparent; border: 0 !important; box-shadow: none; padding-left: .5rem; }
}

/* Main */
.olh-main { padding-top: 2.5rem; padding-bottom: 3rem; }
.olh-main > .container { padding-left: 0; padding-right: 0; }

/* Flash messages */
.olh-messages { position: relative; z-index: 5; }

/* Footer */
.olh-footer {
  display: block !important; /* legacy CSS turns <footer> into a flex row */
  width: 100%;
  margin-top: auto;
  border-top: 1px solid var(--olh-border);
  background: linear-gradient(180deg, rgba(14, 18, 28, 0.6) 0%, var(--olh-bg-2) 100%);
  color: var(--olh-text-2);
  font-size: .92rem;
}
.olh-footer h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--olh-muted); font-weight: 700; margin-bottom: .9rem; }
.olh-footer ul { list-style: none; padding: 0; margin: 0; }
.olh-footer li { margin-bottom: .45rem; }
.olh-footer a { color: var(--olh-text-2); text-decoration: none; }
.olh-footer a:hover { color: #fff; }
.olh-footer .policy-note { border-top: 1px solid var(--olh-border); color: var(--olh-muted); font-size: .82rem; }

#back-to-top {
  position: fixed; right: 20px; bottom: 20px; z-index: 1030;
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--olh-surface-2); color: #fff;
  border: 1px solid var(--olh-border-strong);
  box-shadow: var(--olh-shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .2s, transform .2s, background-color .2s;
}
#back-to-top.show { opacity: 1; pointer-events: auto; transform: none; }
#back-to-top:hover { background: var(--olh-brand-strong); }

/* ==========================================================================
   Page components
   ========================================================================== */

.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--olh-brand-text);
}
.section { padding: 3.5rem 0; }
.section-head { margin-bottom: 2rem; }
.section-head h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin-bottom: .4rem; }
.section-head p { color: var(--olh-muted); margin: 0; }
.section-head .see-all { font-weight: 600; text-decoration: none; white-space: nowrap; }

.page-title { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); margin-bottom: .35rem; }
.page-sub { color: var(--olh-muted); }

/* Hero */
.olh-hero { position: relative; padding: 2.5rem 0 3rem; }
.olh-hero h1 {
  font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.8rem);
  line-height: 1.05; letter-spacing: -0.035em; font-weight: 800;
  margin-bottom: 1.1rem;
}
.olh-hero .lead { color: var(--olh-text-2); font-size: clamp(1.02rem, .95rem + .3vw, 1.18rem); max-width: 38rem; }
.hero-search {
  display: flex; align-items: center; gap: .5rem;
  max-width: 560px;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border-strong);
  border-radius: 14px;
  padding: .4rem .4rem .4rem 1rem;
  box-shadow: var(--olh-shadow-lg);
}
.hero-search:focus-within { border-color: rgba(var(--olh-brand-rgb), .7); box-shadow: 0 0 0 4px rgba(var(--olh-brand-rgb), .15), var(--olh-shadow-lg); }
.hero-search i { color: var(--olh-muted); }
.hero-search input {
  flex: 1; min-width: 0; background: transparent !important; border: 0 !important;
  color: #fff; font-size: 1rem; padding: .5rem 0; outline: none; box-shadow: none !important;
}
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .75rem; border-radius: 999px;
  font-size: .82rem; font-weight: 500;
  color: var(--olh-text-2); text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--olh-border);
  transition: all .15s;
}
.chip:hover { color: #fff; border-color: rgba(var(--olh-brand-rgb), .55); background: rgba(var(--olh-brand-rgb), .12); }
.chip.active { color: #fff; background: rgba(var(--olh-brand-rgb), .2); border-color: rgba(var(--olh-brand-rgb), .6); }
.chip .count { color: var(--olh-muted); font-variant-numeric: tabular-nums; }

.hero-panel {
  background: linear-gradient(180deg, var(--olh-surface-2) 0%, var(--olh-surface) 100%);
  border: 1px solid var(--olh-border-strong);
  border-radius: var(--olh-radius-lg);
  box-shadow: var(--olh-shadow-lg);
  padding: 1.25rem;
  position: relative;
}
.hero-panel::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(140deg, rgba(var(--olh-brand-rgb), .6), transparent 40%, transparent 70%, rgba(108, 124, 255, .4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.status-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .25rem; border-bottom: 1px solid var(--olh-border);
  text-decoration: none; color: var(--olh-text);
}
.status-row:last-child { border-bottom: 0; }
.status-row:hover { color: #fff; }
.status-row .name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-row .meta { color: var(--olh-muted); font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Stats */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media (max-width: 767.98px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  padding: 1.1rem 1.25rem;
}
.stat .num { font-size: 1.75rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .lbl { color: var(--olh-muted); font-size: .85rem; margin-top: .25rem; }

/* Feature tiles (not ".feature": the legacy theme uses that name for 4rem icon boxes) */
.feature-card {
  height: 100%;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius-lg);
  padding: 1.5rem;
}
.feature-card h3 { font-size: 1.08rem; margin: 1rem 0 .5rem; }
.feature-card p { color: var(--olh-muted); margin: 0; font-size: .95rem; }
.icon-tile {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-grid; place-items: center;
  background: rgba(var(--olh-brand-rgb), .14);
  color: var(--olh-brand-text);
  border: 1px solid rgba(var(--olh-brand-rgb), .28);
  font-size: 1.2rem;
}

/* Category tiles */
.cat-tile {
  display: flex; align-items: center; gap: .9rem;
  padding: 1rem 1.1rem;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  color: var(--olh-text); text-decoration: none;
  transition: border-color .15s, background-color .15s, transform .15s;
  height: 100%;
}
.cat-tile:hover { color: #fff; border-color: rgba(var(--olh-brand-rgb), .5); background: var(--olh-surface-2); transform: translateY(-2px); }
.cat-tile .name { font-weight: 600; line-height: 1.2; }
.cat-tile .count { color: var(--olh-muted); font-size: .82rem; }
.cat-tile .bi-arrow-right { margin-left: auto; color: var(--olh-muted); transition: transform .15s, color .15s; }
.cat-tile:hover .bi-arrow-right { transform: translateX(3px); color: var(--olh-brand-text); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.checklist li { display: flex; gap: .75rem; align-items: flex-start; color: var(--olh-text-2); }
.checklist i { color: var(--olh-success); margin-top: .15rem; }

/* CTA band */
.cta-band {
  border-radius: var(--olh-radius-lg);
  padding: 2rem;
  background:
    radial-gradient(600px 200px at 0% 0%, rgba(var(--olh-brand-rgb), .25), transparent 70%),
    radial-gradient(500px 200px at 100% 100%, rgba(108, 124, 255, .18), transparent 70%),
    var(--olh-surface);
  border: 1px solid var(--olh-border-strong);
}

/* ==========================================================================
   Link card
   ========================================================================== */
.lc {
  position: relative;
  display: flex; flex-direction: column;
  height: 100%;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  overflow: hidden;
  box-shadow: var(--olh-shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.lc:hover { transform: translateY(-3px); border-color: var(--olh-border-strong); box-shadow: var(--olh-shadow-lg); }
.lc.is-featured { border-color: rgba(var(--olh-brand-rgb), .45); box-shadow: 0 0 0 1px rgba(var(--olh-brand-rgb), .15), var(--olh-shadow); }
.lc.is-down .lc-media img { filter: grayscale(.85) brightness(.75); }

.lc-media {
  position: relative; display: block;
  aspect-ratio: 16 / 9;
  background: var(--olh-bg-2);
  overflow: hidden;
  border-bottom: 1px solid var(--olh-border);
}
.lc-media img, .lr-thumb img { position: relative; z-index: 1; }
.lc-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .4s ease; }
.lc:hover .lc-media img { transform: scale(1.03); }
.lc-media.no-img { aspect-ratio: 3 / 1; }
.lc-monogram {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 20%, rgba(var(--olh-brand-rgb), .28), transparent 55%),
    radial-gradient(circle at 80% 90%, rgba(108, 124, 255, .22), transparent 55%),
    linear-gradient(135deg, #151b2b, #0d111b);
}
.lc-monogram span {
  font-size: 2.6rem; font-weight: 800; letter-spacing: -0.04em;
  color: rgba(255, 255, 255, .9);
  width: 76px; height: 76px; border-radius: 20px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.lc-status, .lc-flag {
  position: absolute; top: .65rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: .28rem .6rem; border-radius: 999px;
  background: rgba(10, 13, 20, .78);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #fff;
}
.lc-status { left: .65rem; }
.lc-flag { right: .65rem; color: var(--olh-brand-text); border-color: rgba(var(--olh-brand-rgb), .45); }

.lc-body { padding: 1rem 1.1rem .75rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.lc-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: .76rem; color: var(--olh-muted); }
.lc-meta .cat { color: var(--olh-brand-text); font-weight: 600; text-decoration: none; position: relative; z-index: 2; }
.lc-meta .cat:hover { color: #fff; }
.lc-title { font-size: 1.06rem; font-weight: 700; margin: 0; display: flex; align-items: center; gap: .4rem; line-height: 1.3; }
.lc-title a { color: #fff; text-decoration: none; }
.lc-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.lc-title .bi-patch-check-fill { color: var(--olh-info); font-size: .95rem; flex: none; }
.lc-title .bi-patch-check-fill.owner { color: var(--olh-success); }
.lc-desc {
  color: var(--olh-text-2); font-size: .9rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .35rem; position: relative; z-index: 2; }
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 600;
  padding: .22rem .55rem; border-radius: 6px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--olh-border);
  color: var(--olh-text-2);
  text-decoration: none;
  line-height: 1.4;
}
button.tag { cursor: pointer; }
.tag:hover { color: #fff; border-color: var(--olh-border-strong); }
.tag.nsfw { color: var(--olh-danger); border-color: rgba(var(--olh-danger-rgb), .35); background: rgba(var(--olh-danger-rgb), .08); }
.tag.mono { font-family: var(--olh-mono); font-weight: 500; }

.lc-foot {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .65rem 1.1rem;
  border-top: 1px solid var(--olh-border);
  background: rgba(255, 255, 255, .015);
  font-size: .82rem;
}
.vote-group { display: inline-flex; gap: .3rem; }
.vote-group form { margin: 0; }
.vote-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .55rem; border-radius: 7px;
  font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--olh-text-2);
  background: transparent; border: 1px solid var(--olh-border);
  transition: all .15s;
}
.vote-btn:hover { color: #fff; border-color: var(--olh-border-strong); background: rgba(255,255,255,.04); }
.vote-btn.up.on { color: var(--olh-success); border-color: rgba(var(--olh-success-rgb), .5); background: rgba(var(--olh-success-rgb), .1); }
.vote-btn.down.on { color: var(--olh-danger); border-color: rgba(var(--olh-danger-rgb), .5); background: rgba(var(--olh-danger-rgb), .1); }
.rating { display: inline-flex; align-items: center; gap: .35rem; color: var(--olh-text-2); text-decoration: none; white-space: nowrap; }
.rating img { width: 16px; height: 16px; }
.rating strong { color: #fff; font-variant-numeric: tabular-nums; }
.rating .muted { color: var(--olh-muted); }
a.rating:hover strong, a.rating:hover { color: #fff; }

/* List (row) variant */
.lr {
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 1rem;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  transition: border-color .15s, background-color .15s;
}
.lr:hover { border-color: var(--olh-border-strong); background: var(--olh-surface-2); }
.lr-thumb { width: 96px; aspect-ratio: 16/10; border-radius: 8px; overflow: hidden; flex: none; position: relative; background: var(--olh-bg-2); border: 1px solid var(--olh-border); }
.lr-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.lr-thumb .lc-monogram span { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 10px; }
.lr-main { flex: 1; min-width: 0; }
.lr-main .lc-desc { -webkit-line-clamp: 1; }
.lr-side { display: flex; align-items: center; gap: 1rem; flex: none; position: relative; z-index: 2; }
@media (max-width: 767.98px) {
  .lr { flex-wrap: wrap; }
  .lr-side { width: 100%; justify-content: space-between; }
  .lr-thumb { width: 72px; }
}

/* Directory toolbar */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  padding: .75rem;
  background: var(--olh-surface);
  border: 1px solid var(--olh-border);
  border-radius: var(--olh-radius);
  margin-bottom: 1rem;
}
.toolbar .search { position: relative; flex: 1 1 260px; }
.toolbar .search i { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--olh-muted); }
.toolbar .search .form-control { padding-left: 2.2rem; }
.toolbar .form-select { width: auto; }
.toolbar .form-check { margin: 0 .25rem; }
.toolbar .divider { width: 1px; align-self: stretch; background: var(--olh-border); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--olh-bg-2); border: 1px solid var(--olh-border); }
.seg a { padding: .3rem .6rem; border-radius: 7px; color: var(--olh-muted); text-decoration: none; }
.seg a.on { background: var(--olh-surface-3); color: #fff; }
.seg a:hover { color: #fff; }
.cat-scroller { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: 1.5rem; scrollbar-width: thin; }
.cat-scroller .chip { flex: none; }
.results-meta { color: var(--olh-muted); font-size: .9rem; }
.results-meta strong { color: #fff; }

.featured-wrap {
  border-radius: var(--olh-radius-lg);
  padding: 1.25rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, rgba(var(--olh-brand-rgb), .08), rgba(var(--olh-brand-rgb), .02));
  border: 1px solid rgba(var(--olh-brand-rgb), .25);
}

.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  border: 1px dashed var(--olh-border-strong);
  border-radius: var(--olh-radius-lg);
  color: var(--olh-muted);
}
.empty-state i { font-size: 2rem; color: var(--olh-brand-text); display: block; margin-bottom: .75rem; }

/* Legacy helpers still used by some templates */
.icon-small { width: 18px; height: auto; }
.bg-dark-gradient { background: linear-gradient(135deg, var(--olh-surface) 0%, var(--olh-surface-2) 100%); }
.text-accent { color: var(--olh-brand-text); }

/* Auth pages */
.auth-wrap { display: flex; justify-content: center; padding: 1rem 0 2rem; }
.auth-card { width: 100%; max-width: 440px; padding: 2rem; }
@media (min-width: 576px) { .auth-card { padding: 2.5rem; } }
.captcha-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.captcha-wrap img.captcha { border-radius: 8px; background: #fff; height: 46px; }
.captcha-wrap input[type=text] { flex: 1; min-width: 140px; }
.captcha-wrap .h-captcha, .captcha-wrap iframe { max-width: 100%; }
.captcha-wrap input[type=text] {
  background: var(--olh-bg-2); color: var(--olh-text);
  border: 1px solid var(--olh-border-strong); border-radius: 10px; padding: .6rem .85rem;
}

.icon-tile.icon-danger { background: rgba(var(--olh-danger-rgb), .14); color: var(--olh-danger); border-color: rgba(var(--olh-danger-rgb), .35); }
.icon-tile.icon-warning { background: rgba(var(--olh-warning-rgb), .14); color: var(--olh-warning); border-color: rgba(var(--olh-warning-rgb), .35); }
.icon-tile.icon-success { background: rgba(var(--olh-success-rgb), .14); color: var(--olh-success); border-color: rgba(var(--olh-success-rgb), .35); }
