/* Option 2: compact operational workspace. Loaded after the legacy stylesheet. */
:root {
  --workspace-bg: #f5f7fa;
  --workspace-surface: #ffffff;
  --workspace-surface-muted: #f8fafc;
  --workspace-text: #172235;
  --workspace-muted: #64748b;
  --workspace-line: #dce2e9;
  --workspace-line-strong: #cbd4df;
  --workspace-primary: #006fbe;
  --workspace-primary-hover: #005d9f;
  --workspace-primary-soft: #eaf5fc;
  --workspace-danger: #dc3545;
  --workspace-danger-soft: #fff0f1;
  --workspace-warning: #ee9300;
  --workspace-warning-soft: #fff7e8;
  --workspace-success: #3aa65a;
  --workspace-success-soft: #eef9f1;
  --workspace-teal: #1698a5;
  --workspace-radius: 6px;
  --workspace-header-main: 84px;
  --workspace-nav-height: 62px;
  --topbar-height: 84px;
  --radius-xl: 8px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --bg: var(--workspace-bg);
  --surface: var(--workspace-surface);
  --surface-strong: var(--workspace-surface);
  --text: var(--workspace-text);
  --muted: var(--workspace-muted);
  --line: var(--workspace-line);
  --line-strong: var(--workspace-line-strong);
  --primary: var(--workspace-primary);
  --primary-2: var(--workspace-primary-hover);
  --primary-soft: var(--workspace-primary-soft);
  --success: var(--workspace-success);
  --warning: var(--workspace-warning);
  --danger: var(--workspace-danger);
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
}

*,
*::before,
*::after {
  letter-spacing: 0;
}

html {
  background: var(--workspace-bg);
}

body {
  color: var(--workspace-text);
  font-family: "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  background: var(--workspace-bg);
}

h1,
h2,
h3,
h4 {
  color: var(--workspace-text);
  letter-spacing: 0;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(0, 111, 190, 0.24);
  outline-offset: 2px;
}

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

.legacy-topbar-wrap,
.app-backdrop,
.hero-mini-host {
  display: none !important;
}

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

/* Workspace header */
.workspace-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--workspace-surface);
  border-bottom: 1px solid var(--workspace-line-strong);
}

.workspace-header-main {
  min-height: var(--workspace-header-main);
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 520px) minmax(250px, 1fr);
  align-items: center;
  gap: 24px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--workspace-line);
}

.workspace-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--workspace-text);
}

.workspace-brand:hover {
  color: var(--workspace-text);
}

.workspace-brand-mark {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  background: var(--workspace-surface);
}

.workspace-brand-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.workspace-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
  line-height: 1.2;
}

.workspace-brand-copy strong,
.workspace-brand-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-brand-copy strong {
  font-size: 18px;
  font-weight: 700;
}

.workspace-brand-copy span {
  color: #34445a;
  font-size: 14px;
  font-weight: 600;
}

.workspace-search {
  min-width: 0;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--workspace-line-strong);
  border-radius: var(--workspace-radius);
  background: var(--workspace-surface);
}

.workspace-search:focus-within {
  border-color: var(--workspace-primary);
  box-shadow: 0 0 0 3px rgba(0, 111, 190, 0.12);
}

.workspace-search > i {
  flex: 0 0 auto;
  color: #708197;
  font-size: 18px;
}

.workspace-search input {
  width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--workspace-text);
  font: inherit;
}

.workspace-search input:focus {
  border: 0;
  box-shadow: none;
}

.workspace-search input::placeholder {
  color: #7d8da2;
}

.workspace-search kbd {
  flex: 0 0 auto;
  padding: 2px 6px;
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  background: var(--workspace-surface-muted);
  color: var(--workspace-muted);
  font: 600 11px/1.5 "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
}

.workspace-header-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.icon-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 50%;
  color: #53667d;
  font-size: 18px;
}

.icon-button:hover {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  border-color: #cae5f6;
}

.account-menu,
.workspace-more-menu {
  position: relative;
}

.account-menu summary,
.workspace-more-menu summary {
  list-style: none;
}

.account-menu summary::-webkit-details-marker,
.workspace-more-menu summary::-webkit-details-marker {
  display: none;
}

.account-menu-trigger {
  min-width: 210px;
  min-height: 48px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 6px;
  border: 1px solid var(--workspace-line);
  border-radius: var(--workspace-radius);
  color: var(--workspace-text);
  cursor: pointer;
  user-select: none;
}

.account-menu[open] .account-menu-trigger,
.account-menu-trigger:hover {
  background: var(--workspace-surface-muted);
  border-color: var(--workspace-line-strong);
}

.workspace-avatar,
.coordinator-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--workspace-primary);
  color: #fff;
  font-weight: 700;
}

.workspace-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
}

.account-menu-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.account-menu-copy strong,
.account-menu-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-copy strong {
  font-size: 13px;
}

.account-menu-copy span {
  color: var(--workspace-muted);
  font-size: 11px;
}

.account-menu-trigger > i {
  color: var(--workspace-muted);
  font-size: 12px;
  transition: transform 160ms ease;
}

.account-menu[open] .account-menu-trigger > i {
  transform: rotate(180deg);
}

.account-menu-dropdown,
.workspace-more-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 60;
  min-width: 248px;
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--workspace-line-strong);
  border-radius: 8px;
  background: var(--workspace-surface);
  box-shadow: 0 12px 28px rgba(30, 46, 65, 0.14);
}

.account-menu-identity {
  display: grid;
  gap: 2px;
  padding: 8px 10px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--workspace-line);
}

.account-menu-identity span {
  color: var(--workspace-muted);
  font-size: 12px;
}

.account-menu-dropdown a,
.account-menu-dropdown button,
.workspace-more-dropdown a {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #34445a;
  font: 600 13px/1.3 "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  text-align: left;
  cursor: pointer;
}

.account-menu-dropdown a:hover,
.account-menu-dropdown button:hover,
.workspace-more-dropdown a:hover {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
}

.account-menu-dropdown i,
.workspace-more-dropdown i {
  width: 18px;
  color: #66788d;
  font-size: 16px;
}

.account-menu-dropdown form {
  margin: 4px 0 0;
  padding-top: 4px;
  border-top: 1px solid var(--workspace-line);
}

.workspace-nav-row {
  min-height: var(--workspace-nav-height);
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
}

.workspace-nav {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.workspace-nav::-webkit-scrollbar {
  display: none;
}

.workspace-nav-link {
  position: relative;
  flex: 0 0 auto;
  min-width: 128px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 14px;
  color: #53667d;
  font-weight: 650;
}

.workspace-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
}

.workspace-nav-link i {
  font-size: 17px;
}

.workspace-nav-link:hover,
.workspace-nav-link.active {
  color: var(--workspace-primary);
  background: #fafdff;
}

.workspace-nav-link.active::after {
  background: var(--workspace-primary);
}

.workspace-more-trigger {
  min-width: 72px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: #53667d;
  font-weight: 650;
  cursor: pointer;
}

.workspace-more-trigger:hover,
.workspace-more-menu[open] .workspace-more-trigger {
  color: var(--workspace-primary);
}

.workspace-more-dropdown {
  top: calc(100% + 1px);
}

/* Page shell and legacy surface normalization */
.authenticated-shell .container {
  max-width: none;
  padding: 20px 18px 34px;
}

.guest-shell .container {
  max-width: 1120px;
  padding: 56px 20px;
}

.page-shell,
.grid,
.stack-column,
.project-module-stack,
.stack-gap-lg,
.project-grid,
.two-column-layout {
  gap: 16px;
}

.panel,
.card,
.stat-card,
.field-card,
.info-tile,
.workspace-card,
.project-card,
.section-card,
.attention-item,
.download-tile,
.attachment-card,
.record-card,
.workflow-step-card,
.project-ai-module-link,
.responsibility-chip-card,
.accordion-surface,
.inline-disclosure-surface,
.table-shell,
.mapping-table-wrap {
  border-color: var(--workspace-line);
  border-radius: 8px;
  background: var(--workspace-surface);
  background-image: none;
  box-shadow: none;
}

.panel,
.card {
  padding: 18px;
  overflow: visible;
}

.panel::before,
.stat-card::after,
.stat-card-rich::before,
.project-card-glow {
  display: none;
}

.panel-dark-surface {
  color: var(--workspace-text);
  background: #f3f7fa;
  border-color: var(--workspace-line);
}

.panel-dark-surface .panel-header-light h2,
.panel-dark-surface .panel-header-light p,
.panel-dark-surface .mini-kicker-light,
.panel-dark-surface .muted-light,
.panel-dark-surface .stat-label,
.panel-dark-surface .stat-note,
.panel-dark-surface .stat-value,
.panel-dark-surface .route-item strong,
.panel-dark-surface .route-item small {
  color: var(--workspace-text);
}

.hero,
.hero-dashboard,
.compact-hero,
.project-hero {
  padding: 20px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  color: var(--workspace-text);
  background: var(--workspace-surface);
  background-image: none;
  box-shadow: none;
}

.hero::before {
  display: none;
}

.hero h1,
.hero.hero-slim h1,
.hero.compact-hero h1 {
  color: var(--workspace-text);
  font-size: 28px;
  line-height: 1.16;
}

.hero-text,
.hero.compact-hero .hero-text,
.hero.compact-hero p {
  color: var(--workspace-muted);
  font-size: 14px;
  line-height: 1.5;
}

.hero-grid,
.hero.compact-hero.hero-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 18px;
}

.eyebrow,
.mini-kicker,
.mini-kicker-light,
.hero.compact-hero .eyebrow,
.hero.compact-hero .mini-kicker,
.hero.compact-hero .mini-kicker-light {
  min-height: 0;
  padding: 4px 7px;
  border: 1px solid #d4e9f7;
  border-radius: 4px;
  background: var(--workspace-primary-soft);
  color: var(--workspace-primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-transform: none;
}

.glass-card,
.hero-side-panel,
.hero.compact-hero .hero-side-panel,
.hero.compact-hero .compact-side-panel,
.hero.compact-hero .ai-side-panel-tight {
  max-width: none;
  padding: 14px;
  border: 1px solid var(--workspace-line);
  border-radius: 8px;
  color: var(--workspace-text);
  background: var(--workspace-surface-muted);
  background-image: none;
  box-shadow: none;
}

.glass-card h3,
.glass-card-header h3,
.hero-side-metric strong,
.hero-side-metric span,
.hero-side-metric small,
.hero-progress-value {
  color: var(--workspace-text);
  text-shadow: none;
}

.hero-side-panel .download-tile,
.panel-dark-surface .download-tile {
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: var(--workspace-surface);
}

.hero-side-panel .download-tile strong,
.hero-side-panel .download-tile span,
.hero-side-panel .download-tile small,
.panel-dark-surface .download-tile strong,
.panel-dark-surface .download-tile span,
.panel-dark-surface .download-tile small {
  color: var(--workspace-text);
}

.hero.compact-hero .ai-config-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hero.compact-hero .ai-config-stack .download-tile {
  min-height: 64px;
  align-content: start;
  padding: 9px 10px;
}

.hero-side-grid,
.hero.compact-hero .hero-side-grid {
  gap: 8px;
}

.hero-side-metric,
.hero.compact-hero .hero-side-metric {
  min-height: 0;
  padding: 10px;
  border: 1px solid var(--workspace-line);
  border-radius: 6px;
  background: var(--workspace-surface);
  background-image: none;
}

.hero-side-metric strong,
.hero.compact-hero .hero-side-metric strong {
  font-size: 20px;
}

.button,
.button.compact,
.hero.compact-hero .button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--workspace-primary);
  border-radius: 6px;
  color: #fff;
  background: var(--workspace-primary);
  background-image: none;
  box-shadow: none;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.button:hover {
  transform: none;
  filter: none;
  color: #fff;
  background: var(--workspace-primary-hover);
  border-color: var(--workspace-primary-hover);
}

.button.ghost,
.button.secondary,
.button.subtle,
.hero-ghost,
.hero .button.ghost,
.panel-dark-surface .button.ghost {
  color: #34445a;
  background: var(--workspace-surface);
  border-color: var(--workspace-line-strong);
}

.button.ghost:hover,
.button.secondary:hover,
.button.subtle:hover,
.hero-ghost:hover,
.hero .button.ghost:hover {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  border-color: #b9dced;
}

.button.success {
  background: var(--workspace-success);
  border-color: var(--workspace-success);
}

.button.warning {
  background: var(--workspace-warning);
  border-color: var(--workspace-warning);
}

.button.danger {
  background: var(--workspace-danger);
  border-color: var(--workspace-danger);
}

.badge,
.chip,
.mini-chip,
.metric-chip,
.project-chip {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  letter-spacing: 0;
}

.chip-glass,
.chip-soft,
.project-chip {
  color: #53667d;
  background: var(--workspace-surface-muted);
  border-color: var(--workspace-line);
}

.stat-card {
  min-height: 100px;
  padding: 14px 16px;
}

.stat-label {
  margin-bottom: 6px;
  color: var(--workspace-muted);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

.stat-value {
  color: var(--workspace-text);
  font-size: 28px;
  letter-spacing: 0;
}

.stat-note {
  margin-top: 6px;
  font-size: 12px;
}

/* Global AI center: sparse metrics and module links stay visually proportional. */
.ai-center-metrics {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.ai-center-metrics .stat-card {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "note value";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
  padding: 10px 12px;
}

.ai-center-metrics .stat-label {
  grid-area: label;
  align-self: end;
  margin: 0;
}

.ai-center-metrics .stat-value {
  grid-area: value;
  font-size: 22px;
  line-height: 1;
}

.ai-center-metrics .stat-note {
  grid-area: note;
  align-self: start;
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--workspace-muted);
  font-size: 11px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-center-modules-panel {
  padding: 14px 18px 16px;
}

.ai-center-modules-panel .panel-header {
  margin-bottom: 10px;
}

.ai-center-module-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.ai-center-module-card {
  min-height: 68px;
  gap: 8px;
  padding: 10px 12px;
  align-items: start;
}

.ai-center-module-card strong {
  margin: 0 0 3px;
  color: var(--workspace-text);
  font-size: 13px;
  line-height: 1.25;
}

.ai-center-module-card .muted-light {
  display: -webkit-box;
  overflow: hidden;
  color: var(--workspace-muted);
  font-size: 11px;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ai-center-module-card .chip {
  min-width: 26px;
  min-height: 24px;
  padding: 3px 6px;
  justify-content: center;
}

.progress,
.progress-premium,
.portfolio-progress {
  border-radius: 3px;
  background: #e2e8f0;
  background-image: none;
}

.progress-fill,
.portfolio-progress > span {
  border-radius: 3px;
  background: var(--workspace-primary);
  background-image: none;
}

.project-action-strip-wrap {
  position: sticky;
  top: calc(var(--workspace-header-main) + var(--workspace-nav-height));
  z-index: 40;
  padding: 0;
  border-bottom: 1px solid var(--workspace-line);
  background: var(--workspace-surface);
}

.project-action-strip {
  max-width: none;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 0;
  background: var(--workspace-surface);
  box-shadow: none;
}

.project-action-strip-code {
  color: var(--workspace-primary);
}

.project-action-strip-title,
.project-action-link {
  color: #4f6177;
}

.project-action-link {
  border-radius: 4px;
}

.project-action-link:hover,
.project-action-link.active {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
}

.project-hero-media .hero-main {
  align-content: center;
}

.project-preview-card {
  gap: 8px;
}

.project-reference-hero {
  border-color: var(--workspace-line);
  border-radius: 6px;
  background: var(--workspace-surface);
}

.project-reference-hero img {
  max-height: 230px;
  aspect-ratio: 16 / 7;
  object-fit: contain;
  background: var(--workspace-surface);
}

.project-reference-caption {
  padding-top: 0;
  color: var(--workspace-muted);
  font-size: 11px;
}

.project-preview-card .export-actions {
  flex-wrap: nowrap;
  gap: 7px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.project-preview-card .export-actions .button {
  flex: 0 0 auto;
}

.project-tabs-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.project-tabs {
  min-width: 0;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  border-bottom: 1px solid var(--workspace-line-strong);
  scrollbar-width: thin;
}

.project-tab {
  flex: 1 0 150px;
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 12px;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.project-tab:hover {
  transform: none;
  border-color: #a9cfe6;
  background: #f8fbfd;
  box-shadow: none;
}

.project-tab.active {
  border-color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  box-shadow: none;
}

.project-tab-title,
.project-tab.active .project-tab-title {
  color: var(--workspace-text);
  font-size: 12px;
}

.project-tab-note,
.project-tab.active .project-tab-note {
  color: var(--workspace-muted);
  font-size: 10px;
}

/* Dashboard */
.portfolio-dashboard {
  display: grid;
  gap: 16px;
}

.dashboard-mobile-heading {
  display: none;
}

.portfolio-workspace {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 16px;
  align-items: start;
}

.portfolio-main {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.portfolio-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(174px, 0.64fr);
  gap: 10px;
}

.summary-metric {
  min-width: 0;
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  background: var(--workspace-surface);
}

.summary-metric-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #27415b;
  font-size: 27px;
}

.summary-metric > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 8px;
  align-items: center;
}

.summary-metric > div > span {
  min-width: 0;
  color: var(--workspace-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.summary-metric > div > strong {
  grid-row: 1 / span 2;
  grid-column: 2;
  color: var(--workspace-text);
  font-size: 26px;
  line-height: 1;
}

.summary-metric > div > small {
  grid-column: 1;
  color: var(--workspace-muted);
  font-size: 11px;
}

.create-project-button {
  min-height: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--workspace-primary);
  border-radius: 4px;
  color: #fff;
  background: var(--workspace-primary);
  font-weight: 700;
  text-align: center;
}

.create-project-button:hover {
  color: #fff;
  background: var(--workspace-primary-hover);
  border-color: var(--workspace-primary-hover);
}

.create-project-button i {
  font-size: 18px;
}

.create-project-button-secondary {
  color: var(--workspace-primary);
  background: var(--workspace-surface);
}

.create-project-button-secondary:hover {
  color: var(--workspace-primary-hover);
  background: var(--workspace-primary-soft);
}

.stage-distribution,
.portfolio-registry,
.decision-rail {
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  background: var(--workspace-surface);
}

.stage-distribution {
  padding: 14px 16px 16px;
}

.stage-distribution-header,
.registry-header,
.decision-rail-header,
.dashboard-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.stage-distribution-header {
  margin-bottom: 12px;
}

.stage-distribution-header h2,
.registry-header h2,
.decision-rail-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.stage-distribution-header > span,
.registry-header > div > span {
  color: var(--workspace-muted);
  font-size: 12px;
}

.stage-bar {
  height: 7px;
  display: flex;
  overflow: hidden;
  border-radius: 3px;
  background: #edf1f5;
}

.stage-segment {
  flex: 0 0 var(--stage-share);
  min-width: 0;
}

.stage-idea { background: #087ac1; }
.stage-data_collection { background: #18a0ae; }
.stage-concept { background: #e2a019; }
.stage-design { background: #e65b62; }
.stage-approval { background: #7b6ab8; }
.stage-production_prep { background: #52ad68; }

.stage-legend {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.stage-legend-item {
  min-width: 0;
  display: grid;
  grid-template-columns: 7px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.stage-dot {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  border-radius: 50%;
}

.stage-legend-item > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.stage-legend-item span:not(.stage-dot),
.stage-legend-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.stage-legend-item span:not(.stage-dot) {
  color: #4f6177;
  font-size: 11px;
}

.stage-legend-item strong {
  font-size: 11px;
}

.stage-legend-item strong small {
  color: var(--workspace-muted);
  font-weight: 500;
}

.portfolio-registry {
  min-width: 0;
  overflow: hidden;
}

.registry-header {
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--workspace-line);
}

.registry-header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.registry-header > a,
.decision-rail-footer a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--workspace-primary);
  font-size: 12px;
  font-weight: 700;
}

.portfolio-table-wrap {
  min-width: 0;
  overflow-x: auto;
}

.portfolio-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  table-layout: fixed;
}

.portfolio-table th,
.portfolio-table td {
  padding: 20px 14px;
  border-bottom: 1px solid var(--workspace-line);
  text-align: left;
  vertical-align: middle;
}

.portfolio-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  color: #596b80;
  background: #f7f9fb;
  font-size: 11px;
  font-weight: 650;
}

.portfolio-table th:nth-child(1) { width: 38%; }
.portfolio-table th:nth-child(2) { width: 16%; }
.portfolio-table th:nth-child(3) { width: 20%; }
.portfolio-table th:nth-child(4) { width: 14%; }
.portfolio-table th:nth-child(5) { width: 12%; }

.portfolio-table tbody tr:hover {
  background: #fbfdff;
}

.portfolio-project-link {
  min-width: 0;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.portfolio-project-link > i {
  margin-top: 6px;
  color: #718299;
  font-size: 11px;
}

.portfolio-project-link > span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.portfolio-project-link strong {
  color: var(--workspace-primary);
  font-size: 12px;
}

.portfolio-project-link b {
  min-width: 0;
  color: var(--workspace-text);
  font-size: 13px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.portfolio-project-link small,
.table-secondary-line,
.coordinator-cell small {
  display: block;
  color: var(--workspace-muted);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.35;
}

.portfolio-project-link small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-secondary-line {
  margin-top: 5px;
}

.coordinator-cell {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.coordinator-avatar {
  width: 34px;
  height: 34px;
  font-size: 11px;
}

.coordinator-cell > span:last-child {
  min-width: 0;
}

.coordinator-cell strong {
  display: block;
  overflow: hidden;
  color: #33445a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.completion-cell {
  display: grid;
  gap: 5px;
}

.completion-cell strong {
  color: var(--workspace-primary);
  font-size: 12px;
}

.portfolio-progress {
  width: 100%;
  height: 6px;
  display: block;
  overflow: hidden;
}

.portfolio-progress > span {
  width: var(--progress-width, 0%);
  height: 100%;
  display: block;
}

.deadline-date {
  color: #33445a;
  font-size: 12px;
}

.table-empty-value {
  color: var(--workspace-muted);
  font-size: 12px;
}

.portfolio-empty {
  padding: 38px 20px !important;
  text-align: center !important;
}

.portfolio-empty i,
.portfolio-empty strong,
.portfolio-empty span {
  display: block;
}

.portfolio-empty i {
  margin-bottom: 8px;
  color: #8291a4;
  font-size: 30px;
}

.portfolio-empty span {
  margin-top: 4px;
  color: var(--workspace-muted);
}

.registry-footer {
  padding: 11px 16px;
  color: var(--workspace-muted);
  background: #fafbfd;
  font-size: 11px;
}

.decision-rail {
  position: sticky;
  top: calc(var(--workspace-header-main) + var(--workspace-nav-height) + 16px);
  overflow: hidden;
}

.decision-rail-header {
  min-height: 54px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--workspace-line);
}

.decision-rail-header i {
  color: #65778d;
}

.decision-item {
  min-height: 164px;
  display: grid;
  align-content: center;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--workspace-line);
  color: var(--workspace-text);
}

.decision-item:hover {
  color: var(--workspace-text);
  background: #fbfdff;
}

.decision-item-title {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.decision-item-title > i {
  font-size: 21px;
}

.decision-item-title strong {
  font-size: 14px;
}

.decision-item-title b {
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 13px;
  color: #fff;
  font-size: 13px;
}

.decision-item > span:last-child {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--workspace-muted);
  font-size: 11px;
}

.decision-danger .decision-item-title > i { color: var(--workspace-danger); }
.decision-danger .decision-item-title b { background: var(--workspace-danger); }
.decision-warning .decision-item-title > i { color: var(--workspace-warning); }
.decision-warning .decision-item-title b { background: var(--workspace-warning); }
.decision-primary .decision-item-title > i { color: var(--workspace-primary); }
.decision-primary .decision-item-title b { background: var(--workspace-primary); }
.decision-success .decision-item-title > i { color: var(--workspace-success); }
.decision-success .decision-item-title b { background: var(--workspace-success); }

.decision-rail-footer {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
}

.dashboard-statusbar {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--workspace-line);
  border-radius: 4px;
  color: var(--workspace-muted);
  background: var(--workspace-surface);
  font-size: 11px;
}

.dashboard-statusbar span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Login */
.guest-shell .workspace-header-main {
  grid-template-columns: minmax(0, 1fr);
}

.guest-shell .workspace-brand {
  width: fit-content;
}

.login-workspace-layout {
  min-height: calc(100vh - 185px);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 430px);
  gap: 72px;
  align-items: center;
}

.login-context {
  max-width: 620px;
  display: grid;
  gap: 16px;
}

.login-context-kicker {
  width: fit-content;
  color: var(--workspace-primary);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.login-context h1 {
  max-width: 590px;
  margin: 0;
  font-size: 36px;
  line-height: 1.15;
}

.login-context > p {
  max-width: 560px;
  color: var(--workspace-muted);
  font-size: 17px;
}

.login-context-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 12px 0 0;
  list-style: none;
  border-top: 1px solid var(--workspace-line);
}

.login-context-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--workspace-line);
}

.login-context-list li > i {
  color: var(--workspace-primary);
  font-size: 22px;
}

.login-context-list li > span {
  display: grid;
  gap: 3px;
}

.login-context-list small {
  color: var(--workspace-muted);
}

.login-form-panel {
  padding: 26px;
  border: 1px solid var(--workspace-line-strong);
  border-radius: 8px;
  background: var(--workspace-surface);
}

.login-form-heading {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.login-form-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  font-size: 20px;
}

.login-form-heading h2 {
  margin: 0 0 3px;
  font-size: 20px;
}

.login-form-heading p,
.login-support-note {
  margin: 0;
  color: var(--workspace-muted);
  font-size: 12px;
}

.login-workspace-form {
  display: grid;
  gap: 16px;
}

.workspace-field {
  display: grid;
  gap: 6px;
}

.workspace-field label {
  color: #34445a;
  font-size: 12px;
  font-weight: 650;
}

.workspace-input {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--workspace-line-strong);
  border-radius: 6px;
  background: var(--workspace-surface);
}

.workspace-input:focus-within {
  border-color: var(--workspace-primary);
  box-shadow: 0 0 0 3px rgba(0, 111, 190, 0.12);
}

.workspace-input i {
  color: #728398;
}

.workspace-input input {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-input input:focus {
  border: 0;
  box-shadow: none;
}

.login-support-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--workspace-line);
}

/* Responsive */
@media (max-width: 1280px) {
  .workspace-header-main {
    grid-template-columns: minmax(280px, 360px) minmax(240px, 1fr) auto;
    gap: 16px;
  }

  .account-menu-trigger {
    min-width: 48px;
    grid-template-columns: 36px 14px;
  }

  .account-menu-copy {
    display: none;
  }

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

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

  .create-project-button {
    grid-column: 1 / -1;
    min-height: 48px;
  }

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

  .ai-center-metrics,
  .ai-center-module-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workspace-header-main {
    grid-template-columns: minmax(240px, 1fr) minmax(250px, 1.2fr) auto;
    padding-inline: 14px;
  }

  .workspace-brand-copy strong {
    font-size: 15px;
  }

  .workspace-brand-copy span {
    font-size: 12px;
  }

  .workspace-nav-row {
    padding-inline: 14px;
  }

  .workspace-nav {
    gap: 2px;
  }

  .workspace-nav-link {
    min-width: 112px;
  }

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

  .decision-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .decision-rail-header,
  .decision-rail-footer {
    grid-column: 1 / -1;
  }

  .decision-item:nth-of-type(odd) {
    border-right: 1px solid var(--workspace-line);
  }

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

  .login-workspace-layout {
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    gap: 38px;
  }
}

@media (max-width: 760px) {
  :root {
    --workspace-header-main: auto;
    --workspace-nav-height: 50px;
  }

  .workspace-header {
    position: relative;
  }

  .workspace-header-main {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
  }

  .workspace-brand {
    gap: 9px;
  }

  .workspace-brand-mark {
    width: 40px;
    height: 40px;
    padding: 5px;
    border-radius: 6px;
  }

  .workspace-brand-copy strong {
    font-size: 14px;
  }

  .workspace-brand-copy span {
    font-size: 11px;
  }

  .workspace-search {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 40px;
  }

  .workspace-search kbd,
  .workspace-header-actions > .icon-button {
    display: none;
  }

  .account-menu-trigger {
    min-width: 42px;
    min-height: 42px;
    grid-template-columns: 32px;
    padding: 4px;
    border-color: transparent;
  }

  .workspace-avatar {
    width: 32px;
    height: 32px;
  }

  .account-menu-trigger > i {
    display: none;
  }

  .account-menu-dropdown {
    position: fixed;
    top: 60px;
    left: 12px;
    right: 12px;
  }

  .workspace-nav-row {
    min-height: var(--workspace-nav-height);
    gap: 4px;
    padding: 0 8px;
  }

  .workspace-nav-link {
    min-width: 94px;
    gap: 6px;
    padding: 0 9px;
    font-size: 12px;
  }

  .workspace-more-trigger {
    min-width: 54px;
  }

  .workspace-more-trigger span {
    display: none;
  }

  .workspace-more-dropdown {
    position: fixed;
    top: 112px;
    left: 12px;
    right: 12px;
  }

  .authenticated-shell .container,
  .guest-shell .container {
    padding: 12px;
  }

  .dashboard-mobile-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }

  .dashboard-mobile-heading > div {
    min-width: 0;
    display: grid;
    gap: 1px;
  }

  .dashboard-mobile-heading > div > span {
    color: var(--workspace-muted);
    font-size: 10px;
  }

  .dashboard-mobile-heading strong {
    font-size: 17px;
  }

  .portfolio-summary {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .summary-metric {
    flex: 0 0 270px;
    min-height: 76px;
    scroll-snap-align: start;
  }

  .portfolio-summary .create-project-button:not(.create-project-button-secondary) {
    display: none;
  }

  .create-project-button-secondary {
    flex: 0 0 190px;
    min-height: 76px;
  }

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

  .registry-header {
    align-items: flex-start;
  }

  .registry-header > a {
    width: 36px;
    height: 36px;
    justify-content: center;
    border: 1px solid var(--workspace-line);
    border-radius: 50%;
    font-size: 0;
  }

  .registry-header > a i {
    font-size: 15px;
  }

  .portfolio-table-wrap {
    overflow: visible;
  }

  .portfolio-table {
    min-width: 0;
  }

  .portfolio-table,
  .portfolio-table tbody,
  .portfolio-table tr,
  .portfolio-table td {
    display: block;
    width: 100%;
  }

  .portfolio-table thead {
    display: none;
  }

  .portfolio-table tbody {
    padding: 0 12px 12px;
  }

  .portfolio-table tr {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--workspace-line);
    border-radius: 6px;
  }

  .portfolio-table td {
    min-height: 36px;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #edf1f5;
  }

  .portfolio-table td::before {
    content: attr(data-label);
    color: var(--workspace-muted);
    font-size: 10px;
    font-weight: 650;
  }

  .portfolio-table td:first-child {
    display: block;
    padding-top: 0;
  }

  .portfolio-table td:first-child::before {
    display: none;
  }

  .portfolio-table td:last-child {
    border-bottom: 0;
  }

  .portfolio-project-link small {
    white-space: normal;
  }

  .portfolio-empty {
    display: block !important;
  }

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

  .decision-rail-header,
  .decision-rail-footer {
    grid-column: auto;
  }

  .decision-item {
    min-height: 112px;
    gap: 12px;
  }

  .decision-item:nth-of-type(odd) {
    border-right: 0;
  }

  .dashboard-statusbar {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    padding-block: 10px;
  }

  .hero,
  .hero-dashboard,
  .compact-hero,
  .project-hero {
    padding: 16px;
  }

  .hero h1,
  .hero.hero-slim h1,
  .hero.compact-hero h1 {
    font-size: 22px;
  }

  .panel,
  .card {
    padding: 14px;
  }

  .project-action-strip-wrap {
    position: relative;
    top: auto;
  }

  .project-action-strip {
    min-height: 0;
    display: grid;
    gap: 6px;
    padding: 8px 12px;
  }

  .project-action-strip-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .project-action-strip-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .project-action-nav {
    min-width: 0;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .project-action-link {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
  }

  .login-workspace-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .login-context {
    gap: 10px;
  }

  .login-context h1 {
    font-size: 26px;
  }

  .login-context > p {
    font-size: 14px;
  }

  .login-context-list {
    display: none;
  }

  .login-form-panel {
    padding: 20px;
  }

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

  .ai-center-metrics .stat-card,
  .ai-center-module-card {
    min-height: 64px;
  }
}

@media (max-width: 430px) {
  .workspace-brand-copy strong {
    max-width: 220px;
  }

  .workspace-brand-copy span {
    display: none;
  }

  .workspace-nav-link {
    min-width: 78px;
    flex-direction: column;
    gap: 2px;
    font-size: 10px;
  }

  .workspace-nav-link i {
    font-size: 15px;
  }

  .portfolio-table td {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .ai-center-metrics .stat-note,
  .ai-center-module-card .muted-light {
    -webkit-line-clamp: 1;
  }
}

/* Interface audit refresh: denser hierarchy, clearer states, and shorter mobile flows. */
:root {
  --workspace-bg: #f1f5f8;
  --workspace-surface-muted: #f6f9fb;
  --workspace-text: #142238;
  --workspace-muted: #5f7188;
  --workspace-line: #d8e1ea;
  --workspace-line-strong: #c7d3df;
  --workspace-primary: #0076c7;
  --workspace-primary-hover: #005f9f;
  --workspace-primary-soft: #e8f4fb;
  --workspace-header-main: 72px;
  --workspace-nav-height: 50px;
  --topbar-height: 72px;
  --shadow-xs: 0 1px 2px rgba(26, 48, 76, 0.05);
  --shadow-sm: 0 4px 14px rgba(26, 48, 76, 0.06);
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 12px;
  z-index: 120;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  background: var(--workspace-primary);
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

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

.authenticated-shell .container {
  width: 100%;
  max-width: 1880px;
  margin-inline: auto;
  padding-top: 16px;
}

.workspace-header {
  box-shadow: 0 1px 3px rgba(23, 43, 68, 0.06);
}

.workspace-header-main {
  min-height: var(--workspace-header-main);
  grid-template-columns: minmax(300px, 410px) minmax(280px, 520px) minmax(230px, 1fr);
  padding-block: 8px;
}

.workspace-brand {
  gap: 11px;
}

.workspace-brand-mark {
  width: 44px;
  height: 44px;
}

.workspace-brand-copy strong {
  font-size: 17px;
}

.workspace-brand-copy span {
  font-size: 12px;
}

.workspace-search {
  height: 40px;
  background: #fbfdff;
}

.workspace-nav-link {
  min-width: 126px;
  min-height: var(--workspace-nav-height);
  padding-inline: 14px;
}

.workspace-more-trigger {
  min-height: var(--workspace-nav-height);
}

.workspace-more-menu.active .workspace-more-trigger {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  box-shadow: inset 0 -3px 0 var(--workspace-primary);
}

.page-shell {
  gap: 14px;
}

.page-shell > .hero,
.page-shell > section.hero {
  padding: 10px 2px 14px;
  border: 0;
  border-bottom: 1px solid var(--workspace-line);
  border-radius: 0;
  background: transparent;
}

.page-shell > .hero h1,
.page-shell > section.hero h1 {
  font-size: 27px;
}

.hero-single {
  display: block;
}

.hero-single .hero-main {
  max-width: 980px;
}

.hero-main {
  align-content: center;
  gap: 10px;
}

.hero-side-panel,
.glass-card {
  box-shadow: var(--shadow-xs);
}

.panel,
.card,
.stat-card,
.field-card,
.project-card,
.section-card,
.attention-item,
.attachment-card,
.record-card,
.table-shell,
.mapping-table-wrap {
  box-shadow: var(--shadow-xs);
}

.panel,
.card {
  padding: 16px;
}

.panel-header,
.page-header {
  margin-bottom: 12px;
}

.panel-header h2,
.page-header h2 {
  font-size: 20px;
  line-height: 1.2;
}

.stat-card {
  min-height: 84px;
  padding: 12px 14px;
}

.stat-label {
  margin-bottom: 4px;
}

.stat-value {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  margin-top: 4px;
  line-height: 1.3;
}

.button,
.button.compact,
.icon-button,
.workspace-nav-link,
.project-action-link {
  transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.button:not(.ghost) {
  box-shadow: 0 2px 6px rgba(0, 91, 155, 0.15);
}

.button:active,
.icon-button:active,
.project-action-link:active {
  transform: translateY(1px);
}

.button.ghost {
  box-shadow: none;
}

input,
select,
textarea {
  border-color: var(--workspace-line-strong);
  border-radius: 6px;
  background: #fff;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebdca;
}

.filter-panel,
.registry-filters-panel {
  padding: 14px 16px;
  background: var(--workspace-surface-muted);
}

.filter-panel .panel-header {
  margin-bottom: 10px;
}

.filter-panel .field-card,
.registry-filters-panel .field-card,
.form-layout > .field-card,
.embedded-form .field-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.filter-panel .filter-grid,
.registry-filters-panel .filter-grid {
  gap: 12px;
}

.filter-actions {
  align-self: end;
}

.filter-control {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.filter-control > span {
  color: #34465c;
  font-size: 11px;
  font-weight: 700;
}

.prompt-filter-grid {
  grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(170px, 0.85fr)) auto;
  align-items: end;
  gap: 12px;
}

.prompt-filter-grid input,
.prompt-filter-grid select {
  width: 100%;
  min-height: 40px;
}

.table-shell,
.mapping-table-wrap {
  overflow: auto;
}

.table-shell thead th,
.mapping-table-wrap thead th,
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f7fa;
}

.table-shell tbody tr,
.mapping-table-wrap tbody tr,
.data-table tbody tr {
  transition: background-color 120ms ease;
}

.table-shell tbody tr:hover,
.mapping-table-wrap tbody tr:hover,
.data-table tbody tr:hover {
  background: #f7fbfd;
}

.panel-dark-surface {
  color: var(--workspace-text);
  background: #eef4f8;
}

.panel-dark-surface .review-item,
.panel-dark-surface .route-item,
.hero-side-panel .route-item,
.route-list-surface .route-item {
  border: 1px solid var(--workspace-line);
  background: #fff;
}

.panel-dark-surface .review-item strong,
.panel-dark-surface .review-item small,
.panel-dark-surface .route-item strong,
.panel-dark-surface .route-item small,
.hero-side-panel .route-item strong,
.hero-side-panel .route-item small,
.route-list-surface .route-item strong,
.route-list-surface .route-item small {
  color: var(--workspace-text);
}

.panel-dark-surface .review-item small,
.panel-dark-surface .route-item small,
.hero-side-panel .route-item small,
.route-list-surface .route-item small {
  color: var(--workspace-muted);
}

.panel-dark-surface .route-index,
.hero-side-panel .route-index,
.route-list-surface .route-index {
  color: var(--workspace-primary);
  background: var(--workspace-primary-soft);
  border-color: #cde4f2;
}

.empty-state {
  min-height: 0;
  padding: 22px 16px;
  border-style: dashed;
  background: #fafcfd;
}

.route-list-surface .route-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.route-list-surface .route-item > div {
  width: auto;
  min-width: 0;
}

.task-card-grid {
  gap: 10px;
}

.task-card.task-card-compact {
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.task-card-compact .task-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.task-card-compact .task-card-top h3 {
  margin: 0 0 2px;
  font-size: 16px;
  line-height: 1.25;
}

.task-card-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.task-card-open {
  gap: 7px;
}

.task-card-compact .task-card-meta {
  margin-top: 8px;
  font-size: 12px;
}

.task-card-bottom {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
  gap: 18px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #edf1f5;
}

.task-card-bottom .progress-block {
  margin: 0;
}

.task-inline-stats {
  display: flex;
  align-items: center;
  gap: 0;
  color: var(--workspace-muted);
  font-size: 11px;
}

.task-inline-stats > span {
  padding: 0 10px;
  border-left: 1px solid var(--workspace-line);
  white-space: nowrap;
}

.task-inline-stats strong {
  margin-left: 4px;
  color: var(--workspace-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.attention-list {
  gap: 8px;
}

.attention-item {
  padding: 12px 14px;
}

.attention-item h3 {
  font-size: 16px;
  line-height: 1.25;
}

.attention-item .attention-meta {
  margin-top: 5px;
  font-size: 12px;
}

.attention-item .hero-chip-row {
  gap: 6px;
  margin-top: 8px;
}

.attention-item .progress {
  margin-top: 9px;
}

.prompt-block {
  padding: 14px 16px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-xs);
}

.prompt-block + .prompt-block {
  margin-top: 0;
}

.prompt-disclosure {
  margin-top: 10px;
  border-top: 1px solid var(--workspace-line);
}

.prompt-disclosure > summary {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  color: var(--workspace-primary);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
}

.prompt-disclosure > summary::-webkit-details-marker {
  display: none;
}

.prompt-disclosure > summary i {
  transition: transform 140ms ease;
}

.prompt-disclosure[open] > summary i {
  transform: rotate(180deg);
}

.prompt-disclosure .prompt-textarea {
  min-height: 150px;
  margin-top: 2px;
}

.project-edit-disclosure {
  padding: 0;
  overflow: hidden;
}

.project-edit-summary {
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

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

.project-edit-summary-copy {
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 4px;
}

.project-edit-summary-copy > strong {
  font-size: 17px;
}

.project-edit-summary-copy > small {
  color: var(--workspace-muted);
  font-size: 12px;
}

.project-edit-summary-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--workspace-primary);
  font-size: 12px;
  font-weight: 700;
}

.project-edit-summary-action i {
  transition: transform 140ms ease;
}

.project-edit-disclosure[open] .project-edit-summary-action i {
  transform: rotate(180deg);
}

.project-edit-body {
  padding: 16px;
  border-top: 1px solid var(--workspace-line);
}

.form-section-title {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--workspace-line);
}

@media (max-width: 1100px) {
  .prompt-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .prompt-filter-grid .button {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .authenticated-shell .container,
  .guest-shell .container {
    padding-top: 10px;
  }

  .workspace-header-main {
    padding-block: 8px;
  }

  .page-shell {
    gap: 10px;
  }

  .page-shell > .hero,
  .page-shell > section.hero {
    padding: 8px 2px 12px;
  }

  .page-shell > .hero h1,
  .page-shell > section.hero h1 {
    font-size: 21px;
  }

  .hero-main {
    gap: 8px;
  }

  .hero-main > .hero-chip-row,
  .attention-item .hero-chip-row,
  .project-card .hero-chip-row {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
  }

  .hero-side-panel {
    padding: 12px;
  }

  .hero-side-grid,
  .hero-side-grid.hero-side-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .hero-side-metric {
    min-height: 62px;
    padding: 9px 10px;
  }

  .panel,
  .card {
    padding: 12px;
  }

  .stats-grid.four-up,
  .info-grid.four-up,
  .passport-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .stats-grid.four-up .stat-card,
  .info-grid.four-up .info-tile,
  .passport-grid .info-tile {
    min-height: 76px;
    padding: 10px;
  }

  .filter-panel,
  .registry-filters-panel {
    padding: 12px;
  }

  .filter-panel > .filter-grid,
  .registry-filters-panel > .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-panel .filter-actions,
  .registry-filters-panel .filter-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .filter-panel .filter-actions .button,
  .registry-filters-panel .filter-actions .button {
    width: 100%;
  }

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

  .prompt-filter-grid .button {
    width: 100%;
  }

  .route-list-surface .route-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .route-list-surface .route-item > .button {
    width: 100%;
  }

  .task-card.task-card-compact {
    padding: 12px;
  }

  .task-card-compact .task-card-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .task-card-controls {
    justify-content: space-between;
  }

  .task-card-controls .task-card-open {
    width: auto;
  }

  .task-card-compact .task-card-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .task-card-bottom {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .task-inline-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--workspace-line);
  }

  .task-inline-stats > span {
    display: grid;
    gap: 2px;
    padding: 8px 6px 0;
    border-left: 0;
    border-right: 1px solid var(--workspace-line);
    text-align: center;
    white-space: normal;
  }

  .task-inline-stats > span:last-child {
    border-right: 0;
  }

  .task-inline-stats strong {
    margin-left: 0;
  }

  .attention-item {
    padding: 11px 12px;
  }

  .attention-title-row {
    gap: 8px;
  }

  .attention-item h3 {
    font-size: 15px;
  }

  .prompt-block {
    padding: 12px;
  }

  .prompt-block .list-card-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .prompt-block .list-card-top > div {
    width: auto;
    min-width: 0;
  }

  .prompt-block .list-card-top > .button {
    width: 100%;
  }

  .project-edit-summary {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    padding: 12px;
  }

  .project-edit-summary-action {
    justify-content: space-between;
  }

  .project-edit-body {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
