/* Primitive tokens */
:root {
  --mineral-50: #f7f8f6;
  --mineral-100: #f3f4f2;
  --white: #ffffff;
  --ink-950: #171a18;
  --ink-800: #343936;
  --ink-650: #4f5752;
  --ink-550: #5c645f;
  --line-200: #cfd4cf;
  --line-100: #d6dbd6;
  --indigo-700: #4653cd;
  --indigo-600: #4d5bd4;
  --indigo-100: #e8eaff;
  --indigo-50: #f4f4ff;
  --green-700: #207a5b;
  --green-100: #e5f3ec;
  --amber-700: #9a6427;
  --amber-100: #f8eee1;
  --danger-700: #a33d36;
  --danger-100: #fff0ee;
}

/* Semantic tokens */
:root {
  --canvas: var(--mineral-100);
  --surface: var(--white);
  --surface-featured: var(--indigo-50);
  --text: var(--ink-950);
  --text-secondary: var(--ink-650);
  --text-muted: var(--ink-550);
  --border: var(--line-200);
  --border-soft: var(--line-100);
  --brand: var(--indigo-600);
  --brand-hover: var(--indigo-700);
  --brand-soft: var(--indigo-100);
  --success: var(--green-700);
  --success-soft: var(--green-100);
  --focus: var(--indigo-600);
  --danger: var(--danger-700);
  --danger-soft: var(--danger-100);
}

/* Component tokens */
:root {
  --rail-width: 3.125rem;
  --header-height: 2.875rem;
  --control-height: 2.5rem;
  --content-padding: 1.5rem;
  --radius-small: 0.5rem;
  --radius-control: 0.75rem;
  --radius-panel: 0.75rem;
  --shadow-panel: 0 0.5rem 1.5rem rgba(31, 40, 35, 0.035);
  --shadow-command: 0 0.5rem 1.5rem rgba(31, 40, 35, 0.055);
  --shadow-action: 0 0.45rem 1rem rgba(77, 91, 212, 0.22);
  --font-sans: "Segoe UI Variable", "Segoe UI", "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  line-height: 1.55;
}

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

button,
select {
  cursor: pointer;
}

button {
  border: 0;
}

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

img {
  display: block;
  max-width: 100%;
}

svg {
  width: 1.125rem;
  height: 1.125rem;
  stroke-width: 2;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 0.75rem;
  left: calc(var(--rail-width) + 0.75rem);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-control);
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.1875rem;
}

.app-rail {
  position: fixed;
  z-index: 80;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--rail-width);
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--border-soft);
  background: var(--surface);
}

.rail-brand {
  display: grid;
  width: 100%;
  height: var(--header-height);
  place-items: center;
  border-bottom: 1px solid var(--border-soft);
}

.rail-brand img {
  /* The 282×110 wordmark is unreadable at rail width; show the leaf mark only, at an integer size. */
  width: 2.75rem;
  height: 2.25rem;
  object-fit: cover;
  object-position: left center;
}

.rail-nav,
.rail-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
}

.rail-actions {
  margin-top: auto;
  padding-bottom: 0.75rem;
}

.rail-link {
  display: flex;
  width: 2.65rem;
  min-height: 2.9rem;
  padding: 0.35rem 0.15rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.2rem;
  border-radius: 0.65rem;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.15;
  transition: background-color 160ms ease, color 160ms ease;
}

.rail-link svg {
  width: 1rem;
  height: 1rem;
}

.rail-link:hover {
  background: var(--mineral-50);
  color: var(--text);
}

.rail-link.is-current {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.rail-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 0.75rem;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
}

.workline-header {
  position: fixed;
  z-index: 70;
  top: 0;
  right: 0;
  left: var(--rail-width);
  display: flex;
  height: var(--header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
}

.header-context,
.header-actions,
.account-trigger,
.account-copy {
  display: flex;
  align-items: center;
}

.header-context {
  min-width: 0;
  gap: 0.75rem;
}

.header-context strong {
  font-size: 0.875rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.header-context > span {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
}

.header-context p {
  margin: 0;
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 0.8125rem;
}

.header-actions {
  gap: 0.35rem;
}

.header-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--text-secondary);
}

.header-icon:hover {
  background: var(--mineral-50);
  color: var(--text);
}

#notificationBtn {
  background: var(--mineral-50);
}

.account-menu {
  position: relative;
  margin-left: 0.25rem;
}

.account-trigger {
  min-height: 2.4rem;
  gap: 0.65rem;
  padding: 0.25rem 0.4rem 0.25rem 0.3rem;
  border-radius: var(--radius-control);
  background: transparent;
  text-align: left;
}

.account-trigger:hover,
.account-trigger[aria-expanded="true"] {
  background: var(--mineral-50);
}

.account-avatar {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 800;
}

.account-copy {
  min-width: 7rem;
  align-items: flex-start;
  flex-direction: column;
  line-height: 1.25;
}

.account-copy strong {
  max-width: 10rem;
  overflow: hidden;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-copy small {
  max-width: 11rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-trigger > svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--text-muted);
}

.account-popover {
  position: absolute;
  z-index: 100;
  top: calc(100% + 0.5rem);
  right: 0;
  width: 15rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: 0 1rem 2.5rem rgba(31, 40, 35, 0.12);
}

.account-popover__identity {
  display: flex;
  padding: 0.75rem;
  flex-direction: column;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 0.35rem;
}

.account-popover__identity span {
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.account-popover a,
.account-popover button {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  align-items: center;
  gap: 0.65rem;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
}

.account-popover a:hover,
.account-popover button:hover {
  background: var(--mineral-50);
  color: var(--text);
}

.portal-main {
  min-height: 100vh;
  margin-left: var(--rail-width);
  padding: calc(var(--header-height) + 1.5rem) var(--content-padding) 1rem;
}

.welcome-block {
  max-width: 70rem;
  margin-bottom: 0.35rem;
}

.welcome-block h1 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 1.8rem);
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.welcome-block p {
  margin: 0.05rem 0 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.4;
}

.command-search {
  display: flex;
  min-height: var(--control-height);
  padding: 0.2rem 0.3rem 0.2rem 0.75rem;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-command);
}

.command-search > svg {
  flex: 0 0 auto;
  color: var(--brand);
}

.command-search input {
  width: 100%;
  min-width: 0;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: 0;
}

.command-search input::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

.search-scope select {
  max-width: 9rem;
  height: 2.25rem;
  padding: 0 1.75rem 0 0.65rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-small);
  background: var(--mineral-50);
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.command-search kbd {
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--mineral-50);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(31, 40, 35, 0.08);
}

.search-button {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 0.7rem;
  background: var(--brand);
  color: var(--white);
  box-shadow: var(--shadow-action);
  transition: background-color 160ms ease, transform 160ms ease;
}

.search-button:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.portal-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  align-items: center;
  gap: 0.8rem;
  border: 1px solid #f0c6c1;
  border-radius: var(--radius-control);
  background: var(--danger-soft);
  color: var(--danger);
}

.portal-notice p {
  margin: 0.1rem 0 0;
  color: var(--text-secondary);
}

.secondary-button {
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid currentColor;
  border-radius: var(--radius-small);
  background: var(--surface);
  font-weight: 700;
}

.portal-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(13.5rem, 21vw, 19rem);
  margin-top: 0.85rem;
  align-items: stretch;
  gap: 1rem;
}

.workstream {
  min-width: 0;
}

.section-heading,
.panel-heading,
.trust-heading,
.space-summary__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading--recommend {
  min-height: 0.8rem;
  margin-bottom: -0.2rem;
}

.section-heading h2,
.panel-heading h2,
.trust-heading h2,
.space-summary h3 {
  margin: 0;
  color: var(--text);
}

.section-heading h2 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
}

.section-heading h2 svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--brand);
}

.section-heading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.portal-loading {
  min-height: 8.75rem;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #eceeec;
}

.skeleton::after {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.52);
  content: "";
  transform: translateX(-100%);
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton--agent {
  min-height: 8.75rem;
  border-radius: var(--radius-panel);
}

@keyframes shimmer {
  to { transform: translateX(100%); }
}

.agent-list {
  display: grid;
  gap: 0.75rem;
}

.agent-card {
  display: grid;
  min-height: 8.65rem;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  padding: 1rem;
  align-items: center;
  gap: 1rem;
  border: 1px solid #cfd3ff;
  border-radius: var(--radius-panel);
  background: var(--surface-featured);
  box-shadow: var(--shadow-panel);
}

.agent-card:not(.is-primary) {
  min-height: 6.5rem;
  grid-template-columns: 3rem minmax(0, 1fr) auto;
  padding: 1rem 1.2rem;
  border-color: var(--border);
  background: var(--surface);
}

.agent-icon {
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border-radius: 0.9rem;
  background: var(--brand-soft);
  color: var(--brand);
}

.agent-icon svg {
  width: 1.45rem;
  height: 1.45rem;
  stroke-width: 2;
}

.agent-card:not(.is-primary) .agent-icon {
  width: 3rem;
  height: 3rem;
}

.agent-copy {
  min-width: 0;
}

.agent-titleline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.agent-titleline h3 {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.agent-state {
  display: inline-flex;
  padding: 0.2rem 0.5rem;
  align-items: center;
  gap: 0.25rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.agent-state svg {
  width: 0.7rem;
  height: 0.7rem;
  stroke-width: 2;
}

.agent-description {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.agent-meta {
  display: flex;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.agent-meta span {
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.2;
}

.agent-action {
  display: inline-flex;
  min-height: 2.5rem;
  padding: 0 0.65rem;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 0.6rem;
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
  font-size: 0.75rem;
  box-shadow: var(--shadow-action);
  white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease;
}

.agent-action svg {
  width: 0.85rem;
  height: 0.85rem;
}

.agent-action:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.agent-card.is-disabled {
  opacity: 1;
  color: var(--text-muted);
  background: var(--soft);
}

.agent-card.is-disabled .agent-action {
  background: var(--text-muted);
  box-shadow: none;
}

.work-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.09fr) minmax(0, 1fr);
  margin-top: 1.125rem;
  gap: 1.125rem;
}

.work-panel,
.context-rail {
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
}

.work-panel {
  min-width: 0;
  overflow: hidden;
}

.panel-heading {
  min-height: 2.875rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.panel-heading h2 {
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.panel-heading a {
  display: inline-flex;
  min-height: 2.75rem;
  padding: 0 0.2rem;
  align-items: center;
  gap: 0.3rem;
  color: var(--brand);
  font-size: 0.8125rem;
  font-weight: 700;
}

.panel-heading a svg {
  width: 0.85rem;
  height: 0.85rem;
}

.recent-item,
.update-item {
  display: grid;
  min-height: 6.3rem;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid var(--border-soft);
  transition: background-color 160ms ease;
}

.recent-item:last-child,
.update-item:last-child {
  border-bottom: 0;
}

.recent-item:hover,
.update-item:hover {
  background: var(--mineral-50);
}

.recent-item {
  grid-template-columns: 2.3rem minmax(0, 1fr) auto;
  padding: 0.9rem 1.25rem;
}

.update-item {
  grid-template-columns: 1.5rem minmax(0, 1fr);
  padding: 0.9rem 1.1rem;
}

.item-icon {
  display: grid;
  width: 2.3rem;
  height: 2.3rem;
  place-items: center;
  border-radius: 0.7rem;
}

.item-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  stroke-width: 2;
}

.item-icon--indigo {
  background: var(--indigo-50);
  color: var(--brand);
}

.item-icon--green {
  background: var(--success-soft);
  color: var(--success);
}

.item-icon--amber {
  background: var(--amber-100);
  color: var(--amber-700);
}

.item-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.item-copy strong {
  overflow: hidden;
  font-size: 0.875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-copy small {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.item-copy em {
  margin-top: 0.25rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-item > time {
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.recent-item > svg {
  display: none;
}

.context-rail {
  min-width: 0;
  overflow: hidden;
}

.trust-heading {
  padding: 1rem 1rem 0.65rem;
}

.trust-heading h2 {
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.trust-heading p {
  margin: 0.1rem 0 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.trust-heading > svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--text-secondary);
}

.trust-timeline {
  margin: 0;
  padding: 0.25rem 1rem 0;
  list-style: none;
}

.trust-timeline li {
  position: relative;
  display: grid;
  min-height: 4.8rem;
  grid-template-columns: 1.1rem minmax(0, 1fr);
  gap: 0.9rem;
}

.trust-timeline li:not(:last-child)::after {
  position: absolute;
  top: 1rem;
  bottom: -0.3rem;
  left: 0.5rem;
  width: 1px;
  background: #bec4ef;
  content: "";
}

.trust-marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 1rem;
  height: 1rem;
  margin-top: 0.1rem;
  place-items: center;
  border: 1.5px solid var(--brand);
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
}

.trust-marker svg {
  width: 0.55rem;
  height: 0.55rem;
  stroke-width: 2;
}

.trust-marker--green {
  border-color: var(--success);
  color: var(--success);
}

.trust-timeline p {
  display: flex;
  margin: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.trust-timeline p em {
  color: var(--success);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 700;
}

.trust-timeline strong {
  display: block;
  margin-top: 0.5rem;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.space-summary {
  margin: 0 1rem;
  padding: 0.75rem 0 0.7rem;
  border-top: 1px solid var(--border);
}

.space-summary h3 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
}

.space-summary h3 svg {
  width: 0.9rem;
  height: 0.9rem;
  color: var(--success);
}

.space-summary__heading > span {
  display: none;
}

.space-summary > p {
  margin: 0.45rem 0 0;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.workspace-list {
  display: none;
  margin-top: 0.7rem;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.workspace-item {
  display: inline-flex;
  max-width: 100%;
  min-height: 1.7rem;
  padding: 0.25rem 0.55rem;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}

.workspace-item svg {
  width: 0.7rem;
  height: 0.7rem;
}

.space-summary > a {
  display: inline-flex;
  min-height: 2rem;
  margin-top: 0.25rem;
  align-items: center;
  gap: 0.25rem;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
}

.space-summary > a svg {
  width: 0.75rem;
  height: 0.75rem;
}

.portal-empty {
  display: flex;
  min-height: 8.75rem;
  padding: 1.25rem;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  color: var(--text-secondary);
  text-align: left;
}

.portal-empty h3,
.portal-empty p {
  margin: 0;
}

.portal-empty h3 {
  color: var(--text);
  font-size: 0.875rem;
}

.portal-empty p {
  margin-top: 0.2rem;
  font-size: 0.8125rem;
}

.portal-empty--compact {
  min-height: 20rem;
  border: 0;
  border-radius: 0;
}

.portal-empty--side {
  min-height: 0;
  margin-top: 0.6rem;
  padding: 0.65rem;
  border-radius: var(--radius-small);
}

@media (min-width: 96rem) {
  :root {
    --content-padding: 2rem;
  }

  .portal-workspace {
    grid-template-columns: minmax(0, 1fr) 20rem;
  }
}

@media (max-width: 70rem) {
  .work-panels {
    gap: 1rem;
  }
}

@media (max-width: 56rem) {
  :root {
    --rail-width: 0rem;
    --content-padding: 1.5rem;
  }

  .app-rail {
    z-index: 90;
    inset: auto 0 0 0;
    width: 100%;
    height: 4rem;
    flex-direction: row;
    border-top: 1px solid var(--border);
    border-right: 0;
  }

  .rail-brand,
  .rail-actions {
    display: none;
  }

  .rail-nav {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.25rem 0.5rem;
    gap: 0.25rem;
  }

  .rail-link {
    width: 100%;
    min-height: 3.35rem;
    padding: 0.35rem 0.2rem;
  }

  .workline-header {
    left: 0;
    padding: 0 1.25rem;
  }

  .portal-main {
    margin-left: 0;
    padding-bottom: 5.75rem;
  }

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

  .context-rail {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  }

  .trust-heading,
  .trust-timeline {
    grid-column: 1;
  }

  .space-summary {
    grid-row: 1 / span 2;
    grid-column: 2;
    margin: 1.25rem;
    padding: 0 0 0 1.25rem;
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}

@media (max-width: 47.9375rem) {
  :root {
    --header-height: 3.5rem;
    --content-padding: 1rem;
  }

  .header-context p,
  .header-context > span,
  .account-copy,
  .account-trigger > svg {
    display: none;
  }

  .header-context strong {
    font-size: 0.875rem;
  }

  .header-actions {
    gap: 0.1rem;
  }

  .header-icon {
    width: 2.5rem;
    height: 2.5rem;
  }

  .account-trigger {
    min-height: 2.75rem;
    padding: 0.2rem;
  }

  .account-avatar {
    width: 2.2rem;
    height: 2.2rem;
  }

  .welcome-block h1 {
    font-size: 1.8rem;
  }

  .welcome-block p {
    max-width: 36rem;
  }

  .command-search kbd,
  .search-scope {
    display: none;
  }

  .agent-card,
  .agent-card:not(.is-primary) {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    padding: 1rem;
  }

  .agent-icon,
  .agent-card:not(.is-primary) .agent-icon {
    width: 3.25rem;
    height: 3.25rem;
  }

  .agent-action {
    grid-column: 1 / -1;
    width: 100%;
  }

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

  .context-rail {
    display: block;
  }

  .space-summary {
    margin: 0 1.25rem;
    padding: 1rem 0 1.2rem;
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}

@media (max-width: 29.9375rem) {
  .workline-header {
    padding: 0 0.75rem 0 1rem;
  }

  .header-icon:first-child {
    display: none;
  }

  .portal-main {
    padding-top: calc(var(--header-height) + 1.35rem);
  }

  .welcome-block h1 {
    font-size: 1.65rem;
  }

  .welcome-block p {
    font-size: 0.8125rem;
  }

  .command-search {
    min-height: 3.25rem;
  }

  .search-button {
    width: 2.4rem;
    height: 2.4rem;
  }

  .section-heading--recommend {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-card,
  .agent-card:not(.is-primary) {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-titleline h3 {
    font-size: 1.05rem;
  }

  .agent-description {
    font-size: 0.8125rem;
  }

  .agent-action {
    width: 100%;
  }

  .panel-heading,
  .recent-item {
    padding-right: 1rem;
    padding-left: 1rem;
  }

  .item-copy em {
    white-space: normal;
  }

  .portal-notice {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .portal-notice .secondary-button {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-contrast: more) {
  :root {
    --border: #9ca39e;
    --border-soft: #bcc1bd;
    --text-secondary: #3f4541;
  }

  .agent-card,
  .work-panel,
  .context-rail,
  .command-search {
    border-width: 2px;
  }
}

@media (forced-colors: active) {
  .rail-link.is-current,
  .agent-card,
  .agent-state,
  .workspace-item,
  .item-icon,
  .account-avatar,
  .rail-avatar {
    border: 1px solid CanvasText;
  }

  .search-button,
  .agent-action {
    border: 1px solid ButtonText;
  }
}
