: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 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;
}

.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);
}

.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;
}

.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);
}

.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;
}

.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;
}

.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;
}

.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;
}

.source-browser-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.85fr) minmax(320px, 1.35fr) minmax(220px, 0.9fr);
  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 {
  border-color: var(--ck-edge);
  background: var(--surface);
}

.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);
}

.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 {
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-3);
}

.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 {
  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 {
  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;
}

.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;
}

.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;
}

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

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

.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,
  .count-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-grid,
  .report-layout,
  .operation-home,
  .document-grid,
  .source-browser-grid,
  .visual-overview,
  .ck-map-lanes,
  .login-shell {
    grid-template-columns: 1fr;
  }

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

  .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,
  .count-grid,
  .document-grid,
  .source-browser-grid,
  .lane-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;
  }

  .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,
  .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;
  }
}
