:root {
  color-scheme: light;
  --ink: #1d2428;
  --muted: #6f777b;
  --line: #d9e0de;
  --panel: #f7f8f6;
  --paper: #ffffff;
  --blue: #2364aa;
  --green: #178260;
  --amber: #a76518;
  --red: #b73535;
  --shadow: 0 1px 2px rgba(22, 30, 33, 0.08);
  font-family: Avenir Next, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}
button, input, textarea, select {
  font: inherit;
  letter-spacing: 0;
}
button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
  min-height: 34px;
  padding: 6px 10px;
  cursor: pointer;
}
button:hover { border-color: #9fb0ad; }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button.icon { width: 34px; padding: 0; }
input[type="checkbox"] {
  width: auto;
  min-height: auto;
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 8px 9px;
  min-height: 34px;
}
textarea {
  min-height: 92px;
  resize: vertical;
}
.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(260px, 320px) 1fr;
  background:
    linear-gradient(90deg, #f4f6f5 0, #f4f6f5 320px, #fff 320px);
}
.rail {
  border-right: 1px solid var(--line);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.main {
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 16px;
  min-width: 0;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mark {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #e6f1ed;
  color: var(--green);
  font-weight: 800;
  border: 1px solid #c7ddd6;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 18px; font-weight: 700; }
h2 { font-size: 13px; font-weight: 700; text-transform: uppercase; color: var(--muted); }
h3 { font-size: 14px; font-weight: 700; }
.subtle { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.spread { justify-content: space-between; }
.section {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stat {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  padding: 10px;
  box-shadow: var(--shadow);
  min-height: 70px;
}
.stat .value {
  font-size: 24px;
  line-height: 1.1;
  font-weight: 750;
  margin-top: 3px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill.ok { color: var(--green); border-color: #bddad1; background: #eef8f4; }
.pill.warn { color: var(--amber); border-color: #ead2a9; background: #fff7e8; }
.pill.bad { color: var(--red); border-color: #e7bcbc; background: #fff0f0; }
.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  background: var(--panel);
  width: fit-content;
}
.tab {
  border: 0;
  background: transparent;
  min-height: 30px;
  padding: 5px 10px;
}
.tab.active {
  background: #fff;
  box-shadow: var(--shadow);
}
.toolbar {
  display: grid;
  grid-template-columns: 1fr 160px auto;
  gap: 8px;
  align-items: center;
}
.content-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
  min-height: 0;
}
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.panel-head {
  min-height: 44px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfb;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-body {
  padding: 12px;
  overflow: auto;
}
.results {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
}
.result {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  cursor: pointer;
  background: #fff;
}
.result:hover { background: #f7faf8; }
.result.active { border-left: 3px solid var(--green); padding-left: 9px; background: #f1f7f4; }
.result-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}
.preview {
  color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-grid .wide { grid-column: 1 / -1; }
.message {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--panel);
  color: var(--muted);
}
.message.error {
  border-color: #e7bcbc;
  background: #fff0f0;
  color: var(--red);
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px;
  background: #f8f9f8;
  max-height: 280px;
  overflow: auto;
}
.hidden { display: none !important; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; background: #fff; }
  .rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .toolbar { grid-template-columns: 1fr; }
  .content-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}
