/* Ember Workspace — design system lifted verbatim from mockups/workspace-web.html.
   Do not redesign here; the mock is the source of truth. */

:root {
  --tray: #edeae6;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: #f7f5f2;
  --line: #e6e2dc;
  --line-strong: #d6d1c9;
  --text: #221f1b;
  --muted: #6f6a62;
  --faint: #a29c92;

  --ember: #e8590c;
  --ember-deep: #c2410c;
  --ember-soft: #fdeee3;
  --ember-glow: rgba(232, 89, 12, 0.25);

  --green: #1f9d55;
  --green-soft: #e7f6ec;
  --amber: #b45309;
  --amber-soft: #fdf3df;
  --red: #b42318;
  --red-soft: #fdeceb;

  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

/* Blazor mounts into #app; it must not break the body grid below. */
#app { display: contents; }

body {
  font-family: var(--ui);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(1100px 480px at 88% -8%, rgba(232,89,12,0.055), transparent 60%),
    var(--tray);
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 288px 1fr;
  gap: 10px;
  padding: 10px;
}

.pill {
  min-height: 0;
  background: var(--surface);
  border: 0.5px solid rgba(255,255,255,0.9);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(40,30,20,0.05), 0 8px 22px rgba(40,30,20,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================= NAV ================= */

.context {
  padding: 14px 14px 12px;
  border-bottom: 0.5px solid var(--line);
}
.org-line-wrap, .ws-line-wrap { position: relative; }
.org-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: var(--muted); font-weight: 560;
  padding: 0 2px 9px;
  cursor: pointer;
}
.org-mark {
  width: 17px; height: 17px; border-radius: 5.5px;
  background: linear-gradient(150deg, #ff9d2e, #c2410c);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 9.5px;
  box-shadow: 0 1px 3px var(--ember-glow);
}
.org-mark.org-mango, .ws-mark.org-mango, .ctx-mark.org-mango {
  background: linear-gradient(150deg, #a78bfa, #6d28d9);
  box-shadow: 0 1px 3px rgba(109,40,217,0.3);
}
.org-line .chev { font-size: 8px; color: var(--faint); }
.org-line .cog { margin-left: auto; color: var(--faint); font-size: 13px; cursor: pointer; }

.ws-line { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.ws-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background:
    radial-gradient(14px 10px at 30% 22%, rgba(255,255,255,0.4), transparent 60%),
    linear-gradient(150deg, #ffb35c, #e8590c);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 7px var(--ember-glow), inset 0 0.5px 0 rgba(255,255,255,0.5);
}
.ws-name { font-size: 14.5px; font-weight: 690; letter-spacing: -0.2px; flex: 1; }
.ws-line .chev { color: var(--faint); font-size: 10px; }

/* ---- Context switcher dropdowns ---- */
.ctx-backdrop { position: fixed; inset: 0; z-index: 40; background: transparent; }
.ctx-menu {
  position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  z-index: 50;
  background: var(--surface-strong);
  border: 0.5px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(40,30,20,0.08), 0 10px 30px rgba(40,30,20,0.12);
  padding: 6px;
}
.ctx-menu .ctx-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 9px; border-radius: 8px;
  font-size: 13px; color: var(--text); font-weight: 530;
  cursor: pointer;
}
.ctx-menu .ctx-row:hover { background: var(--surface-soft); }
.ctx-menu .ctx-row.inert { color: var(--faint); cursor: default; }
.ctx-menu .ctx-row.inert:hover { background: none; }
.ctx-menu .ctx-row .tick { margin-left: auto; color: var(--ember); font-size: 12px; }
.ctx-menu .ctx-row .ctx-cog, .ctx-menu .ctx-row .ctx-add { margin-left: auto; font-size: 12px; color: var(--faint); }
.ctx-menu .ctx-divider { height: 0.5px; background: var(--line); margin: 5px 2px; }
.ctx-mark {
  width: 16px; height: 16px; border-radius: 5px; flex: none;
  background: linear-gradient(150deg, #ff9d2e, #c2410c);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 9px;
}

.nav-scroll { flex: 1; overflow-y: auto; padding: 12px 10px 12px; min-height: 0; }

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7.5px 10px; border-radius: 9px;
  font-size: 13px; color: var(--muted); font-weight: 530;
  margin-bottom: 1px;
  text-decoration: none;
}
.nav-item:hover { background: var(--surface-soft); }
.nav-item.active {
  background: var(--surface-strong); color: var(--text); font-weight: 640;
  box-shadow: 0 0 0 0.5px var(--line-strong), 0 1px 3px rgba(40,30,20,0.07);
}
.nav-glyph { width: 18px; text-align: center; font-size: 13px; color: var(--faint); }
.nav-item.active .nav-glyph { color: var(--ember); }

.nav-badge {
  margin-left: auto;
  background: linear-gradient(150deg, #f0620d, var(--ember-deep));
  color: #fff;
  font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 9px;
  display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 1px 3px var(--ember-glow);
}

.nav-group {
  font-size: 10px; font-weight: 680; letter-spacing: 1px;
  text-transform: uppercase; color: var(--faint);
  padding: 18px 10px 6px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-group .add { font-size: 12px; font-weight: 400; }
.nav-group .disclose { font-size: 8.5px; }

.nav-item .live-dot {
  margin-left: auto;
  display: flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums;
}
@keyframes breathe { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.live-dot i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: breathe 2.4s ease-in-out infinite;
}

.nav-item .more { margin-left: auto; font-size: 10.5px; color: var(--faint); }

.agent-dots { margin-left: auto; display: flex; }
.agent-dots .mini {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--surface-strong);
  margin-left: -5px;
  display: grid; place-items: center;
  color: #fff; font-size: 6.5px; font-weight: 700;
}
.agent-dots .mini:first-child { margin-left: 0; }

.a-owner  { background: linear-gradient(150deg, #ffb35c, #e8590c); }
.a-violet { background: linear-gradient(150deg, #a78bfa, #6d28d9); }
.a-cyan   { background: linear-gradient(150deg, #22d3ee, #0e7490); }
.a-slate  { background: linear-gradient(150deg, #a8b0ba, #5f6b78); }
.a-moss   { background: linear-gradient(150deg, #a3e635, #4d7c0f); }

.nav-footer {
  border-top: 0.5px solid var(--line);
  padding: 11px 14px;
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.nav-footer:hover { background: var(--surface-soft); }
.avatar {
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 680; color: #fff; flex: none;
  box-shadow: inset 0 0.5px 0 rgba(255,255,255,0.45), 0 1px 2px rgba(40,30,20,0.12);
}
.nav-footer .avatar { width: 26px; height: 26px; font-size: 10.5px; }
.nav-footer .who { flex: 1; min-width: 0; }
.nav-footer .nm { font-weight: 620; font-size: 12.5px; }
.nav-footer .em { font-size: 10px; color: var(--faint); }
.nav-footer .cog { color: var(--faint); font-size: 13px; }

/* ================= MAIN / BRIEFING ================= */

.main { position: relative; }

.brief-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.brief-inner { max-width: 860px; margin: 0 auto; padding: 40px 40px 24px; }

.brief-date {
  font-size: 11px; font-weight: 650; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--faint);
}
.brief-title {
  font-size: 26px; font-weight: 740; letter-spacing: -0.5px;
  margin: 6px 0 4px;
}
.brief-lede {
  font-size: 14px; color: var(--muted); line-height: 1.55;
  max-width: 620px;
}
.brief-lede b { color: var(--text); font-weight: 640; }
.prepared {
  display: flex; align-items: center; gap: 7px;
  margin-top: 14px; font-size: 11px; color: var(--faint);
}
.prepared .mini {
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
  color: #fff; font-size: 6.5px; font-weight: 700;
  border: 1.5px solid var(--surface-strong);
  margin-left: -5px;
}
.prepared .mini:first-child { margin-left: 0; }

.brief-body {
  font-size: 14px; color: var(--muted); line-height: 1.55;
  max-width: 620px; margin-top: 8px;
}
.brief-body:first-of-type { margin-top: 0; }

.brief-section { margin-top: 34px; }
.sec-head {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 12px;
}
.sec-title { font-size: 13px; font-weight: 690; letter-spacing: -0.1px; }
.sec-link { font-size: 11.5px; color: var(--ember); font-weight: 600; margin-left: auto; }

/* needs you */
.need-card {
  display: flex; align-items: center; gap: 13px;
  border: 0.5px solid #f3d9bd;
  background: linear-gradient(180deg, #fff9f2, #fdf0e2);
  border-radius: 13px;
  padding: 13px 16px;
  margin-bottom: 8px;
  font-size: 13px;
  box-shadow: 0 2px 8px rgba(232,89,12,0.06);
}
.need-card .pen {
  width: 32px; height: 32px; border-radius: 10px; flex: none;
  background: var(--surface-strong);
  border: 0.5px solid #f0dcc0;
  display: grid; place-items: center; font-size: 14px;
  box-shadow: 0 1px 3px rgba(40,30,20,0.06);
}
.need-card .ntext b { font-weight: 650; }
.need-card .nsub { font-size: 11px; color: var(--muted); margin-top: 1.5px; }
.need-card .spacer { flex: 1; }
.btn {
  font-size: 11.5px; font-weight: 630; padding: 6px 13px;
  border-radius: 8px; border: 0.5px solid var(--line-strong);
  background: var(--surface-strong); color: var(--text);
  box-shadow: 0 1px 2px rgba(40,30,20,0.05);
}
.btn.primary {
  background: linear-gradient(150deg, #f0620d, var(--ember-deep));
  border-color: transparent; color: #fff;
  box-shadow: 0 2px 8px var(--ember-glow), inset 0 0.5px 0 rgba(255,255,255,0.3);
}
.btn:disabled { opacity: 0.5; cursor: default; }

/* needs you page */
.need-card.resolving { opacity: 0.55; transition: opacity 160ms ease; }
.need-card .env { margin-left: 8px; }
.kind-chip {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
}
.kind-chip.approval { background: var(--amber-soft); color: var(--amber); }
.kind-chip.violation { background: var(--ember-soft, #fdeeee); color: var(--ember); }
.ny-error { font-size: 11px; color: var(--ember); margin-top: 3px; }
.ny-links { display: flex; gap: 12px; margin-top: 4px; }
.ny-links .sec-link { margin-left: 0; }
.ny-empty {
  font-size: 13px; color: var(--muted);
  padding: 22px 4px; text-align: left;
}

/* in motion rows */
.motion-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 4px;
  border-bottom: 0.5px solid var(--line);
  font-size: 13px;
}
.motion-row:last-child { border-bottom: none; }
.motion-row .avatar { width: 26px; height: 26px; font-size: 10px; }
.m-meta { flex: 1; min-width: 0; }
.m-title { font-weight: 620; font-size: 13px; letter-spacing: -0.1px; }
.m-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.m-sub b { color: var(--text); font-weight: 600; }
.m-state { font-size: 11px; color: var(--faint); display: flex; align-items: center; gap: 6px; flex: none; }
.m-state.live { color: var(--green); font-weight: 640; }
.m-state.live i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: breathe 1.8s ease-in-out infinite;
}
.m-state .tick {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 8px;
}

/* property cards */
.prop-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.prop-card {
  border: 0.5px solid var(--line);
  background: var(--surface-strong);
  border-radius: 13px;
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(40,30,20,0.04);
}
.prop-name { font-size: 13px; font-weight: 670; letter-spacing: -0.1px; display: flex; align-items: center; gap: 7px; }
.prop-name .pd { width: 7px; height: 7px; border-radius: 2.5px; background: linear-gradient(150deg,#ff9d2e,var(--ember)); }
.prop-line { font-size: 11.5px; color: var(--muted); margin-top: 7px; line-height: 1.5; }
.prop-line b { color: var(--text); font-weight: 620; }
.prop-chip {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 10px;
  font-size: 10px; font-weight: 650;
  padding: 3px 9px; border-radius: 999px;
}
.pc-green { background: var(--green-soft); color: var(--green); }
.pc-amber { background: var(--amber-soft); color: var(--amber); }
.pc-grey { background: #f1efec; color: var(--faint); }

/* composer — on the page, the way in */
.ask-wrap { flex: none; padding: 14px 40px 26px; }
.ask-inner { max-width: 860px; margin: 0 auto; }
.ask {
  display: flex; align-items: center; gap: 12px;
  border: 0.5px solid var(--line-strong);
  background: var(--surface-strong);
  border-radius: 15px;
  padding: 15px 19px;
  box-shadow: 0 2px 6px rgba(40,30,20,0.05), 0 10px 30px rgba(40,30,20,0.07);
}
.ask .hint { color: var(--faint); font-size: 13.5px; flex: 1; }
.ask input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-family: var(--ui); font-size: 13.5px; color: var(--text);
}
.ask input::placeholder { color: var(--faint); }
.ask .ic { color: var(--faint); font-size: 13px; }
.ask .send {
  width: 28px; height: 28px; border-radius: 9px;
  background: linear-gradient(150deg, #f0620d, var(--ember-deep));
  color: #fff; display: grid; place-items: center; font-size: 13px;
  box-shadow: 0 2px 7px var(--ember-glow);
  cursor: pointer; flex: none;
}

/* ── Composer attach: + button, chips, file browser ── */
.ask .attach-btn {
  width: 28px; height: 28px; border-radius: 9px; flex: none;
  display: grid; place-items: center; font-size: 15px;
  color: var(--muted); background: var(--surface-soft);
  border: 0.5px solid var(--line-strong); cursor: pointer;
}
.ask .attach-btn.on { color: var(--ember); border-color: var(--ember); background: var(--ember-soft); }

.attach-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 2px 9px; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px 4px 7px; border-radius: 10px;
  background: var(--surface-strong); border: 0.5px solid var(--line-strong);
  font-size: 12px; color: var(--text);
  box-shadow: 0 1px 3px rgba(40,30,20,0.05);
}
.attach-chip .ac-doc { font-size: 12px; }
.attach-chip .ac-name { font-weight: 620; }
.attach-chip .ac-size { color: var(--faint); }
.attach-chip .ac-x { margin-left: 3px; color: var(--faint); cursor: pointer; font-size: 10px; }
.attach-chip .ac-x:hover { color: var(--ember); }

.file-browser {
  margin: 0 2px 11px; border-radius: 12px;
  background: var(--surface-strong); border: 0.5px solid var(--line-strong);
  box-shadow: 0 2px 6px rgba(40,30,20,0.05), 0 12px 34px rgba(40,30,20,0.09);
  overflow: hidden;
}
.file-browser .fb-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 13px; border-bottom: 0.5px solid var(--line);
}
.fb-title { font-weight: 650; font-size: 12.5px; }
.fb-x { color: var(--faint); cursor: pointer; font-size: 11px; }
.fb-x:hover { color: var(--ember); }
.fb-empty { padding: 18px 14px; color: var(--faint); font-size: 12.5px; text-align: center; }

.fb-source {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; cursor: pointer; font-size: 12.5px;
  border-bottom: 0.5px solid var(--line);
}
.fb-source:last-child { border-bottom: none; }
.fb-source:hover { background: var(--surface-soft); }
.fb-src-ic { font-size: 14px; }

.fb-crumbs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 2px;
  padding: 8px 13px; border-bottom: 0.5px solid var(--line);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.fb-crumb { cursor: pointer; padding: 1px 4px; border-radius: 5px; }
.fb-crumb:hover { background: var(--surface-soft); color: var(--ember); }
.fb-sep { color: var(--faint); }

.fb-list { max-height: 260px; overflow-y: auto; }
.fb-row {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px; cursor: pointer; font-size: 12.5px;
  border-bottom: 0.5px solid var(--line);
}
.fb-row:last-child { border-bottom: none; }
.fb-row:hover { background: var(--surface-soft); }
.fb-row.busy { opacity: 0.6; cursor: default; }
.fb-ic { font-size: 13px; flex: none; }
.fb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-size { color: var(--faint); font-family: var(--mono); font-size: 10.5px; }
.fb-chev { color: var(--faint); }
.fb-spin { color: var(--ember); }

/* ── Attachment row in a thread body ── */
.attachment-row {
  display: flex; align-items: center; gap: 9px;
  margin-top: 8px; padding: 9px 12px;
  border: 0.5px solid var(--line); border-radius: 10px;
  background: var(--surface-soft); max-width: 440px;
}
.attachment-row .ic {
  width: 20px; height: 20px; border-radius: 6px; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--surface-strong); border: 0.5px solid var(--line);
}
.attachment-row .att-meta { min-width: 0; }
.attachment-row .att-name { font-weight: 640; font-size: 12.5px; color: var(--text); text-decoration: none; }
.attachment-row .att-name:hover { color: var(--ember); text-decoration: underline; }
.attachment-row .att-sub { display: flex; gap: 5px; color: var(--faint); font-size: 11px; margin-top: 2px; }
.attachment-row .att-keep {
  flex: none; padding: 4px 9px; border-radius: 8px;
  border: 0.5px solid var(--line-strong); background: var(--surface-strong);
  color: var(--muted); font-family: var(--ui); font-size: 11.5px; cursor: pointer;
}
.attachment-row .att-keep:hover { color: var(--ember); border-color: var(--ember); }
.attachment-row .att-kept {
  flex: none; color: var(--green); font-size: 11.5px; font-weight: 600;
  background: none; border: 0.5px solid transparent; border-radius: 8px;
  padding: 4px 9px; font-family: var(--ui); cursor: pointer;
}
.attachment-row .att-kept:hover { color: var(--red); border-color: var(--line-strong); }
.att-image {
  display: block; margin-top: 8px; max-width: 100%; max-height: 360px;
  border-radius: 10px; border: 0.5px solid var(--line);
}

/* ================= THREADS ================= */

.spine { margin-top: 8px; }

.day-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 8px 0 18px; color: var(--faint);
  font-size: 10px; font-weight: 650; letter-spacing: 1px; text-transform: uppercase;
}
.day-divider::before, .day-divider::after { content: ""; flex: 1; height: 0.5px; background: var(--line); }

.msg { display: flex; gap: 12px; margin-bottom: 4px; }
.msg > .avatar { width: 31px; height: 31px; font-size: 12.5px; margin-top: 2px; }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-author { font-size: 13px; font-weight: 670; letter-spacing: -0.1px; }
.msg-role { font-size: 10px; color: var(--faint); font-weight: 560; letter-spacing: 0.3px; text-transform: uppercase; }
.msg-time { font-size: 10.5px; color: var(--faint); }
.msg-text { font-size: 13.5px; line-height: 1.55; margin-top: 2.5px; white-space: pre-line; }
.msg-text b { font-weight: 640; }

.gap { height: 4px; }

/* Threads — the hero element. Colored rail = who owns the work. */
.thread {
  margin: 10px 0 4px;
  background: var(--surface-strong);
  border: 0.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(40,30,20,0.04);
}
.thread::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.thread.by-violet::before { background: linear-gradient(180deg, #a78bfa, #6d28d9); }
.thread.by-cyan::before   { background: linear-gradient(180deg, #22d3ee, #0e7490); }
.thread.by-moss::before   { background: linear-gradient(180deg, #a3e635, #4d7c0f); }
.thread.by-slate::before  { background: linear-gradient(180deg, #a8b0ba, #5f6b78); }

.thread-head {
  display: flex; align-items: center; gap: 9px;
  padding: 8.5px 14px 8.5px 16px;
  background: var(--surface-soft);
  border-bottom: 0.5px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.thread-head .tname { font-weight: 650; color: var(--text); letter-spacing: -0.1px; }
.thread-head .spacer { flex: 1; }

/* Slice D4 — a thread head/preview that opens into its room. */
.thread-head.clickable, .collapsed-thread.clickable { cursor: pointer; }
.thread-head.clickable:hover .tname { text-decoration: underline; }
.collapsed-thread.clickable:hover { background: var(--surface-soft); }
.room-back { display: inline-block; margin-bottom: 12px; cursor: pointer; text-decoration: none; }

.env {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 9px; font-weight: 650; letter-spacing: 0.3px;
  padding: 2.5px 8px; border-radius: 999px;
  background: #f1efec; color: var(--faint);
}
.env.write { background: var(--amber-soft); color: var(--amber); }
.env.build { background: var(--green-soft); color: var(--green); }

.resolved {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--green); font-weight: 620;
}
.resolved .tick {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green); color: #fff;
  display: grid; place-items: center; font-size: 8px;
}
.replies { font-size: 10.5px; color: var(--faint); }

@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10.5px; color: var(--green); font-weight: 650;
}
.live-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  animation: livepulse 1.6s ease-in-out infinite;
}

.thread-msgs { padding: 11px 14px 5px 16px; }
.tmsg { display: flex; gap: 9px; margin-bottom: 11px; }
.tmsg > .avatar { width: 22px; height: 22px; font-size: 9px; margin-top: 1px; }
.tmsg .msg-author { font-size: 12px; }
.tmsg .msg-text { font-size: 12.5px; margin-top: 1px; }

.activity {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: var(--faint);
  padding: 0 0 11px 31px;
}
.activity .ic {
  width: 16px; height: 16px; border-radius: 5px; flex: none;
  background: var(--surface-soft); border: 0.5px solid var(--line);
  display: grid; place-items: center; font-size: 9px;
}
.activity b { color: var(--muted); font-weight: 620; }
.activity.referral { color: var(--amber); }
.activity.referral .ic { background: var(--amber-soft); border-color: var(--amber); }
.activity.referral b { color: var(--amber); }
/* A faulted turn — the model overran its context, or the run errored before finishing.
   Quiet red row (mirrors the .referral amber pattern) so the failure reads honestly. */
.activity.error { color: var(--red); }
.activity.error .ic { background: var(--red-soft); border-color: var(--red); }
.activity.error b { color: var(--red); }
.activity .cap {
  font-family: var(--mono); font-size: 10px;
  background: var(--surface-soft); border: 0.5px solid var(--line);
  padding: 1px 6px; border-radius: 5px; color: var(--muted);
}
/* The personal identity a user-scoped connection served the call under — kept subtle. */
.activity .as-user { color: var(--faint); }

.figures {
  margin-top: 8px; border: 0.5px solid var(--line);
  border-radius: 10px; overflow: hidden; max-width: 440px;
  font-size: 12px;
}
.figures .frow { display: flex; justify-content: space-between; align-items: center; padding: 6.5px 13px; border-bottom: 0.5px solid var(--line); }
.figures .frow:last-child { border-bottom: none; background: var(--surface-soft); font-weight: 660; }
.figures .fval { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.figures .bar { height: 3px; border-radius: 2px; background: var(--ember-soft); position: relative; margin-top: 3px; }
.figures .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: linear-gradient(90deg, #ff9d2e, var(--ember)); }
.figures .fcell { flex: 1; padding-right: 24px; }

.resource-card {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px; max-width: 440px;
  border: 0.5px solid var(--line);
  background: var(--surface-soft);
  border-radius: 10px;
  padding: 10px 14px;
}
.resource-card .ric {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--surface-strong); border: 0.5px solid var(--line);
  display: grid; place-items: center; font-size: 14px;
}
.resource-card .rmeta { min-width: 0; flex: 1; }
.resource-card .rname { font-weight: 650; font-size: 12.5px; }
.resource-card .rurl { font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.resource-card .rstate {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; color: var(--green); font-weight: 620; margin-top: 3px;
}
.resource-card .rstate i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.resource-card .spacer { flex: 1; }

.collapsed-thread {
  display: inline-flex; align-items: center; gap: 9px;
  margin-top: 8px;
  border: 0.5px solid var(--line);
  background: var(--surface-strong);
  border-radius: 10px;
  padding: 7px 13px;
  font-size: 12px; color: var(--muted);
  box-shadow: 0 1px 3px rgba(40,30,20,0.04);
}
.collapsed-thread .facepile { display: flex; }
.collapsed-thread .facepile .avatar { width: 18px; height: 18px; font-size: 7.5px; margin-left: -6px; border: 1.5px solid var(--surface-strong); }
.collapsed-thread .facepile .avatar:first-child { margin-left: 0; }
.collapsed-thread .link { color: var(--ember); font-weight: 620; font-size: 11.5px; }

/* Blazor default error UI, restyled minimally to fit the porcelain palette instead of Bootstrap. */
#blazor-error-ui {
  background: var(--surface-strong);
  bottom: 0;
  box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
  display: none;
  left: 0;
  padding: 0.6rem 1.25rem 0.7rem 1.25rem;
  position: fixed;
  width: 100%;
  z-index: 1000;
  font-family: var(--ui);
  color: var(--text);
}
#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

/* ---- Org settings stub (slice 3) ---- */
.settings-row {
  display: flex; align-items: center; gap: 13px;
  border: 0.5px solid var(--line);
  background: var(--surface-soft);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.settings-row.disabled { opacity: 0.55; }
.settings-row .sr-glyph { width: 20px; text-align: center; font-size: 14px; color: var(--faint); }
.settings-row .sr-title { font-size: 13px; font-weight: 620; }
.settings-row .sr-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.settings-hint { font-size: 11.5px; color: var(--faint); margin-top: 10px; font-style: italic; }

/* ---- Connectors page ---- */
.org-line .cog { transition: color 120ms ease; }
.org-line .cog:hover { color: var(--ember); }

.connector-card {
  border: 0.5px solid var(--line);
  background: var(--surface-strong);
  border-radius: 13px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(40,30,20,0.05);
}
.connector-card.flip {
  border-color: #b7e2c6;
  background: linear-gradient(180deg, #f4fbf6, var(--green-soft));
  animation: cx-flip 420ms ease;
}
@keyframes cx-flip { 0% { transform: scale(0.985); opacity: 0.6; } 100% { transform: scale(1); opacity: 1; } }

.cx-head { display: flex; align-items: center; gap: 13px; }
.cx-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-size: 16px; color: #fff;
  box-shadow: 0 1px 3px rgba(40,30,20,0.10);
}
.cx-logo.m365 { background: linear-gradient(150deg, #ff7a2f, var(--ember-deep)); }
.cx-logo.converge { background: linear-gradient(150deg, #7a6ff0, #4b3bcf); }
.cx-logo.ledger { background: linear-gradient(150deg, #5aa9c9, #2f7f9c); }
.cx-logo.bridge { background: linear-gradient(150deg, #7fbf8a, #3f9d55); }

.cx-titles { flex: 1; min-width: 0; }
.cx-name { font-size: 14px; font-weight: 660; letter-spacing: -0.2px; }
.cx-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.cx-chip {
  flex: none; padding: 2px 9px; border-radius: 999px;
  font-size: 10.5px; font-weight: 640; white-space: nowrap;
}
.cx-chip.green { background: var(--green-soft); color: var(--green); }
.cx-chip.amber { background: var(--amber-soft); color: var(--amber); }
.cx-chip.grey  { background: #f1efec; color: var(--faint); }

.cx-body { margin-top: 12px; padding-left: 47px; }
.cx-line { font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 560px; }
.cx-note { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.cx-error { font-size: 11.5px; color: var(--ember); margin-top: 8px; }

.cx-caps { display: flex; flex-wrap: wrap; gap: 6px; }
.cap-chip {
  padding: 2px 9px; border-radius: 7px;
  border: 0.5px solid var(--line-strong);
  background: var(--surface-soft);
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
}

.cx-actions { margin-top: 12px; display: flex; gap: 8px; align-items: center; }
.cx-actions .cx-confirm { font-size: 12px; color: var(--muted); margin-right: 2px; }

/* Quiet cross-link between the org and personal connection surfaces. */
.cx-crosslink { margin-top: 22px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.cx-crosslink a { font-size: 13px; font-weight: 600; color: var(--ember); text-decoration: none; }
.cx-crosslink a:hover { text-decoration: underline; }
.cx-crosslink .cx-crosslink-note { font-size: 11.5px; color: var(--faint); }

.cx-code-lead { font-size: 12.5px; color: var(--muted); }
.device-code {
  margin: 12px 0 4px;
  font-family: var(--mono);
  letter-spacing: .2em; font-size: 28px; font-weight: 700;
  color: var(--text); user-select: all;
}
.cx-code-meta { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.cx-code-meta a { font-size: 12px; color: var(--ember); font-weight: 600; }
.cx-countdown { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.cx-waiting {
  display: flex; align-items: center; gap: 7px;
  margin-top: 12px; font-size: 12px; color: var(--green); font-weight: 600;
}
.cx-waiting i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  animation: breathe 1.8s ease-in-out infinite;
}

.cx-bridge-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0;
  border-bottom: 0.5px solid var(--line);
}
.cx-bridge-row:last-child { border-bottom: none; }
.cx-bridge-name { font-size: 12.5px; font-weight: 620; }

/* ---- Connector firewall rules panel ---- */


.rule-reorder { display: flex; flex-direction: column; gap: 1px; }
.rule-arrow {
  border: 0; background: none; cursor: pointer;
  font-size: 8px; line-height: 8px; color: var(--faint); padding: 1px 2px;
}
.rule-arrow:hover:not(:disabled) { color: var(--ember); }
.rule-arrow:disabled { opacity: 0.3; cursor: default; }



.rule-del {
  flex: none; border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--faint); padding: 2px 4px; line-height: 1;
}
.rule-del:hover:not(:disabled) { color: var(--red); }
.rule-del:disabled { opacity: 0.4; cursor: default; }

.rule-add, .rule-preview {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.rule-add { margin-bottom: 8px; }
.rule-input {
  flex: 1; min-width: 160px;
  font-size: 12px; padding: 6px 10px;
  border: 0.5px solid var(--line-strong); border-radius: 9px;
  background: var(--surface-strong); color: var(--text);
  font-family: var(--mono);
}
.rule-input:focus { outline: none; border-color: var(--ember); }
.rule-input::placeholder { color: var(--faint); font-family: var(--sans, inherit); }
.rule-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.rule-toggle input { accent-color: var(--ember); }
.rule-select {
  font-size: 11.5px; font-weight: 600; padding: 6px 8px;
  border: 0.5px solid var(--line-strong); border-radius: 9px;
  background: var(--surface-strong); color: var(--text);
}
.rule-addbtn { flex: none; }

.rule-validation { font-size: 11px; color: var(--red); margin: 0 0 8px; }

.rule-preview {
  margin-top: 10px; padding-top: 10px;
  border-top: 0.5px dashed var(--line);
}
.preview-input { font-family: var(--mono); }
.preview-out {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; color: var(--muted); white-space: nowrap;
}
.preview-out.muted { color: var(--faint); }
.preview-rule { color: var(--faint); }
.preview-rule code { font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* ── Connector console (design: mockups/connector-console.html) ── */
.console-page { padding: 30px 40px; max-width: 900px; }
.console-crumb { font-size: 10.5px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--faint); margin-bottom: 5px; }
.console-title { display: flex; align-items: center; gap: 12px; }
.console-title h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.console-glyph { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; color: #fff; }
.console-sub { color: var(--faint); margin: 6px 0 20px; max-width: 640px; }
.console-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.console-tab { padding: 8px 14px; cursor: pointer; color: var(--faint); font-weight: 620; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 13.5px; }
.console-tab:hover { color: var(--text); }
.console-tab.active { color: var(--text); border-bottom-color: var(--ember); }
.console-tab-count { font-size: 10.5px; background: var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 5px; color: var(--faint); }
.console-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; }
.console-card h3 { font-size: 13px; font-weight: 700; margin: 0 0 3px; }
.console-hint { font-size: 12.5px; color: var(--faint); margin-bottom: 12px; }
.console-empty { font-size: 13px; color: var(--faint); padding: 10px 4px; }
.console-btn { border: none; border-radius: 9px; padding: 8px 16px; font-weight: 620; font-size: 13px; cursor: pointer; background: var(--ember); color: #fff; }
.console-btn:disabled { opacity: 0.4; cursor: default; }
.console-btn.ghost { background: var(--surface-strong, #f1ede6); color: var(--text); }
.console-hardstop { display: flex; gap: 9px; align-items: center; background: var(--amber-soft); border: 1px solid #ecd9b8; border-radius: 11px; padding: 11px 14px; font-size: 12.5px; color: #7c5a1e; margin-bottom: 14px; }

.glance-table { width: 100%; border-collapse: collapse; }
.glance-table th { font-size: 10.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); text-align: left; padding: 4px 10px; font-weight: 600; }
.glance-table td { padding: 7px 10px; border-top: 1px solid var(--line); font-size: 13px; }
.glance-agent { display: flex; align-items: center; gap: 8px; }
.glance-role { color: var(--faint); font-size: 11.5px; }
.console-av { width: 22px; height: 22px; font-size: 10px; }
.console-av-mini { width: 18px; height: 18px; font-size: 9px; display: inline-grid; margin-right: 2px; }

.verdict-chip { font-size: 11.5px; font-weight: 700; padding: 3.5px 11px; border-radius: 999px; white-space: nowrap; }
.verdict-chip.un { background: var(--green-soft); color: var(--green); }
.verdict-chip.at { background: var(--amber-soft); color: var(--amber); }
.verdict-chip.dn { background: var(--red-soft); color: var(--red); }
.verdict-chip.df { background: var(--line); color: var(--faint); }

.probe-input { width: 100%; border: 1.5px solid var(--line); border-radius: 11px; padding: 10px 14px; font-family: var(--mono, ui-monospace); font-size: 13px; }
.probe-input:focus { outline: none; border-color: var(--ember); }
.probe-verdict { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 13px; }
.probe-why { color: var(--faint); }

.console-rule { display: flex; align-items: center; gap: 11px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; margin-bottom: 7px; background: #fdfcfa; }
.console-rule.default-rule { border-style: dashed; background: transparent; color: var(--faint); }
.rule-sentence { flex: 1; font-size: 13.5px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.rule-token { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--surface-strong, #f4f0ea); border-radius: 6px; padding: 1.5px 7px; }
.rule-fired { font-size: 11px; color: var(--faint); white-space: nowrap; }

.console-builder { background: linear-gradient(180deg, #fff, #fdfaf7); border: 1px dashed var(--line-strong); border-radius: 13px; padding: 15px 17px; margin-bottom: 14px; }
.builder-lead { font-size: 10.5px; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 10px; font-weight: 620; }
.builder-sentence { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-size: 14px; }
.b-word { color: var(--faint); }
.b-slot { position: relative; border: 1.5px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 10px; font-weight: 600; cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.b-slot:hover { border-color: var(--ember); }
.b-slot.empty { color: var(--faint); font-weight: 500; border-style: dashed; }
.b-caret { font-size: 9px; color: var(--faint); }
.b-slot.verdict-slot.un { background: var(--green-soft); border-color: #bfe0cb; color: var(--green); }
.b-slot.verdict-slot.at { background: var(--amber-soft); border-color: #e7d4ac; color: var(--amber); }
.b-slot.verdict-slot.dn { background: var(--red-soft); border-color: #efc7be; color: var(--red); }
.builder-impact { margin: 12px 0; font-size: 12.5px; color: var(--faint); }
.impact-idle { color: var(--faint); }

.verb-pill { border: 1.5px dashed var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; color: var(--faint); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; user-select: none; }
.verb-pill:hover { border-color: var(--ember); color: var(--text); }
.verb-pill.on { border-style: solid; border-color: #bfe0cb; background: var(--green-soft); color: var(--green); }
.verb-incl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.6; }

.console-pop { position: absolute; z-index: 50; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(60,50,40,0.16); padding: 8px; min-width: 290px; cursor: default; font-weight: 400; }
.console-pop h5 { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); padding: 6px 8px 4px; margin: 0; }
.pop-opt { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; }
.pop-opt:hover { background: var(--surface-strong, #f6f2ec); }
.pop-desc { font-size: 11.5px; color: var(--faint); font-weight: 400; }
.pop-meta { margin-left: auto; font-size: 11px; color: var(--faint); white-space: nowrap; }
.pop-tick { margin-left: auto; font-size: 14px; color: var(--green); }
.pop-input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; margin: 2px 0 4px; box-sizing: border-box; }
.pop-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.pop-swatch.un { background: var(--green); }
.pop-swatch.at { background: var(--amber); }
.pop-swatch.dn { background: var(--red); }

.scope-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: #fdfcfa; }
.scope-row.block { border-color: #f3d9d3; background: #fdf7f5; cursor: pointer; }
.scope-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.scope-dot.allow { background: var(--green); }
.scope-dot.block { background: var(--red); }
.scope-path { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; flex: 1; }
.scope-kind { font-size: 11px; color: var(--faint); white-space: nowrap; }
.scope-add { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.scope-error { margin-top: 8px; font-size: 12px; color: var(--red); }
.census { margin: -2px 0 8px 22px; padding: 7px 12px; border-left: 2px solid #f0cfc6; display: flex; flex-direction: column; gap: 5px; }
.census-row { font-size: 12px; color: var(--faint); }

.pack { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: #fdfcfa; }
.pack.on { border-color: #e9c7bb; background: linear-gradient(180deg, #fdf8f5, #fdfcfa); }
.pack-icon { font-size: 17px; margin-top: 1px; }
.pack-body { flex: 1; }
.pack-title { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.pack-count { font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-soft); border-radius: 999px; padding: 2px 9px; }
.pack-count.partial { color: var(--amber); background: var(--amber-soft); }
.pack-desc { font-size: 12.5px; color: var(--faint); margin: 2px 0 6px; }
.pack-pats { display: flex; gap: 5px; flex-wrap: wrap; }

.console-toggle { width: 34px; height: 20px; border-radius: 999px; background: var(--green); position: relative; cursor: pointer; flex: none; }
.console-toggle::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: #fff; top: 2px; right: 2px; box-shadow: 0 1px 2px rgba(0,0,0,0.2); }
.console-toggle.off { background: var(--line-strong); }
.console-toggle.off::after { right: auto; left: 2px; }

.pop-browser { width: 400px; padding: 0; overflow: hidden; }
.fb-head { padding: 9px 13px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--faint); }
.fb-crumb { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-bottom: 1px solid var(--line); font-size: 12px; }
.fb-crumb code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.fb-up { cursor: pointer; color: var(--faint); }
.fb-up:hover { color: var(--text); }
.fb-list { max-height: 260px; overflow-y: auto; padding: 6px; }
.fb-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 13px; }
.fb-item:hover { background: var(--surface-strong, #f6f2ec); }
.fb-name { cursor: pointer; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; flex: 1; }
.fb-inscope { font-size: 10.5px; font-weight: 700; color: var(--green); }
.fb-allow { border: 1px solid var(--line); background: #fff; border-radius: 7px; font-size: 11px; padding: 3px 10px; cursor: pointer; font-weight: 620; }
.fb-allow:hover { border-color: var(--ember); color: var(--ember); }

.act-row { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.act-row:last-child { border-bottom: none; }
.act-when { font-size: 11.5px; color: var(--faint); width: 56px; flex: none; }
.act-who { font-weight: 620; width: 60px; flex: none; }
.act-what { flex: 1; color: var(--faint); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.act-rule { font-size: 11.5px; }

.deleg { display: flex; gap: 14px; align-items: flex-start; }
.console-link { display: flex; align-items: center; gap: 6px; padding: 10px 2px 2px; font-size: 13px; font-weight: 620; color: var(--text); text-decoration: none; border-top: 1px solid var(--line); margin-top: 10px; }
.console-link:hover { color: var(--ember); }
.cl-arrow { color: var(--faint); }
.console-link:hover .cl-arrow { color: var(--ember); }

/* ── Threads overview: clean rows + search (wireframe: mockups/threads-wireframe.html) ── */
.threads-head { display: flex; align-items: center; gap: 10px; }
.threads-head .brief-title { flex: 1; }
.thread-search-btn { border: 1.5px solid var(--line-strong); background: #fff; border-radius: 9px; width: 32px; height: 32px; font-size: 15px; color: var(--faint); cursor: pointer; display: grid; place-items: center; }
.thread-search-btn:hover { color: var(--text); border-color: var(--text); }
.thread-search-input { border: 1.5px solid var(--line-strong); border-radius: 9px; padding: 6px 12px; font-size: 13px; width: 220px; }
.thread-search-input:focus { outline: none; border-color: var(--ember); }
.thread-list { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; padding-bottom: 90px; }
.thread-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 40px 11px 14px; }
.thread-card.openable { cursor: pointer; }
.thread-card.openable:hover { border-color: var(--line-strong); box-shadow: 0 2px 8px rgba(40,30,20,0.06); }
.tc-arrow { position: absolute; top: 11px; right: 13px; color: var(--faint); font-size: 15px; }
.thread-card.openable:hover .tc-arrow, .motion-row.openable:hover .tc-arrow { color: var(--ember); }
.tc-title-row { display: flex; align-items: center; gap: 9px; }
.tc-title-row .avatar { width: 22px; height: 22px; font-size: 10px; }
.tc-title { font-weight: 640; font-size: 13.5px; }
.tc-preview { margin: 5px 0 0 31px; font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-meta { margin: 5px 0 0 31px; font-size: 11px; color: var(--faint); display: flex; gap: 6px; }
.tc-empty { color: var(--faint); font-size: 13px; padding: 18px 4px; }
.motion-row { position: relative; }
.motion-row.openable { cursor: pointer; border-radius: 10px; }
.motion-row.openable:hover { background: #fdfcfa; }
.motion-row .tc-arrow { top: 50%; transform: translateY(-50%); }

/* ── Org models console (wireframe: mockups/org-models-wireframe.html) ── */
.lib-group { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 12px 0 6px; }
.pol-head { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.pol-summary { font-size: 11.5px; color: var(--faint); font-family: ui-monospace, Menlo, monospace; }
.pol-origin { font-size: 11px; color: var(--faint); }
.pol-add { border: 1.5px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.pol-sim { border: 1.5px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pol-sim-verdict { font-size: 12px; color: var(--text); }
.pol-sim-verdict i { color: var(--amber); font-style: normal; }
.pol-select { border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; background: #fff; }
.pol-serving { font-size: 11.5px; color: var(--faint); margin-top: 4px; }
.pol-serving.fell { color: var(--amber); }
.prov-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 620; color: var(--faint); border: 1px solid var(--line); border-radius: 999px; padding: 2.5px 10px; cursor: pointer; position: relative; }
.prov-chip:hover { color: var(--text); border-color: var(--line-strong); }
.prov-pop { position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 34px rgba(60,50,40,.16); padding: 12px 14px; min-width: 300px; cursor: default; text-align: left; }
.prov-pop h5 { font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 0 7px; }
.prov-row { font-size: 12px; color: var(--faint); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.prov-row .ok { color: var(--green); }
.prov-row .skip { color: var(--red); }
.console-toggle.sm { width: 28px; height: 17px; }
.console-toggle.sm::after { width: 13px; height: 13px; }
.console-rule.off .rule-sentence, .console-rule.off .verdict-chip, .console-rule.off .rule-fired { opacity: .38; }
.console-tab:disabled { opacity: 0.4; cursor: default; }
.console-tab:disabled:hover { color: var(--faint); }

/* ── Integrations page (slice A2, DESIGN.md § Connections) ── */
.int-meta-chip {
  flex: none; padding: 2px 8px; border-radius: 6px; align-self: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  border: 0.5px solid var(--line-strong); color: var(--muted); background: var(--surface-soft);
}
.int-meta-chip.origin.muted { color: var(--faint); }
.int-system-note { font-size: 10.5px; color: var(--faint); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0; }
.cap-chip.linked { cursor: pointer; text-decoration: none; }
.cap-chip.linked:hover { border-color: var(--ember); color: var(--ember); }

/* ── Widget artifacts (W2: view-only Widget rendering — thread body + briefing pin) ── */
.widget-card {
  border: 0.5px solid var(--line);
  background: var(--surface-strong);
  border-radius: 14px;
  padding: 15px 17px;
  margin: 6px 0 10px;
  box-shadow: 0 1px 3px rgba(40,30,20,0.05);
}
.widget-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.widget-title { font-size: 13.5px; font-weight: 680; letter-spacing: -0.1px; }
.widget-owner { font-size: 10.5px; color: var(--faint); }
.widget-head .spacer { flex: 1; }
.widget-pin {
  font-size: 11px; font-weight: 620; color: var(--ember);
  background: none; border: none; padding: 2px 0; cursor: pointer;
}
.widget-pin:hover { text-decoration: underline; }
.widget-pin.pinned { color: var(--green); }
.widget-pin:disabled { opacity: 0.5; cursor: default; text-decoration: none; }

.widget-skel {
  height: 44px; border-radius: 9px;
  background: linear-gradient(90deg, var(--surface-soft) 25%, #efece6 37%, var(--surface-soft) 63%);
  background-size: 400% 100%;
  animation: widget-shimmer 1.4s ease infinite;
}
@keyframes widget-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
.widget-empty, .widget-broken, .widget-view-empty {
  font-size: 12px; color: var(--faint); padding: 8px 2px;
}
.widget-broken { font-style: italic; }

.widget-views { display: flex; flex-wrap: wrap; gap: 16px; }
.widget-view-label { font-size: 11px; font-weight: 630; color: var(--muted); margin-bottom: 8px; }

/* stat */
.widget-stat {
  flex: 1 1 110px;
  border: 0.5px solid var(--line);
  background: var(--surface-soft);
  border-radius: 11px;
  padding: 12px 14px;
}
.widget-stat-value { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; line-height: 1.1; }
.widget-stat-label { font-size: 11px; color: var(--muted); margin-top: 3px; }

/* breakdown (donut) */
.widget-breakdown { flex: 1 1 100%; }
.widget-donut-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.widget-donut { width: 140px; height: 140px; flex: none; }
.donut-track { fill: none; stroke: var(--surface-soft); stroke-width: 20; }
.donut-seg { fill: none; stroke-width: 20; transform-origin: 80px 80px; transform: rotate(-90deg); }
.widget-legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.widget-legend-row { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend-cat { flex: 1; min-width: 0; }
.legend-count { color: var(--faint); font-variant-numeric: tabular-nums; }

/* table */
.widget-table { flex: 1 1 100%; overflow-x: auto; }
.widget-table-el { width: 100%; border-collapse: collapse; font-size: 12px; }
.widget-table-el th {
  text-align: left; font-size: 10.5px; font-weight: 640; color: var(--faint);
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 0 8px 6px 0; border-bottom: 0.5px solid var(--line);
}
.widget-table-el td { padding: 6px 8px 6px 0; border-bottom: 0.5px solid var(--line); color: var(--text); }
.widget-table-el tr:last-child td { border-bottom: none; }

/* pinned section on the briefing */
.pinned-widgets { display: flex; flex-direction: column; gap: 12px; }

/* ── Pages (Z2: layout templates + zone stacks — the composition surface) ── */
.page-header { margin-bottom: 20px; }
.page-owner { font-size: 11px; color: var(--faint); margin-top: 4px; }
.page-empty { font-size: 12.5px; color: var(--faint); padding: 8px 2px; }

.page-sections { display: flex; flex-direction: column; gap: 20px; }
.page-grid { display: grid; gap: 20px; align-items: start; }
.page-grid-one-column { grid-template-columns: 1fr; }
.page-grid-two-column { grid-template-columns: 2fr 1fr; }
.page-grid-halves { grid-template-columns: 1fr 1fr; }
.page-grid-thirds { grid-template-columns: 1fr 1fr 1fr; }

.page-zone { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ── Z3: edit mode — the ribbon, and per-widget control strips ── */
.page-edit-toggle {
  font-size: 12px; font-weight: 620; color: var(--ember); cursor: pointer;
  margin-top: 6px; display: inline-block;
}
.page-edit-toggle:hover { text-decoration: underline; }

.page-save-errors {
  background: var(--red-soft); border: 0.5px solid #f3c9c2; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px; font-size: 12.5px; color: var(--red);
}
.page-save-errors div + div { margin-top: 3px; }

/* ── PE-V2b: the ribbon-v2 editor — see mockups/ribbon-v2.html, the spec this mirrors verbatim in
   spacing/radii/borders/fold behavior. Colours are this app's own variables, not the mock's palette. ── */

.pe-shell { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }

/* The ribbon: docked full-width at the top of the content pane, not the window — an accordion, not a
   toolbar. The command row folds via max-height/opacity; any selection unfolds it. */
.ribbon {
  position: relative; flex-shrink: 0; background: linear-gradient(var(--surface-strong), var(--surface-soft));
  border-bottom: 0.5px solid var(--line); padding: 0 22px;
}
.pr-row {
  display: flex; flex-wrap: nowrap; align-items: stretch; gap: 0;
  max-height: 360px; padding-bottom: 14px;
  /* overflow stays VISIBLE while open so gallery flyouts can escape the row;
     the fold transition and folded state clip it (that's what the fold is). */
  overflow: visible;
  transition: max-height .22s ease, opacity .18s ease, padding .22s ease; opacity: 1;
}
.ribbon.pr-folded .pr-row { max-height: 0; opacity: 0; padding-bottom: 0; overflow: hidden; }

.pr-fold-tab {
  position: absolute; left: 50%; bottom: 0; transform: translate(-50%, 50%);
  border: 0.5px solid var(--line); background: var(--surface-strong); border-radius: 999px;
  width: 44px; height: 18px; cursor: pointer; color: var(--faint); font-size: 9px; line-height: 1;
  display: grid; place-items: center; box-shadow: 0 1px 3px rgba(40,30,20,.1); z-index: 25;
}
.pr-fold-tab:hover { border-color: var(--ember); color: var(--ember); }
.pr-fold-tab i { font-style: normal; display: inline-block; transition: transform .2s; }
.pr-fold-tab i.pr-flip { transform: rotate(180deg); }

.ribbon-title { display: flex; align-items: center; gap: 14px; padding: 14px 0 10px; }
.ribbon-title h1 { font-size: 19px; font-weight: 700; margin: 0; }
.pr-mode {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--ember-deep);
  background: var(--ember-soft); border: 0.5px solid #f3d3bd; padding: 3px 9px; border-radius: 999px;
}
.pr-spacer { flex: 1; }
.pr-actions {
  display: flex; align-items: center; background: var(--surface-strong); border: 0.5px solid var(--line);
  border-radius: 999px; padding: 3px; box-shadow: 0 1px 2px rgba(40,30,20,.05);
}
.pr-quiet { border: 0; background: none; color: var(--muted); font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.pr-quiet:hover:not(:disabled) { color: var(--red); background: var(--red-soft); }
.pr-quiet:disabled { opacity: .5; cursor: default; }
.pr-save {
  border: 0; background: var(--ember); color: #fff; font-weight: 600; font-size: 13px;
  padding: 6px 18px; border-radius: 999px; cursor: pointer; box-shadow: 0 1px 3px var(--ember-glow);
}
.pr-save:hover:not(:disabled) { background: var(--ember-deep); }
.pr-save:disabled { opacity: .6; cursor: default; }

.pr-group { display: flex; flex-direction: column; gap: 7px; padding: 0 18px; border-left: 0.5px solid var(--line); min-width: 0; flex-shrink: 0; }
.pr-group:first-child { padding-left: 0; border-left: 0; }
.pr-rel { position: relative; }
.pr-label { font-size: 10px; font-weight: 600; letter-spacing: .09em; color: var(--faint); text-transform: uppercase; }
.pr-items { display: flex; gap: 8px; align-items: center; flex: 1; }

.pr-thumb { width: 66px; cursor: pointer; border: 1.5px solid var(--line); border-radius: 9px; padding: 5px 5px 3px; background: var(--surface-strong); text-align: center; }
.pr-thumb:hover { border-color: var(--line-strong); }
.pr-thumb.pr-sel { border-color: var(--ember); background: var(--ember-soft); }
.pr-thumb.pr-disabled { opacity: .4; pointer-events: none; }
.pr-sketch { height: 30px; display: flex; gap: 3px; }
.pr-sketch i { background: var(--line-strong); border-radius: 3px; flex: 1; display: block; }
.pr-thumb.pr-sel .pr-sketch i { background: #efc8ae; }
.pr-sketch i.pr-wide { flex: 2; }
.pr-tname { font-size: 9.5px; color: var(--faint); margin-top: 3px; }
.pr-thumb.pr-sel .pr-tname { color: var(--ember-deep); font-weight: 600; }

.pr-collapsed-btn {
  display: none; align-items: center; gap: 8px; border: 0.5px solid var(--line); background: var(--surface-strong);
  border-radius: 9px; padding: 6px 12px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.pr-collapsed-btn:hover { border-color: var(--line-strong); }
.pr-collapsed-btn .pr-sketch { height: 18px; width: 30px; display: flex; gap: 2px; }

.pr-rbtn { border: 0.5px solid var(--line); background: var(--surface-strong); border-radius: 9px; padding: 7px 14px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pr-rbtn:hover:not(:disabled) { border-color: var(--line-strong); }
.pr-rbtn:disabled { opacity: .5; cursor: default; }

/* Insert buttons carry a glyph + label + chevron always, so stage 0 can reflow them into big
   stacked buttons without a different markup — compact stages (1-3) just hide the glyph and read
   as a single line, unchanged from before. */
.pr-rbtn-insert { display: inline-flex; align-items: center; gap: 6px; }
.pr-rbtn-glyph { display: none; width: 16px; height: 16px; flex-shrink: 0; }
.pr-rbtn-glyph svg { width: 100%; height: 100%; fill: currentColor; }
.pr-rbtn-label { white-space: nowrap; }
.pr-rbtn-chevron { color: var(--faint); }

.pr-target {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px 11px; border-radius: 999px;
  border: 1.5px dashed var(--ember); color: var(--ember-deep); background: var(--ember-soft); font-weight: 600; white-space: nowrap;
}
.pr-target small { font-weight: 400; color: var(--faint); margin-left: 2px; }

.pr-flyout {
  position: absolute; top: 100%; left: 0; margin-top: 8px; background: var(--surface-strong);
  border: 0.5px solid var(--line); border-radius: 14px; box-shadow: 0 10px 34px rgba(40,30,20,.18);
  padding: 12px; z-index: 95;
}
.pr-flyout-wide { width: 460px; }
.pr-mh { font-size: 10px; font-weight: 600; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; padding: 2px 4px 8px; }

.pr-menu {
  position: absolute; top: 100%; left: 0; background: var(--surface-strong); border: 0.5px solid var(--line);
  border-radius: 14px; box-shadow: 0 10px 34px rgba(40,30,20,.18); padding: 10px; margin-top: 8px;
  z-index: 90; width: 460px; max-height: 60vh; overflow-y: auto;
}
.pr-mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pr-mcard { border: 1.5px solid var(--line); border-radius: 11px; padding: 9px; cursor: pointer; background: var(--surface-strong); }
.pr-mcard:hover { border-color: var(--ember); background: var(--ember-soft); }
.pr-mtitle { font-size: 12px; font-weight: 600; display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pr-mby { font-size: 10px; color: var(--faint); font-weight: 400; white-space: nowrap; }
.pr-mempty { grid-column: 1 / -1; font-size: 12px; color: var(--faint); padding: 8px 4px; }

/* One line, always — collapse stages 0→3, driven by wwwroot/js/ribbon.js measuring pr-row against its
   container and stamping data-stage on .ribbon. Never wraps. */
.ribbon[data-stage="1"] .pr-thumb, .ribbon[data-stage="2"] .pr-thumb, .ribbon[data-stage="3"] .pr-thumb { width: 40px; padding: 4px 4px 3px; }
.ribbon[data-stage="1"] .pr-sketch, .ribbon[data-stage="2"] .pr-sketch, .ribbon[data-stage="3"] .pr-sketch { height: 22px; }
.ribbon[data-stage="1"] .pr-tname, .ribbon[data-stage="2"] .pr-tname, .ribbon[data-stage="3"] .pr-tname { display: none; }
.ribbon[data-stage="1"] .pr-target small, .ribbon[data-stage="2"] .pr-target small, .ribbon[data-stage="3"] .pr-target small { display: none; }

.ribbon[data-stage="2"] #pr-layout-full, .ribbon[data-stage="3"] #pr-layout-full { display: none; }
.ribbon[data-stage="2"] #pr-layout-collapsed, .ribbon[data-stage="3"] #pr-layout-collapsed { display: inline-flex; }

.ribbon[data-stage="3"] #pr-insert-full { display: none; }
.ribbon[data-stage="3"] #pr-insert-collapsed { display: inline-flex; }

/* ── Stage 0 only: the expanded ribbon enjoys its real estate, Word-style. Stages 1-3 above are
   untouched — these rules only fire when data-stage="0" (always stamped once ribbon.js has fit). ── */
.ribbon[data-stage="0"] #pr-layout-full { gap: 14px; }
.ribbon[data-stage="0"] #pr-layout-full .pr-thumb { width: 90px; padding: 8px 8px 6px; }
.ribbon[data-stage="0"] #pr-layout-full .pr-sketch { height: 52px; }
.ribbon[data-stage="0"] #pr-layout-full .pr-tname { font-size: 10.5px; margin-top: 5px; }

.ribbon[data-stage="0"] #pr-insert-full .pr-rbtn-insert {
  flex-direction: column; justify-content: center; align-items: center; height: 72px; width: auto;
  min-width: 76px; gap: 5px; padding: 10px 14px; font-size: 11.5px; white-space: normal;
}
.ribbon[data-stage="0"] #pr-insert-full .pr-rbtn-glyph { display: flex; width: 22px; height: 22px; color: var(--ember-deep); }
.ribbon[data-stage="0"] #pr-insert-full .pr-rbtn-plus { display: none; }
.ribbon[data-stage="0"] #pr-insert-full .pr-rbtn-chevron { font-size: 9px; opacity: .55; }

.ribbon[data-stage="0"] #pr-target-group { justify-content: center; }

/* ── Canvas: the stacked, editable sections ── */
.pe-canvas { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 22px 60px; }
.pe-rail {
  text-align: center; margin: 2px 0 14px; position: relative; height: 22px; cursor: pointer;
  opacity: .4; transition: opacity .12s;
}
.pe-rail:hover { opacity: 1; }
.pe-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px dashed var(--line-strong); }
.pe-rail span { position: relative; background: var(--surface); padding: 0 12px; font-size: 12px; color: var(--ember); font-weight: 600; }

.pe-section { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 26px 12px 12px; margin-bottom: 8px; cursor: default; }
.pe-section.pe-active { border-color: var(--ember); }
.pe-section.pe-picked { border-style: solid; border-color: var(--ember); background: var(--ember-glow); background: rgba(232,89,12,.03); }
.pe-section.pe-picked .pe-schip { color: #fff; background: var(--ember); }
.pe-section.pe-active .pe-schip { color: var(--ember-deep); }

.pe-schrome { position: absolute; top: -1px; left: 14px; transform: translateY(-50%); display: flex; gap: 5px; align-items: center; background: var(--surface); padding: 2px 6px; border-radius: 8px; }
.pe-schip { font-size: 9.5px; font-weight: 700; letter-spacing: .07em; color: var(--faint); text-transform: uppercase; padding: 2px 5px; border-radius: 6px; }
.pe-sctl { border: 0.5px solid var(--line); background: var(--surface-strong); border-radius: 6px; font-size: 10.5px; width: 20px; height: 20px; cursor: pointer; color: var(--faint); line-height: 1; }
.pe-sctl:hover:not(:disabled) { border-color: var(--ember); color: var(--ember); }
.pe-sctl:disabled { opacity: .4; cursor: default; }

.pe-cols { display: grid; gap: 12px; }
.pe-cols-one-column { grid-template-columns: 1fr; }
.pe-cols-two-column { grid-template-columns: 2fr 1fr; }
.pe-cols-halves { grid-template-columns: 1fr 1fr; }
.pe-cols-thirds { grid-template-columns: 1fr 1fr 1fr; }

.pe-zone { border-radius: 12px; border: 1.5px dashed var(--line); padding: 8px; min-height: 96px; cursor: pointer; }
.pe-zone.pe-zone-active { border-color: var(--ember); background: rgba(232,89,12,.035); }
.pe-zlabel { font-size: 9.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 0 4px 7px; }
.pe-zone.pe-zone-active .pe-zlabel { color: var(--ember-deep); }

.pe-card {
  background: var(--surface-strong); border: 0.5px solid var(--line); border-radius: 11px;
  padding: 12px 14px; margin-bottom: 9px; box-shadow: 0 1px 2px rgba(40,30,20,.05); cursor: default;
  /* Without these, pressing a card starts a TEXT selection/drag (Safari especially) and the
     element drag never begins. Edit-mode cards are placeholders — nothing here needs selecting. */
  user-select: none; -webkit-user-select: none; -webkit-user-drag: element;
}
.pe-card.pe-dragging { opacity: .35; }
.pe-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pe-card-head h3 { font-size: 13.5px; display: flex; gap: 7px; align-items: center; margin: 0; }
.pe-tag { font-size: 9px; font-weight: 600; letter-spacing: .06em; color: var(--faint); background: var(--surface-soft); border: 0.5px solid var(--line); padding: 1.5px 6px; border-radius: 999px; }
.pe-grip { color: var(--line-strong); font-size: 14px; cursor: grab; }
.pe-grip:active { cursor: grabbing; }
.pe-card-body { color: var(--muted); font-size: 12px; margin-top: 5px; }
.pe-card-ctl { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.pe-ctl {
  font-size: 11px; font-weight: 600; color: var(--muted); border: 0.5px solid var(--line); border-radius: 6px;
  background: var(--surface-strong); padding: 2px 7px; cursor: pointer; line-height: 1.5;
}
.pe-ctl:hover:not(:disabled) { border-color: var(--line-strong); color: var(--text); }
.pe-ctl:disabled { opacity: .4; cursor: default; }
.pe-ctl-remove { color: var(--red); }
.pe-ctl-remove:hover { border-color: var(--red); }

/* Drop-line hints: a 3px accent line at the nearest insertion point while dragging over a column —
   one per gap between cards plus one at the tail; JS toggles .pe-drop-hint-show on the nearest. */
.pe-drop-hint { height: 3px; border-radius: 2px; background: var(--ember); margin: -5px 3px 6px; opacity: 0; }
.pe-drop-hint.pe-drop-hint-show { opacity: 1; }

.pe-addcontent {
  border: 1.5px dashed var(--line-strong); border-radius: 11px; padding: 16px; text-align: center;
  color: var(--faint); font-size: 12.5px; cursor: pointer;
}
.pe-zone.pe-zone-active .pe-addcontent { border-color: var(--ember); color: var(--ember-deep); background: var(--ember-soft); }

/* ── Live miniatures — WidgetMini (real render payload) and SystemBlockMini (static sketch) ── */
.wmini { border: 0.5px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface-soft); pointer-events: none; }
.wmini-stats { display: flex; gap: 6px; }
.wmini-stat { flex: 1; background: var(--surface-strong); border-radius: 6px; padding: 5px 7px; }
.wmini-stat b { font-size: 14px; display: block; color: var(--text); }
.wmini-stat s { font-size: 8.5px; color: var(--faint); text-decoration: none; }
.wmini-donutrow { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.wmini-donutrow:first-child { margin-top: 0; }
.wmini-donut { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; position: relative; }
.wmini-donut::after { content: ""; position: absolute; inset: 9px; background: var(--surface-soft); border-radius: 50%; }
.wmini-legend { font-size: 8.5px; color: var(--faint); line-height: 1.5; }
.wmini-legend-row { display: block; }
.wmini-legend-row i { display: inline-block; width: 6px; height: 6px; border-radius: 2px; margin-right: 4px; }
.wmini-table { margin-top: 6px; }
.wmini-table:first-child { margin-top: 0; }
.wmini-rowline { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; color: var(--faint); padding: 3px 1px; border-bottom: 0.5px solid var(--line); }
.wmini-rowline:last-child { border-bottom: none; }
.wmini-empty { font-size: 9px; color: var(--faint); font-style: italic; }
.wmini-needcard { display: flex; gap: 6px; align-items: center; font-size: 9px; color: var(--text); background: var(--surface-strong); border-radius: 6px; padding: 5px 7px; }
.wmini-needbtn { margin-left: auto; font-size: 8px; background: var(--ember); color: #fff; padding: 2px 6px; border-radius: 5px; }
.wmini-chip { font-size: 8px; padding: 1px 5px; border-radius: 999px; background: var(--green-soft); color: var(--green); border: 0.5px solid #d3e6d6; }
.wmini-chip.amber { background: var(--amber-soft); color: var(--amber); border-color: #f0dfc0; }
.wmini-prose { font-size: 9px; color: var(--faint); }
.wmini-prose b { color: var(--text); font-size: 10px; display: block; margin-bottom: 2px; }
.wmini-live { color: var(--green); }
