/* Workspace compositions. Shared visual decisions belong in design-system.css.
   The app is plain: one background, text in ink or muted ink, the accent only
   for primary actions and focus, and spacing instead of rules and frames. */
:root {
  --muted: var(--ds-muted); --line: var(--ds-line); --soft: var(--ds-surface-soft);
  --radius-control: var(--ds-radius-control); --radius-card: var(--ds-radius-card); --radius-panel: var(--ds-radius-panel);
  --ease-out: var(--ds-ease-out); --font-mono: var(--ds-font-mono);
  color: var(--ds-ink); background: var(--ds-paper); font-family: var(--ds-font-sans);
}
body { background: var(--ds-paper); }
.eyebrow, .page-eyebrow { color: var(--ds-muted); font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); font-weight: 450; }
.demo { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--ds-space-2); padding: var(--ds-space-2) var(--ds-space-4); background: var(--ds-surface); color: var(--ds-ink); font-size: var(--ds-text-sm); font-weight: 500; }
.demo > span { color: var(--ds-muted); font-size: var(--ds-text-sm); font-weight: 400; opacity: 1; }

/* Shell */
.app-shell { background: var(--ds-paper); }
.sidebar { overflow-y: auto; width: 216px; padding: var(--ds-space-6) var(--ds-space-4); background: var(--ds-paper); color: var(--ds-ink); border: 0; }
.sidebar .wordmark { line-height: 1; margin-bottom: var(--ds-space-6); padding-left: 0; font-size: 22px; font-weight: 600; }
.sidebar .brand-mark { width: 26px; height: 26px; padding: 0; background: transparent; border-radius: 0; }
.sidebar .mobile-navigation-toggle { display: none; }
.workspace-picker { gap: 0; padding: 0 var(--ds-space-2); margin-bottom: var(--ds-space-8); border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-control); background: var(--ds-paper); color: var(--ds-ink); }
.workspace-picker select { min-height: 36px; font-size: var(--ds-text-sm); }
.workspace-picker > .ds-select { flex: 1; min-width: 0; }
.field > .ds-select, .setup-stage .ds-select { width: 100%; }
.nav { gap: var(--ds-space-6); }
.nav-group { display: grid; gap: 0; }
.nav-group-label { padding: 0 0 var(--ds-space-1); color: var(--ds-muted); font-size: var(--ds-text-sm); font-weight: 450; }
.nav a { min-height: 34px; padding: 0; border: 0; border-radius: var(--ds-radius-control); color: var(--ds-muted); font-size: var(--ds-text-base); font-weight: 450; }
.nav a[aria-current="page"] { color: var(--ds-ink); background: transparent; font-weight: 600; }
.nav a[aria-current="page"]::after { display: none; }
.nav a[href="#showcase"] { margin-top: 0; }
.sidebar :is(a, button, select):focus-visible { outline-color: var(--ds-accent); outline-offset: 2px; }
.sidebar-bottom { padding: var(--ds-space-6) 0 0; gap: var(--ds-space-3); }
.sidebar-bottom button.text { justify-content: flex-start; padding: 0; min-height: 32px; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.sidebar-bottom .workspace-note { padding: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); text-decoration: none; }
.sidebar-account { display: grid; min-width: 0; }
.sidebar-account-copy { display: grid; gap: 0; min-width: 0; }
.sidebar-account-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--ds-text-sm); font-weight: 450; }
.sidebar-account-copy > small { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.app-topbar { height: 64px; padding: 0 var(--ds-space-10); border: 0; background: var(--ds-paper); }
.breadcrumbs { gap: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-sm); }
.breadcrumbs > span:first-child { color: var(--ds-ink); }
.breadcrumbs .workspace-kind::before { content: "·"; margin-right: var(--ds-space-2); }
.topbar-actions { gap: var(--ds-space-4); }
.topbar-actions .setup-resume { color: var(--ds-ink); padding-inline: 0; }
.workspace { max-width: 1120px; margin: 0; padding: var(--ds-space-6) var(--ds-space-10) var(--ds-space-16); }
.page-heading { align-items: flex-start; margin-bottom: var(--ds-space-8); padding: 0; border: 0; }
.page-heading > .ds-heading-group { min-width: 0; flex: 1; }
.page-heading > :not(.ds-heading-group) { flex-shrink: 0; }
.workspace .page-heading h1 { font-family: var(--ds-font-sans); font-size: 28px; font-weight: 600; line-height: 1.25; }
.page-heading p { max-width: 640px; margin-top: var(--ds-space-2); color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.65; }
.heading-side { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.page-eyebrow { display: inline-block; margin-bottom: var(--ds-space-2); }
.filters { gap: var(--ds-space-2); }
.filters > .ds-select { min-width: 102px; max-width: 185px; }
.filters:has(+ .ds-results) { margin-bottom: 0; }
#friend-access-slot:not(:empty) { margin-bottom: var(--ds-space-8); }
.search-field { max-width: 420px; }
.search { padding-left: 36px; font-size: var(--ds-text-sm); }
.search-field > .icon-search { color: var(--ds-muted); }
.filters select { font-size: var(--ds-text-sm); }
kbd { color: var(--ds-muted); border: 0; background: transparent; }
.active-filter { background: transparent; color: var(--ds-ink); }
.activity-section-tabs { margin-bottom: var(--ds-space-8); }

/* Drawer: one flat surface over a clear backdrop. */
.detail { color: var(--ds-ink); background: var(--ds-surface); border: 0; border-radius: 0; box-shadow: none; }
.detail::backdrop { background: transparent; }
.activity-detail .detail-header, .memory-detail .detail-header, .detail-header { min-height: 56px; height: auto; padding: var(--ds-space-2) var(--ds-space-6); color: var(--ds-muted); background: var(--ds-surface); border: 0; font-size: var(--ds-text-sm); }
.detail-body { padding: var(--ds-space-2) var(--ds-space-6) var(--ds-space-8); }
.detail-body h2 { letter-spacing: normal; }
.detail-body dl:not(.ds-evidence-list) { border: 0; padding-top: 0; }
.memory-document .memory-document-title { color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-xl); font-weight: 600; line-height: 1.35; }
.detail-tool-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: var(--ds-space-3); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 14px; }
.detail-tool-icon > :is(svg, img) { width: 28px; height: 28px; }
.detail-tool-icon > img.agent-logo { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* Memory */
.memory-row { min-height: 0; margin: 0; padding: var(--ds-space-4) 0; gap: var(--ds-space-6); border: 0; border-radius: 0; background: transparent; }
.workspace .memory-row, .workspace .review-row { background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.memory-row strong { font-size: var(--ds-text-base); font-weight: 500; }
.memory-row .muted, .memory-date { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.memory-row-copy { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.memory-row-copy > span { display: block; }
.memory-row-copy > .status-label { margin-top: var(--ds-space-1); }
.memory-date { flex-shrink: 0; }
.memory-tabs { gap: var(--ds-space-6); padding-bottom: var(--ds-space-6); border: 0; }
.workspace .memory-tabs button { min-height: 32px; padding: 0; color: var(--ds-muted); background: transparent; border: 0; border-radius: 0; box-shadow: none; font-size: var(--ds-text-base); font-weight: 450; }
.workspace .memory-tabs button[aria-pressed="true"] { color: var(--ds-ink); font-weight: 600; }
.memory-document-tabs { border: 0; }
.memory-document-tabs > [role="tab"] { color: var(--ds-muted); }
.memory-document-tabs > [aria-selected="true"] { color: var(--ds-ink); font-weight: 600; }
.memory-document-tabs > [aria-selected="true"]::after { display: none; }
.memory-prose { color: var(--ds-ink); font-size: var(--ds-text-base); line-height: 1.8; }
.memory-prose :is(h2,h3,h4,h5,h6) { font-size: 16px; font-weight: 600; }
.memory-entry, .memory-source-text, .memory-related-link, .memory-show-more { color: var(--ds-ink); background: transparent; border: 0; border-radius: 0; }
.memory-entry[open] { background: transparent; }
.memory-entry-search { color: var(--ds-ink); background: var(--ds-paper); border: 1px solid var(--ds-input-border); border-radius: var(--ds-radius-control); }
.memory-entry-search:focus-within { border-color: var(--ds-accent); box-shadow: none; }
.memory-loading .memory-loading-title { color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-xl); font-weight: 600; }
.memory-loading-sheet { background: transparent; border: 0; }
.memory-loading-sheet-title, .memory-loading-metadata span, .memory-loading-paragraph span, .memory-loading-rule, .skeleton-line { background: var(--ds-surface); }
.memory-loading-delayed { color: var(--ds-muted); background: transparent; border: 0; }

/* States, forms and administration. */
.empty, .insight-empty { padding: var(--ds-space-12) 0; color: var(--ds-muted); text-align: left; background: transparent; border: 0; border-radius: 0; }
.empty h2, .insight-empty h2 { color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: var(--ds-text-lg); font-weight: 600; }
.empty p, .insight-empty p { max-width: 520px; margin: var(--ds-space-2) 0 var(--ds-space-5); font-size: var(--ds-text-base); line-height: 1.65; }
.notice { padding: 0; margin-bottom: var(--ds-space-6); color: var(--ds-danger); background: transparent; border: 0; border-radius: 0; font-size: var(--ds-text-base); }
.notice button.text { color: var(--ds-ink); }
.toast { color: var(--ds-inverse-ink); background: var(--ds-inverse); border: 0; border-radius: var(--ds-radius-control); box-shadow: none; font-size: var(--ds-text-sm); }
.endpoint { padding: var(--ds-space-3) var(--ds-space-4); background: var(--ds-surface); border: 0; border-radius: var(--ds-radius-control); }
.connect-layout { max-width: 880px; }
.connect-computer { margin-bottom: var(--ds-space-10); }
.connect-computer h2 { font-size: var(--ds-text-lg); font-weight: 600; }
.section { padding-top: 0; margin-top: var(--ds-space-12); border: 0; }
.section > h2 { font-size: var(--ds-text-lg); font-weight: 600; }
.section > p { color: var(--ds-muted); font-size: var(--ds-text-base); }
.connection-section-title { margin-bottom: var(--ds-space-1); }
.token-row { border: 0; }
.token-row small { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.account-content { max-width: 960px; }
.account-section { grid-template-columns: minmax(180px, .75fr) minmax(0, 1.6fr); padding: var(--ds-space-10) 0 0; gap: var(--ds-space-8); border: 0; }
.account-section h2 { font-size: var(--ds-text-lg); font-weight: 600; }
.account-section .detail-note { font-size: var(--ds-text-sm); }
.account-section form > button { justify-self: start; }
.billing-summary { padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.billing-summary h2 { font-family: var(--ds-font-sans); font-size: var(--ds-text-xl); font-weight: 600; }
.billing-summary .eyebrow { color: var(--ds-muted); }
.plan-card { padding: 0; background: transparent; border: 0; border-radius: 0; }
.cloud-plan { background: transparent; }
.plan-description, .plan-price span, .plan-card .field-hint { color: var(--ds-muted); }
.plan-price strong { font-family: var(--ds-font-sans); font-size: 36px; font-weight: 600; }
.billing-dates dt { color: var(--ds-muted); }
.visibility-panel, .share-link-row { background: transparent; border: 0; border-radius: 0; padding: 0; }
.visibility-panel p, .preview-label { color: var(--ds-muted); font-size: var(--ds-text-sm); }
.profile-presentation-editor { margin-block: var(--ds-space-3); gap: var(--ds-space-8); }
.profile-highlight-editor .ds-panel-header { align-items: flex-start; }
.profile-highlight-editor .ds-panel-header > .ds-row { margin-left: auto; flex-wrap: wrap; }
.profile-highlight-editor .field { min-width: 0; }
.profile-highlight-editor :is(input, textarea) { width: 100%; }
.profile-presentation-editor > section > .ds-toolbar { align-items: flex-start; }
.profile-presentation-editor > section > .ds-toolbar > .ds-hint { flex: 1 1 160px; }
.visibility-badge { margin-left: 0; padding: 0; color: var(--ds-muted); background: transparent; border: 0; border-radius: 0; }
.slug-field { background: var(--ds-paper); border-color: var(--ds-input-border); }
.slug-field > span { color: var(--ds-muted); }
.slug-field:focus-within { border-color: var(--ds-accent); box-shadow: none; }
.form-feedback { color: var(--ds-ink); }
.insight-job, .insight-card, .insight-brief, .insight-search-results, .insight-privacy { padding-inline: 0; background: transparent; border: 0; border-radius: 0; }
.insight-card-top h2 { color: var(--ds-ink); font-size: var(--ds-text-lg); font-weight: 600; line-height: 1.5; }
.insight-description, .insight-brief-text { color: var(--ds-ink); font-size: var(--ds-text-base); }
.insight-source, .insight-search-match { color: var(--ds-ink); background: transparent; border: 0; }
.insight-config dd { color: var(--ds-ink); }
.review-row { padding: var(--ds-space-4) 0; margin: 0; border: 0; }
.review-row strong { font-size: var(--ds-text-base); font-weight: 500; }
.review-proposal { padding: 0; background: transparent; border: 0; }
.task-reporting-setup { color: var(--ds-ink); }
.task-reporting-setup h2 { font-family: var(--ds-font-sans); font-size: var(--ds-text-xl); line-height: 1.3; font-weight: 600; }
.task-reporting-step-number { color: var(--ds-muted); background: transparent; border: 0; }
.task-reporting-instructions { background: transparent; border: 0; }
.task-reporting-instructions > summary { color: var(--ds-ink); }
.task-reporting-instructions[open] > summary { border: 0; }
.task-reporting-instructions pre { background: var(--ds-surface); color: var(--ds-ink); border: 0; font-family: var(--ds-font-mono); }
.task-reporting-setup .task-reporting-connection { background: transparent; border: 0; }

/* Account entry: one quiet column. */
.auth.auth-layout { display: block; width: min(420px, calc(100% - 40px)); min-height: 0; margin: clamp(40px, 12vh, 120px) auto var(--ds-space-12); border: 0; border-radius: 0; background: transparent; }
.auth .wordmark { display: inline-flex; margin: 0 0 var(--ds-space-10); color: var(--ds-ink); font-size: 22px; font-weight: 600; }
.auth .brand-mark { width: 26px; height: 26px; padding: 0; background: transparent; border-radius: 0; }
.auth-panel { min-width: 0; padding: 0; }
.auth-panel-heading { display: grid; justify-items: start; margin-bottom: var(--ds-space-8); }
.auth.auth-layout h1 { color: var(--ds-ink); font-family: var(--ds-font-sans); font-size: 28px; font-weight: 600; line-height: 1.25; }
.auth .auth-intro { max-width: 400px; margin-top: var(--ds-space-3); color: var(--ds-muted); font-size: var(--ds-text-base); line-height: 1.65; }
.auth .field { font-size: var(--ds-text-sm); }
.auth .field > input { min-height: 44px; background: var(--ds-paper); font-size: 16px; }
.auth .primary { margin-top: var(--ds-space-1); }
.auth .signup-promise { margin: 0 0 var(--ds-space-6); padding: 0; color: var(--ds-muted); background: transparent; border: 0; font-size: var(--ds-text-base); }
.auth .auth-invite-request { margin: var(--ds-space-6) 0 0; color: var(--ds-muted); font-size: var(--ds-text-sm); line-height: 1.7; }
.auth-invite-request a { color: var(--ds-ink); }
.auth-switch { margin-top: var(--ds-space-6); gap: var(--ds-space-3); color: var(--ds-muted); }
.auth-switch button.text { color: var(--ds-ink); font-size: var(--ds-text-sm); }
.auth .auth-links { gap: var(--ds-space-5); margin-top: var(--ds-space-10); padding-top: 0; border: 0; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.auth .auth-links a { min-height: 36px; }
.auth.provisioning { width: min(480px, calc(100% - 40px)); margin-top: 12vh; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.provisioning h1 { margin-top: var(--ds-space-5); font-family: var(--ds-font-sans); font-size: 28px; font-weight: 600; }
.provisioning [role="status"] > svg { width: 20px; height: 20px; padding: 0; color: var(--ds-muted); background: transparent; border-radius: 0; }
.provisioning p { margin-top: var(--ds-space-4); color: var(--ds-muted); line-height: 1.7; }
.boot-loader { color: var(--ds-muted); font-family: var(--ds-font-sans); }

@media (hover: hover) and (pointer: fine) {
  .nav a:hover { color: var(--ds-ink); background: transparent; }
  .workspace .memory-row:hover, .workspace .review-row:hover { background: var(--ds-hover-bg); }
  .workspace .memory-tabs button:hover:not(:disabled) { color: var(--ds-ink); background: var(--ds-hover-bg); }
  .memory-entry > summary:hover, .memory-related-link:hover, .task-reporting-instructions > summary:hover { color: var(--ds-ink); background: var(--ds-hover-bg); }
  .task-reporting-setup .task-reporting-connection:hover { background: var(--ds-hover-bg); }
  .auth-switch button.text:hover { background: transparent; color: var(--ds-ink); }
}
@media (max-width: 1100px) {
  .filters > .ds-select { flex: 1; width: 0; min-width: 0; max-width: none; }
  .activity-search-filters > .ds-select { flex: 0 1 150px; width: auto; max-width: 150px; }
}
@media (max-width: 840px) {
  .activity-search-filters > .ds-select { flex: 1; width: 0; max-width: none; }
}
@media (max-width: 1080px) {
  .sidebar { width: 200px; }
  .workspace, .app-topbar { padding-inline: var(--ds-space-6); }
}
@media (max-width: 900px) {
  .account-section { grid-template-columns: 1fr; gap: var(--ds-space-4); }
}
@media (max-width: 620px) {
  .filters.activity-search-filters > .ds-select { width: 100%; min-width: 0; max-width: none; }
  .app-shell { display: block; }
  .sidebar, .demo + .app-shell .sidebar { position: static; display: grid; grid-template-columns: auto minmax(0, 1fr) 44px; align-items: center; gap: var(--ds-space-3); width: 100%; height: auto; padding: var(--ds-space-3) max(var(--ds-space-4), env(safe-area-inset-right)) var(--ds-space-3) max(var(--ds-space-4), env(safe-area-inset-left)); background: var(--ds-paper); border: 0; }
  .sidebar .wordmark { margin: 0; padding: 0; font-size: 20px; }
  .sidebar .brand-mark { width: 24px; height: 24px; }
  .workspace-picker { width: 100%; min-width: 0; max-width: none; margin: 0; padding: 0 var(--ds-space-2); }
  .sidebar .mobile-navigation-toggle { display: inline-flex; }
  .sidebar .nav { display: none; grid-column: 1 / -1; width: 100%; max-height: 60dvh; overflow-x: visible; overflow-y: auto; padding: var(--ds-space-4) 0 var(--ds-space-2); margin: 0; border: 0; }
  .sidebar[data-navigation-open='true'] .nav { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--ds-space-4); }
  .nav-group { display: grid; align-content: start; }
  .nav-group + .nav-group { margin: 0; padding: 0; border: 0; }
  .nav-group-label { display: block; padding: 0 0 var(--ds-space-1); }
  .nav a { min-height: 44px; padding: 0; white-space: normal; }
  .sidebar-bottom { display: none; }
  .workspace { padding: var(--ds-space-6) max(var(--ds-space-4), env(safe-area-inset-right)) max(var(--ds-space-10), env(safe-area-inset-bottom)) max(var(--ds-space-4), env(safe-area-inset-left)); }
  .app-topbar { height: auto; min-height: 52px; flex-wrap: wrap; padding: var(--ds-space-2) var(--ds-space-4); gap: var(--ds-space-2); }
  .breadcrumbs { display: none; }
  .topbar-actions { max-width: 100%; margin-left: auto; flex-wrap: wrap; gap: var(--ds-space-3); }
  .topbar-actions button { min-height: 44px; font-size: var(--ds-text-sm); }
  .page-heading { align-items: flex-start; gap: var(--ds-space-4); margin-bottom: var(--ds-space-6); }
  .workspace .page-heading h1 { font-size: 24px; }
  .page-heading p { font-size: var(--ds-text-base); max-width: none; }
  html[data-design-system] .workspace :is(.activity-kind-switcher button, .activity-intent-button, .activity-open, .activity-agent-chip, .activity-tool-chip, .activity-more-agents, .activity-resource) { min-height: 44px; }
  .memory-row { flex-wrap: wrap; gap: var(--ds-space-1); }
  .memory-row-copy { flex-basis: 100%; }
  .memory-row .memory-date { margin-left: 0; }
  .connection-row { padding: var(--ds-space-4) 0; }
  .empty, .insight-empty { padding: var(--ds-space-10) 0; }
  .plan-grid { grid-template-columns: 1fr; }
  .auth.auth-layout h1 { font-size: 24px; }
  .auth .field > input, .auth .primary { min-height: 44px; }
  .auth.provisioning { margin-top: var(--ds-space-10); }
  .task-reporting-setup h2 { font-size: var(--ds-text-xl); }
}
@media (pointer: coarse) {
  .nav a, .auth .auth-links a, .setup-name-fields button { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  button, .button { transform: none !important; }
}
@media (forced-colors: active) {
  .nav a[aria-current="page"] { color: HighlightText; background: Highlight; }
  .status-label, .activity-status, .connection-state { color: CanvasText; }
}

/* Plain app layer. One sans face at normal tracking, text on one background,
   status as words, spacing instead of rules and frames. Form controls and
   focus rings keep their visible boundaries. */
html[data-design-system] :is(h1, h2, h3, h4, .wordmark, .ds-heading-group > :is(h1, h2, h3), .ds-dialog h2, .ds-panel-header :is(h2, h3)) { letter-spacing: normal; }
html[data-design-system] :is(em, i, cite, q) { font-style: normal; }
html[data-design-system] .ds-eyebrow { font-family: var(--ds-font-sans); font-size: var(--ds-text-sm); font-weight: 450; letter-spacing: normal; text-transform: none; color: var(--ds-muted); }
html[data-design-system] :is(.ds-badge, .ds-sticker) { display: inline; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ds-muted); font: inherit; font-size: inherit; letter-spacing: normal; text-transform: none; transform: none; box-shadow: none; }
html[data-design-system] :is(.ds-badge, .ds-sticker) > :is(svg, img) { display: none; }
html[data-design-system] :is(.ds-card, .ds-panel, .ds-option, .ds-loading, .ds-metric) { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
html[data-design-system] :is(.ds-card, .ds-metric) { padding: 0; }
html[data-design-system] .ds-option { padding: var(--ds-space-2) 0; }
html[data-design-system] .ds-loading { padding: var(--ds-space-4) 0; }
html[data-design-system] :is(.ds-panel-header, .ds-panel-footer, .ds-panel-body) { padding-inline: 0; border: 0; }
html[data-design-system] .ds-notice { padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ds-ink); }
html[data-design-system] .ds-notice[data-tone='danger'] { color: var(--ds-danger); background: transparent; }
html[data-design-system] .ds-notice[data-tone='success'] { color: var(--ds-success); background: transparent; }
html[data-design-system] .ds-notice[data-tone='warning'] { color: var(--ds-warning); background: transparent; }
html[data-design-system] .ds-evidence-row { border: 0; }
html[data-design-system] .ds-tabs { border: 0; gap: var(--ds-space-6); }
html[data-design-system] .ds-tab { border: 0; font-size: var(--ds-text-base); font-weight: 450; }
html[data-design-system] .ds-tabs .ds-tab:is([aria-selected='true'], [aria-current='page']) { color: var(--ds-ink); font-weight: 600; border: 0; }
html[data-design-system] .ds-command > .ds-code-scroll { border: 0; background: var(--ds-surface); }
html[data-design-system] pre { border: 0; background: var(--ds-surface); }
html[data-design-system] .ds-skeleton::after { display: none; }
.status-label { color: var(--ds-muted); font-weight: 450; }
.status-label[data-tone='danger'] { color: var(--ds-danger); }
.account-content :is(.plan-label, .plan-features) .icon { display: none; }
.account-content .plan-grid { gap: var(--ds-space-10); }
.account-content .plan-features li { margin: var(--ds-space-2) 0; }

/* Icons, identity and live motion (design-system identityMark, emptyState, ds-stagger, ds-flash). */
.nav a { display: flex; align-items: center; gap: var(--ds-space-3); }
.nav a > .icon { flex-shrink: 0; color: var(--ds-muted); transition: color var(--ds-duration-fast) var(--ds-ease-out); }
.nav a[aria-current="page"] > .icon { color: var(--ds-accent); }
@media (hover: hover) { .nav a:hover > .icon { color: var(--ds-ink); } }
.workspace-picker { display: flex; align-items: center; gap: var(--ds-space-2); }
.workspace-initial { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; color: var(--ds-accent-ink); background: var(--ds-accent); border-radius: 7px; font-size: var(--ds-text-xs); font-weight: 700; }
.workspace-note, .sidebar-bottom button { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
.workspace-kind { display: inline-flex; align-items: center; gap: 6px; }
.activity-kind-switcher button { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
.activity-kind-switcher button > .icon { color: var(--ds-muted); transition: color var(--ds-duration-fast) var(--ds-ease-out); }
.activity-kind-switcher button[aria-pressed="true"] > .icon { color: var(--ds-accent); }
.activity-intent-button > .icon { color: var(--ds-accent); }
.activity-refresh-label { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
.activity-refresh-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ds-success); }
.activity-refresh-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: var(--ds-success); animation: ds-presence-pulse var(--ds-pulse-duration) var(--ds-ease-out) infinite; }
.activity-footnote, .activity-history-paused, .insight-scope, .share-link-label, .preview-label { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
.activity-options > summary { display: inline-flex; align-items: center; gap: var(--ds-space-2); cursor: pointer; }
.memory-row { display: flex; align-items: flex-start; gap: var(--ds-space-3); }
.memory-icon { display: inline-grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; color: var(--ds-accent); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 9px; }
.memory-row.ds-row-hover { margin-inline: calc(var(--ds-space-3) * -1); padding-inline: var(--ds-space-3); }
.empty.ds-empty h2 { font-size: var(--ds-text-lg); }
:is(button, .button, .button-link) > .icon { flex-shrink: 0; }
@media (prefers-reduced-motion: reduce) { .activity-refresh-dot::after { animation: none; } }

/* ── Dashboard shell: top bar, icon rail, main column (design-system App shell) ── */
.app-bar { gap: var(--ds-space-2); }
.app-bar .topbar-logo { text-decoration: none; display: inline-grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 7px; }
.app-bar .topbar-logo:hover { background: var(--ds-hover-bg); }
.app-bar .mobile-navigation-toggle { display: none; }
.app-bar .workspace-picker { gap: var(--ds-space-2); padding-right: 4px; }
.app-bar .workspace-picker .ds-select, .app-bar .workspace-picker select { min-width: 0; }
.app-bar .workspace-picker :is(select, .ds-select-trigger) { min-height: 28px; height: 28px; padding: 0 22px 0 2px; color: var(--ds-ink); background-color: transparent; border: 0; box-shadow: none; font-size: var(--ds-text-sm); font-weight: 500; }
.app-bar .workspace-initial { width: 20px; height: 20px; border-radius: 6px; font-size: 11px; }
.app-bar .crumb-page { color: var(--ds-ink); }
.app-bar .topbar-actions { display: flex; align-items: center; gap: var(--ds-space-2); margin-left: auto; }
.app-bar .topbar-actions > :is(button, .button-link):not(.ds-search-trigger, .ds-topbar-action) { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; }
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-initial { color: var(--ds-accent-ink); background: var(--ds-accent); display: inline-grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; font-size: 12px; font-weight: 700; }
.account-menu { display: flex; margin: 0; }
.account-menu > summary.ds-topbar-button { display: grid; padding: 0; border: 0; overflow: hidden; }
.account-menu-panel { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; display: grid; gap: 2px; width: 248px; padding: var(--ds-space-2); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); box-shadow: var(--ds-shadow-dialog); animation: ds-palette-in 160ms var(--ds-ease-out); }
.account-menu-head { display: grid; gap: 2px; padding: var(--ds-space-2) var(--ds-space-2) var(--ds-space-3); margin-bottom: var(--ds-space-1); border-bottom: 1px solid var(--ds-hairline); }
.account-menu-head > strong { overflow: hidden; font-size: var(--ds-text-sm); font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.account-menu-head > span { color: var(--ds-muted); font-size: var(--ds-text-xs); }
.account-menu-panel > :is(a, button) { display: flex; align-items: center; gap: var(--ds-space-3); width: 100%; min-height: 34px; padding: 0 var(--ds-space-2); color: var(--ds-ink); background: none; border: 0; border-radius: var(--ds-radius-control); font-size: var(--ds-text-sm); text-decoration: none; text-align: left; justify-content: flex-start; box-shadow: none; }
.account-menu-panel > :is(a, button):hover { background: var(--ds-paper); }
.account-menu-panel > button > kbd { margin-left: auto; }
.account-menu-panel > :is(a, button) > .icon { color: var(--ds-muted); }
.app-shell[data-shell='rail'] { display: block; min-height: calc(100dvh - var(--ds-topbar-height)); }
.app-shell[data-shell='rail'] .main-column { margin-left: var(--ds-rail-width); min-width: 0; }
.app-shell[data-shell='rail'] .workspace { max-width: 1200px; margin: 0 auto; padding: var(--ds-space-8) var(--ds-space-10) var(--ds-space-16); }
.demo ~ .app-shell .ds-rail { top: calc(var(--ds-topbar-height) + 37px); }
.app-shell .ds-rail .ds-rail-bottom > button { justify-content: flex-start; min-height: 38px; box-shadow: none; }
@media (max-width: 900px) {
  .app-bar .mobile-navigation-toggle { display: inline-grid; place-items: center; }
  .app-bar .topbar-feedback, .app-bar .topbar-share, .app-bar .crumb-page, .app-bar .crumb-page-sep { display: none; }
  .ds-search-trigger { width: auto; } .ds-search-trigger > span, .ds-search-trigger > kbd { display: none; }
  .app-shell .ds-rail { width: min(280px, 85vw); transform: translateX(-100%); transition: transform var(--ds-duration-slow) var(--ds-ease-out); box-shadow: none; }
  .app-shell .ds-rail[data-navigation-open='true'] { transform: none; box-shadow: 16px 0 48px rgb(0 0 0 / .5); }
  .app-shell .ds-rail a > span, .app-shell .ds-rail button > span { opacity: 1; }
  .app-shell[data-shell='rail'] .main-column { margin-left: 0; }
  .app-shell[data-shell='rail'] .workspace { padding: var(--ds-space-6) var(--ds-space-4) var(--ds-space-12); }
}
@media (max-width: 600px) { .app-bar .setup-resume { display: none; } .app-bar { padding: 0 var(--ds-space-2); } }
.app-bar .workspace-picker { min-height: 32px; margin: 0; padding: 0 2px 0 6px; background: transparent; border: 0; border-radius: var(--ds-radius-control); box-shadow: none; }
.app-bar .workspace-picker:hover, .app-bar .workspace-picker:focus-within { background: var(--ds-surface-raised); }
.app-bar .workspace-picker .ds-select-trigger { min-height: 28px; padding-block: 0; }
.page-heading-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); }
.page-heading-actions .page-docs { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; color: var(--ds-ink); background: transparent; border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); font-size: var(--ds-text-xs); text-decoration: none; }
.page-heading-actions .page-docs:hover { border-color: var(--ds-input-border); background: var(--ds-surface-raised); }
.page-heading-actions .page-docs > .icon { color: var(--ds-muted); }
.workspace .activity-section-tabs { gap: var(--ds-space-5); border-bottom: 1px solid var(--ds-hairline); margin-bottom: var(--ds-space-6); }
.workspace .activity-section-tabs .ds-tab { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 0 10px; color: var(--ds-muted); text-decoration: none; }
.workspace .activity-section-tabs .ds-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ds-accent); transform: scaleX(0); transition: transform var(--ds-duration-slow) var(--ds-ease-out); }
.workspace .activity-section-tabs .ds-tab[aria-current="page"] { color: var(--ds-ink); }
.workspace .activity-section-tabs .ds-tab[aria-current="page"]::after { transform: scaleX(1); }
.workspace .activity-section-tabs .ds-tab[aria-current="page"] > .icon { color: var(--ds-accent); }

/* Memory: bordered page list, icon tabs. */
.workspace .memory-tabs { display: flex; gap: var(--ds-space-5); margin-bottom: var(--ds-space-5); padding-bottom: 0; border-bottom: 1px solid var(--ds-hairline); }
.workspace .memory-tabs button { position: relative; display: inline-flex; align-items: center; gap: 6px; padding-bottom: 10px; }
.workspace .memory-tabs button::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ds-accent); transform: scaleX(0); transition: transform var(--ds-duration-slow) var(--ds-ease-out); }
.workspace .memory-tabs button[aria-pressed="true"]::after { transform: scaleX(1); }
.workspace .memory-tabs button > .icon { color: var(--ds-muted); }
.workspace .memory-tabs button[aria-pressed="true"] > .icon { color: var(--ds-accent); }
.memory-panel { margin-top: var(--ds-space-4); }
.memory-panel .ds-panel-head > span:first-child { flex: 1; }
.memory-rows { display: grid; }
.memory-rows > .memory-row + .memory-row { border-top: 1px solid var(--ds-hairline); }
.workspace .memory-panel .memory-row { display: flex; align-items: center; gap: var(--ds-space-3); width: 100%; margin: 0; padding: var(--ds-space-3) var(--ds-space-4); background: transparent; border: 0; border-radius: 0; box-shadow: none; text-align: left; }
.memory-panel .memory-icon { width: 30px; height: 30px; border-radius: 8px; }
.memory-row-title { display: flex; align-items: center; gap: var(--ds-space-2); min-width: 0; }
.memory-panel .memory-row-copy { display: grid; flex: 1; gap: 2px; min-width: 0; }
.memory-panel .memory-row-copy .muted { overflow: hidden; color: var(--ds-muted); font-size: var(--ds-text-sm); text-overflow: ellipsis; white-space: nowrap; }
.memory-panel .memory-date { flex-shrink: 0; color: var(--ds-muted); font-size: var(--ds-text-xs); font-variant-numeric: tabular-nums; }
.memory-row-chevron { flex-shrink: 0; color: var(--ds-hairline-strong); transition: transform var(--ds-duration-fast) var(--ds-ease-out), color var(--ds-duration-fast) var(--ds-ease-out); }
@media (hover: hover) { .memory-row:hover .memory-row-chevron { color: var(--ds-muted); transform: translateX(2px); } }
.ds-skeleton-panel .ds-panel-head { gap: var(--ds-space-2); text-transform: none; font-family: var(--ds-font-sans); font-size: var(--ds-text-xs); letter-spacing: normal; }
.ds-skeleton-panel .ds-panel-head .ds-spinner { width: 12px; height: 12px; }
.workspace .memory-search { max-width: 420px; }

/* Detail side panel (dashboard grammar): header bar, mono section labels, bordered cards, slide-in. */
html[data-design-system] dialog.detail { width: min(560px, 100vw); background: var(--ds-paper); border-left: 1px solid var(--ds-hairline-strong); border-radius: 0; box-shadow: -24px 0 64px rgb(0 0 0 / .45); }
html[data-design-system] dialog.detail::backdrop { background: rgb(0 0 0 / .45); }
dialog.detail[open] { animation: ds-panel-in 260ms var(--ds-ease-out); }
@keyframes ds-panel-in { from { transform: translateX(24px); opacity: .4; } }
html[data-design-system] .detail .detail-header { position: sticky; top: 0; z-index: 3; min-height: 48px; padding: 0 var(--ds-space-4) 0 var(--ds-space-5); color: var(--ds-ink); background: var(--ds-surface-raised); border-bottom: 1px solid var(--ds-hairline-strong); font-size: var(--ds-text-sm); font-weight: 500; }
.detail .detail-close-controls { display: inline-flex; align-items: center; gap: var(--ds-space-2); }
html[data-design-system] .detail .detail-body { padding: var(--ds-space-6) var(--ds-space-5) var(--ds-space-10); }
.detail .activity-detail-kicker { display: inline-flex; align-items: center; gap: var(--ds-space-2); color: var(--ds-muted); font-family: var(--ds-font-mono); font-size: var(--ds-mono-label); letter-spacing: .04em; text-transform: uppercase; }
.detail .activity-detail-kicker .activity-status { font-family: var(--ds-font-sans); letter-spacing: normal; text-transform: none; font-size: var(--ds-text-sm); }
.detail :is(.activity-last-step > span, .activity-report-label, .activity-section-heading h3, .activity-log-heading h3) { color: var(--ds-muted); font-family: var(--ds-font-mono); font-size: var(--ds-mono-label); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.detail .activity-last-step, .detail .activity-detail-report { display: grid; gap: 6px; padding: var(--ds-space-4); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.detail .activity-detail-resources { display: flex; flex-wrap: wrap; gap: var(--ds-space-2); }
:is(.workspace, .detail) .activity-detail-resources .activity-resource { padding: 4px 10px; color: var(--ds-ink); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline-strong); border-radius: 999px; text-decoration: none; font-size: var(--ds-text-xs); }
:is(.workspace, .detail) .activity-detail-resources .activity-resource:hover { border-color: var(--ds-input-border); }
.detail .activity-approaches { display: grid; gap: var(--ds-space-2); }
.detail .approach-card { display: grid; gap: var(--ds-space-2); padding: var(--ds-space-4); background: var(--ds-paper); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.detail .approach-card > p { margin: 0; color: var(--ds-ink); font-size: var(--ds-text-sm); line-height: 1.65; }
.detail .activity-steps-expander { padding: var(--ds-space-3) var(--ds-space-4); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-card); }
.detail .activity-source-note { padding: var(--ds-space-3) var(--ds-space-4); background: var(--ds-surface-raised); border-radius: var(--ds-radius-card); }
.detail .work-log-details > summary { min-height: 28px; }
.detail .activity-receipt-fields { display: grid; grid-template-columns: 120px 1fr; gap: 6px var(--ds-space-3); margin: var(--ds-space-2) 0 0; padding: var(--ds-space-3); background: var(--ds-surface-raised); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-control); font-size: var(--ds-text-xs); }
.detail .activity-receipt-fields dt { color: var(--ds-muted); font-family: var(--ds-font-mono); }
.detail .activity-receipt-fields dd { margin: 0; overflow-wrap: anywhere; font-family: var(--ds-font-mono); }
@media (prefers-reduced-motion: reduce) { dialog.detail[open] { animation: none; } }
/* Narrow top bar: hide secondary actions with enough specificity to beat the action layout rule. */
.app-bar .crumb-page, .app-bar .workspace-picker { max-width: 46vw; }
.app-bar .workspace-picker :is(.ds-select-value, select) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .app-bar .topbar-actions > :is(.topbar-feedback, .topbar-share):not(.ds-search-trigger) { display: none; }
  .app-bar .topbar-actions > .ds-search-trigger { width: 30px; padding: 0; justify-content: center; }
}
@media (max-width: 600px) {
  .app-bar .topbar-actions > :is(.setup-resume, a.ds-topbar-button):not(.ds-search-trigger) { display: none; }
  .app-bar .ds-pill { display: none; }
  .app-bar .workspace-picker { max-width: 40vw; }
}
@media (max-width: 700px) {
  .workspace .page-heading { flex-direction: column; align-items: stretch; gap: var(--ds-space-3); }
  .page-heading-actions { justify-content: flex-start; }
}

/* Site analytics (operator only): layout of shared data-display primitives. */
.analytics-view { display: grid; gap: var(--ds-space-6); }
.analytics-toolbar { justify-content: flex-end; }
.analytics-window { min-width: 12rem; }
.analytics-body { display: grid; gap: var(--ds-space-6); min-width: 0; }
.analytics-section { min-width: 0; }
.analytics-section .ds-panel-header { display: block; }
.analytics-section .ds-panel-header h2 { margin: 0; font-size: var(--ds-text-lg); }
.analytics-section .ds-panel-header p { margin: var(--ds-space-2) 0 0; color: var(--ds-muted); font-size: var(--ds-text-sm); }
.analytics-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ds-space-6); }
.analytics-yes, .analytics-no { display: inline-flex; align-items: center; gap: var(--ds-space-1); white-space: nowrap; }
.analytics-yes { color: var(--ds-success); }
.analytics-no { color: var(--ds-muted); }

/* Connections › linked teams */
.linked-workspaces { margin-top: var(--ds-space-6); }
.linked-teams { display: grid; gap: var(--ds-space-3); width: 100%; }
.linked-team { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--ds-space-2) var(--ds-space-3); }
.linked-team-label { display: inline-flex; align-items: center; gap: var(--ds-space-2); min-width: 0; font-size: var(--ds-text-sm); color: var(--ds-ink); }
.linked-team-label > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-confirm { grid-column: 1 / -1; display: grid; gap: var(--ds-space-2); padding: var(--ds-space-3); border: 1px solid var(--ds-hairline-strong); border-radius: var(--ds-radius-control); background: var(--ds-surface-raised); }
.linked-confirm p { margin: 0; font-size: var(--ds-text-sm); color: var(--ds-ink); }
.linked-confirm .ds-row { justify-content: flex-end; }

/* Approvals */
.approvals-view, .approvals-body { display: grid; gap: var(--ds-space-6); min-width: 0; }
.approvals-toolbar { justify-content: flex-end; }
.approvals-section { min-width: 0; }
.approvals-section .ds-panel-header { display: block; }
.approvals-section .ds-panel-header h2 { margin: 0; font-size: var(--ds-text-lg); }
.approvals-count { color: var(--ds-muted); font-weight: 400; }
.approvals-list { display: grid; gap: var(--ds-space-4); }
.approvals-card { display: grid; gap: var(--ds-space-3); padding: var(--ds-space-4); border: 1px solid var(--ds-hairline); border-radius: var(--ds-radius-card); background: var(--ds-surface); min-width: 0; }
.approvals-card[data-open="true"] { border-color: var(--ds-hairline-strong); }
.approvals-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--ds-space-3); }
.approvals-card-head h3 { margin: 0; font-size: var(--ds-text-base); overflow-wrap: anywhere; }
.approvals-meta { margin: var(--ds-space-1) 0 0; color: var(--ds-muted); font-size: var(--ds-text-sm); overflow-wrap: anywhere; }
.approvals-question { margin: 0; padding: var(--ds-space-3) var(--ds-space-4); border-left: 2px solid var(--ds-accent); background: var(--ds-surface-raised); border-radius: 0 var(--ds-radius-control) var(--ds-radius-control) 0; color: var(--ds-ink); overflow-wrap: anywhere; }
.approvals-review { display: grid; gap: var(--ds-space-3); min-width: 0; }
.approvals-mode { display: grid; gap: var(--ds-space-2); margin: 0; padding: 0; border: 0; min-width: 0; }
.approvals-mode legend { padding: 0; margin-bottom: var(--ds-space-2); font-size: var(--ds-text-sm); font-weight: 600; }
.approvals-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--ds-space-2); align-items: start; font-size: var(--ds-text-sm); }
.approvals-choice > span { display: grid; gap: var(--ds-space-1); }
.approvals-choice small { color: var(--ds-muted); }
.approvals-topic { margin-left: var(--ds-space-6); }
.approvals-grants, .approvals-history { list-style: none; margin: 0; padding: 0; display: grid; }
.approvals-row { display: flex; align-items: center; justify-content: space-between; gap: var(--ds-space-3); padding: var(--ds-space-3) 0; border-top: 1px solid var(--ds-hairline); min-width: 0; }
.approvals-row:first-child { border-top: 0; }
.approvals-row > div { min-width: 0; overflow-wrap: anywhere; }
.approvals-gaps { margin: 0; }
@media (max-width: 640px) {
  .approvals-card-head .ds-row { width: 100%; justify-content: flex-end; }
  .approvals-topic { margin-left: 0; }
  .approvals-row { align-items: flex-start; flex-direction: column; }
}
.analytics-notes { margin: 0; padding-left: var(--ds-space-5); color: var(--ds-muted); font-size: var(--ds-text-xs); line-height: 1.7; }
@media (max-width: 900px) { .analytics-grid { grid-template-columns: minmax(0, 1fr); } }
.approvals-rule > div:first-child { flex: 1; }
.approvals-rule-actions { flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; gap: var(--ds-space-2); }
@media (max-width: 640px) { .approvals-rule-actions { justify-content: flex-start; } }
