/* impeccable-disable overused-font: INDX reference cockpit uses Plus Jakarta Sans as the brand UI font. */
*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --surface: oklch(0.15 0.004 50);
  --surface-low: oklch(0.19 0.004 50);
  --surface-container: oklch(0.23 0.005 50);
  --surface-high: oklch(0.31 0.005 50);
  --ink: oklch(0.91 0.004 80);
  --ink-strong: oklch(0.98 0.002 80);
  --muted: oklch(0.74 0.006 70);
  --muted-strong: oklch(0.82 0.006 70);
  --line: oklch(0.38 0.006 50 / 0.7);
  --line-soft: oklch(0.38 0.006 50 / 0.35);
  --primary: oklch(0.68 0.22 42);
  --primary-strong: oklch(0.76 0.2 45);
  --primary-soft: oklch(0.68 0.22 42 / 0.12);
  --on-primary: oklch(0.2 0.07 35);
  --success: oklch(0.76 0.16 150);
  --warning: oklch(0.78 0.16 78);
  --info: oklch(0.75 0.13 225);
  --danger: oklch(0.68 0.19 28);
  --radius: 8px;
  --radius-sm: 6px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, oklch(0.17 0.014 38), var(--surface) 360px),
    var(--surface);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
}

body::selection {
  color: var(--on-primary);
  background: var(--primary-strong);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

a {
  color: var(--primary-strong);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: oklch(0.19 0.005 50 / 0.96);
  backdrop-filter: blur(14px);
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  width: 112px;
  height: auto;
  display: block;
}

.title-block {
  min-width: 0;
}

.kicker,
.panel-label {
  margin-bottom: 0.2rem;
  color: var(--primary-strong);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.title-block h1 {
  margin-bottom: 0.1rem;
  color: var(--ink-strong);
  font-size: 1.35rem;
  line-height: 1.15;
  text-wrap: balance;
}

.title-block p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

.icon-button,
.segment,
.tab {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-high);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 180ms var(--ease), color 180ms var(--ease), background 180ms var(--ease);
}

.icon-button {
  padding: 0 0.75rem;
  color: var(--primary-strong);
  font-size: 0.73rem;
  font-weight: 800;
}

.icon-button:hover,
.segment:hover,
.tab:hover {
  border-color: oklch(0.68 0.22 42 / 0.55);
  background: oklch(0.68 0.22 42 / 0.1);
}

.icon-button:focus-visible,
.segment:focus-visible,
.tab:focus-visible,
.module-row:focus-visible,
.flow-step:focus-visible,
.search-box input:focus-visible {
  outline: 3px solid oklch(0.68 0.22 42 / 0.28);
  outline-offset: 2px;
  border-color: var(--primary-strong);
}

.shell {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 1.25rem 1.5rem 3rem;
}

.executive-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(520px, 1.1fr);
  gap: 1rem;
  align-items: stretch;
}

.intro-panel,
.process-band,
.module-sidebar,
.detail-panel,
.method-band {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-container);
}

.intro-panel {
  padding: 1.35rem 1.4rem;
}

.intro-panel h2 {
  max-width: 17ch;
  margin-bottom: 0.7rem;
  color: var(--ink-strong);
  font-size: 2.1rem;
  line-height: 1.05;
  text-wrap: balance;
}

.intro-panel p {
  max-width: 68ch;
  margin-bottom: 1rem;
  color: var(--muted-strong);
}

.scope-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.scope-tags span,
.count-pill,
.scope-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.scope-tags span {
  padding: 0.2rem 0.58rem;
  color: var(--ink);
  background: var(--surface-high);
}

.metric-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--surface-container);
  overflow: hidden;
}

.metric {
  min-height: 122px;
  padding: 1rem 1.05rem;
  border-bottom: 1px solid var(--line-soft);
}

.metric:not(:nth-child(3n)) {
  border-right: 1px solid var(--line-soft);
}

.metric span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--primary-strong);
  font-size: 1.65rem;
  line-height: 1;
}

.metric p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.process-band,
.method-band {
  margin-top: 1rem;
  padding: 1rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 0.9rem;
}

.section-heading h2,
.sidebar-head h2 {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 1.05rem;
  line-height: 1.25;
}

.flow-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.5rem;
}

.flow-step {
  min-height: 128px;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms var(--ease), border-color 180ms var(--ease), background 180ms var(--ease);
}

.flow-step:hover,
.flow-step.active {
  border-color: oklch(0.68 0.22 42 / 0.58);
  background: var(--primary-soft);
}

.flow-step:hover {
  transform: translateY(-1px);
}

.flow-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  color: var(--on-primary);
  background: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.flow-step strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-strong);
  font-size: 0.86rem;
}

.flow-step small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.workspace {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(330px, 0.92fr) minmax(520px, 1.08fr);
  gap: 1rem;
  align-items: start;
}

.module-sidebar {
  overflow: hidden;
}

.sidebar-head {
  min-height: 66px;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.count-pill {
  padding: 0.2rem 0.55rem;
  color: var(--muted-strong);
  background: var(--surface-high);
}

.toolbar {
  padding: 0.8rem;
  border-bottom: 1px solid var(--line-soft);
  display: grid;
  gap: 0.75rem;
  background: var(--surface-low);
}

.search-box {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 0.78rem;
  color: var(--ink);
  background: var(--surface-container);
}

.search-box input::placeholder {
  color: oklch(0.63 0.006 70);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.segment,
.tab {
  padding: 0 0.65rem;
  color: var(--muted-strong);
  font-size: 0.72rem;
  font-weight: 800;
}

.segment.active,
.tab.active {
  border-color: oklch(0.68 0.22 42 / 0.7);
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.module-list {
  display: grid;
  gap: 0.35rem;
  max-height: 660px;
  overflow: auto;
  padding: 0.45rem;
  background: var(--surface-low);
}

.module-row {
  width: 100%;
  min-height: 66px;
  padding: 0.72rem 0.75rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface-container);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease);
}

.module-row:hover,
.module-row.active {
  border-color: oklch(0.68 0.22 42 / 0.5);
  background: var(--surface-high);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
}

.status-dot.optional {
  background: var(--warning);
}

.module-row-main {
  min-width: 0;
}

.module-row-main strong,
.module-row-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-row-main strong {
  color: var(--ink-strong);
  font-size: 0.85rem;
}

.module-row-main small {
  color: var(--muted);
  font-size: 0.72rem;
}

.scope-chip {
  padding: 0.18rem 0.5rem;
  color: oklch(0.91 0.11 150);
  background: oklch(0.76 0.16 150 / 0.13);
}

.scope-chip.optional {
  color: oklch(0.9 0.12 78);
  background: oklch(0.78 0.16 78 / 0.14);
}

.detail-panel {
  position: sticky;
  top: 92px;
  min-height: 620px;
  padding: 1rem;
}

.module-detail-card {
  display: grid;
  gap: 1rem;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  gap: 1rem;
  align-items: stretch;
}

.detail-copy {
  min-height: 250px;
  padding: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-low);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.detail-copy h2 {
  margin-bottom: 0.55rem;
  color: var(--ink-strong);
  font-size: 2rem;
  line-height: 1.08;
  text-wrap: balance;
}

.detail-copy p {
  max-width: 68ch;
  margin-bottom: 0;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.detail-visual {
  min-height: 250px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-low);
}

.image-preview-button {
  position: relative;
  width: 100%;
  padding: 0;
  cursor: zoom-in;
  text-align: left;
}

.image-preview-button:hover,
.image-preview-button:focus-visible {
  border-color: oklch(0.68 0.22 42 / 0.72);
}

.image-preview-button .expand-icon {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid oklch(0.68 0.22 42 / 0.55);
  border-radius: var(--radius-sm);
  color: var(--primary-strong);
  background: oklch(0.15 0.004 50 / 0.9);
}

.image-preview-button .expand-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.detail-visual img,
.media-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.image-modal {
  width: min(1180px, calc(100vw - 2rem));
  max-width: none;
  max-height: min(92vh, 920px);
  border: 1px solid oklch(0.68 0.22 42 / 0.32);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: var(--surface-container);
}

.image-modal::backdrop {
  background: oklch(0.08 0.004 50 / 0.84);
  backdrop-filter: blur(4px);
}

.image-modal-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(92vh, 920px);
}

.image-modal-header {
  min-height: 68px;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.image-modal-header h2 {
  margin-bottom: 0;
  color: var(--ink-strong);
  font-size: 1.05rem;
}

.modal-close {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 0.75rem;
  color: var(--primary-strong);
  background: var(--surface-high);
  font-size: 0.73rem;
  font-weight: 900;
  cursor: pointer;
}

.modal-close:hover,
.modal-close:focus-visible {
  border-color: oklch(0.68 0.22 42 / 0.6);
  background: var(--primary-soft);
}

.image-modal-stage {
  min-height: 420px;
  max-height: calc(92vh - 136px);
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: oklch(0.11 0.004 50);
}

.image-modal-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(92vh - 180px);
  border-radius: var(--radius-sm);
  object-fit: contain;
}

.image-modal-caption {
  margin: 0;
  padding: 0.8rem 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tab-content {
  min-height: 260px;
  padding: 1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
}

.argument {
  max-width: 76ch;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.check-list,
.step-list,
.attention-list,
.limit-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li,
.step-list li,
.attention-list li,
.limit-list li {
  position: relative;
  padding: 0.62rem 0.72rem 0.62rem 2rem;
  border-radius: var(--radius-sm);
  background: var(--surface-container);
  color: var(--muted-strong);
}

.check-list li::before,
.step-list li::before,
.attention-list li::before,
.limit-list li::before {
  content: "";
  position: absolute;
  left: 0.72rem;
  top: 0.98rem;
  width: 0.48rem;
  height: 0.48rem;
  border-radius: 50%;
  background: var(--success);
}

.step-list li::before {
  background: var(--info);
}

.attention-list li::before {
  background: var(--warning);
}

.limit-list li::before {
  background: var(--danger);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.7rem;
}

.media-card,
.reference-card {
  min-height: 132px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-container);
}

.media-card {
  display: grid;
  grid-template-rows: 150px auto;
}

.media-card div,
.reference-card {
  padding: 0.8rem;
}

.media-card strong,
.reference-card strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-strong);
  font-size: 0.82rem;
}

.media-card p,
.reference-card p {
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.reference-card a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0.2rem 0.62rem;
  border: 1px solid oklch(0.68 0.22 42 / 0.45);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.phase-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
}

.phase-item {
  min-height: 150px;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-low);
}

.phase-item span {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--primary-strong);
  font-size: 0.72rem;
  font-weight: 900;
}

.phase-item h3 {
  margin-bottom: 0.4rem;
  color: var(--ink-strong);
  font-size: 0.9rem;
}

.phase-item p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 1180px) {
  .executive-grid,
  .workspace,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    position: static;
  }

  .flow-rail,
  .phase-list {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .top-actions {
    justify-content: start;
  }

  .shell {
    padding: 1rem 0.85rem 2.5rem;
  }

  .intro-panel h2,
  .detail-copy h2 {
    font-size: 1.45rem;
  }

  .metric-band,
  .check-list,
  .step-list,
  .attention-list,
  .limit-list {
    grid-template-columns: 1fr;
  }

  .metric:not(:nth-child(3n)) {
    border-right: 0;
  }

  .metric {
    min-height: auto;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .module-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .module-row .scope-chip {
    grid-column: 2;
    width: fit-content;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .topbar,
  .toolbar,
  .tabs,
  .top-actions {
    display: none;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .intro-panel,
  .process-band,
  .module-sidebar,
  .detail-panel,
  .method-band,
  .metric,
  .flow-step,
  .phase-item {
    break-inside: avoid;
    border-color: #ccc;
    background: #fff;
    color: #111;
  }

  .workspace,
  .executive-grid {
    grid-template-columns: 1fr;
  }
}
