/* ============================================================
   projects.css — Project Ideas page
   Uses site theme variables from mainPage.css (--orange-primary,
   --card-bg, --text-primary, --border-color, etc.) and the
   site-wide [data-theme="dark"] dark-mode mechanism.
   ============================================================ */

/* ---------- Hero ---------- */
.projects-hero {
  background: linear-gradient(135deg, var(--text-primary, #0f172a) 0%, #1e3a8a 100%);
  color: #fff;
  padding: 4rem 0 2.5rem;
}
[data-theme="dark"] .projects-hero {
  background: linear-gradient(135deg, #020617 0%, #0f172a 100%);
}
.projects-hero h1 { font-weight: 800; }
.projects-hero .lead { opacity: 0.95; }

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  margin: 0.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
}

/* ---------- Search box ---------- */
.search-wrap {
  position: relative;
  max-width: 1100px;
  margin: 1.5rem auto 0;
}
.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 0.85rem 2.6rem 0.85rem 1.1rem;
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.7); }
.search-input:focus {
  border-color: var(--orange-primary, #ff6b35);
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.25);
}
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 0.55rem;
  transform: translateY(-50%);
  width: 1.85rem;
  height: 1.85rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: none;            /* JS toggles to inline-flex when there's a query */
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.search-clear:hover { background: rgba(255, 255, 255, 0.32); }

/* ---------- Filter panel (two-row grid) ---------- */
.filter-panel {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 1.1rem 1.4rem;
  margin: 1.5rem auto 0;
  max-width: 1100px;
  text-align: left;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "track track"
    "hw    diff";
  gap: 0.85rem 1.5rem;
}
.filter-row { margin-bottom: 0; }
.filter-row.track-row { grid-area: track; }
.filter-row.hw-row    { grid-area: hw; }
.filter-row.diff-row  { grid-area: diff; }

.filter-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  opacity: 0.85;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }

.chip {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}
.chip:hover { background: rgba(255, 255, 255, 0.25); }
.chip.active {
  background: var(--orange-primary, #ff6b35);
  border-color: var(--orange-primary, #ff6b35);
  color: #fff;
}
.chip.clear {
  background: transparent;
  border-style: dashed;
}
.chip.clear:hover { background: rgba(255, 255, 255, 0.1); }

/* Difficulty chip: colored dot before label */
.chip-diff::before {
  content: "";
  display: inline-block;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.chip-starter::before { background: #10b981; }
.chip-tight::before   { background: #f59e0b; }
.chip-stretch::before { background: #ef4444; }

@media (max-width: 640px) {
  .filter-panel {
    grid-template-columns: 1fr;
    grid-template-areas: "track" "hw" "diff";
  }
}

.results-bar {
  text-align: center;
  margin: 1.5rem 0 0.5rem;
  color: #fff;
  font-size: 0.95rem;
  opacity: 0.9;
}

/* ---------- Intro row: legend + TOC side-by-side ---------- */
.intro-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: 1.5rem;
  margin: 2rem 0;
  align-items: start;
}
.intro-row .legend-box,
.intro-row .toc-card { margin: 0; }
@media (max-width: 900px) {
  .intro-row { grid-template-columns: 1fr; }
}

/* ---------- Legend ---------- */
.legend-box {
  background: var(--bg-secondary, #f8fafc);
  border-left: 4px solid var(--orange-primary, #ff6b35);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  color: var(--text-primary, #0f172a);
}
.legend-box h3 {
  margin-top: 0;
  font-size: 1.25rem;
  color: var(--text-primary, #0f172a);
}
.legend-box .diff-row { margin-bottom: 0.5rem; }
[data-theme="dark"] .legend-box {
  background: var(--card-bg, #1e293b);
}

/* ---------- Bring-your-own-project card ---------- */
.byo-card {
  background: linear-gradient(135deg, #fff4ee 0%, #ffe1d2 100%);
  border: 1px solid #ffcdb4;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  color: var(--text-primary, #0f172a);
  box-shadow: 0 4px 14px rgba(255, 107, 53, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}
.byo-card::before {
  content: "✦";
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--orange-primary, #ff6b35);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}
.byo-body { flex: 1 1 auto; min-width: 0; }
.byo-title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--orange-dark, #e55a2b);
  letter-spacing: 0.1px;
}
.byo-text {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-primary, #0f172a);
}

[data-theme="dark"] .byo-card {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.18) 0%, rgba(229, 90, 43, 0.28) 100%);
  border-color: rgba(255, 107, 53, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .byo-title { color: var(--orange-light, #ff8c5a); }
[data-theme="dark"] .byo-text { color: var(--text-primary, #f8fafc); }

@media (max-width: 540px) {
  .byo-card { flex-direction: column; gap: 0.8rem; }
}

/* ---------- Table of Contents ---------- */
.toc-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  color: var(--text-primary, #0f172a);
}
.toc-card h3 {
  margin-top: 0;
  font-size: 1.15rem;
  color: var(--text-primary, #0f172a);
}
.toc-card a {
  display: block;
  padding: 0.35rem 0;
  color: var(--orange-primary, #ff6b35);
  text-decoration: none;
}
.toc-card a:hover { text-decoration: underline; }

/* ---------- Track section ---------- */
.track-section { padding: 3rem 0 1rem; }
.track-section h2 {
  font-weight: 800;
  border-bottom: 3px solid var(--orange-primary, #ff6b35);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-primary, #0f172a);
}
.track-intro {
  color: var(--text-secondary, #64748b);
  margin-bottom: 2rem;
}

/* ---------- Project grid (two columns) ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) {
  .projects-grid { grid-template-columns: 1fr; }
}

/* ---------- Project card ---------- */
.project-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.2s, transform 0.2s;
  color: var(--text-primary, #0f172a);
}
.project-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.project-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: var(--text-primary, #0f172a);
}
.project-card .pnum {
  display: inline-block;
  background: var(--orange-primary, #ff6b35);
  color: #fff;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}
[data-theme="dark"] .project-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .project-card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

/* ---------- Badges ---------- */
.badge-row {
  margin-bottom: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.diff-badge,
.hw-badge,
.track-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.diff-badge::before,
.hw-badge::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.1rem;
  background: currentColor;
  opacity: 0.85;
}

.diff-starter { background: #d1fae5; color: #065f46; }
.diff-tight   { background: #fef3c7; color: #92400e; }
.diff-stretch { background: #fee2e2; color: #991b1b; }

.hw-cpu    { background: #e0f2fe; color: #075985; }
.hw-gpu    { background: #ede9fe; color: #5b21b6; }
.hw-either { background: #f1f5f9; color: #334155; }

/* Legend dot indicators */
.dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.dot-starter { background: #10b981; }
.dot-tight   { background: #f59e0b; }
.dot-stretch { background: #ef4444; }

/* Hero stat-pill color accents (currently just background-style pills) */
.stat-pill::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.1rem;
}
.stat-starter::before  { background: #10b981; }
.stat-tight::before    { background: #f59e0b; }
.stat-stretch::before  { background: #ef4444; }
.stat-tracks::before   { background: var(--orange-primary, #ff6b35); }

.track-badge {
  background: #fff4ee;
  color: var(--orange-dark, #e55a2b);
  font-weight: 500;
  border: 1px solid #ffe1d2;
}

[data-theme="dark"] .diff-starter { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-theme="dark"] .diff-tight   { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .diff-stretch { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
[data-theme="dark"] .hw-cpu    { background: rgba(56, 189, 248, 0.18); color: #7dd3fc; }
[data-theme="dark"] .hw-gpu    { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-theme="dark"] .hw-either { background: rgba(148, 163, 184, 0.18); color: #cbd5e1; }
[data-theme="dark"] .track-badge {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.3);
  color: var(--orange-light, #ff8c5a);
}

/* ---------- Project field rows ---------- */
.pfield {
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  color: var(--text-primary, #0f172a);
}
.pfield .lbl {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}
.pfield code {
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--orange-dark, #e55a2b);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}
[data-theme="dark"] .pfield code {
  background: rgba(255, 107, 53, 0.12);
  color: var(--orange-light, #ff8c5a);
}

/* ---------- Warning / note / infra / guardrails boxes ---------- */
.warn-box {
  background: #fff7ed;
  border-left: 4px solid #ea580c;
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #7c2d12;
}
[data-theme="dark"] .warn-box {
  background: rgba(234, 88, 12, 0.12);
  color: #fdba74;
}

.infra-box {
  background: var(--bg-secondary, #f8fafc);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 1rem 0 0;
}
.infra-box h4 {
  font-size: 1.05rem;
  margin-top: 0;
  color: var(--text-primary, #0f172a);
}
.infra-box ul { margin: 0; padding-left: 1.25rem; }
.infra-box li {
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
  color: var(--text-primary, #0f172a);
}
[data-theme="dark"] .infra-box {
  background: rgba(255, 255, 255, 0.04);
}

.guardrails-box {
  background: #fef2f2;
  border-left: 4px solid #dc2626;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0 0;
  border-radius: 6px;
  color: #7f1d1d;
}
.guardrails-box h4 {
  color: #991b1b;
  margin-top: 0;
}
[data-theme="dark"] .guardrails-box {
  background: rgba(220, 38, 38, 0.1);
  color: #fecaca;
}
[data-theme="dark"] .guardrails-box h4 { color: #fca5a5; }

.note-box {
  background: #fff4ee;
  border-left: 3px solid var(--orange-primary, #ff6b35);
  padding: 0.55rem 0.85rem;
  margin-top: 0.75rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-primary, #0f172a);
}
[data-theme="dark"] .note-box {
  background: rgba(255, 107, 53, 0.1);
  color: var(--text-primary, #f8fafc);
}

/* ---------- Empty state + filter hide ---------- */
.no-match {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary, #64748b);
  font-style: italic;
}

.project-card.hidden,
.track-section.hidden { display: none; }

/* ---------- Print ---------- */
@media print {
  .projects-hero { background: #fff; color: #000; }
  .project-card { break-inside: avoid; box-shadow: none; }
  .filter-panel { display: none; }
}

/* ---------- Read-more link on cards ---------- */
.read-more-row {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-color, #e2e8f0);
  text-align: right;
}
.read-more-link {
  display: inline-block;
  font-weight: 600;
  color: var(--orange-primary, #ff6b35);
  text-decoration: none;
  font-size: 0.95rem;
  transition: transform 0.15s, color 0.15s;
}
.read-more-link:hover {
  color: var(--orange-dark, #e55a2b);
  transform: translateX(2px);
}
[data-theme="dark"] .read-more-link { color: var(--orange-light, #ff8c5a); }
[data-theme="dark"] .read-more-row { border-top-color: rgba(255, 255, 255, 0.1); }


/* ============================================================
   Project detail page
   Clean, content-first layout with sticky outline sidebar.
   ============================================================ */

/* ---- Hero ---- */
.detail-hero {
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  padding: 2.25rem 0 2rem;
  margin-bottom: 2rem;
}
[data-theme="dark"] .detail-hero {
  background: var(--card-bg, #1e293b);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.detail-breadcrumb a {
  color: var(--text-secondary, #64748b);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.detail-breadcrumb a:hover {
  color: var(--orange-primary, #ff6b35);
}
.detail-eyebrow {
  margin-top: 1rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--orange-primary, #ff6b35);
  font-weight: 700;
}
.detail-title {
  margin: 0.35rem 0 0.8rem;
  font-size: clamp(1.6rem, 2.4vw + 1rem, 2.3rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-primary, #0f172a);
  letter-spacing: -0.01em;
}
.detail-badge-row {
  margin-top: 0.4rem;
}

/* ---- Layout: narrow reading width ---- */
.detail-container { max-width: 900px; }
.detail-main {
  min-width: 0;
  padding-bottom: 2.5rem;
}
.detail-section h2 .section-optional {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #64748b);
  margin-left: 0.4rem;
  vertical-align: middle;
}
.detail-section h2 .section-optional {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary, #64748b);
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ---- Sections ---- */
.detail-section {
  margin: 0 0 2.5rem;
  scroll-margin-top: 80px;
}
.detail-section h2 {
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text-primary, #0f172a);
  margin: 0 0 0.9rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
}
.detail-section .sub-heading {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary, #64748b);
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
}
.detail-overview {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary, #0f172a);
  margin: 0 0 1rem;
}
.detail-pfield {
  margin-bottom: 0.7rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary, #0f172a);
}
.detail-pfield .lbl {
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-right: 0.2rem;
}
.detail-list {
  padding-left: 1.3rem;
  margin: 0.5rem 0 0;
  line-height: 1.65;
}
.detail-list li { margin-bottom: 0.45rem; }

/* ---- Meta strip (For / Duration / Team) ---- */
.detail-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.detail-meta-pill {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  color: var(--text-primary, #0f172a);
}
.detail-meta-pill .lbl {
  color: var(--text-secondary, #64748b);
  font-weight: 600;
  margin-right: 0.3rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
[data-theme="dark"] .detail-meta-pill { background: rgba(255, 255, 255, 0.04); }

/* ---- Input / Output side-by-side ---- */
.io-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}
.io-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  color: var(--text-primary, #0f172a);
}
.io-label {
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text-secondary, #64748b);
}
.io-card p { margin: 0; font-size: 0.95rem; line-height: 1.6; }
[data-theme="dark"] .io-card { background: rgba(255, 255, 255, 0.04); }
@media (max-width: 720px) {
  .io-grid { grid-template-columns: 1fr; }
}

/* ---- Code blocks ---- */
.code-block {
  margin: 0.75rem 0 1rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
[data-theme="dark"] .code-block { background: var(--card-bg, #1e293b); }
.code-caption {
  background: var(--bg-secondary, #f8fafc);
  color: var(--text-secondary, #475569);
  font-size: 0.78rem;
  padding: 0.45rem 0.85rem;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  font-weight: 600;
  letter-spacing: 0.01em;
}
[data-theme="dark"] .code-caption {
  background: rgba(255, 255, 255, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary, #94a3b8);
}
.code-pre {
  margin: 0;
  padding: 0.9rem 1.05rem;
  background: #fafafa;
  color: var(--text-primary, #0f172a);
  font-size: 0.85rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
[data-theme="dark"] .code-pre {
  background: #0f172a;
  color: #e2e8f0;
}
.code-pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

/* ---- Cards used for datasets and step blocks ---- */
.detail-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  margin-bottom: 0.85rem;
  color: var(--text-primary, #0f172a);
}
.detail-card-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
}
.detail-card-title .detail-link {
  color: var(--orange-primary, #ff6b35);
  text-decoration: none;
  margin-left: 0.35rem;
  font-size: 0.85rem;
}
.detail-card-title .detail-link:hover { text-decoration: underline; }
.detail-card p { margin: 0.3rem 0; line-height: 1.6; font-size: 0.95rem; }
.detail-card .lbl { font-weight: 700; color: var(--text-secondary, #64748b); margin-right: 0.15rem; }
[data-theme="dark"] .detail-card .lbl { color: var(--text-secondary, #94a3b8); }

/* ---- Libraries table ---- */
.lib-table-wrap {
  overflow-x: auto;
  margin-top: 0.85rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 8px;
}
.lib-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.lib-table th, .lib-table td {
  padding: 0.6rem 0.85rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-primary, #0f172a);
}
.lib-table th {
  background: var(--bg-secondary, #f8fafc);
  font-weight: 700;
  color: var(--text-secondary, #64748b);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme="dark"] .lib-table th { background: rgba(255, 255, 255, 0.04); }
.lib-table tr:last-child td { border-bottom: 0; }
.lib-table tr:hover td { background: rgba(255, 107, 53, 0.04); }
.lib-table td code {
  background: var(--bg-tertiary, #f1f5f9);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--orange-dark, #e55a2b);
}
[data-theme="dark"] .lib-table td code {
  background: rgba(255, 255, 255, 0.06);
  color: var(--orange-light, #ff8c5a);
}

/* ---- Footer nav ---- */
.detail-footer-nav {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-color, #e2e8f0);
}
.detail-footer-nav a {
  color: var(--orange-primary, #ff6b35);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.detail-footer-nav a:hover { text-decoration: underline; }

/* ---- Warning box reuse ---- */
.detail-section .warn-box { margin: 0.75rem 0 0; }

/* ---- Print ---- */
@media print {
  .detail-hero { background: #fff; border-bottom: 1px solid #ccc; }
  .detail-footer-nav { display: none; }
  .code-block { break-inside: avoid; }
}

/* ---- System architecture ASCII diagram (tighter type, centred-ish) ---- */
.code-pre.code-arch {
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 1rem 1.2rem;
}

/* ---- "These are suggestions" freedom-of-choice note ---- */
.freedom-note {
  background: #fff7ef;
  border-left: 3px solid var(--orange-primary, #ff6b35);
  padding: 0.7rem 0.95rem;
  margin: 0.25rem 0 1.1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-primary, #0f172a);
  border-radius: 4px;
}
[data-theme="dark"] .freedom-note {
  background: rgba(255, 107, 53, 0.08);
  border-left-color: var(--orange-light, #ff8c5a);
}

/* ---- Library list (used by Tools section) ---- */
.lib-list {
  margin: 0.4rem 0 0.85rem;
  padding-left: 1.2rem;
  line-height: 1.6;
}
.lib-list li { margin-bottom: 0.3rem; font-size: 0.95rem; }
.lib-list code {
  background: var(--bg-tertiary, #f1f5f9);
  color: var(--orange-dark, #e55a2b);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.88em;
}
[data-theme="dark"] .lib-list code {
  background: rgba(255, 255, 255, 0.06);
  color: var(--orange-light, #ff8c5a);
}

/* ---- Tighter dataset card meta-line ---- */
.detail-card .meta-line {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748b);
  margin: 0.4rem 0 0;
}
