:root {
  color-scheme: light;
  --ink: #15202b;
  --muted: #5d6978;
  --line: #d7dde6;
  --surface: #ffffff;
  --page: #f4f7fb;
  --blue: #2454d6;
  --green: #0f8b57;
  --amber: #aa6a00;
  --red: #c0392b;
  --cyan: #187487;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: #fbfcff;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  letter-spacing: 0;
}

.status-strip,
.metric-row,
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
}

.status-pill.good {
  border-color: #bfe3d1;
  color: var(--green);
}

.status-pill.warn {
  border-color: #f1d399;
  color: var(--amber);
}

.status-pill.bad {
  border-color: #edb5ae;
  color: var(--red);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 350px) 1fr;
  gap: 18px;
  padding: 18px;
}

.control-panel,
.incident-map,
.answer-panel,
.timeline-panel,
.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

select {
  height: 42px;
  padding: 0 10px;
}

textarea {
  min-height: 128px;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
}

.toggles {
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 600;
}

button {
  min-height: 40px;
  border: 1px solid #183ca0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

button.secondary {
  background: #fff;
  color: var(--blue);
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.metric {
  padding: 14px;
}

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

.metric strong {
  font-size: 24px;
  letter-spacing: 0;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.incident-map,
.answer-panel,
.timeline-panel {
  padding: 16px;
  min-width: 0;
}

.incident-map span,
.timeline-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

canvas {
  display: block;
  width: 100%;
  aspect-ratio: 2.4 / 1;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.answer-panel p {
  margin: 14px 0;
  color: #24313f;
  line-height: 1.55;
}

.user-note {
  padding: 12px;
  border-radius: 8px;
  background: #edf7f2;
  color: #0e6440;
  line-height: 1.4;
  font-weight: 700;
}

ol {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

li time {
  color: var(--cyan);
  font-weight: 800;
}

li p {
  margin-bottom: 0;
  line-height: 1.45;
}

@media (max-width: 1280px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 1fr;
  }

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

  .control-panel {
    position: static;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 18px;
  }

  .workspace {
    padding: 12px;
  }

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

  button {
    width: 100%;
  }

  li {
    grid-template-columns: 1fr;
  }
}
