/* Adom Wiki — Dark Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Brand fonts (Adom Brand Guidelines) ──────────────── */
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('https://adom.inc/fonts/familjen-grotesk/familjen-grotesk-latin-700-normal.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('https://adom.inc/fonts/familjen-grotesk/familjen-grotesk-latin-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('https://adom.inc/fonts/satoshi/satoshi-400-normal.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Satoshi';
  src: url('https://adom.inc/fonts/satoshi/satoshi-500-normal.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('https://fonts.gstatic.com/s/jetbrainsmono/v24/tDbv2o-flEEny0FZhsfKu5WU4zr3E_BX0PnT8RD8yKwBNntkaToggR7BYRbKPx3cwhsk.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}

:root {
  --bg: #0d1117;
  --bg-surface: #161b22;
  --bg-hover: #1c2128;
  --border: #30363d;
  --border-light: #21262d;
  --text: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #484f58;
  --accent: #00b8b0;
  --accent-bright: #00e6dc;
  --danger: #f85149;
  --warning: #d29922;
  --success: #3fb950;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Familjen Grotesk', sans-serif; }
code, pre, .mono { font-family: 'JetBrains Mono', monospace; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }

/* ── Navigation ─────────────────────────────────────────── */
.wiki-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  position: relative;
}
.nav-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo-img {
  height: 20px;
  width: auto;
}
.nav-links {
  display: flex;
  gap: 4px;
  margin-left: 12px;
  min-width: 0;
  visibility: hidden;
}
.nav-links.measured { visibility: visible; }
.nav-links a.nav-hidden { display: none; }
.nav-links a {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-links a:hover { color: var(--text); background: var(--bg-hover); }
.nav-links a.active { color: var(--accent); background: rgba(0,184,176,0.08); }

/* Overflow "..." button */
.nav-overflow {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  padding: 4px 6px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
  letter-spacing: 3px;
  border-radius: 4px;
}
.nav-overflow:hover { color: var(--text); background: var(--bg-hover); }
.nav-overflow.visible { display: block; }

/* Overflow dropdown menu — positioned by JS relative to the ... button */
.nav-overflow-menu {
  display: none;
  position: fixed;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  min-width: 170px;
}
.nav-overflow-menu.open { display: block; }
.nav-overflow-menu a {
  display: block;
  padding: 7px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.nav-overflow-menu a:hover { color: var(--text); background: var(--bg-hover); }

/* Right side — search + login, always pinned */
.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.nav-search {
  flex-shrink: 0;
}
.nav-search input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  width: 160px;
  outline: none;
  font-family: inherit;
}
.nav-search input:focus { border-color: var(--accent); }

/* ── Nav user / login ────────────────────────────────────── */
.nav-login {
  font-size: 12px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.nav-login:hover { border-color: var(--accent); color: var(--accent); }
.nav-orgs-link {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-orgs-link:hover { color: var(--text); background: var(--bg-hover); }
.nav-orgs-link.active { color: var(--accent); background: rgba(0,184,176,0.08); }
.nav-user-link {
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text);
  transition: color 0.15s;
}
.nav-user-link:hover { color: var(--accent); }
.nav-user-link:hover .nav-user-name { color: var(--accent); }
.nav-user-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  transition: border-color 0.15s;
}
.nav-user-link:hover .nav-user-avatar { border-color: var(--accent); }
.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.nav-user-name {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
}
.nav-user-logout {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.nav-user-logout:hover { color: var(--danger); border-color: var(--danger); }

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 20px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px;
}
.login-header {
  text-align: center;
  margin-bottom: 24px;
}
.login-logo {
  display: inline-block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}
.login-header h1 {
  font-size: 20px;
  color: var(--text);
  margin-bottom: 6px;
}
.login-header p {
  font-size: 13px;
  color: var(--text-secondary);
}
.login-error {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid var(--danger);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--danger);
  margin-bottom: 16px;
}
.login-field {
  margin-bottom: 16px;
}
.login-field label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.login-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.login-field input:focus { border-color: var(--accent); }
.login-submit {
  width: 100%;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 4px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
}
.login-submit:hover { background: var(--accent-bright); }
.login-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ── Main + Footer ──────────────────────────────────────── */
.wiki-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px;
}
.wiki-footer {
  padding: 16px 20px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}
.wiki-footer .sep { margin: 0 6px; }

/* ── Landing Page ───────────────────────────────────────── */
.landing { max-width: 720px; margin: 0 auto; }
.landing-hero {
  text-align: center;
  padding: 40px 0 32px;
}
.hero-logo-img {
  height: 83px;
  width: auto;
  margin-bottom: 8px;
}
.hero-tagline {
  font-size: 16px;
  color: var(--text);
  margin-top: 16px;
}
.hero-desc {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 8px auto 0;
}

/* ── Org activity feed on landing ────────────────────────── */
.landing-org-feed {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.landing-org-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.landing-org-feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.landing-org-feed-link {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}
.landing-org-feed-link:hover { text-decoration: underline; }
.landing-org-feed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-top: 1px solid var(--border-light);
}
.landing-org-feed-row:first-of-type { border-top: none; }
.landing-org-feed-author { color: var(--text); font-weight: 500; }
.landing-org-feed-kind { color: var(--text-muted); }
.landing-org-feed-page { color: var(--accent); text-decoration: none; font-weight: 500; }
.landing-org-feed-page:hover { text-decoration: underline; }
.landing-org-feed-org { font-size: 11px; color: var(--text-muted); background: rgba(139,148,158,0.08); padding: 1px 6px; border-radius: 3px; }
.landing-org-feed-time { color: var(--text-muted); font-size: 11px; margin-left: auto; }

.landing-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.landing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  transition: all 0.15s;
}
.landing-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.lc-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.lc-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(0,184,176,0.1);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}
.lc-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
}
.lc-desc {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.lc-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── List Page ──────────────────────────────────────────── */
.list-page h1 { font-size: 20px; margin-bottom: 4px; }
.list-desc { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.list-item {
  display: block;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 16px;
  text-decoration: none;
  transition: all 0.15s;
}
.list-item:hover { border-color: var(--accent); background: var(--bg-hover); }
.li-title {
  display: block;
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 3px;
}
.li-brief {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

/* ── Library Filters ───────────────────────────────────── */
.lib-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
}
.lib-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.lib-filter:hover { border-color: var(--accent); color: var(--text); }
.lib-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.filter-count {
  font-size: 10px;
  font-weight: 600;
  background: rgba(255,255,255,0.15);
  padding: 1px 6px;
  border-radius: 10px;
}
.lib-filter.active .filter-count { background: rgba(255,255,255,0.25); }

/* ── Skill Filters ────────────────────────────────────── */
.skill-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.skill-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.skill-filter:hover { border-color: var(--accent); color: var(--text); }
.skill-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.skill-filter.active .filter-count { background: rgba(255,255,255,0.25); }
.li-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}
.li-badge.fp-missing {
  background: rgba(255,166,87,0.15);
  color: #ffa657;
}

/* ── LibView Provenance ────────────────────────────────── */
.libview-provenance {
  margin-top: 10px;
  padding: 10px 14px;
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  font-size: 11px;
}
.prov-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  color: #8b949e;
}
.prov-label {
  width: 62px;
  flex-shrink: 0;
  color: #484f58;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.05em;
}
.prov-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.prov-kicad { background: rgba(63,185,80,0.15); color: #3fb950; }
.prov-generated { background: rgba(130,80,223,0.15); color: #bc8cff; }
.prov-missing { background: rgba(255,166,87,0.15); color: #ffa657; }
.prov-detail { color: #6e7681; }

/* ── Skill List ─────────────────────────────────────────── */
.skill-section { margin-bottom: 32px; }
.skill-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.skill-section-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
.skill-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.skill-section-desc {
  font-size: 12px;
  color: var(--text-secondary);
}
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 8px;
}
.skill-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
}
.skill-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.skill-card-viewer { border-left: 3px solid rgba(0,184,176,0.3); }
.skill-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  margin-top: 1px;
}
.skill-card-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  margin-top: 1px;
}
.skill-card-content { flex: 1; min-width: 0; }
.skill-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}
.skill-card-title {
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
}
.skill-card-badges {
  display: flex;
  gap: 4px;
}
.skill-badge {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 1px 6px;
  border-radius: 3px;
}
.skill-badge-viewer {
  color: var(--accent);
  background: rgba(0,184,176,0.1);
}
.skill-badge-samples {
  color: var(--warning);
  background: rgba(210,153,34,0.1);
}
.skill-badge-community {
  color: #58a6ff;
  background: rgba(88,166,255,0.1);
}
.skill-badge-new {
  color: #3fb950;
  background: rgba(63,185,80,0.1);
}
.skill-card-brief {
  display: block;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.4;
}

/* ── Wiki Page ──────────────────────────────────────────── */
.wiki-page { max-width: 760px; }
/* ── Skill Hero Image ──────────────────────────────────── */
.skill-hero {
  margin: -4px -20px 20px;
  border-radius: 10px;
  overflow: hidden;
  max-height: 320px;
  background: var(--bg-surface);
}
.skill-hero-img {
  width: 100%;
  height: 100%;
  max-height: 320px;
  object-fit: cover;
  display: block;
}

/* ── Skill/app screenshot galleries use base sizing (no overrides needed) ── */
.gallery-captions {
  min-height: 1.5em;
}
.gallery-caption {
  display: none;
  text-align: center;
  color: #8b949e;
  font-size: 0.9rem;
  padding: 8px 0 0;
  margin: 0;
}
.gallery-caption.active {
  display: block;
}

/* ── Skill Videos ──────────────────────────────────────── */
.skill-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 12px;
}
.skill-video-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.skill-video-player,
.skill-video-embed {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  border: none;
}
.skill-video-label {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.skill-video-link {
  display: block;
  padding: 16px;
  font-size: 13px;
}

.page-header { margin-bottom: 24px; }
.page-type-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(0,184,176,0.08);
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.page-header h1 { font-size: 24px; margin-bottom: 6px; }
.page-brief { color: var(--text-secondary); font-size: 14px; }

.page-section { margin-top: 32px; margin-bottom: 28px; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-header h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.edit-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.edit-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.page-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}
.page-content h1, .page-content h2, .page-content h3 { color: var(--text); margin: 16px 0 8px; }
.page-content h1 { font-size: 18px; }
.page-content h2 { font-size: 16px; }
.page-content h3 { font-size: 14px; }
.page-content p { margin-bottom: 10px; }
.page-content code {
  background: var(--bg-surface);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
}
.page-content pre {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 12px 16px;
  overflow-x: auto;
  margin: 10px 0;
}
.page-content pre code { background: none; padding: 0; }
.page-content ul { padding-left: 20px; margin-bottom: 10px; }
.page-content li { margin-bottom: 4px; }
.page-content a { color: var(--accent); }
.page-content strong { color: var(--text); }

.skill-source {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 400px;
  overflow-y: auto;
}

.skill-explainer {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(0, 184, 176, 0.06);
  border: 1px solid rgba(0, 184, 176, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.skill-explainer-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 184, 176, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}
.skill-explainer-text strong { color: var(--text); }
.skill-explainer-text em { color: var(--accent); font-style: normal; }

.page-meta {
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.page-meta .sep { margin: 0 6px; }

/* ── Viewer / Samples ───────────────────────────────────── */
.sample-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.sample-tab {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.sample-tab:hover { color: var(--text); border-color: var(--text-muted); }
.sample-tab.active { color: var(--accent); border-color: var(--accent); background: rgba(0,184,176,0.06); }
.sample-frame { display: none; }
.sample-frame.active { display: block; }
.viewer-iframe {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
}

/* File explorer (collapsed by default) */
.file-explorer {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-surface);
}
.fe-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border: none;
  border-bottom: 1px solid transparent;
  font-size: 12px;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background 0.15s;
}
.fe-header:hover { background: var(--bg-surface); }
.file-explorer:not(.collapsed) .fe-header {
  border-bottom-color: var(--border-light);
}
.fe-toggle-icon {
  font-size: 9px;
  color: var(--text-muted);
  transition: transform 0.2s;
  display: inline-block;
}
.file-explorer:not(.collapsed) .fe-toggle-icon {
  transform: rotate(90deg);
}
.fe-title {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fe-count { color: var(--text-muted); font-size: 11px; }
.fe-total { color: var(--text-muted); font-size: 11px; }
.fe-zip-btn {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  transition: all 0.15s;
}
.fe-zip-btn:hover { color: var(--accent); border-color: var(--accent); }
.fe-table {
  width: 100%;
  border-collapse: collapse;
}
.fe-row td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  vertical-align: middle;
}
.fe-row:last-child td { border-bottom: none; }
.fe-row:hover { background: var(--bg-hover); }
.fe-icon-cell { width: 48px; }
.fe-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
.fe-html { color: #f97316; background: rgba(249,115,22,0.12); }
.fe-js { color: #eab308; background: rgba(234,179,8,0.12); }
.fe-css { color: #3b82f6; background: rgba(59,130,246,0.12); }
.fe-3d { color: #bc8cff; background: rgba(188,140,255,0.12); }
.fe-asset { color: var(--accent); background: rgba(0,184,176,0.10); }
.fe-data { color: #22d3ee; background: rgba(34,211,238,0.10); }
.fe-bin { color: #94a3b8; background: rgba(148,163,184,0.10); }
.fe-doc { color: #8b949e; background: rgba(139,148,158,0.10); }
.fe-other { color: #8b949e; background: rgba(139,148,158,0.08); }
.fe-name-cell {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text);
  font-size: 12px;
  padding: 6px 0;
}
.fe-name-line {
  display: flex; align-items: baseline; gap: 12px;
}
.fe-name { font-weight: 500; }
.fe-when {
  font-family: 'Familjen Grotesk', system-ui, sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.fe-desc {
  font-family: 'Familjen Grotesk', system-ui, sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.45;
}
.fe-desc-missing {
  color: #c0883e;
  font-style: italic;
}
.fe-size-cell {
  color: var(--text-muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
  width: 70px;
}
.fe-actions-cell {
  text-align: right;
  white-space: nowrap;
  width: 80px;
}
.fe-view-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 8px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  margin-right: 4px;
}
.fe-view-btn:hover { color: var(--accent); border-color: var(--accent); }
.fe-view-btn.active { color: var(--accent); border-color: var(--accent); background: rgba(0,184,176,0.06); }
.fe-dl-btn {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.15s;
}
.fe-dl-btn:hover { color: var(--accent); }

/* Source panel within file explorer */
.fe-source-panel {
  border-top: 1px solid var(--border);
}
.fe-source-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 12px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
}
.fe-source-name {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text);
  font-weight: 500;
  font-size: 11px;
}
.fe-source-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.fe-source-close:hover { color: var(--text); }
.fe-source-content {
  display: flex;
  max-height: 400px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  tab-size: 2;
}
.fe-source-lines {
  flex-shrink: 0;
  padding: 10px 0;
  text-align: right;
  color: var(--text-muted);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 11px;
  line-height: 1.6;
  user-select: none;
  border-right: 1px solid var(--border-light);
  min-width: 40px;
  background: var(--bg-surface);
  position: sticky;
  left: 0;
}
.fe-source-lines span {
  display: block;
  padding: 0 8px 0 10px;
}
.fe-source-code {
  flex: 1;
  margin: 0;
  padding: 10px 14px;
  background: none;
  color: var(--text-secondary);
  white-space: pre;
  font-size: 12px;
  line-height: 1.6;
  overflow: visible;
}
.fe-source-code code {
  background: none;
  padding: 0;
  font-size: inherit;
}

/* ── Edit Page ──────────────────────────────────────────── */
.edit-page h1 { font-size: 18px; margin-bottom: 4px; }
.edit-field-label { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.edit-textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--text);
  line-height: 1.6;
  resize: vertical;
  outline: none;
}
.edit-textarea:focus { border-color: var(--accent); }
.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  justify-content: flex-end;
}
.btn {
  padding: 6px 16px;
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-bright); color: #fff; }
.btn-secondary { background: var(--bg-surface); border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover { color: var(--text); border-color: var(--text-muted); }
.edit-note { font-size: 11px; color: var(--text-muted); margin-top: 10px; }

/* ── Search ─────────────────────────────────────────────── */
.search-page h1 { font-size: 18px; margin-bottom: 16px; }
.search-results { display: flex; flex-direction: column; gap: 6px; }
.search-result {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.search-result:hover { border-color: var(--accent); background: var(--bg-hover); }
.sr-type {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(0,184,176,0.08);
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.sr-title { color: var(--text); font-weight: 600; font-size: 13px; }
.sr-brief { color: var(--text-secondary); font-size: 12px; }

/* ── Revisions ──────────────────────────────────────────── */
.revisions-page h1 { font-size: 18px; margin-bottom: 6px; }
.revisions-page > a { font-size: 12px; display: inline-block; margin-bottom: 16px; }
.revision-list { display: flex; flex-direction: column; gap: 4px; }
.revision-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 12px;
}
.rev-status {
  font-size: 10px;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.rev-approved { color: var(--success); background: rgba(63,185,80,0.08); }
.rev-pending { color: var(--warning); background: rgba(210,153,34,0.08); }
.rev-revoked { color: var(--danger); background: rgba(248,81,73,0.08); }
.rev-field { color: var(--text-muted); }
.rev-author { color: var(--text-secondary); }
.rev-date { color: var(--text-muted); margin-left: auto; }

.empty { color: var(--text-muted); font-size: 13px; }

/* ── Rich Component Page ───────────────────────────────── */
.component-page { max-width: 860px; }

.component-hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 16px;
  margin-bottom: 24px;
}

/* Gallery */
.component-gallery { min-width: 0; }
.gallery-main {
  position: relative;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Square aspect only for component library hero (symbol/footprint previews) */
.component-hero .gallery-main {
  aspect-ratio: 1;
}
.gallery-img {
  width: 100%;
  display: none;
}
.component-hero .gallery-img {
  height: 100%;
  object-fit: contain;
}
.gallery-img.active { display: block; }
.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.15s;
}
.gallery-main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover { background: var(--accent); color: #fff; }
.gallery-arrow-prev { left: 8px; }
.gallery-arrow-next { right: 8px; }

.gallery-thumbs {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-track { background: transparent; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
.gallery-thumb {
  min-width: 48px;
  width: 48px;
  height: 48px;
  border-radius: 4px;
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
  padding: 0;
}
.gallery-thumb:hover { border-color: var(--text-muted); }
.gallery-thumb.active { border-color: var(--accent); }
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Info card */
.component-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  align-self: start;
}
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light);
  gap: 8px;
}
.info-row:last-child { border-bottom: none; }
.info-label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.info-value {
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}
.info-value a { color: var(--accent); }
.stock-high { color: var(--success); }

/* Datasheets */
.datasheet-links {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.datasheet-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.datasheet-link:hover { border-color: var(--accent); background: var(--bg-hover); }
.datasheet-link.primary { border-color: rgba(0,184,176,0.2); }
.ds-icon {
  font-size: 10px;
  font-weight: 700;
  color: var(--danger);
  background: rgba(248,81,73,0.08);
  padding: 3px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ds-label { color: var(--text); font-size: 13px; }
.ds-url { color: var(--text-muted); font-size: 11px; margin-left: auto; }

/* Pricing — Mouser-featured layout */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.pricing-grid--featured {
  grid-template-columns: 1.5fr 1fr 0.8fr;
}
.pricing-distributor {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px;
}
.pricing-distributor.pd-featured {
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(0,184,176,0.02) 100%);
}
.pricing-distributor.pd-featured .pd-name { font-size: 15px; color: var(--accent); }
.pricing-distributor.pd-compact { opacity: 0.85; }
.pricing-distributor.pd-compact .pd-name { font-size: 12px; }
.pricing-distributor.pd-compact .pricing-table { font-size: 11px; }
.pd-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.pd-name { font-weight: 600; font-size: 13px; color: var(--text); }
.pd-badge {
  font-size: 9px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
}
.pd-badge.basic { color: var(--success); background: rgba(63,185,80,0.08); }
.pd-badge.partner { color: var(--accent); background: rgba(0,184,176,0.08); }
.pd-stock { font-size: 10px; color: var(--text-secondary); margin-left: auto; }
.pd-status { font-size: 11px; color: var(--text-muted); }
.pd-cta { margin: 8px 0 0; }
.pd-cta-link {
  display: inline-block;
  padding: 6px 14px;
  font-size: 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.15s;
}
.pd-cta-link:hover { opacity: 0.85; }
.pricing-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.pricing-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  padding: 3px 0;
  border-bottom: 1px solid var(--border-light);
}
.pricing-table td { padding: 3px 0; color: var(--text-secondary); }
.pricing-distributor.unavailable {
  display: flex;
  align-items: center;
}

/* Viewer iframe tall (for 3D) */
.viewer-iframe-tall { min-height: 450px; }

/* ── Downloads & EDA Integration ─────────────────────── */
.eda-picker { margin-bottom: 16px; }
.eda-picker-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
  font-weight: 600;
}
.eda-picker-options { display: flex; flex-wrap: wrap; gap: 6px; }
.eda-option {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: inherit;
  transition: all 0.15s;
}
.eda-option:hover { border-color: var(--text-muted); background: var(--bg-hover); }
.eda-option.active { border-color: var(--accent); background: rgba(0,184,176,0.06); }
.eda-option.active .eda-name { color: var(--accent); }
.eda-name { font-size: 12px; font-weight: 600; color: var(--text); }
.eda-status { font-size: 9px; text-transform: uppercase; letter-spacing: 0.2px; }
.eda-status.available { color: var(--success); }
.eda-status.coming-soon { color: var(--text-muted); }

.download-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
  min-height: 40px;
}
.download-files { display: flex; flex-direction: column; gap: 6px; }
.download-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s;
}
.download-file:hover { border-color: var(--accent); }
.df-icon {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  flex-shrink: 0;
  font-family: -apple-system, sans-serif;
}
.df-icon.sym { color: #66bb6a; background: rgba(102,187,106,0.08); }
.df-icon.fp { color: #42a5f5; background: rgba(66,165,245,0.08); }
.df-icon.step { color: #ab47bc; background: rgba(171,71,188,0.08); }
.df-icon.lbr { color: #ff7043; background: rgba(255,112,67,0.08); }
.df-name { color: var(--text); font-size: 13px; }
.df-size { color: var(--text-muted); font-size: 11px; margin-left: auto; font-family: monospace; }
.download-coming-soon { color: var(--text-muted); font-size: 12px; padding: 4px 0; }

.conduit-send { margin-top: 12px; }
.conduit-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}
.conduit-btn:hover { opacity: 0.85; }
.conduit-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.conduit-icon { margin-right: 4px; }
.conduit-desc { font-size: 11px; color: var(--text-secondary); margin-top: 6px; }
.conduit-no-desktop {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}
.conduit-no-desktop a { color: var(--accent); }

/* Specs table */
.specs-table { width: 100%; border-collapse: collapse; }
.specs-table td {
  padding: 5px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.spec-label { color: var(--text-muted); width: 45%; }

/* Pin table */
.pin-table { width: 100%; border-collapse: collapse; }
.pin-table th {
  text-align: left;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 5px 8px;
  border-bottom: 1px solid var(--border-light);
}
.pin-table td {
  padding: 5px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
/* Grouped pin table */
.pin-group-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pin-group-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 12px; font-size: 12px; color: #c9d1d9;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.pgc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pin-group-header td {
  padding: 10px 8px 4px !important; font-size: 12px;
  background: rgba(255,255,255,0.02); border-bottom: 1px solid var(--border-light);
}
.pin-table-grouped td:first-child { width: 50px; color: var(--text-muted); }
.pin-table-grouped td:nth-child(3) { font-size: 11px; color: var(--text-muted); }

/* Section headers for component pages */
.component-page .page-section h2 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Molecule List ──────────────────────────────────────── */
.mol-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}
.mol-filter-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  width: 200px;
}
.mol-filter-input:focus { border-color: var(--accent); }
.mol-filter-select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}
.mol-filter-select:focus { border-color: var(--accent); }
.mol-filter-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.mol-filter-check input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }
.mol-filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.mol-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.mol-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: all 0.15s;
}
.mol-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.mol-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--bg);
  display: block;
}
.mol-card-no-thumb {
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-surface) 100%);
}
.mol-card-body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mol-card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; }
.mol-card-creator {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ── Molecule Badges ────────────────────────────────────── */
.mol-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 6px;
  border-radius: 3px;
}
.badge-nsf      { color: #58a6ff; background: rgba(88,166,255,0.10); }
.badge-breakout { color: var(--warning); background: rgba(210,153,34,0.10); }
.badge-stable   { color: var(--success); background: rgba(63,185,80,0.08); }
.badge-photo    { color: var(--accent);  background: rgba(0,184,176,0.08); }
.badge-3d       { color: #bc8cff; background: rgba(188,140,255,0.10); }
.mol-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* ── Molecule Detail Page ───────────────────────────────── */
.molecule-page .page-header { margin-bottom: 20px; }
.molecule-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  aspect-ratio: 4/3;
  color: var(--text-muted);
  font-size: 12px;
}

/* Science driver tags */
.science-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.science-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(88,166,255,0.08);
  color: #58a6ff;
  border: 1px solid rgba(88,166,255,0.15);
  text-transform: capitalize;
}

/* NSF relevance block */
.mol-relevance {
  background: rgba(88,166,255,0.04);
  border-left: 3px solid rgba(88,166,255,0.3);
  padding: 12px 16px;
  border-radius: 0 6px 6px 0;
}

/* ── Molecule Gallery Extended ──────────────────────────── */
.mol-gallery .gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mol-gallery .gallery-thumb {
  position: relative;
  width: 64px;
  height: 64px;
}
.mol-gallery .thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-size: 8px;
  text-align: center;
  background: rgba(0,0,0,0.65);
  color: var(--text-secondary);
  padding: 1px 2px;
  line-height: 1.2;
  pointer-events: none;
}

/* ── Quality bar ───────────────────────────────────────── */
.quality-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}
.quality-fill {
  height: 100%;
  background: linear-gradient(90deg, #e53e3e, var(--warning), var(--success));
  border-radius: 3px;
  transition: width 0.3s;
}
.quality-num { font-size: 11px; color: var(--text-muted); }
.info-value .quality-bar { max-width: 80px; }
.avail-badge {
  font-size: 10px;
  color: var(--success);
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(63,185,80,0.08);
}

/* ── Symbol & Footprint badges ─────────────────────────── */
.badge-sym { color: #f97316; background: rgba(249,115,22,0.10); }
.badge-fp  { color: #06b6d4; background: rgba(6,182,212,0.10); }

/* ── Symbol & Footprint grid ───────────────────────────── */
.sym-fp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.sym-fp-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.sym-fp-card h3 {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sym-fp-img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 4px;
  background: #fff;
  padding: 8px;
}

/* ── 3D Model Viewer ───────────────────────────────────── */
.mol-3d-viewer {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.mol-3d-viewer model-viewer {
  --poster-color: var(--bg-surface);
}

/* ── Download grid ─────────────────────────────────────── */
.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.dl-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.15s;
}
.dl-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
}
.dl-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.dl-label { font-size: 12px; }
.dl-3d .dl-icon  { background: rgba(188,140,255,0.15); color: #bc8cff; }
.dl-pcb .dl-icon { background: rgba(0,184,176,0.15); color: var(--accent); }
.dl-f3d .dl-icon { background: rgba(249,115,22,0.15); color: #f97316; }
.dl-sch .dl-icon { background: rgba(88,166,255,0.15); color: #58a6ff; }
.dl-ar .dl-icon  { background: rgba(236,72,153,0.15); color: #ec4899; }
.dl-sym .dl-icon { background: rgba(249,115,22,0.12); color: #f97316; }
.dl-fp .dl-icon  { background: rgba(6,182,212,0.12); color: #06b6d4; }
.dl-net .dl-icon { background: rgba(148,163,184,0.12); color: #94a3b8; }

/* ── File browser (GitHub-style) ────────────────────────── */
.file-browser {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
}
.fb-row td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  vertical-align: middle;
}
.fb-row:last-child td { border-bottom: none; }
.fb-row:hover { background: var(--bg-hover); }
.fb-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.fb-3d  { background: rgba(188,140,255,0.15); color: #bc8cff; }
.fb-pcb { background: rgba(0,184,176,0.15); color: var(--accent); }
.fb-f3d { background: rgba(249,115,22,0.15); color: #f97316; }
.fb-sch { background: rgba(88,166,255,0.15); color: #58a6ff; }
.fb-ar  { background: rgba(236,72,153,0.15); color: #ec4899; }
.fb-sym { background: rgba(249,115,22,0.12); color: #f97316; }
.fb-fp  { background: rgba(6,182,212,0.12); color: #06b6d4; }
.fb-net { background: rgba(148,163,184,0.12); color: #94a3b8; }
.fb-name { color: var(--text); font-weight: 500; }
.fb-name:hover { color: var(--accent-bright); }
.fb-type { color: var(--text-muted); font-size: 12px; text-align: right; }
.btn-sm { font-size: 11px; padding: 4px 12px; }

/* ── Footprint pages ───────────────────────────────────── */
.badge-footprint {
  background: rgba(6,182,212,0.15);
  color: #06b6d4;
  border-color: rgba(6,182,212,0.25);
}

/* Footprint inline viewers (both always visible, no tabs) */
.fp-viewers-inline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}
.fp-viewer-block {
  position: relative;
}
.fp-viewer-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.footprint-page .component-info-card {
  margin-bottom: 0;
}

/* Footprint grid */
.fp-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.fp-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.fp-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,184,176,0.15);
}
.fp-card-thumb {
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  max-height: 180px;
  overflow: hidden;
}
.fp-card-thumb-dark {
  background: #0d1117;
  border-bottom: 1px solid var(--border-light);
}
.fp-card-thumb img {
  max-width: 100%;
  max-height: 160px;
  object-fit: contain;
}
.sym-card-thumb img {
  filter: invert(0.88) hue-rotate(180deg) saturate(1.8) brightness(0.95);
}
.fp-card-no-thumb {
  background: var(--bg-hover);
  min-height: 100px;
}
.fp-card-body {
  padding: 10px 14px 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fp-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

/* Landing page: 4 columns */
.landing-cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .landing-cards { grid-template-columns: 1fr; }
  .nav-search input { width: 120px; }
  .component-hero { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-grid--featured { grid-template-columns: 1fr; }
  .eda-picker-options { gap: 6px; }
  .eda-option { min-width: 0; flex: 1 1 calc(50% - 6px); }
  .mol-filters { flex-direction: column; align-items: stretch; }
  .mol-filter-input, .mol-filter-select { width: 100%; }
  .mol-grid { grid-template-columns: 1fr; }
  .fp-grid { grid-template-columns: 1fr; }
  .sym-fp-grid { grid-template-columns: 1fr; }
  .dl-grid { grid-template-columns: 1fr; }
  .mol-gallery .gallery-thumb { width: 52px; height: 52px; }
}

/* ── Sub-Skills Section ────────────────────────────────── */
.sub-skills-section .section-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-skills-list {
  display: grid;
  gap: 8px;
}

.sub-skill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 14px 16px;
  transition: border-color 0.15s;
}
.sub-skill-card:hover {
  border-color: var(--accent);
}

.sub-skill-url {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}
.sub-skill-url:hover { color: var(--accent-bright); }
.sub-skill-external { font-size: 11px; }

.sub-skill-desc {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.sub-skill-desc p { margin: 0; }

.sub-skill-meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.sub-skill-meta .sep { margin: 0 6px; }

.sub-skills-empty {
  font-size: 13px;
  color: var(--text-muted);
  padding: 16px 0;
}

/* ── Sub-Skills Help Tooltip ─────────────────────────── */
.sub-skills-help {
  position: relative;
  display: inline-flex;
  cursor: help;
}

.sub-skills-help-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 184, 176, 0.15);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

.sub-skills-tooltip {
  display: none;
  position: absolute;
  top: 28px;
  left: 0;
  z-index: 100;
  width: 340px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-secondary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
}
.sub-skills-tooltip strong { color: var(--text); }
.sub-skills-tooltip em { color: var(--accent); font-style: normal; }
.sub-skills-tooltip ul {
  margin: 4px 0;
  padding-left: 18px;
}
.sub-skills-tooltip li {
  margin-bottom: 2px;
}
.sub-skills-tooltip p {
  margin: 6px 0;
}

.sub-skills-help:hover .sub-skills-tooltip,
.sub-skills-help:focus .sub-skills-tooltip,
.sub-skills-help:focus-within .sub-skills-tooltip {
  display: block;
}

/* ── Sub-Skill Add Button ────────────────────────────── */
.sub-skill-add-btn {
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

/* ── Sub-Skill Form ──────────────────────────────────── */
.sub-skill-form-container {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sub-skill-form { display: flex; flex-direction: column; gap: 12px; }
.sub-skill-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.sub-skill-input,
.sub-skill-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}
.sub-skill-input:focus,
.sub-skill-textarea:focus {
  border-color: var(--accent);
}
.sub-skill-textarea { resize: vertical; }

.sub-skill-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.sub-skill-form-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
  margin: 0;
}

/* ── Sub-Skill Submitted Notice ──────────────────────── */
.sub-skill-submitted-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(63, 185, 80, 0.08);
  border: 1px solid rgba(63, 185, 80, 0.2);
  border-radius: 6px;
  font-size: 12px;
  color: var(--success);
}
.sub-skill-notice-icon { font-size: 14px; }

/* ══════════════════════════════════════════════════════════ */
/* ── Publication Status Banners ─────────────────────────── */
/* ══════════════════════════════════════════════════════════ */

.pub-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.pub-banner-icon { font-size: 16px; }
.pub-banner-version {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.7;
  font-family: monospace;
}
.pub-submitted {
  background: rgba(210, 153, 34, 0.1);
  border: 1px solid rgba(210, 153, 34, 0.3);
  color: var(--warning);
}
.pub-rejected {
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--danger);
}

/* ── Publication Status Badges (inline) ─────────────────── */

.pub-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.pub-badge-submitted {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warning);
}
.pub-badge-validated {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
}
.pub-badge-rejected {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
}

/* ══════════════════════════════════════════════════════════ */
/* ── Admin Dashboard ────────────────────────────────────── */
/* ══════════════════════════════════════════════════════════ */

.admin-dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px;
}
.admin-dashboard h1 { font-size: 24px; margin-bottom: 20px; }
.admin-dashboard h2 { font-size: 16px; margin: 24px 0 12px; color: var(--text-secondary); }

.admin-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.admin-page-header h1 { margin-bottom: 0; }

/* ── Summary Cards ──────────────────────────────────────── */

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.admin-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}
.admin-card-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.admin-card-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.admin-card-link {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--accent);
}
.admin-card-pending { border-color: var(--warning); }
.admin-card-pending .admin-card-number { color: var(--warning); }
.admin-card-rejected { border-color: rgba(248, 81, 73, 0.3); }
.admin-card-rejected .admin-card-number { color: var(--danger); }

/* ── Admin Table ────────────────────────────────────────── */

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.admin-table tr:hover td { background: var(--bg-hover); }

.admin-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(0, 184, 176, 0.1);
  color: var(--accent);
  text-transform: capitalize;
}

/* ── Filter Bar ─────────────────────────────────────────── */

.admin-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.admin-filters select {
  background: var(--bg-surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 13px;
}

/* ── Review Queue ───────────────────────────────────────── */

.admin-queue { display: flex; flex-direction: column; gap: 12px; }

.admin-queue-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
}
.queue-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.queue-item-title {
  font-weight: 600;
  font-size: 15px;
}
.queue-item-version {
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.queue-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.queue-item-brief {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.queue-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

/* ── Reject Reason Form ─────────────────────────────────── */

.reject-reason-form {
  margin-top: 12px;
}
.reject-reason-input {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
}
.reject-reason-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ── Detail Page ────────────────────────────────────────── */

.admin-detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 0;
  font-size: 13px;
}
.admin-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin: 16px 0;
}

.admin-nav-links {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.admin-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-bright); color: #000; }
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-secondary);
}
.btn-secondary:hover { background: var(--bg-hover); color: var(--text); }
.btn-success {
  background: rgba(63, 185, 80, 0.15);
  color: var(--success);
  border-color: rgba(63, 185, 80, 0.3);
}
.btn-success:hover { background: rgba(63, 185, 80, 0.25); }
.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.3);
}
.btn-danger:hover { background: rgba(248, 81, 73, 0.25); }

/* ── Datasheet Page ────────────────────────────────────── */

.ds-page .ds-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 20px; }
.ds-badge { font-size: 12px; padding: 3px 10px; border-radius: 14px; border: 1px solid var(--border); color: var(--text-secondary); background: var(--bg-surface); }
.ds-badge-mfg { border-color: rgba(0,184,176,0.3); color: var(--accent); background: rgba(0,184,176,0.08); font-weight: 600; }
.ds-badge-part { border-color: rgba(0,184,176,0.3); color: var(--accent-bright); }
.ds-badge-doc { color: var(--text-muted); font-family: monospace; font-size: 11px; }
.ds-badge-link { text-decoration: none; color: var(--accent); cursor: pointer; }
.ds-badge-link:hover { color: var(--accent-bright); border-color: var(--accent-bright); }

.ds-hero-image { margin: 0 auto 24px; text-align: center; background: #f5f5f5; border-radius: 12px; padding: 16px; }
.ds-hero-image img { max-width: 100%; max-height: 400px; height: auto; display: inline-block; }

/* Tab bar wrapper (holds tabs + copy button side by side) */
.ds-tabs-wrap {
  display: flex; align-items: flex-end; gap: 8px;
  margin-bottom: 20px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  padding-top: 8px;
}
.ds-tabs-bar {
  display: flex; gap: 0; flex: 1; min-width: 0;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ds-tab {
  padding: 8px 14px; font-size: 12px; color: var(--text-secondary);
  cursor: pointer; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color 0.15s, border-color 0.15s;
  user-select: none;
}
.ds-tab:hover { color: var(--text); }
.ds-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Tab panels */
.ds-panel { display: none; }
.ds-panel.active { display: block; }

/* Source / raw markdown panel */
.ds-source-pre {
  background: var(--bg-card, #1a1a2e);
  border: 1px solid var(--border, #333);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: 70vh;
  overflow-y: auto;
}
.ds-source-pre code {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  color: var(--text-secondary, #b0b0c0);
}

/* Section titles */
.ds-section-title {
  font-size: 14px; font-weight: 600; color: var(--accent);
  margin: 0 0 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
.ds-panel .ds-section-title + .ds-section-title { margin-top: 28px; }
.ds-panel .ds-section-title:not(:first-child) { margin-top: 28px; }
.ds-h3 {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin: 16px 0 8px;
}

/* Description text */
.ds-desc {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.6; margin-bottom: 12px;
}
.ds-desc a { color: var(--accent); }

/* Stat cards (Key Specifications) */
.ds-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.ds-stat {
  padding: 12px; background: var(--bg-surface);
  border: 1px solid var(--border-light); border-radius: 6px;
}
.ds-stat-val { font-size: 16px; font-weight: 600; color: var(--accent); }
.ds-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* Pin cards */
.ds-pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 8px; margin-bottom: 16px;
}
.ds-pin-card {
  padding: 10px 12px; background: var(--bg-surface);
  border: 1px solid var(--border-light); border-radius: 6px;
  transition: border-color 0.15s;
}
.ds-pin-card:hover { border-color: rgba(0,184,176,0.3); background: var(--bg-hover); }
.ds-pin-num {
  display: inline-block; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(0,184,176,0.12);
  color: var(--accent); font-size: 11px; font-weight: 600;
  text-align: center; line-height: 22px; margin-right: 8px;
}
.ds-pin-name { font-weight: 600; font-size: 13px; }
.ds-pin-dir {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  margin-left: 6px; background: var(--border-light); color: var(--text-secondary);
}
.ds-pin-desc {
  font-size: 12px; color: var(--text-secondary);
  margin-top: 4px; line-height: 1.4;
}

/* Tables */
.ds-table {
  width: 100%; border-collapse: collapse;
  font-size: 12px; margin-bottom: 16px;
}
.ds-table th {
  text-align: left; padding: 8px 10px;
  color: var(--text-secondary); font-weight: 500;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface); white-space: nowrap;
}
.ds-table td {
  padding: 7px 10px; border-bottom: 1px solid var(--border-light);
  color: var(--text); vertical-align: top;
}
.ds-table tr:hover td { background: rgba(0,184,176,0.04); }

/* Features list */
.ds-features-list {
  list-style: none; margin-bottom: 16px;
}
.ds-features-list li {
  padding: 6px 0; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: flex-start; gap: 8px;
}
.ds-features-list li:last-child { border-bottom: none; }
.ds-feat-dot { color: var(--accent); flex-shrink: 0; margin-top: 0; font-size: 18px; line-height: 1; }

/* Generic list */
.ds-list { list-style: none; margin-bottom: 16px; }
.ds-list li {
  padding: 5px 0; font-size: 13px; color: var(--text);
  border-bottom: 1px solid var(--border-light);
}
.ds-list li:last-child { border-bottom: none; }
.ds-list li::before { content: '\25B8'; color: var(--accent); margin-right: 8px; }

/* Code blocks */
.ds-code {
  background: var(--bg-surface); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 12px; margin-bottom: 16px;
  font-size: 12px; color: var(--text); overflow-x: auto;
  font-family: 'SF Mono', 'Cascadia Code', Consolas, monospace;
}
.ds-code code { font-family: inherit; }

/* Copy markdown button */
.ds-copy-md {
  position: relative;
  margin-left: auto; padding: 4px 8px;
  background: transparent; border: 1px solid var(--border);
  border-radius: 4px; color: var(--text-secondary);
  cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 4px;
  flex-shrink: 0;
}
.ds-copy-md:hover { color: var(--accent); border-color: var(--accent); }
.ds-copy-md.copied { color: var(--success); border-color: var(--success); }

/* Custom tooltip */
.ds-copy-md::after {
  content: attr(aria-label);
  position: absolute; bottom: calc(100% + 6px); right: 0;
  padding: 4px 10px; border-radius: 6px;
  background: var(--bg-surface); border: 1px solid var(--border);
  color: var(--text); font-size: 11px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 10;
}
.ds-copy-md:hover::after { opacity: 1; }
.ds-copy-md.copied::after { content: 'Copied!'; }

/* Copy button on list cards — wrapper owns the positioning context so the
   card <a> remains a clean, whole-card click target (button is a sibling,
   not nested inside the anchor). */
.list-item-wrap { position: relative; display: block; }
.list-item-wrap .list-item { margin: 0; }
.ds-copy-md-card {
  position: absolute; top: 10px; right: 10px;
  margin-left: 0; padding: 4px 6px;
  opacity: 0; transition: opacity 0.15s, color 0.15s, border-color 0.15s;
  z-index: 2;
}
.list-item-wrap:hover .ds-copy-md-card { opacity: 1; }
