:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-muted: #eef2f6;
  --text: #16202a;
  --muted: #5f6f7f;
  --line: #d8e0e8;
  --blue: #0868ac;
  --blue-strong: #064f83;
  --green: #147d64;
  --red: #b42318;
  --shadow: 0 12px 30px rgb(19 35 49 / 10%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1440px, 100%);
  /*min-height: 100vh;*/
  margin: 0 auto;
  /*padding: 24px;*/
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 0 4px;
}

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

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.08;
}

h2 {
  font-size: 1rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.toolbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: stretch;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
}

.meta-grid div {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
}

.meta-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.meta-grid strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 0.98rem;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 142px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
}

.button:hover:not(:disabled) {
  border-color: var(--blue);
}

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

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

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

.button.loading {
  opacity: 0.7;
}

.workspace {
  width: 100%;
}

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

.event-panel {
  min-height: 480px;
  padding: 18px;
}

.event-panel ol {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.report-surface {
  position: relative;
  min-height: 550px;
  /*min-height: 760px;*/
  padding-bottom: 59%;
  overflow: scroll;
}

#report-container {
  position: absolute;
  min-width: 900px;
  inset: 0;
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fafc 0%, #eef5f9 100%);
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none !important;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.1rem;
}

.spinner {
  justify-self: center;
  width: 32px;
  height: 32px;
  border: 3px solid rgb(0 0 0 / 12%);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: spinner-rotate 0.8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 1.6s;
  }
}

.error-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-color: rgb(180 35 24 / 35%);
  color: var(--red);
}

.error-panel strong {
  display: block;
  margin-bottom: 8px;
}

.error-panel ul {
  margin: 0;
  padding-left: 20px;
}

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

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

  .event-panel {
    min-height: 180px;
  }
}

@media (max-width: 680px) {
  .top-bar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}

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