/* ============================================================
   Skillget — Design System
   System-aware theming with manual toggle
   ============================================================ */

:root {
  /* --- Dark (default) --- */
  --bg:            #000000;
  --bg-elevated:   #0a0a0a;
  --surface:       #141414;
  --surface-hover: #1a1a1a;
  --border:        rgba(255, 255, 255, 0.06);
  --border-strong: rgba(255, 255, 255, 0.12);

  --text:          #ededed;
  --text-secondary:#a0a0a0;
  --text-muted:    #666666;

  --accent:        #ededed;
  --accent-hover:  #ffffff;
  --accent-glow:   rgba(255, 255, 255, 0.06);

  --teal:          #a0a0a0;
  --teal-dim:      rgba(255, 255, 255, 0.04);

  --green:         #22c55e;
  --green-dim:     rgba(34, 197, 94, 0.08);
  --green-border:  rgba(34, 197, 94, 0.2);

  --red:           #ef4444;
  --red-dim:       rgba(239, 68, 68, 0.08);
  --red-border:    rgba(239, 68, 68, 0.18);

  --yellow:        #eab308;
  --yellow-dim:    rgba(234, 179, 8, 0.08);

  --header-bg:     rgba(0, 0, 0, 0.85);
  --code-bg:       #0a0a0a;
  --code-text:     #d4d4d4;

  --radius-sm:     6px;
  --radius-md:     8px;
  --radius-lg:     10px;
  --radius-xl:     12px;
  --radius-pill:   999px;

  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-lg:     0 4px 16px rgba(0, 0, 0, 0.6);
  --shadow-glow:   none;

  --transition:    0.15s ease;

  color-scheme: dark;
}

/* --- Light theme tokens --- */
:root[data-theme="light"] {
  --bg:            #ffffff;
  --bg-elevated:   #ffffff;
  --surface:       #f5f5f5;
  --surface-hover: #ebebeb;
  --border:        rgba(0, 0, 0, 0.06);
  --border-strong: rgba(0, 0, 0, 0.12);

  --text:          #111111;
  --text-secondary:#555555;
  --text-muted:    #999999;

  --accent:        #111111;
  --accent-hover:  #000000;
  --accent-glow:   rgba(0, 0, 0, 0.04);

  --teal:          #555555;
  --teal-dim:      rgba(0, 0, 0, 0.03);

  --green:         #16a34a;
  --green-dim:     rgba(22, 163, 74, 0.06);
  --green-border:  rgba(22, 163, 74, 0.18);

  --red:           #dc2626;
  --red-dim:       rgba(220, 38, 38, 0.06);
  --red-border:    rgba(220, 38, 38, 0.15);

  --yellow:        #ca8a04;
  --yellow-dim:    rgba(202, 138, 4, 0.06);

  --header-bg:     rgba(255, 255, 255, 0.88);
  --code-bg:       #f5f5f5;
  --code-text:     #1a1a1a;

  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md:     0 2px 8px rgba(0, 0, 0, 0.07);
  --shadow-lg:     0 4px 16px rgba(0, 0, 0, 0.09);
  --shadow-glow:   none;

  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg:            #ffffff;
    --bg-elevated:   #ffffff;
    --surface:       #f5f5f5;
    --surface-hover: #ebebeb;
    --border:        rgba(0, 0, 0, 0.06);
    --border-strong: rgba(0, 0, 0, 0.12);

    --text:          #111111;
    --text-secondary:#555555;
    --text-muted:    #999999;

    --accent:        #111111;
    --accent-hover:  #000000;
    --accent-glow:   rgba(0, 0, 0, 0.04);

    --teal:          #555555;
    --teal-dim:      rgba(0, 0, 0, 0.03);

    --green:         #16a34a;
    --green-dim:     rgba(22, 163, 74, 0.06);
    --green-border:  rgba(22, 163, 74, 0.18);

    --red:           #dc2626;
    --red-dim:       rgba(220, 38, 38, 0.06);
    --red-border:    rgba(220, 38, 38, 0.15);

    --yellow:        #ca8a04;
    --yellow-dim:    rgba(202, 138, 4, 0.06);

    --header-bg:     rgba(255, 255, 255, 0.88);
    --code-bg:       #f5f5f5;
    --code-text:     #1a1a1a;

    --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md:     0 2px 8px rgba(0, 0, 0, 0.07);
    --shadow-lg:     0 4px 16px rgba(0, 0, 0, 0.09);
    --shadow-glow:   none;

    color-scheme: light;
  }
}

/* --- Retro (teletext) theme --- */
:root[data-theme="retro"] {
  --bg:            #000000;
  --bg-elevated:   #000000;
  --surface:       #111111;
  --surface-hover: #1a1a1a;
  --border:        rgba(255, 255, 255, 0.15);
  --border-strong: rgba(255, 255, 255, 0.25);

  --text:          #ffffff;
  --text-secondary:#00ff00;
  --text-muted:    #ffff00;

  --accent:        #00ffff;
  --accent-hover:  #ffffff;
  --accent-glow:   none;

  --teal:          #00ffff;
  --teal-dim:      rgba(0, 255, 255, 0.08);

  --green:         #00ff00;
  --green-dim:     rgba(0, 255, 0, 0.1);
  --green-border:  rgba(0, 255, 0, 0.3);

  --red:           #ff0000;
  --red-dim:       rgba(255, 0, 0, 0.1);
  --red-border:    rgba(255, 0, 0, 0.3);

  --yellow:        #ffff00;
  --yellow-dim:    rgba(255, 255, 0, 0.1);

  --header-bg:     #000000;
  --code-bg:       #111111;
  --code-text:     #00ff00;

  --shadow-sm:     none;
  --shadow-md:     none;
  --shadow-lg:     none;
  --shadow-glow:   none;

  color-scheme: dark;
}

:root[data-theme="retro"] body {
  font-family: "Courier New", "Consolas", monospace;
}
:root[data-theme="retro"] .brand-mark strong {
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
:root[data-theme="retro"] .listing-type-pill,
:root[data-theme="retro"] .tag-pill,
:root[data-theme="retro"] .status-badge,
:root[data-theme="retro"] .client-pill,
:root[data-theme="retro"] .audit-badge,
:root[data-theme="retro"] .rating-chip {
  border-radius: 0;
  text-transform: uppercase;
}
:root[data-theme="retro"] .panel-card,
:root[data-theme="retro"] .listing-card,
:root[data-theme="retro"] .listing-row,
:root[data-theme="retro"] .summary-card,
:root[data-theme="retro"] .readme-card,
:root[data-theme="retro"] .tab-bar,
:root[data-theme="retro"] .view-toggle,
:root[data-theme="retro"] .audit-category {
  border-radius: 0;
}
:root[data-theme="retro"] input:not([type="checkbox"]):not([type="radio"]),
:root[data-theme="retro"] textarea,
:root[data-theme="retro"] select,
:root[data-theme="retro"] .button,
:root[data-theme="retro"] .vote-btn,
:root[data-theme="retro"] .install-hero {
  border-radius: 0;
  font-family: "Courier New", "Consolas", monospace;
}
:root[data-theme="retro"] .tab-btn.active {
  border-bottom-color: #00ffff;
  color: #00ffff;
}
:root[data-theme="retro"] .breadcrumb span,
:root[data-theme="retro"] .meta-label {
  color: #ffff00;
}
:root[data-theme="retro"] a { color: #00ffff; }
:root[data-theme="retro"] a:hover { color: #ffffff; }

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

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: #55efc4; }

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

/* ---- Layout ---- */
.container { width: min(1200px, calc(100% - 2rem)); margin: 0 auto; }
.page-shell { padding: 2rem 0 4rem; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  border-bottom: 1px solid var(--border);
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-mark:hover { text-decoration: none; color: var(--text); }
.brand-mark strong { display: block; font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  justify-content: center;
}
.header-nav a,
.header-nav .link-button {
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.header-nav a:hover,
.header-nav .link-button:hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}
.header-nav form { margin: 0; }

.locale-dropdown {
  position: relative;
  flex-shrink: 0;
  margin-left: auto;
}

.locale-trigger {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}

.locale-trigger:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.locale-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  z-index: 100;
  overflow: hidden;
}

.locale-search {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 8px 12px;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  box-sizing: border-box;
}

.locale-search::placeholder {
  color: var(--text-muted);
}

.locale-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
}

.locale-list li[hidden] {
  display: none;
}

.locale-list a {
  display: block;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: background var(--transition);
}

.locale-list a:hover {
  background: var(--surface);
  color: var(--text);
}

.locale-list a.active {
  color: var(--text);
  font-weight: 600;
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--surface-hover);
  color: var(--text);
}
/* dark mode: show sun, hide moon */
.theme-toggle .icon-sun  { display: block; }
.theme-toggle .icon-moon { display: none; }
/* light mode: show moon, hide sun */
:root[data-theme="light"] .theme-toggle .icon-sun  { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]):not([data-theme="retro"]) .theme-toggle .icon-sun  { display: none; }
  :root:not([data-theme="dark"]):not([data-theme="retro"]) .theme-toggle .icon-moon { display: block; }
}

/* Retro toggle */
.retro-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}
.retro-toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
:root[data-theme="retro"] .retro-toggle {
  color: #00ffff;
  border-color: #00ffff;
}

/* mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle svg { width: 24px; height: 24px; }

/* ---- Form Elements ---- */
input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
input:not([type="checkbox"]):not([type="radio"]):focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input:not([type="checkbox"]):not([type="radio"])::placeholder, textarea::placeholder { color: var(--text-muted); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239499ad' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

/* ---- Buttons ---- */
.link-button, button { font: inherit; }
.link-button {
  background: none;
  border: none;
  color: var(--teal);
  padding: 0;
  cursor: pointer;
  transition: color var(--transition);
}
.link-button:hover { color: #55efc4; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.button-primary {
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.button-primary:hover {
  color: var(--text-secondary);
  transform: none;
}

.button-danger {
  border-color: var(--red-border);
  color: var(--red);
}
.button-danger:hover {
  background: var(--red-dim);
}

.button-block { width: 100%; }

.text-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal);
  transition: color var(--transition);
}
.text-link:hover { color: #55efc4; text-decoration: none; }

/* ---- Flash Messages ---- */
.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
}
.flash-success { background: var(--green-dim); border-color: var(--green-border); color: var(--green); }
.flash-error { background: var(--red-dim); border-color: var(--red-border); color: var(--red); }

/* ============================================================
   Cards & Panels
   ============================================================ */
.panel-card,
.listing-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.panel-card { padding: 1.5rem; }

/* ============================================================
   Home Layout (sidebar + main)
   ============================================================ */
.home-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.home-sidebar {
  position: sticky;
  top: 80px;
  display: grid;
  gap: 1.25rem;
}

.sidebar-search input {
  width: 100%;
}

.sidebar-categories,
.sidebar-filters {
  display: grid;
  gap: 0.3rem;
}
.sidebar-categories h3,
.sidebar-filters h3 {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.sidebar-categories a {
  display: block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.sidebar-categories a:hover {
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.filter-chip {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.65rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.filter-chip:hover {
  background: var(--surface);
  color: var(--text);
}
.filter-chip.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 600;
}

.home-main { min-width: 0; }

/* Lazy load */
.lazy-list > .listing-row { transition: opacity 0.25s ease; }
.lazy-list > .listing-row.lazy-hidden { display: none; }
.lazy-list > .listing-row.lazy-reveal {
  animation: fadeSlideIn 0.2s ease forwards;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lazy-sentinel { height: 1px; }

/* Card grid lazy (same treatment) */
.card-grid > .listing-card.lazy-hidden { display: none; }
.card-grid > .listing-card.lazy-reveal {
  animation: fadeSlideIn 0.2s ease forwards;
}

/* ============================================================
   Content Sections
   ============================================================ */
.content-section { margin-top: 2rem; }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.section-heading h1,
.section-heading h2 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.section-heading h2 { font-size: 1.25rem; }

/* ============================================================
   Tabs & View Toggle
   ============================================================ */
.tab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 600;
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem;
}
.view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
}
.view-btn:hover { color: var(--text-secondary); }
.view-btn.active {
  background: var(--surface-hover);
  color: var(--text);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   List View & Listing Row
   ============================================================ */
.list-view {
  display: grid;
  gap: 0.5rem;
}

a.listing-row,
a.listing-card {
  color: inherit;
  text-decoration: none;
}

.listing-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition), background var(--transition);
}
.listing-row:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.listing-row .listing-type-pill { flex-shrink: 0; }

.listing-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.listing-row-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-row-title:hover { color: var(--teal); text-decoration: none; }
.listing-row-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-row-meta {
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
}
.listing-row-meta small {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* ============================================================
   Card Grid & Listing Card
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.listing-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.listing-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.listing-card h3 { margin: 0.5rem 0; font-size: 0.95rem; font-weight: 600; }
.listing-card h3 a { color: var(--text); }
.listing-card h3 a:hover { color: var(--teal); text-decoration: none; }
.listing-card p { color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }
.listing-card small { color: var(--text-muted); font-size: 0.78rem; }

.listing-card-top { display: flex; justify-content: space-between; gap: 1rem; }
.listing-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.listing-status-group { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }

.listing-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin: 1rem 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.listing-meta-grid strong { color: var(--text-muted); font-weight: 500; }

/* ---- Pills, Badges, Chips ---- */
.listing-type-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.status-badge.verified {
  background: var(--green-dim);
  border-color: var(--green-border);
  color: var(--green);
}

.rating-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--yellow-dim);
  border: 1px solid rgba(253, 203, 110, 0.25);
  color: var(--yellow);
}

.tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.75rem; }

.client-pills { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.client-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--teal-dim);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--accent);
  white-space: nowrap;
}

.client-fieldset {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.client-fieldset legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 0 0.4rem;
}
.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.hero-meta strong { color: var(--text-muted); font-weight: 500; }

/* ============================================================
   Explore Page
   ============================================================ */
.explore-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}

.filter-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}
.filter-panel h1 { font-size: 1.25rem; font-weight: 700; }

.filter-form {
  display: grid;
  gap: 0.85rem;
}
.filter-form label span,
.stack-form label span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-actions { display: flex; gap: 0.5rem; margin-top: 0.25rem; }

.checkbox-row { display: flex; gap: 0.6rem; align-items: center; }
.checkbox-row input {
  width: auto;
  accent-color: var(--accent);
}

.results-panel { min-width: 0; }

/* Empty state */
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.9rem;
}

/* ============================================================
   Listing Detail (skills.sh style)
   ============================================================ */

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--teal); text-decoration: none; }
.breadcrumb span { color: var(--text-muted); }

/* Detail header */
.detail-header { margin-bottom: 1.5rem; }

.detail-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.detail-title-row h1 {
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
}
.detail-title-badges { display: flex; gap: 0.4rem; align-items: center; }

/* Install hero */
.install-hero {
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 600px;
}
.install-hero code {
  flex: 1;
  padding: 0.75rem 1rem;
  font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace;
  font-size: 0.88rem;
  color: var(--teal);
  white-space: nowrap;
  overflow-x: auto;
}
.install-copy {
  padding: 0.75rem 1rem;
  border: none;
  border-left: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition);
}
.install-copy:hover { background: var(--surface-hover); color: var(--text); }

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 1.5rem;
}

.detail-content { min-width: 0; }

/* Summary card */
.summary-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.summary-lead {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.6;
  margin: 0.5rem 0 0;
}
.summary-notes {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* README card */
.readme-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.readme-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.readme-header svg { color: var(--text-muted); }
.readme-card .markdown-body { padding: 1.25rem; }

/* Sidebar */
.detail-sidebar {
  display: grid;
  gap: 1.25rem;
  align-content: start;
}

.sidebar-stat { display: grid; gap: 0.3rem; }

.meta-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.stat-value {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.stat-value-text { font-size: 0.9rem; color: var(--text); }
.stat-value-muted { font-size: 0.82rem; color: var(--text-muted); font-weight: 400; }

.star-icon { color: var(--yellow); }

.sidebar-repo-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
  word-break: break-all;
}
.sidebar-repo-link svg { flex-shrink: 0; color: var(--text-muted); }

.sidebar-client-list,
.sidebar-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.sidebar-actions {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.sidebar-actions form { margin: 0; }

/* Markdown body */
.markdown-body { overflow-wrap: anywhere; color: var(--text-secondary); line-height: 1.75; }
.markdown-body h1, .markdown-body h2, .markdown-body h3,
.markdown-body h4, .markdown-body h5 { color: var(--text); margin: 1.5rem 0 0.5rem; font-weight: 600; }
.markdown-body p { margin: 0.75rem 0; }
.markdown-body a { color: var(--teal); }
.markdown-body pre, .markdown-body code { font-family: "JetBrains Mono", "Consolas", "SFMono-Regular", monospace; }
.markdown-body code {
  background: var(--surface);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--teal);
}
.markdown-body pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  border: 1px solid var(--border);
  margin: 1rem 0;
}
.markdown-body pre code { background: none; padding: 0; color: inherit; }
.markdown-body img { border-radius: var(--radius-md); margin: 1rem 0; }
.markdown-body ul, .markdown-body ol { padding-left: 1.5rem; }
.markdown-body li { margin: 0.3rem 0; }
.markdown-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  color: var(--text-muted);
  margin: 1rem 0;
}

/* Mini list (related) */
.mini-list { display: grid; gap: 0.5rem; }
.mini-list a {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  transition: color var(--transition);
}
.mini-list a:last-child { border-bottom: none; }
.mini-list a:hover { text-decoration: none; }

/* Review actions */
.review-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ============================================================
   Vote Row (Like button)
   ============================================================ */
.vote-row {
  display: flex;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.vote-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}
.vote-btn.vote-active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.vote-btn svg { flex-shrink: 0; }

/* Review login prompt */
.review-login-card {
  padding: 1.5rem;
  text-align: center;
}
.review-login-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

/* ============================================================
   Security Audit
   ============================================================ */
.audit-overall {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audit-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.audit-badge-sm { font-size: 0.65rem; padding: 0.12rem 0.45rem; }

.audit-badge-pass { background: var(--green-dim); border: 1px solid var(--green-border); color: var(--green); }
.audit-badge-warn { background: var(--yellow-dim); border: 1px solid rgba(253, 203, 110, 0.25); color: var(--yellow); }
.audit-badge-fail { background: var(--red-dim); border: 1px solid var(--red-border); color: var(--red); }

.audit-checks { display: grid; gap: 0.35rem; margin-top: 0.5rem; }

.audit-category {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.audit-category summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background var(--transition);
  list-style: none;
}
.audit-category summary::-webkit-details-marker { display: none; }
.audit-category summary:hover { background: var(--surface); }
.audit-cat-name { flex: 1; font-weight: 500; }

.audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.audit-dot-pass { background: var(--green); }
.audit-dot-warn { background: var(--yellow); }
.audit-dot-fail { background: var(--red); }

.audit-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--border);
}
.audit-detail-item {
  display: flex;
  align-items: start;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.audit-detail-item .audit-dot { margin-top: 0.3rem; }
.audit-detail-item strong { color: var(--text); font-weight: 600; }

/* ============================================================
   Reviews
   ============================================================ */
.review-form-card { padding: 1.5rem; }
.review-list { display: grid; gap: 1rem; }
.review-card { padding: 1.25rem; }
.review-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.review-head strong { color: var(--text); font-size: 0.9rem; }
.review-head small { color: var(--text-muted); font-size: 0.78rem; }
.review-card p { color: var(--text-secondary); font-size: 0.9rem; margin: 0.5rem 0; }
.inline-report-form { display: inline; }

/* ============================================================
   Auth / Single Panel
   ============================================================ */
.single-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}
.narrow { max-width: 480px; width: 100%; text-align: center; }
.narrow h1 { margin-bottom: 0.75rem; }
.narrow p { color: var(--text-secondary); margin-bottom: 1.5rem; }
.status-code {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Forms (Stack)
   ============================================================ */
.stack-form { display: grid; gap: 1rem; }
.stack-list { display: grid; gap: 0.75rem; }
.two-column { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

/* ============================================================
   Admin
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.admin-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color var(--transition);
}
.admin-item:hover { border-color: var(--border-strong); }
.admin-item strong { color: var(--text); font-size: 0.9rem; }
.admin-item p { color: var(--text-secondary); font-size: 0.82rem; margin: 0.25rem 0 0; }
.admin-item small { color: var(--text-muted); font-size: 0.78rem; }

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; flex-shrink: 0; }

.discover-panel { grid-column: 1 / -1; }

.discover-forms {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.discover-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.discover-form h3 {
  font-size: 0.9rem;
  margin: 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.discover-form label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.discover-form small {
  color: var(--text-muted);
}

.discover-form textarea,
.discover-form input[type="url"],
.discover-form input[type="number"],
.discover-form select {
  padding: 0.5rem;
  font-size: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.discover-form textarea {
  resize: vertical;
  font-family: inherit;
}

.discover-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.discover-row label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.discover-row input[type="number"] {
  width: 70px;
}

/* ============================================================
   Profile
   ============================================================ */
.profile-header { margin-bottom: 1.5rem; }
.profile-header p { color: var(--text-secondary); margin-top: 0.25rem; }

/* ============================================================
   Pagination
   ============================================================ */
.pagination { display: flex; gap: 0.4rem; margin-top: 1.5rem; flex-wrap: wrap; }
.pagination a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.pagination a:hover {
  background: var(--surface-hover);
  color: var(--text);
  text-decoration: none;
}
.pagination a.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  .header-shell { flex-wrap: wrap; }

  .nav-toggle { display: block; margin-left: auto; }

  .header-nav {
    display: none;
    flex-basis: 100%;
    order: 11;
    padding: 0.5rem 0;
  }
  .header-nav.open { display: flex; flex-wrap: wrap; }

  .locale-dropdown { margin-left: auto; }

  .home-layout,
  .explore-shell,
  .detail-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }

  .home-sidebar { position: static; }

  .filter-panel {
    position: static;
    max-height: none;
  }

  .action-stack { justify-content: flex-start; }

  .listing-row-desc { display: none; }
  .listing-row-meta:not(:last-of-type) { display: none; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 1rem); }
  .two-column,
  .listing-meta-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .panel-card,
  .listing-card { padding: 1.1rem; }
  .readme-card .markdown-body,
  .summary-card { padding: 1rem; }

  .tab-toolbar { flex-wrap: wrap; }
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .listing-row { flex-wrap: wrap; gap: 0.5rem; }
  .listing-row-main { flex-basis: 100%; }
}

/* ============================================================
   CLI Promo (home page)
   ============================================================ */

.cli-promo {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.cli-promo-header h2 {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.cli-promo-header p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

.cli-promo-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.cli-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.cli-block-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cli-block pre {
  margin: 0;
  overflow-x: auto;
}

.cli-block code {
  font-size: 0.875rem;
  color: var(--text);
}

.cli-docs-link {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cli-docs-link:hover {
  color: var(--text-muted);
}

/* ============================================================
   CLI Page (/cli)
   ============================================================ */

.cli-page {
  max-width: 720px;
}

.cli-page h1 {
  font-size: 1.75rem;
  margin: 0 0 0.5rem;
}

.cli-page-intro {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.cli-section {
  margin-bottom: 2.5rem;
}

.cli-section h2 {
  font-size: 1.125rem;
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.cli-section p {
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

.cli-code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
  overflow-x: auto;
}

.cli-code code {
  font-size: 0.875rem;
  color: var(--text);
}

.cli-output {
  background: #0a0a0a;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  overflow-x: auto;
}

.cli-output pre {
  margin: 0;
}

.cli-output code {
  font-size: 0.8rem;
  color: #e0e0e0;
  line-height: 1.6;
}

[data-theme="light"] .cli-output {
  background: #1a1a1a;
}

[data-theme="light"] .cli-output code {
  color: #d0d0d0;
}

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--border);
  padding: 2rem 0;
}

.footer-shell {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: flex-start;
}

.footer-about {
  flex: 1;
  min-width: 200px;
}

.footer-about strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.footer-about p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-copy {
  width: 100%;
}

.footer-copy small {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ============================================================
   Contact Page
   ============================================================ */

.contact-page {
  max-width: 560px;
}

.contact-page h1 {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.contact-intro {
  color: var(--text-muted);
  margin: 0 0 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-form label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-form input,
.contact-form textarea {
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--text-muted);
}
