:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #16202a;
  background: #eef2f6;
  --panel: #ffffff;
  --panel-soft: #f7f9fb;
  --line: #cbd5df;
  --line-strong: #9aa8b6;
  --ink-soft: #536273;
  --primary: #0f6f5f;
  --primary-strong: #0a594d;
  --blue: #2454a6;
  --amber: #9a5b13;
  --amber-bg: #fff4df;
  --ok: #116044;
  --ok-bg: #e1f6ed;
  --danger: #a63333;
  --danger-bg: #feeaea;
  --neutral-bg: #e8edf2;
  --shadow: 0 12px 30px rgb(20 30 42 / 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
a,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

.auth-shell,
.ops-shell {
  background: #f6f8fb;
}

.auth-shell {
  display: grid;
  min-height: 100svh;
}

.auth-shell-panel-wrap {
  align-self: center;
  display: grid;
  padding: 24px;
  place-items: center;
}

.status-row,
.auth-actions,
.incident-card-top,
.incident-card-meta,
.tabs,
.ai-drawer-top {
  align-items: center;
  display: flex;
  gap: 8px;
}

.ops-shell {
  display: grid;
  gap: 14px;
  min-height: 100vh;
  padding: 16px;
  padding-bottom: 98px;
}

.ops-header {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1480px;
  width: 100%;
}

.ops-title h1,
.incident-heading h2,
.empty-state h2,
.auth-panel h2 {
  font-size: 30px;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0;
}

.eyebrow {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.brand-mark {
  align-items: center;
  background: var(--blue);
  border-radius: 8px;
  color: #ffffff;
  display: inline-flex;
  font-size: 20px;
  font-weight: 900;
  height: 40px;
  justify-content: center;
  width: 40px;
}

.brand-mark-small {
  font-size: 16px;
  height: 32px;
  width: 32px;
}

.auth-panel,
.incident-rail,
.center-panel,
.attention-rail,
.ai-drawer {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-panel {
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
  display: grid;
  gap: 14px;
  padding: 24px;
  width: min(100%, 440px);
}

.ops-cockpit {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) minmax(260px, 320px);
  margin: 0 auto;
  max-width: 1480px;
  min-height: 680px;
  width: 100%;
}

.incident-rail,
.center-panel,
.attention-rail {
  min-width: 0;
  padding: 14px;
}

.incident-rail,
.attention-rail {
  align-self: start;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.center-panel {
  display: grid;
  gap: 14px;
  min-height: 680px;
}

.section-header,
.incident-heading {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.section-header h2 {
  font-size: 18px;
  margin: 0;
}

.pill {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  min-height: 28px;
  padding: 5px 9px;
  text-transform: capitalize;
  white-space: nowrap;
}

.pill.ok {
  background: var(--ok-bg);
  border-color: #8bc9ad;
  color: var(--ok);
}

.pill.warn {
  background: var(--amber-bg);
  border-color: #e0bb83;
  color: var(--amber);
}

.pill.danger,
.pill.critical {
  background: var(--danger-bg);
  border-color: #e4a1a1;
  color: var(--danger);
}

.pill.neutral {
  background: var(--neutral-bg);
  color: #344251;
}

.incident-card,
.event-row,
.attention-item,
.metric,
.tool-chip {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.auth-panel h1 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.auth-status-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-error {
  background: var(--amber-bg);
  border: 1px solid #e0bb83;
  border-radius: 8px;
  color: var(--amber);
  margin: 0;
  padding: 12px 14px;
}

.incident-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.incident-card.selected {
  border-color: #7fb9ad;
  box-shadow: inset 3px 0 0 var(--primary);
}

.incident-card h2 {
  font-size: 18px;
  line-height: 1.2;
  margin: 0;
}

.incident-card-copy,
.event-row p,
.attention-item p,
.muted-copy,
.muted {
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
  overflow-wrap: anywhere;
}

.incident-card-meta {
  color: var(--ink-soft);
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
  text-transform: capitalize;
}

.compact-form,
.resolve-form {
  display: grid;
  gap: 10px;
}

.preview-fixture-banner {
  align-items: center;
  background: #edf7f6;
  border: 1px solid #8ccbc2;
  border-radius: 8px;
  color: #123f39;
  display: flex;
  gap: 12px;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding: 12px 14px;
}

.preview-fixture-banner strong {
  display: block;
  font-size: 14px;
}

.preview-fixture-banner p {
  color: #315b55;
  margin: 4px 0 0;
}

.lookup-form,
.resolve-form {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.field {
  display: grid;
  gap: 5px;
}

.field span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

input,
select,
textarea {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #172029;
  min-height: 38px;
  padding: 8px 10px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(15 111 95 / 0.16);
  outline: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.tab,
.ai-launcher {
  align-items: center;
  border-radius: 6px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
}

.primary-button {
  background: var(--primary);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.auth-primary-button {
  background: #f2a51a;
  color: #172029;
}

.secondary-button {
  background: #dfe8ee;
  color: #172029;
}

.ghost-button,
.tab {
  background: #ffffff;
  border: 1px solid var(--line);
  color: #172029;
}

.tab.active {
  background: #e1f6ed;
  border-color: #8bc9ad;
  color: var(--ok);
}

.tabs {
  flex-wrap: wrap;
}

.tab-panel {
  display: grid;
  gap: 14px;
}

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

.metric {
  padding: 12px;
}

.metric dt {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.metric dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.list-section {
  display: grid;
  gap: 10px;
}

.list-section h3 {
  font-size: 16px;
  margin: 0;
}

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

.event-row {
  padding: 10px;
}

.event-row strong,
.attention-item strong,
.tool-chip strong {
  display: block;
  font-size: 13px;
  text-transform: capitalize;
}

.attention-item {
  display: grid;
  gap: 6px;
  padding: 10px;
}

.attention-item.critical {
  border-color: #e4a1a1;
  box-shadow: inset 3px 0 0 var(--danger);
}

.attention-item.warning {
  border-color: #e0bb83;
  box-shadow: inset 3px 0 0 #d8931c;
}

.attention-due {
  color: #344251;
  font-size: 12px;
  font-weight: 900;
}

.tool-dock {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  bottom: 16px;
  box-shadow: 0 8px 22px rgb(20 30 42 / 0.12);
  display: grid;
  gap: 8px;
  grid-auto-flow: column;
  grid-auto-columns: minmax(140px, 1fr);
  left: 16px;
  max-width: calc(100vw - 110px);
  overflow-x: auto;
  padding: 10px;
  position: fixed;
  right: 86px;
  z-index: 5;
}

.tool-dock-title {
  align-self: center;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.tool-chip {
  display: grid;
  gap: 4px;
  min-width: 140px;
  padding: 8px 10px;
}

.tool-chip span {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.tool-chip.involved {
  border-color: #7fb9ad;
  box-shadow: inset 3px 0 0 var(--primary);
}

.tool-chip.blocked {
  border-color: #e4a1a1;
  box-shadow: inset 3px 0 0 var(--danger);
}

.ai-launcher {
  background: var(--blue);
  border-radius: 999px;
  bottom: 20px;
  box-shadow: var(--shadow);
  color: #ffffff;
  height: 54px;
  position: fixed;
  right: 20px;
  width: 54px;
  z-index: 7;
}

.ai-drawer {
  bottom: 88px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-height: min(560px, calc(100vh - 120px));
  overflow: auto;
  padding: 16px;
  position: fixed;
  right: 20px;
  width: min(420px, calc(100vw - 32px));
  z-index: 6;
}

.ai-drawer-top {
  justify-content: space-between;
}

.ai-drawer h2 {
  font-size: 20px;
  margin: 0;
}

.message-stack {
  display: grid;
  gap: 8px;
}

.message,
.auth-error {
  border-radius: 6px;
  font-weight: 800;
  margin: 0;
  padding: 10px 12px;
}

.message.error,
.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
}

.message.notice {
  background: var(--ok-bg);
  color: var(--ok);
}

.empty-state {
  align-content: center;
  display: grid;
  min-height: 500px;
}

@media (max-width: 1100px) {
  .ops-cockpit {
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  }

  .attention-rail {
    grid-column: 1 / -1;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .ops-shell {
    padding: 12px;
    padding-bottom: 140px;
  }

  .ops-header,
  .section-header,
  .incident-heading {
    align-items: flex-start;
    display: grid;
  }

  .ops-cockpit,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .preview-fixture-banner {
    align-items: flex-start;
    display: grid;
  }

  .incident-rail,
  .attention-rail {
    max-height: none;
  }

  .tool-dock {
    grid-auto-columns: minmax(130px, 1fr);
    left: 10px;
    max-width: calc(100vw - 20px);
    right: 10px;
  }

  .ai-launcher {
    bottom: 104px;
  }

  .ai-drawer {
    bottom: 166px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}
