:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --panel: #ffffff;
  --line: #d8dee7;
  --text: #172033;
  --muted: #667085;
  --soft: #eef6f4;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #8a5a00;
  --danger: #a13b3b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-weight: 700; font-size: 18px; letter-spacing: 0; }
.subtle { color: var(--muted); }
.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 18px;
}
.sidebar, .main, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.sidebar { padding: 12px; align-self: start; position: sticky; top: 12px; }
.main { padding: 22px; min-width: 0; }
.section-link {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.section-link.active { background: var(--soft); color: var(--accent-strong); font-weight: 700; }
.section-state {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  margin-top: 1px;
}
.section-state.ok { background: #e7f5ef; color: #087443; }
.section-state.bad { background: #fff1f0; color: var(--danger); }
h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.18; }
h2 { margin: 26px 0 10px; font-size: 18px; }
h3 { margin: 0 0 8px; font-size: 16px; }
p { line-height: 1.55; }
.content { line-height: 1.58; max-width: 900px; }
.content ul { padding-left: 22px; }
.content li { margin: 4px 0; }
.note {
  padding: 12px 14px;
  background: var(--soft);
  border-radius: 6px;
  color: var(--accent-strong);
  line-height: 1.45;
}
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.panel { padding: 16px; margin-top: 18px; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  background: #fff;
}
.pill.good { border-color: #a7d7cf; color: var(--accent-strong); background: var(--soft); }
.pill.warn { border-color: #efd99b; color: var(--warn); background: #fff8e5; }
.comment {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.comment:first-child { border-top: 0; }
.comment-body { white-space: pre-wrap; line-height: 1.5; }
.comment-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.comment-scroll {
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
}
.proposal {
  background: #fbfcfe;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  margin-top: 12px;
}
.run-update-form { margin: 12px 0 14px; }
.run-update-form button { width: 100%; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(23, 32, 51, 0.42);
}
.manual-modal {
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 18px 60px rgba(23, 32, 51, 0.22);
}
.manual-modal h1 { font-size: 24px; }
.manual-modal ol {
  padding-left: 22px;
  line-height: 1.55;
}
.manual-modal li { margin: 8px 0; }
button, .button {
  appearance: none;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 700;
  cursor: pointer;
  font-size: 14px;
}
button:disabled {
  border-color: #c7ced8;
  background: #e4e7ec;
  color: #667085;
  cursor: not-allowed;
}
button.secondary, .button.secondary {
  background: #fff;
  color: var(--accent-strong);
}
button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  background: #fff;
  color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
label { display: block; margin: 12px 0 6px; font-weight: 700; font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.auth {
  width: min(460px, calc(100% - 32px));
  margin: 9vh auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}
.flash { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; background: #fff8e5; color: var(--warn); }
.danger { color: var(--danger); }
.footer { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 820px) {
  .layout { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { position: static; }
  .grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

/* Keep the signed-in account readable even with a long email on mobile. */
.topbar > div { min-width: 0; max-width: 100%; }
.topbar small { display: block; overflow-wrap: anywhere; margin-top: 4px; }
