:root {
  color-scheme: light;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #eeeeea;
  --surface-3: #fafaf7;
  --line: #d8d8d2;
  --text: #111111;
  --muted: #686862;
  --ink: #050505;
  --inverse: #ffffff;
  --accent: #111111;
  --accent-soft: #e8e8e2;
  --green: #237252;
  --amber: #9a650f;
  --red: #9d3434;
  --ca-edge: #111111;
  --ck-edge: #2f6f9f;
  --xc-edge: #8a641f;
  --shadow: 0 1px 2px rgba(17, 17, 17, 0.08);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090909;
  --surface: #141414;
  --surface-2: #1d1d1d;
  --surface-3: #101010;
  --line: #303030;
  --text: #f2f2ee;
  --muted: #aaa9a2;
  --ink: #ffffff;
  --inverse: #050505;
  --accent: #ffffff;
  --accent-soft: #242424;
  --green: #67c29a;
  --amber: #d49b47;
  --red: #e07575;
  --ca-edge: #f2f2ee;
  --ck-edge: #78b7e6;
  --xc-edge: #d6aa55;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.console-booting .app-shell {
  display: none;
}

.session-screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}

.console-booting .session-screen {
  display: grid;
}

.session-screen-panel {
  width: min(100%, 460px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.session-screen-panel p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

button,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--ink);
  color: var(--inverse);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
}

.brand-block > div:nth-child(2) {
  min-width: 0;
}

.mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
}

.eyebrow,
.label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar .eyebrow,
.sidebar .label {
  color: color-mix(in srgb, var(--inverse) 62%, transparent);
}

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

h1 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.1;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
  line-height: 1.3;
}

.module-nav {
  display: grid;
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 6px;
}

.nav-section-title {
  margin: 0 0 2px;
  color: color-mix(in srgb, var(--inverse) 48%, transparent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  min-height: 38px;
  gap: 10px;
  padding: 8px 10px;
  color: color-mix(in srgb, var(--inverse) 82%, transparent);
  text-decoration: none;
  border-radius: 8px;
}

.nav-item:hover,
.nav-item.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--inverse);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 0 var(--ck-edge);
}

.nav-item svg,
.icon-button svg,
.action-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.nav-count {
  min-width: 28px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: color-mix(in srgb, var(--inverse) 82%, transparent);
  text-align: center;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.sidebar-menu-button {
  display: none;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--inverse);
  font-size: 13px;
  font-weight: 800;
}

.sidebar-menu-button svg {
  width: 17px;
  height: 17px;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  color: color-mix(in srgb, var(--inverse) 82%, transparent);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  margin-bottom: 16px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-button,
.action-button,
.mode-button {
  display: inline-grid;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.action-button {
  grid-auto-flow: column;
  gap: 8px;
  width: auto;
  min-width: 82px;
  padding: 0 11px;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.action-button .button-label {
  white-space: nowrap;
}

.danger-action {
  min-width: 92px;
}

.mode-button {
  grid-auto-flow: column;
  gap: 7px;
  width: auto;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.mode-button svg {
  width: 17px;
  height: 17px;
}

.icon-button {
  width: 40px;
}

.icon-button:hover,
.action-button:hover,
.mode-button:hover {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ck-edge) 14%, transparent), var(--shadow);
}

.icon-button:active,
.action-button:active,
.action-button[data-pressed="true"],
.mode-button:active {
  transform: translateY(1px);
  background: var(--accent-soft);
}

.action-button:focus-visible,
.mode-button:focus-visible,
.icon-button:focus-visible {
  outline: 2px solid var(--ck-edge);
  outline-offset: 2px;
}

.action-button:disabled,
.mode-button:disabled,
.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.action-button[data-loading="true"] {
  border-color: var(--ck-edge);
  background: color-mix(in srgb, var(--ck-edge) 12%, var(--surface));
  color: var(--text);
}

.action-button[data-loading="true"] svg {
  animation: spin 820ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dashboard-layer {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.dashboard-layer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 2px 2px 0;
}

.dashboard-layer-head h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.1;
}

.library-intake-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.library-intake-panel h3 {
  max-width: 760px;
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.12;
}

.library-intake-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dashboard-foundation {
  margin-bottom: 16px;
}

.visual-overview {
  display: grid;
  grid-template-columns: minmax(260px, 0.62fr) minmax(360px, 1.38fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ck-map-overview {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.ck-map-copy h3 {
  max-width: 760px;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.08;
}

.ck-map-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ck-map-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.ck-map-card:hover,
.ck-map-card:focus-visible,
.ck-map-card.is-selected {
  border-color: var(--ink);
  background: var(--surface);
  outline: none;
}

.ck-map-card.is-selected {
  box-shadow: inset 0 0 0 2px var(--ink);
}

.ck-map-icon {
  display: grid;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.ck-map-card h4 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.ck-map-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.ck-map-item {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.ck-map-item strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}

.ck-map-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.ck-map-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ck-map-detail h4 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.ck-map-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ck-map-detail-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.route-detail-item a {
  color: var(--text);
  text-decoration: none;
}

.route-detail-item a:hover {
  text-decoration: underline;
}

.visual-copy h3 {
  max-width: 520px;
}

.system-diagram {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.diagram-node {
  --node-accent: var(--ca-edge);
  position: relative;
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 10px;
  padding: 10px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--node-accent) 28%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--node-accent) 9%, transparent), transparent),
    var(--surface-3);
}

.diagram-node::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--node-accent);
}

.node-ca {
  --node-accent: var(--ca-edge);
}

.node-ck {
  --node-accent: var(--ck-edge);
}

.node-xc {
  --node-accent: var(--xc-edge);
}

.diagram-symbol {
  display: grid;
  width: 36px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--inverse);
  font-size: 13px;
  font-weight: 850;
}

.diagram-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--node-accent) 32%, var(--line));
  border-radius: 8px;
  color: var(--node-accent);
  background: color-mix(in srgb, var(--node-accent) 9%, var(--surface));
}

.diagram-icon svg {
  width: 17px;
  height: 17px;
}

.diagram-node small {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  text-align: left;
}

.diagram-line {
  display: none;
}

.operation-home {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.dashboard-command-panel {
  min-height: 236px;
}

.dashboard-priority-list,
.dashboard-action-list {
  display: grid;
  gap: 8px;
}

.dashboard-priority-item,
.dashboard-action-item {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}

.dashboard-priority-item:hover,
.dashboard-priority-item:focus-visible,
.dashboard-action-item:hover,
.dashboard-action-item:focus-visible {
  border-color: var(--ink);
  background: var(--surface);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--ink);
}

.dashboard-priority-item:active,
.dashboard-priority-item[data-pressed="true"],
.dashboard-action-item:active,
.dashboard-action-item[data-pressed="true"] {
  transform: translateY(1px);
}

.dashboard-priority-item {
  display: grid;
  gap: 5px;
}

.dashboard-priority-item.is-review {
  border-color: color-mix(in srgb, var(--amber) 36%, var(--line));
}

.dashboard-priority-item.is-active {
  border-color: color-mix(in srgb, var(--ck-edge) 42%, var(--line));
}

.dashboard-priority-title,
.dashboard-priority-meta {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.dashboard-priority-title {
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.dashboard-priority-meta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.dashboard-action-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.dashboard-action-item svg {
  width: 18px;
  height: 18px;
}

.dashboard-action-item > span:first-child {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ck-edge);
}

.dashboard-action-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dashboard-action-copy strong,
.dashboard-action-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-action-copy strong {
  font-size: 13px;
  line-height: 1.2;
}

.dashboard-action-copy small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status-item,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.status-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  min-height: 76px;
  padding: 14px;
}

.status-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--accent);
}

.status-value {
  margin: 2px 0 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.panel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-wide {
  grid-column: span 1;
}

.operating-health-panel .metric-grid {
  margin-bottom: 14px;
}

.signal-section {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.signal-section > .eyebrow {
  margin-bottom: 8px;
}

.panel-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.handoff-surface-panel {
  margin: 14px 0;
}

.handoff-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.handoff-subpanel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.handoff-subpanel > .label {
  margin-bottom: 8px;
}

#handoffData {
  max-height: 260px;
  margin-top: 12px;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin: 12px 0 8px;
}

.panel-subhead .eyebrow {
  margin: 0;
}

.email-runtime-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.runtime-cell {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.runtime-cell strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.runtime-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.entry-panel,
.lane-panel {
  min-height: 238px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  margin-bottom: 14px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  max-width: 180px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-3);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.session-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  max-width: 220px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.state-ok {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 34%, transparent);
  background: color-mix(in srgb, var(--green) 12%, var(--surface));
}

.state-warn {
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 34%, transparent);
  background: color-mix(in srgb, var(--amber) 12%, var(--surface));
}

.state-bad {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 34%, transparent);
  background: color-mix(in srgb, var(--red) 12%, var(--surface));
}

.metric-grid,
.count-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.count-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-grid-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.metric,
.count-cell {
  min-height: 78px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.metric strong,
.count-cell strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.document-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  min-height: 140px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.document-icon {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.document-icon svg {
  width: 19px;
  height: 19px;
  margin-bottom: 4px;
  color: var(--ck-edge);
}

.document-icon strong {
  font-size: 11px;
  line-height: 1;
}

.document-card p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.technical-library-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.technical-library-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.technical-library-group {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.technical-library-list {
  display: grid;
  gap: 8px;
}

.technical-library-item {
  display: grid;
  width: 100%;
  min-height: 48px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.technical-library-item:hover,
.technical-library-item.is-selected {
  border-color: var(--ck-edge);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--ck-edge);
}

.technical-library-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.technical-library-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.source-browser-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.82fr) minmax(340px, 1.42fr) minmax(220px, 0.82fr);
  gap: 12px;
  margin-top: 14px;
  min-width: 0;
}

.source-browser-column {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.source-browser-column h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}

.source-package-list,
.file-list,
.document-index-list {
  display: grid;
  gap: 8px;
}

.package-row {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.package-row:hover,
.package-row.is-selected,
.file-row:hover,
.file-row.is-selected {
  border-color: var(--ck-edge);
  background: var(--surface);
}

.file-row {
  width: 100%;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.package-title,
.package-meta,
.file-path,
.file-meta,
.document-index-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.package-title,
.file-path,
.document-index-title {
  font-weight: 700;
}

.package-meta,
.file-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.file-row,
.document-index-item {
  display: grid;
  gap: 6px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.file-row.is-selected {
  box-shadow: inset 0 0 0 1px var(--ck-edge);
}

.source-file-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.source-file-preview pre {
  min-height: 260px;
  max-height: 520px;
}

.document-index-item {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
}

.document-index-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 12px;
  margin-top: 14px;
}

pre {
  width: 100%;
  min-height: 190px;
  max-height: 300px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ink);
  color: var(--inverse);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.stack-list,
.step-list,
.route-list {
  display: grid;
  gap: 8px;
}

.list-item,
.step-item,
.route-item,
.task-row,
.approval-row,
.resource-plane-row,
.storage-bucket-row,
.component-asset-row,
.email-sender-row,
.ai-model-row,
.visual-asset-row,
.roadmap-row,
.surface-row,
.route-row,
.x-factory-resource-row,
.x-creation-gate-row {
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.task-row,
.approval-row,
.resource-plane-row,
.storage-bucket-row,
.component-asset-row,
.email-sender-row,
.ai-model-row,
.visual-asset-row,
.roadmap-row,
.surface-row,
.route-row,
.x-factory-resource-row,
.x-creation-gate-row {
  display: grid;
  width: 100%;
  gap: 4px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.task-row:hover,
.task-row.is-selected,
.approval-row:hover,
.approval-row.is-selected,
.resource-plane-row:hover,
.resource-plane-row.is-selected,
.storage-bucket-row:hover,
.storage-bucket-row.is-selected,
.component-asset-row:hover,
.component-asset-row.is-selected,
.email-sender-row:hover,
.email-sender-row.is-selected,
.ai-model-row:hover,
.ai-model-row.is-selected,
.visual-asset-row:hover,
.visual-asset-row.is-selected,
.roadmap-row:hover,
.roadmap-row.is-selected,
.surface-row:hover,
.surface-row.is-selected,
.route-row:hover,
.route-row.is-selected,
.x-factory-resource-row:hover,
.x-factory-resource-row.is-selected,
.x-creation-gate-row:hover,
.x-creation-gate-row.is-selected {
  border-color: var(--ck-edge);
  background: var(--surface);
}

.task-row.is-selected,
.resource-plane-row.is-selected,
.approval-row.is-selected,
.storage-bucket-row.is-selected,
.component-asset-row.is-selected,
.email-sender-row.is-selected,
.ai-model-row.is-selected,
.visual-asset-row.is-selected,
.roadmap-row.is-selected,
.surface-row.is-selected,
.route-row.is-selected,
.x-factory-resource-row.is-selected,
.x-creation-gate-row.is-selected {
  box-shadow: inset 0 0 0 1px var(--ck-edge);
}

.step-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.step-item svg {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.list-title,
.route-item a,
.step-title,
.task-title,
.approval-title,
.resource-plane-title,
.storage-bucket-title,
.component-asset-title,
.email-sender-title,
.ai-model-title,
.visual-asset-title,
.roadmap-title,
.surface-title,
.route-title,
.x-factory-resource-title,
.x-creation-gate-title {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-decoration: none;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.list-meta,
.step-meta,
.route-meta,
.task-meta,
.task-id,
.approval-meta,
.approval-id,
.resource-plane-meta,
.resource-plane-id,
.storage-bucket-meta,
.storage-bucket-id,
.component-asset-meta,
.component-asset-id,
.email-sender-meta,
.email-sender-id,
.ai-model-meta,
.ai-model-id,
.visual-asset-meta,
.visual-asset-id,
.roadmap-meta,
.roadmap-id,
.surface-meta,
.surface-id,
.route-meta,
.route-id,
.x-factory-resource-meta,
.x-factory-resource-id,
.x-creation-gate-meta,
.x-creation-gate-id {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.task-id,
.approval-id,
.resource-plane-id,
.storage-bucket-id,
.component-asset-id,
.email-sender-id,
.ai-model-id,
.visual-asset-id,
.roadmap-id,
.surface-id,
.route-id,
.x-factory-resource-id,
.x-creation-gate-id {
  font-size: 11px;
  -webkit-line-clamp: 1;
}

.work-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.work-intake-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.work-intake-panel h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.work-intake-panel p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.work-intake-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
  max-width: 280px;
}

.work-intake-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, transform 120ms ease, box-shadow 140ms ease;
}

.work-intake-button:hover,
.work-intake-button:focus-visible {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ck-edge) 14%, transparent);
}

.work-intake-button:active,
.work-intake-button[data-pressed="true"] {
  transform: translateY(1px);
  background: var(--accent-soft);
}

.work-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.work-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.work-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#workDetailData {
  min-height: 180px;
  max-height: 360px;
}

#workClosureList {
  padding-top: 2px;
}

#workClosureList .list-item {
  background: var(--surface-3);
}

.approval-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.approval-bridge-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.approval-bridge-panel h4 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.approval-bridge-panel p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.approval-bridge-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--text);
  color: var(--surface);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.approval-bridge-button:hover,
.approval-bridge-button:focus-visible {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.identity-readiness-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-readiness-panel h4 {
  margin: 2px 0 4px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.identity-readiness-panel p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.identity-subpanel {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-1);
}

.identity-write-gate-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-ledger-contract-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-migration-plan-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-dry-run-package-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-admin-form-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-runtime-wiring-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-route-harness-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-runtime-patch-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-worker-dry-run-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-production-wiring-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.identity-admin-form-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.88fr) minmax(280px, 1.12fr);
  gap: 12px;
}

.identity-admin-form {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-1);
}

.identity-admin-field {
  display: grid;
  gap: 6px;
}

.identity-admin-field span,
.identity-admin-approval span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.identity-admin-field input,
.identity-admin-field select {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.identity-admin-field input:hover,
.identity-admin-field select:hover {
  border-color: var(--ink);
}

.identity-admin-field input:focus-visible,
.identity-admin-field select:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  background: var(--surface-1);
}

.identity-admin-approval {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.identity-admin-approval input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ink);
}

.identity-admin-preview-stack {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.identity-write-gate-panel .list-item {
  background: var(--surface-3);
}

.identity-ledger-contract-panel .list-item {
  background: var(--surface-3);
}

.identity-migration-plan-panel .list-item {
  background: var(--surface-3);
}

.identity-dry-run-package-panel .list-item {
  background: var(--surface-3);
}

.identity-admin-form-panel .list-item {
  background: var(--surface-3);
}

.identity-runtime-wiring-panel .list-item {
  background: var(--surface-3);
}

.identity-route-harness-panel .list-item {
  background: var(--surface-3);
}

.identity-runtime-patch-panel .list-item {
  background: var(--surface-3);
}

.identity-worker-dry-run-panel .list-item {
  background: var(--surface-3);
}

.identity-production-wiring-panel .list-item {
  background: var(--surface-3);
}

.approval-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.approval-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.approval-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#approvalDetailData {
  min-height: 180px;
  max-height: 360px;
}

.resource-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.resource-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.resource-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.resource-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#resourceDetailData {
  min-height: 200px;
  max-height: 420px;
}

.storage-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.storage-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.storage-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.storage-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#storageDetailData {
  min-height: 200px;
  max-height: 420px;
}

.component-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.component-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.component-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.component-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#componentDetailData {
  min-height: 200px;
  max-height: 420px;
}

.email-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.email-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.email-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.email-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#emailDetailData {
  min-height: 200px;
  max-height: 420px;
}

.ai-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.ai-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.ai-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.ai-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#aiDetailData {
  min-height: 200px;
  max-height: 420px;
}

.visual-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.visual-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.visual-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.visual-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#visualDetailData {
  min-height: 200px;
  max-height: 420px;
}

.panel-subhead-spaced {
  margin-top: 14px;
}

.roadmap-detail-panel,
.surface-detail-panel,
.route-detail-panel,
.x-factory-detail-panel,
.x-creation-gate-detail-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.roadmap-detail-grid,
.surface-detail-grid,
.route-detail-grid,
.x-factory-detail-grid,
.x-creation-gate-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.roadmap-detail-cell,
.surface-detail-cell,
.route-detail-cell,
.x-factory-detail-cell,
.x-creation-gate-detail-cell {
  min-width: 0;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.roadmap-detail-cell strong,
.surface-detail-cell strong,
.route-detail-cell strong,
.x-factory-detail-cell strong,
.x-creation-gate-detail-cell strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#roadmapDetailData,
#surfaceDetailData,
#routeDetailData,
#xFactoryPackageDetailData,
#xFactoryResourceDetailData,
#xCreationGateDetailData {
  min-height: 200px;
  max-height: 420px;
}

.empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface-3);
}

.entry-task {
  display: grid;
  gap: 12px;
}

.entry-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.2;
}

.entry-meta-grid {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}

.entry-meta-grid span {
  min-height: 30px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.entry-meta-grid span:last-child {
  grid-column: 1 / -1;
}

.entry-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.lane-card {
  display: grid;
  gap: 12px;
  min-height: 164px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.lane-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.lane-card-head strong {
  display: inline-grid;
  min-width: 42px;
  min-height: 34px;
  width: auto;
  padding: 0 9px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: var(--inverse);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.lane-card-head span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: right;
}

.lane-metrics {
  display: grid;
  gap: 6px;
}

.lane-metrics span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.lane-metrics b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.lane-next {
  margin: auto 0 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.compact-list {
  max-height: 340px;
  overflow: auto;
  padding-right: 2px;
}

.access-shell {
  display: grid;
  grid-template-columns: minmax(420px, 48vw) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

.session-screen.access-shell {
  padding: 0;
  place-items: stretch;
}

.identity-plane {
  display: flex;
  min-height: 100vh;
  align-items: center;
  padding: clamp(42px, 7vw, 92px);
  background: var(--ink);
  color: var(--inverse);
}

.os-identity-plane {
  background: #050505;
}

.identity-content {
  width: min(100%, 620px);
}

.identity-kicker {
  margin: 0 0 16px;
  color: color-mix(in srgb, var(--inverse) 66%, transparent);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.identity-plane h1 {
  margin: 0;
  color: var(--inverse);
  font-size: clamp(48px, 6vw, 86px);
  letter-spacing: 0;
  line-height: 0.94;
}

.identity-plane p:not(.identity-kicker) {
  max-width: 470px;
  margin: 24px 0 0;
  color: color-mix(in srgb, var(--inverse) 74%, transparent);
  font-size: 18px;
  line-height: 1.6;
}

.auth-plane {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 42px;
}

.access-panel {
  width: min(100%, 430px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 52px rgba(17, 17, 17, 0.08);
}

.access-header {
  display: grid;
  gap: 8px;
  margin-bottom: 20px;
}

.access-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.access-header h1,
.access-header h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.08;
}

.access-copy {
  margin-bottom: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.access-copy p {
  margin: 0;
}

.access-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
}

.access-step {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.access-step.is-active,
.access-step.is-done {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--inverse);
}

.status-surface {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.status-surface p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.login-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 0.95fr) minmax(420px, 1.05fr);
  background: var(--bg);
}

.login-shell-auth {
  align-items: stretch;
  padding: 0;
}

.login-panel-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(28px, 5vw, 72px);
}

.login-panel {
  width: min(100%, 460px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-product-title {
  margin-bottom: 22px;
}

.login-product-title h1 {
  max-width: 360px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.08;
}

.login-brand-panel {
  display: flex;
  min-height: 100vh;
  align-items: center;
  padding: clamp(36px, 6vw, 88px);
  background: var(--ink);
  color: var(--inverse);
}

.login-brand-content {
  width: min(100%, 560px);
}

.login-brand-panel .eyebrow {
  color: color-mix(in srgb, var(--inverse) 62%, transparent);
}

.login-brand-panel h1 {
  max-width: 560px;
  margin: 10px 0 0;
  color: var(--inverse);
  font-size: clamp(42px, 5vw, 76px);
  letter-spacing: 0;
  line-height: 0.96;
}

.login-brand-panel p:last-child {
  max-width: 420px;
  margin: 22px 0 0;
  color: color-mix(in srgb, var(--inverse) 72%, transparent);
  font-size: 16px;
  line-height: 1.55;
}

.login-panel h2 {
  margin-bottom: 8px;
}

.login-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
  margin: 18px 0 14px;
}

.field label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
}

.x-factory-form {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.x-factory-form .field {
  margin: 0;
}

.primary-button,
.primary-link,
.secondary-link,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--inverse);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 120ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-link {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--inverse);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.primary-button:hover:not(:disabled) {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

.primary-button:active:not(:disabled),
.primary-button[data-pressed="true"] {
  transform: translateY(1px);
}

.primary-button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.primary-button[data-loading="true"] {
  box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--inverse) 30%, transparent);
}

.secondary-link {
  margin-top: 10px;
  border: 1px solid var(--line);
  color: var(--text);
}

.secondary-button {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.login-action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.message-ok {
  color: var(--green);
}

.message-pending {
  color: var(--amber);
}

.message-bad {
  color: var(--red);
}

.login-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 14px;
  }

  .module-nav {
    grid-template-columns: 1fr;
  }

  .nav-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-section-title {
    grid-column: 1 / -1;
  }

  .status-strip,
  .metric-grid,
  .handoff-grid,
  .count-grid,
  .approval-detail-grid,
  .resource-detail-grid,
  .storage-detail-grid,
  .component-detail-grid,
  .email-detail-grid,
  .ai-detail-grid,
  .visual-detail-grid,
  .roadmap-detail-grid,
  .surface-detail-grid,
  .route-detail-grid,
  .x-factory-detail-grid,
  .x-creation-gate-detail-grid,
  .work-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid,
  .report-layout,
  .operation-home,
  .dashboard-command-center,
  .document-grid,
  .technical-library-grid,
  .source-browser-grid,
  .visual-overview,
  .ck-map-detail-grid,
  .ck-map-lanes,
  .access-shell,
  .login-shell {
    grid-template-columns: 1fr;
  }

  .identity-plane {
    min-height: 34vh;
    padding: 32px;
  }

  .identity-plane h1 {
    font-size: 44px;
  }

  .identity-plane p:not(.identity-kicker) {
    font-size: 16px;
  }

  .auth-plane {
    min-height: auto;
    place-items: start center;
    padding: 26px 18px 36px;
  }

  .login-panel-wrap {
    min-height: auto;
  }

  .library-intake-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .library-intake-actions {
    justify-content: flex-start;
  }

  .work-intake-panel {
    grid-template-columns: 1fr;
  }

  .work-intake-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .approval-bridge-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .identity-readiness-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .identity-grid,
  .identity-admin-form-grid {
    grid-template-columns: 1fr;
  }

  .login-shell-auth {
    background: var(--bg);
  }

  .login-shell-auth .login-panel-wrap {
    order: 2;
    min-height: auto;
    justify-content: center;
    padding: 22px;
  }

  .login-shell-auth .login-panel {
    width: min(100%, 460px);
    margin: 0 auto;
  }

  .login-brand-panel {
    order: 1;
    min-height: 42svh;
    padding: 34px 22px 40px;
  }

  .login-brand-panel h1 {
    font-size: clamp(34px, 8vw, 54px);
  }

}

@media (max-width: 620px) {
  .sidebar {
    position: sticky;
    z-index: 20;
    top: 0;
    padding: 12px 14px;
  }

  .brand-block {
    min-height: 46px;
  }

  .brand-block h1 {
    font-size: 18px;
    line-height: 1.1;
  }

  .mark {
    width: 40px;
    height: 40px;
  }

  .sidebar-menu-button {
    display: inline-flex;
  }

  .sidebar:not(.is-menu-open) .module-nav,
  .sidebar:not(.is-menu-open) .sidebar-foot {
    display: none;
  }

  .sidebar.is-menu-open .module-nav {
    display: grid;
    max-height: calc(100vh - 88px);
    overflow: auto;
    padding-right: 2px;
  }

  .nav-section {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  h2 {
    font-size: 20px;
  }

  .status-strip,
  .module-nav,
  .metric-grid,
  .handoff-grid,
  .count-grid,
  .document-grid,
  .technical-library-grid,
  .source-browser-grid,
  .lane-grid,
  .approval-detail-grid,
  .resource-detail-grid,
  .storage-detail-grid,
  .component-detail-grid,
  .email-detail-grid,
  .ai-detail-grid,
  .visual-detail-grid,
  .roadmap-detail-grid,
  .surface-detail-grid,
  .route-detail-grid,
  .x-factory-detail-grid,
  .x-creation-gate-detail-grid,
  .work-detail-grid,
  .system-diagram,
  .entry-meta-grid {
    grid-template-columns: 1fr;
  }

  .diagram-line {
    width: 1px;
    height: 22px;
    justify-self: center;
  }

  .login-action-row {
    grid-template-columns: 1fr;
  }

  .access-steps {
    grid-template-columns: 1fr;
  }

  .access-step {
    justify-items: start;
    padding: 0 12px;
  }

  .access-header h1,
  .access-header h2 {
    font-size: 26px;
  }

  .email-runtime-grid {
    grid-template-columns: 1fr;
  }

  .login-panel-wrap {
    justify-content: flex-start;
    padding: 18px;
  }

  .login-panel {
    padding: 20px;
  }

  .field {
    margin: 14px 0 12px;
  }

  .login-note {
    margin-top: 12px;
    line-height: 1.55;
  }
}

@media (max-width: 700px) {
  .login-shell-auth .login-panel-wrap {
    min-height: auto;
    padding: 18px;
  }

}

@media (max-height: 620px) and (max-width: 700px) {
  .login-shell {
    min-height: 100vh;
  }

  .login-panel-wrap {
    justify-content: flex-start;
    padding: 16px 22px;
  }

  .login-panel {
    padding: 16px;
  }

  .login-shell-auth .login-panel-wrap {
    min-height: auto;
    padding: 14px;
  }

  .login-shell-auth .login-panel-head {
    align-items: center;
  }

  .login-shell-auth .login-note {
    line-height: 1.45;
  }
}

@media (max-width: 700px) {
  .ck-map-lanes,
  .ck-map-detail-grid,
  .source-browser-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .source-browser-column,
  .source-package-list,
  .package-row,
  .package-title,
  .package-meta {
    max-width: 100%;
    min-width: 0;
  }
}
