:root {
  --bg: #f4f4f5;
  --surface: #ffffff;
  --ink: #18181b;
  --muted: #71717a;
  --line: #e4e4e7;
  --accent: #18181b;
  --accent-ink: #ffffff;
  --good: #0f766e;
  --bad: #be123c;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --page: #ececee;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font: 13.5px/1.45 var(--font);
}

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

a {
  color: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.card {
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 32px 28px 24px;
}

.mark {
  font-weight: 650;
  letter-spacing: 0.2em;
  font-size: 12px;
}

.card .mark {
  margin-bottom: 28px;
}

.mark-bar {
  display: block;
  width: 16px;
  height: 1px;
  background: var(--ink);
  margin: 6px 0 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 7px 12px;
  font: inherit;
  cursor: pointer;
}

.stack .btn,
.card .btn {
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.btn-bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, var(--line));
  background: transparent;
}

.hint {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.hint b {
  color: var(--ink);
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
}

.error {
  margin: 0 0 12px;
  color: var(--bad);
  font-size: 12px;
}

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  background: var(--bg);
}

.rail {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 20px 16px;
}

.tenant {
  margin: 18px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.nav a,
.nav-muted {
  display: block;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 10px;
  margin: 0 -8px 1px;
}

.nav a.on {
  color: var(--ink);
  background: var(--bg);
}

.main {
  padding: 20px 24px 32px;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.top h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.key {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
}

.key a {
  text-decoration: none;
}

.pill {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.pill.ok {
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
}

.pill.run {
  color: var(--ink);
  border-color: var(--ink);
}

.detail {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 20px;
}

.block {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 14px 16px 16px;
  margin-bottom: 10px;
}

.block h3 {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.id {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.acts {
  display: flex;
  gap: 8px;
}

.form-wide {
  max-width: 640px;
}

.form-wide label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-wide .acts {
  margin-top: 8px;
}

.form-wide .acts .btn {
  width: auto;
}

.event {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.event:last-child {
  border-bottom: 0;
}

.event b {
  color: var(--ink);
  font-weight: 550;
}

.event p {
  margin-top: 4px;
  color: var(--ink);
}

.mention-box {
  position: relative;
  margin-top: 8px;
}

.suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  z-index: 2;
}

.suggest button {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 8px 10px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.suggest button:hover {
  background: var(--bg);
}
