/* ============================================================
   Mission Control — styles
   Status colours are the validated status palette. Every status is
   rendered as icon + text label, never colour alone: the light-mode
   amber sits below 3:1 on the page surface by design, and the label
   is the mitigation. Do not strip the labels.
   ============================================================ */

:root {
  color-scheme: light;

  --surface:        #fcfcfb;   /* cards */
  --plane:          #f5f5f2;   /* page */
  --surface-sunk:   #f0efec;
  --ink:            #0b0b0b;
  --ink-2:          #52514e;
  --ink-muted:      #898781;
  --hair:           #e1e0d9;
  --hair-strong:    #cfcec6;

  --accent:         #2a78d6;
  --accent-soft:    #eaf2fd;

  /* status palette (fixed, never themed) */
  --st-live:        #0ca30c;
  --st-progress:    #2a78d6;
  --st-blocked:     #d03b3b;
  --st-confirm:     #fab219;
  --st-done:        #898781;

  --st-live-bg:     #e6f5e6;
  --st-progress-bg: #eaf2fd;
  --st-blocked-bg:  #fbe9e9;
  --st-confirm-bg:  #fdf3dd;
  --st-done-bg:     #efeeeb;

  --st-live-ink:     #06630a;
  --st-progress-ink: #184f95;
  --st-blocked-ink:  #8f1f1f;
  --st-confirm-ink:  #6b4600;
  --st-done-ink:     #52514e;

  --radius:   12px;
  --radius-s: 8px;
  --shadow:   0 1px 2px rgba(11,11,11,.05), 0 4px 14px rgba(11,11,11,.045);
  --shadow-lift: 0 2px 5px rgba(11,11,11,.07), 0 12px 30px rgba(11,11,11,.09);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface:      #1a1a19;
    --plane:        #0d0d0d;
    --surface-sunk: #232322;
    --ink:          #ffffff;
    --ink-2:        #c3c2b7;
    --ink-muted:    #898781;
    --hair:         #2c2c2a;
    --hair-strong:  #3d3d3a;

    --accent:       #3987e5;
    --accent-soft:  #16283d;

    --st-live:      #0ca30c;
    --st-progress:  #3987e5;
    --st-blocked:   #e05c5c;
    --st-confirm:   #fab219;
    --st-done:      #9d9b93;

    --st-live-bg:     #102a10;
    --st-progress-bg: #16283d;
    --st-blocked-bg:  #33191a;
    --st-confirm-bg:  #33280c;
    --st-done-bg:     #262624;

    --st-live-ink:     #7ede7e;
    --st-progress-ink: #9cc7f5;
    --st-blocked-ink:  #f3a9a9;
    --st-confirm-ink:  #fbd888;
    --st-done-ink:     #c3c2b7;

    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.32);
    --shadow-lift: 0 2px 5px rgba(0,0,0,.5), 0 12px 30px rgba(0,0,0,.45);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --surface:      #1a1a19;
  --plane:        #0d0d0d;
  --surface-sunk: #232322;
  --ink:          #ffffff;
  --ink-2:        #c3c2b7;
  --ink-muted:    #898781;
  --hair:         #2c2c2a;
  --hair-strong:  #3d3d3a;

  --accent:       #3987e5;
  --accent-soft:  #16283d;

  --st-live:      #0ca30c;
  --st-progress:  #3987e5;
  --st-blocked:   #e05c5c;
  --st-confirm:   #fab219;
  --st-done:      #9d9b93;

  --st-live-bg:     #102a10;
  --st-progress-bg: #16283d;
  --st-blocked-bg:  #33191a;
  --st-confirm-bg:  #33280c;
  --st-done-bg:     #262624;

  --st-live-ink:     #7ede7e;
  --st-progress-ink: #9cc7f5;
  --st-blocked-ink:  #f3a9a9;
  --st-confirm-ink:  #fbd888;
  --st-done-ink:     #c3c2b7;

  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 4px 14px rgba(0,0,0,.32);
  --shadow-lift: 0 2px 5px rgba(0,0,0,.5), 0 12px 30px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--plane);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0; font-weight: 620; letter-spacing: -0.012em; }

/* ---------------- top bar ---------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--plane) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.topbar-inner {
  max-width: 1220px; margin: 0 auto;
  padding: 13px 22px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 11px; margin-right: auto; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: var(--ink);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 8px;
  border-radius: 50%; background: var(--st-live);
}
.brand-text h1 { font-size: 17px; line-height: 1.2; }
.brand-sub { margin: 1px 0 0; font-size: 12.5px; color: var(--ink-muted); }

.tabs { display: flex; gap: 3px; flex-wrap: wrap; }
.tab {
  padding: 6px 13px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-2);
  border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
}
.tab:hover { background: var(--surface); text-decoration: none; color: var(--ink); }
.tab[aria-current="page"] {
  background: var(--surface); color: var(--ink);
  border-color: var(--hair-strong); box-shadow: var(--shadow);
}
.tab-badge {
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--st-confirm-bg); color: var(--st-confirm-ink);
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}

.icon-btn {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--hair-strong); border-radius: 9px;
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-muted); }

/* ---------------- layout ---------------- */

.view { max-width: 1220px; margin: 0 auto; padding: 26px 22px 60px; }

.section { margin-bottom: 34px; }
.section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 13px; flex-wrap: wrap;
}
.section-head h2 { font-size: 15px; }
.section-head p { margin: 0; font-size: 13px; color: var(--ink-muted); }

.footer {
  max-width: 1220px; margin: 0 auto; padding: 0 22px 40px;
}
.footer p { margin: 0; font-size: 12.5px; color: var(--ink-muted); }

/* ---------------- status chips / filter row ---------------- */

.chiprow { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px 8px 11px;
  border: 1px solid var(--hair-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 13px; cursor: pointer;
  box-shadow: var(--shadow);
}
.chip:hover { color: var(--ink); border-color: var(--ink-muted); }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.chip-n { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; color: var(--ink); }
.chip-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent);
}

/* ---------------- status pill ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .005em;
  white-space: nowrap;
}
.pill-ico { font-size: 9px; line-height: 1; }

.s-live        { background: var(--st-live-bg);     color: var(--st-live-ink); }
.s-in_progress { background: var(--st-progress-bg); color: var(--st-progress-ink); }
.s-blocked     { background: var(--st-blocked-bg);  color: var(--st-blocked-ink); }
.s-needs_confirmation { background: var(--st-confirm-bg); color: var(--st-confirm-ink); }
.s-done        { background: var(--st-done-bg);     color: var(--st-done-ink); }

.dot-live        { background: var(--st-live); }
.dot-in_progress { background: var(--st-progress); }
.dot-blocked     { background: var(--st-blocked); }
.dot-needs_confirmation { background: var(--st-confirm); }
.dot-done        { background: var(--st-done); }

/* ---------------- cards ---------------- */

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

.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 17px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow);
  text-align: left; font: inherit; color: inherit;
  cursor: pointer; position: relative;
  border-left: 3px solid var(--edge, var(--hair-strong));
  transition: box-shadow .14s ease, transform .14s ease, border-color .14s ease;
}
.card:hover {
  box-shadow: var(--shadow-lift); transform: translateY(-1px);
  border-color: var(--hair-strong); text-decoration: none;
}
.card.e-live        { --edge: var(--st-live); }
.card.e-in_progress { --edge: var(--st-progress); }
.card.e-blocked     { --edge: var(--st-blocked); }
.card.e-needs_confirmation { --edge: var(--st-confirm); }
.card.e-done        { --edge: var(--st-done); }

.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-title { font-size: 15.5px; font-weight: 640; flex: 1; min-width: 0; }
.card-kind {
  font-size: 11px; color: var(--ink-muted); text-transform: uppercase;
  letter-spacing: .06em; font-weight: 600; margin-top: 2px;
}
.card-sum { margin: 0; font-size: 13.5px; color: var(--ink-2); }
.card-foot {
  display: flex; align-items: center; gap: 3px 13px; flex-wrap: wrap;
  margin-top: auto; padding-top: 4px;
  font-size: 12px; color: var(--ink-muted);
}
.card-url { font-family: var(--mono); font-size: 11.5px; }

.flagline {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--st-confirm-ink);
  background: var(--st-confirm-bg); padding: 3px 8px; border-radius: 6px;
}
.flagline.danger { color: var(--st-blocked-ink); background: var(--st-blocked-bg); }

/* ---------------- detail view ---------------- */

.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-2); margin-bottom: 16px;
}
.back:hover { color: var(--ink); text-decoration: none; }

.detail-head {
  padding: 20px 21px; margin-bottom: 20px;
  background: var(--surface); border: 1px solid var(--hair);
  border-left: 3px solid var(--edge, var(--hair-strong));
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.detail-head.e-live        { --edge: var(--st-live); }
.detail-head.e-in_progress { --edge: var(--st-progress); }
.detail-head.e-blocked     { --edge: var(--st-blocked); }
.detail-head.e-needs_confirmation { --edge: var(--st-confirm); }
.detail-head.e-done        { --edge: var(--st-done); }

.detail-title { display: flex; align-items: center; gap: 11px; flex-wrap: wrap; }
.detail-title h2 { font-size: 22px; }
.detail-sum { margin: 9px 0 0; font-size: 14.5px; color: var(--ink-2); max-width: 78ch; }

.cols { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }

.panel {
  padding: 16px 17px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.panel > h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-muted); margin-bottom: 12px;
}

/* facts table */
.facts { display: grid; gap: 9px; }
.fact { display: grid; grid-template-columns: 128px 1fr; gap: 12px; font-size: 13.5px; }
.fact dt { color: var(--ink-muted); }
.fact dd { margin: 0; color: var(--ink); }
@media (max-width: 560px) { .fact { grid-template-columns: 1fr; gap: 2px; } }

/* open items */
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.item {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13.5px; color: var(--ink-2);
  padding-bottom: 10px; border-bottom: 1px solid var(--hair);
}
.items .item:last-child { border-bottom: 0; padding-bottom: 0; }
.item-tag {
  flex: none; margin-top: 1px;
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px; white-space: nowrap;
}
.tag-needs_harsh      { background: var(--st-blocked-bg); color: var(--st-blocked-ink); }
.tag-needs_confirmation { background: var(--st-confirm-bg); color: var(--st-confirm-ink); }
.tag-todo             { background: var(--surface-sunk);  color: var(--ink-2); }
.item.p-high .item-text { color: var(--ink); }

/* timeline */
.timeline { position: relative; margin: 0; padding: 0 0 0 20px; list-style: none; }
.timeline::before {
  content: ""; position: absolute; left: 4px; top: 6px; bottom: 6px;
  width: 1px; background: var(--hair-strong);
}
.tl { position: relative; padding-bottom: 17px; }
.tl:last-child { padding-bottom: 0; }
.tl::before {
  content: ""; position: absolute; left: -20px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 2px var(--hair-strong);
}
.tl.c-verified::before { background: var(--st-live); box-shadow: 0 0 0 2px var(--surface); }
.tl.c-needs_confirmation::before { background: var(--st-confirm); box-shadow: 0 0 0 2px var(--surface); }
.tl.f-incident::before, .tl.f-problem::before { background: var(--st-blocked); box-shadow: 0 0 0 2px var(--surface); }
.tl-date {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-muted);
  display: block; margin-bottom: 2px;
}
.tl-title { font-size: 14px; font-weight: 600; }
.tl-detail { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); }
.tl-basis {
  margin: 5px 0 0; font-size: 11.5px; color: var(--ink-muted);
  font-family: var(--mono);
}

/* links + repos */
.linklist { display: grid; gap: 7px; }
.linkrow {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: var(--radius-s);
  background: var(--surface-sunk); font-size: 13.5px;
  border: 1px solid transparent; cursor: pointer;
  text-align: left; font-family: inherit; color: var(--ink); width: 100%;
}
.linkrow:hover { border-color: var(--hair-strong); text-decoration: none; }
.linkrow .lk-kind {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-muted); flex: none;
}
.linkrow .lk-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.repo {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px; padding: 7px 0; border-bottom: 1px solid var(--hair);
}
.repo:last-child { border-bottom: 0; }
.repo-path { font-family: var(--mono); color: var(--ink); }
.repo-branch {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--surface-sunk); padding: 1px 6px; border-radius: 5px; color: var(--ink-2);
}
.repo-meta { color: var(--ink-muted); }

/* ---------------- comms ---------------- */

.person {
  padding: 17px 18px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.person-head {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding-bottom: 13px; margin-bottom: 13px; border-bottom: 1px solid var(--hair);
}
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 13px;
}
.person-name { font-size: 15.5px; font-weight: 640; }
.person-meta { font-size: 12.5px; color: var(--ink-muted); }
.person-meta .mono { font-family: var(--mono); font-size: 12px; }

.comms { display: grid; gap: 0; }
.comm {
  display: grid; grid-template-columns: 74px 42px 1fr auto; gap: 11px;
  align-items: start; padding: 11px 0; border-bottom: 1px solid var(--hair);
}
.comm:last-child { border-bottom: 0; }
.comm-date { font-family: var(--mono); font-size: 12px; color: var(--ink-muted); padding-top: 1px; }
.comm-dir {
  font-size: 11px; font-weight: 700; text-align: center; padding-top: 2px;
  letter-spacing: .03em;
}
.comm-dir.out { color: var(--accent); }
.comm-dir.in  { color: var(--st-live); }
.comm-subj { font-size: 13.5px; font-weight: 600; }
.comm-sum { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }
.comm-basis { margin: 4px 0 0; font-size: 11.5px; color: var(--ink-muted); font-family: var(--mono); }
.comm-round {
  font-family: var(--mono); font-size: 11px; font-weight: 700;
  background: var(--surface-sunk); color: var(--ink-2);
  padding: 2px 7px; border-radius: 6px; white-space: nowrap;
}
@media (max-width: 640px) {
  .comm { grid-template-columns: 1fr auto; }
  .comm-dir { text-align: left; padding-top: 0; }
}

.conf {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 5px; margin-left: 6px;
  vertical-align: 1px;
}
.conf-verified { background: var(--st-live-bg); color: var(--st-live-ink); }
.conf-derived  { background: var(--surface-sunk); color: var(--ink-muted); }
.conf-needs_confirmation { background: var(--st-confirm-bg); color: var(--st-confirm-ink); }

/* ---------------- gaps ---------------- */

.gap {
  padding: 15px 17px; margin-bottom: 11px;
  background: var(--surface); border: 1px solid var(--hair);
  border-left: 3px solid var(--st-confirm);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.gap-q { font-size: 14.5px; font-weight: 620; display: flex; gap: 10px; align-items: baseline; }
.gap-n {
  font-family: var(--mono); font-size: 12px; color: var(--ink-muted);
  flex: none; padding-top: 1px;
}
.gap-why { margin: 7px 0 0 27px; font-size: 13.5px; color: var(--ink-2); }
.gap-affects { margin: 8px 0 0 27px; display: flex; gap: 6px; flex-wrap: wrap; }
.gap-affects a {
  font-size: 11.5px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-sunk); color: var(--ink-2);
}
.gap-affects a:hover { text-decoration: none; color: var(--ink); }

/* ---------------- status pages ---------------- */

.pagecard {
  display: flex; flex-direction: column; gap: 6px;
  padding: 15px 16px; text-align: left; font: inherit; color: inherit;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer;
  transition: box-shadow .14s ease, transform .14s ease;
}
.pagecard:hover { box-shadow: var(--shadow-lift); transform: translateY(-1px); }
.pagecard h3 { font-size: 14.5px; }
.pagecard p { margin: 0; font-size: 13px; color: var(--ink-2); }
.pagecard .mono { font-size: 11.5px; color: var(--ink-muted); font-family: var(--mono); }

/* ---------------- doc overlay ---------------- */

.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: color-mix(in srgb, #0b0b0b 55%, transparent);
  display: grid; place-items: center; padding: 24px;
}
.overlay[hidden] { display: none; }
.overlay-panel {
  width: min(920px, 100%); max-height: 88vh;
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: 14px; box-shadow: var(--shadow-lift); overflow: hidden;
}
.overlay-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 15px 17px; border-bottom: 1px solid var(--hair);
}
.overlay-head h2 { font-size: 15.5px; }
.overlay-sub { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-muted); }
.overlay-head .icon-btn { margin-left: auto; }
.overlay-body { padding: 18px 20px 26px; overflow: auto; }

/* rendered markdown */
.md { font-size: 14px; color: var(--ink-2); max-width: 74ch; }
.md h1, .md h2, .md h3, .md h4 { color: var(--ink); margin: 20px 0 8px; line-height: 1.3; }
.md h1 { font-size: 19px; } .md h2 { font-size: 16.5px; }
.md h3 { font-size: 14.5px; } .md h4 { font-size: 13.5px; }
.md > :first-child { margin-top: 0; }
.md p { margin: 0 0 10px; }
.md ul, .md ol { margin: 0 0 11px; padding-left: 21px; }
.md li { margin-bottom: 4px; }
.md code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--surface-sunk); padding: 1px 5px; border-radius: 4px; color: var(--ink);
}
.md pre {
  background: var(--surface-sunk); padding: 12px 13px; border-radius: var(--radius-s);
  overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--hair);
}
.md pre code { background: none; padding: 0; font-size: 12px; line-height: 1.5; }
.md hr { border: 0; border-top: 1px solid var(--hair); margin: 18px 0; }
.md strong { color: var(--ink); font-weight: 650; }
.md blockquote {
  margin: 0 0 12px; padding: 2px 0 2px 13px;
  border-left: 3px solid var(--hair-strong); color: var(--ink-muted);
}
.md .tablewrap { overflow-x: auto; margin: 0 0 13px; }
.md table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.md th, .md td {
  border-bottom: 1px solid var(--hair); padding: 6px 11px 6px 0; text-align: left;
  vertical-align: top;
}
.md th { color: var(--ink); font-weight: 620; white-space: nowrap; }

.pre-raw {
  font-family: var(--mono); font-size: 12.5px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; margin: 0; color: var(--ink-2);
}

/* ---------------- misc ---------------- */

.mono { font-family: var(--mono); }
.empty {
  padding: 34px 20px; text-align: center;
  color: var(--ink-muted); font-size: 13.5px;
  background: var(--surface); border: 1px dashed var(--hair-strong);
  border-radius: var(--radius);
}
.notice {
  padding: 12px 15px; margin-bottom: 20px; font-size: 13.5px;
  background: var(--st-confirm-bg); color: var(--st-confirm-ink);
  border-radius: var(--radius-s);
}
.notice strong { font-weight: 700; }
.spinner { padding: 40px; text-align: center; color: var(--ink-muted); font-size: 13.5px; }

/* ============================================================
   Auto-refresh additions: freshness strip, conflicts, live checks,
   commits, system view.
   ============================================================ */

/* ---- freshness strip: how old each class of data is ---- */
.fresh {
  display: flex; align-items: center; gap: 6px 18px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 12.5px;
}
.fresh-item { display: inline-flex; align-items: baseline; gap: 7px; }
.fresh-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--st-live);
  flex: none; align-self: center;
}
.fresh-item.is-stale .fresh-dot { background: var(--st-confirm); }
.fresh-label { color: var(--ink-muted); }
.fresh-val { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.fresh-item.is-stale .fresh-val { color: var(--st-confirm-ink); }
.fresh-btn {
  margin-left: auto; padding: 4px 11px; font: inherit; font-size: 12px;
  border: 1px solid var(--hair-strong); border-radius: 7px;
  background: var(--plane); color: var(--ink-2); cursor: pointer;
}
.fresh-btn:hover { color: var(--ink); border-color: var(--ink-muted); }

/* ---- conflicts: written status vs measured reality ---- */
.conflict-strip {
  padding: 13px 16px; margin-bottom: 18px;
  background: var(--st-blocked-bg); border: 1px solid transparent;
  border-left: 3px solid var(--st-blocked); border-radius: var(--radius);
}
.conflict-head { font-size: 13.5px; font-weight: 700; color: var(--st-blocked-ink); margin-bottom: 7px; }
.conflict-strip ul { margin: 0; padding-left: 18px; }
.conflict-strip li { font-size: 13px; color: var(--st-blocked-ink); margin-bottom: 4px; }
.conflict-strip a { color: var(--st-blocked-ink); font-weight: 650; }

.conflict-inline {
  margin-top: 13px; padding: 10px 13px;
  background: var(--st-blocked-bg); border-radius: var(--radius-s);
  font-size: 13px; color: var(--st-blocked-ink); font-weight: 600;
}
.conflict-inline div + div { margin-top: 5px; }

/* ---- tone on machine-checked values ---- */
.t-good { color: var(--st-live-ink); }
.t-warn { color: var(--st-confirm-ink); }
.t-bad  { color: var(--st-blocked-ink); font-weight: 600; }
.fact dd.is-auto { font-variant-numeric: tabular-nums; }

.panel-auto {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--st-live-ink); background: var(--st-live-bg);
  padding: 2px 6px; border-radius: 5px; margin-left: 7px; vertical-align: 1px;
}
.panel-foot { margin: 11px 0 0; font-size: 11.5px; color: var(--ink-muted); }

.statussrc {
  font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface-sunk);
  padding: 3px 7px; border-radius: 5px;
}

/* live-check line on the overview card */
.livechk {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-muted);
  display: block;
}

/* ---- recent commits ---- */
.commits { display: grid; gap: 0; }
.commit {
  display: grid; grid-template-columns: 74px 62px 1fr auto; gap: 10px;
  align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.commit:last-child { border-bottom: 0; }
.commit-date, .commit-hash { font-size: 11.5px; color: var(--ink-muted); }
.commit-subj { color: var(--ink-2); min-width: 0; }
.commit-repo { font-size: 11px; color: var(--ink-muted); }
@media (max-width: 700px) {
  .commit { grid-template-columns: 74px 1fr; }
  .commit-hash, .commit-repo { display: none; }
}

/* ---- system view rows ---- */
.srclist { display: grid; gap: 0; }
.src {
  display: grid; grid-template-columns: 12px minmax(140px, auto) 1fr auto; gap: 11px;
  align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--hair);
  font-size: 13px;
}
.src:last-child { border-bottom: 0; }
.src-dot {
  width: 8px; height: 8px; border-radius: 50%; align-self: center;
  background: var(--ink-muted);
}
.src-dot.ok { background: var(--st-live); }
.src-dot.bad { background: var(--st-blocked); }
.src-dot.warn { background: var(--st-confirm); }
.src-dot.off { background: var(--hair-strong); }
.src-label { font-weight: 600; color: var(--ink); }
.src-detail { color: var(--ink-2); min-width: 0; }
.src-at { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }
@media (max-width: 700px) {
  .src { grid-template-columns: 12px 1fr; }
  .src-detail, .src-at { grid-column: 2; }
}

/* ---- comms person strip ---- */
.person-strip {
  display: flex; gap: 7px 16px; flex-wrap: wrap; align-items: center;
  margin-bottom: 12px; font-size: 12.5px; color: var(--ink-muted);
}
.waiting {
  font-weight: 650; color: var(--st-confirm-ink);
  background: var(--st-confirm-bg); padding: 2px 8px; border-radius: 6px;
}
.waiting.overdue { color: var(--st-blocked-ink); background: var(--st-blocked-bg); }
.ball-ours {
  font-weight: 650; color: var(--st-progress-ink);
  background: var(--st-progress-bg); padding: 2px 8px; border-radius: 6px;
}
.roundbig {
  font-family: var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--ink); background: var(--surface-sunk);
  padding: 4px 10px; border-radius: 7px; flex: none;
}

.notice.ok { background: var(--st-live-bg); color: var(--st-live-ink); }

/* seed banner: a container serving image-baked data must say so */
.seed-banner {
  padding: 13px 16px; margin-bottom: 18px;
  background: var(--st-blocked-bg); color: var(--st-blocked-ink);
  border-left: 3px solid var(--st-blocked); border-radius: var(--radius);
  font-size: 13.5px; line-height: 1.5;
}
.seed-banner strong { display: block; font-weight: 700; margin-bottom: 3px; }
.subtle { color: var(--ink-muted); font-size: 11.5px; }

.comm-artifact {
  margin: 4px 0 0; font-size: 12px; color: var(--ink-2);
  font-family: var(--mono);
}

/* ============================================================
   Milestones — ordered go-live checklist with live verification
   ============================================================ */

.ms-count {
  float: right; font-size: 12px; font-weight: 500; text-transform: none;
  letter-spacing: 0; color: var(--ink-2);
}
.ms-count strong { color: var(--st-live-ink); font-weight: 700; }

.ms-bar {
  display: flex; gap: 3px; margin: 2px 0 16px; height: 6px;
}
.ms-bar.sm { margin: 0; height: 5px; flex: 1; min-width: 90px; }
.ms-seg { flex: 1; border-radius: 3px; background: var(--surface-sunk); }
.ms-seg.ms-done { background: var(--st-live); }
.ms-seg.ms-in_progress { background: var(--st-progress); }

.card-ms { display: flex; align-items: center; gap: 10px; }
.card-ms-label { font-size: 11.5px; color: var(--ink-muted); white-space: nowrap; }

.ms-phase {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-muted); margin: 14px 0 8px;
}
.ms-phase:first-of-type { margin-top: 2px; }

.ms-list { list-style: none; margin: 0; padding: 0; }
.ms {
  display: flex; gap: 11px; align-items: flex-start;
  padding: 8px 0; border-bottom: 1px solid var(--hair);
}
.ms-list .ms:last-child { border-bottom: 0; }

.ms-dot {
  flex: none; width: 22px; height: 22px; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 50%; font-size: 11px; font-weight: 700;
}
.ms-done .ms-dot { background: var(--st-live-bg); color: var(--st-live-ink); }
.ms-in_progress .ms-dot { background: var(--st-progress-bg); color: var(--st-progress-ink); }
.ms-pending .ms-dot { background: var(--surface-sunk); color: var(--ink-muted); }

.ms-body { flex: 1; min-width: 0; }
.ms-title { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.ms-pending .ms-title { color: var(--ink-2); font-weight: 500; }
.ms-date {
  font-family: var(--mono); font-size: 11px; color: var(--ink-muted);
  margin-left: 7px; font-weight: 500;
}
.ms-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 5px; margin-left: 7px; vertical-align: 1px;
}
.ms-tag.t-prog { background: var(--st-progress-bg); color: var(--st-progress-ink); }
.ms-tag.t-gate { background: var(--st-confirm-bg); color: var(--st-confirm-ink); }
.ms-detail { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-2); }
.ms-meta { margin: 3px 0 0; display: flex; gap: 5px 14px; flex-wrap: wrap; }
.ms-check { font-size: 11.5px; font-family: var(--mono); }
.ms-check.ok { color: var(--st-live-ink); }
.ms-check.bad { color: var(--st-blocked-ink); font-weight: 700; }
.ms-basis { font-size: 11.5px; color: var(--ink-muted); font-family: var(--mono); }

.ms-tag.t-auto { background: var(--st-live-bg); color: var(--st-live-ink); }
.ms-tag.t-armed { background: var(--accent-soft); color: var(--st-progress-ink); }
.ms-tag.t-manual { background: var(--surface-sunk); color: var(--ink-muted); }

/* ---- Overview sections: Webapps / Review loops / Others ---- */
.ov-section { margin-bottom: 30px; }
.ov-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 13px;
}
.ov-head h2 {
  font-size: 12.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-2);
}
.ov-count {
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--surface-sunk); color: var(--ink-muted);
  font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center;
}
.ov-rule { flex: 1; height: 1px; background: var(--hair); }

/* ============================================================
   Team Portal (portal.html / portal.js) — pt-* namespace.
   Reuses the dashboard tokens; nothing here restyles the dashboard.
   ============================================================ */

.pt-body { display:flex; flex-direction:column; min-height:100vh; }
.pt-main { flex:1; display:flex; flex-direction:column; gap:14px; width:100%;
  max-width:1060px; margin:0 auto; padding:18px 20px 26px; }
.pt-topbar { gap:14px; }
.pt-mark { background:var(--accent); }
.pt-userbox { display:flex; align-items:center; gap:12px; margin-left:auto; }
.pt-username { font-weight:600; font-size:13px; color:var(--ink-2); }
.pt-logout { font-size:12.5px; color:var(--ink-muted); text-decoration:none; }
.pt-logout:hover { color:var(--ink); text-decoration:underline; }
.pt-loading { padding:22px; color:var(--ink-muted); }

.pt-input { width:100%; padding:10px 12px; font:inherit; border:1px solid var(--hair-strong);
  border-radius:9px; background:var(--plane); color:var(--ink); }
.pt-btn { padding:10px 16px; font:inherit; font-weight:600; cursor:pointer; white-space:nowrap;
  border:1px solid transparent; border-radius:9px; background:var(--accent); color:#fff; }
.pt-btn:disabled { opacity:.55; cursor:default; }
.pt-btn-ghost { background:transparent; color:var(--ink-2); border-color:var(--hair-strong); font-weight:500; }
.pt-btn-ok { background:var(--st-live); }
.pt-btn-no { background:var(--st-blocked); }

/* ---- chat ---- */
.pt-chat { display:flex; flex-direction:column; flex:1; min-height:0; }
.pt-chat-scroll { flex:1; overflow-y:auto; padding:18px 16px; display:flex; flex-direction:column;
  gap:14px; min-height:220px; max-height:calc(100vh - 320px); }
.pt-empty { color:var(--ink-muted); font-size:13.5px; padding:18px 6px; }
.pt-msg { max-width:78%; align-self:flex-start; }
.pt-msg.pt-mine { align-self:flex-end; text-align:right; }
.pt-msg-meta { font-size:11.5px; color:var(--ink-muted); margin:0 6px 3px; }
.pt-bubble { display:inline-block; text-align:left; padding:10px 13px; border-radius:14px;
  background:var(--surface-sunk); color:var(--ink); font-size:14px; line-height:1.45;
  border:1px solid var(--hair); overflow-wrap:anywhere; white-space:normal; }
.pt-mine .pt-bubble { background:var(--accent-soft); border-color:transparent; }
.pt-msg-claude .pt-bubble, .pt-bubble.pt-msg-claude { background:var(--surface); }
.pt-bubble.pt-msg-system { background:var(--st-confirm-bg); color:var(--st-confirm-ink);
  border-color:transparent; font-weight:500; }
.pt-attach-img { display:block; max-width:280px; max-height:220px; border-radius:9px; margin-top:8px; }
.pt-attach-link { display:inline-block; }

/* member chat sits in a panel-look wrapper */
.pt-main > .pt-chat { background:var(--surface); border:1px solid var(--hair);
  border-radius:var(--radius); box-shadow:var(--shadow); }

/* ---- composer ---- */
.pt-composer { border-top:1px solid var(--hair); padding:12px 14px; }
.pt-composer-row { display:flex; gap:10px; align-items:flex-end; }
.pt-ta { flex:1; resize:vertical; min-height:44px; max-height:180px; padding:10px 12px; font:inherit;
  border:1px solid var(--hair-strong); border-radius:9px; background:var(--plane); color:var(--ink); }
.pt-iconbtn { border:1px solid var(--hair-strong); background:var(--plane); border-radius:9px;
  font-size:16px; padding:9px 11px; cursor:pointer; }
.pt-btn-send { padding:10px 20px; }
.pt-composer-foot { display:flex; justify-content:space-between; margin-top:6px; min-height:16px; }
.pt-send-note { font-size:12px; color:var(--st-live-ink); }
.pt-hint { font-size:11px; color:var(--ink-muted); }
.pt-files { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:6px; }
.pt-file-chip { display:inline-flex; align-items:center; gap:6px; font-size:12px; padding:4px 8px;
  background:var(--surface-sunk); border:1px solid var(--hair); border-radius:7px; }
.pt-file-x { border:0; background:none; cursor:pointer; font-size:14px; color:var(--ink-muted); padding:0; }

/* ---- request chips ---- */
.pt-req-bar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; padding:10px 14px;
  background:var(--surface); border:1px solid var(--hair); border-radius:var(--radius); }
.pt-req-title { font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em;
  color:var(--ink-muted); margin-right:4px; }
.pt-chip { display:inline-flex; align-items:center; gap:4px; font-size:12px; font-weight:600;
  padding:4px 10px; border-radius:999px; }
.pt-chip-live { background:var(--st-live-bg); color:var(--st-live-ink); }
.pt-chip-progress { background:var(--st-progress-bg); color:var(--st-progress-ink); }
.pt-chip-blocked { background:var(--st-blocked-bg); color:var(--st-blocked-ink); }
.pt-chip-confirm { background:var(--st-confirm-bg); color:var(--st-confirm-ink); }
.pt-chip-done { background:var(--st-done-bg); color:var(--st-done-ink); }

/* ---- admin split ---- */
.pt-split { display:grid; grid-template-columns:290px 1fr; gap:14px; flex:1; min-height:0; align-items:start; }
.pt-threadlist { padding:8px; max-height:calc(100vh - 200px); overflow-y:auto; }
.pt-thread-item { display:block; padding:11px 12px; border-radius:9px; text-decoration:none;
  color:var(--ink); }
.pt-thread-item:hover { background:var(--surface-sunk); }
.pt-thread-sel { background:var(--accent-soft); }
.pt-thread-top { display:flex; align-items:center; gap:6px; font-size:13.5px; }
.pt-thread-app { color:var(--ink-muted); font-size:12px; }
.pt-unread { margin-left:auto; background:var(--accent); color:#fff; font-size:11px; font-weight:700;
  border-radius:999px; padding:1px 7px; }
.pt-thread-sub { font-size:12px; color:var(--ink-muted); margin-top:2px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pt-chatpane { display:flex; flex-direction:column; padding:0; min-height:420px; }
.pt-chatpane .pt-req-bar { border:0; border-bottom:1px solid var(--hair); border-radius:12px 12px 0 0; }
.pt-chatpane .pt-chat-scroll { max-height:calc(100vh - 360px); }

/* ---- queue ---- */
.pt-queue { padding:14px; display:flex; flex-direction:column; gap:12px; }
.pt-queue-card { border:1px solid var(--hair); border-radius:var(--radius-s); padding:13px 15px;
  display:flex; flex-direction:column; gap:7px; background:var(--surface); }
.pt-queue-head { display:flex; align-items:center; gap:10px; justify-content:space-between; }
.pt-queue-sub { font-size:12.5px; color:var(--ink-muted); }
.pt-queue-detail { font-size:13.5px; color:var(--ink-2); }
.pt-queue-ask { font-size:13px; padding:8px 11px; border-radius:8px;
  background:var(--st-confirm-bg); color:var(--st-confirm-ink); }
.pt-queue-actions { display:flex; gap:8px; align-items:center; margin-top:3px; flex-wrap:wrap; }
.pt-note { flex:1; min-width:180px; }

/* ---- people ---- */
.pt-people { padding:16px; }
.pt-h3 { font-size:14px; margin:6px 0 10px; }
.pt-h3 + .pt-h3, .pt-usertable { margin-top:6px; }
.pt-form-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.pt-form-row .pt-input { width:auto; flex:1; min-width:140px; }
.pt-invitebox { margin:4px 0 16px; padding:12px 14px; border-radius:var(--radius-s);
  background:var(--st-confirm-bg); color:var(--st-confirm-ink);
  display:flex; flex-direction:column; gap:8px; align-items:flex-start; }
.pt-invite-title { font-size:13px; font-weight:600; }
.pt-invite-url { font-family:var(--mono); font-size:12px; overflow-wrap:anywhere;
  user-select:all; }
.pt-user-row { display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:11px 4px; border-top:1px solid var(--hair); }
.pt-user-off { opacity:.5; }
.pt-user-main { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.pt-user-sub { font-size:12.5px; color:var(--ink-muted); }
.pt-user-actions { display:flex; gap:8px; }
.pt-user-actions .pt-btn { padding:6px 12px; font-size:12.5px; }

@media (max-width: 760px) {
  .pt-split { grid-template-columns:1fr; }
  .pt-threadlist { max-height:32vh; }
  .pt-msg { max-width:92%; }
  .pt-main { padding:12px 10px 18px; }
}

/* hidden must win over .tabs{display:flex}; empty badges disappear */
#pt-tabs[hidden] { display: none; }
.tab-badge:empty { display: none; }
.pt-invitebox[hidden] { display: none; }

/* logout: a real button, present on every portal page and the dashboard nav */
.pt-logout-btn { display:inline-flex; align-items:center; gap:6px; padding:7px 13px;
  font-size:12.5px; font-weight:600; color:var(--ink-2); text-decoration:none;
  border:1px solid var(--hair-strong); border-radius:9px; background:var(--surface);
  white-space:nowrap; }
.pt-logout-btn:hover { color:var(--st-blocked-ink); border-color:var(--st-blocked);
  background:var(--st-blocked-bg); }
.pt-logout-tab { margin-left:6px; border:1px solid var(--hair-strong); border-radius:9px; }
.pt-logout-tab:hover { color:var(--st-blocked-ink); border-color:var(--st-blocked);
  background:var(--st-blocked-bg); }

/* When the staging switcher pill is mounted (staging-mc only), give the
   topbar room so the pill doesn't sit on the brand. */
:root.has-stgsw .topbar-inner { padding-top: 46px; }

/* ---- member app landing ---- */
.pt-applanding { padding: 16px; }
.pt-appgrid { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; }
.pt-apptile { display:flex; flex-direction:column; gap:7px; padding:16px 17px; border-radius:var(--radius-s);
  border:1px solid var(--hair); background:var(--surface); text-decoration:none; color:var(--ink);
  transition:border-color .12s ease, box-shadow .12s ease; }
.pt-apptile:hover { border-color:var(--accent); box-shadow:var(--shadow-lift); }
.pt-apptile-head { display:flex; align-items:center; gap:8px; }
.pt-apptile-name { font-size:15px; }
.pt-apptile-head .pt-unread { margin-left:auto; }
.pt-apptile-sub { font-size:12.5px; color:var(--ink-muted); overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.pt-apptile-time { font-size:11px; color:var(--ink-muted); }
.pt-back { display:inline-block; font-size:12.5px; color:var(--ink-2); text-decoration:none;
  padding:2px 0; width:max-content; }
.pt-back:hover { color:var(--ink); text-decoration:underline; }

/* ---- admin: app checkboxes (create form) + grant chips (rows) ---- */
.pt-appcheck-group { display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; }
.pt-appcheck { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; padding:8px 10px;
  border:1px solid var(--hair-strong); border-radius:9px; cursor:pointer; background:var(--plane); }
.pt-appcheck input { accent-color:var(--accent); margin:0; }
.pt-user-apps { display:inline-flex; gap:4px; align-items:center; flex-wrap:wrap; }
.pt-user-apps-all { font-size:12px; color:var(--ink-muted); }
.pt-appgrant { font:inherit; font-size:11.5px; font-weight:600; padding:4px 9px; border-radius:999px;
  border:1px solid var(--hair-strong); background:transparent; color:var(--ink-muted); cursor:pointer; }
.pt-appgrant:hover { border-color:var(--accent); color:var(--accent); }
.pt-appgrant.is-on { background:var(--accent-soft); border-color:transparent; color:var(--st-progress-ink); }
.pt-appgrant.is-on:hover { background:var(--st-blocked-bg); color:var(--st-blocked-ink); }

/* ---- Team comms: per-teammate portal boxes (dashboard) ---- */
.tp-h { font-size:13px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-muted); margin:4px 0 10px; }
.tp-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(250px,1fr)); gap:12px;
  margin-bottom:22px; }
.tp-box { display:flex; flex-direction:column; gap:7px; padding:14px 16px; border-radius:var(--radius-s);
  border:1px solid var(--hair); background:var(--surface); text-decoration:none; color:var(--ink);
  box-shadow:var(--shadow); transition:border-color .12s ease, box-shadow .12s ease; }
.tp-box:hover { border-color:var(--accent); box-shadow:var(--shadow-lift); }
.tp-box-off { opacity:.55; }
.tp-box-head { display:flex; align-items:center; gap:9px; }
.tp-unread { margin-left:auto; background:var(--accent); color:#fff; font-size:11px; font-weight:700;
  border-radius:999px; padding:1px 7px; }
.tp-box-apps { font-size:11.5px; font-weight:600; text-transform:uppercase; letter-spacing:.05em;
  color:var(--ink-muted); }
.tp-box-last { font-size:12.5px; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }

/* ---- portal: member activity view ---- */
.pt-member-head { padding:14px 16px; display:flex; flex-direction:column; gap:10px; }
.pt-member-title { display:flex; align-items:center; gap:9px; flex-wrap:wrap; }
.pt-member-links { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.pt-member-links .pt-btn { padding:6px 12px; font-size:12.5px; }
.pt-member-feed { padding:18px 16px; display:flex; flex-direction:column; gap:14px;
  max-height:calc(100vh - 300px); overflow-y:auto; }

/* ---- request lifecycle states + Claude-working animation ---- */
.pt-msg-state { font-size:11.5px; margin:4px 8px 0; display:flex; align-items:center; gap:6px;
  color:var(--ink-muted); }
.pt-mine .pt-msg-state { justify-content:flex-end; }
.pt-state-pending { color:var(--ink-muted); }
.pt-state-processing { color:var(--st-progress-ink); font-weight:600; }
.pt-state-done { color:var(--st-live-ink); }
.pt-state-check { font-size:10.5px; letter-spacing:-1px; }
.pt-working-dots { display:inline-flex; align-items:center; gap:3px; }
.pt-working-dots span { width:5px; height:5px; border-radius:999px; background:currentColor;
  animation:pt-bounce 1.2s infinite ease-in-out; }
.pt-working-dots span:nth-child(2) { animation-delay:.15s; }
.pt-working-dots span:nth-child(3) { animation-delay:.3s; }
@keyframes pt-bounce {
  0%, 60%, 100% { transform:translateY(0); opacity:.35; }
  30% { transform:translateY(-4px); opacity:1; }
}
.pt-working-bubble { display:inline-flex; align-items:center; gap:8px;
  color:var(--st-progress-ink); font-weight:500; }
.pt-working-bubble .pt-working-dots span { background:var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .pt-working-dots span { animation:none; opacity:.8; }
}

/* ---- Claude running spark (Dispatch-style) — replaces the generic dots ---- */
.pt-spark { display:inline-flex; color:#D97757; }   /* Claude coral, both themes */
.pt-spark svg { width:13px; height:13px; display:block; transform-origin:center;
  animation:pt-spark-pulse 1.4s ease-in-out infinite; }
.pt-working-bubble { color:#C15F3C; font-weight:500; }
.pt-working-bubble .pt-spark svg { width:17px; height:17px; }
.pt-state-processing { color:#C15F3C; }
@media (prefers-color-scheme: dark) {
  .pt-working-bubble { color:#E8956F; }
  .pt-state-processing { color:#E8956F; }
}
@keyframes pt-spark-pulse {
  0%, 100% { transform:scale(.85) rotate(-10deg); opacity:.65; }
  50%      { transform:scale(1.08) rotate(10deg); opacity:1; }
}
@media (prefers-reduced-motion: reduce) {
  .pt-spark svg { animation:none; opacity:.9; }
}
