:root {
  color-scheme: light;
  --rb-ink: #15211f;
  --rb-soft: #2e3b36;
  --rb-muted: #56655f;
  --rb-canvas: #f5f7f5;
  --rb-card: #ffffff;
  --rb-primary: #167463;
  --rb-primary-dark: #0d5548;
  --rb-link: #0d5548;
  --rb-review: #c95c36;
  --rb-review-tint: #f7e9e2;
  --rb-border: #cdd7d2;
  --rb-tint: #e7f1ee;
  --rb-success: #18794e;
  --rb-warning: #9a6700;
  --rb-danger: #b42318;
  --rb-review-cta-ink: #000;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --rb-ink: #f5f7f5;
  --rb-soft: #dceee8;
  --rb-muted: #a9c6bd;
  --rb-canvas: #0f1b18;
  --rb-card: #152a25;
  --rb-primary: #167463;
  --rb-primary-dark: #0d5548;
  --rb-link: #65c6b0;
  --rb-review: #f3b39c;
  --rb-review-tint: #3b241c;
  --rb-border: #35564c;
  --rb-tint: #173d35;
  --rb-success: #6ee7a9;
  --rb-warning: #ffd166;
  --rb-review-cta-ink: #2b1711;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--rb-canvas);
  color: var(--rb-ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}
a { color: var(--rb-link); }
button, input, textarea, select { font: inherit; }
:focus-visible { outline: 3px solid var(--rb-primary); outline-offset: 3px; }
html:not(.demo-enhanced) [data-theme-toggle],
html:not(.demo-enhanced) [data-skip-animation] {
  display: none;
}
.demo-enhanced [data-theme-toggle], .demo-enhanced [data-skip-animation] {
  display: inline-flex;
}
.container { width: min(68rem, calc(100% - 2rem)); margin-inline: auto; }
.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.625rem;
  padding: 0.7rem 1rem;
  font-weight: 650;
  text-decoration: none;
}
.btn-primary { background: var(--rb-primary); color: #fff; }
.btn-review { background: var(--rb-review); color: var(--rb-review-cta-ink); }
.btn-secondary { border-color: var(--rb-border); color: var(--rb-ink); }
.demo-intro { display: grid; min-height: 100svh; align-items: center; padding-block: 3rem; }
.demo-disclosure {
  border: 1px solid var(--rb-border);
  border-radius: 0.75rem;
  background: var(--rb-card);
  padding: 1rem;
}
.skip-link {
  position: fixed;
  inset: 0 auto auto 1rem;
  min-height: 44px;
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); z-index: 100; }
.app-shell { min-height: 100svh; }
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 16rem;
  overflow-y: auto;
  background: var(--rb-primary-dark);
  color: #fff;
  padding: 1rem;
}
.app-sidebar .brand { display: block; margin-bottom: 2rem; }
.app-sidebar .brand img { display: block; height: auto; max-width: 100%; }
.app-nav { display: grid; gap: 0.25rem; }
.app-nav a {
  display: flex;
  min-height: 44px;
  align-items: center;
  border-radius: 0.5rem;
  color: #fff;
  padding-inline: 0.75rem;
  text-decoration: none;
}
.app-nav a[aria-current="page"], .app-nav a:hover { background: rgba(255, 255, 255, 0.16); }
.app-main { min-width: 0; padding: 1rem; }
.app-content { margin-left: 16rem; min-width: 0; }
.app-toolbar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.app-toolbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.shell-control {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rb-border);
  border-radius: 0.625rem;
  background: var(--rb-card);
  color: var(--rb-ink);
  padding-inline: 0.75rem;
}
.demo-marker {
  display: inline-flex;
  border-radius: 999px;
  background: var(--rb-review-tint);
  color: var(--rb-ink);
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
}
.card {
  border: 1px solid var(--rb-border);
  border-radius: 0.75rem;
  background: var(--rb-card);
  padding: 1rem;
}
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.walkthrough-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  border: 1px solid var(--rb-review);
  background: var(--rb-review-tint);
  padding: 0.75rem 1rem;
}
[data-walkthrough-back] {
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.scope-list { display: grid; grid-template-columns: minmax(10rem, 14rem) 1fr; gap: 0.5rem 1rem; }
.scope-list dt { color: var(--rb-muted); }
.scope-list dd { margin: 0; overflow-wrap: anywhere; }
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1rem;
}
.progress-value { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 750; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.status-good { color: var(--rb-success); }
.status-review { color: var(--rb-review); }
.status-exception { color: var(--rb-warning); }
.review-panel { border-color: var(--rb-review); background: var(--rb-review-tint); }
.exception-list code, .path-sample code { overflow-wrap: anywhere; }
.manifest-digest { overflow-wrap: anywhere; }
[data-demo-animation][data-state="animating"] [data-outcome-value] { color: var(--rb-muted); }
[data-demo-animation][data-state="settled"] [data-skip-animation] { display: none; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { border-left: 2px solid var(--rb-border); padding: 0 0 1.25rem 1rem; }
.audit-list { display: grid; gap: 0.5rem; padding: 0; list-style: none; }
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  border-bottom: 1px solid var(--rb-border);
  padding: 0.75rem;
  text-align: left;
  vertical-align: top;
}
.mobile-menu-button { display: none; }
.mobile-nav { display: none; }
.mobile-nav-panel {
  min-height: 100%;
  width: min(20rem, 88vw);
  background: var(--rb-primary-dark);
  color: #fff;
  padding: 1rem;
}
.mobile-nav .shell-control { margin-bottom: 1rem; }
.status-healthy { color: var(--rb-success); font-weight: 700; }
.muted { color: var(--rb-muted); }
@media (max-width: 47.99rem) {
  .app-sidebar {
    position: static;
    width: auto;
    overflow-y: visible;
  }
  .app-sidebar .brand {
    width: min(15rem, 100%);
    margin-bottom: 1rem;
  }
  .app-content { margin-left: 0; }
  .app-toolbar { align-items: flex-start; }
  .card-grid { grid-template-columns: 1fr; }
  .walkthrough-bar { grid-template-columns: 1fr; }
  .scope-list { grid-template-columns: 1fr; }
  .progress-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-enhanced .app-sidebar { display: none; }
  .demo-enhanced .mobile-menu-button { display: inline-flex; }
  .demo-enhanced .mobile-nav[data-open="true"] {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 27, 24, 0.68);
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
