/* community-spaces.css — Community → Spaces (js/community-spaces.js).
 *
 * App-shell tokens only, no raw hex. Everything is scoped under #route-spaces
 * so nothing here can reach another screen; the tab strip, tiles and rows are
 * the course page's own .cpg-* rules (css/course-page.css), reused by wrapping
 * the space view in .cpg-page. Mobile first; the desktop block is at the end.
 * Approved design: docs/projects/dau-50/spaces-design/.
 */

#route-spaces .pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap;
}
#route-spaces .p-good { background: var(--good-soft); color: var(--good); }
#route-spaces .p-acc  { background: var(--accent-soft); color: var(--accent-deep); }
#route-spaces .p-warn { background: var(--warn-soft); color: var(--warn); }
#route-spaces .p-mut  { background: var(--surface-3); color: var(--text-2); }
#route-spaces .sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
#route-spaces .csp-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; }
#route-spaces .csp-ico {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  background: var(--accent-softer); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
}
#route-spaces .csp-lbl {
  display: block; margin: 0 0 8px;
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3);
}
#route-spaces .csp-meta { color: var(--text-3); font-size: 13px; }
#route-spaces .csp-hint { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); line-height: 1.5; }
#route-spaces .csp-none { padding: 16px 22px; color: var(--text-3); font-size: 13.5px; line-height: 1.55; }

/* ── The list ─────────────────────────────────────────────────────── */
#route-spaces .csp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#route-spaces .csp-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden; min-width: 0;
}
#route-spaces .csp-card-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
#route-spaces .csp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
#route-spaces .csp-kind {
  font-family: "JetBrains Mono", monospace; font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3);
}
#route-spaces .csp-card-name {
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 19px; line-height: 1.25;
  margin: 4px 0 0; overflow-wrap: anywhere;
}
#route-spaces .csp-card-foot {
  border-top: 1px solid var(--border-soft); padding: 12px 20px; font-size: 13.5px;
  display: flex; justify-content: flex-end;
}
#route-spaces .csp-card-foot a { font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
#route-spaces .csp-card-new {
  border-style: dashed; background: var(--surface-2); align-items: center; justify-content: center;
  gap: 10px; min-height: 200px; cursor: pointer; color: var(--text-2); font: inherit;
}
#route-spaces .csp-new-label { font-weight: 600; }
#route-spaces .csp-empty {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 32px 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 620px;
}
#route-spaces .csp-empty h2 { font-family: "Bricolage Grotesque", sans-serif; font-size: 20px; margin: 0; }
#route-spaces .csp-empty p { margin: 0; color: var(--text-2); line-height: 1.55; }

/* ── New space ────────────────────────────────────────────────────── */
#route-spaces .csp-kinds { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 22px; }
#route-spaces .csp-kind-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 10px;
  font: inherit; color: var(--text); cursor: pointer; min-height: 44px;
}
#route-spaces .csp-kind-tile.on { border: 2px solid var(--accent); box-shadow: 0 6px 20px -8px var(--accent); }
#route-spaces .csp-kind-name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 17px; }
#route-spaces .csp-kind-desc { color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
#route-spaces .csp-chips { display: flex; gap: 6px; flex-wrap: wrap; }
#route-spaces .csp-new-form { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
#route-spaces .csp-field { display: block; min-width: 0; }
#route-spaces .csp-field input[type="text"],
#route-spaces .csp-field select,
#route-spaces .csp-field textarea {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface);
  color: var(--text); font: inherit; font-size: 14px;
}
#route-spaces .csp-field textarea { resize: vertical; line-height: 1.5; }
#route-spaces .csp-field input:focus,
#route-spaces .csp-field select:focus,
#route-spaces .csp-field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-softer); }
#route-spaces .csp-new-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: flex-end; flex-wrap: wrap; }
#route-spaces .csp-field-inline { margin-right: auto; min-width: 180px; }
#route-spaces .csp-pad { padding: 0 20px 18px; justify-content: flex-start; }

/* ── One space ────────────────────────────────────────────────────── */
#route-spaces .csp-head-tags { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
/* 991: Draft / Live, and Publish it with the ••• menu at the top right (the funnel home's places). */
#route-spaces .csp-head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#route-spaces .csp-live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
#route-spaces .csp-more { position: relative; }
#route-spaces .csp-more-btn { min-width: 44px; justify-content: center; letter-spacing: 1px; }
#route-spaces .csp-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 180px;
  display: grid; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px -8px var(--text); }
#route-spaces .csp-menu[hidden] { display: none; }
#route-spaces .csp-menu button { border: 0; background: transparent; text-align: left; padding: 9px 10px; border-radius: 8px;
  font: inherit; font-size: 14px; color: var(--text); cursor: pointer; min-height: 40px; }
#route-spaces .csp-menu button:hover, #route-spaces .csp-menu button:focus-visible { background: var(--surface-3); }
#route-spaces .csp-menu-sep { height: 1px; background: var(--border); margin: 4px 0; }
#route-spaces .csp-card-pills { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
#route-spaces .csp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#route-spaces .csp-tile-small { font-size: 18px; }
#route-spaces .csp-steps { padding: 4px 20px; }
/* Robert and Anne, round 4: a plan from Maya waiting on Edit lessons. */
#route-spaces .csp-waiting { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 12px 0 2px; padding: 12px 14px; border-radius: 10px; background: var(--accent-softer); color: var(--text-1, inherit); }
#route-spaces .csp-waiting-t { flex: 1 1 220px; font-size: 14px; line-height: 1.5; font-weight: 600; }
#route-spaces .csp-steps .cpg-item { align-items: center; }
#route-spaces .csp-check {
  width: 22px; height: 22px; flex: 0 0 22px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center;
}
#route-spaces .csp-check.done { background: var(--good); border-color: var(--good); color: var(--surface); }
#route-spaces .csp-done { color: var(--text-3); text-decoration: line-through; }
#route-spaces .card { margin-bottom: 16px; }
#route-spaces .csp-posts { padding: 4px 20px; }
#route-spaces .csp-post .cpg-item-body { min-width: 0; }
/* The post's ••• menu, top right of the item (cb-actions.js; edit/delete review 2026-10-08). */
#route-spaces .csp-post { position: relative; }
#route-spaces .csp-post-menu { position: absolute; top: 10px; right: 10px; }
#route-spaces .csp-post .cpg-item-body { padding-right: 40px; }
#route-spaces .csp-post-body { margin-top: 6px; color: var(--text-2); font-size: 14px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere;
  max-height: 13.5em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, #000 75%, transparent); mask-image: linear-gradient(to bottom, #000 75%, transparent); }
/* F19: rendered posts carry their own paragraphs; pre-wrap would double them. */
#route-spaces .csp-post-body.csp-post-html { white-space: normal; }
/* N2: Read it all, Edit and Delete sit together, wrapping on a phone. */
#route-spaces .csp-post-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#route-spaces .csp-post-html > :first-child { margin-top: 0; }
#route-spaces .csp-post-html p, #route-spaces .csp-post-html ul, #route-spaces .csp-post-html ol { margin: 0 0 8px; }
#route-spaces .csp-post-html ul, #route-spaces .csp-post-html ol { padding-left: 20px; }
#route-spaces .csp-post-html a { color: var(--accent); }
/* F19: on a phone the post takes the full width and its buttons go under it
   (the buttons beside it squeezed the text into half the card). */
@media (max-width: 699px) {
  #route-spaces .csp-post { flex-wrap: wrap; }
  #route-spaces .csp-post .cpg-item-body { flex: 1 1 100%; }
}
/* N4 / N2 (round 4): the Game tab's list sits inside the card's padding like
   every other list here, and an open game says when its posts wait on the coach. */
#route-spaces .csp-games .cpg-item-body { min-width: 0; flex: 1 1 auto; }
#route-spaces .csp-game-posts:empty { display: none; }
#route-spaces div.csp-game-wait { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px;   /* P12: on the kit tokens */
  padding: 8px 12px; border-radius: 10px; background: var(--fh-warn-soft, var(--warn-soft)); color: var(--fh-text, var(--text)); font-size: 13.5px; line-height: 1.45; }
#route-spaces .csp-post.csp-game-wait { margin-top: 0; padding: 14px 0; background: none; border-radius: 0; }
#route-spaces .csp-game-wait > span { flex: 1 1 220px; }
@media (max-width: 699px) {
  #route-spaces .csp-games .csp-game { flex-wrap: wrap; row-gap: 10px; }
  #route-spaces .csp-games .csp-game .cpg-item-body { flex: 1 1 100%; }
}
/* N2 (Robert, round 4): another product that still sells this space. */
#route-spaces .csp-also { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
#route-spaces .csp-also-row { padding: 10px 0 0; align-items: center; flex-wrap: wrap; row-gap: 8px; }
#route-spaces .csp-also-row .cpg-item-body { flex: 1 1 220px; min-width: 0; }
#route-spaces .csp-also-row .cpg-item-title { overflow-wrap: anywhere; }
/* Round 4 D: on a phone the header's "Start a live call" goes under the title
   rather than squeezing a two-word name onto two lines. */
@media (max-width: 699px) {
  #route-spaces .cpg-page > .page-head { flex-wrap: wrap; row-gap: 12px; }
  #route-spaces .cpg-page > .page-head > div:first-child { flex: 1 1 100%; min-width: 0; }
}
/* F6: the currency sign inside the price box. */
#route-spaces .csp-money { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); overflow: hidden; }
#route-spaces .csp-money:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-softer); }
#route-spaces .csp-money-sym { display: flex; align-items: center; padding: 0 10px; background: var(--surface-2); color: var(--text-2); font-weight: 600; border-right: 1px solid var(--border); }
#route-spaces .csp-field .csp-money input[type="text"] { border: 0; border-radius: 0; flex: 1; min-width: 0; box-shadow: none; }
#route-spaces .csp-mini-select {
  min-height: 36px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  font: inherit; font-size: 13px; padding: 0 8px; max-width: 150px;
}
#route-spaces .csp-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#route-spaces .csp-two .card { margin: 0; }
#route-spaces .csp-two .card + .card { margin-top: 0; }
#route-spaces .csp-toggle-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
#route-spaces .csp-switch { position: relative; display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
#route-spaces .csp-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
#route-spaces .csp-switch span:first-of-type {
  width: 40px; height: 24px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background .15s;
}
#route-spaces .csp-switch span:first-of-type::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); transition: left .15s;
}
#route-spaces .csp-switch input:checked + span { background: var(--accent); }
#route-spaces .csp-switch input:checked + span::after { left: 19px; }
#route-spaces .csp-switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-softer); }
#route-spaces .csp-danger .card-title { color: var(--danger); }
/* The working-group picker lives in a CBSheet panel (outside #route-spaces). */
.csp-pick { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.csp-pick input { width: 20px; height: 20px; flex: 0 0 20px; }
.csp-pick .csp-meta { color: var(--text-3); font-size: 12.5px; }
/* R4-3: Add people, invite by email, and the check before sending (CBSheet panels). */
.csp-add-help { color: var(--text-3); font-size: 13px; line-height: 1.5; margin: 6px 0 4px; }
.csp-add-or { margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border-soft); font-size: 13px; font-weight: 600; color: var(--text-2); }
.csp-inv-group { margin: 0 0 16px; }
.csp-inv-group .csp-meta { color: var(--text-3); font-size: 13px; line-height: 1.5; margin: 2px 0 6px; }
.csp-inv-head { font-size: 14px; font-weight: 600; color: var(--text); }
.csp-inv-head .count { color: var(--text-3); font-weight: 500; margin-left: 4px; }
.csp-inv-list { margin: 4px 0 0; padding: 0; list-style: none; }
.csp-inv-list li { padding: 6px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; overflow-wrap: anywhere; }
.csp-inv-mail { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px; margin: 6px 0; background: var(--surface-2); }
.csp-inv-subj { font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.csp-inv-body { font-size: 13.5px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
#route-spaces .csp-privacy { color: var(--text-3); font-size: 12.5px; border-top: 1px solid var(--border-soft); }

/* ── Access & selling (S5; spaces-design/project/SpaceAccess.dc.html) ── */
#route-spaces .csp-seg {
  display: inline-flex; flex-wrap: wrap; align-self: flex-start; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: 10px; max-width: 100%;
}
#route-spaces .csp-seg button {
  border: 0; background: transparent; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500;
  min-height: 36px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  flex: 1 1 auto; white-space: nowrap;
}
#route-spaces .csp-seg button.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px var(--border-strong); }
#route-spaces .csp-seg button:disabled { cursor: default; }
#route-spaces .csp-seg button:disabled:not(.on) { color: var(--text-3); }
#route-spaces .csp-seg button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-softer); }
#route-spaces .csp-grid2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#route-spaces .csp-grid2 > .csp-field-wide { grid-column: 1 / -1; }
#route-spaces .csp-pick-now { display: block; margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
#route-spaces .csp-pick-now b { color: var(--text); font-weight: 600; }
/* R4-M14: while a new price is set, what people pay reads as a sentence, not a box. */
#route-spaces .csp-newprice-sum { margin: 0 0 4px; font-size: 15px; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
#route-spaces .csp-newprice-sum .csp-lbl { display: block; margin-bottom: 2px; }
#route-spaces .csp-newprice-sum #csp-pricebox { color: var(--text); font-weight: 700; }
/* R4-M15: the price at rest, the same sentence style; its amount stands out, nothing looks typeable. */
#route-spaces .csp-newprice-sum b { color: var(--text); font-weight: 700; }
#route-spaces .csp-fieldbox {
  border: 1px solid var(--border); border-radius: 10px; padding: 0 14px; min-height: 44px; box-sizing: border-box;
  display: flex; align-items: center; font-size: 14px; background: var(--surface); color: var(--text);
}
#route-spaces .csp-newprod {
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px;
  border: 1px dashed var(--border-strong); border-radius: 14px;
}
/* N3: why "Make the product" did not make it, beside the button. Empty takes no room. */
#route-spaces .csp-np-err { margin: 0; font-size: 14px; line-height: 1.5; color: var(--danger); font-weight: 600; }
#route-spaces .csp-np-err:empty { display: none; }
#route-spaces .csp-lead { font-size: 13px; line-height: 1.55; padding: 0; }
#route-spaces .csp-note {
  font-size: 13px; line-height: 1.5; padding: 10px 12px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn);
}
#route-spaces .csp-funnels {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
}
#route-spaces .csp-frow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
#route-spaces .csp-fico {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  background: var(--accent-softer); color: var(--accent); display: flex; align-items: center; justify-content: center;
}
#route-spaces .csp-fbody { flex: 1 1 160px; min-width: 0; }
#route-spaces .csp-fbody .cpg-item-title { overflow-wrap: anywhere; }
#route-spaces .csp-factions { display: flex; gap: 8px; flex-wrap: wrap; }
#route-spaces .csp-factions .btn { min-height: 36px; }
#route-spaces .csp-card .csp-lead, #route-spaces .card > .csp-lead { padding: 14px 22px 0; }

@media (min-width: 700px) {
  #route-spaces .csp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #route-spaces .csp-kinds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #route-spaces .csp-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #route-spaces .csp-grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  #route-spaces .csp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #route-spaces .csp-kinds { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #route-spaces .csp-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* A path of spaces, round 3: a number inside a check ("Came to 3 of its live
   sessions"), the business checks' sub-heading, and why a finish line cannot be met. */
.csp-pick input.csp-path-n { width: 64px; flex: 0 0 64px; height: 32px; margin: 0 4px; padding: 2px 6px; font: inherit; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); }
#route-spaces .csp-path-sub { margin-top: 14px; }
#route-spaces .csp-hint.csp-warn { color: var(--warn); font-weight: 500; }

/* Two buttons in one card head (Working groups: make groups for everyone, or one). */
#route-spaces .csp-head-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }

/* Round 3: "Connect Stripe first", said before the product form. */
#route-spaces .csp-stripe-first { border: 1px solid var(--border-soft); border-radius: 12px; padding: 14px 16px; margin: 12px 0; background: var(--surface-2); }
/* Spaces round 4 (R4-1): the plain step before Stripe, and what came back. */
#route-spaces .csp-sf-p { margin: 8px 0 0; font-size: 14px; line-height: 1.55; color: var(--text-2); }
#route-spaces .csp-sf-p b { color: var(--text); }
#route-spaces .csp-sf-h { margin: 14px 0 4px; font-size: 14px; font-weight: 600; color: var(--text); }
#route-spaces .csp-sf-asks { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
#route-spaces .csp-sf-asks li { margin: 6px 0; }
#route-spaces .csp-sf-asks b { color: var(--text); font-weight: 600; }
#route-spaces .csp-sf-state { margin: 12px 0; padding: 12px 14px; border-radius: 10px; font-size: 14px; line-height: 1.55;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); }
#route-spaces .csp-sf-ok { background: var(--good-soft, #ecfdf5); border-color: transparent; }
#route-spaces .csp-sf-warn { background: var(--warn-soft); border-color: transparent; }
#route-spaces .csp-sf-due { margin: 6px 0; padding-left: 20px; }
/* R4-2: what a sale means, beside the price. */
#route-spaces .csp-moneybox { margin: 12px 0 4px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border-soft); background: var(--surface-2); }
#route-spaces .csp-mb-h { margin: 10px 0 2px; font-size: 13px; font-weight: 600; color: var(--text); }
#route-spaces .csp-mb-h:first-child { margin-top: 0; }
#route-spaces .csp-mb-big { font-size: 15px; line-height: 1.45; color: var(--text); }
#route-spaces .csp-mb-row { font-size: 13px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
#route-spaces .csp-mb-soft { margin-top: 2px; }
.csp-pick.csp-pick-all { font-weight: 600; }

/* "Getting started for new members" on a space's Overview (space-getting-started.js,
   design D2: docs/projects/dau-50/space-onboarding-design.html). P12 (28 Oct 2026): the card, its rows, the order
   switch and the buttons are the course home's kit; the grip beside a step and the two sheets (Edit a step, Who's
   stuck, which are CBSheets outside the page) keep these rules. */
#route-spaces .csg-lead { margin: 0; }
#route-spaces .csg-step .csg-body { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
#route-spaces .csg-step .csg-body > div { min-width: 0; }
.csg-grip { color: var(--fh-text-3, var(--text-3)); font-size: 14px; line-height: 20px; cursor: grab; user-select: none; }
.csg-stuck { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px 0; border-top: 1px solid var(--border-soft); }
.csg-stuck:first-child { border-top: 0; }
.csg-stuck .csg-body { min-width: 0; }
.csg-stuck .csg-title { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.csg-stuck .csg-how { margin-top: 2px; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.csg-btn { min-height: 44px; }
.csg-sheet-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

/* Round 4 (F20): the Members list on a phone. A member's row put the name beside
   the cohort picker, Move and Remove, so a long name or an email (an imported
   member with no name) was squeezed to one letter a line. On a phone the name
   takes the whole first line and the controls wrap under it. */
@media (max-width: 640px) {
  #route-spaces #csp-members .cpg-item { flex-wrap: wrap; row-gap: 8px; }
  #route-spaces #csp-members .cpg-item-body { flex: 1 1 100%; min-width: 0; }
  #route-spaces #csp-members .cpg-item-title,
  #route-spaces #csp-members .cpg-item-meta { overflow-wrap: anywhere; }
  /* The rows are the course home's .ch-row now (words | controls). At 390 a member's email ran on under Move and
     Remove (the dev walk of 29 Oct, mirror space 360): the words take the first line and the controls go under them. */
  #route-spaces #csp-members > .ch-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  #route-spaces #csp-members > .ch-row .ch-row-acts { flex-wrap: wrap; }
}
/* An email has nowhere to break, so it breaks anywhere rather than running under the buttons beside it. */
#route-spaces #csp-members > .ch-row small { overflow-wrap: anywhere; }

/* R4-11 / R4-12: planned lessons and "Write all lessons" on the Content tab. */
#route-spaces .csp-planned .cpg-item-title { color: var(--text-2, #4d5168); }
#route-spaces .csp-writeall { margin: 10px 0 4px; padding: 12px 14px; border-radius: 12px; background: var(--accent-softer); display: flex; flex-direction: column; gap: 10px; }
#route-spaces .csp-writeall-t { font-size: 14px; line-height: 1.5; color: var(--text-1, #15172b); }
#route-spaces .csp-writeall .csp-new-actions { flex-wrap: wrap; gap: 8px; }
#route-spaces .csp-writeall-bar { height: 8px; border-radius: 999px; background: var(--border, #e4dcff); overflow: hidden; }
#route-spaces .csp-writeall-bar span { display: block; height: 100%; background: var(--accent, #6a4cf1); border-radius: 999px; transition: width .4s ease; }
#route-spaces .card-title .count { white-space: nowrap; }
/* NB2: the note after invitations go, kept until the coach moves on. */
.csp-invdone { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 4px; padding: 12px 14px; border-radius: 10px; background: var(--good-soft, #ecfdf5); color: var(--good, #047857); font-size: 14px; line-height: 1.5; }
.csp-invdone b { font-weight: 600; }
.csp-invdone-bad { background: var(--warn-soft, #fffbeb); color: var(--warn, #92400e); }
/* Tyre-kicker round 1 (builder S). TK-17: the setup list leads the Overview; its
   first open step is the one next step, and the cards after it are quieter. */
#route-spaces .csp-setup .csp-next { background: var(--accent-soft, #f5f3ff); border-radius: 10px; margin: 4px -12px; padding-left: 12px; padding-right: 12px; }
/* The Spaces list: each space's next step, read from the list (spaces home, G1). */
#route-spaces .csp-card-next { font-size: 14px; color: var(--text); line-height: 1.45; }
#route-spaces .csp-card-next .csp-next-tag { display: inline; margin-right: 4px; }
#route-spaces .csp-home-tabs { margin-bottom: 20px; }
#route-spaces .csp-next-tag { font-size: 12px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); margin-bottom: 2px; }
#route-spaces .csp-ov-rest .btn-primary { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
#route-spaces .csp-ov-rest .btn-primary:hover { background: var(--surface-2); }
/* TK-5: what a quick change saved, with Undo beside it. */
#route-spaces .csp-acc-said { margin-top: 8px; font-size: 14px; color: var(--text-2); }
#route-spaces .csp-linkbtn { background: none; border: none; padding: 0 2px; min-height: 0; color: var(--accent); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
/* TK-6: no course yet, said instead of an empty picker. */
#route-spaces .csp-nocourse { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; line-height: 1.5; color: var(--text-2); }
#route-spaces .csp-nocourse b { color: var(--text); }
/* TK-10: the price before Stripe, and the one step left. */
#route-spaces .csp-draftform, #route-spaces .csp-draftprice { margin-bottom: 14px; }
#route-spaces .csp-draft-next { margin: 6px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
#route-spaces .csp-draft-next b { color: var(--text); }
/* Archived spaces at the foot of the list, each with Restore (R9-UI, 3 Oct). */
#route-spaces .csp-arch { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
#route-spaces .csp-arch-h { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--text); }
#route-spaces .csp-arch-sub { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
#route-spaces .csp-arch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
#route-spaces .csp-arch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
#route-spaces .csp-arch-body { min-width: 0; flex: 1 1 180px; }
#route-spaces .csp-arch-name { font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
#route-spaces .csp-arch-meta { margin-top: 2px; font-size: 13px; color: var(--text-2); }
#route-spaces .csp-arch-row .csp-btn { min-height: 44px; }

/* Cover picture (design polish, 3 Oct 2026): the space's card picture on the member Spaces page. */
.csp-cover-prev { aspect-ratio: 16 / 7; max-width: 520px; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; text-align: center; padding: 0 16px; background: linear-gradient(135deg, var(--accent-softer), var(--surface-2)); color: var(--text-2); font-size: 14px; }
.csp-cover-prev.csp-cover-has { padding: 0; background: var(--surface-2); }
.csp-cover-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
#route-spaces .csp-card-cover { aspect-ratio: 16 / 6; overflow: hidden; background: var(--surface-2); }
#route-spaces .csp-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Review 3, UX3-18: with no picture, the preview shows the host's photo, as members see it. */
.csp-cover-prev:not(.csp-cover-has) { flex-direction: column; gap: 10px; }
.csp-cover-prev img.csp-cover-host { width: 72px; height: 72px; border-radius: 50%; flex: none; border: 3px solid var(--surface); }
/* Archived cohorts and working groups, with Bring it back (edit/delete Phase 2). */
#route-spaces .csp-archived { margin: 6px 16px 14px; font-size: 14px; color: var(--text-2); }
#route-spaces .csp-archived > summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
#route-spaces .csp-archived .cpg-item { padding-left: 0; padding-right: 0; }

/* The ••• on a space card (cb-actions.js, edit/delete standard): top right, always shown. */
.csp-card-top { position: relative; }
.csp-card-more { margin-left: auto; }
.csp-card-more .cba-dots { margin: 0; }

/* Getting started: the order members take the steps in (any, or each unlocks the next). */

/* 1199: "Show this space on your community home?" on the New space form (plain radios, 44px rows). */
#route-spaces .csp-home-q { border: 0; padding: 0; margin: 0; min-width: 0; }
#route-spaces .csp-home-q legend { padding: 0; }
#route-spaces .csp-radio { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; cursor: pointer; }
#route-spaces .csp-radio input { width: 18px; height: 18px; margin: 0; flex: none; }

/* ── Build 3: the space home that follows the guide's steps (js/community-spaces.js _stepTabs, HOME-STEPS.md) ──
   ONE row of twelve tabs. On a desktop it is today's strip with tighter spacing, so the row, and the first card under
   it, fit at 1440 without wrapping; a narrower window wraps rather than hiding a tab. On a phone it is one line that
   scrolls sideways inside itself (course-home.css's phone rule), so the first card is still on screen. Every parent
   of an .sr-only is positioned, so a step mark at the far end of a scrolling row never widens the page. */
#route-spaces .csp-steps-tabs .cpg-tab { position: relative; white-space: nowrap; }
#route-spaces .csp-tabst { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }
#route-spaces .csp-tabst.ok { background: var(--good-soft); color: var(--good); }
#route-spaces .csp-tabst.warn { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 699px) {
  #route-spaces .csp-steps-tabs {
    display: flex; flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%;
  }
  #route-spaces .csp-steps-tabs::-webkit-scrollbar { display: none; }
  #route-spaces .csp-steps-tabs .cpg-tab { flex: 0 0 auto; padding: 6px 12px; }
}
@media (min-width: 700px) {
  #route-spaces .csp-steps-tabs { gap: 2px; }
  #route-spaces .csp-steps-tabs .cpg-tab { padding: 8px 10px; }
}
/* A composed tab: each of today's cards in its own section, spaced as they always were (.card's margin). */
#route-spaces .csp-sec:empty, #route-spaces .csp-part:empty { display: none; }
/* The six steps on the Overview: today's setup rows, each with Change. */
#route-spaces .csp-sixsteps .cpg-item-title .csp-tabst { margin-left: 6px; vertical-align: 1px; }
/* Concept, Work, How it runs: a read-only answer under its small label. */
#route-spaces .csp-sum .cpg-item-title { overflow-wrap: anywhere; }
/* A tab with nothing on it yet. */
#route-spaces .csp-emptytab .csp-none { text-align: center; padding: 28px 22px; }

/* P12: a column with nothing drawn in it takes no room, so a tab's first card sits where the course home's does
   (the body's own padding, never that plus an empty column's gap). */
#route-spaces .csp-home .fh-col > div:empty,
#route-spaces .csp-home .fh-col > section:empty,
#route-spaces .csp-home .fh-col > :is(div, section):has(> div:empty):not(:has(> :not(div:empty))) { display: none; }
#route-spaces #csp-pane:empty,
#route-spaces #csp-tab-parts-top:not(:has(> :not(:empty))),
#route-spaces #csp-tab-parts:not(:has(> :not(:empty))) { display: none; }

/* P12: "Who can get in" has five choices, so it wraps inside its card as the course home's own long choice row does
   (course-home.css .ch-stu-bar .fh-seg), instead of pushing the card wider than a phone. */
#route-spaces .csp-acc-seg { flex-wrap: wrap; max-width: 100%; }
@media (max-width: 640px) { #route-spaces .csp-acc-seg button { padding: 6px 9px; font-size: 13px; } }

/* Getting started's "Members do the steps" and its two choices: the choices go under the words when the card is too
   narrow for both on one line. On a phone (the dev walk of 29 Oct, 390 wide) the grid's auto column held the choices
   wider than the card, and they sat on top of the words ("Members d… th… steps"). */
#route-spaces .ch .csg-order { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; }
#route-spaces .csg-order .ch-row-acts { max-width: 100%; }
#route-spaces .csg-order .fh-seg { flex-wrap: wrap; max-width: 100%; }

/* ── The Fill home: a draft's Overview (Concept · Shape · Fill, 29 Oct; the approved board Finish.dc.html) ──
   The board's card: the words and the five parts on the left, Maya beside them, the line and Publish across the foot.
   Its colours are the course home's own tokens (the marks: good and warn; Maya: accent soft). On a phone Maya goes
   under the parts and the foot stacks, Publish full width. */
#route-spaces .csp-fill { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 28px 32px; padding: 30px 36px; border-radius: 20px; }
#route-spaces .csp-fill.csp-fill-solo { grid-template-columns: minmax(0, 1fr); }
#route-spaces .csp-fill-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#route-spaces .csp-fill-eyebrow { font-family: var(--fh-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fh-text-3); }
#route-spaces .csp-fill .csp-fill-h { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 34px; line-height: 1.12; letter-spacing: -.01em; margin: 0; }
#route-spaces .csp-fill-lede { margin: 0; font-size: 16px; color: var(--fh-text-2); }
#route-spaces .csp-fill-rows { display: flex; flex-direction: column; }
#route-spaces .csp-fill-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--fh-border); }
#route-spaces .csp-fill-mark { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
#route-spaces .csp-fill-mark.ok { background: var(--fh-good-soft); color: var(--fh-good); }
#route-spaces .csp-fill-mark.todo { background: var(--fh-warn-soft); color: var(--fh-warn); }
#route-spaces .csp-fill-mark.skip { background: var(--fh-surface-3); }
#route-spaces .csp-fill-t { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#route-spaces .csp-fill-t b { font-size: 16px; }
#route-spaces .csp-fill-t small { font-size: 14px; color: var(--fh-text-2); overflow-wrap: anywhere; }
#route-spaces .csp-fill-row .fh-btn { min-height: 44px; padding: 8px 16px; font-size: 14px; }
#route-spaces .csp-fill-maya { align-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px; border-radius: 16px; background: var(--fh-accent-soft); }
#route-spaces .csp-fill-maya b { font-size: 14px; }
#route-spaces .csp-fill-maya p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--fh-text-2); }
#route-spaces .csp-fill-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding-top: 18px; border-top: 1px solid var(--fh-border); }
#route-spaces .csp-fill-foot > span { flex: 1; font-size: 14px; color: var(--fh-text-3); }
#route-spaces .csp-fill-foot .fh-btn.primary { min-height: 48px; padding: 12px 22px; font-size: 16px; border-radius: 12px; }
@media (max-width: 760px) {
  #route-spaces .csp-fill { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; gap: 20px; }
  #route-spaces .csp-fill .csp-fill-h { font-size: 28px; }
  #route-spaces .csp-fill-row { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; }
  #route-spaces .csp-fill-row .fh-btn { padding: 8px 12px; }
  #route-spaces .csp-fill-foot { flex-direction: column; align-items: stretch; }
  #route-spaces .csp-fill-foot .fh-btn.primary { justify-content: center; }
}

/* Messages: Alex's two choices for each message (29 Oct, Messages.dc.html), full sentences, side by side as the board
   draws them, one under the other on a phone. The chosen one carries the accent, as the board's does. */
#route-spaces .csp-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1 1 100%; min-width: 0; }
#route-spaces .csp-modes button { text-align: left; font-size: 14px; line-height: 1.4; padding: 10px 12px; min-height: 44px; border-radius: 12px; border: 2px solid var(--fh-border); background: var(--fh-surface); color: var(--fh-text); }
#route-spaces .csp-modes button[aria-checked="true"] { border-color: var(--fh-accent); background: var(--fh-accent-soft); }
@media (max-width: 640px) { #route-spaces .csp-modes { grid-template-columns: minmax(0, 1fr); } }

/* ── Presale (Alex, 29 Oct 2026; boards Presale.dc.html and Manage.dc.html) ──────────────────────────────────────────
   The publish sheet is the Shape's own sheet and cards (the Clips studio kit, .clstudio.cst-swap in #cb-sheet); these
   are only its list and its start date. "Still to make" leads a published program's Overview in the warm "to do" colour
   of the Fill home's marks, and a part already late says so a shade warmer. */
#cb-sheet .csp-ps-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
#cb-sheet .csp-ps-list li { font-size: 15px; color: #5d5566; overflow-wrap: anywhere; }
#cb-sheet .csp-ps-list li::before { content: "· "; }
#cb-sheet .csp-ps-start { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; background: #fff; border: 1px solid #ece7dd; border-radius: 12px; padding: 12px 16px; font-size: 15px; }
#cb-sheet .csp-ps-date { font-weight: 600; padding: 8px 12px; border: 1px solid #e3ded4; border-radius: 10px; }
#cb-sheet .csp-ps-start .csp-ps-change { min-height: 44px; }
#cb-sheet .csp-ps-pick .csp-ps-box { max-width: 280px; }
#cb-sheet .csp-ps-hint { margin: 6px 0 0; font-size: 14px; }
#cb-sheet .csp-ps-why { margin: 0; font-size: 14px; }
/* The sheet's own column (the studio sheet's gap), inside one wrapper so a phone can leave room under Maya's line. */
#cb-sheet .csp-ps { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The day it starts in words, under the browser's own date field (which writes it in the browser's order). */
#cb-sheet .csp-ps-long { margin: 8px 0 0; font-size: 15px; font-weight: 600; color: var(--fh-text, #1e1b2e); }
#route-spaces .fh-card.csp-stm { background: #FFF6E8; border: 1px solid #f1dcb8; border-radius: 16px; box-shadow: none; padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
#route-spaces .csp-stm h3 { font-size: 16px; color: #5c3a0a; margin: 0 0 4px; }
#route-spaces .csp-stm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 10px 0; border-top: 1px solid #f1dcb8; }
#route-spaces .csp-stm-what { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
#route-spaces .csp-stm-when { font-size: 14px; color: #5c3a0a; white-space: nowrap; }
#route-spaces .csp-stm-when.late { color: var(--fh-bad, #c2413b); font-weight: 600; }
#route-spaces .csp-stm .fh-btn.csp-stm-go { min-height: 44px; padding: 8px 14px; font-size: 14px; border-color: var(--fh-accent, #6a4cf1); color: var(--fh-accent-deep, #4a32b8); background: #fff; }
@media (max-width: 640px) {
  #route-spaces .csp-stm { padding: 16px; }
  #route-spaces .csp-stm-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; }
  #route-spaces .csp-stm-what { grid-column: 1 / -1; }
  #route-spaces .csp-stm-when { white-space: normal; }
}
@media (max-width: 640px) {
  #cb-sheet .csp-ps-start { gap: 8px 10px; padding: 10px 12px; font-size: 14px; }
  #cb-sheet .csp-ps-date { padding: 6px 8px; }
  /* At 390 the sheet's sticky button sat over Maya's last line (the 29 Oct walk, finding 17). */
  #cb-sheet .csp-ps { padding-bottom: 88px; }
}

/* A program's Lessons tab (the 29 Oct walk, finding 4): a lesson to make says "To make" and has Choose, which opens
   Shape, Lessons. The row keeps the course home's ladder (course-home.css .ch-lad.ch-les) with room for the button. */
#route-spaces .sct .ch-lad.ch-les.sct-tm { grid-template-columns: minmax(0, 240px) minmax(0, 1fr) auto; }
#route-spaces .sct .sct-tm .sct-lopen { grid-column: 2 / 3; }
#route-spaces .sct .sct-tm .sct-lact { grid-column: 3 / 4; justify-self: end; }
#route-spaces .sct .sct-choose { min-height: 36px; }
@media (max-width: 640px) {
  #route-spaces .sct .ch-lad.ch-les.sct-tm { grid-template-columns: minmax(0, 1fr) auto; }
  #route-spaces .sct .sct-tm > div:first-child { grid-column: 1 / -1; }
  #route-spaces .sct .sct-tm .sct-lopen { grid-column: 1 / 2; }
  #route-spaces .sct .sct-tm .sct-lact { grid-column: 2 / 3; }
}
/* Steps Maya wrote that wait for her check (finding 8): the course home's "waiting" box at the top of the milestones. */
#route-spaces .csp-steps-check { margin: 0 16px 12px; }

/* ⭐ THE TAB ROW ON A REAL iPHONE (walk 4, W5). On a touch screen app-shell.css gives every button on the community
   route a 44px minimum width (`@media (pointer: coarse) #page-community button`). That explicit minimum replaces a
   flex item's automatic one, so the row's buttons were free to shrink to 44px each and their words were drawn on top
   of each other ("Overview" over "Plan"). Chromium at 390 with a mouse never matches `pointer: coarse`, which is why
   only the iPhone showed it. Each tab keeps its own width, and the row scrolls sideways (course-home.css) or wraps
   (on a wider screen) instead. */
#route-spaces .csp-home .fh-tabs > button { flex: 0 0 auto; }

/* Manage's three figures at 390 (walk 4, W7): two columns left the third, the date of the first call, half a row, so
   "Wed 25 Nov" broke onto two lines. On a narrow screen the third figure has the whole row, and its value one line. */
@media (max-width: 900px) {
  #route-spaces .csp-home .fh-nums.csp-n3 > :nth-child(3) { grid-column: 1 / -1; }
  #route-spaces .csp-home .fh-nums.csp-n3 > :nth-child(3) .v { white-space: nowrap; overflow-wrap: normal; }
}
