* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  background: var(--surface-canvas);
  color: var(--text-primary);
  font-family: var(--font-ui);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-strong);
}

.ui-icon {
  display: inline-block;
  flex: 0 0 auto;
  height: 1em;
  overflow: visible;
  vertical-align: -0.12em;
  width: 1em;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 2px;
  box-shadow: var(--shadow-focus);
}

.skip-link {
  background: var(--text-primary);
  border-radius: var(--radius-sm);
  color: var(--surface-raised);
  left: 12px;
  padding: 8px 12px;
  position: fixed;
  top: 10px;
  transform: translateY(-180%);
  transition: transform 120ms ease;
  z-index: 100;
}

.skip-link:focus-visible {
  color: var(--surface-raised);
  transform: translateY(0);
}

@media (forced-colors: active) {
  :focus-visible {
    box-shadow: none;
    outline: 3px solid CanvasText;
  }

  .skip-link {
    background: Canvas;
    color: CanvasText;
  }
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-weight: var(--weight-medium);
  letter-spacing: -0.025em;
}

h1 {
  font-size: var(--text-page-title);
  line-height: 1.22;
  margin-bottom: 0.55rem;
}

h2 {
  font-size: var(--text-heading-md);
  line-height: 1.35;
  margin-bottom: 0.9rem;
}

h3 {
  font-size: var(--text-heading-sm);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.serif {
  font-family: var(--font-editorial);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  background: var(--surface-muted);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100vh;
  left: 0;
  padding: 24px 14px 18px;
  position: fixed;
  top: 0;
  width: var(--sidebar-width);
  z-index: 20;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  margin: 0 8px 30px;
}

.brand-mark {
  align-items: center;
  background: var(--text-primary);
  border-radius: var(--radius-md);
  color: var(--surface-canvas);
  display: inline-flex;
  font-family: var(--font-editorial);
  font-size: var(--text-body);
  height: 32px;
  justify-content: center;
  width: 32px;
}

.brand-name {
  font-size: var(--text-heading-sm);
  font-weight: var(--weight-strong);
  letter-spacing: -0.02em;
}

.brand-caption {
  color: var(--text-muted);
  display: block;
  font-size: var(--text-2xs);
  font-weight: var(--weight-regular);
  letter-spacing: 0;
}

.nav-list {
  display: grid;
  gap: 20px;
}

.nav-section-label {
  color: var(--text-muted);
  font-size: var(--text-3xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.09em;
  margin: 0 10px 6px;
  text-transform: uppercase;
}

.nav-section-links {
  display: grid;
  gap: 3px;
}

.nav-link {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  display: flex;
  font-size: var(--text-body);
  gap: 10px;
  padding: 8px 10px;
}

.nav-link::before {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  content: "";
  height: 6px;
  width: 6px;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-raised-translucent);
  color: var(--text-primary);
}

.nav-link.active::before {
  background: var(--accent);
}

.sidebar-account {
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  padding: 14px 2px 0;
  position: relative;
}

.sidebar-account > summary {
  list-style: none;
}

.sidebar-account > summary::-webkit-details-marker {
  display: none;
}

.sidebar-user {
  align-items: center;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 9px;
  padding: 8px 6px;
  position: relative;
}

.sidebar-user::after {
  color: var(--text-muted);
  content: "⌄";
  font-size: var(--text-control);
  margin-left: auto;
  transform: translateY(-1px);
}

.sidebar-account[open] .sidebar-user::after {
  transform: rotate(180deg) translateY(-1px);
}

.sidebar-user:hover {
  background: var(--surface-raised-translucent);
}

.sidebar-avatar {
  align-items: center;
  background: var(--text-primary);
  border-radius: var(--radius-md);
  color: var(--surface-canvas);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  height: 30px;
  justify-content: center;
  width: 30px;
}

.sidebar-user-copy {
  display: grid;
  min-width: 0;
}

.user-name {
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
}

.user-role {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.account-menu {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  bottom: calc(100% + 6px);
  box-shadow: var(--shadow-floating);
  display: grid;
  gap: 3px;
  left: 2px;
  padding: 5px;
  position: absolute;
  right: 2px;
  z-index: 2;
}

.account-menu-link,
.account-menu-button {
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  font-size: var(--text-sm);
  padding: 8px 9px;
  text-align: left;
  width: 100%;
}

.account-menu-link small {
  color: var(--text-muted);
  font-size: var(--text-3xs);
}

.account-menu-link:hover,
.account-menu-link.active,
.account-menu-button:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.main {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 34px 36px 56px;
}

.page {
  margin: 0 auto;
  max-width: 1440px;
}

.reading-page {
  max-width: 900px;
}

.page-header {
  align-items: flex-start;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-header > :first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.page-header > .actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

.page-header > .actions .button {
  white-space: nowrap;
}

.header-meta-actions {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 2px;
}

.idea-publish-action {
  margin: 0;
}

.idea-derived-project {
  align-items: center;
  background: linear-gradient(135deg, var(--surface-accent-subtle) 0%, var(--surface-raised) 72%);
  border: 1px solid var(--accent-border-soft);
  border-color: var(--accent-border-soft);
  border-radius: var(--radius-md);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--space-4);
}

.idea-derived-project h2,
.idea-derived-project h3 {
  font-size: var(--text-heading-sm);
  margin-bottom: 5px;
}

.idea-derived-project .meta {
  margin: 0;
}

.idea-project-guidance {
  color: var(--text-secondary);
  font-size: var(--text-control);
  margin: 8px 0 0;
}

.idea-derived-project-actions {
  justify-content: flex-end;
}

.idea-derived-project-actions .button {
  white-space: nowrap;
}

.idea-header-meta {
  align-items: center;
  margin-top: 10px;
}

.idea-meta-item + .idea-meta-item::before {
  content: "·";
  margin-right: 14px;
}

.idea-workflow-module > .panel-header {
  margin-bottom: var(--space-4);
}

.idea-workflow-action {
  align-items: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: var(--space-4);
}

.idea-workflow-action p {
  margin: 4px 0 0;
}

.idea-state-message {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.idea-state-message.is-danger {
  background: var(--status-danger-surface);
}

.idea-state-message p {
  color: var(--text-secondary);
  margin: 5px 0;
}

.idea-content-management {
  margin-top: 14px;
}

.idea-research-content {
  padding-bottom: var(--space-2);
}

.idea-content-section {
  border-top: 1px solid var(--border-subtle);
  padding: 20px 0;
}

.idea-content-section:first-of-type {
  border-top: 0;
  padding-top: var(--space-1);
}

.idea-content-section h3 {
  font-size: var(--text-ui);
  margin-bottom: var(--space-2);
}

.idea-content-section .summary {
  color: var(--text-secondary);
  font-size: var(--text-body);
  line-height: 1.75;
  margin: 0;
  overflow-wrap: anywhere;
}

.idea-review-form {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
  padding: 17px;
}

.form-section-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 14px;
}

.idea-review-history,
.idea-revision-history {
  border-top: 0;
}

.page-kicker {
  color: var(--accent-strong);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.page-subtitle {
  color: var(--text-secondary);
  margin: 0;
  max-width: 720px;
}

.breadcrumbs {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  gap: 7px;
  margin-bottom: var(--space-3);
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--accent-strong);
}

.page-tabs {
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-5);
  margin: -8px 0 22px;
  overflow-x: auto;
}

.page-tab {
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  flex: 0 0 auto;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  padding: 9px 1px 10px;
}

.page-tab:hover {
  color: var(--text-primary);
}

.page-tab.active {
  border-bottom-color: var(--accent-strong);
  color: var(--text-primary);
}

.page-tab-count {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  margin-left: var(--space-1);
}

.collection-toolbar {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.collection-toolbar .filters {
  margin-bottom: 0;
}

.collection-toolbar .collection-view-tabs {
  align-self: stretch;
  flex: 1;
  margin: -8px 0 0;
}

.actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.button {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  gap: 7px;
  justify-content: center;
  line-height: 1;
  min-height: var(--control-height-md);
  padding: 9px 14px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.button:active:not(:disabled):not([aria-disabled="true"]) {
  transform: translateY(1px);
}

.button:disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.52;
  pointer-events: none;
}

.button.is-submitting {
  opacity: 0.78;
}

.button.is-submitting::before {
  animation: button-spin 700ms linear infinite;
  border: 2px solid currentcolor;
  border-radius: var(--radius-full);
  border-right-color: transparent;
  content: "";
  height: 12px;
  width: 12px;
}

@keyframes button-spin {
  to {
    transform: rotate(360deg);
  }
}

.button-primary {
  background: var(--accent-strong);
  color: var(--text-on-accent);
}

.button-primary:hover {
  background: var(--accent-strong-hover);
  color: var(--text-on-accent);
}

.idea-page-header {
  margin-bottom: var(--space-5);
}

.idea-export-actions {
  display: flex;
  margin-top: var(--space-5);
}

.button-secondary {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.button-secondary:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.button-contextual {
  background: var(--accent-surface);
  border-color: var(--accent-border-soft);
  color: var(--accent-text);
}

.button-contextual:hover {
  background: var(--accent-surface-hover);
  border-color: var(--accent-border);
  color: var(--accent-text-strong);
}

.button-ghost {
  color: var(--text-secondary);
  padding-left: 5px;
  padding-right: 5px;
}

.button-ghost:hover {
  color: var(--accent-strong);
}

.button-danger {
  background: var(--status-danger-surface);
  border-color: var(--status-danger-border-soft);
  color: var(--status-danger);
}

.button-danger:hover {
  background: var(--status-danger-surface-hover);
  border-color: var(--status-danger-border);
  color: var(--status-danger-text-strong);
}

.correction-card .button-danger {
  background: var(--status-danger);
  color: var(--text-on-accent);
}

.correction-card .button-danger:hover {
  background: var(--status-danger-text-strong);
  color: var(--text-on-accent);
}

.button-small {
  font-size: var(--text-sm);
  min-height: var(--control-height-sm);
  padding: 7px 10px;
}

.filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: 22px;
}

.filter-link {
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  gap: 5px;
  justify-content: center;
  line-height: 1;
  min-height: var(--control-height-sm);
  padding: 6px 11px;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.filter-link:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.filter-link.active,
.filter-link.active:hover {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--surface-canvas);
}

.filter-count {
  align-items: center;
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  display: inline-flex;
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  height: 18px;
  justify-content: center;
  min-width: 18px;
  padding: 0 5px;
}

.filter-link.active .filter-count {
  background: var(--border-on-dark);
  color: var(--surface-raised);
}

.panel {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  padding: 22px;
}

.panel + .panel {
  margin-top: var(--space-4);
}

.panel-spaced {
  margin-top: 18px;
}

.action-summary {
  align-items: baseline;
  display: flex;
  gap: var(--space-2);
}

.action-summary strong {
  color: var(--accent-strong);
  font-size: var(--text-display-md);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
}

.action-summary span {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.action-list {
  display: grid;
  gap: 10px;
}

.action-groups {
  display: grid;
  gap: 30px;
}

.action-group-header {
  align-items: flex-end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin: 0 2px 12px;
}

.action-group-header h2 {
  font-size: var(--text-heading-sm);
  margin: 1px 0 2px;
}

.action-group-header p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.action-group-count {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  height: 27px;
  justify-content: center;
  min-width: 27px;
  padding: 0 8px;
}

.action-attention {
  border-top: 1px solid var(--border-subtle);
  margin-top: 34px;
  padding-top: 26px;
}

.action-card {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 17px 18px;
}

.action-card-urgent {
  border-left-color: var(--accent);
}

.action-card-main {
  min-width: 0;
}

.action-card h3 {
  font-size: var(--text-heading-sm);
  margin: 7px 0 3px;
}

.action-card p {
  color: var(--text-secondary);
  font-size: var(--text-control);
  margin: 0;
}

.action-card-attention {
  background: var(--surface-muted-55);
  border-left-color: var(--border-strong);
}

.empty-state {
  max-width: 760px;
  padding: 34px;
  text-align: center;
}

.empty-state p {
  margin-bottom: 0;
}

.full-width {
  width: 100%;
}

.panel-header {
  align-items: center;
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: 15px;
}

.panel-header h2,
.panel-header h3 {
  margin-bottom: 0;
}

.grid {
  display: grid;
  gap: var(--space-4);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-header {
  margin-bottom: 22px;
}

.home-pulse {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.home-metric {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  min-height: 116px;
  padding: 16px 18px;
  position: relative;
}

.home-metric::after {
  color: var(--border-strong);
  content: "↗";
  font-size: var(--text-body);
  position: absolute;
  right: 15px;
  top: 13px;
}

.home-metric:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.home-metric > span {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.home-metric strong {
  font-family: var(--font-editorial);
  font-size: var(--text-display-lg);
  font-weight: var(--weight-medium);
  line-height: 1;
  margin: 8px 0 5px;
}

.home-metric small {
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

.home-metric-accent {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--surface-canvas);
}

.home-metric-accent:hover {
  border-color: var(--text-primary);
  color: var(--text-on-accent);
}

.home-metric-accent::after,
.home-metric-accent > span,
.home-metric-accent small {
  color: var(--text-on-dark-muted);
}

.home-focus-grid,
.home-project-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.home-focus-grid > .panel {
  margin-top: 0;
}

.home-action-panel {
  grid-column: 1 / -1;
}

.home-owned-projects {
  grid-column: span 8;
}

.home-project-side {
  grid-column: span 4;
}

.section-kicker {
  color: var(--text-muted);
  font-size: var(--text-3xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  margin-bottom: 3px;
  text-transform: uppercase;
}

.home-action-panel .panel-header h2,
.lifecycle-panel .panel-header h2,
.home-project-grid .panel-header h2,
.agent-section-heading h2 {
  margin-bottom: 0;
}

.home-action-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.home-action-item {
  border-top: 1px solid var(--border-subtle);
}

.home-action-item:first-child {
  border-top: 0;
}

.home-action-item > a {
  align-items: center;
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 13px 2px;
}

.home-action-item > a:hover {
  color: var(--text-primary);
}

.home-action-index {
  color: var(--text-muted);
  font-family: var(--font-editorial);
  font-size: var(--text-sm);
}

.home-action-item.is-urgent .home-action-index {
  color: var(--accent-strong);
}

.home-action-copy {
  display: grid;
  min-width: 0;
}

.home-action-copy .signal-row {
  margin: 0 0 5px;
}

.home-action-copy strong {
  font-size: var(--text-body);
}

.home-action-copy small {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-top: 2px;
}

.home-action-meta {
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

.home-clear-state {
  align-items: center;
  display: flex;
  gap: 14px;
  min-height: 145px;
  padding: 20px;
}

.home-clear-state > span {
  align-items: center;
  background: var(--status-success-surface);
  border-radius: var(--radius-full);
  color: var(--status-success);
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: var(--weight-bold);
  height: 38px;
  justify-content: center;
  width: 38px;
}

.home-clear-state p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 3px 0 0;
}

.guide-header {
  margin-bottom: 0;
}

.guide-section {
  margin-top: 28px;
}

.guide-section-heading {
  align-items: end;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
  margin-bottom: 14px;
}

.guide-section-heading h2 {
  margin: 0;
}

.guide-section-heading > p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0;
  max-width: 460px;
  text-align: right;
}

.guide-flow {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.guide-flow li {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  min-height: 134px;
  padding: var(--space-4);
}

.guide-flow li > span {
  color: var(--accent-strong);
  font-family: var(--font-editorial);
  font-size: var(--text-2xs);
}

.guide-flow strong {
  align-self: end;
  font-size: var(--text-ui);
  margin-top: 20px;
}

.guide-flow small {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  line-height: 1.5;
  margin-top: var(--space-1);
}

.guide-task-list {
  border-top: 1px solid var(--border-subtle);
}

.guide-task {
  align-items: start;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 34px minmax(180px, 0.7fr) minmax(320px, 1.3fr) auto;
  padding: 20px 2px;
}

.guide-task-index {
  color: var(--accent-strong);
  font-family: var(--font-editorial);
  font-size: var(--text-sm);
}

.guide-task-copy h3 {
  margin: 0 0 5px;
}

.guide-task-copy p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0;
}

.guide-task-points {
  color: var(--text-secondary);
  display: grid;
  font-size: var(--text-sm);
  gap: 5px;
  margin: 0;
  padding-left: 18px;
}

.guide-task-points li::marker {
  color: var(--accent);
}

.guide-task > .button {
  align-self: center;
}

.guide-agent-panel {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 34px;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  margin-top: 28px;
  padding: var(--space-5);
}

.guide-agent-panel h2 {
  margin-bottom: 7px;
}

.guide-agent-panel > div:first-child > p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.65;
  margin: 0 0 15px;
  max-width: 520px;
}

.guide-agent-modes {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.guide-agent-modes > div {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  min-height: 116px;
  padding: 15px;
}

.guide-agent-modes strong {
  font-size: var(--text-control);
}

.guide-agent-modes p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  line-height: 1.55;
  margin: 6px 0 0;
}

.lifecycle-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lifecycle-step {
  border-left: 1px solid var(--border-subtle);
  display: grid;
  padding: 8px 18px;
  position: relative;
}

.lifecycle-step:first-child {
  border-left: 0;
  padding-left: 0;
}

.lifecycle-step:last-child {
  padding-right: 0;
}

.lifecycle-step strong {
  font-family: var(--font-editorial);
  font-size: var(--text-display-md);
  font-weight: var(--weight-medium);
  line-height: 1.1;
}

.lifecycle-step span {
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  margin-top: var(--space-1);
}

.lifecycle-step small {
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

.home-project-rows {
  display: grid;
}

.home-project-row {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px 0;
}

.home-owned-projects .home-project-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.home-project-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.home-project-row:last-child {
  padding-bottom: 0;
}

.home-project-row > span:first-child {
  display: grid;
}

.home-project-row strong {
  font-size: var(--text-ui);
}

.home-project-row small,
.home-project-owner {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: 2px;
}

.home-project-grid {
  margin-top: 18px;
}

.home-project-side .panel + .panel {
  margin-top: var(--space-4);
}

.compact-link-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.compact-link-list li {
  border-top: 1px solid var(--border-subtle);
}

.compact-link-list li:first-child {
  border-top: 0;
}

.compact-link-list a {
  display: grid;
  padding: 10px 0;
}

.compact-link-list li:first-child a {
  padding-top: 0;
}

.compact-link-list li:last-child a {
  padding-bottom: 0;
}

.compact-link-list strong {
  font-size: var(--text-control);
}

.compact-link-list span {
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-item {
  align-items: flex-start;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 0;
}

.list-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.list-item:last-child {
  padding-bottom: 0;
}

.list-item-title {
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  margin-bottom: 2px;
}

.meta {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.summary {
  color: var(--text-secondary);
  white-space: pre-line;
}

.status {
  align-items: center;
  border-radius: var(--radius-sm);
  display: inline-flex;
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  gap: 6px;
  padding: 4px 8px;
}

.status::before {
  background: currentColor;
  border-radius: var(--radius-full);
  content: "";
  height: 5px;
  width: 5px;
}

.status-neutral,
.stage-paused,
.stage-archived {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.stage-open_for_claim,
.status-info {
  background: var(--status-info-surface);
  color: var(--status-info-text);
}

.stage-active {
  background: var(--accent-surface);
  color: var(--accent-text);
}

.status-success {
  background: var(--status-success-surface);
  color: var(--status-success-text);
}

.status-danger {
  background: var(--status-danger-surface);
  color: var(--status-danger);
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.signal {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-2xs);
  padding: 2px 6px;
}

.signal-danger {
  background: var(--status-danger-surface);
  border-color: transparent;
  color: var(--status-danger);
}

.signal-clay {
  background: var(--accent-surface);
  border-color: transparent;
  color: var(--accent-text);
}

.idea-list {
  display: grid;
  gap: var(--space-3);
}

.idea-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px 20px;
}

.idea-card h2 {
  font-family: var(--font-editorial);
  font-size: var(--text-heading-md);
  margin-bottom: 5px;
}

.idea-summary-preview {
  color: var(--text-secondary);
  margin: var(--space-2) 0 var(--space-3);
  max-height: 12rem;
  overflow: auto;
}

.card-status {
  align-self: start;
  justify-self: end;
  margin-top: 1px;
}

.claim-status {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.portfolio-summary {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.portfolio-stat {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  padding: 15px 17px;
}

.portfolio-stat strong {
  font-family: var(--font-editorial);
  font-size: var(--text-display-sm);
  line-height: 1.1;
}

.portfolio-stat span {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-top: 5px;
}

.member-list {
  display: grid;
  gap: 14px;
}

.member-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  padding: 20px;
}

.member-card-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.member-identity {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
}

.member-identity h2 {
  font-family: var(--font-editorial);
  font-size: var(--text-heading-sm);
  margin: 0 0 3px;
}

.member-avatar {
  align-items: center;
  background: var(--accent-surface);
  border-radius: var(--radius-full);
  color: var(--accent-text);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-editorial);
  font-size: var(--text-ui);
  height: 36px;
  justify-content: center;
  width: 36px;
}

.member-counts {
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  gap: 7px 14px;
  justify-content: flex-end;
}

.member-counts strong {
  color: var(--text-primary);
  font-size: var(--text-control);
}

.member-project-list {
  border-top: 1px solid var(--border-subtle);
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
}

.member-project-list-standalone {
  border-top: 0;
  margin-top: 0;
}

.member-project-list-standalone .member-project-row:first-child {
  padding-top: 0;
}

.member-detail-grid .panel + .panel {
  margin-top: 0;
}

.member-project-row {
  align-items: flex-start;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px 0;
}

.member-project-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.member-project-main {
  min-width: 0;
}

.member-project-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
  gap: var(--space-2);
}

.role-label {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-2xs);
  font-weight: var(--weight-strong);
  padding: 2px 6px;
}

.role-label-lead {
  background: var(--accent-surface);
  color: var(--accent-text);
}

.member-project-main > .meta {
  margin-top: 6px;
}

.member-empty {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
}

.count {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.project-overview {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.project-overview-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  display: grid;
  gap: var(--space-1);
  min-width: 0;
  padding: 16px 18px;
  transition: border-color 140ms ease, transform 140ms ease;
}

.project-overview-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.project-overview-card > span {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.project-overview-card strong {
  font-family: var(--font-editorial);
  font-size: var(--text-display-md);
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-medium);
  line-height: 1.1;
}

.project-overview-card small {
  color: var(--text-muted);
  font-size: var(--text-2xs);
}

.project-attention {
  margin-bottom: var(--space-5);
}

.project-section-header,
.project-stage-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.project-section-header {
  margin-bottom: 14px;
}

.project-section-header h2,
.project-stage-header h3 {
  margin-bottom: 0;
}

.project-attention-list {
  border-top: 1px solid var(--border-subtle);
}

.project-attention-row {
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 13px 0;
}

.project-attention-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.project-attention-main {
  min-width: 0;
}

.project-attention-title {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-body);
  font-weight: var(--weight-strong);
  gap: var(--space-2);
}

.project-attention-row .signal-row {
  justify-content: flex-end;
  margin-top: 0;
}

.project-workflow {
  scroll-margin-top: 18px;
}

.project-workflow-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr));
}

.project-filtered-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

.project-filtered-grid .project-card {
  height: 100%;
}

.project-stage-group {
  background: var(--surface-muted-62);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  min-width: 0;
  padding: 14px;
  scroll-margin-top: 18px;
}

.project-stage-header {
  margin: 0 2px 12px;
}

.project-stage-header h3 {
  font-size: var(--text-body);
}

.project-stage-header p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  line-height: 1.45;
  margin: 3px 0 0;
}

.project-stage-count {
  align-items: center;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  height: 25px;
  justify-content: center;
  min-width: 25px;
  padding: 0 7px;
}

.project-stage-cards {
  display: grid;
  gap: 10px;
}

.project-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  padding: 14px;
}

.project-card h3 {
  font-family: var(--font-editorial);
  font-size: var(--text-heading-sm);
  margin: 9px 0 5px;
}

.project-card-summary {
  color: var(--text-secondary);
  display: -webkit-box;
  font-size: var(--text-control);
  line-height: 1.5;
  margin-bottom: var(--space-3);
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.project-card-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card-facts span {
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: 4px 8px;
}

.next-action {
  background: var(--surface-muted);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 10px 0;
  padding: 7px 9px;
}

.next-action strong {
  color: var(--text-primary);
  display: block;
  font-size: var(--text-2xs);
  letter-spacing: 0.03em;
  margin-bottom: 2px;
}

.project-card-footer {
  align-items: center;
  color: var(--text-muted);
  display: flex;
  font-size: var(--text-2xs);
  gap: var(--space-2);
  justify-content: space-between;
  margin-top: 10px;
}

.project-card-footer > span {
  align-items: center;
  display: inline-flex;
  gap: 5px;
  min-width: 0;
}

.project-board-empty {
  margin-inline: auto;
}

.avatar {
  align-items: center;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  display: inline-flex;
  font-size: var(--text-3xs);
  height: 24px;
  justify-content: center;
  width: 24px;
}

.detail-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.project-archive-summary + .detail-layout {
  margin-top: var(--space-5);
}

.detail-layout > *,
.list-item > *,
.fact-grid > * {
  min-width: 0;
}

.sticky-side {
  align-self: start;
  position: sticky;
  top: 24px;
}

.project-members-panel .panel-header {
  margin-bottom: var(--space-2);
}

.project-claim-callout {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-3);
  margin-top: 14px;
  padding: 14px;
}

.project-claim-callout strong {
  display: block;
  font-size: var(--text-ui);
  margin-bottom: 3px;
}

.project-claim-callout p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.45;
  margin: 0;
}

.project-claim-callout .button {
  width: 100%;
}

.project-member-summary {
  align-items: center;
}

.member-management {
  border-top: 1px solid var(--border-subtle);
  margin-top: 13px;
}

.member-management-summary {
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  list-style: none;
  min-height: 60px;
  padding: 8px 0;
}

.member-management-summary::-webkit-details-marker {
  display: none;
}

.member-management-summary > span {
  display: grid;
  gap: 1px;
}

.member-management-summary strong {
  color: var(--text-primary);
  font-size: var(--text-body);
  font-weight: var(--weight-semibold);
}

.member-management-summary small {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.member-management-summary::after {
  color: var(--text-muted);
  content: "⌄";
  font-size: var(--text-body);
  margin-left: var(--space-3);
  transition: transform 120ms ease;
}

.member-management[open] .member-management-summary::after {
  transform: rotate(180deg);
}

.member-management-content {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: 18px;
  padding: 18px 0 2px;
}

.member-management-group + .member-management-group {
  border-top: 1px solid var(--border-subtle);
  padding-top: 18px;
}

.member-management-group h3 {
  font-size: var(--text-control);
  margin-bottom: 2px;
}

.member-management-group > .meta {
  margin: 0;
}

.member-management-form {
  margin-top: var(--space-3);
}

.member-removal-list {
  display: grid;
  gap: 7px;
  margin-top: var(--space-3);
}

.member-management-row {
  align-items: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: flex;
  font-size: var(--text-control);
  gap: 10px;
  justify-content: space-between;
  padding: 8px 9px;
}

.destructive-action-panel {
  background: var(--surface-accent-subtle);
  border-color: var(--status-danger-border-faint);
}

.destructive-action-panel h2 {
  font-size: var(--text-body);
  margin-bottom: var(--space-1);
}

.destructive-action-panel .meta {
  margin: 0 0 13px;
}

.idea-danger-zone {
  align-items: center;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.idea-danger-zone .meta {
  margin-bottom: 0;
}

.project-detail-main > .panel + .panel {
  margin-top: 22px;
}

.content-module {
  min-width: 0;
}

.content-module > .panel-header,
.project-record-panel > .panel-header {
  align-items: flex-end;
}

.project-overview-module .summary {
  font-size: var(--text-body);
  margin-bottom: 20px;
}

.project-current-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-current-item {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  min-width: 0;
  padding: 15px 16px;
}

.project-next-item {
  border-left: 2px solid var(--accent);
}

.project-attention-block {
  align-items: center;
  background: var(--accent-surface);
  border-radius: var(--radius-md);
  color: var(--accent-text-strong);
  display: flex;
  font-size: var(--text-control);
  gap: var(--space-4);
  justify-content: space-between;
  margin-top: var(--space-3);
  padding: 13px 15px;
}

.project-attention-block > div,
.project-attention-block:not(:has(> div)) {
  min-width: 0;
}

.project-attention-block strong,
.project-attention-block span {
  display: block;
}

.project-attention-block strong {
  flex: 0 0 auto;
  white-space: nowrap;
}

.project-attention-block span {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.project-attention-block.is-danger {
  background: var(--status-danger-surface);
  color: var(--status-danger-text-strong);
}

.project-guidance-summary {
  border-left: 2px solid var(--status-success);
  margin-top: 14px;
  padding: 4px 0 4px 14px;
}

.project-overview-history,
.project-overview-module > .record-management {
  margin-top: var(--space-4);
}

.project-record-panel {
  padding: var(--space-5);
}

.project-record-panel .panel-header {
  margin-bottom: 20px;
}

.update-record {
  gap: 14px;
}

.update-record-featured {
  background: var(--surface-raised);
  box-shadow: none;
}

.update-record-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
}

.update-content-grid {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.update-content-block {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  min-width: 0;
  padding: 14px 15px;
}

.update-next-block {
  border-left: 2px solid var(--accent);
}

.update-content-value {
  color: var(--text-secondary);
  font-size: var(--text-control);
  line-height: 1.6;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.updates-history {
  margin-top: var(--space-4);
}

.update-history-item {
  padding-bottom: var(--space-2);
}

.update-history-item .update-content-grid {
  margin-top: var(--space-3);
}

.update-revision-history,
.update-management {
  margin-top: 10px;
}

.update-attachment-list {
  margin-top: 2px;
}

.attachment-management {
  flex: 0 0 auto;
}

.attachment-management > summary {
  font-size: var(--text-2xs);
}

.project-output-list {
  display: grid;
  gap: 14px;
}

.project-output-item {
  box-shadow: none;
}

.module-empty {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  padding: 18px;
}

.discussion-thread {
  display: grid;
  gap: 18px;
}

.comment-list {
  display: grid;
}

.comment-management {
  flex: 0 0 auto;
  position: relative;
}

.comment-management > summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-xs);
  list-style: none;
  padding: 5px 0 5px 8px;
}

.comment-management > summary::-webkit-details-marker {
  display: none;
}

.comment-management .comment-delete-form {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  padding: 6px;
  position: absolute;
  right: 0;
  top: 30px;
  z-index: 3;
}

.comment-composer {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  margin-top: 2px;
  padding: var(--space-4);
}

.comment-composer .form-field {
  margin-bottom: 10px;
}

.comment-composer-actions {
  display: flex;
  justify-content: flex-end;
}

.discussion-empty {
  padding: 8px 0;
}

.discussion-locked {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.activity-module > .panel-header {
  margin-bottom: 6px;
}

.activity-module .activity-history {
  border-top: 0;
}

.fact-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fact {
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  padding: 13px;
}

.fact-label {
  color: var(--text-muted);
  display: block;
  font-size: var(--text-2xs);
  margin-bottom: var(--space-1);
}

.fact-value {
  font-size: var(--text-ui);
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.timeline {
  border-left: 1px solid var(--border-strong);
  list-style: none;
  margin: 0 0 0 5px;
  padding: 0 0 0 20px;
}

.timeline-item {
  margin-bottom: 22px;
  position: relative;
}

.timeline-item::before {
  background: var(--surface-raised);
  border: 2px solid var(--accent);
  border-radius: var(--radius-full);
  content: "";
  height: 8px;
  left: -25px;
  position: absolute;
  top: 6px;
  width: 8px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-date {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin-bottom: 2px;
}

.timeline-title {
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  overflow-wrap: anywhere;
}

.timeline-body {
  color: var(--text-secondary);
  font-size: var(--text-control);
  margin-top: 5px;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.comment {
  border-top: 1px solid var(--border-subtle);
  padding: 14px 0;
}

.comment:first-child {
  border-top: 0;
  padding-top: 0;
}

.comment-author {
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
}

.comment-heading {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
}

.comment-delete-form {
  flex: 0 0 auto;
  margin: 0;
}

.comment-body {
  color: var(--text-secondary);
  font-size: var(--text-ui);
  margin: 5px 0 0;
  white-space: pre-line;
}

.attachment-list {
  display: grid;
  gap: var(--space-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.attachment-list li {
  align-items: baseline;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  justify-content: space-between;
  padding: 8px 10px;
}

.record-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 7px;
}

.record-actions a:not(.button) {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.correction-notice {
  border-left: 3px solid var(--status-danger);
}

.revision-history {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
}

.revision-history > summary {
  color: var(--text-muted);
  cursor: pointer;
  font-size: var(--text-sm);
}

.revision-history[open] > summary {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.output-resource {
  margin: 8px 0 0;
}

.output-resource a {
  color: var(--text-muted);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
}

.output-resource a:hover {
  color: var(--accent-strong);
  text-decoration-color: currentColor;
}

.resource-panel {
  overflow: hidden;
  padding: 0;
}

.resource-summary {
  align-items: center;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  font-size: var(--text-control);
  font-weight: var(--weight-semibold);
  gap: 10px;
  justify-content: space-between;
  list-style: none;
  padding: 17px 20px;
}

.resource-summary::-webkit-details-marker {
  display: none;
}

.resource-summary::after {
  color: var(--text-muted);
  content: "⌄";
  font-size: var(--text-body);
  font-weight: var(--weight-regular);
  margin-left: auto;
  transition: transform 120ms ease;
}

.resource-summary-title {
  align-items: center;
  display: inline-flex;
  gap: var(--space-2);
}

.resource-panel[open] .resource-summary::after {
  transform: rotate(180deg);
}

.resource-content {
  border-top: 1px solid var(--border-subtle);
  padding: 5px 20px 17px;
}

.resource-item {
  border-bottom: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-2);
  padding: 10px 0;
}

.resource-item-main {
  min-width: 0;
}

.resource-item-main .list-item-title {
  overflow-wrap: anywhere;
}

.resource-item-header {
  align-items: start;
  display: grid;
  gap: var(--space-2);
  grid-template-columns: minmax(0, 1fr) auto;
}

.resource-menu-trigger {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  gap: 6px;
  min-height: 28px;
  padding: 5px 7px;
}

.resource-menu-trigger::after {
  border-bottom: 1px solid currentcolor;
  border-right: 1px solid currentcolor;
  content: "";
  height: 4px;
  margin-top: -2px;
  transform: rotate(45deg);
  transition: transform 120ms ease, margin-top 120ms ease;
  width: 4px;
}

.resource-menu-trigger:hover,
.resource-menu-trigger[aria-expanded="true"] {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
  color: var(--text-primary);
}

.resource-menu-trigger[aria-expanded="true"]::after {
  margin-top: 2px;
  transform: rotate(225deg);
}

.resource-menu-content {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: 2px;
  padding: var(--space-1);
}

.resource-menu-content[hidden] {
  display: none;
}

.resource-menu-link {
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  padding: var(--space-2);
}

.resource-menu-link:hover,
.resource-menu-link:focus-visible {
  background: var(--surface-raised);
  color: var(--text-primary);
}

.resource-menu-link.is-danger {
  color: var(--status-danger);
}

.resource-menu-link.is-danger:hover,
.resource-menu-link.is-danger:focus-visible {
  background: var(--status-danger-surface);
  color: var(--status-danger-text-strong);
}

.resource-panel-footer {
  padding-top: var(--space-3);
}

.resource-panel-footer .button {
  width: 100%;
}

.resource-empty-action {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  display: flex;
  font-size: var(--text-sm);
  justify-content: center;
  margin-top: var(--space-4);
  padding: 10px 12px;
}

.resource-empty-action:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.attachment-list-compact {
  margin-top: var(--space-3);
}

.form-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 760px;
  padding: 26px;
}

.agent-consent-page {
  max-width: 960px;
}

.agent-consent-shell {
  margin: 10px auto 0;
  max-width: 880px;
}

.agent-consent-hero {
  margin: 0 auto 24px;
  max-width: 680px;
  text-align: center;
}

.agent-consent-brand {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.agent-consent-app-mark,
.agent-consent-taskboard-mark {
  align-items: center;
  border-radius: var(--radius-lg);
  display: inline-flex;
  font-family: var(--font-editorial);
  font-size: var(--text-heading-sm);
  font-weight: var(--weight-bold);
  height: 46px;
  justify-content: center;
  width: 46px;
}

.agent-consent-app-mark {
  background: var(--status-info-surface);
  color: var(--status-info-text-strong);
}

.agent-consent-taskboard-mark {
  background: var(--text-primary);
  color: var(--surface-canvas);
}

.agent-consent-link {
  background: var(--border-strong);
  height: 1px;
  position: relative;
  width: 34px;
}

.agent-consent-link::before,
.agent-consent-link::after {
  background: var(--surface-canvas);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  content: "";
  height: 6px;
  position: absolute;
  top: -4px;
  width: 6px;
}

.agent-consent-link::before {
  left: -1px;
}

.agent-consent-link::after {
  right: -1px;
}

.agent-consent-hero .page-kicker {
  margin-bottom: 7px;
}

.agent-consent-hero h1 {
  margin-bottom: 10px;
}

.agent-consent-lead {
  color: var(--text-secondary);
  margin: 0;
}

.agent-consent-identity {
  align-items: center;
  background: linear-gradient(135deg, var(--surface-raised) 0%, var(--surface-muted) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: flex;
  gap: var(--space-3);
  padding: 16px 20px;
}

.agent-consent-avatar {
  align-items: center;
  background: var(--accent-surface);
  border-radius: var(--radius-full);
  color: var(--accent-strong);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-body);
  font-weight: var(--weight-bold);
  height: 38px;
  justify-content: center;
  width: 38px;
}

.agent-consent-identity > span:nth-child(2) {
  display: grid;
  line-height: 1.35;
}

.agent-consent-identity strong {
  font-size: var(--text-body);
}

.agent-consent-identity small {
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.agent-consent-overline {
  color: var(--text-muted);
  display: block;
  font-size: var(--text-3xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  text-transform: uppercase;
}

.agent-consent-role-note {
  background: var(--status-success-surface);
  border-radius: var(--radius-pill);
  color: var(--status-success-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
  margin-left: auto;
  padding: 5px 10px;
  white-space: nowrap;
}

.agent-consent-form {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-top: 0;
  box-shadow: var(--shadow-overlay);
  overflow: hidden;
}

.agent-mode-section {
  padding: 24px 26px 4px;
}

.agent-mode-section h2 {
  margin: 2px 0 14px;
}

.agent-mode-options {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.agent-mode-option {
  align-items: flex-start;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 132px;
  padding: 17px;
  position: relative;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.agent-mode-option:hover {
  border-color: var(--border-strong);
}

.agent-mode-option:focus-within {
  box-shadow: var(--shadow-focus-accent);
}

.agent-mode-option.is-selected {
  background: var(--accent-surface-translucent);
  border-color: var(--accent-border-strong);
  box-shadow: var(--shadow-accent-inset);
}

.agent-mode-option.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.agent-mode-option input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.agent-mode-check {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  height: 20px;
  margin-top: 1px;
  position: relative;
  width: 20px;
}

.agent-mode-option.is-selected .agent-mode-check {
  border-color: var(--accent-strong);
}

.agent-mode-option.is-selected .agent-mode-check::after {
  background: var(--accent-strong);
  border-radius: var(--radius-full);
  content: "";
  inset: 4px;
  position: absolute;
}

.agent-mode-copy,
.agent-mode-copy > span {
  display: grid;
}

.agent-mode-copy > span {
  align-items: center;
  gap: 7px;
  grid-template-columns: auto 1fr;
}

.agent-mode-copy strong {
  font-size: var(--text-body);
}

.agent-mode-copy small {
  background: var(--surface-muted);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: var(--text-3xs);
  justify-self: start;
  padding: 3px 7px;
}

.agent-mode-option-yolo.is-selected .agent-mode-copy small {
  background: var(--accent-surface);
  color: var(--accent-text);
}

.agent-mode-copy p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin: 8px 0 0;
}

.agent-consent-safety {
  align-items: flex-start;
  background: var(--surface-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  display: flex;
  gap: 10px;
  margin: 20px 26px 0;
  padding: 11px 13px;
  transition: background 140ms ease, border-color 140ms ease;
}

.agent-consent-safety.is-active {
  background: var(--surface-accent-subtle);
  border-color: var(--accent-border-strong);
}

.agent-consent-safety > span {
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-editorial);
  font-size: var(--text-2xs);
  height: 20px;
  justify-content: center;
  margin-top: 1px;
  width: 20px;
}

.agent-consent-safety p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0;
}

.agent-consent-safety strong {
  color: var(--text-primary);
}

.agent-consent-footer {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-top: 22px;
  padding: 18px 26px;
}

.agent-consent-footer p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  line-height: 1.5;
  margin: 0;
  max-width: 440px;
}

.agent-consent-actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.agent-consent-approve {
  min-width: 130px;
}

.correction-object {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: var(--font-editorial);
  margin-bottom: 20px;
  overflow-wrap: anywhere;
  padding: 13px 15px;
}

.guidance-context-row {
  border-top: 1px solid var(--border-subtle);
  display: grid;
  gap: var(--space-3);
  grid-template-columns: 92px minmax(0, 1fr);
  margin-top: var(--space-3);
  padding-top: var(--space-3);
}

.guidance-context-row span {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
}

.guidance-context-row > p,
.guidance-context-row > .markdown-body {
  margin: 0;
}

.guidance-record {
  background: var(--surface-muted);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  display: grid;
  gap: 7px;
  margin-top: var(--space-3);
  padding: 12px 14px;
}

.guidance-record p {
  margin: 0;
}

.guidance-record-header {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
}

.form-field {
  margin-bottom: 19px;
}

.form-field label {
  display: block;
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
  margin-bottom: 6px;
}

.notification-address {
  align-items: center;
  background: var(--surface-muted);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-4);
  justify-content: space-between;
  margin-bottom: var(--space-5);
  padding: var(--space-4);
}

.notification-address > div {
  display: grid;
  gap: 3px;
}

.notification-address span,
.notification-address small {
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.notification-address strong {
  overflow-wrap: anywhere;
}

.notification-form {
  display: grid;
  gap: var(--space-5);
}

.notification-master-toggle {
  background: var(--accent-surface);
  border: 1px solid var(--accent-border-soft);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.notification-choice {
  align-items: flex-start;
  cursor: pointer;
  display: flex;
  gap: var(--space-3);
  line-height: 1.5;
}

.notification-choice > span {
  display: grid;
  gap: 2px;
}

.notification-choice small {
  color: var(--text-muted);
}

.notification-master-toggle .notification-choice small {
  color: var(--text-secondary);
}

.notification-selection-toolbar {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  padding: var(--space-3) var(--space-4);
}

.notification-preference-groups {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.notification-preference-group {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: var(--space-3);
  margin: 0;
  min-width: 0;
  padding: var(--space-4);
}

.notification-preference-group legend {
  font-size: var(--text-ui);
  font-weight: var(--weight-bold);
  padding: 0 4px;
}

.notification-review-group {
  grid-column: 1 / -1;
}

.notification-preference-group > p {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-1);
}

.notification-preference-group .notification-choice + .notification-choice {
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-3);
}

@media (max-width: 900px) {
  .notification-preference-groups {
    grid-template-columns: 1fr;
  }
}

.checkbox-control {
  appearance: none;
  background: var(--surface-raised);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-grid;
  flex: 0 0 20px;
  height: 20px;
  margin: 0;
  padding: 0;
  place-content: center;
  transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease,
    transform 100ms ease;
  width: 20px;
}

.checkbox-control::before {
  border: solid var(--surface-raised);
  border-width: 0 2px 2px 0;
  content: "";
  height: 9px;
  margin-top: -2px;
  transform: rotate(45deg) scale(0);
  transition: transform 120ms ease;
  width: 5px;
}

.checkbox-control:hover {
  background: var(--accent-surface);
  border-color: var(--accent);
}

.checkbox-control:checked,
.checkbox-control:indeterminate {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-on-dark-inset);
}

.checkbox-control:checked::before {
  transform: rotate(45deg) scale(1);
}

.checkbox-control:indeterminate::before {
  background: var(--surface-raised);
  border: 0;
  height: 2px;
  margin: 0;
  transform: scale(1);
  width: 9px;
}

.checkbox-control:active:not(:disabled) {
  transform: scale(0.93);
}

.checkbox-control:focus-visible {
  border-color: var(--accent-strong);
  outline: 2px solid var(--surface-raised);
  outline-offset: 1px;
  box-shadow: var(--shadow-focus-wide);
}

.checkbox-control:disabled {
  background: var(--surface-muted);
  border-color: var(--border-subtle);
  cursor: not-allowed;
  opacity: 0.62;
}

@media (forced-colors: active) {
  .checkbox-control {
    appearance: auto;
  }
}

.field-control {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  min-height: var(--control-height-lg);
  padding: 9px 11px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
  width: 100%;
}

select.field-control {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  cursor: pointer;
  padding-right: 38px;
}

select.field-control:hover:not(:disabled) {
  border-color: var(--accent);
}

select.field-control:disabled {
  background-color: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.72;
}

@media (forced-colors: active) {
  select.field-control {
    appearance: auto;
    background-image: none;
  }
}

.custom-select {
  position: relative;
  width: 100%;
}

.custom-select-native {
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
  width: 1px !important;
}

.custom-select-trigger.button {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
  font-size: var(--text-control);
  font-weight: var(--weight-regular);
  justify-content: flex-start;
  min-height: var(--control-height-lg);
  padding: 9px 38px 9px 11px;
  position: relative;
  text-align: left;
  width: 100%;
}

.custom-select-trigger.button::after {
  border-bottom: 1.5px solid var(--text-muted);
  border-right: 1.5px solid var(--text-muted);
  content: "";
  height: 6px;
  position: absolute;
  right: 15px;
  top: calc(50% - 5px);
  transform: rotate(45deg);
  transition: transform 140ms ease, top 140ms ease;
  width: 6px;
}

.custom-select-trigger.button:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--accent);
  color: var(--text-primary);
}

.custom-select-trigger.is-placeholder {
  color: var(--text-muted);
}

.custom-select.is-open .custom-select-trigger {
  border-color: var(--accent-strong);
  box-shadow: var(--shadow-focus);
}

.custom-select.is-open .custom-select-trigger::after {
  top: calc(50% - 1px);
  transform: rotate(225deg);
}

.custom-select.is-invalid .custom-select-trigger {
  border-color: var(--status-danger);
  box-shadow: var(--shadow-focus-danger);
}

.custom-select-list {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-dialog);
  left: 0;
  margin-top: 6px;
  max-height: 260px;
  min-width: 100%;
  overflow-y: auto;
  padding: 6px;
  position: absolute;
  top: 100%;
  z-index: 60;
}

.custom-select-list[hidden] {
  display: none;
}

.custom-select.opens-up .custom-select-list {
  bottom: 100%;
  margin-bottom: 6px;
  margin-top: 0;
  top: auto;
}

.custom-select-option {
  align-items: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  font-size: var(--text-control);
  line-height: 1.4;
  min-height: var(--control-height-md);
  padding: 8px 34px 8px 10px;
  position: relative;
}

.custom-select-option.is-active {
  background: var(--accent-surface);
  color: var(--text-primary);
}

.custom-select-option.is-selected {
  color: var(--accent-strong);
  font-weight: var(--weight-strong);
}

.custom-select-option.is-selected::after {
  color: var(--accent-strong);
  content: "✓";
  font-size: var(--text-ui);
  font-weight: var(--weight-bold);
  position: absolute;
  right: 11px;
}

.custom-select-option.is-disabled {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.52;
}

@media (forced-colors: active) {
  .custom-select-trigger.button,
  .custom-select-list {
    border: 1px solid CanvasText;
  }

  .custom-select-option.is-active {
    outline: 2px solid Highlight;
  }
}

textarea.field-control {
  line-height: 1.55;
  resize: vertical;
}

.markdown-editor {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.markdown-editor:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.markdown-editor-tabs {
  align-items: center;
  background: var(--surface-muted-55);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
}

.markdown-editor-tab.button {
  border-color: transparent;
  color: var(--text-muted);
  min-height: 30px;
  padding-inline: var(--space-3);
}

.markdown-editor-tab.button:hover {
  background: var(--surface-raised-translucent);
  color: var(--text-primary);
}

.markdown-editor-tab.button.is-active {
  background: var(--surface-raised);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  color: var(--text-primary);
}

.markdown-editor-hint {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin-left: auto;
  padding-inline: var(--space-2);
}

.markdown-editor-pane[hidden] {
  display: none;
}

.markdown-editor-pane textarea.field-control {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 132px;
  outline: 0;
  padding: 13px 14px;
}

.markdown-editor-pane textarea.field-control:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

@media (forced-colors: active) {
  .markdown-editor-pane textarea.field-control:focus-visible {
    outline-color: CanvasText;
  }
}

.markdown-preview-pane {
  min-height: 132px;
  padding: 13px 14px;
}

.markdown-preview-pane:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
}

.markdown-preview-empty,
.markdown-preview-status,
.markdown-preview-error {
  color: var(--text-muted);
  margin: 0;
}

.markdown-preview-error {
  color: var(--status-danger);
}

.math-source[data-math="display"] {
  display: block;
  overflow-x: auto;
  max-width: 100%;
  padding-block: 0.5rem;
}

.math-error {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.math-error small {
  display: block;
}

.markdown-body {
  line-height: 1.68;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}

.project-attention-block > .markdown-body {
  flex: 1 1 auto;
}

.project-attention-block > .markdown-body,
.project-attention-block > div > .markdown-body {
  margin-top: 3px;
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body blockquote,
.markdown-body pre,
.markdown-body table {
  margin: 0 0 0.9em;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-family: var(--font-editorial);
  font-weight: var(--weight-semibold);
  line-height: 1.25;
  margin: 1.15em 0 0.45em;
}

.markdown-body h1 {
  font-size: var(--text-display-sm);
}

.markdown-body h2 {
  font-size: var(--text-heading-md);
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  font-size: var(--text-heading-sm);
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.45em;
}

.markdown-body li + li {
  margin-top: 0.28em;
}

.markdown-body blockquote {
  border-left: 3px solid var(--accent-border-strong);
  color: var(--text-secondary);
  padding-left: var(--space-4);
}

.markdown-body code {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.12em 0.34em;
}

.markdown-body pre {
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: auto;
  padding: var(--space-3) var(--space-4);
}

.markdown-body pre code {
  background: transparent;
  padding: 0;
}

.markdown-body a {
  color: var(--accent-text);
  text-decoration: underline;
  text-decoration-color: var(--accent-border-strong);
  text-underline-offset: 0.16em;
}

.markdown-body a:hover {
  color: var(--accent-strong);
}

.markdown-body table {
  border-collapse: collapse;
  display: block;
  max-width: 100%;
  overflow-x: auto;
  width: max-content;
}

.markdown-body th,
.markdown-body td {
  border: 1px solid var(--border-subtle);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.markdown-body th {
  background: var(--surface-muted);
  font-weight: var(--weight-strong);
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid var(--border-subtle);
  margin: var(--space-5) 0;
}

.markdown-compact {
  line-height: 1.55;
}

.markdown-compact h1,
.markdown-compact h2,
.markdown-compact h3,
.markdown-compact h4,
.markdown-compact h5,
.markdown-compact h6 {
  font-family: var(--font-ui);
  font-size: inherit;
  margin: 0 0 0.45em;
}

.markdown-compact p,
.markdown-compact ul,
.markdown-compact ol,
.markdown-compact blockquote,
.markdown-compact pre,
.markdown-compact table {
  margin-bottom: 0.55em;
}

.field-control:focus {
  border-color: var(--accent);
  box-shadow: var(--shadow-focus);
}

.approval-choice {
  border: 0;
  margin-inline: 0;
  padding: 0;
}

.approval-choice legend {
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
  margin-bottom: 7px;
  padding: 0;
}

.form-field .approval-choice-card {
  align-items: center;
  background: var(--surface-canvas);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  gap: 13px;
  margin: 0;
  padding: 13px 15px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.approval-choice-card:hover {
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

.approval-choice-card > input[type="checkbox"] {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.approval-switch {
  background: var(--border-strong);
  border-radius: var(--radius-pill);
  display: inline-flex;
  flex: 0 0 38px;
  height: 22px;
  padding: 3px;
  transition: background-color 160ms ease;
}

.approval-switch::after {
  background: var(--surface-raised);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-subtle);
  content: "";
  height: 16px;
  transform: translateX(0);
  transition: transform 160ms ease;
  width: 16px;
}

.approval-choice-card > input[type="checkbox"]:checked + .approval-switch {
  background: var(--accent);
}

.approval-choice-card > input[type="checkbox"]:checked + .approval-switch::after {
  transform: translateX(16px);
}

.approval-choice-card > input[type="checkbox"]:focus-visible + .approval-switch {
  box-shadow: var(--shadow-focus);
}

.approval-copy,
.approval-copy-review,
.approval-copy-direct {
  display: grid;
}

.approval-copy strong {
  color: var(--text-primary);
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
}

.approval-copy small {
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
}

.approval-copy-direct,
.approval-choice-card > input[type="checkbox"]:not(:checked) ~ .approval-copy .approval-copy-review {
  display: none;
}

.approval-choice-card > input[type="checkbox"]:not(:checked) ~ .approval-copy .approval-copy-direct {
  display: grid;
}

.file-picker {
  align-items: center;
  background: var(--surface-canvas);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  gap: var(--space-3);
  min-height: 58px;
  padding: 9px 11px;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.file-picker:hover,
.file-picker.has-files {
  background: var(--surface-muted);
  border-color: var(--accent);
}

.file-picker-input {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.form-field .file-picker-button {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-strong);
  margin: 0;
  padding: 6px 11px;
  transition: border-color 140ms ease, color 140ms ease;
}

.file-picker-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.file-picker-input:focus-visible + .file-picker-button {
  box-shadow: var(--shadow-focus);
}

.file-picker-status {
  color: var(--text-muted);
  font-size: var(--text-sm);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-picker.has-files .file-picker-status {
  color: var(--text-secondary);
}

.field-help {
  color: var(--text-muted);
  display: block;
  font-size: var(--text-xs);
  margin-top: var(--space-1);
}

.field-errors,
.errorlist {
  color: var(--status-danger);
  font-size: var(--text-sm);
  list-style: none;
  margin: 5px 0 0;
  padding: 0;
}

.message-list {
  display: grid;
  gap: var(--space-2);
  margin-bottom: 20px;
}

.message {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: var(--text-control);
  padding: 9px 12px;
}

.message.error {
  border-left-color: var(--status-danger);
}

.empty {
  color: var(--text-muted);
  font-size: var(--text-control);
  padding: 16px 0;
  text-align: center;
}

.auth-shell {
  align-items: center;
  display: grid;
  min-height: 100vh;
  padding: var(--space-5);
}

.auth-card {
  margin: 0 auto;
  max-width: 420px;
  width: 100%;
}

.auth-intro {
  margin-bottom: 25px;
  text-align: center;
}

.auth-intro .brand-mark {
  margin: 0 auto 14px;
}

.agent-connections-header {
  align-items: center;
}

.agent-setup-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  margin-bottom: 26px;
  padding: 20px;
}

.agent-setup-intro {
  align-items: end;
  display: flex;
  gap: var(--space-5);
  justify-content: space-between;
}

.agent-setup-intro h2 {
  margin: 0;
}

.agent-setup-intro > p {
  color: var(--text-muted);
  font-size: var(--text-xs);
  margin: 0;
  max-width: 460px;
}

.agent-endpoint {
  align-items: center;
  background: var(--surface-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 17px;
  padding: 10px 11px;
}

.agent-endpoint > span {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-strong);
}

.agent-endpoint code {
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

.agent-setup-steps {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.agent-setup-steps li {
  align-items: flex-start;
  border-left: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  padding: 2px 16px;
}

.agent-setup-steps li:first-child {
  border-left: 0;
  padding-left: 0;
}

.agent-setup-steps li:last-child {
  padding-right: 0;
}

.agent-setup-steps li > span {
  align-items: center;
  background: var(--accent-surface);
  border-radius: var(--radius-full);
  color: var(--accent-text);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  height: 24px;
  justify-content: center;
  width: 24px;
}

.agent-setup-steps strong {
  display: block;
  font-size: var(--text-sm);
}

.agent-setup-steps p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin: 2px 0 0;
}

.agent-setup-note {
  border-top: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin: 17px 0 0;
  padding-top: var(--space-3);
}

.agent-section-heading {
  align-items: flex-end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
}

.agent-connection-list {
  display: grid;
  gap: 14px;
}

.agent-connection-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
}

.agent-connection-card-header {
  align-items: center;
  display: flex;
  gap: 13px;
  padding: 18px 20px 15px;
}

.agent-client-mark {
  align-items: center;
  background: var(--status-info-surface);
  border-radius: var(--radius-md);
  color: var(--status-info-text);
  display: inline-flex;
  flex: 0 0 auto;
  font-family: var(--font-editorial);
  font-size: var(--text-heading-sm);
  height: 42px;
  justify-content: center;
  width: 42px;
}

.agent-client-copy {
  min-width: 0;
  width: 100%;
}

.agent-client-title {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.agent-client-title h2 {
  font-size: var(--text-heading-sm);
  margin: 0;
}

.agent-client-copy p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin: 3px 0 0;
}

.agent-client-copy p strong {
  color: var(--text-secondary);
}

.connection-status {
  align-items: center;
  background: var(--status-success-surface);
  border-radius: var(--radius-pill);
  color: var(--status-success-text);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: var(--text-3xs);
  font-weight: var(--weight-strong);
  gap: 5px;
  padding: 4px 7px;
}

.connection-status i {
  background: currentColor;
  border-radius: var(--radius-full);
  height: 5px;
  width: 5px;
}

.agent-connection-facts {
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-subtle);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px 20px;
}

.agent-connection-facts > div {
  border-left: 1px solid var(--border-subtle);
  display: grid;
  padding: 0 14px;
}

.agent-connection-facts > div:first-child {
  border-left: 0;
  padding-left: 0;
}

.agent-connection-facts > div:last-child {
  padding-right: 0;
}

.agent-connection-facts span {
  color: var(--text-muted);
  font-size: var(--text-3xs);
}

.agent-connection-facts strong,
.agent-connection-facts code {
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-connection-mode {
  align-items: center;
  display: flex;
  gap: var(--space-3);
  padding: 17px 20px;
}

.agent-connection-mode p {
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin: 0;
}

.agent-mode-badge {
  border-radius: var(--radius-pill);
  flex: 0 0 auto;
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  padding: 5px 9px;
}

.agent-connection-mode.is-read-only .agent-mode-badge {
  background: var(--status-info-surface);
  color: var(--status-info-text);
}

.agent-connection-mode.is-yolo .agent-mode-badge {
  background: var(--accent-surface);
  color: var(--accent-text);
}

.agent-connection-card-footer {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  padding: 11px 20px;
}

.agent-connection-card-footer p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin: 0;
}

.agent-connection-card-footer .button-danger {
  border-color: var(--status-danger-border-muted);
}

.agent-connection-empty {
  align-items: center;
  background: var(--surface-raised);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  display: flex;
  min-height: 108px;
  padding: 22px;
}

.agent-connection-empty h2 {
  margin-bottom: var(--space-1);
}

.agent-connection-empty p {
  color: var(--text-secondary);
  font-size: var(--text-control);
  margin: 0;
  max-width: 510px;
}

.agent-connection-notes {
  border-top: 1px solid var(--border-subtle);
  margin-top: var(--space-5);
  padding-top: 10px;
}

.agent-connection-notes > summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  min-height: 36px;
  padding: 7px 0;
}

.agent-connection-notes > div {
  display: grid;
  gap: 5px;
  padding: 3px 0 8px 18px;
}

.agent-connection-notes p {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  margin: 0;
}

.agent-history {
  border-top: 1px solid var(--border-subtle);
  margin-top: 20px;
  padding-top: 13px;
}

.agent-history > summary {
  color: var(--text-secondary);
  cursor: pointer;
  font-size: var(--text-sm);
  min-height: var(--control-height-sm);
  padding: 6px 0;
}

.agent-history > summary span {
  color: var(--text-muted);
  margin-left: var(--space-1);
}

.agent-history-list {
  margin-top: 10px;
}

.agent-history-row {
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
}

.agent-history-row > div {
  display: grid;
}

.agent-history-row strong {
  font-size: var(--text-sm);
}

.agent-history-row small {
  color: var(--text-muted);
  font-size: var(--text-3xs);
}

.mobile-header {
  display: none;
}

@media (max-width: 1024px) {
  .home-action-panel,
  .home-owned-projects,
  .home-project-side {
    grid-column: span 12;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .sticky-side {
    position: static;
  }

  .project-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .guide-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .guide-task {
    grid-template-columns: 34px minmax(180px, 0.7fr) minmax(0, 1.3fr);
  }

  .guide-task > .button {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .guide-agent-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sidebar {
    display: none;
  }

  .guide-section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .guide-section-heading > p {
    text-align: left;
  }

  .guide-flow,
  .guide-agent-modes {
    grid-template-columns: 1fr;
  }

  .guide-flow li {
    min-height: 0;
  }

  .guide-task {
    gap: var(--space-3);
    grid-template-columns: 28px minmax(0, 1fr);
    padding: var(--space-4) 0;
  }

  .guide-task-points,
  .guide-task > .button {
    grid-column: 2;
  }

  .mobile-header {
    align-items: center;
    background: var(--surface-canvas-translucent);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    padding: 11px 16px;
    position: sticky;
    top: 0;
    z-index: 20;
  }

  .mobile-header details {
    position: relative;
  }

  .mobile-header summary {
    align-items: center;
    cursor: pointer;
    display: inline-flex;
    font-size: var(--text-control);
    justify-content: center;
    list-style: none;
    min-height: var(--control-height-lg);
    min-width: 48px;
    padding: 0 8px;
  }

  .mobile-menu {
    background: var(--surface-raised);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-mobile-nav);
    display: grid;
    gap: 3px;
    padding: var(--space-2);
    position: absolute;
    right: 0;
    top: 32px;
    max-height: calc(100vh - 68px);
    overflow-y: auto;
    width: 230px;
  }

  .mobile-menu-section {
    border-bottom: 1px solid var(--border-subtle);
    display: grid;
    gap: 2px;
    padding-bottom: 6px;
  }

  .mobile-menu-section .nav-section-label {
    margin: 5px 10px 2px;
  }

  .mobile-menu .account-menu-link {
    margin-top: 2px;
  }

  .main {
    margin-left: 0;
    padding: 24px 16px 48px;
  }

  .page-header {
    display: block;
  }

  .page-header .actions {
    margin-top: var(--space-4);
  }

  .collection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-toolbar .button {
    width: 100%;
  }

  .page-tabs {
    gap: 20px;
    margin-top: -6px;
  }

  .header-meta-actions {
    margin-left: 0;
    width: 100%;
  }

  .idea-derived-project {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .idea-workflow-action {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .idea-derived-project-actions,
  .idea-derived-project-actions form,
  .idea-derived-project-actions .button,
  .idea-workflow-action form,
  .idea-workflow-action .button {
    width: 100%;
  }

  .idea-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .idea-danger-zone .actions,
  .idea-danger-zone .button {
    width: 100%;
  }

  .grid-2,
  .fact-grid,
  .portfolio-summary,
  .home-pulse {
    grid-template-columns: 1fr;
  }

  .lifecycle-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lifecycle-step {
    border-bottom: 1px solid var(--border-subtle);
    border-left: 0;
    padding: 13px 0;
  }

  .lifecycle-step:nth-child(even) {
    border-left: 1px solid var(--border-subtle);
    padding-left: var(--space-4);
  }

  .lifecycle-step:last-child {
    border-bottom: 0;
  }

  .idea-card {
    grid-template-columns: 1fr;
  }

  .card-status {
    justify-self: start;
  }

  .claim-status {
    align-items: flex-start;
  }

  .member-card-header {
    display: grid;
  }

  .member-counts {
    justify-content: flex-start;
  }

  .member-project-row {
    grid-template-columns: 1fr;
  }

  .project-overview,
  .project-filtered-grid,
  .project-workflow-grid {
    grid-template-columns: 1fr;
  }

  .project-attention-row {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .project-attention-row .signal-row {
    justify-content: flex-start;
  }

  .project-attention-row .button {
    width: 100%;
  }

  .form-card,
  .panel {
    padding: 18px;
  }

  .file-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .action-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-group-header {
    align-items: flex-start;
  }

  .action-card > .button {
    width: 100%;
  }

  .home-action-item > a {
    align-items: start;
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .home-action-meta {
    display: none;
  }

  .home-project-row,
  .home-owned-projects .home-project-row {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-project-owner {
    display: none;
  }

  .agent-connections-header {
    align-items: stretch;
  }

  .agent-setup-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--space-2);
  }

  .agent-endpoint {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .agent-endpoint .button {
    width: 100%;
  }

  .agent-setup-steps {
    grid-template-columns: 1fr;
  }

  .agent-setup-steps li,
  .agent-setup-steps li:first-child,
  .agent-setup-steps li:last-child {
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding: 13px 0;
  }

  .agent-setup-steps li:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .agent-setup-steps li:last-child {
    padding-bottom: 0;
  }

  .agent-client-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .agent-connection-facts {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  .agent-connection-facts > div {
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
    padding: 9px 0 0;
  }

  .agent-connection-facts > div:first-child {
    border-top: 0;
    padding-top: 0;
  }

  .agent-connection-mode {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .agent-connection-card-footer {
    align-items: stretch;
    flex-direction: column;
    gap: 9px;
  }

  .agent-connection-card-footer .button {
    width: 100%;
  }

  .form-field .file-picker-button {
    text-align: center;
  }

  .agent-consent-shell {
    margin-top: 0;
  }

  .agent-consent-hero {
    margin-bottom: 20px;
  }

  .agent-consent-brand {
    margin-bottom: 14px;
  }

  .agent-consent-identity {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 14px 16px;
  }

  .agent-consent-role-note {
    margin-left: 50px;
    margin-top: -6px;
    white-space: normal;
  }

  .agent-mode-section {
    padding: 20px 16px 4px;
  }

  .agent-mode-options {
    grid-template-columns: 1fr;
  }

  .agent-mode-option {
    min-height: 0;
    padding: 15px;
  }

  .agent-consent-safety {
    margin: 18px 16px 0;
  }

  .agent-consent-footer {
    align-items: stretch;
    flex-direction: column;
    padding: var(--space-4);
  }

  .agent-consent-actions {
    justify-content: flex-end;
  }
}

.submission-filters {
  margin-bottom: var(--space-6);
}

.submission-project-list {
  display: grid;
  gap: 38px;
}

.submission-project-group {
  display: grid;
  gap: 14px;
}

.submission-project-header {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding: 0 2px 3px;
}

.submission-project-header h2 {
  font-size: var(--text-heading-md);
  margin: 3px 0 0;
}

.submission-project-header .count {
  background: transparent;
  border: 0;
  min-width: auto;
  padding: 0;
}

.submission-lifecycle-list {
  display: grid;
  gap: 14px;
}

.record-card {
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  display: grid;
  gap: var(--space-4);
  min-width: 0;
  padding: 20px;
}

.record-card-header {
  align-items: flex-start;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-width: 0;
}

.record-card-header > div:first-child {
  min-width: 0;
}

.record-eyebrow,
.workflow-state-label {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
}

.record-card-title {
  font-family: var(--font-editorial);
  font-size: var(--text-heading-sm);
  line-height: 1.38;
  margin: 4px 0 7px;
  overflow-wrap: anywhere;
}

.record-meta-row {
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  gap: 5px 14px;
}

.record-resource-link {
  align-items: center;
  display: inline-flex;
  font-size: var(--text-control);
  gap: 6px;
  justify-self: start;
}

.workflow-state {
  align-items: center;
  background: var(--surface-muted-72);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-md);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 16px;
}

.workflow-state-copy {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}

.workflow-state-copy strong {
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}

.workflow-state-copy small,
.workflow-state-copy p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

.workflow-state-copy p {
  margin: 4px 0 0;
}

.workflow-actions {
  align-items: center;
  display: flex;
  gap: 7px;
}

.action-menu {
  position: relative;
}

.action-menu > summary,
.record-management > summary,
.history-disclosure > summary {
  cursor: pointer;
  list-style: none;
}

.action-menu > summary::-webkit-details-marker,
.record-management > summary::-webkit-details-marker,
.history-disclosure > summary::-webkit-details-marker {
  display: none;
}

.action-menu > summary::after {
  content: "⌄";
  font-size: var(--text-xs);
}

.action-menu-content {
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-floating);
  display: grid;
  min-width: 150px;
  padding: 6px;
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 4;
}

.action-menu-content a {
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: var(--text-sm);
  padding: 9px 10px;
}

.action-menu-content a:hover {
  background: var(--surface-muted);
}

.history-disclosure {
  border-top: 1px solid var(--border-subtle);
  padding-top: 2px;
}

.history-disclosure > summary {
  align-items: center;
  color: var(--text-secondary);
  display: flex;
  font-size: var(--text-control);
  font-weight: var(--weight-strong);
  gap: var(--space-2);
  justify-content: space-between;
  min-height: var(--control-height-md);
}

.history-disclosure > summary::after {
  color: var(--text-muted);
  content: "+";
  font-size: var(--text-heading-sm);
  margin-left: auto;
}

.history-disclosure[open] > summary::after {
  content: "−";
}

.history-count {
  color: var(--text-muted);
  font-weight: var(--weight-medium);
  margin-left: 2px;
}

.history-disclosure .timeline {
  margin-bottom: var(--space-1);
  margin-top: 10px;
}

.submission-history > .submission-track-summary {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.submission-track-heading,
.submission-track-preview {
  align-items: center;
  display: flex;
  min-width: 0;
}

.submission-track-heading {
  gap: var(--space-2);
}

.submission-track-preview {
  gap: 9px;
  justify-content: flex-end;
}

.submission-track-preview-venue {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submission-track-preview-status,
.submission-round-status {
  flex: 0 0 auto;
  font-size: var(--text-2xs);
}

.submission-history > .submission-track-summary::after {
  margin-left: 0;
}

.submission-track-list {
  display: grid;
  gap: 0;
  list-style: none;
  margin: 10px 0 4px;
  padding: 0;
}

.submission-track-round {
  padding: 0 0 13px 28px;
  position: relative;
}

.submission-track-round:last-child {
  padding-bottom: 2px;
}

.submission-track-round:not(:last-child)::before {
  background: var(--border-strong);
  content: "";
  left: 7px;
  position: absolute;
  top: 17px;
  bottom: -2px;
  width: 1px;
}

.submission-track-marker {
  background: var(--surface-raised);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-full);
  height: 11px;
  left: 2px;
  position: absolute;
  top: 13px;
  width: 11px;
  z-index: 1;
}

.submission-track-round.is-latest .submission-track-marker {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--shadow-current-marker);
}

.submission-round-card {
  background: var(--surface-muted-55);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  display: grid;
  gap: 9px;
  padding: 12px 14px;
}

.submission-track-round.is-latest .submission-round-card {
  background: var(--surface-raised);
  border-color: var(--border-subtle);
}

.submission-round-header {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.submission-round-heading {
  min-width: 0;
}

.submission-round-label {
  color: var(--text-muted);
  font-size: var(--text-2xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}

.submission-round-heading h4 {
  font-size: var(--text-ui);
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}

.submission-round-meta {
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  font-size: var(--text-xs);
  gap: 5px 13px;
}

.submission-round-meta span + span {
  border-left: 1px solid var(--border-strong);
  padding-left: 13px;
}

.submission-round-note {
  border-left: 2px solid var(--border-strong);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.55;
  margin: 0;
  padding-left: 10px;
}

.submission-round-links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 15px;
}

.submission-round-links a {
  align-items: center;
  display: inline-flex;
  font-size: var(--text-xs);
  gap: var(--space-1);
  font-weight: var(--weight-strong);
}

.record-management {
  border-top: 1px dashed var(--border-subtle);
  padding-top: 9px;
}

.record-management > summary {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  min-height: 28px;
}

.record-management > summary::after {
  content: "  ⌄";
}

.record-management[open] > summary::after {
  content: "  ⌃";
}

.record-management-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 7px 0 2px;
}

.record-management-inline {
  border-top: 0;
  margin-top: 9px;
  padding-top: 0;
}

.history-record-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: var(--space-2);
}

.historical-revisions {
  background: var(--surface-muted);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  margin-top: 10px;
  padding: 10px 12px;
}

.historical-revisions ul {
  display: grid;
  gap: var(--space-1);
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.submission-empty-history {
  margin: 0;
}

@media (max-width: 760px) {
  .filter-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-1);
    scrollbar-width: none;
    width: 100%;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-bar .filter-link {
    flex: 0 0 auto;
  }

  .submission-project-header,
  .record-card-header {
    align-items: flex-start;
  }

  .submission-project-header {
    flex-direction: column;
    gap: 6px;
  }

  .record-card-header {
    flex-direction: column;
    gap: 10px;
  }

  .record-card-header .status {
    align-self: flex-start;
  }

  .record-card {
    padding: 17px;
  }

  .workflow-state {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .project-current-grid,
  .update-content-grid {
    grid-template-columns: 1fr;
  }

  .project-attention-block {
    align-items: flex-start;
    flex-direction: column;
  }

  .project-attention-block .button {
    width: 100%;
  }

  .project-record-panel > .panel-header {
    align-items: stretch;
    flex-direction: column;
  }

  .project-record-panel > .panel-header .button {
    width: 100%;
  }

  .comment-composer-actions .button {
    width: 100%;
  }

  .workflow-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .workflow-actions > .button,
  .workflow-actions > .action-menu,
  .workflow-actions > .action-menu > summary {
    width: 100%;
  }

  .action-menu-content {
    margin-top: 6px;
    position: static;
  }

  .submission-history > .submission-track-summary {
    align-items: start;
    gap: 6px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .submission-track-preview {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    padding-bottom: var(--space-2);
  }

  .submission-history > .submission-track-summary::after {
    grid-column: 2;
    grid-row: 1;
  }

  .submission-track-preview-venue {
    max-width: min(62vw, 300px);
  }

  .submission-track-round {
    padding-left: var(--space-5);
  }

  .submission-round-header {
    gap: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .button.is-submitting::before {
    animation: none;
  }
}
