:root {
  --bg: #f4f1eb;
  --text: #1a2e1f;
  --muted: #5a6b5e;
  --accent: #1a2e1f;
  --danger: #8a3324;
  --border: rgba(26, 46, 31, 0.15);
  --surface: #fffdf7;
  --surface-2: #ece7dd;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }
pre, code { font-family: "DM Mono", ui-monospace, monospace; font-size: 13.5px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* Layout */
.nav {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.nav-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-title { font-weight: 600; font-size: 17px; text-decoration: none; color: var(--text); }
.nav-right { display: flex; gap: 16px; align-items: center; color: var(--muted); font-size: 13.5px; }
.nav-right a { color: var(--muted); text-decoration: none; }
.nav-right a:hover { color: var(--text); }

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

h1 { font-size: 26px; margin: 0 0 4px 0; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 15.5px; text-transform: uppercase; letter-spacing: 0.08em;
     margin: 32px 0 12px 0; color: var(--muted); font-weight: 600; }
h3 { font-size: 19px; margin: 0 0 6px 0; font-weight: 600; }

.breadcrumb { color: var(--muted); font-size: 13.5px; margin-bottom: 12px; }
.breadcrumb a { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Cards and sections */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}
.section-card > h2 { padding: 14px 20px 0 20px; margin: 0; }
.section-card > .section-body { padding: 12px 20px 16px 20px; }
.section-card table { margin: 0; }
.empty {
  color: var(--muted); font-style: italic; padding: 8px 20px 16px 20px;
  font-size: 13.5px;
}

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 20px; text-align: left; vertical-align: top;
         border-top: 1px solid var(--border); }
thead th { background: var(--surface-2); font-weight: 600;
           text-transform: uppercase; font-size: 12px;
           letter-spacing: 0.06em; color: var(--muted); border-top: none; }
tbody tr:first-child td { border-top: 1px solid var(--border); }
tr.group-heading td {
  background: var(--surface-2); font-weight: 600;
  text-transform: uppercase; font-size: 12px; letter-spacing: 0.06em;
  color: var(--muted);
}

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 10px;
         font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
         background: var(--surface-2); color: var(--muted);
         border: 1px solid var(--border); }
.badge.status-pending     { background: #ece7dd; color: #5a6b5e; }
.badge.status-in_progress { background: #e4efe1; color: #1a2e1f; }
.badge.status-blocked     { background: #f2e1dc; color: #8a3324; border-color: rgba(138,51,36,.25); }
.badge.status-completed   { background: #dde6dc; color: #1a2e1f; }
.badge.status-cancelled   { background: #ece7dd; color: #5a6b5e; text-decoration: line-through; }
.badge.tier-human { background: #f0e8d8; color: #5a4a2e; }
.badge.tier-cc    { background: #e4efe1; color: #1a2e1f; }
.badge.attn { background: #f2e1dc; color: #8a3324; border-color: rgba(138,51,36,.35); }

/* Forms + buttons */
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 9px 11px; font: inherit;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent); outline-offset: 0px; border-color: var(--accent);
}
label { display: block; margin-bottom: 4px; font-size: 13.5px; color: var(--muted); }
.field { margin-bottom: 12px; }

.btn {
  display: inline-block; padding: 8px 14px; font: inherit;
  background: var(--accent); color: var(--bg); border: 1px solid var(--accent);
  border-radius: var(--radius); cursor: pointer; text-decoration: none;
  font-weight: 500;
}
.btn:hover { opacity: 0.9; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--bg); }
.btn.danger:hover { opacity: 0.9; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Prompt / prose blocks */
.prose-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin: 0;
  font-size: 14px;
}

/* Notes */
.notes { display: flex; flex-direction: column; gap: 10px; }
.note {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
}
.note-head { display: flex; gap: 10px; align-items: baseline;
             font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.note-author { color: var(--text); font-weight: 600; }

.error-inline {
  color: var(--danger); font-size: 13.5px; padding: 6px 0;
}
.alert-inline {
  background: #f2e1dc; border: 1px solid rgba(138,51,36,.25);
  color: var(--danger); padding: 8px 12px; border-radius: var(--radius);
  font-size: 13.5px; margin-bottom: 14px;
}

/* Metadata row */
.meta-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px 20px; font-size: 13.5px;
}
.meta-grid dt { color: var(--muted); margin: 0 0 2px 0; font-size: 12px;
                text-transform: uppercase; letter-spacing: 0.04em; }
.meta-grid dd { margin: 0 0 8px 0; }

/* Launch CC panel */
.launch-cc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.launch-cc-summary {
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--text);
  list-style: none;
}
.launch-cc-summary::-webkit-details-marker { display: none; }
.launch-cc-summary::before {
  content: "▸ ";
  display: inline-block;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.launch-cc[open] .launch-cc-summary::before { content: "▾ "; }
.launch-cc-body {
  padding: 0 20px 18px 20px;
  border-top: 1px solid var(--border);
}
.launch-cc-heading {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px 0;
  font-weight: 600;
}
.launch-cc-codewrap { position: relative; }
.launch-cc-code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  padding-right: 80px; /* leave room for copy button */
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}
.launch-cc-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 12px;
  padding: 4px 10px;
}

/* Login screen */
.login-wrap { max-width: 380px; margin: 80px auto; padding: 0 20px; }
.login-card { background: var(--surface); border: 1px solid var(--border);
              border-radius: var(--radius); padding: 24px 28px; }
