:root {
  --cream: #fff3e7;
  --cool: #efe1d7;
  --peach: #f1c09a;
  --amber: #d47c2e;
  --copper: #9a4d25;
  --graphite: #2a1c18;
  --charcoal: #17100f;
  --muted: #766155;
  --teal: #7c4636;
  --green: #5f7a55;
  --red: #a54d3b;
  --surface: rgba(255,248,241,.92);
  --surface-solid: #fff9f3;
  --border: #dcc8b8;
  --border-light: #ead8ca;
  --hover: #fff1e4;
  --shadow: 0 22px 60px rgba(122, 63, 43, .12);
  --radius-sm: 9px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --focus-ring: 0 0 0 2px var(--cream), 0 0 0 4px var(--amber);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { font-size: 16px; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--charcoal);
  color: var(--cream);
  padding: .6rem 1rem;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; text-decoration: none; }

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 14% 0%, rgba(212, 124, 46, .20), transparent 24%),
    radial-gradient(circle at 84% 8%, rgba(154, 77, 37, .16), transparent 28%),
    radial-gradient(circle at 50% 18%, rgba(255, 214, 178, .32), transparent 30%),
    linear-gradient(180deg, var(--cream) 0, var(--cool) 46%, #f2ddcf 100%);
  color: var(--graphite);
  font-family: "IBM Plex Sans", Inter, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--copper); text-decoration: none; }
a:hover { text-decoration: underline; }

button, .button {
  border: 1px solid rgba(154, 77, 37, .38);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 250, 245, .92), rgba(255, 241, 231, .88));
  color: var(--copper);
  padding: .58rem .95rem;
  font: inherit;
  font-size: .95rem;
  font-weight: 500;
  line-height: 1.2;
  min-height: 2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  box-shadow: 0 1px 0 rgba(255,255,255,.72) inset;
}

button:hover, .button:hover {
  background: linear-gradient(180deg, #fff7ef, #ffe9d8);
  border-color: rgba(154, 77, 37, .55);
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(154, 77, 37, .12);
}

.primary, .button.primary {
  background: linear-gradient(135deg, var(--copper), var(--amber));
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 28px rgba(154, 77, 37, .28);
}
.primary:hover, .button.primary:hover {
  background: linear-gradient(135deg, #8f4222, #bf6a23);
  box-shadow: 0 16px 32px rgba(154, 77, 37, .34);
}

input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.76);
  padding: .65rem .8rem;
  color: var(--graphite);
  font: inherit;
  font-size: 1rem;
}

input[type="checkbox"], input[type="radio"] {
  width: 1.1rem;
  height: 1.1rem;
  min-width: 1.1rem;
  padding: 0;
  accent-color: var(--teal);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(47,111,104,.16);
}

textarea { min-height: 4rem; resize: vertical; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .95rem 1.5rem;
  border-bottom: 1px solid rgba(154, 77, 37, .16);
  background: linear-gradient(180deg, rgba(255, 248, 241, .92), rgba(250, 236, 223, .84));
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px rgba(122, 63, 43, .06);
}

.brand {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--graphite);
  letter-spacing: 0;
}

.topbar nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .35rem .8rem;
  font-size: .95rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 999px;
}
.topbar nav a:hover { color: var(--graphite); text-decoration: none; background: rgba(255, 239, 224, .92); }
.topbar nav button { padding: .4rem .8rem; font-size: .9rem; min-height: 2rem; }

.inline-form { display: inline; }

main { padding: 1.5rem; }
main:focus { outline: none; }

.is-navigating main {
  opacity: .62;
  transition: opacity .12s ease;
}

.live-status {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  max-width: min(22rem, calc(100vw - 2rem));
  border: 1px solid rgba(212, 124, 46, .26);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(43, 28, 22, .98), rgba(28, 18, 16, .98));
  color: var(--cream);
  padding: .55rem .8rem;
  box-shadow: var(--shadow);
  font-size: .92rem;
}

/* Page head — compact, utilitarian */
.hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(20rem, .9fr); gap: 1.5rem; align-items: center; max-width: 1200px; margin: 3.5rem auto; }
.eyebrow { color: var(--copper); text-transform: uppercase; letter-spacing: 0; font-size: .78rem; font-weight: 700; margin: 0 0 .45rem; }
h1 { font-family: "Space Grotesk", Inter, sans-serif; font-size: 3.25rem; line-height: 1.03; margin: 0 0 1rem; font-weight: 800; letter-spacing: 0; }
h2 { margin: 0 0 .7rem; font-size: 1.25rem; font-weight: 700; }
h3 { margin: .85rem 0 .45rem; font-size: 1.05rem; font-weight: 650; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46rem; line-height: 1.55; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.35rem; }
.note, .meta { color: var(--muted); font-size: .92rem; }

.board-page-head { margin-bottom: 1.1rem; }
.board-shell { max-width: 1440px; margin: 1rem auto 3rem; display: grid; gap: 1rem; }
.board-shell > .board { max-width: none; }

.board-header-row {
  display: grid;
  gap: .85rem;
  align-items: end;
}

.board-repo-meta {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.board-secondary-action { color: var(--copper); }
.board-open-repo { min-height: 2.4rem; }
.board-quiet-link {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .15rem .25rem;
  color: var(--muted);
  font-size: .92rem;
}

.repo-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  align-items: center;
  padding: .55rem;
  border: 1px solid rgba(154, 77, 37, .18);
  border-radius: 18px;
  background: rgba(255, 248, 241, .55);
}

.repo-switcher-label {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0 .25rem;
}

.repo-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: .35rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,.62);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 650;
}

.repo-switcher a.active { background: var(--graphite); color: var(--cream); border-color: var(--graphite); }

.column-add-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-left: .45rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(154, 77, 37, .28);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(255,243,231,.94));
  color: var(--copper);
  font-size: 1.1rem;
  line-height: 1;
}

.column-add-button:hover { border-color: rgba(154, 77, 37, .5); box-shadow: 0 8px 18px rgba(154, 77, 37, .12); }

.board-modal[hidden] { display: none; }

.board-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.board-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 17, 14, .54);
  backdrop-filter: blur(8px);
}

.board-modal-panel {
  position: relative;
  z-index: 1;
  width: min(42rem, 100%);
  max-height: min(90vh, 54rem);
  overflow: auto;
  border: 1px solid rgba(154, 77, 37, .25);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 251, 247, .98), rgba(255, 241, 230, .98));
  box-shadow: 0 30px 90px rgba(37, 21, 16, .34);
  padding: 1.2rem;
}

.board-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 1rem;
}

.board-modal-header h2 { margin-bottom: .25rem; }

.board-modal-close {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 999px;
  flex: 0 0 auto;
}

.board-create-form { margin-top: 1rem; }

.board-field { display: grid; gap: .35rem; }
.board-field-label { color: var(--muted); font-size: .92rem; font-weight: 600; }

.board-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  flex-wrap: wrap;
}

body.board-modal-open { overflow: hidden; }

/* Panels and cards */
.nc-panel, .nc-task-card, .new-card {
  background: linear-gradient(180deg, rgba(255, 251, 247, .95), rgba(255, 243, 233, .88));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
}

.nc-panel { box-shadow: var(--shadow); }
.nc-panel h2 { margin-top: 0; font-size: 1.15rem; }

.nc-task-card {
  margin-bottom: .6rem;
  padding: .75rem;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.nc-task-card:hover {
  box-shadow: 0 14px 34px rgba(122, 63, 43, .12);
  border-color: #e3cbb7;
}

.nc-task-card.running { border-color: var(--amber); }
.nc-task-card.failed { border-color: var(--red); background: linear-gradient(180deg, #fff9f7, #fff1ef); }

.hero-card { display: grid; gap: .75rem; }

.mini-column {
  padding: .75rem;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,244,235,.62));
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: .95rem;
}

.mini-column.active { background: linear-gradient(135deg, #3d2017, #6e341f); color: var(--cream); border-color: #3d2017; }

.trace-line {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: linear-gradient(180deg, #201512, #140f0f);
  color: #f3c9a4;
  border-radius: 10px;
  padding: .6rem .75rem;
  font-size: .9rem;
}

.trace-line.success { color: #b5dfb7; }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem); gap: 1.25rem; align-items: start; }

/* Static landing uses the same shell and token set as the Django app. */
.marketing-hero { max-width: 960px; margin: 5.5rem auto 3rem; text-align: center; }
.marketing-hero h1 { font-size: 4.75rem; }
.marketing-hero .lede { margin: 0 auto; }
.marketing-hero .actions { justify-content: center; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; max-width: 1100px; margin: 0 auto 1rem; }
.cards article { display: grid; gap: .4rem; box-shadow: none; }
.cards span { color: var(--copper); font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .88rem; font-weight: 700; }
.cards p, .flow li { color: var(--muted); line-height: 1.6; }
.flow { max-width: 760px; margin: 0 auto 4rem; }
.flow ol { margin: .75rem 0 0; padding-left: 1.2rem; }

.new-card { padding: .75rem; display: grid; gap: .6rem; }
.board-actions { display: grid; gap: .75rem; }
.board-quick-actions { align-content: start; }

/* Board layout */
.board-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.board-tabs a {
  border: 1px solid rgba(154, 77, 37, .2);
  background: linear-gradient(180deg, rgba(255, 250, 246, .94), rgba(255, 240, 228, .88));
  border-radius: 999px;
  padding: .45rem .75rem;
  font-size: .95rem;
  font-weight: 500;
  color: var(--muted);
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
}

.board-tabs a:hover { color: var(--graphite); border-color: rgba(154, 77, 37, .35); text-decoration: none; box-shadow: 0 8px 18px rgba(154, 77, 37, .10); }
.board-tabs a.active { background: linear-gradient(135deg, #4a261c, #7c3f22); color: var(--cream); border-color: transparent; }

.board-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.board-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(17rem, .75fr);
  gap: 1rem;
  align-items: stretch;
}

.board-primary-card,
.board-flow-card {
  border: 1px solid rgba(154, 77, 37, .18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 251, 247, .95), rgba(255, 239, 228, .86));
  box-shadow: var(--shadow);
  padding: 1rem;
}

.board-primary-card {
  display: grid;
  grid-template-columns: minmax(12rem, .7fr) minmax(18rem, 1fr);
  gap: 1rem;
  align-items: start;
}

.board-primary-card h2,
.board-flow-card h2 { margin-bottom: .35rem; }

.board-flow-list {
  list-style: none;
  margin: .75rem 0 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}

.board-flow-list li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: .75rem;
  align-items: start;
  padding: .55rem .65rem;
  border: 1px solid rgba(154, 77, 37, .14);
  border-radius: 12px;
  background: rgba(255, 255, 255, .42);
}

.board-flow-list strong { color: var(--copper); }
.board-flow-list span { color: var(--muted); font-size: .9rem; }

.board-admin {
  border: 1px solid rgba(154, 77, 37, .16);
  border-radius: 16px;
  background: rgba(255, 248, 241, .62);
  padding: .75rem;
}

.board-admin summary {
  cursor: pointer;
  color: var(--copper);
  font-weight: 700;
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
}

.board-admin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}

.board-admin { max-width: 1200px; margin: 1rem auto 0; }

.board-status-note {
  max-width: 1440px;
  margin: 0 auto .8rem;
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  border: 1px solid rgba(212, 124, 46, .24);
  border-radius: 16px;
  background: rgba(255, 245, 236, .70);
  padding: .65rem .85rem;
  color: var(--muted);
  box-shadow: 0 10px 24px rgba(122, 63, 43, .06);
}

.board-status-note p { margin: 0; font-size: .92rem; }
.board-status-note strong { color: var(--copper); }
.board-status-note details { margin-left: auto; }

.board-status-note summary {
  cursor: pointer;
  color: var(--copper);
  font-weight: 600;
  font-size: .9rem;
}

.config-problems {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: .25rem .75rem;
  margin-top: .45rem;
}

.config-problems .meta {
  margin: 0;
}

.compact-form { display: grid; gap: .5rem; }
.compact-form h2, .people-list h2 { font-size: 1.05rem; margin-bottom: .25rem; }
.people-list p { display: flex; justify-content: space-between; gap: 1rem; margin: .45rem 0; font-size: .95rem; }
.people-list span { color: var(--muted); font-size: .9rem; }

.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(16rem, 1fr));
  gap: 1rem;
  align-items: start;
  margin: 0;
  transition: opacity .16s ease;
}

.board.is-refreshing { opacity: .72; }

.detail-grid { position: relative; }

.detail-grid::before {
  display: none;
  content: "Auto-updating";
  position: absolute;
  top: -2.15rem;
  right: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  padding: .18rem .55rem;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.detail-grid.live-connected::before {
  display: block;
  border-color: rgba(79, 125, 84, .35);
  color: var(--green);
}

.column {
  min-height: 12rem;
  background: linear-gradient(180deg, rgba(255, 249, 243, .66), rgba(255, 240, 230, .45));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: .9rem;
  box-shadow: 0 14px 34px rgba(122, 63, 43, .07);
}

.column-head {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: start;
  margin-bottom: .75rem;
}

.column-head h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--copper);
  font-weight: 700;
  margin: 0 0 .15rem;
}

.column-head p {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.35;
  margin: 0;
}

.column-head > span {
  min-width: 2rem;
  min-height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(154, 77, 37, .10);
  color: var(--copper);
  font-weight: 700;
  font-size: .88rem;
}

.card-top { display: flex; justify-content: space-between; gap: .5rem; }
.card-top strong { font-size: 1rem; font-weight: 650; }
.card-top span { color: var(--muted); font-size: .85rem; font-weight: 500; }

.card-actions { display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; margin-top: .5rem; }
.card-actions button, .card-actions a {
  padding: .3rem .5rem;
  font-size: .9rem;
  border-radius: 999px;
  min-height: 2rem;
}

.progress { height: .4rem; background: #f1e2d3; border-radius: 999px; overflow: hidden; margin: .5rem 0; }
.progress span { display: block; width: 60%; height: 100%; background: linear-gradient(90deg, var(--amber), var(--copper)); animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.failure { color: var(--red); font-weight: 600; margin: .4rem 0; font-size: .95rem; }
.empty { color: var(--muted); padding: 1.5rem 0; text-align: center; font-size: .95rem; }

/* Archive */
.archived-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr)); gap: .75rem; max-width: 1200px; margin: 1.25rem auto 0; }
.archived-list .nc-task-card { margin-bottom: 0; }
.status-pill {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--copper);
  background: rgba(154, 77, 37, .09);
  border: 1px solid rgba(154, 77, 37, .18);
  border-radius: 999px;
  padding: .12rem .5rem;
  align-self: flex-start;
  white-space: nowrap;
}

/* Drag and drop */
.nc-task-card[draggable] { cursor: grab; }
.nc-task-card[draggable]:active { cursor: grabbing; }
.nc-task-card.dragging { opacity: .4; transform: scale(.97); border-style: dashed; }
.column.drag-over, .column.is-updating { border-color: var(--amber); background: rgba(255, 235, 214, .46); box-shadow: inset 0 0 0 2px rgba(212, 124, 46, .28); }
.column-drop-zone { min-height: 4rem; }
.inline-move { display: inline; }

.checklist { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; max-width: 1200px; margin: 0 auto; }

.onboarding-flow {
  max-width: 860px;
  margin: 0 auto 3rem;
  display: grid;
  gap: .85rem;
}

.onboarding-step {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: .9rem;
  position: relative;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 250, 242, .78);
  padding: 1rem;
  box-shadow: 0 12px 36px rgba(82, 50, 20, .08);
}

.onboarding-step::before {
  content: "";
  position: absolute;
  left: 2.2rem;
  top: 3.75rem;
  bottom: -1rem;
  border-left: 1px solid var(--border);
}

.onboarding-step:last-child::before { display: none; }
.onboarding-step.done { border-color: rgba(79, 125, 84, .35); }
.onboarding-step.current { border-color: rgba(199, 122, 45, .55); background: rgba(255, 240, 220, .72); }
.onboarding-step.locked { opacity: .68; }
.onboarding-step.optional { border-style: dashed; }

.step-marker {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--graphite);
  color: var(--cream);
  font-weight: 750;
  font-family: "Space Grotesk", Inter, sans-serif;
  z-index: 1;
}

.step-state {
  display: inline-block;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: .72rem;
  font-weight: 750;
  margin-bottom: .25rem;
}

.step-body h2 { margin-bottom: .35rem; }
.step-body p { margin: 0 0 .75rem; color: var(--muted); }
.compact-actions { margin-top: .75rem; }

.inline-onboarding-form {
  display: grid;
  gap: .6rem;
  margin-top: .85rem;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .45);
}

.inline-onboarding-form label {
  display: grid;
  gap: .35rem;
  color: var(--muted);
  font-size: .92rem;
}

.inline-onboarding-form button { justify-self: start; }

.repo-suggestions {
  max-height: 20rem;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem;
  margin-top: .75rem;
}

.inline-onboarding-form .repo-suggestions { margin-bottom: .75rem; }

.repo-suggestion-form {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .4rem .5rem;
  border-bottom: 1px solid var(--border);
}

.repo-suggestion-form:last-child { border-bottom: none; }

button.repo-suggestion-form {
  width: 100%;
  background: transparent;
  text-align: left;
  border-radius: 0;
  min-height: 0;
}

.repo-suggestion-name {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .875rem;
}

.repo-suggestion-branch { font-size: .75rem; }

.repo-suggestion-add { font-size: .8rem; padding: .25rem .75rem; }

.repo-paste-hint { margin-top: .75rem; font-size: .8rem; }

.onboarding-aside { margin-top: .75rem; }

.detail-grid, .settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
  max-width: 1200px;
  margin: 0 auto;
}

.settings-shell {
  max-width: 1120px;
  margin: 0 auto 3rem;
  display: grid;
  grid-template-columns: minmax(13rem, 17rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.stage {
  border-left: 3px solid var(--border);
  padding: .45rem .65rem;
  margin: .4rem 0;
  background: var(--surface);
  border-radius: 4px;
  font-size: .95rem;
}

.stage.passed { border-color: var(--green); }
.stage.failed { border-color: var(--red); }
.stage.running { border-color: var(--amber); }
.stage span { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .88rem; }
.stage strong { font-size: .9rem; }

.builder-layout { max-width: 1200px; margin: 0 auto 3rem; display: grid; grid-template-columns: minmax(0, .95fr) minmax(22rem, .75fr); gap: 1rem; align-items: start; }
.builder-chat, .builder-draft { display: grid; gap: .85rem; }
.builder-message { padding: .85rem; border: 1px solid var(--border); border-radius: 14px; background: rgba(255, 255, 255, .45); }
.builder-message.agent { border-color: rgba(178, 91, 54, .28); background: rgba(178, 91, 54, .08); }
.builder-message.system { border-style: dashed; }
.builder-message p { margin: .35rem 0 0; }
.check-row { display: flex; align-items: center; gap: .5rem; color: var(--muted); min-height: 2rem; }

.settings-nav {
  display: grid;
  gap: .55rem;
  position: sticky;
  top: 5.25rem;
}
.settings-nav a {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  background: rgba(255, 250, 242, .72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .65rem .7rem;
  font-size: 1rem;
  font-weight: 500;
  box-shadow: 0 10px 26px rgba(82, 50, 20, .06);
  color: var(--muted);
}

.settings-nav a:hover { text-decoration: none; border-color: rgba(199, 122, 45, .45); color: var(--graphite); }
.settings-nav a span {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(37, 35, 33, .08);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 750;
  font-family: "Space Grotesk", Inter, sans-serif;
}
.settings-nav a strong { font-size: .98rem; font-weight: 700; }
.settings-nav a.active {
  border-color: rgba(199, 122, 45, .55);
  background: rgba(255, 240, 220, .82);
  color: var(--graphite);
}
.settings-nav a.active span { background: var(--graphite); color: var(--cream); }

.settings-panel {
  border-radius: 14px;
  padding: 1.25rem;
  background: rgba(255, 250, 242, .82);
  box-shadow: 0 18px 48px rgba(82, 50, 20, .10);
}

.settings-panel > h2:first-child {
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 1.65rem;
  letter-spacing: 0;
}

.settings-panel form,
.settings-panel details,
.settings-panel .settings-card {
  margin-top: .85rem;
}

.settings-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .5);
  padding: .75rem;
  display: grid;
  gap: .5rem;
}

.attention-card { border-color: rgba(199, 122, 45, .45); background: rgba(255, 240, 220, .72); }
.success-card { border-color: rgba(79, 125, 84, .35); background: rgba(230, 245, 231, .64); }

.settings-panel .kv { display: grid; gap: .35rem; margin: .35rem 0; }
.settings-panel .kv > div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: .75rem;
  align-items: baseline;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border);
}
.settings-panel .kv > div:last-child { border-bottom: none; }
.settings-panel .kv dt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
  margin: 0;
}
.settings-panel .kv dd { margin: 0; }

.settings-panel .repo-row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.settings-panel .repo-row strong { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.settings-panel .cmd-list { list-style: none; margin: .35rem 0; padding: 0; display: grid; gap: .3rem; }
.settings-panel .cmd-list li { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; }

/* Billing */
.billing-plan {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(150deg, var(--cream), var(--cool));
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}
.billing-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.billing-price { margin: .15rem 0 0; }
.billing-price strong { font-family: "Space Grotesk", Inter, sans-serif; font-size: 2.1rem; font-weight: 700; letter-spacing: 0; color: var(--graphite); }
.billing-includes { margin: .9rem 0 0; padding-left: 1.1rem; display: grid; gap: .3rem; }
.billing-includes li { color: var(--muted); }
.billing-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .75rem; }
.billing-pill-active { color: var(--green); background: rgba(95, 122, 85, .12); border-color: rgba(95, 122, 85, .3); }
.billing-pill-warn { color: var(--red); background: rgba(165, 77, 59, .1); border-color: rgba(165, 77, 59, .3); }
#billing-payment-element { margin: .9rem 0; }
.billing-mode { margin-top: 1rem; text-transform: uppercase; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .72rem; letter-spacing: 0; }
.usage-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); max-width: none; }

.readiness-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .75rem;
  margin-top: .9rem;
}

.readiness-summary .settings-card {
  align-content: start;
}

.readiness-badge {
  width: max-content;
  border-radius: 999px;
  padding: .24rem .55rem;
  font-size: .82rem;
  font-weight: 700;
  line-height: 1;
  border: 1px solid var(--border);
}

.readiness-badge.ready {
  color: var(--green);
  background: rgba(230, 245, 231, .78);
  border-color: rgba(79, 125, 84, .34);
}

.readiness-badge.blocked {
  color: var(--red);
  background: rgba(255, 240, 220, .78);
  border-color: rgba(199, 122, 45, .36);
}

.readiness-checks {
  display: grid;
  gap: .65rem;
}

.readiness-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--border);
  padding: .8rem 0 0;
}

.readiness-row .failure,
.readiness-row .meta {
  margin-bottom: 0;
}

@media (max-width: 800px) {
  .readiness-summary {
    grid-template-columns: 1fr;
  }

  .readiness-row {
    display: grid;
  }
}

.issue-settings textarea { min-height: 5.5rem; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; max-width: 1200px; margin: 0 auto .75rem; }

.messages { max-width: 1200px; margin: .75rem auto 0; padding: 0 1.25rem; }
.message {
  padding: .6rem .9rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 1rem;
}

/* Auth forms */
.auth-shell { max-width: 30rem; margin: 4.5rem auto; display: grid; gap: 1.25rem; }
.auth-copy { text-align: center; }
.auth-copy h1 { font-size: 2.75rem; }
.auth-copy .lede { margin: 0 auto; }
.auth-card form { display: grid; gap: .85rem; }
.auth-card button, .auth-card .button { width: 100%; }
.auth-card .alt { text-align: center; margin: .35rem 0; font-size: .95rem; color: var(--muted); }
.auth-card .alt a,
.auth-secondary a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .15rem .25rem;
}
.auth-divider { color: var(--muted); display: flex; align-items: center; gap: .75rem; margin: .9rem 0; font-size: .9rem; }
.auth-divider::before, .auth-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.github-auth { align-items: center; justify-content: center; gap: .55rem; }
.google-auth { align-items: center; justify-content: center; gap: .55rem; border-color: var(--border); color: var(--graphite); }
.google-auth:hover { background: rgba(199, 122, 45, .08); }
.github-icon { width: 1.1rem; height: 1.1rem; display: block; filter: brightness(0) invert(1); }
.google-icon { width: 1.15rem; height: 1.15rem; display: block; flex-shrink: 0; }
.oauth-buttons { display: grid; gap: .55rem; }
.email-account { margin-top: .9rem; }
.email-account summary { color: var(--muted); cursor: pointer; font-size: .95rem; text-align: center; }
.email-account form { margin-top: .85rem; }

/* Misc */
.pr-link { font-size: .95rem; display: inline-block; margin-top: .35rem; }
.compact { padding: .5rem 0; }

/* Legal pages */
.legal-page { max-width: 760px; margin: 2.5rem auto 3rem; }
.legal-header { margin-bottom: 2rem; }
.legal-header h1 { font-size: 2.4rem; }
.legal-header .meta { margin-top: .25rem; }
.legal-section { margin-bottom: 2rem; }
.legal-section h2 { font-size: 1.15rem; margin-bottom: .5rem; }
.legal-section h3 { font-size: 1rem; margin: .75rem 0 .35rem; }
.legal-section p { margin: .5rem 0; color: var(--muted); line-height: 1.6; }
.legal-section ul { margin: .5rem 0; padding-left: 1.5rem; color: var(--muted); }
.legal-section li { margin: .3rem 0; line-height: 1.55; }
.legal-section strong { color: var(--graphite); }

/* Footer */
.site-footer {
  margin-top: 3rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: .88rem;
  color: var(--muted);
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  flex-wrap: wrap;
}
.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: .15rem .25rem;
  color: var(--muted);
  font-weight: 500;
}
.site-footer a:hover { color: var(--copper); }

@media (max-width: 980px) {
  main { padding: 1rem; }
  .hero, .split, .detail-grid, .settings-layout, .settings-shell, .flow, .builder-layout, .board-command-center, .board-primary-card { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; }
  .board-admin-grid { grid-template-columns: minmax(0, 1fr); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-status-note { align-items: flex-start; }
  .board-status-note details { margin-left: 0; width: 100%; }
  .repo-switcher { align-items: flex-start; }
  .column { min-width: 0; }
  .board-flow-list li { grid-template-columns: minmax(0, 1fr); gap: .25rem; }
  .stats, .cards { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; flex-direction: column; gap: .6rem; }
  h1 { font-size: 2.35rem; }
  .marketing-hero h1 { font-size: 3rem; }
  .auth-copy h1 { font-size: 2.3rem; }
  .legal-header h1 { font-size: 2.1rem; }
}

#nc-loading {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.nc-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--copper);
  border-radius: 50%;
  animation: nc-spin 0.6s linear infinite;
}

@keyframes nc-spin {
  to { transform: rotate(360deg); }
}

.nc-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(1rem);
  opacity: 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(14px);
}

.nc-toast--visible {
  transform: translateY(0);
  opacity: 1;
}

.nc-toast--error {
  background: rgba(163, 71, 53, 0.9);
  color: white;
}

.nc-toast--success {
  background: rgba(79, 125, 84, 0.9);
  color: white;
}

.nc-toast--info {
  background: rgba(37, 35, 33, 0.9);
  color: white;
}

/* Markdown rendered content */
[data-markdown] h1 { font-size: 1.5rem; margin: 1rem 0 .5rem; }
[data-markdown] h2 { font-size: 1.25rem; margin: .85rem 0 .4rem; }
[data-markdown] h3 { font-size: 1.1rem; margin: .7rem 0 .35rem; }
[data-markdown] p { margin: .4rem 0; }
[data-markdown] ul, [data-markdown] ol { margin: .4rem 0; padding-left: 1.4rem; }
[data-markdown] li { margin: .2rem 0; }
[data-markdown] code {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  background: rgba(37,35,33,.06);
  padding: .15rem .35rem;
  border-radius: 4px;
  font-size: .9em;
}
[data-markdown] pre {
  background: var(--charcoal);
  color: var(--peach);
  border-radius: 6px;
  padding: .65rem .8rem;
  overflow-x: auto;
  font-size: .9rem;
  margin: .6rem 0;
}
[data-markdown] pre code { background: none; padding: 0; color: inherit; }
[data-markdown] blockquote {
  border-left: 3px solid var(--border);
  margin: .5rem 0;
  padding: .35rem .75rem;
  color: var(--muted);
}
[data-markdown] a { color: var(--copper); }
[data-markdown] strong { font-weight: 650; }
[data-markdown] hr { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }
[data-markdown] table { border-collapse: collapse; margin: .5rem 0; width: 100%; }
[data-markdown] th, [data-markdown] td { border: 1px solid var(--border); padding: .35rem .6rem; text-align: left; font-size: .95rem; }
[data-markdown] th { background: rgba(37,35,33,.04); font-weight: 650; }

.card-body-preview {
  font-size: .95rem;
  color: var(--graphite);
  line-height: 1.5;
}
.card-body-preview h1, .card-body-preview h2, .card-body-preview h3 {
  margin: .3rem 0 .2rem;
  font-size: 1rem;
}
.card-body-preview p { margin: .2rem 0; }
.card-body-preview ul, .card-body-preview ol { padding-left: 1.2rem; margin: .2rem 0; }

/* Markdown editor */
.md-editor { position: relative; }
.md-editor textarea.md-editor-source { min-height: 12rem; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .92rem; }

.md-editor-toolbar {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  padding: .35rem;
  background: rgba(255,255,255,.6);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}

.md-btn {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255,255,255,.7);
  color: var(--graphite);
  padding: .35rem .55rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.1;
  min-height: 2rem;
  min-width: 2rem;
  text-align: center;
}
.md-btn:hover { background: var(--hover); border-color: var(--amber); }
.md-preview-toggle { margin-left: auto; color: var(--copper); }

.md-editor-preview {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .75rem;
  background: rgba(255,255,255,.5);
  min-height: 6rem;
  margin-top: .35rem;
}

.md-field-toggle {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.md-field-toggle .md-preview-toggle { margin-left: 0; }
