/* TinyCAD Manual – custom theme
   Matches the look & feel of tinycad.net */

/* ---- Base ---- */
:root {
  --tc-primary:   #2563eb;
  --tc-dark:      #1e293b;
  --tc-darker:    #0f172a;
  --tc-body-bg:   #f8fafc;
  --tc-body-color:#334155;
  --tc-heading:   #0f172a;
  --tc-light:     #f1f5f9;
  --tc-border:    rgba(0,0,0,0.06);
  --tc-secondary: #64748b;
  --tc-sidebar-w: 280px;
  --tc-focus-ring: #f59e0b;
  --tc-focus-shadow: rgba(245,158,11,0.3);
}

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--tc-body-color);
  background: var(--tc-body-bg);
}

body { overflow: hidden; }

/* ---- Search UI ---- */
.manual-search-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

#manual-search-form {
  display: flex;
  align-items: center;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--tc-border);
  border-radius: 0.5rem;
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
  padding: 0.1rem 0.5rem;
}

#manual-search-input {
  min-width: 12rem;
  width: clamp(12rem, 18vw, 18rem);
  border: none;
  outline: none;
  font-size: 0.95rem;
  padding: 0.4rem 0.6rem;
  background: transparent;
}

#manual-search-form button {
  background: none;
  border: none;
  color: var(--tc-primary);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

#manual-search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  left: auto;
  background: #fff;
  border: 1px solid var(--tc-border);
  border-radius: 0.75rem;
  box-shadow: 0 16px 40px rgba(15,23,42,0.18);
  width: min(32rem, calc(100vw - 2rem));
  max-height: min(26rem, 70vh);
  overflow-y: auto;
  z-index: 1001;
  padding: 0.5rem 0.75rem;
}

#manual-search-results:empty,
#manual-search-results[hidden] {
  display: none;
}

.manual-search-result {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--tc-border);
}

.manual-search-result:last-child {
  border-bottom: none;
}

.manual-search-result a {
  font-weight: 600;
  color: var(--tc-primary);
  text-decoration: none;
}

.manual-search-result a:hover {
  text-decoration: underline;
}

.manual-search-snippet {
  font-size: 0.92em;
  color: var(--tc-secondary);
  margin-top: 0.15rem;
}

.manual-search-no-results,
.manual-search-status {
  color: var(--tc-secondary);
  padding: 0.5rem 0;
}

:target {
  scroll-margin-top: 1rem;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--tc-heading);
  font-weight: 700;
}

a { color: var(--tc-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.7rem 1rem;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--tc-heading);
  box-shadow: 0 8px 24px rgba(15,23,42,0.18);
  transform: translateY(-140%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

a:focus-visible,
summary:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid var(--tc-focus-ring);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px var(--tc-focus-shadow);
}

/* ---- Shell grid ---- */
.manual-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto;
}

/* ---- Navbar ---- */
.manual-navbar {
  backdrop-filter: blur(12px);
  background: rgba(15,23,42,0.95) !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  padding: 0;
}

.manual-navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.manual-brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #fff !important;
  text-decoration: none;
}
.manual-brand:hover { text-decoration: none; color: #fff !important; }
.manual-brand .brand-highlight { color: #fff; }

.manual-navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.manual-navbar-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.manual-navbar-links .nav-label-short,
.manual-navbar-links .nav-site-short {
  display: none;
}

.manual-navbar-links a {
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.5rem 0.85rem;
  min-height: 2.5rem;
  border-radius: 0.375rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.manual-navbar-links a:hover,
.manual-navbar-links a.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.manual-navbar-links .nav-divider {
  width: 1px;
  height: 1.2rem;
  background: rgba(255,255,255,0.15);
  margin: 0 0.25rem;
}

.manual-navbar-links .btn-site-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.4rem 1rem;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 0.5rem;
  background: transparent;
  text-decoration: none;
  transition: all 0.2s ease;
}
.manual-navbar-links .btn-site-link:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
  text-decoration: none;
}

.manual-navbar-links .nav-site-icon {
  font-size: 0.95rem;
}

/* ---- Content area ---- */
.manual-content-scroll {
  height: 100%;
  overflow: hidden;
  min-height: 0;
}

.manual-layout {
  display: grid;
  grid-template-columns: var(--tc-sidebar-w) minmax(0,1fr);
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  box-sizing: border-box;
}

.manual-layout.single-column {
  grid-template-columns: minmax(0,1fr);
}

/* ---- Sidebar ---- */
.manual-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  min-height: 0;
  max-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem 1rem;
  border-right: 1px solid var(--tc-border);
  background: #fff;
}

.manual-contents > summary {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tc-secondary);
  cursor: pointer;
  min-height: 2rem;
  padding: 0.2rem 0.1rem;
}

.manual-contents > summary::-webkit-details-marker { display: none; }

.manual-sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.manual-sidebar li {
  margin: 0 0 0.1rem;
}

.manual-sidebar a {
  display: block;
  padding: 0.4rem 0.6rem;
  border-radius: 0.375rem;
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--tc-body-color);
  transition: background 0.15s ease, color 0.15s ease;
}

.manual-sidebar a:hover {
  background: var(--tc-light);
  color: var(--tc-primary);
  text-decoration: none;
}

.manual-sidebar a.active {
  background: rgba(37,99,235,0.08);
  color: var(--tc-primary);
  font-weight: 600;
  text-decoration: none;
}

.manual-sidebar .section-link {
  font-weight: 600;
}

.manual-contents ul ul {
  margin-top: 0.15rem;
  padding-left: 0.85rem;
}

/* ---- Main content ---- */
.manual-main {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 2rem 2.5rem 2rem 2rem;
}

.manual-main:focus {
  outline: none;
}

.manual-main h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--tc-border);
}

.manual-main h2 {
  font-size: 1.4rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.manual-main h3 {
  font-size: 1.15rem;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.manual-main img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  margin: 0.5rem 0;
}

.manual-media-figure {
  margin: 1rem 0 1.25rem;
}

.manual-video-player {
  display: block;
}

.manual-video-controls {
  display: none;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}

.manual-video-player.is-enhanced .manual-video-controls {
  display: flex;
}

.manual-media-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--tc-secondary);
}

.manual-video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  background: #000;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
}

.manual-video-button {
  appearance: none;
  border: 1px solid rgba(37,99,235,0.16);
  border-radius: 999px;
  background: #fff;
  color: var(--tc-heading);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  min-height: 2.5rem;
  min-width: 2.5rem;
  padding: 0.6rem;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.manual-video-button i {
  display: block;
  line-height: 1;
}

.manual-video-button:hover {
  background: rgba(37,99,235,0.06);
  border-color: rgba(37,99,235,0.32);
  color: var(--tc-primary);
}

.manual-video-button:active {
  transform: translateY(1px);
}

.manual-video-button.is-primary {
  background: var(--tc-primary);
  border-color: var(--tc-primary);
  color: #fff;
}

.manual-video-button.is-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.manual-video-button-toggle {
  margin-right: 0.1rem;
}

.manual-video-scrubber-label {
  display: flex;
  align-items: center;
  flex: 1 1 10rem;
  min-width: 8rem;
}

.manual-video-scrubber {
  width: 100%;
  accent-color: var(--tc-primary);
}

.manual-video-time {
  margin-left: auto;
  color: var(--tc-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.manual-video-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.manual-main code {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  background: var(--tc-light);
  border-radius: 0.375rem;
  color: var(--tc-heading);
}

.manual-main pre {
  background: var(--tc-darker);
  color: #e2e8f0;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-size: 0.88rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.manual-main pre code {
  background: none;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.manual-main table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}

.manual-main th, .manual-main td {
  padding: 0.6rem 0.75rem;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.manual-main th {
  background: var(--tc-light);
  font-weight: 600;
  color: var(--tc-heading);
}

.manual-main tr:hover td {
  background: #fafbfc;
}

.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1rem 0 0.75rem;
}

.comparison-table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid rgba(37,99,235,0.08);
  border-radius: 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 12px 32px rgba(15,23,42,0.08);
}

.comparison-table {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.comparison-table .comparison-col-feature {
  width: 20%;
}

.comparison-table .comparison-col-browser,
.comparison-table .comparison-col-app,
.comparison-table .comparison-col-v3 {
  width: 14%;
}

.comparison-table .comparison-col-notes {
  width: 38%;
}

.comparison-table caption {
  padding: 1rem 1rem 0.25rem;
  text-align: left;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tc-secondary);
}

.comparison-table th,
.comparison-table td {
  vertical-align: top;
}

.comparison-table thead th {
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-top: 0;
}

.comparison-table thead th:first-child,
.comparison-table tbody tr:first-child th {
  border-left: 0;
}

.comparison-table thead th:last-child,
.comparison-table tbody td:last-child,
.comparison-table tbody th:last-child {
  border-right: 0;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: normal;
  hyphens: none;
}

.comparison-table tbody tr:last-child th,
.comparison-table tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-table-section th {
  padding: 0.7rem 0.9rem;
  border-left: 0;
  border-right: 0;
  background: #e2e8f0;
  color: var(--tc-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.comparison-table tr.comparison-table-section:hover th {
  background: #e2e8f0;
}

.feature-status-cell {
  text-align: center;
  white-space: nowrap;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.feature-pill--yes {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.feature-pill--partial {
  color: #a16207;
  background: #fef3c7;
  border-color: #fcd34d;
}

.feature-pill--no {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}

.feature-detail {
  display: grid;
  gap: 0.18rem;
}

.feature-detail-title {
  display: block;
  color: var(--tc-heading);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.3;
}

.feature-detail-copy {
  display: block;
  color: var(--tc-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.comparison-table td:last-child {
  color: var(--tc-secondary);
}

.comparison-table tbody tr:hover td,
.comparison-table tbody tr:hover th[scope="row"] {
  background: #f8fbff;
}

.manual-main blockquote {
  border-left: 4px solid var(--tc-primary);
  background: rgba(37,99,235,0.04);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  border-radius: 0 0.5rem 0.5rem 0;
  color: var(--tc-body-color);
}

.manual-main blockquote p:last-child {
  margin-bottom: 0;
}

.manual-main ul, .manual-main ol {
  padding-left: 1.5rem;
}

.manual-main a {
  text-underline-offset: 0.15em;
}

.manual-main li + li {
  margin-top: 0.25rem;
}

/* ---- Tabsets ---- */
.manual-tabset {
  margin: 1.5rem 0;
}

.manual-tabset-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.35rem;
  border: 1px solid var(--tc-border);
  border-radius: 0.875rem;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.manual-tabset-tab {
  appearance: none;
  border: 0;
  border-radius: 0.625rem;
  background: transparent;
  color: var(--tc-secondary);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  min-height: 2.5rem;
  padding: 0.7rem 1rem;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.manual-tabset-tab:hover {
  background: var(--tc-light);
  color: var(--tc-heading);
}

.manual-tabset-tab[aria-selected="true"] {
  background: rgba(37,99,235,0.08);
  box-shadow: inset 0 0 0 1px rgba(37,99,235,0.18);
  color: var(--tc-primary);
}

.manual-tabset-panel {
  border: 1px solid var(--tc-border);
  border-radius: 1rem;
  background: #fff;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04);
}

.manual-tabset-panel[hidden] {
  display: none;
}

.manual-tabset-panel > :first-child {
  margin-top: 0;
}

.manual-tabset-panel > :last-child {
  margin-bottom: 0;
}

/* ---- Edit link ---- */
.manual-edit-link {
  margin: 2.5rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--tc-border);
  font-size: 0.85rem;
}

.manual-edit-link a {
  color: var(--tc-secondary);
  text-decoration: none;
  transition: color 0.15s;
}

.manual-edit-link a:hover {
  color: var(--tc-primary);
  text-decoration: underline;
}

/* ---- Footer ---- */
.manual-footer {
  background: var(--tc-dark);
  color: rgba(255,255,255,0.7);
  border-top: none;
}

.manual-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.manual-footer-inner a {
  color: rgba(255,255,255,0.55);
  padding: 0.2rem 0.3rem;
  border-radius: 0.3rem;
  text-decoration: none;
  transition: color 0.15s;
}

.manual-footer-inner a:hover {
  color: #fff;
  text-decoration: underline;
}

.manual-footer-sep {
  color: rgba(255,255,255,0.25);
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .manual-content-scroll {
    overflow: auto;
  }

  .manual-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100%;
    gap: 0;
  }

  .manual-navbar-inner {
    flex-wrap: nowrap;
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }

  .manual-brand {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .manual-navbar-links {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.2rem;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .manual-navbar-links::-webkit-scrollbar {
    display: none;
  }

  .manual-navbar-links a {
    flex: 0 0 auto;
    font-size: 0.82rem;
    min-height: 2.2rem;
    padding: 0.4rem 0.55rem;
  }

  .manual-navbar-links .nav-divider {
    display: none;
  }

  .manual-navbar-links .btn-site-link {
    padding: 0.4rem 0.65rem;
  }

  .manual-search-container {
    margin-left: 0.5rem;
  }

  #manual-search-input {
    min-width: 8rem;
    width: 8rem;
  }

  #manual-search-results {
    right: 0;
    width: min(26rem, calc(100vw - 1.5rem));
  }

  .manual-sidebar {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--tc-border);
    padding: 0.85rem 1rem 0.5rem;
    max-height: none;
    overflow: visible;
    background: linear-gradient(180deg, rgba(37,99,235,0.06), rgba(37,99,235,0));
  }

  .manual-contents {
    border: 1px solid rgba(37,99,235,0.16);
    border-radius: 0.9rem;
    background: #fff;
    box-shadow: 0 12px 30px rgba(15,23,42,0.08);
  }

  .manual-contents > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--tc-heading);
    background: linear-gradient(135deg, rgba(37,99,235,0.14), rgba(37,99,235,0.05));
    border-radius: 0.9rem;
  }

  .manual-contents > summary::after {
    content: '+';
    flex: 0 0 auto;
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1;
    color: var(--tc-primary);
  }

  .manual-contents[open] > summary {
    margin-bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .manual-contents[open] > summary::after {
    content: '\2212';
  }

  .manual-contents > ul {
    display: none;
  }

  .manual-contents[open] > ul {
    display: block;
    max-height: min(60vh, 32rem);
    overflow: auto;
    padding: 0.75rem 0.6rem 0.85rem;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .manual-contents[open] > ul::-webkit-scrollbar {
    width: 6px;
  }

  .manual-contents[open] > ul::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
  }

  .manual-main {
    overflow: visible;
    padding: 1.25rem 1rem;
  }

  .manual-tabset-nav {
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .manual-tabset-tab {
    flex: 1 1 10rem;
    justify-content: center;
    text-align: center;
  }

  .manual-tabset-panel {
    padding: 1rem;
  }

  .manual-footer-inner {
    flex-wrap: wrap;
    white-space: normal;
    row-gap: 0.2rem;
  }
}

@media (max-width: 600px) {
  .manual-navbar-inner {
    padding: 0.55rem 0.7rem;
  }

  .manual-brand {
    font-size: 0.98rem;
  }

  .manual-navbar-links .nav-label-full,
  .manual-navbar-links .nav-site-full {
    display: none;
  }

  .manual-navbar-links .nav-label-short,
  .manual-navbar-links .nav-site-short {
    display: inline;
  }

  .comparison-table-wrap {
    border-radius: 0.85rem;
  }

  .comparison-table {
    min-width: 720px;
  }

  .manual-navbar-links .btn-site-link {
    gap: 0.25rem;
  }
}

@media (min-width: 901px) {
  .manual-contents > summary {
    list-style: none;
    cursor: default;
    pointer-events: none;
  }

  .manual-contents > ul {
    display: block !important;
  }
}

/* ---- Version badge ---- */
.version-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15em 0.5em;
  border-radius: 0.3rem;
  vertical-align: middle;
  margin-left: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.version-badge-draft {
  background: rgba(245,158,11,0.15);
  color: #d97706;
}

.version-badge-stable {
  background: rgba(16,185,129,0.15);
  color: #059669;
}

/* ---- Index page cards ---- */
.version-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.version-card {
  background: #fff;
  border: 1px solid var(--tc-border);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.version-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
}

.version-card h2 {
  margin-top: 0;
  font-size: 1.25rem;
}

.version-card p {
  color: var(--tc-secondary);
  font-size: 0.92rem;
}

.version-card .btn-manual {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  min-height: 2.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: #fff;
  background: var(--tc-primary);
  text-decoration: none;
  transition: background 0.2s ease;
}

.version-card .btn-manual:hover {
  background: #1d4ed8;
  text-decoration: none;
}

/* Scrollbar styling for sidebar */
.manual-sidebar::-webkit-scrollbar {
  width: 4px;
}
.manual-sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.manual-sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}
.manual-sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .version-card:hover {
    transform: none;
  }

  .skip-link {
    transition: none;
  }
}

@media (forced-colors: active) {
  .skip-link,
  .manual-sidebar,
  .version-card,
  .manual-main pre,
  .manual-tabset-nav,
  .manual-tabset-panel,
  .manual-navbar-links .btn-site-link,
  .version-card .btn-manual {
    border: 1px solid ButtonText;
  }

  .manual-tabset-tab[aria-selected="true"] {
    outline: 1px solid Highlight;
  }

  a:focus-visible,
  summary:focus-visible,
  .manual-tabset-tab:focus-visible,
  [tabindex="-1"]:focus-visible {
    outline: 2px solid Highlight;
    box-shadow: none;
  }
}
