:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --text: #172026;
  --muted: #66727c;
  --line: #d9e0e4;
  --panel: #ffffff;
  --accent: #146c5f;
  --accent-dark: #0d4d45;
  --danger: #b42318;
  --ok: #16803c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

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

button {
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.actions button {
  white-space: normal;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

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

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

h1 {
  font-size: 30px;
  line-height: 1.12;
}

h2 {
  font-size: 15px;
  line-height: 1.2;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.status-dot.busy {
  background: #c47f17;
}

.status-dot.ok {
  background: var(--ok);
}

.status-dot.error {
  background: var(--danger);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.raw-panel {
  grid-column: 1 / -1;
}

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

.facts {
  display: grid;
  grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 16px 0 0;
}

.facts dt {
  color: var(--muted);
  font-size: 13px;
}

.facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.brand-draft {
  margin: 0;
  grid-template-columns: minmax(140px, 0.45fr) minmax(0, 1fr);
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.empty {
  color: var(--muted);
}

.item {
  appearance: none;
  width: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 400;
}

.item:hover {
  border-color: var(--accent);
  background: #f7fbfa;
}

.item.selected {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.item strong,
.item span {
  display: block;
  overflow-wrap: anywhere;
}

.item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.timeline {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.timeline time {
  color: var(--muted);
  font-size: 12px;
}

.timeline span {
  min-width: 0;
  overflow-wrap: anywhere;
}

pre {
  max-height: 460px;
  margin: 16px 0 0;
  overflow: auto;
  border-radius: 6px;
  background: #101820;
  color: #e7edf0;
  padding: 14px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.inline-json {
  max-height: 240px;
  margin-top: 10px;
  font-size: 12px;
}

@media (max-width: 760px) {
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .actions {
    justify-content: stretch;
  }

  .actions button {
    width: 100%;
  }

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

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

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