:root {
  color-scheme: light;
  --ink: #192027;
  --muted: #62707f;
  --line: #d8dee5;
  --panel: #ffffff;
  --band: #f5f7f9;
  --accent: #0f766e;
  --accent-weak: #e0f2ef;
  --warn: #9a5b00;
  --danger: #a33a3a;
  --shadow: 0 1px 2px rgba(22, 30, 38, 0.08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--band);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px) 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.status-pill,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.badge[data-tone="danger"] {
  color: var(--danger);
  border-color: #efc7c7;
  background: #fff5f5;
}

.badge[data-tone="warn"] {
  color: var(--warn);
  border-color: #edd3a9;
  background: #fff8ec;
}

.badge[data-tone="ok"] {
  color: var(--accent);
  border-color: #b8ded8;
  background: var(--accent-weak);
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px clamp(16px, 4vw, 40px);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

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

.tab,
.button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.tab.is-active,
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 4vw, 32px) 40px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.panel {
  grid-column: span 12;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.half {
  grid-column: span 6;
}

.panel.third {
  grid-column: span 4;
}

.metric-row,
.item-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(0, 2fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.metric-row:first-of-type,
.item-row:first-of-type {
  border-top: 0;
}

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

.value {
  min-width: 0;
}

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

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

.item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.item p:last-child {
  margin-bottom: 0;
}

.split {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
}

.control-stack {
  display: grid;
  gap: 10px;
}

select,
textarea,
input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.artifact-frame {
  min-height: 460px;
  max-height: 72vh;
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.artifact-frame article {
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.68;
  font-size: 16px;
}

.artifact-frame .meta,
.artifact-frame .note {
  color: var(--muted);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.empty {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fff;
}

@media (max-width: 820px) {
  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .panel.half,
  .panel.third {
    grid-column: span 12;
  }

  .metric-row,
  .item-row {
    grid-template-columns: 1fr;
  }

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