.page-intro {
  margin-bottom: 1rem;
}
.page-intro h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}
.page-intro p {
  margin: 0;
  color: var(--muted);
}
.project-card {
  overflow: hidden;
}
.setup-tabs {
  display: flex;
  flex-direction: column;
}
.setup-tabs .card-header {
  padding: 0 1rem;
  background: var(--row-hover);
  border-bottom: 1px solid var(--border);
}
.card-header-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin: 0;
  padding: 0.75rem 0 0;
  list-style: none;
}
.card-header-tabs .nav-item {
  margin: 0;
  margin-bottom: -1px;
}
.card-header-tabs .nav-link {
  display: block;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.25;
}
.card-header-tabs .nav-link:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--panel) 65%, transparent);
}
.card-header-tabs .nav-link.active {
  color: var(--accent);
  background: var(--panel);
  border-color: var(--border);
  font-weight: 600;
}
.setup-tabs .card-body {
  padding: 1.25rem;
}
.setup-tabs.single .card-header {
  display: none;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.setup-tabs.single .tab-panel { display: block; }
.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
}
.screenshot-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.screenshot-thumb {
  position: relative;
  display: block;
  width: 100%;
  height: 160px;
  padding: 0;
  border: 0;
  background: var(--row-hover);
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
  overflow: hidden;
}
.screenshot-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.screenshot-title-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.45rem 0.65rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  text-align: left;
  line-height: 1.3;
  word-break: break-word;
}
.screenshot-caption {
  padding: 0.75rem;
}
.screenshot-desc {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.screenshot-desc-wrap.is-expanded .screenshot-desc {
  -webkit-line-clamp: unset;
  display: block;
}
.screenshot-read-more {
  margin-top: 0.35rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}
.screenshot-read-more:hover {
  color: var(--text);
}
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.lightbox[hidden] { display: none !important; }
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.82);
}
.lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  max-height: calc(100vh - 3rem);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
}
.lightbox-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
  max-height: calc(100vh - 3rem);
  display: flex;
  flex-direction: column;
}
.lightbox-image-wrap {
  background: var(--row-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  max-height: calc(100vh - 12rem);
}
.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 12rem);
  object-fit: contain;
}
.lightbox-caption {
  padding: 1rem 1.1rem;
  border-top: 1px solid var(--border);
}
.lightbox-caption strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}
.lightbox-caption p {
  margin: 0 0 0.5rem;
  color: var(--muted);
  line-height: 1.5;
}
.lightbox-counter {
  font-size: 0.8rem;
  color: var(--muted);
}
.lightbox-close,
.lightbox-nav {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
}
.lightbox-close {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  width: 2.25rem;
  height: 2.25rem;
  z-index: 2;
}
.lightbox-nav {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.35rem;
  line-height: 1;
}
.lightbox-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.project-description {
  color: var(--muted);
  line-height: 1.6;
}
.project-description img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 0.5rem 0;
}
.project-description h1,
.project-description h2,
.project-description h3,
.project-description h4 {
  color: var(--text);
  margin: 1rem 0 0.5rem;
}
.project-description p:last-child { margin-bottom: 0; }
.setup-block .hint {
  margin: 0 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.setup-accordion {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--row-hover);
  margin-bottom: 0.65rem;
}
.setup-accordion:last-child {
  margin-bottom: 0;
}
.setup-accordion summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  list-style: none;
  user-select: none;
}
.setup-accordion summary::-webkit-details-marker {
  display: none;
}
.setup-accordion summary::before {
  content: '▸';
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}
.setup-accordion[open] summary::before {
  content: '▾';
}
.setup-accordion-body {
  padding: 0 0.9rem 0.85rem;
  border-top: 1px solid var(--border);
}
.setup-accordion-body .hint:first-child {
  margin-top: 0.75rem;
}
.setup-accordion-body .code-block:last-child {
  margin-bottom: 0;
}
.code-block {
  margin: 0 0 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--row-hover);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
@media (max-width: 720px) {
  .topbar {
    padding: 0.75rem 1rem;
    align-items: flex-start;
  }
  .brand {
    flex-wrap: wrap;
    row-gap: 0.35rem;
    min-width: 0;
    flex: 1 1 12rem;
  }
  .brand-project {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .brand-logo { display: none !important; }
  html[data-bs-theme="dark"] .brand-logo-dark { display: none !important; }
  .brand-favicon { display: inline; }
  .portal-link { display: none; }
  .container {
    margin-top: 1rem;
    padding: 0 0.75rem 1.5rem;
  }
  .crumbs {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
  .card-header-tabs .nav-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.85rem;
  }
  .setup-tabs .card-body {
    padding: 1rem;
  }
  .code-block {
    font-size: 0.75rem;
    padding: 0.65rem 0.75rem;
  }
  .screenshot-grid {
    grid-template-columns: 1fr;
  }
  .lightbox {
    padding: 0.75rem;
  }
  .lightbox-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }
  .lightbox-nav.lightbox-prev,
  .lightbox-nav.lightbox-next {
    display: none;
  }
  .lightbox-close {
    top: 0.35rem;
    right: 0.35rem;
  }
  .file-table-wrap {
    overflow-x: visible;
  }
  .file-table {
    min-width: 0;
  }
  .file-table thead {
    display: none;
  }
  .file-table tbody tr {
    display: block;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
  }
  .file-table tbody tr:hover td {
    background: transparent;
  }
  .file-table tbody tr:last-child {
    border-bottom: 0;
  }
  .file-table td {
    display: block;
    padding: 0;
    border-bottom: 0;
  }
  .file-table td.name {
    margin-bottom: 0.35rem;
  }
  .file-table td.name a {
    white-space: normal;
    word-break: break-word;
    overflow: visible;
    text-overflow: unset;
  }
  .file-table td.file-meta {
    font-size: 0.82rem;
    padding-left: 2rem;
    white-space: normal;
  }
  .file-table td.file-meta::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--text);
  }
}
