:root {
  --bg: #0c0f0a;
  --panel: #111510;
  --border: #2e3b27;
  --accent: #9fd87a;
  --accent-warn: #d8a857;
  --accent-error: #d88a8a;
  --text: #d8e4d0;
  --text-muted: #7d8a73;
  --mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--mono); line-height: 1.5;
  display: flex; justify-content: center; padding: 3rem 1.25rem;
}
main { width: 100%; max-width: 640px; }

.site-nav { display: flex; gap: 1.25rem; margin-bottom: 2rem; font-size: 0.85rem; }
.site-nav a { color: var(--text-muted); text-decoration: none; padding-bottom: 0.2rem; border-bottom: 1px solid transparent; }
.site-nav a:hover { color: var(--text); }
.site-nav a.active { color: var(--accent); border-bottom: 1px solid var(--accent); }

.status-block, .policy-block {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 4px; padding: 1.5rem 1.75rem; margin-bottom: 2.5rem;
}
.status-line { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.service-name { font-weight: 700; color: var(--accent); font-size: 1rem; }
.service-desc { color: var(--text-muted); font-size: 0.85rem; }
.status-fields { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; font-size: 0.85rem; }
.status-fields div { display: contents; }
.status-fields dt { color: var(--text-muted); font-weight: 400; }
.status-fields dd { margin: 0; color: var(--text); }
.status-fields dd.active { color: var(--accent); }

.policy-code { margin: 0; font-family: var(--mono); font-size: 0.85rem; color: var(--text); line-height: 1.7; white-space: pre; overflow-x: auto; }

.log h1, .prose h1, .notes h1 { font-size: 0.85rem; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 700; margin-bottom: 1.25rem; }
.log-entries { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.log-entry { position: relative; padding: 0 0 1.5rem 1.5rem; }
.log-entry::before { content: ''; position: absolute; left: -4px; top: 0.3rem; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.log-tag { font-size: 0.75rem; font-weight: 700; color: var(--accent); }
.tag-warn { color: var(--accent-warn); }
.log-title { font-weight: 700; margin-left: 0.4rem; font-size: 0.95rem; }
.log-body { margin: 0.4rem 0 0; color: var(--text-muted); font-size: 0.85rem; line-height: 1.6; }

.prose p { font-size: 0.9rem; color: var(--text); line-height: 1.75; margin: 0 0 1.1rem; }
.prose p:last-child { margin-bottom: 0; }

.notes-intro { font-size: 0.85rem; color: var(--text-muted); margin: -0.5rem 0 1.5rem; }
.notes-list { display: flex; flex-direction: column; gap: 1.25rem; }
.note { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 1.25rem 1.5rem; }
.note-header { display: flex; align-items: baseline; gap: 0.6rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.note-id { color: var(--text-muted); font-size: 0.75rem; }
.note-title { font-weight: 700; font-size: 0.95rem; }
.note-symptom {
  background: #150c0c; border: 1px solid #3b2727; border-radius: 3px;
  padding: 0.6rem 0.8rem; font-size: 0.78rem; color: var(--accent-error);
  margin: 0 0 0.9rem; overflow-x: auto; white-space: pre-wrap;
}
.note-field { font-size: 0.85rem; color: var(--text); margin-bottom: 0.5rem; line-height: 1.6; }
.note-field:last-child { margin-bottom: 0; }
.note-field .label { color: var(--text-muted); font-weight: 700; margin-right: 0.5rem; }

footer { margin-top: 2.5rem; font-size: 0.75rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 1rem; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.howto-steps { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.howto-step { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.step-header { display: flex; align-items: baseline; gap: 0.75rem; margin-bottom: 0.6rem; }
.step-num { color: var(--accent); font-weight: 700; font-size: 0.85rem; }
.step-title { font-weight: 700; font-size: 0.95rem; }
.step-body { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.9rem; line-height: 1.6; }
.step-code { background: #0a0d08; border: 1px solid var(--border); border-radius: 3px; padding: 0.8rem 1rem; font-size: 0.78rem; color: var(--text); white-space: pre; overflow-x: auto; margin: 0; }

.tools h1 { font-size: 0.85rem; letter-spacing: 0.12em; color: var(--text-muted); font-weight: 700; margin-bottom: 1.25rem; }
.tool-block { display: flex; flex-direction: column; gap: 1.5rem; margin-bottom: 1.5rem; }
.tool-section { background: var(--panel); border: 1px solid var(--border); border-radius: 4px; padding: 1.25rem 1.5rem; }
.tool-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.9rem; }
.tool-section-header .label { font-size: 0.75rem; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }
.btn-add { background: transparent; border: 1px solid var(--border); color: var(--accent); font-family: var(--mono); font-size: 0.75rem; padding: 0.3rem 0.7rem; border-radius: 3px; cursor: pointer; }
.btn-add:hover { border-color: var(--accent); }
.group-row, .rule-row { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.6rem; }
.group-row input, .rule-select {
  background: #0a0d08; border: 1px solid var(--border); color: var(--text);
  font-family: var(--mono); font-size: 0.85rem; padding: 0.45rem 0.6rem; border-radius: 3px;
}
.group-name-input { flex: 0 0 140px; }
.group-members-input { flex: 1; }
.rule-select { flex: 1; }
.rule-arrow { color: var(--text-muted); flex: 0 0 auto; }
.btn-remove {
  background: transparent; border: 1px solid var(--border); color: var(--accent-error);
  font-family: var(--mono); width: 1.8rem; height: 1.8rem; border-radius: 3px; cursor: pointer; flex: 0 0 auto;
}
.btn-remove:hover { border-color: var(--accent-error); }
.tool-output { margin-top: 0.5rem; }
