/* Synapse Build 3.1 Surface Composition Correction
   buildId: synapse-build3-1-public-protected-surface-composition-v1
   Purpose: apply product-surface composition fixes after Build 2.4 CSS readmission.
   Boundary: visual/layout and protected landing preparation only. No old platform,
   cover, veil, diagnostics, RuntimeDomainLoader, app-runtime-kernel, or old action-host
   authority is admitted by this file.
*/

:root {
  --synapse-3-surface-composition: 'build3.1-public-protected-surface-composition';
  --syn-3-footer-field: color-mix(in srgb, var(--field, #eef8ef) 86%, white 14%);
  --syn-3-card-gutter: clamp(1.35rem, 4.4vw, 2.35rem);
  --syn-3-tight-card-gutter: clamp(1.05rem, 3vw, 1.55rem);
  --syn-3-protected-radius: clamp(1.1rem, .95rem + .5vw, 1.65rem);
}

/* Public page field should resolve back into the clinical green field, not a loose cream bottom. */
html {
  background: var(--field, #eef8ef) !important;
}

body[data-public-chamber-shell='soft-active'] {
  background:
    radial-gradient(circle at top left, rgba(184,135,66,.14), transparent 32rem),
    linear-gradient(180deg, var(--field, #eef8ef) 0%, #f6fbf6 52%, var(--field, #eef8ef) 100%) !important;
}

body[data-public-chamber-shell='soft-active'] .site-footer {
  background:
    linear-gradient(180deg, rgba(238,248,239,.98), var(--syn-3-footer-field)) !important;
  border-top-color: color-mix(in srgb, var(--teal, #0b506c) 16%, transparent) !important;
  box-shadow: inset 0 1px 0 rgba(255,253,248,.7) !important;
}

/* The index-v2 access panel is a route-support card, not a tall hero sidecar. */
body[data-public-chamber-shell='soft-active'] .access-card.route-panel {
  align-self: start !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  gap: .58rem !important;
  padding: clamp(1rem, 1.45vw, 1.3rem) !important;
}

body[data-public-chamber-shell='soft-active'] .access-card.route-panel .access-card__label {
  margin-bottom: .28rem !important;
}

body[data-public-chamber-shell='soft-active'] .access-card.route-panel h2 {
  margin-bottom: .42rem !important;
}

body[data-public-chamber-shell='soft-active'] .access-card.route-panel p {
  margin-block: 0 !important;
}

body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card {
  margin-top: .72rem !important;
  margin-bottom: 0 !important;
}

body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card img {
  max-height: clamp(7.4rem, 18vh, 11.4rem) !important;
  object-position: center 40% !important;
}

/* Restore inner gutters where new index-v2 panels placed text too close to the frame. */
body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .diagram-panel.panel-card {
  padding: clamp(.9rem, 2.4vw, 1.35rem) !important;
}

body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .diagram-panel__copy {
  padding-inline: var(--syn-3-card-gutter) !important;
  padding-block: clamp(.85rem, 2.4vw, 1.35rem) !important;
  align-content: center !important;
}

body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .panel-kicker,
body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .panel-summary,
body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .panel-chip-list {
  margin-inline: 0 !important;
}

body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .panel-summary {
  max-width: 42rem !important;
}

body[data-public-chamber-shell='soft-active'] .closing-panel {
  padding: clamp(1.35rem, 4vw, 2.25rem) !important;
  gap: clamp(.85rem, 2vw, 1.4rem) !important;
}

body[data-public-chamber-shell='soft-active'] .closing-panel__actions {
  margin-top: .15rem !important;
  gap: .72rem !important;
}

body[data-public-chamber-shell='soft-active'] .button--solid {
  color: #fffdf8 !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.18) !important;
}

body[data-public-chamber-shell='soft-active'] .button--solid:visited {
  color: #fffdf8 !important;
}

@media (min-width: 980px) {
  body[data-public-chamber-shell='soft-active'] .hero {
    grid-template-columns: minmax(0, 1.02fr) minmax(17rem, .48fr) !important;
  }
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card img {
    max-height: 9.2rem !important;
  }
}

@media (max-width: 860px) {
  body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .diagram-panel__copy {
    padding-inline: clamp(1.25rem, 5.2vw, 1.75rem) !important;
    padding-block: 1.05rem !important;
  }
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel {
    gap: .48rem !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) and (max-width: 980px) {
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel {
    padding: .82rem !important;
    gap: .36rem !important;
  }
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card {
    margin-top: .42rem !important;
  }
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card img {
    max-height: 5.8rem !important;
  }
  body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .diagram-panel.panel-card {
    padding: .72rem !important;
  }
  body[data-public-chamber-shell='soft-active'] .surface-diagram-shell .diagram-panel__copy {
    padding-inline: 1.05rem !important;
    padding-block: .72rem !important;
  }
}

@media (orientation: landscape) and (max-height: 460px) and (max-width: 900px) {
  body[data-public-chamber-shell='soft-active'] .access-card.route-panel .page-media-card {
    display: none !important;
  }
}

/* Protected landing cleanup: no app-install dead-end; show current backend intent and future chamber actions. */
body[data-portal-route],
body[data-workspace-route] {
  background:
    radial-gradient(circle at 8% 0%, rgba(184,135,66,.12), transparent 28rem),
    linear-gradient(180deg, #eef8ef 0%, #f6fbf6 48%, #eef8ef 100%) !important;
}

body[data-portal-route] .app-header,
body[data-workspace-route] .app-header {
  background: rgba(255,253,246,.94) !important;
  box-shadow: 0 .7rem 1.5rem rgba(23,38,58,.055) !important;
}

body[data-portal-route] .panel,
body[data-portal-route] .status-panel,
body[data-portal-route] .route-card,
body[data-workspace-route] .panel,
body[data-workspace-route] .status-panel,
body[data-workspace-route] .route-card,
body[data-workspace-route] .list-panel,
body[data-workspace-route] .stat-card {
  border-radius: var(--syn-3-protected-radius) !important;
}

.protected-surface-note {
  margin: 1rem 0 0;
  border: 1px solid rgba(11,80,108,.14);
  border-radius: 1.15rem;
  padding: .85rem 1rem;
  background: linear-gradient(180deg, rgba(238,248,239,.92), rgba(255,253,246,.9));
  color: var(--syn-muted, #637385);
  line-height: 1.45;
}

.protected-surface-note strong {
  color: var(--syn-teal, #0b506c);
}

.route-card[data-route-state='coming-online'] {
  cursor: default;
  background: linear-gradient(180deg, rgba(255,253,246,.96), rgba(238,248,239,.78)) !important;
}

.route-card[data-route-state='coming-online'] h2::after {
  content: 'Coming online';
  display: inline-flex;
  margin-left: .45rem;
  vertical-align: middle;
  border-radius: 999px;
  padding: .22rem .46rem;
  background: rgba(11,80,108,.08);
  color: var(--syn-teal, #0b506c);
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.route-card[data-action-window] {
  position: relative;
}

.route-card[data-action-window]::before {
  content: 'Action Chamber';
  display: inline-flex;
  margin-bottom: .55rem;
  border-radius: 999px;
  padding: .25rem .55rem;
  background: rgba(184,135,66,.13);
  color: #7a5426;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.route-card[data-staff-route='true'] {
  border-color: rgba(11,80,108,.22) !important;
}

body[data-portal-route] .header-actions .button,
body[data-workspace-route] .header-actions .button {
  min-height: 2.32rem;
}

body[data-portal-route] .workspace-footer,
body[data-workspace-route] .workspace-footer {
  background: var(--syn-3-footer-field) !important;
}

@media (max-width: 820px) {
  body[data-portal-route] .header-actions,
  body[data-workspace-route] .header-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-portal-route] .header-actions .button,
  body[data-workspace-route] .header-actions .button {
    min-width: 0;
    padding-inline: .65rem;
  }
}


/* Build 3.12 — Protected Header Density Correction late composition override
   Loaded after the base workspace CSS so earlier two-column mobile header rules
   cannot keep the authenticated header oversized. */
@media (max-width: 820px) {
  body[data-workspace-route] .app-header,
  body[data-portal-route] .app-header,
  body[data-client-route] .app-header {
    gap: .46rem !important;
    padding: .56rem clamp(.72rem,3.5vw,1rem) .62rem !important;
  }
  body[data-workspace-route] .header-actions,
  body[data-portal-route] .header-actions,
  body[data-client-route] .header-actions {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(4.75rem, 1fr)) !important;
    gap: .38rem !important;
    width: 100% !important;
    align-items: center !important;
  }
  body[data-workspace-route] .header-actions .button,
  body[data-portal-route] .header-actions .button,
  body[data-client-route] .header-actions .button {
    min-width: 0 !important;
    width: 100% !important;
    min-height: 2.2rem !important;
    padding: .46rem .46rem !important;
    font-size: .82rem !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }
}
@media (max-width: 380px) {
  body[data-workspace-route] .header-actions,
  body[data-portal-route] .header-actions,
  body[data-client-route] .header-actions {
    grid-template-columns: repeat(auto-fit, minmax(4.35rem, 1fr)) !important;
    gap: .32rem !important;
  }
  body[data-workspace-route] .header-actions .button,
  body[data-portal-route] .header-actions .button,
  body[data-client-route] .header-actions .button {
    min-height: 2.05rem !important;
    padding: .42rem .32rem !important;
    font-size: .77rem !important;
  }
}
