:root {
  --bg: #f6f3ed;
  --surface: #ffffff;
  --surface-2: #f8f6f1;
  --ink: #1b211d;
  --muted: #677069;
  --line: #ded8ce;
  --line-strong: #c8bfb2;
  --green: #165c3a;
  --green-soft: #e3f0e8;
  --amber: #b56b22;
  --amber-soft: #fbeddc;
  --red: #b94848;
  --red-soft: #f8e4e1;
  --teal: #2e7885;
  --teal-soft: #e0f1f3;
  --plum: #6d5578;
  --plum-soft: #eee7f1;
  --charcoal: #2a241f;
  --shadow: 0 14px 36px rgba(48, 40, 32, 0.09);
}

html,
body {
  margin: 0;
  background: var(--bg);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14100c;
    --surface: #1d1712;
    --surface-2: #261f18;
    --ink: #f3eee6;
    --muted: #b9afa3;
    --line: #3b3128;
    --line-strong: #59483a;
    --green: #76c091;
    --green-soft: #20372a;
    --charcoal: #100c09;
  }

  html,
  body {
    background: #14100c;
    color: #f3eee6;
  }
}

#observablehq-main:has(.es-platform),
#observablehq-main:has(.es-platform) #observablehq-center,
#observablehq-main:has(.es-platform) .observablehq {
  max-width: none !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
}

#observablehq-header {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.framework-header {
  display: flex;
  flex: 1 1 auto;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  color: var(--ink);
}

.framework-brand,
.framework-header nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.framework-brand,
.framework-header a {
  color: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.framework-header nav a {
  min-height: 30px;
  padding: 5px 9px;
  border-radius: 8px;
  color: var(--muted);
}

.framework-header nav a:hover,
.framework-header nav a:focus-visible {
  background: var(--green-soft);
  color: var(--green);
}

.framework-signout {
  margin-left: auto;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.framework-signout:hover,
.framework-signout:focus-visible {
  background: var(--green-soft);
  color: var(--green);
  outline: none;
}

body:not(:has(.route-app[data-session="authenticated"])) .framework-signout {
  display: none;
}

.framework-home,
.framework-footer {
  color: var(--ink);
  font-weight: 800;
}

#observablehq-sidebar {
  border-right-color: var(--line);
  background: var(--surface);
}

#observablehq-sidebar > ol:first-child {
  padding: 12px 0 10px;
  border-bottom-color: var(--line);
}

#observablehq-sidebar > ol:first-child::before {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 82%, var(--charcoal)), var(--surface));
  border-bottom: 1px solid var(--line);
}

#observablehq-sidebar > ol:first-child > li > a {
  min-height: 42px;
  margin-left: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(16, 12, 9, 0.08);
}

#observablehq-sidebar > ol:first-child > li > a:hover,
#observablehq-sidebar > ol:first-child > li > a:focus-visible {
  background: var(--green-soft);
  color: var(--green);
  text-decoration: none;
}

.framework-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.framework-home::before {
  content: "ES";
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--charcoal);
  color: #f3eee6;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.observablehq-link-active::before,
.observablehq-secondary-link-highlight {
  background: var(--green) !important;
}

#observablehq-sidebar > ol:first-child > li.observablehq-link-active::before {
  left: -0.5rem;
  border-radius: 0 999px 999px 0;
}

body:not(:has(.route-app[data-session="authenticated"])) #observablehq-header,
body:not(:has(.route-app[data-session="authenticated"])) #observablehq-sidebar-toggle,
body:not(:has(.route-app[data-session="authenticated"])) #observablehq-sidebar-backdrop,
body:not(:has(.route-app[data-session="authenticated"])) #observablehq-sidebar,
body:not(:has(.route-app[data-session="authenticated"])) #observablehq-toc {
  display: none !important;
}

body:not(:has(.route-app[data-session="authenticated"])) #observablehq-main,
body:not(:has(.route-app[data-session="authenticated"])) #observablehq-center,
body:not(:has(.route-app[data-session="authenticated"])) .observablehq {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.es-platform {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(245, 242, 236, 0.95)),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.es-platform[data-theme="dark"] {
  --bg: #14100c;
  --surface: #1d1712;
  --surface-2: #261f18;
  --ink: #f3eee6;
  --muted: #b9afa3;
  --line: #3b3128;
  --line-strong: #59483a;
  --green: #76c091;
  --green-soft: #20372a;
  --amber: #e2a25f;
  --amber-soft: #3b2b19;
  --red: #ef8585;
  --red-soft: #3a2223;
  --teal: #7ccbd4;
  --teal-soft: #17363b;
  --plum: #c89ed8;
  --plum-soft: #302438;
  --charcoal: #100c09;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
  background:
    linear-gradient(180deg, rgba(35, 27, 20, 0.9), rgba(20, 16, 12, 0.98)),
    var(--bg);
}

.es-platform * {
  box-sizing: border-box;
  letter-spacing: 0;
}

.es-platform h1,
.es-platform h2,
.es-platform h3,
.es-platform strong {
  color: var(--ink);
}

.es-platform p {
  color: inherit;
}

.auth-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 28px;
}

.auth-panel {
  display: grid;
  gap: 22px;
  width: min(100%, 520px);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-copy {
  display: grid;
  gap: 10px;
}

.auth-copy h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
}

.auth-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-error {
  margin: 0;
  padding: 12px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-weight: 700;
}

.auth-action {
  width: 100%;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.auth-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-reset-action {
  justify-self: center;
  min-height: 30px;
  white-space: normal;
}

.auth-reset-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.platform-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  overflow-x: hidden;
}

.empty-workspace {
  display: grid;
  gap: 18px;
}

.empty-workspace h2,
.empty-state-panel h3,
.starter-card h3 {
  margin: 0;
}

.empty-workspace p,
.empty-state-panel p,
.starter-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.starter-card,
.empty-state-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.access-starter {
  margin-bottom: 16px;
}

.invite-list {
  display: grid;
  gap: 8px;
}

.invite-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.invite-list span {
  color: var(--muted);
  font-size: 13px;
}

.platform-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 14px;
  background: #fbfaf6;
  border-right: 1px solid var(--line);
}

.es-platform[data-theme="dark"] .platform-sidebar {
  background: #1a140f;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 12px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--charcoal);
  color: #fffaf1;
  font-weight: 800;
  font-size: 13px;
}

.brand-name {
  font-weight: 800;
  font-size: 16px;
}

.brand-meta,
.mini-label,
.section-kicker,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.screen-nav {
  display: grid;
  gap: 4px;
}

.nav-item,
button,
select,
input,
textarea {
  font: inherit;
}

.nav-item {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #eef3ed;
  border-color: var(--line);
}

.es-platform[data-theme="dark"] .nav-item:hover,
.es-platform[data-theme="dark"] .nav-item.active {
  background: #202820;
}

.nav-bullet {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--line-strong);
}

.nav-item.active .nav-bullet {
  background: var(--green);
}

.sidebar-footer {
  margin-top: auto;
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
}

.sidebar-footer strong {
  color: var(--ink);
}

.platform-main {
  min-width: 0;
  overflow-x: hidden;
}

.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  min-height: 84px;
  padding: 18px 28px;
  background: rgba(245, 242, 236, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.es-platform[data-theme="dark"] .workspace-topbar {
  background: rgba(16, 20, 17, 0.92);
}

.workspace-topbar h1 {
  margin: 4px 0 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.topbar-cluster {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar-metric {
  display: grid;
  min-width: 106px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.75);
}

.es-platform[data-theme="dark"] .topbar-metric {
  background: rgba(23, 29, 25, 0.82);
}

.topbar-metric span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-metric strong {
  font-size: 20px;
}

.context-switchers {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(170px, 1fr);
  gap: 8px;
  min-width: min(100%, 380px);
}

.context-switchers label,
.matrix-controls label,
.viewer-toolbar label,
.search-box {
  display: grid;
  gap: 4px;
}

.context-switchers span,
.matrix-controls label span,
.viewer-toolbar label span,
.search-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.context-switchers select,
.matrix-controls select,
.viewer-toolbar select,
.search-box input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
}

.screen-frame {
  padding: 26px 28px 36px;
}

.kpi-grid,
.export-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card,
.workspace-panel,
.pipeline-step,
.comment-card,
.chunk-card,
.standard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.kpi-card {
  display: grid;
  gap: 6px;
  min-height: 108px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.kpi-card span,
.kpi-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.kpi-card strong {
  font-size: 30px;
  line-height: 1;
}

.pipeline-band {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pipeline-step {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 14px;
}

.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  font-weight: 800;
}

.pipeline-step h2,
.workspace-panel h2,
.comment-card h3,
.chunk-card h3,
.gap-row h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.pipeline-step p,
.gap-row p,
.comment-card p,
.chunk-card p,
.drop-zone p,
.finding-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.pipeline-step strong {
  align-self: end;
  font-size: 13px;
}

.dashboard-grid,
.two-column-screen,
.architecture-detail-grid,
.evidence-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.workspace-panel {
  padding: 18px;
  box-shadow: var(--shadow);
}

.wide-panel {
  grid-column: 1 / -1;
}

.panel-heading,
.comment-card-header,
.chunk-meta,
.page-header,
.comment-actions,
.export-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading {
  margin-bottom: 14px;
}

.section-kicker {
  margin: 0 0 4px;
}

.primary-action,
.secondary-action,
.link-action,
.citation-button,
.matrix-link {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.primary-action {
  padding: 8px 14px;
  background: var(--green);
  color: white;
  font-weight: 800;
}

.primary-action strong,
.primary-action span {
  color: currentColor;
}

.secondary-action {
  padding: 8px 12px;
  background: #f7f8f5;
  border-color: var(--line-strong);
  color: var(--ink);
  font-weight: 700;
}

.es-platform[data-theme="dark"] .secondary-action {
  background: #2b231b;
}

.link-action,
.matrix-link {
  padding: 0;
  background: transparent;
  color: var(--teal);
  font-weight: 800;
}

.primary-action:hover,
.secondary-action:hover,
.link-action:hover,
.citation-button:hover,
.matrix-link:hover {
  filter: brightness(0.97);
}

.primary-action:focus-visible,
.secondary-action:focus-visible,
.link-action:focus-visible,
.citation-button:focus-visible,
.matrix-link:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--green) 70%, white);
  outline-offset: 2px;
}

.primary-action:disabled,
.secondary-action:disabled,
.link-action:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.score-layout {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.score-ring {
  --score: 0;
  display: grid;
  width: 148px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #e4e8e2 0);
}

.es-platform[data-theme="dark"] .score-ring {
  background: conic-gradient(var(--green) calc(var(--score) * 1%), #2b352f 0);
}

.score-ring::before {
  content: "";
  position: absolute;
}

.score-ring span {
  display: grid;
  width: 104px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: white;
  font-size: 34px;
  font-weight: 900;
}

.es-platform[data-theme="dark"] .score-ring span {
  background: var(--surface);
}

.risk-bars,
.query-block,
.artifact-list,
.gap-list,
.chunk-list,
.type-strip {
  display: grid;
  gap: 10px;
}

.risk-row,
.confidence-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.bar-track,
.score-meter {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e8ede7;
}

.es-platform[data-theme="dark"] .bar-track,
.es-platform[data-theme="dark"] .score-meter {
  background: #2b352f;
}

.bar-fill,
.score-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.bar-fill.high,
.risk-badge.high {
  background: var(--red-soft);
  color: var(--red);
}

.bar-fill.medium,
.risk-badge.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.bar-fill.low,
.risk-badge.low,
.bar-fill.confidence {
  background: var(--green-soft);
  color: var(--green);
}

.bar-fill.partially-addressed,
.bar-fill.in-review,
.bar-fill.at-risk {
  background: var(--amber);
}

.bar-fill.needs-specialist-review {
  background: var(--plum);
}

.bar-fill.high {
  background: var(--red);
}

.bar-fill.medium {
  background: var(--amber);
}

.bar-fill.low,
.bar-fill.confidence,
.score-meter span {
  background: var(--green);
}

.status-pill,
.risk-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill.complete,
.status-pill.compliant,
.status-pill.ai-review-complete,
.status-pill.mapped,
.status-pill.active,
.status-pill.owner,
.status-pill.personal,
.status-pill.account-admin,
.status-pill.client-org {
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.partially-addressed,
.status-pill.in-review,
.status-pill.extracting,
.status-pill.queued,
.status-pill.reviewer,
.status-pill.contributor,
.status-pill.invited,
.status-pill.at-risk {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-pill.insufficient-evidence,
.status-pill.not-addressed {
  background: var(--red-soft);
  color: var(--red);
}

.status-pill.needs-specialist-review {
  background: var(--plum-soft);
  color: var(--plum);
}

.status-pill.viewer,
.status-pill.assessment-running {
  background: var(--teal-soft);
  color: var(--teal);
}

.table-scroll,
.matrix-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f1f5ef;
  color: #435046;
  font-size: 12px;
  text-transform: uppercase;
  z-index: 1;
}

.es-platform[data-theme="dark"] th {
  background: #202820;
  color: #bdcabf;
}

td {
  font-size: 14px;
}

td strong,
td span {
  display: block;
}

td span,
td code {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.gap-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 104px;
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.gap-row:first-child {
  border-top: 0;
}

.requirement-id {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.super-admin-command {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr) auto;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--teal) 35%, var(--line));
  border-radius: 8px;
  background: linear-gradient(135deg, var(--surface), var(--teal-soft));
  box-shadow: var(--shadow);
}

.super-admin-command h2,
.super-admin-command p,
.command-card strong,
.command-card span,
.inline-empty p,
.account-card-note {
  margin: 0;
}

.super-admin-command h2 {
  font-size: 22px;
  line-height: 1.15;
}

.super-admin-command p {
  color: var(--muted);
  line-height: 1.5;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(112px, 1fr));
  gap: 8px;
}

.command-card,
.account-card,
.permission-card,
.api-contract,
.principle-card,
.inline-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.command-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.command-card strong,
.api-contract strong,
.principle-card strong,
.inline-empty strong {
  font-size: 14px;
}

.command-card span,
.account-card-note,
.api-contract p,
.principle-card p,
.inline-empty p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dismiss-command {
  align-self: start;
  min-width: max-content;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.gap-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.project-card-list,
.project-grid,
.account-grid,
.api-contract-grid,
.principle-grid,
.report-grid,
.portfolio-grid,
.action-template-list,
.role-stack,
.stacked-table,
.assessment-mini-list {
  display: grid;
  gap: 12px;
}

.account-grid,
.api-contract-grid,
.principle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-card,
.permission-card,
.api-contract,
.principle-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.account-card.active {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--teal) 42%, transparent);
}

.account-card h3 {
  margin: 0;
  font-size: 20px;
}

.account-card p,
.permission-card small {
  color: var(--muted);
}

.permission-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.permission-card .tag-row,
.permission-card small {
  grid-column: 1 / -1;
}

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

.permission-ladder span {
  min-height: 28px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.permission-ladder span.enabled {
  border-color: color-mix(in srgb, var(--green) 40%, var(--line));
  background: var(--green-soft);
  color: var(--green);
}

.team-card {
  margin-left: calc(var(--team-depth, 0) * 18px);
}

.api-contract span {
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
}

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.project-card.active,
.project-tile.active,
.report-card.active {
  border-color: var(--green);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--green) 45%, transparent);
}

.project-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.project-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.project-tile,
.report-card,
.portfolio-card,
.action-template,
.role-card,
.assessment-mini {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.project-tile,
.report-card,
.portfolio-card,
.action-template,
.role-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.project-tile h3,
.report-card h3,
.action-template h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.project-tile p,
.report-card p,
.portfolio-card p,
.role-card p,
.action-template p,
.empty-state {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.project-tile-header,
.report-card-header,
.report-card-footer,
.portfolio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.project-metrics,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.project-metrics div,
.detail-grid div {
  display: grid;
  gap: 4px;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.project-metrics span,
.detail-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-metrics strong {
  font-size: 24px;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 0.65fr);
  gap: 16px;
}

.role-card strong {
  font-size: 16px;
}

.report-card-footer span {
  color: var(--muted);
  font-size: 13px;
}

.report-detail {
  display: grid;
  gap: 14px;
}

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

.detail-grid div:last-child {
  grid-column: 1 / -1;
}

.detail-grid strong {
  overflow-wrap: anywhere;
}

.assessment-mini {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.assessment-mini span,
.assessment-mini em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.portfolio-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.portfolio-card li {
  margin: 5px 0;
}

.score-ring.compact {
  width: 108px;
}

.score-ring.compact span {
  width: 76px;
  font-size: 26px;
}

.drop-zone {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 318px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  text-align: center;
}

.drop-zone h3 {
  margin: 0;
  font-size: 22px;
}

.drop-visual {
  display: grid;
  width: min(260px, 100%);
  height: 132px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(47, 125, 92, 0.12), rgba(181, 107, 34, 0.12)),
    #fff;
  border: 1px solid var(--line);
}

.es-platform[data-theme="dark"] .drop-visual {
  background:
    linear-gradient(135deg, rgba(118, 199, 158, 0.14), rgba(226, 162, 95, 0.16)),
    #141a16;
}

.doc-stack {
  position: relative;
  width: 112px;
  height: 82px;
}

.doc-stack span {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background:
    repeating-linear-gradient(180deg, #fff 0 13px, #edf2ec 13px 15px),
    #fff;
}

.es-platform[data-theme="dark"] .doc-stack span {
  background:
    repeating-linear-gradient(180deg, #202820 0 13px, #303a34 13px 15px),
    #202820;
}

.doc-stack span:nth-child(1) {
  transform: translate(-18px, 10px) rotate(-7deg);
}

.doc-stack span:nth-child(2) {
  transform: translate(16px, 4px) rotate(6deg);
}

.doc-stack span:nth-child(3) {
  transform: translate(0, 0);
}

.type-strip {
  grid-template-columns: repeat(6, 1fr);
  margin-top: 12px;
}

.type-strip span,
.tag-row span,
.query-chips span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef3ed;
  color: #425148;
  font-size: 12px;
  font-weight: 800;
}

.es-platform[data-theme="dark"] .type-strip span,
.es-platform[data-theme="dark"] .tag-row span,
.es-platform[data-theme="dark"] .query-chips span {
  background: #202820;
  color: #bdcabf;
}

.artifact-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.artifact-row:last-child {
  border-bottom: 0;
}

.artifact-row code {
  overflow-wrap: anywhere;
  color: var(--teal);
}

.viewer-screen {
  display: grid;
  gap: 16px;
}

.viewer-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

select,
input,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 8px 10px;
  text-transform: none;
}

.es-platform[data-theme="dark"] select,
.es-platform[data-theme="dark"] input,
.es-platform[data-theme="dark"] textarea {
  background: #101411;
}

textarea {
  min-width: 240px;
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

.query-chips,
.tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
  gap: 16px;
}

.document-canvas {
  display: grid;
  min-height: 690px;
  place-items: start center;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.025) 1px, transparent 1px),
    #ecefe8;
  background-size: 24px 24px;
}

.es-platform[data-theme="dark"] .document-canvas {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    #121713;
}

.document-page {
  width: min(100%, 720px);
  min-height: 640px;
  padding: 34px;
  border: 1px solid #c7d1c6;
  border-radius: 4px;
  background: white;
  box-shadow: 0 24px 50px rgba(55, 61, 52, 0.18);
}

.es-platform[data-theme="dark"] .document-page {
  border-color: #46544b;
  background: #f6f3eb;
  color: #202820;
}

.es-platform[data-theme="dark"] .document-page h2,
.es-platform[data-theme="dark"] .document-page strong {
  color: #202820;
}

.page-header {
  padding-bottom: 12px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.document-page h2 {
  margin: 28px 0 14px;
  font-size: 24px;
}

.document-page p {
  color: #313a34;
  font-size: 18px;
  line-height: 1.65;
}

.es-platform[data-theme="dark"] .document-page p {
  color: #313a34;
}

mark {
  padding: 1px 3px;
  border-radius: 4px;
  background: #ffe6a7;
  color: #332714;
}

.es-platform[data-theme="dark"] mark {
  background: #ffe18f;
  color: #332714;
}

.page-table {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  margin-top: 30px;
  border: 1px solid var(--line);
}

.page-table div {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.page-table div:nth-child(odd) {
  background: #f3f6f0;
  color: var(--muted);
  font-weight: 800;
}

.es-platform[data-theme="dark"] .page-table div:nth-child(odd) {
  background: #ebe7dc;
}

.chunk-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.chunk-card {
  padding: 14px;
}

.chunk-meta {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chunk-card h3 {
  margin-bottom: 8px;
}

.matrix-controls {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.filter-cluster {
  display: grid;
  grid-template-columns: 190px 140px minmax(220px, 320px);
  gap: 10px;
  align-items: end;
}

.review-matrix {
  min-width: 1180px;
}

.review-matrix th:nth-child(1) {
  width: 260px;
}

.review-matrix th:nth-child(2) {
  width: 180px;
}

.review-matrix th:nth-child(5) {
  width: 190px;
}

.review-matrix th:nth-child(6) {
  width: 280px;
}

.review-matrix tr.active-row td {
  background: #fffaf1;
}

.es-platform[data-theme="dark"] .review-matrix tr.active-row td {
  background: #261f16;
}

.citation-button {
  display: block;
  min-height: 30px;
  margin-bottom: 6px;
  padding: 5px 8px;
  border-color: var(--line-strong);
  background: #f6f8f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.es-platform[data-theme="dark"] .citation-button {
  background: #202820;
}

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

.comment-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.comment-card blockquote {
  margin: 0;
  padding: 12px;
  border-left: 4px solid var(--green);
  border-radius: 4px;
  background: var(--green-soft);
  color: #284536;
}

.es-platform[data-theme="dark"] .comment-card blockquote {
  color: #cfe9da;
}

.evidence-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}

.evidence-header select {
  max-width: 420px;
}

.query-block div {
  display: grid;
  gap: 5px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.query-block div:last-child {
  border-bottom: 0;
}

.query-block span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.finding-summary {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
}

.finding-summary.high {
  background: var(--red-soft);
}

.finding-summary.medium {
  background: var(--amber-soft);
}

.finding-summary.low {
  background: var(--green-soft);
}

.finding-summary span {
  display: block;
  font-weight: 800;
}

.export-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.export-package {
  min-height: 360px;
}

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

.export-option {
  display: grid;
  grid-template-columns: 20px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  text-transform: none;
}

.export-option input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--green);
}

.export-option strong,
.export-option em {
  display: block;
}

.export-option em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.export-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 16px;
}

.storage-tree {
  overflow: auto;
  max-height: 430px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #202821;
  color: #edf6ed;
  font-size: 13px;
  line-height: 1.55;
}

.es-platform[data-theme="dark"] .storage-tree {
  background: #120d09;
}

.route-app {
  min-height: 100vh;
  padding-top: 56px;
}

.route-app:has(.route-auth) {
  padding-top: 0;
}

.route-app a {
  color: inherit;
}

.route-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(180px, 0.55fr) auto;
  gap: 14px;
  align-items: center;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-context {
  display: flex;
  gap: 14px;
  align-items: center;
}

.route-brand {
  display: inline-grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  text-decoration: none;
}

.route-brand strong,
.route-brand em {
  display: block;
}

.route-brand em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.route-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.route-nav a,
.docs-nav a,
.settings-link-list a,
.route-tabs a {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.route-nav a.active,
.docs-nav a.active,
.route-tabs a:hover,
.settings-link-list a:hover {
  background: var(--green-soft);
  color: var(--green);
}

.workspace-jump {
  display: grid;
  gap: 4px;
}

.workspace-jump span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-jump select {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.route-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.route-context-summary {
  display: grid;
  gap: 2px;
  justify-self: end;
  text-align: right;
}

.route-context-summary span,
.route-context-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-context-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-context-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.status-pill {
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.preview-pill {
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
  background: var(--amber-soft);
  color: var(--amber);
}

.route-main {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.route-header > *,
.route-main,
.route-hero,
.route-title,
.route-section,
.route-panel,
.launcher-card,
.route-project-card {
  min-width: 0;
}

.route-auth {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(280px, 480px) minmax(260px, 360px);
  gap: 16px;
  width: min(100%, 880px);
}

.route-auth .auth-panel {
  width: 100%;
}

.auth-primary-panel {
  align-content: start;
}

.auth-preview-panel {
  align-content: center;
  border-color: color-mix(in srgb, var(--green) 34%, var(--line));
  background:
    linear-gradient(145deg, var(--surface), var(--green-soft)),
    var(--surface);
}

.auth-preview-panel h2 {
  margin: 0;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
}

.auth-recovery {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.auth-recovery .link-action {
  min-height: 28px;
  padding: 0 3px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.route-hero,
.route-title,
.compact-setup,
.route-section,
.route-panel,
.launcher-card,
.route-project-card,
.route-metric,
.docs-article,
.docs-nav {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.route-hero,
.route-title,
.compact-setup {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 22px;
  box-shadow: var(--shadow);
}

.route-hero h1,
.route-title h1,
.docs-article h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.05;
}

.route-hero p,
.route-title p,
.compact-setup p,
.route-panel p,
.launcher-card p,
.route-project-card p,
.muted-copy,
.docs-article p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.route-hero-actions,
.route-title-actions,
.compact-setup-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.route-title-actions .scoped-actions {
  display: contents;
}

.scoped-actions,
.launcher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.scoped-actions .primary-action,
.scoped-actions .secondary-action,
.launcher-actions .secondary-action,
.launcher-actions .link-action {
  width: auto;
}

.route-section {
  margin-top: 16px;
  padding: 18px;
}

.workspace-selection-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 16px;
  align-items: center;
}

.workspace-selection-panel h2 {
  margin: 0;
}

.workspace-selection-control {
  align-self: center;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.section-heading h2,
.route-panel h2,
.launcher-card h3,
.route-project-card h3,
.compact-setup h2,
.docs-article h2 {
  margin: 0;
  line-height: 1.18;
}

.launcher-grid,
.route-project-grid,
.metric-grid,
.admin-action-grid {
  display: grid;
  gap: 12px;
}

.launcher-grid,
.route-project-grid,
.admin-action-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.launcher-card,
.route-project-card,
.route-metric,
.route-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.route-project-card {
  align-content: space-between;
}

.route-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-card-metrics span {
  min-height: 26px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.route-metric span,
.route-metric em,
.detail-list span,
.member-list span {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.route-metric strong {
  font-size: 28px;
  line-height: 1;
}

.route-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
  gap: 16px;
}

.route-two-column .route-panel,
.route-two-column .wide-content {
  min-width: 0;
}

.route-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.workspace-browser {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.workspace-browser-nav {
  position: sticky;
  top: 16px;
  align-self: start;
  display: grid;
  gap: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

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

.workspace-nav-group > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workspace-nav-group a,
.resource-link {
  display: grid;
  gap: 2px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.workspace-nav-group a:hover,
.workspace-nav-group a:focus-visible,
.resource-link:hover,
.resource-link:focus-visible {
  background: var(--green-soft);
  color: var(--green);
}

.workspace-nav-group em,
.resource-link span {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.workspace-browser-main {
  min-width: 0;
}

.compact-project-grid .route-project-card {
  min-height: 190px;
}

.resource-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.settings-nav {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.settings-nav a {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.settings-nav a:hover,
.settings-nav a:focus-visible {
  background: var(--green-soft);
  color: var(--green);
}

.settings-content {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.settings-section {
  scroll-margin-top: 18px;
}

.settings-section .account-metrics {
  margin-bottom: 12px;
}

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

.permission-card-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.permission-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.permission-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.project-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 336px);
  gap: 16px;
  align-items: start;
}

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

.project-tool-dock {
  position: sticky;
  top: 16px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-tool-rail {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 8px;
  border-right: 1px solid var(--line);
  background: var(--surface-2);
}

.tool-button {
  position: relative;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tool-button:hover,
.tool-button:focus-visible,
.tool-button.active {
  background: var(--green-soft);
  color: var(--green);
  outline: none;
}

.tool-button:focus-visible {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--green) 34%, transparent);
}

.tool-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.project-tool-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.project-tool-panel h2 {
  margin: 0;
  font-size: 18px;
}

.tool-panel-list {
  display: grid;
  gap: 8px;
}

.tool-panel-list div,
.tool-panel-list a {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: inherit;
  text-decoration: none;
}

.tool-panel-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.tool-search {
  display: grid;
  gap: 6px;
}

.tool-search span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.tool-search input,
.tool-search textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.compact-storage {
  max-width: 100%;
  overflow-x: auto;
}

.view-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.view-toggle a {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.view-toggle a.active,
.view-toggle a:hover,
.view-toggle a:focus-visible {
  background: var(--surface);
  color: var(--green);
}

.project-detail-list {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-detail-header,
.project-detail-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.8fr) minmax(170px, 1fr) minmax(120px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
}

.project-detail-header {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.project-detail-row {
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}

.project-detail-row:hover,
.project-detail-row:focus-visible {
  background: var(--green-soft);
}

.project-detail-row span {
  min-width: 0;
  color: var(--muted);
}

.project-detail-row strong,
.project-detail-row em {
  display: block;
}

.project-detail-row em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-card-list,
.assessment-route-list,
.activity-list,
.comparison-list,
.member-list,
.detail-list,
.settings-link-list,
.docs-layer-list {
  display: grid;
  gap: 10px;
}

.document-review-card,
.activity-row,
.comparison-row,
.assessment-route-list div,
.member-list div,
.detail-list div,
.docs-layer-list div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  text-decoration: none;
}

.document-review-card,
.comparison-row {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 0.7fr) auto;
  align-items: center;
}

.comparison-bars {
  display: grid;
  gap: 6px;
}

.comparison-bars span {
  --value: 0;
  display: block;
  overflow: hidden;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green-soft) calc(var(--value) * 1%), var(--surface) 0);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.compact-setup {
  margin-top: 16px;
  background: linear-gradient(135deg, var(--surface), var(--teal-soft));
}

.docs-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 16px;
}

.docs-nav {
  position: sticky;
  top: 78px;
  display: grid;
  align-self: start;
  gap: 4px;
  padding: 12px;
}

.docs-article {
  padding: 28px;
}

.docs-article section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.docs-intro {
  margin-top: 12px !important;
  font-size: 18px;
}

.primary-action,
.secondary-action {
  text-align: center;
  text-decoration: none;
}

.architecture-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.architecture-node {
  display: grid;
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.es-platform[data-theme="dark"] .architecture-node {
  background: var(--surface);
}

.architecture-node span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: var(--plum-soft);
  color: var(--plum);
  font-weight: 900;
}

.layer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.layer-card {
  min-height: 170px;
}

.layer-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.layer-card li {
  margin: 6px 0;
  color: var(--muted);
}

.standards-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.standard-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  padding: 14px;
  background: var(--surface-2);
}

.standard-card span,
.standard-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

@media (max-width: 1180px) {
  .route-header {
    grid-template-columns: minmax(0, 1fr) minmax(160px, auto) auto;
  }

  .workspace-context {
    grid-template-columns: minmax(180px, auto) minmax(180px, 1fr);
  }

  .route-context-summary {
    justify-self: start;
    text-align: left;
  }

  .route-main {
    width: 100%;
  }

  .launcher-grid,
  .route-project-grid,
  .admin-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .docs-nav {
    position: static;
    display: flex;
    flex-wrap: wrap;
  }

  .workspace-browser,
  .settings-layout {
    grid-template-columns: 1fr;
  }

  .workspace-browser-nav,
  .settings-nav {
    position: static;
    display: flex;
    overflow-x: auto;
  }

  .workspace-nav-group {
    min-width: 180px;
  }

  .permission-card-list,
  .resource-link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-shell {
    grid-template-columns: 1fr;
  }

  .platform-sidebar {
    position: static;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .sidebar-footer {
    display: none;
  }

  .dashboard-grid,
  .two-column-screen,
  .viewer-layout,
  .architecture-detail-grid,
  .evidence-layout,
  .export-screen {
    grid-template-columns: 1fr;
  }

  .layer-grid,
  .standards-grid,
  .comment-grid,
  .project-grid,
  .account-grid,
  .api-contract-grid,
  .principle-grid,
  .report-grid,
  .portfolio-grid,
  .starter-grid,
  .access-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .super-admin-command {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .framework-header {
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .framework-header::-webkit-scrollbar {
    display: none;
  }

  .framework-brand,
  .framework-header nav {
    gap: 6px;
    flex: 0 0 auto;
  }

  .framework-brand img {
    width: 20px;
    height: 20px;
  }

  .framework-header a {
    font-size: 13px;
  }

  .framework-header nav a {
    padding-right: 6px;
    padding-left: 6px;
  }

  .route-header,
  .route-hero,
  .route-title,
  .compact-setup,
  .route-two-column,
  .workspace-selection-panel,
  .document-review-card,
  .comparison-row,
  .workspace-context,
  .project-workbench,
  .project-tool-dock {
    grid-template-columns: 1fr;
  }

  .route-header,
  .route-hero,
  .route-title,
  .compact-setup {
    display: grid;
  }

  .route-header {
    position: static;
    width: min(100% - 24px, 720px);
    padding: 12px;
  }

  .route-nav,
  .route-hero-actions,
  .route-title-actions,
  .compact-setup-actions,
  .view-toggle,
  .route-actions,
  .scoped-actions,
  .launcher-actions {
    justify-content: stretch;
  }

  .route-nav a,
  .view-toggle a,
  .route-actions .secondary-action,
  .workspace-jump,
  .workspace-jump select,
  .route-hero-actions .primary-action,
  .route-hero-actions .secondary-action,
  .route-title-actions .primary-action,
  .route-title-actions .secondary-action,
  .scoped-actions .primary-action,
  .scoped-actions .secondary-action,
  .launcher-actions .primary-action,
  .launcher-actions .secondary-action,
  .launcher-actions .link-action,
  .compact-setup-actions .primary-action,
  .compact-setup-actions .secondary-action {
    width: 100%;
  }

  .launcher-grid,
  .route-project-grid,
  .admin-action-grid,
  .metric-grid,
  .route-permissions,
  .permission-card-list,
  .resource-link-grid,
  .settings-launcher-grid {
    grid-template-columns: 1fr;
  }

  .route-main {
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
    padding-top: 16px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    width: min(100%, calc(100vw - 80px));
  }

  .auth-screen,
  .route-auth {
    padding: 14px;
  }

  .route-auth .auth-panel {
    padding: 20px;
  }

  .route-context-summary {
    justify-self: stretch;
    text-align: left;
  }

  .workspace-browser-nav,
  .settings-nav {
    flex-direction: column;
    overflow: visible;
  }

  .workspace-nav-group {
    min-width: 0;
  }

  .project-tool-dock {
    position: static;
  }

  .project-detail-list {
    border: 0;
    gap: 10px;
  }

  .project-detail-header {
    display: none;
  }

  .project-detail-row {
    grid-template-columns: 1fr;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-2);
  }

  .project-tool-rail {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tool-button {
    flex: 0 0 40px;
  }

  .docs-article {
    padding: 18px;
  }

  .workspace-topbar,
  .matrix-controls,
  .viewer-toolbar,
  .evidence-header {
    align-items: stretch;
    flex-direction: column;
  }

  .screen-frame,
  .workspace-topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .screen-nav,
  .kpi-grid,
  .export-stats,
  .layer-grid,
  .standards-grid,
  .comment-grid,
  .project-grid,
  .account-grid,
  .api-contract-grid,
  .principle-grid,
  .report-grid,
  .portfolio-grid,
  .starter-grid,
  .access-layout,
  .context-switchers,
  .permission-card,
  .detail-grid,
  .export-grid,
  .type-strip {
    grid-template-columns: 1fr;
  }

  .nav-item {
    grid-template-columns: 10px 1fr;
  }

  .topbar-cluster {
    justify-content: stretch;
  }

  .topbar-metric,
  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .command-grid {
    grid-template-columns: 1fr;
  }

  .team-card {
    margin-left: 0;
  }

  .pipeline-band,
  .architecture-flow {
    grid-template-columns: repeat(6, 180px);
  }

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

  .filter-cluster {
    grid-template-columns: 1fr;
  }

  .document-canvas {
    min-height: 520px;
    padding: 12px;
  }

  .document-page {
    min-height: 500px;
    padding: 20px;
  }

  .document-page p {
    font-size: 15px;
  }

  .page-table {
    grid-template-columns: 1fr;
  }

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

  .project-card,
  .assessment-mini {
    grid-template-columns: 1fr;
  }

  .gap-actions {
    align-items: flex-start;
    flex-direction: row;
  }

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

@media print {
  .platform-sidebar,
  .workspace-topbar,
  .export-actions,
  .screen-nav {
    display: none !important;
  }

  .platform-shell,
  .export-screen,
  .dashboard-grid,
  .two-column-screen {
    display: block;
  }

  .screen-frame {
    padding: 0;
  }

  .workspace-panel,
  .kpi-card {
    box-shadow: none;
    break-inside: avoid;
  }
}
