/* Puform Dreamatorium. Tokens copied from Puform_design_system/foundations/tokens.css (web + internal tools register). */
:root {
  color-scheme: light;
  --pf-cream-50: #F5F3EE; --pf-cream-25: #FBFAF7; --pf-sand-100: #EFECE4; --pf-sand-border: #E4E0D8;
  --pf-tint-100: #EAF1F8; --pf-navy-900: #081A30; --pf-navy-800: #0B2340; --pf-ink: #0E1726;
  --pf-ink-muted: #4A5D7C; --pf-ink-faint: #7C8AA0; --pf-blue-700: #08365F; --pf-blue-600: #0B4F8A;
  --pf-blue-500: #0D63AD; --pf-blue-300: #7FA6D6; --pf-blue-200: #9FC4EA; --pf-blue-100: #CFE0F1;
  --pf-yellow-accent: #FACD00; --pf-white: #FFFFFF;
  --pf-logo-cyan: #57C2E0; --pf-logo-deep-blue: #006793;
  --pf-success-bg: #D1FAE5; --pf-success-text: #065F46; --pf-warning-bg: #FEF3C7; --pf-warning-text: #92400E;
  --pf-error-bg: #FEE2E2; --pf-error-text: #991B1B;
  --pf-series-1: #2C7CC0; --pf-series-2: #C8802B; --pf-series-3: #2AA08A;
  --pf-font-body: 'Helvetica Neue', Helvetica, 'Neue Haas Grotesk Display', Arial, sans-serif;
  --pf-font-ui: 'Inter', system-ui, sans-serif;
  --pf-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --pf-radius-sm: 4px; --pf-radius-md: 6px; --pf-radius-lg: 10px; --pf-radius-xl: 14px;
  --pf-shadow-sm: 0 14px 32px rgba(11, 35, 64, .10); --pf-shadow-lg: 0 18px 44px rgba(8, 26, 48, .18);
  /* model colors: validated categorical series */
  --model-haiku: var(--pf-series-3); --model-sonnet: var(--pf-series-1); --model-opus: var(--pf-series-2);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--pf-font-ui); background: var(--pf-cream-50); color: var(--pf-ink); font-size: 14px; line-height: 1.5; }
.hidden { display: none !important; }
a { color: var(--pf-blue-600); text-decoration: none; }
a:hover { color: var(--pf-blue-500); text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--pf-font-body); color: var(--pf-navy-800); text-wrap: balance; margin: 0; }
h1 { font-size: clamp(26px, 4vw, 40px); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; }
h2 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
h3 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
p { text-wrap: pretty; }
.eyebrow { font-family: var(--pf-font-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--pf-ink-faint); font-weight: 500; }
.muted { color: var(--pf-ink-muted); }
.faint { color: var(--pf-ink-faint); }
.mono { font-family: var(--pf-font-mono); }
.error-text { color: var(--pf-error-text); min-height: 1.2em; }

/* ---------------------------------------------------------------- buttons & inputs */
.btn { font: 600 13px var(--pf-font-ui); border-radius: var(--pf-radius-md); border: 1px solid var(--pf-sand-border); background: var(--pf-white); color: var(--pf-ink); padding: 8px 14px; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; white-space: nowrap; }
.btn:hover { border-color: var(--pf-blue-300); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--pf-blue-600); color: var(--pf-white); border-color: var(--pf-blue-600); }
.btn.primary:hover { background: var(--pf-blue-500); }
.btn.danger { color: var(--pf-error-text); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.wide { width: 100%; padding: 11px; }
.btn.ghost-dark { background: transparent; color: var(--pf-blue-100); border-color: rgba(207, 224, 241, .3); }
.btn.ghost-dark:hover { color: var(--pf-white); border-color: var(--pf-blue-200); }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--pf-ink-muted); }
.field small { color: var(--pf-ink-faint); font-size: 12px; }
input[type=text], input[type=password], input[type=url], textarea { font: 14px var(--pf-font-ui); color: var(--pf-ink); border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-md); padding: 9px 11px; background: var(--pf-white); width: 100%; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus, textarea:focus { outline: 2px solid var(--pf-blue-200); border-color: var(--pf-blue-600); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--pf-ink-muted); margin-bottom: 14px; }

/* ---------------------------------------------------------------- login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, var(--pf-tint-100), var(--pf-cream-50) 60%); }
.login-card { width: min(380px, 100%); background: var(--pf-white); border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-xl); padding: 32px; box-shadow: var(--pf-shadow-sm); }
.login-card h1 { font-size: 28px; margin: 6px 0 22px; }
.login-logo { height: 22px; margin-bottom: 18px; }
.login-card .lede { color: var(--pf-ink-muted); margin: 0 0 16px; }
.qr { display: block; width: 200px; height: 200px; margin: 0 auto 10px; image-rendering: pixelated; }
.secret { font-size: 12px; color: var(--pf-ink-muted); margin: 0 0 16px; overflow-wrap: anywhere; }
.secret code { font-family: var(--pf-font-mono); color: var(--pf-ink); }
.setup-logout { margin-top: 8px; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; background: var(--pf-navy-800); color: var(--pf-blue-100); display: flex; align-items: center; gap: 28px; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { height: 18px; display: block; }
.brand-sub { font-family: var(--pf-font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--pf-blue-300); border-left: 1px solid rgba(207, 224, 241, .25); padding-left: 12px; }
.tabs { display: flex; gap: 22px; height: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: flex; align-items: center; color: var(--pf-blue-100); font-weight: 500; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.tabs a:hover { color: var(--pf-white); }
.tabs a.active { color: var(--pf-white); border-bottom-color: var(--pf-blue-300); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.clock { font-family: var(--pf-font-mono); font-size: 13px; color: var(--pf-blue-200); }
.live { display: flex; align-items: center; gap: 6px; font: 11px var(--pf-font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--pf-blue-300); }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #E06A6A; }
.live.on i { background: #4ADE80; box-shadow: 0 0 0 0 rgba(74, 222, 128, .6); animation: beacon 2.4s infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, .55); } 70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); } 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); } }

.view { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------------------------------------------------------------- panels */
.panel { background: var(--pf-white); border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-lg); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head .count { font-family: var(--pf-font-mono); font-size: 12px; color: var(--pf-ink-faint); }
.empty { color: var(--pf-ink-faint); font-size: 13px; padding: 14px 0; }
.setup-hint { background: var(--pf-cream-25); border: 1px dashed var(--pf-sand-border); border-radius: var(--pf-radius-md); padding: 12px; font-size: 12.5px; color: var(--pf-ink-muted); }
.badge { display: inline-flex; align-items: center; gap: 5px; font: 600 11px var(--pf-font-ui); padding: 2px 8px; border-radius: var(--pf-radius-sm); background: var(--pf-tint-100); color: var(--pf-blue-600); white-space: nowrap; }
.badge.good { background: var(--pf-success-bg); color: var(--pf-success-text); }
.badge.warn { background: var(--pf-warning-bg); color: var(--pf-warning-text); }
.badge.bad { background: var(--pf-error-bg); color: var(--pf-error-text); }
.badge.plain { background: var(--pf-sand-100); color: var(--pf-ink-muted); }
.badge.model-haiku { background: color-mix(in srgb, var(--model-haiku) 14%, white); color: #1B6E5E; }
.badge.model-sonnet { background: color-mix(in srgb, var(--model-sonnet) 14%, white); color: var(--pf-blue-700); }
.badge.model-opus { background: color-mix(in srgb, var(--model-opus) 16%, white); color: #7A4A12; }

/* ---------------------------------------------------------------- today */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.hero h1 span { color: var(--pf-blue-600); }
.now-card { display: flex; gap: 14px; align-items: center; background: var(--pf-navy-800); color: var(--pf-blue-100); border-radius: var(--pf-radius-lg); padding: 14px 18px; min-width: 280px; max-width: 460px; }
.now-card .eyebrow { color: var(--pf-blue-300); }
.now-card strong { color: var(--pf-white); font-weight: 600; display: block; font-size: 15px; }
.now-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pf-yellow-accent); flex: none; animation: beacon-y 2s infinite; }
@keyframes beacon-y { 0% { box-shadow: 0 0 0 0 rgba(250, 205, 0, .5); } 70% { box-shadow: 0 0 0 10px rgba(250, 205, 0, 0); } 100% { box-shadow: 0 0 0 0 rgba(250, 205, 0, 0); } }
.today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.strip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; margin-top: 18px; }
.item { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pf-sand-100); align-items: flex-start; }
.item:first-child { border-top: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; color: var(--pf-ink); overflow-wrap: anywhere; }
.item .sub { font-size: 12.5px; color: var(--pf-ink-faint); margin-top: 2px; }
.prio { width: 4px; align-self: stretch; border-radius: 2px; background: var(--pf-sand-border); flex: none; }
.prio.High { background: #D9534F; } .prio.Medium { background: var(--pf-yellow-accent); } .prio.Low { background: var(--pf-series-3); }
.time { font-family: var(--pf-font-mono); font-size: 12.5px; color: var(--pf-ink-muted); width: 92px; flex: none; }
.event.past { opacity: .5; }
.event.current { background: var(--pf-tint-100); margin: 0 -10px; padding: 10px; border-radius: var(--pf-radius-md); border-top-color: transparent; }
.event.current .time { color: var(--pf-blue-600); font-weight: 600; }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pf-blue-600); margin-top: 6px; flex: none; }
.unread-dot.read { background: transparent; border: 1px solid var(--pf-sand-border); }
.mini-force { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 12px; }
.mini-force i { width: 12px; height: 12px; border-radius: 50%; display: block; animation: pulse 1.8s ease-in-out infinite; }

/* ---------------------------------------------------------------- control: compute */
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin: 0 0 14px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: baseline; gap: 12px; }
.compute-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 28px; }
.compute { flex: 0 0 250px; background: var(--pf-white); border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-lg); padding: 14px 16px; position: relative; }
.compute.offline { opacity: .65; }
.compute .name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.compute .host { font-size: 12px; color: var(--pf-ink-faint); margin: 2px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #C9C3B6; }
.status-dot.on { background: #22A06B; }
.slots { display: flex; gap: 12px; padding: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.slot { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--pf-sand-border); position: relative; }
.slot.busy { border: 0; background: var(--pf-blue-600); }
.slot.busy::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--pf-blue-300); animation: ripple 1.8s ease-out infinite; }
.compute .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.compute .actions { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.icon-btn { border: 0; background: transparent; color: var(--pf-ink-faint); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 4px; }
.icon-btn:hover { background: var(--pf-sand-100); color: var(--pf-ink); }
.add-compute { flex: 0 0 200px; border: 2px dashed var(--pf-sand-border); border-radius: var(--pf-radius-lg); display: grid; place-items: center; text-align: center; color: var(--pf-blue-600); font-weight: 600; cursor: pointer; background: transparent; font-family: var(--pf-font-ui); min-height: 130px; }
.add-compute:hover { border-color: var(--pf-blue-300); background: var(--pf-cream-25); }
.add-compute b { display: block; font-size: 26px; line-height: 1; margin-bottom: 4px; }

/* ---------------------------------------------------------------- control: layout */
.control-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* workforce visualization */
.force { background: linear-gradient(180deg, var(--pf-navy-800), var(--pf-navy-900)); color: var(--pf-blue-100); border-radius: var(--pf-radius-xl); padding: 20px 22px; position: relative; overflow: hidden; }
.force h2 { color: var(--pf-white); }
.force .eyebrow { color: var(--pf-blue-300); }
.force-legend { display: flex; gap: 14px; font-size: 12px; flex-wrap: wrap; }
.force-legend span { display: inline-flex; gap: 6px; align-items: center; }
.force-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.force-empty { padding: 30px 0 18px; text-align: center; color: var(--pf-blue-300); }
.force-empty svg { width: 54px; opacity: .5; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }
.squad { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-top: 1px solid rgba(207, 224, 241, .12); align-items: center; }
.squad:first-of-type { border-top: 0; }
.lead { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; cursor: pointer; }
.lead-orb { width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #16406E, var(--pf-navy-900)); display: grid; place-items: center; position: relative; border: 1px solid rgba(127, 166, 214, .35); }
.lead-orb svg { width: 36px; }
.lead.thinking .lead-orb::before, .lead.thinking .lead-orb::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--pf-logo-cyan); opacity: 0; animation: ripple 2.2s ease-out infinite; }
.lead.thinking .lead-orb::after { animation-delay: 1.1s; }
.lead.thinking .lead-orb svg { animation: sway 2.4s ease-in-out infinite; }
@keyframes sway { 50% { transform: translateY(-2px) rotate(-4deg); } }
.lead-name { color: var(--pf-white); font-weight: 600; font-size: 13px; line-height: 1.3; }
.lead-state { font: 11px var(--pf-font-mono); color: var(--pf-blue-300); letter-spacing: .06em; }
.agents { display: flex; flex-direction: column; gap: 8px; position: relative; margin-left: 18px; }
.agents::before { content: ""; position: absolute; left: -18px; top: 26px; bottom: 26px; width: 2px; background: rgba(127, 166, 214, .25); border-radius: 1px; }
.agents:has(> .agent:only-child)::before { display: none; }
.agent { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; position: relative; padding: 8px 12px 8px 0; }
.agent::before { content: ""; position: absolute; left: -18px; top: 50%; width: 18px; height: 2px; background: rgba(127, 166, 214, .25); }
.agent.running::before { background: linear-gradient(90deg, transparent 0 40%, var(--pf-logo-cyan) 40% 60%, transparent 60%) 0 0 / 200% 100%, rgba(127, 166, 214, .25); animation: flow 1.2s linear infinite; }
@keyframes flow { from { background-position: 100% 0, 0 0; } to { background-position: -100% 0, 0 0; } }
.agent-orb { width: 30px; height: 30px; border-radius: 50%; position: relative; background: var(--c, var(--pf-blue-300)); }
.agent.queued .agent-orb { background: transparent; border: 2px dashed var(--c); opacity: .7; }
.agent.running .agent-orb { animation: pulse 1.6s ease-in-out infinite; }
.agent.running .agent-orb::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--c); animation: ripple 1.6s ease-out infinite; }
@keyframes pulse { 50% { transform: scale(.88); } }
@keyframes ripple { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }
.agent-title { color: var(--pf-white); font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-activity { font: 12px var(--pf-font-mono); color: var(--pf-blue-200); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-activity.fresh { animation: fadein .6s ease; }
@keyframes fadein { from { opacity: 0; transform: translateX(-4px); } }
.agent-meta { font: 11px var(--pf-font-mono); color: var(--pf-blue-300); text-align: right; white-space: nowrap; }
.model-haiku { --c: var(--model-haiku); } .model-sonnet { --c: var(--model-sonnet); } .model-opus { --c: var(--model-opus); } .model-fable { --c: #B46CC8; }

/* projects */
.project-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.project-card { background: var(--pf-white); border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-lg); padding: 16px; cursor: pointer; transition: box-shadow .2s, transform .2s; display: flex; flex-direction: column; gap: 10px; text-align: left; font: inherit; color: inherit; }
.project-card:hover { box-shadow: var(--pf-shadow-sm); transform: translateY(-1px); }
.project-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.project-card h3 { font-size: 16px; }
.project-card .last { font-size: 12.5px; color: var(--pf-ink-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.progress { height: 6px; background: var(--pf-sand-100); border-radius: 3px; overflow: hidden; display: flex; }
.progress i { display: block; height: 100%; transition: width .6s ease; }
.progress .done { background: var(--pf-blue-600); } .progress .run { background: var(--pf-blue-300); background-image: linear-gradient(90deg, transparent, rgba(255,255,255,.6), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.needs-you { background: var(--pf-yellow-accent); color: var(--pf-navy-800); }
details.closed-projects summary { cursor: pointer; font-weight: 600; color: var(--pf-ink-muted); padding: 6px 0; }
.closed-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pf-sand-100); cursor: pointer; }
.closed-row:hover .title { color: var(--pf-blue-600); }

/* updates feed */
.feed { display: flex; flex-direction: column; max-height: 760px; overflow-y: auto; }
.update { padding: 12px 0; border-top: 1px solid var(--pf-sand-100); animation: fadein .5s ease; }
.update:first-child { border-top: 0; }
.update .who { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--pf-ink-faint); margin-bottom: 4px; }
.update .who b { color: var(--pf-blue-600); font-weight: 600; cursor: pointer; }
.update.error { border-left: 3px solid var(--pf-error-text); padding-left: 10px; }
.update.ask { border-left: 3px solid var(--pf-yellow-accent); padding-left: 10px; }
.update.owner { border-left: 3px solid var(--pf-blue-300); padding-left: 10px; }
.md { font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.md p { margin: 0 0 8px; } .md p:last-child { margin-bottom: 0; }
.md ul, .md ol { margin: 4px 0 8px; padding-left: 20px; }
.md blockquote { margin: 2px 0; padding: 0 0 0 12px; border-left: 3px solid var(--pf-blue-300); color: var(--pf-ink-muted); font-style: italic; }
.md code { font-family: var(--pf-font-mono); font-size: 12px; background: var(--pf-sand-100); padding: 1px 5px; border-radius: 4px; }
.md pre { background: var(--pf-navy-900); color: var(--pf-blue-100); padding: 12px; border-radius: var(--pf-radius-md); overflow-x: auto; }
.md pre code { background: none; color: inherit; padding: 0; }
.md h1, .md h2, .md h3, .md h4 { margin: 14px 0 6px; font-size: 16px; }
.md h1 { font-size: 22px; } .md h2 { font-size: 18px; }

/* ---------------------------------------------------------------- project page */
.back { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.project-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.project-head h1 { font-size: clamp(24px, 3.6vw, 36px); }
.project-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--pf-sand-border); margin-bottom: 18px; overflow-x: auto; }
.subtabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 0; font: 500 13px var(--pf-font-ui); color: var(--pf-ink-faint); cursor: pointer; white-space: nowrap; }
.subtabs button.active { color: var(--pf-blue-600); border-bottom-color: var(--pf-blue-600); font-weight: 600; }
.project-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.report-frame { width: 100%; height: 78vh; border: 1px solid var(--pf-sand-border); border-radius: var(--pf-radius-lg); background: var(--pf-white); }
.brief dl { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.brief dt { font-weight: 600; color: var(--pf-ink-muted); font-size: 12.5px; }
.brief dd { margin: 0; }
.brief ul { margin: 0; padding-left: 18px; }

/* chat */
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.bubble { max-width: 80%; padding: 12px 14px; border-radius: 14px; animation: fadein .35s ease; }
.bubble.from-lead { background: var(--pf-white); border: 1px solid var(--pf-sand-border); border-top-left-radius: 4px; align-self: flex-start; }
.bubble.owner { background: var(--pf-blue-600); color: var(--pf-white); border-top-right-radius: 4px; align-self: flex-end; }
.bubble.owner .md code { background: rgba(255,255,255,.18); }
.bubble .who { font: 11px var(--pf-font-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .7; margin-bottom: 4px; }
.typing { align-self: flex-start; display: flex; gap: 10px; align-items: center; color: var(--pf-ink-faint); font-size: 13px; }
.typing span { display: inline-flex; gap: 4px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--pf-blue-300); animation: bounce 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.composer { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea { min-height: 60px; }
.conv-banner { display: flex; gap: 12px; align-items: center; background: var(--pf-tint-100); border-radius: var(--pf-radius-md); padding: 10px 14px; margin-bottom: 14px; font-size: 13px; color: var(--pf-blue-700); }

/* tasks table */
.task-row { border-top: 1px solid var(--pf-sand-100); padding: 12px 0; }
.task-row summary { list-style: none; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; cursor: pointer; }
.task-row summary::-webkit-details-marker { display: none; }
.task-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c, var(--pf-sand-border)); }
.task-row.running .task-dot { animation: pulse 1.6s infinite; }
.task-row.pending .task-dot, .task-row.queued .task-dot { background: transparent; border: 2px dashed var(--c); }
.task-body { padding: 10px 0 4px 30px; display: grid; gap: 10px; }
.activity { font: 12px var(--pf-font-mono); color: var(--pf-ink-muted); background: var(--pf-cream-25); border: 1px solid var(--pf-sand-100); border-radius: var(--pf-radius-md); padding: 8px 10px; max-height: 180px; overflow-y: auto; }
.activity div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--pf-sand-100); }

/* knowledge */
.knowledge-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.knowledge-doc { padding: 26px 30px; }
.knowledge-doc .md { font-family: var(--pf-font-body); font-size: 15px; }
.knowledge-doc .md h2 { font-size: 19px; margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--pf-sand-100); }
.version { padding: 10px 0; border-top: 1px solid var(--pf-sand-100); cursor: pointer; }
.version:hover .title, .version.active .title { color: var(--pf-blue-600); }
.version ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--pf-ink-muted); }
.editor { min-height: 60vh; font-family: var(--pf-font-mono); font-size: 13px; }
.curating { display: flex; gap: 10px; align-items: center; color: var(--pf-blue-600); font-weight: 600; font-size: 13px; }

/* modal & toast */
.modal { position: fixed; inset: 0; background: rgba(8, 26, 48, .45); display: grid; place-items: center; padding: 16px; z-index: 50; animation: fadein .2s; }
.modal-card { width: min(620px, 100%); max-height: 90vh; overflow-y: auto; background: var(--pf-white); border-radius: var(--pf-radius-xl); padding: 26px; box-shadow: var(--pf-shadow-lg); }
.modal-card h2 { margin-bottom: 6px; }
.modal-card .lede { color: var(--pf-ink-muted); margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.cmd { display: flex; gap: 8px; align-items: stretch; margin-bottom: 8px; }
.cmd code { flex: 1; font: 12px var(--pf-font-mono); background: var(--pf-navy-900); color: var(--pf-blue-100); padding: 10px 12px; border-radius: var(--pf-radius-md); overflow-x: auto; white-space: nowrap; }
.fp { font: 13px var(--pf-font-mono); background: var(--pf-tint-100); color: var(--pf-blue-700); padding: 8px 10px; border-radius: var(--pf-radius-md); overflow-wrap: anywhere; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--pf-navy-800); color: var(--pf-white); padding: 10px 18px; border-radius: var(--pf-radius-md); box-shadow: var(--pf-shadow-lg); z-index: 60; font-weight: 500; }
.toast.bad { background: var(--pf-error-text); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .control-grid, .project-grid, .knowledge-grid { grid-template-columns: minmax(0, 1fr); }
  .today-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .view { padding: 18px 16px 48px; }
  .topbar { padding: 0 16px; gap: 14px; }
  .brand-sub, .clock, .live span { display: none; }
  .today-grid, .strip { grid-template-columns: minmax(0, 1fr); }
  .squad { grid-template-columns: minmax(0, 1fr); }
  .lead { flex-direction: row; text-align: left; }
  .agent::before, .agents::before { display: none; }
  .agents { margin-left: 0; }
  .bubble { max-width: 92%; }
  .brief dl { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
