:root {
  --bg: #0e1116;
  --panel: #161a22;
  --panel-2: #1d222c;
  --line: #2a3140;
  --text: #e6e9ef;
  --text-dim: #9aa3b2;
  --accent: #6ea8fe;
  --done: #58d68d;
  --partial: #f5b041;
  --in-progress: #6ea8fe;
  --todo: #6c7280;
  --link: #8ab4f8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Inter", "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--panel-2);
  padding: 1px 6px;
  border-radius: 4px;
  font: 0.92em ui-monospace, "SF Mono", Menlo, monospace;
  color: #d6deff;
}

header {
  padding: 36px 40px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #11151c 0%, var(--bg) 100%);
}
header h1 { margin: 0 0 6px; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
header .subtitle { margin: 0; color: var(--text-dim); font-size: 14px; }

nav {
  display: flex;
  gap: 4px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  position: sticky; top: 0; z-index: 10;
  overflow-x: auto;
}
nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 12px 16px;
  color: var(--text-dim);
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
nav a:hover { color: var(--text); }
nav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
nav a.disabled {
  color: var(--text-dim);
  pointer-events: none;
  opacity: 0.55;
}
nav .pill {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-dim);
}
nav .pill-todo {
  background: rgba(108, 114, 128, 0.18);
  border-color: rgba(108, 114, 128, 0.45);
  color: #b3b8c4;
}

/* Component pages: Ferni / HumanitiOS / User 1 / User 2 / External */
.component h2 { margin-top: 0; }
.component h3 { font-size: 16px; margin-top: 24px; margin-bottom: 6px; color: var(--accent); }
.component ul { padding-left: 22px; }
.component li { margin: 4px 0; color: var(--text); }
.component p.next-up {
  margin-top: 28px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-dim);
}

.status-banner {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  letter-spacing: 0.02em;
}
.status-banner.status-todo {
  background: rgba(108, 114, 128, 0.15);
  border: 1px solid rgba(108, 114, 128, 0.4);
  color: #c4c8d1;
}
.status-banner.status-partial {
  background: rgba(245, 176, 65, 0.12);
  border: 1px solid rgba(245, 176, 65, 0.4);
  color: var(--partial);
}
.status-banner.status-done {
  background: rgba(88, 214, 141, 0.12);
  border: 1px solid rgba(88, 214, 141, 0.4);
  color: var(--done);
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 32px 80px;
}

main section + section { margin-top: 56px; }
main h2 { font-size: 22px; margin: 0 0 8px; letter-spacing: -0.01em; }
main p.muted { color: var(--text-dim); margin: 0 0 24px; font-size: 14px; }

ol.tasks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
ol.tasks li {
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "head head"
    "body notes";
  gap: 8px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 22px;
}
@media (max-width: 800px) {
  ol.tasks li {
    grid-template-columns: 1fr;
    grid-template-areas: "head" "body" "notes";
  }
}
.task-head {
  grid-area: head;
  display: flex; align-items: center; gap: 10px;
  font-size: 16px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.task-head strong { font-weight: 600; }
.task-head .status { font-size: 18px; }
.task-body { grid-area: body; }
.task-body p { margin: 8px 0; }
.task-body ul, .task-body ol { margin: 8px 0; padding-left: 22px; }
.task-body li { margin: 4px 0; }
.task-body ul.repolist code { font-size: 12.5px; }

aside.notes {
  grid-area: notes;
  background: var(--panel-2);
  border-left: 3px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-dim);
  align-self: start;
}
aside.notes strong { display: block; color: var(--text); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
aside.notes p { margin: 0; }

li.done { border-left: 3px solid var(--done); }
li.partial { border-left: 3px solid var(--partial); }
li.in-progress { border-left: 3px solid var(--in-progress); }
li.todo { border-left: 3px solid var(--todo); }

.infra .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
}
.card h3 { margin: 0 0 8px; font-size: 14px; color: var(--accent); letter-spacing: 0.02em; }
.card ul { margin: 0; padding-left: 18px; font-size: 13px; }
.card li { margin: 4px 0; color: var(--text-dim); }
.card li code { font-size: 11.5px; }

ul.checklist {
  list-style: none;
  padding: 0; margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px 18px;
}
ul.checklist li {
  padding: 6px 0;
  color: var(--text-dim);
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
ul.checklist li::before { content: "○ "; color: var(--todo); margin-right: 6px; }

ol.phases { font-size: 14px; }

footer {
  border-top: 1px solid var(--line);
  padding: 20px 40px;
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
}
