:root {
  color: #17202a;
  background: #f5f7f8;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid #b8c3c9;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  cursor: pointer;
  padding: 7px 12px;
}

button:hover {
  border-color: #536b78;
}

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

input,
textarea {
  width: 100%;
  border: 1px solid #b8c3c9;
  border-radius: 6px;
  background: #ffffff;
  color: #17202a;
  padding: 8px 10px;
}

textarea {
  grid-column: 1 / -1;
  resize: vertical;
}

label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: #40505a;
  font-size: 0.82rem;
}

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

h1 {
  font-size: 1.35rem;
}

h2 {
  font-size: 1.15rem;
}

h3 {
  color: #40505a;
  font-size: 0.9rem;
  margin-bottom: 10px;
}

pre {
  max-width: 100%;
  overflow: auto;
  margin: 0;
  border: 1px solid #d5dde1;
  border-radius: 6px;
  background: #fbfcfd;
  color: #293740;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.8rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid #d5dde1;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #40505a;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(320px, 2.2fr);
  gap: 20px;
  align-items: end;
  padding: 18px 22px;
  border-bottom: 1px solid #d5dde1;
  background: #ffffff;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1.15fr 1.15fr 1fr auto;
  gap: 10px;
  align-items: end;
}

.tabs {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid #d5dde1;
  background: #eef3f4;
  overflow-x: auto;
}

.tab.selected,
.primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

.ghost {
  margin-left: auto;
}

.surface {
  padding: 18px 22px 26px;
}

.two-pane {
  display: grid;
  grid-template-columns: minmax(250px, 360px) minmax(0, 1fr);
  gap: 16px;
  min-height: calc(100vh - 176px);
}

.single-pane,
.list-pane,
.detail-pane {
  min-width: 0;
  border: 1px solid #d5dde1;
  border-radius: 8px;
  background: #ffffff;
}

.single-pane,
.detail-pane {
  display: grid;
  align-content: start;
  gap: 18px;
  padding: 16px;
}

.list-pane {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.filter-panel {
  display: grid;
  gap: 8px;
  border-bottom: 1px solid #e4e9ec;
  padding-bottom: 10px;
}

.list-item {
  display: grid;
  width: 100%;
  gap: 5px;
  min-height: 78px;
  text-align: left;
}

.list-item.selected {
  border-color: #0f766e;
  background: #eef9f7;
}

.row-title,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.row-title {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  font-weight: 650;
}

.row-meta,
.subtle {
  color: #647580;
  font-size: 0.82rem;
}

.detail-header {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  border-bottom: 1px solid #e4e9ec;
  padding-bottom: 14px;
}

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

.metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  border: 1px solid #d5dde1;
  border-radius: 6px;
  padding: 10px;
}

.metric span {
  color: #647580;
  font-size: 0.78rem;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.kv-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.kv-list div {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 12px;
  border-bottom: 1px solid #eef1f3;
  padding-bottom: 8px;
}

.kv-list dt {
  color: #647580;
  font-size: 0.82rem;
}

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

.timeline {
  display: grid;
  gap: 10px;
}

.event {
  display: grid;
  gap: 8px;
  border-left: 3px solid #9fb2bd;
  padding-left: 12px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
}

.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8edf0;
  color: #40505a;
  font-size: 0.78rem;
  font-weight: 650;
}

.pill.success,
.banner.success {
  background: #e4f4ea;
  color: #166534;
}

.pill.warning,
.banner.warning {
  background: #fff7db;
  color: #8a5b00;
}

.pill.danger,
.banner.danger {
  background: #fdecec;
  color: #9b1c1c;
}

.pill.muted,
.banner.muted {
  background: #e8edf0;
  color: #40505a;
}

.banner,
.empty {
  margin: 12px 22px 0;
  border-radius: 6px;
  padding: 10px 12px;
}

.empty {
  margin: 0;
  border: 1px dashed #b8c3c9;
  color: #647580;
  background: #fbfcfd;
}

@media (max-width: 900px) {
  .topbar,
  .settings-grid,
  .two-pane,
  .metrics,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .ghost {
    margin-left: 0;
  }

  .kv-list div {
    grid-template-columns: 1fr;
  }
}
