:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #eef2f8;
  --text: #162033;
  --muted: #5f6b7c;
  --line: #d9e0ea;
  --accent: #4467e8;
  --accent-2: #7649d8;
  --ok: #16805a;
  --warn: #a45a00;
  --danger: #b42318;
  --shadow: 0 12px 34px rgba(25, 39, 72, 0.1);
  --code: #1e1f22;
  --code-head: #2b2d30;
  --code-text: #bcbec4;
  --font-scale: 1;
}
html[data-theme="dark"] {
  --bg: #0d1118;
  --surface: #151b24;
  --surface-2: #1d2531;
  --text: #edf2f8;
  --muted: #aab6c6;
  --line: #2b3544;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
  --code: #1e1f22;
  --code-head: #2b2d30;
  --code-text: #bcbec4;
}
html[data-accent="emerald"] {
  --accent: #087f5b;
  --accent-2: #1098ad;
}
html[data-accent="amber"] {
  --accent: #d97706;
  --accent-2: #b45309;
}
html[data-accent="rose"] {
  --accent: #c2255c;
  --accent-2: #9c36b5;
}
html[data-accent="cyan"] {
  --accent: #087ea4;
  --accent-2: #0b7285;
}
html[data-accent="violet"] {
  --accent: #6741d9;
  --accent-2: #9c36b5;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  font-size: calc(16px * var(--font-scale));
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.62;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
select,
input {
  font: inherit;
}
.app {
  min-height: 100vh;
}
.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--accent), var(--accent-2));
  color: white;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
}
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}
.icon-btn,
.compact-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  min-width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn:hover,
.compact-btn:hover {
  border-color: var(--accent);
  background: var(--surface-2);
}
.icon-btn svg,
.compact-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.control {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background: var(--surface);
  color: var(--text);
}
.layout {
  display: grid;
  grid-template-columns: 285px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}
.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow: auto;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  background: var(--surface);
}
.sidebar .nav-group-title {
  padding: 4px 12px 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.91rem;
}
.sidebar a:hover,
.sidebar a.active {
  background: var(--surface-2);
  text-decoration: none;
  color: var(--accent);
}
.nav-icon {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.73rem;
  font-weight: 800;
  flex: 0 0 auto;
}
.content {
  min-width: 0;
  padding: 34px clamp(20px, 4vw, 62px) 90px;
}
.content-inner {
  max-width: 1180px;
  margin: 0 auto;
}
.hero {
  position: relative;
  overflow: hidden;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--surface) 95%, var(--accent) 5%),
    var(--surface)
  );
  box-shadow: var(--shadow);
}
.hero:after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  right: -100px;
  top: -130px;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 28%, transparent),
    transparent 68%
  );
}
.eyebrow {
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.76rem;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0.35rem 0 1rem;
  max-width: 900px;
}
.hero p {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.08rem;
}
.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.primary-btn,
.secondary-btn {
  border-radius: 11px;
  padding: 10px 15px;
  font-weight: 750;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.primary-btn {
  background: var(--accent);
  color: white;
}
.primary-btn:hover {
  text-decoration: none;
  filter: brightness(1.05);
}
.secondary-btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.secondary-btn:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 5px 16px rgba(20, 30, 55, 0.05);
}
.card h3 {
  margin: 0.25rem 0 0.45rem;
}
.card p {
  color: var(--muted);
  margin: 0.3rem 0;
}
.card .tag {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  font-size: 0.75rem;
  color: var(--accent);
  font-weight: 750;
}
.metric {
  font-size: 2rem;
  font-weight: 850;
  line-height: 1;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 34px 0 12px;
}
.section-head h2 {
  margin: 0;
}
.muted {
  color: var(--muted);
}
.goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.goal {
  padding: 16px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
  border-radius: 0 14px 14px 0;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.chapter-search {
  position: sticky;
  top: 74px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 8px;
  padding: 10px;
  margin: 22px 0;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.chapter-search input {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 12px;
}
.hit-count {
  display: flex;
  align-items: center;
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.86rem;
}
details.chapter {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  margin: 14px 0;
  overflow: hidden;
  scroll-margin-top: 145px;
}
details.chapter[open] {
  box-shadow: var(--shadow);
}
details.chapter summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 52px 18px 20px;
  font-size: 1.14rem;
  font-weight: 800;
  position: relative;
}
details.chapter summary::-webkit-details-marker {
  display: none;
}
details.chapter summary:after {
  content: "+";
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--accent);
}
details.chapter[open] summary:after {
  content: "−";
}
.chapter-body {
  padding: 0 20px 20px;
}
.chapter-body p {
  max-width: 900px;
}
.chapter-close {
  display: flex;
  justify-content: flex-end;
  margin-top: 15px;
}
.chapter-close button {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 10px;
  cursor: pointer;
}
.chapter.match {
  outline: 3px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
mark {
  background: color-mix(in srgb, var(--accent) 25%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.code-shell {
  margin: 18px 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--code);
  border: 1px solid #3a3d41;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.code-head {
  height: 38px;
  background: var(--code-head);
  color: #bcbec4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.copy-code {
  border: 1px solid #4a4d51;
  border-radius: 7px;
  background: #393b40;
  color: #f0f1f2;
  padding: 4px 9px;
  cursor: pointer;
  font-size: 0.76rem;
}
.copy-code:hover {
  background: #45484e;
}
.code-shell pre {
  margin: 0;
  padding: 17px 18px;
  overflow-x: auto;
  tab-size: 4;
  color: var(--code-text);
  font:
    13.5px/1.62 "JetBrains Mono",
    "Cascadia Code",
    "SFMono-Regular",
    Consolas,
    monospace;
  white-space: pre;
}
.code-shell code {
  font: inherit;
}
.code-shell .hll {
  background-color: #49483e;
}
.code-shell .c,
.code-shell .ch,
.code-shell .cm,
.code-shell .cp,
.code-shell .cpf,
.code-shell .c1,
.code-shell .cs {
  color: #7a7e85;
  font-style: italic;
}
.code-shell .k,
.code-shell .kc,
.code-shell .kd,
.code-shell .kn,
.code-shell .kp,
.code-shell .kr,
.code-shell .kt {
  color: #cf8e6d;
}
.code-shell .s,
.code-shell .sa,
.code-shell .sb,
.code-shell .sc,
.code-shell .dl,
.code-shell .sd,
.code-shell .s2,
.code-shell .se,
.code-shell .sh,
.code-shell .si,
.code-shell .sx,
.code-shell .sr,
.code-shell .s1,
.code-shell .ss {
  color: #6aab73;
}
.code-shell .m,
.code-shell .mb,
.code-shell .mf,
.code-shell .mh,
.code-shell .mi,
.code-shell .mo,
.code-shell .il {
  color: #2aacb8;
}
.code-shell .na {
  color: #c77dbb;
}
.code-shell .nb,
.code-shell .bp {
  color: #8888c6;
}
.code-shell .nc {
  color: #c7b97b;
}
.code-shell .nf,
.code-shell .fm {
  color: #56a8f5;
}
.code-shell .nn {
  color: #c7b97b;
}
.code-shell .no {
  color: #9876aa;
}
.code-shell .nv,
.code-shell .vc,
.code-shell .vg,
.code-shell .vi,
.code-shell .vm {
  color: #a9b7c6;
}
.code-shell .o,
.code-shell .ow {
  color: #bcbec4;
}
.code-shell .p {
  color: #bcbec4;
}
.code-shell .nt {
  color: #e8bf6a;
}
.code-shell .nd {
  color: #bbb529;
}
.workflow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 18px 0;
}
.workflow span {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 11px;
  font-weight: 700;
}
.workflow i {
  color: var(--accent);
  font-style: normal;
}
.footer {
  margin-top: 50px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
}
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  display: none;
  place-items: center;
  cursor: pointer;
  z-index: 50;
}
.to-top.visible {
  display: grid;
}
.to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.mobile-only {
  display: none;
}
.desktop-only {
  display: inline-flex;
}
.search-results {
  margin-top: 20px;
}
.result-item {
  display: block;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 15px;
  margin: 9px 0;
  color: var(--text);
}
.result-item:hover {
  border-color: var(--accent);
  text-decoration: none;
}
.result-item small {
  color: var(--muted);
}
.diagram {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: 15px;
  margin: 20px 0;
}
.diagram img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: auto;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px;
  background: var(--surface);
}
th,
td {
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}
th {
  background: var(--surface-2);
}
.callout {
  border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
}
.status-ok {
  color: var(--ok);
  font-weight: 800;
}
.status-warn {
  color: var(--warn);
  font-weight: 800;
}
@media (max-width: 1000px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(88vw, 320px);
    transform: translateX(-102%);
    transition: 0.2s;
    padding-top: 76px;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar {
    transform: translateX(0);
  }
  .mobile-only {
    display: inline-flex;
  }
  .desktop-only {
    display: none;
  }
  .content {
    padding: 26px 18px 80px;
  }
  .topbar {
    padding: 0 12px;
  }
  .brand span:last-child {
    max-width: 52vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .goals {
    grid-template-columns: 1fr;
  }
  .chapter-search {
    top: 72px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .hit-count {
    grid-column: 1/-1;
  }
  .hero {
    padding: 28px 22px;
  }
}
@media (max-width: 620px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .top-actions .control {
    display: none;
  }
  .hero h1 {
    font-size: 2.25rem;
  }
  .content {
    padding-left: 12px;
    padding-right: 12px;
  }
  .chapter-search {
    padding: 8px;
  }
  .chapter-search input {
    grid-column: 1/-1;
  }
  .chapter-search .compact-btn {
    min-width: 44px;
  }
  .hero-actions a {
    width: 100%;
    justify-content: center;
  }
  .card {
    padding: 17px;
  }
  .brand {
    font-size: 0.88rem;
  }
  .code-shell pre {
    font-size: 12.6px;
  }
  .goals {
    margin-top: 15px;
  }
  .footer {
    padding-bottom: 60px;
  }
}

/* Consistent, scannable treatment for all index hubs. */
body[data-page-type="hub"] .content-inner {
  width: 100%;
}
body[data-page-type="hub"] .content-inner > .eyebrow:first-child {
  margin-top: 0.25rem;
}
body[data-page-type="hub"] .content-inner > h1 {
  max-width: 900px;
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.08;
}
body[data-page-type="hub"] .content-inner > .lead {
  max-width: 820px;
  color: var(--muted);
  font-size: 1.08rem;
}
body[data-page-type="hub"] a.card {
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}
body[data-page-type="hub"] a.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: var(--shadow);
  text-decoration: none;
}
body[data-page-type="hub"] a[aria-current="page"] {
  color: var(--accent);
}
.theme-clusters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.theme-clusters .card {
  display: flex;
  flex-direction: column;
}
.theme-clusters .card > h3 {
  margin-top: 1rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.theme-clusters .card > .cluster-title {
  margin-top: 0;
  color: var(--text);
  font-size: 1.18rem;
  letter-spacing: normal;
  text-transform: none;
}
.theme-clusters .card > ul {
  margin-top: 0.35rem;
}
@media (max-width: 820px) {
  .theme-clusters {
    grid-template-columns: 1fr;
  }
}
@media print {
  .topbar,
  .sidebar,
  .chapter-search,
  .to-top,
  .copy-code,
  .chapter-close {
    display: none !important;
  }
  .layout {
    display: block;
  }
  .content {
    padding: 0;
  }
  .hero,
  details.chapter {
    box-shadow: none;
  }
  details.chapter {
    break-inside: avoid;
  }
  details.chapter:not([open]) .chapter-body {
    display: block;
  }
}

/* WORKFLOW-EXPANSION-2026-07-12 */
.workflow-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  position: sticky;
  top: 74px;
  z-index: 20;
  box-shadow: var(--shadow);
}
.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.progress-track {
  height: 11px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.progress-track span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s;
}
.workflow-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.workflow-actions button {
  cursor: pointer;
}
.work-section {
  margin: 22px 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}
.work-section .section-head {
  margin: 0 0 14px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-weight: 750;
}
.form-field textarea,
.form-field input {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  font-weight: 450;
  line-height: 1.55;
}
.form-field textarea:focus,
.form-field input:focus {
  outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
}
.step-checks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.check-step {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
}
.check-step input {
  margin-top: 4px;
  accent-color: var(--accent);
}
@media (max-width: 850px) {
  .workflow-toolbar {
    grid-template-columns: 1fr;
    position: relative;
    top: auto;
  }
  .workflow-actions {
    justify-content: flex-start;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .step-checks {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .workflow-actions button {
    width: 100%;
    justify-content: center;
  }
  .work-section {
    padding: 16px;
  }
}

/* SENIOR-LABS-V2 */
.sim-flow {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 0;
}
.sim-node {
  min-width: 150px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  padding: 14px;
  cursor: pointer;
  text-align: left;
}
.sim-node b,
.sim-node span {
  display: block;
}
.sim-node span {
  color: var(--muted);
  margin-top: 5px;
}
.sim-node:hover,
.arch-map button:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.arch-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.arch-map button {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.refactor-steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}
.refactor-steps li,
.review-grid label {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.review-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.question-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  padding: 12px;
}
.form-field select {
  width: 100%;
}
@media (max-width: 720px) {
  .arch-map,
  .review-grid {
    grid-template-columns: 1fr;
  }
}

/* ENTERPRISE-SIMULATION-V3 */
.mission-board,
.system-landscape,
.incident-board,
.code-graph,
.learning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.mission-stage,
.system-card,
.incident-card,
.code-node,
.learning-card,
.timeline-item {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}
.mission-stage:hover,
.system-card:hover,
.incident-card:hover,
.code-node:hover,
.learning-card:hover,
.timeline-item:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.mission-stage span,
.system-card span,
.incident-card span,
.code-node span,
.learning-card span,
.timeline-item span,
.timeline-item small {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}
.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.impact-check {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}
.impact-check input {
  accent-color: var(--accent);
}
.architect-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.architecture-timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 18px 0;
}
.timeline-item {
  position: relative;
  min-height: 140px;
}
.timeline-item:after {
  content: "→";
  position: absolute;
  right: -10px;
  top: 50%;
  color: var(--accent);
  font-weight: 900;
}
.timeline-item:last-child:after {
  display: none;
}
@media (max-width: 760px) {
  .architect-questions {
    grid-template-columns: 1fr;
  }
  .architecture-timeline {
    grid-template-columns: repeat(5, 220px);
  }
}

/* ENTERPRISE-ENGINEERING-V4 */
.v4-grid,
.v4-graph,
.metric-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.v4-card,
.sequence-step,
.metric-tile {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: 0.18s;
}
.v4-card:hover,
.sequence-step:hover,
.metric-tile:hover,
.sequence-step.active {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.v4-card span,
.sequence-step span {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}
.sequence-track {
  display: grid;
  grid-template-columns: repeat(9, minmax(180px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding: 16px 0;
}
.metric-tile span {
  display: block;
  color: var(--muted);
}
.metric-tile b {
  display: block;
  font-size: 1.7rem;
  margin-top: 8px;
}
.metric-tile.bad {
  border-color: #d65c6d;
}
.metric-tile.warn {
  border-color: #d6a34a;
}
.metric-tile.ok {
  border-color: #4cad82;
}
.fitness-list {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}
.fitness-rule {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.fitness-rule small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}
.fitness-rule input {
  accent-color: var(--accent);
  margin-top: 3px;
}
.architect-questions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 760px) {
  .architect-questions {
    grid-template-columns: 1fr;
  }
  .sequence-track {
    grid-template-columns: repeat(9, 220px);
  }
}

/* ENTERPRISE-PLATFORM-V5 */
.v5-grid,
.fitness-dashboard,
.genome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.v5-card,
.evolution-step,
.kg-node,
.score-card,
.genome-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  transition: 0.18s;
}
.v5-card,
.evolution-step,
.kg-node {
  cursor: pointer;
}
.v5-card:hover,
.evolution-step:hover,
.kg-node:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.v5-card span,
.evolution-step span,
.kg-node span {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}
.canvas-board {
  min-height: 130px;
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.canvas-chip,
.sim-chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.canvas-arrow {
  color: var(--muted);
}
.timeline-v5,
.journey-track,
.assessment-list {
  display: grid;
  gap: 12px;
  margin: 20px 0;
}
.score-card b,
.genome-card b {
  display: block;
  font-size: 1.6rem;
  margin: 8px 0;
}
.score-track {
  height: 9px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.score-track i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.knowledge-graph {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.simulation-flow {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-x: auto;
  padding: 18px 0;
}
.sim-chip.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.assessment-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  background: var(--surface);
}
.journey-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
.journey-step small {
  display: block;
  color: var(--muted);
  margin-top: 5px;
}
.journey-step input {
  margin-top: 4px;
  accent-color: var(--accent);
}
@media (max-width: 760px) {
  .simulation-flow {
    align-items: stretch;
  }
  .sim-chip {
    min-width: 180px;
  }
  .v5-grid,
  .fitness-dashboard,
  .genome-grid {
    grid-template-columns: 1fr;
  }
}

/* REAL-ENTERPRISE-V6 */
.v6-grid,
.ops-dashboard,
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 22px 0;
}
.v6-card,
.metric-tile,
.flow-step,
.trace-span,
.cert-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  color: var(--text);
  padding: 16px;
  text-align: left;
  transition: 0.18s;
}
.v6-card,
.metric-tile,
.flow-step,
.trace-span {
  cursor: pointer;
}
.v6-card:hover,
.metric-tile:hover,
.flow-step:hover,
.trace-span:hover,
.active {
  border-color: var(--accent) !important;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.v6-card span,
.flow-step span,
.trace-span span,
.cert-card span {
  display: block;
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
}
.flow-track,
.trace-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 18px 2px;
}
.flow-step {
  min-width: 210px;
}
.flow-step i {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-style: normal;
  margin-bottom: 10px;
}
.trace-span {
  min-width: 190px;
}
.trace-span small {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}
.metric-tile b {
  display: block;
  font-size: 1.35rem;
  margin-top: 8px;
}
.cert-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cert-card input {
  margin-top: 4px;
  accent-color: var(--accent);
}
.diagram {
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #101722;
  margin: 16px 0;
}
@media (max-width: 760px) {
  .v6-grid,
  .ops-dashboard,
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .flow-step,
  .trace-span {
    min-width: 82vw;
  }
}

/* Finalisierung: Accessibility */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* === Enterprise Professional UI 2.0 === */
:root {
  --sidebar-w: 272px;
  --rail-w: 250px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm:
    0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 14px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 18px 55px rgba(15, 23, 42, 0.14);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
  --core: #3b82f6;
  --platform: #0f9f8f;
  --reference: #22a06b;
  --academy: #d97706;
  --ai: #7c3aed;
  --quality: #dc2626;
  --market: #4f46e5;
}
body {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--bg) 96%, var(--accent) 4%),
    var(--bg) 360px
  );
  letter-spacing: -0.006em;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(
    circle at 1px 1px,
    color-mix(in srgb, var(--text) 8%, transparent) 1px,
    transparent 0
  );
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 55%);
  opacity: 0.22;
  z-index: -1;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus) !important;
  border-color: var(--accent) !important;
}
.topbar {
  height: 68px;
  padding: 0 20px;
  border-bottom-color: color-mix(in srgb, var(--line) 82%, transparent);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
}
.brand {
  font-size: 0.94rem;
  letter-spacing: -0.01em;
}
.brand-mark {
  border-radius: 11px;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 30%, transparent);
}
.layout {
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
}
.sidebar {
  top: 68px;
  height: calc(100vh - 68px);
  padding: 16px 10px;
  background: color-mix(in srgb, var(--surface) 97%, var(--bg) 3%);
}
.sidebar::-webkit-scrollbar {
  width: 7px;
}
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 10px;
}
.sidebar a {
  position: relative;
  min-height: 42px;
  padding: 9px 10px;
  border-radius: 11px;
  font-weight: 620;
  transition: 0.18s ease;
}
.sidebar a:hover {
  transform: translateX(2px);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
}
.sidebar a.active {
  background: color-mix(in srgb, var(--accent) 13%, var(--surface));
  color: var(--accent);
}
.sidebar a.active::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}
.nav-icon {
  width: 27px;
  height: 27px;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
}
.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}
.content {
  padding-top: 28px;
}
.content-inner {
  max-width: 1380px;
}
.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--rail-w);
  gap: 28px;
  align-items: start;
}
.page-main {
  min-width: 0;
}
.context-rail {
  position: sticky;
  top: 90px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.context-rail h3 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin: 0 0 10px;
}
.context-rail a {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.84rem;
}
.context-rail a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.context-meta {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}
.context-meta span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--muted);
}
.context-meta b {
  color: var(--text);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.82rem;
}
.breadcrumbs a {
  color: var(--muted);
}
.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: none;
}
.breadcrumbs svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
}
.hero {
  padding: 42px;
  border-radius: 22px;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--surface) 94%, var(--accent) 6%),
    var(--surface)
  );
  box-shadow: var(--shadow-sm);
}
.hero h1 {
  font-size: clamp(2rem, 4.2vw, 3.55rem);
  letter-spacing: -0.045em;
}
.hero p {
  font-size: 1.02rem;
}
.eyebrow {
  letter-spacing: 0.1em;
}
.grid {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  border-radius: 16px;
  padding: 19px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 38%, var(--line));
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1);
}
a.card {
  text-decoration: none;
  color: inherit;
}
.card h3 {
  font-size: 1rem;
}
.card p {
  font-size: 0.9rem;
}
.card .tag {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.product-card {
  overflow: hidden;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--product-color, var(--accent));
}
.product-card[data-product="core"] {
  --product-color: var(--core);
}
.product-card[data-product="platform"] {
  --product-color: var(--platform);
}
.product-card[data-product="reference"] {
  --product-color: var(--reference);
}
.product-card[data-product="academy"] {
  --product-color: var(--academy);
}
.product-card[data-product="ai"] {
  --product-color: var(--ai);
}
.product-card[data-product="quality"] {
  --product-color: var(--quality);
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 750;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
}
.status-pill.warn::before {
  background: var(--warn);
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.dashboard-grid > .span-8 {
  grid-column: span 8;
}
.dashboard-grid > .span-4 {
  grid-column: span 4;
}
.dashboard-grid > .span-6 {
  grid-column: span 6;
}
.metric-card {
  min-height: 118px;
}
.metric-card .metric {
  font-size: 2.2rem;
  letter-spacing: -0.04em;
}
.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.progress-track {
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 12px;
}
.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.quick-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
}
.quick-action:hover {
  text-decoration: none;
  border-color: var(--accent);
  background: var(--surface-2);
}
.quick-action svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
}
.primary-btn,
.secondary-btn {
  border-radius: 10px;
  font-size: 0.86rem;
  padding: 9px 13px;
}
.icon-btn,
.compact-btn,
.control {
  border-radius: 9px;
}
.icon-btn:hover,
.compact-btn:hover {
  transform: translateY(-1px);
}
.code-shell {
  border-radius: 13px;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.25);
}
.code-head {
  height: 42px;
}
.code-language {
  display: flex;
  align-items: center;
  gap: 8px;
}
.code-language::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
}
.code-tools {
  display: flex;
  gap: 6px;
}
.code-tool {
  border: 1px solid #4a4d51;
  border-radius: 7px;
  background: #34363a;
  color: #e7e8ea;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 0.72rem;
}
.code-shell.has-lines pre {
  counter-reset: line;
}
.code-shell.has-lines pre .code-line {
  display: block;
  position: relative;
  padding-left: 3.2em;
}
.code-shell.has-lines pre .code-line::before {
  counter-increment: line;
  content: counter(line);
  position: absolute;
  left: 0;
  width: 2.4em;
  text-align: right;
  color: #5f6368;
  user-select: none;
}
.code-shell.collapsed pre {
  max-height: 180px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, #000 60%, transparent);
}
.command-palette {
  position: fixed;
  inset: 0;
  display: none;
  place-items: start center;
  padding-top: min(15vh, 130px);
  background: rgba(4, 8, 15, 0.55);
  backdrop-filter: blur(7px);
  z-index: 1000;
}
.command-palette.open {
  display: grid;
}
.command-box {
  width: min(720px, calc(100vw - 28px));
  max-height: 70vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}
.command-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.command-input-wrap svg {
  width: 21px;
  height: 21px;
  stroke: var(--muted);
  fill: none;
}
.command-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  outline: 0;
}
.command-results {
  max-height: 54vh;
  overflow: auto;
  padding: 8px;
}
.command-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.command-item:hover,
.command-item.active {
  background: var(--surface-2);
}
.command-item svg {
  width: 19px;
  height: 19px;
  stroke: var(--accent);
  fill: none;
}
.command-item small {
  display: block;
  color: var(--muted);
}
.command-kbd {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 0.7rem;
}
.command-trigger {
  min-width: auto;
  padding: 0 12px;
  gap: 7px;
}
.command-trigger kbd {
  font: inherit;
  font-size: 0.68rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
}
.floating-tools {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 55;
}
.floating-tools .to-top {
  position: static;
  display: grid;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
}
.floating-tools .to-top.visible {
  opacity: 1;
  pointer-events: auto;
}
.float-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.float-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
}
.diagram {
  position: relative;
  overflow: auto;
  background: linear-gradient(
    180deg,
    var(--surface),
    color-mix(in srgb, var(--surface-2) 70%, var(--surface))
  );
  border-radius: 16px;
}
.diagram img,
.diagram svg {
  max-width: none;
}
.diagram-toolbar {
  display: flex;
  gap: 6px;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}
.diagram-toolbar button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
[data-depth="beginner"] .deep-dive,
[data-depth="beginner"] .architect-only {
  display: none !important;
}
[data-depth="professional"] .architect-only {
  display: none !important;
}
.depth-select {
  max-width: 185px;
}
.simple-interface .page-progress {
  display: none;
}
[data-depth="beginner"] .context-rail {
  display: none;
}
[data-depth="architect"] details[open] > summary {
  color: var(--accent);
}
@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .context-rail {
    display: none;
  }
  .dashboard-grid > .span-8,
  .dashboard-grid > .span-4,
  .dashboard-grid > .span-6 {
    grid-column: span 12;
  }
}
@media (max-width: 860px) {
  :root {
    --sidebar-w: 278px;
  }
  .topbar {
    height: 60px;
    padding: 0 10px;
  }
  .layout {
    display: block;
  }
  .sidebar {
    top: 60px;
    height: calc(100vh - 60px);
  }
  .content {
    padding: 20px 14px 84px;
  }
  .hero {
    padding: 26px 20px;
  }
  .hero h1 {
    font-size: 2.05rem;
  }
  .top-actions .control,
  .top-actions .desktop-only {
    display: none !important;
  }
  .command-trigger span {
    display: none;
  }
  .command-trigger kbd {
    display: none;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid > * {
    grid-column: auto !important;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .floating-tools {
    right: 12px;
    bottom: 12px;
  }
  .chapter-search {
    top: 68px;
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
  .chapter-search .hit-count {
    grid-column: 1/-1;
  }
  .breadcrumbs {
    margin-top: 2px;
  }
  .card:hover {
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* === Professional UI Optimization 2.1 === */
.skip-link {
  position: fixed;
  left: 12px;
  top: 8px;
  z-index: 2000;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease;
}
.skip-link:focus {
  transform: translateY(0);
}
.sidebar-tools {
  position: sticky;
  top: -16px;
  z-index: 8;
  margin: -16px -10px 10px;
  padding: 14px 10px 10px;
  background: linear-gradient(
    var(--surface),
    color-mix(in srgb, var(--surface) 96%, transparent)
  );
  border-bottom: 1px solid var(--line);
}
.sidebar-filter-wrap {
  position: relative;
}
.sidebar-filter-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  stroke: var(--muted);
  fill: none;
}
.sidebar-filter {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px 8px 35px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  outline: 0;
}
.sidebar-filter:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
.sidebar-filter-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.7rem;
}
.sidebar-filter-clear {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-weight: 700;
}
.nav-group-title {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 35px;
  padding: 8px 8px !important;
  margin-top: 10px !important;
  border-radius: 9px;
  cursor: pointer;
  user-select: none;
}
.nav-group-title:hover {
  background: var(--surface-2);
}
.nav-group-title::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.16s ease;
}
.nav-group-title.collapsed::after {
  transform: rotate(-45deg);
}
.sidebar a.nav-hidden {
  display: none;
}
.sidebar.filtering .nav-group-title {
  display: none !important;
}
.sidebar .nav-no-results {
  display: none;
  padding: 18px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}
.sidebar.filter-empty .nav-no-results {
  display: block;
}
.sidebar-compact .sidebar a {
  min-height: 37px;
  padding-block: 7px;
}
.sidebar-compact .nav-icon {
  width: 24px;
  height: 24px;
}
.sidebar-compact .nav-group-title {
  min-height: 30px;
}
.ui-perf-section {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}
.card,
.diagram,
.code-shell,
details,
.table-wrap {
  content-visibility: auto;
  contain-intrinsic-size: 1px 280px;
}
.command-item.keyboard-active {
  background: var(--surface-2);
  outline: 2px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: -2px;
}
.command-results mark {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  color: inherit;
  border-radius: 3px;
  padding: 0 1px;
}
.page-progress {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1100;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: width 0.08s linear;
}
.topbar {
  isolation: isolate;
}
.topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--accent) 35%, var(--line)),
    transparent
  );
  pointer-events: none;
}
.sidebar a span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar a {
  contain: layout paint;
}
.hero {
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -110px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 13%, transparent),
    transparent 68%
  );
  pointer-events: none;
}
@media (max-width: 860px) {
  .sidebar-tools {
    top: -16px;
  }
  .sidebar {
    overscroll-behavior: contain;
  }
  .command-box {
    max-height: 82vh;
  }
  .command-results {
    max-height: 66vh;
  }
  .depth-select {
    display: none !important;
  }
}
@media print {
  .skip-link,
  .page-progress,
  .sidebar-tools,
  .command-palette,
  .floating-tools {
    display: none !important;
  }
  .ui-perf-section,
  .card,
  .diagram,
  .code-shell,
  details,
  .table-wrap {
    content-visibility: visible;
  }
}

/* Offline Java syntax highlighting, including blocks outside code-shell. */
code.language-java {
  color: #a9b7c6;
}
code.language-java .c,
code.language-java .c1,
code.language-java .cm,
code.language-java .cp {
  color: #7a7e85;
  font-style: italic;
}
code.language-java .k,
code.language-java .kc,
code.language-java .kd,
code.language-java .kn,
code.language-java .kr,
code.language-java .kt {
  color: #cf8e6d;
}
code.language-java .s,
code.language-java .s1,
code.language-java .s2,
code.language-java .sc {
  color: #6aab73;
}
code.language-java .m,
code.language-java .mi,
code.language-java .mf {
  color: #2aacb8;
}
code.language-java .nc {
  color: #c7b97b;
}
code.language-java .nd {
  color: #bbb529;
}
code.language-java .na,
code.language-java .nf {
  color: #56a8f5;
}
code.language-java .n,
code.language-java .nn,
code.language-java .nv {
  color: #a9b7c6;
}
code.language-java .o,
code.language-java .p {
  color: #bcbec4;
}
code.language-java .w {
  color: inherit;
}

.practice-artifact dl {
  display: grid;
  grid-template-columns: minmax(130px, 0.28fr) 1fr;
  gap: 0;
  margin: 1rem 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.workbench-brief {
  display: grid;
  grid-template-columns: minmax(170px, 0.3fr) 1fr;
  column-gap: 20px;
  row-gap: 0;
  margin: 22px 0;
  border-left: 4px solid var(--accent);
  box-shadow: none;
}
.workbench-brief h2 {
  grid-column: 1 / -1;
  margin-top: 0;
}
.workbench-brief h3,
.workbench-brief p {
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.workbench-brief h3 {
  font-size: 0.93rem;
}
.workbench-brief p {
  color: var(--text);
}
.decision-matrix {
  margin: 22px 0;
  box-shadow: none;
}
.practice-artifact {
  margin-top: 28px;
}
.practice-artifact dt,
.practice-artifact dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.practice-artifact dt {
  background: var(--surface-2);
  font-weight: 800;
}
.practice-artifact dt:last-of-type,
.practice-artifact dd:last-of-type {
  border-bottom: 0;
}
@media (max-width: 620px) {
  .practice-artifact dl {
    grid-template-columns: 1fr;
  }
  .workbench-brief {
    grid-template-columns: 1fr;
  }
  .workbench-brief h3 {
    padding-bottom: 2px;
  }
  .workbench-brief p {
    padding-top: 2px;
    border-top: 0;
  }
  .practice-artifact dt {
    border-bottom: 0;
  }
}
