/* Joint App Builder dashboard */

:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --text: #22201c;
  --muted: #6d675e;
  --line: #e4ded4;
  --brick: #b4532a;
  --brick-soft: #f6e3d9;
  --idea: #a67708;
  --idea-soft: #fbf0d3;
  --build: #b4532a;
  --build-soft: #f6e3d9;
  --done: #2f7d4f;
  --done-soft: #dcefe2;
  --karan: #2f5fb3;
  --karan-soft: #dfe8f8;
  --anuj: #8a3fa8;
  --anuj-soft: #efe1f5;
  --other: #5f5a52;
  --other-soft: #ebe7e0;
  --danger: #b3261e;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 2px 8px rgba(40, 30, 20, .05);
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171513;
    --surface: #211e1b;
    --surface-2: #1c1a17;
    --text: #ece7df;
    --muted: #a39b8f;
    --line: #36312b;
    --brick: #e07a4f;
    --brick-soft: #3a2519;
    --idea: #e2b23e;
    --idea-soft: #3a2f14;
    --build: #e07a4f;
    --build-soft: #3a2519;
    --done: #5cc185;
    --done-soft: #183224;
    --karan: #7fa6ef;
    --karan-soft: #1c2a44;
    --anuj: #cc8ae6;
    --anuj-soft: #34203d;
    --other: #b5ada2;
    --other-soft: #2e2a25;
    --danger: #ef7d74;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171513;
  --surface: #211e1b;
  --surface-2: #1c1a17;
  --text: #ece7df;
  --muted: #a39b8f;
  --line: #36312b;
  --brick: #e07a4f;
  --brick-soft: #3a2519;
  --idea: #e2b23e;
  --idea-soft: #3a2f14;
  --build: #e07a4f;
  --build-soft: #3a2519;
  --done: #5cc185;
  --done-soft: #183224;
  --karan: #7fa6ef;
  --karan-soft: #1c2a44;
  --anuj: #cc8ae6;
  --anuj-soft: #34203d;
  --other: #b5ada2;
  --other-soft: #2e2a25;
  --danger: #ef7d74;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brick); }

h1, h2, h3 { line-height: 1.25; margin: 0; }

button, input, textarea, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background:
    linear-gradient(var(--surface), var(--surface)) 6px 15px / 6px 4px no-repeat,
    linear-gradient(var(--surface), var(--surface)) 14px 15px / 6px 4px no-repeat,
    linear-gradient(var(--surface), var(--surface)) 10px 9px / 6px 4px no-repeat,
    var(--brick);
}

.tabs { display: flex; gap: 4px; overflow-x: auto; }

.tabs a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.tabs a:hover { color: var(--text); background: var(--surface); }

.tabs a[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-weight: 600;
}

.badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: 9px;
  background: var(--idea-soft);
  color: var(--idea);
  font-size: 12px;
  font-weight: 650;
  text-align: center;
}

.badge:empty { display: none; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

.sync::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--done);
  vertical-align: 1px;
}

.sync.is-error::before { background: var(--danger); }
.sync.is-busy::before { background: var(--idea); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-btn:hover { color: var(--text); }

/* ---------- Layout ---------- */

main { max-width: 1280px; margin: 0 auto; padding: 24px; }

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.view-head h1 { font-size: 22px; }
.view-head p { margin: 4px 0 0; color: var(--muted); }

.section-title {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 10px;
}

/* ---------- Board ---------- */

.board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.col {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  min-height: 180px;
}

.col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 12px;
}

.col-head h2 { font-size: 15px; }

.col-head .count {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.col-dot { width: 10px; height: 10px; border-radius: 3px; }
.col-ideas .col-dot { background: var(--idea); }
.col-building .col-dot { background: var(--build); }
.col-finished .col-dot { background: var(--done); }

.col-arrow { margin-left: auto; color: var(--muted); font-size: 13px; }

.col-body { display: grid; gap: 10px; }

.col-foot {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.col-foot:hover { color: var(--text); border-color: var(--muted); }

.empty {
  padding: 18px 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}

.card:hover { border-color: var(--muted); }
.card:focus-visible { outline: 2px solid var(--brick); outline-offset: 2px; }

.card h3 { font-size: 15px; margin: 6px 0 4px; }

.card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.card-links { display: flex; gap: 10px; margin-left: auto; }
.card-links a { font-size: 12px; font-weight: 600; text-decoration: none; }
.card-links a:hover { text-decoration: underline; }

.card.is-fresh { animation: glow 2.4s ease-out 3; border-color: var(--brick); }
.card.is-unseen::after {
  content: "New";
  position: absolute;
  top: -7px;
  right: 10px;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--brick);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

@keyframes glow {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--brick) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .card.is-fresh { animation: none; }
}

.pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .02em;
  background: var(--other-soft);
  color: var(--other);
}

.pill-raw, .pill-exploring { background: var(--idea-soft); color: var(--idea); }
.pill-accepted, .pill-building { background: var(--build-soft); color: var(--build); }
.pill-finished { background: var(--done-soft); color: var(--done); }
.pill-parked, .pill-rejected { background: var(--other-soft); color: var(--other); }

.topic { font-size: 12px; color: var(--muted); }

.who {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--other);
}

.who::before {
  content: attr(data-initial);
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--other-soft);
  font-size: 10px;
  font-weight: 700;
}

.who-karan { color: var(--karan); }
.who-karan::before { background: var(--karan-soft); }
.who-anuj { color: var(--anuj); }
.who-anuj::before { background: var(--anuj-soft); }

/* ---------- Activity ---------- */

.activity {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.activity li {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

.activity li:first-child { border-top: 0; }
.activity .what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity .what a { color: var(--text); text-decoration: none; }
.activity .what a:hover { text-decoration: underline; }
.activity .kind { color: var(--muted); }
.activity time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Lists (capture, threads) ---------- */

.list { display: grid; gap: 10px; }

.row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.row-main { flex: 1; min-width: 0; }
.row-main h3 { font-size: 15px; }
.row-main p { margin: 4px 0 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.row-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.row-actions { display: flex; gap: 8px; flex-shrink: 0; }

.row.is-clickable { cursor: pointer; }
.row.is-clickable:hover { border-color: var(--muted); }

/* ---------- Forms ---------- */

.panel {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.form { display: grid; gap: 10px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }

input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 9px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 400;
  color: var(--text);
}

textarea { min-height: 76px; resize: vertical; }

input:focus, textarea:focus, select:focus {
  outline: 2px solid color-mix(in srgb, var(--brick) 45%, transparent);
  border-color: var(--brick);
}

.capture-input { font-size: 17px; padding: 12px 14px; }

.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-hint { color: var(--muted); font-size: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  white-space: nowrap;
}

.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn-primary { background: var(--brick); border-color: var(--brick); color: #fff; }
.btn-primary:hover { filter: brightness(1.06); border-color: var(--brick); }
.btn-small { padding: 4px 10px; font-size: 13px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }

/* ---------- Ideas page ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.chip {
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
}

.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

/* ---------- Modal ---------- */

dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

dialog::backdrop { background: rgba(20, 15, 10, .45); }

.modal-inner { padding: 22px 24px 24px; }

.modal-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.modal-head h2 { font-size: 20px; flex: 1; }
.modal-close { font-size: 22px; line-height: 1; padding: 2px 8px; }

.modal-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.modal-actions {
  display: grid;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.banner {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--brick-soft);
  color: var(--brick);
  font-size: 13px;
  font-weight: 600;
}

/* ---------- Rendered markdown ---------- */

.prose { font-size: 15px; overflow-wrap: anywhere; }
.prose h2, .prose h3, .prose h4 { margin: 20px 0 8px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 16px; }
.prose h4 { font-size: 15px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .prose table { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 3px 0; }
.prose li.task { list-style: none; margin-left: -20px; }
.prose code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9em; }
.prose pre { padding: 12px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); overflow-x: auto; }
.prose pre code { padding: 0; border: 0; background: none; }
.prose blockquote { padding: 6px 14px; border-left: 3px solid var(--brick); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 6px 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.comment { padding: 12px 0; border-top: 1px solid var(--line); }
.comment-head { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Sign in ---------- */

.signin {
  max-width: 520px;
  margin: 8vh auto 0;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.signin .brand { margin-bottom: 18px; font-size: 18px; }
.signin h1 { font-size: 22px; margin-bottom: 6px; }
.signin > p { color: var(--muted); margin: 0 0 18px; }
.signin details { margin-top: 18px; font-size: 14px; }
.signin summary { cursor: pointer; font-weight: 600; }
.signin ol { padding-left: 20px; }
.signin li { margin: 6px 0; }
.error { color: var(--danger); font-size: 13px; font-weight: 600; }

/* ---------- Agreement ---------- */

.ag-status {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.ag-person {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ag-person-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ag-person-top .pill { margin-left: auto; }
.ag-person-foot { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.ag-meter { height: 6px; border-radius: 3px; background: var(--other-soft); overflow: hidden; }
.ag-meter > span { display: block; height: 100%; border-radius: inherit; background: var(--brick); transition: width .3s ease-out; }
.ag-person.is-karan .ag-meter > span { background: var(--karan); }
.ag-person.is-anuj .ag-meter > span { background: var(--anuj); }

.pill-submitted, .pill-agree { background: var(--done-soft); color: var(--done); }
.pill-progress, .pill-close { background: var(--idea-soft); color: var(--idea); }
.pill-differ { background: var(--build-soft); color: var(--build); }
.pill-notstarted, .pill-open, .pill-missing { background: var(--other-soft); color: var(--other); }

.ag-switch { margin-bottom: 18px; }
.ag-intro { max-width: 760px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }

.ag-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ag-nav { position: sticky; top: 72px; display: grid; gap: 2px; }

.ag-nav button {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.ag-nav button:hover { background: var(--surface); color: var(--text); }
.ag-nav .n { font-size: 12px; font-variant-numeric: tabular-nums; }
.ag-nav .is-done .n { color: var(--done); font-weight: 650; }

.ag-form { display: grid; gap: 4px; min-width: 0; }
.ag-section { display: grid; gap: 10px; scroll-margin-top: 76px; }
.ag-section .section-title { margin: 22px 0 2px; }
.ag-section:first-child .section-title { margin-top: 0; }

.ag-q, .ag-cmp {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.ag-q.is-answered { border-left-color: var(--done); }
.ag-cmp.is-agree { border-left-color: var(--done); }
.ag-cmp.is-close { border-left-color: var(--idea); }
.ag-cmp.is-differ { border-left-color: var(--build); }

.ag-q-head { display: flex; gap: 10px; align-items: baseline; }
.ag-q-head h3 { flex: 1; font-size: 15px; font-weight: 600; }
.ag-num { flex-shrink: 0; min-width: 22px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.ag-hint { font-size: 12px; color: var(--muted); white-space: nowrap; }

.ag-why, .ag-call, .ag-options, .ag-note, .ag-text, .ag-cmp-cols { margin-left: 32px; }
.ag-why { margin-top: 6px; margin-bottom: 0; font-size: 13px; color: var(--muted); }

.ag-call {
  margin-top: 8px;
  margin-bottom: 0;
  padding: 6px 10px;
  border-left: 3px solid var(--brick);
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  font-size: 13px;
  color: var(--muted);
}

.ag-call::before { content: "From the call · "; font-weight: 650; color: var(--brick); }

.ag-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.ag-opt { display: block; position: relative; font-size: 14px; font-weight: 500; color: var(--text); cursor: pointer; }
.ag-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: inherit; }

.ag-opt span {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  transition: background-color .15s, border-color .15s, color .15s;
}

.ag-opt:hover span { border-color: var(--muted); }
.ag-opt input:checked + span { background: var(--brick); border-color: var(--brick); color: #fff; }
.ag-opt input:focus-visible + span { outline: 2px solid var(--brick); outline-offset: 2px; }
.ag-opt input:disabled + span { cursor: default; }
.ag-opt input:disabled:not(:checked) + span { opacity: .55; }

.ag-opt input[type="checkbox"] + span::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 7px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  vertical-align: -1px;
  opacity: .55;
}

.ag-opt input[type="checkbox"]:checked + span::before {
  opacity: 1;
  background: #fff linear-gradient(var(--brick), var(--brick)) center / 6px 6px no-repeat;
  border-color: #fff;
}

.ag-text { display: block; width: calc(100% - 32px); margin-top: 12px; min-height: 60px; }

.ag-note { margin-top: 10px; font-size: 13px; }
.ag-note summary { display: inline-block; color: var(--muted); font-weight: 600; cursor: pointer; list-style: none; }
.ag-note summary::-webkit-details-marker { display: none; }
.ag-note summary:hover { color: var(--text); }
.ag-note textarea { display: block; margin-top: 8px; min-height: 56px; }

.ag-bar {
  position: sticky;
  bottom: 14px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin-top: 20px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(40, 30, 20, .12);
}

.ag-bar-progress { flex: 1; min-width: 200px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.ag-bar-progress strong, .ag-bar-text strong { color: var(--text); }
.ag-bar-text { flex: 1; min-width: 200px; font-size: 14px; color: var(--muted); }
.ag-unsaved { color: var(--brick); font-weight: 600; }

.ag-waiting h2 { font-size: 17px; margin-bottom: 6px; }
.ag-waiting p { margin: 0; color: var(--muted); }

.ag-summary { display: grid; gap: 10px; margin-bottom: 8px; }
.ag-summary strong { font-size: 16px; margin-right: 10px; }

.ag-cmp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.ag-ans {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}

.ag-ans.is-karan { border-top: 2px solid var(--karan); }
.ag-ans.is-anuj { border-top: 2px solid var(--anuj); }
.ag-ans p, .ag-ans ul { margin: 0; }
.ag-ans ul { padding-left: 18px; }
.ag-ans .shared { font-weight: 650; }
.ag-free, .ag-ans-note { white-space: pre-wrap; overflow-wrap: anywhere; }
.ag-ans-note { font-size: 13px; color: var(--muted); }
.ag-none { color: var(--muted); font-style: italic; }

.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 8px 24px;
  background: var(--idea-soft);
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
}

.demo-bar > span { margin-right: auto; }

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  display: grid;
  gap: 8px;
}

.toast {
  max-width: 340px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.toast.is-error { background: var(--danger); color: #fff; }

/* ---------- Small screens ---------- */

@media (max-width: 900px) {
  .board { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 16px; }
  .topbar-right { margin-left: 0; width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; }
  main { padding: 16px; }
  .ag-layout { grid-template-columns: 1fr; gap: 14px; }
  .ag-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; }
  .ag-nav button { flex-shrink: 0; white-space: nowrap; background: var(--surface); border: 1px solid var(--line); }
  .demo-bar { padding: 8px 16px; }
}

@media (max-width: 600px) {
  .ag-why, .ag-call, .ag-options, .ag-note, .ag-text, .ag-cmp-cols { margin-left: 0; }
  .ag-text { width: 100%; }
  .ag-cmp-cols { grid-template-columns: 1fr; }
  .ag-q, .ag-cmp { padding: 12px; }
  .ag-bar { bottom: 8px; }
}

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
  .activity li { grid-template-columns: 1fr auto; }
  .activity li .who { grid-column: 1 / -1; }
  .row { flex-direction: column; }
  .view-head { flex-direction: column; align-items: flex-start; }
  .modal-inner { padding: 18px 16px; }
}
