/* SupplyFlow experience layer. This is the active visual contract shared by
   public pages and workspaces; older component rules remain only as fallback
   until their behavior is migrated and audited. */
:root {
  --sf-color-ink: #17211d;
  --sf-color-muted: #5f6d66;
  --sf-color-line: #d8e1db;
  --sf-color-canvas: #f5f7f6;
  --sf-color-surface: #ffffff;
  --sf-color-primary: #126b4e;
  --sf-color-primary-soft: #eaf3ee;
  --sf-color-accent: #b35931;
  --sf-font-body: 14px;
  --sf-font-small: 12px;
  --sf-font-title: 24px;
  --sf-font-section: 17px;
  --sf-space-1: 4px;
  --sf-space-2: 8px;
  --sf-space-3: 12px;
  --sf-space-4: 16px;
  --sf-space-5: 20px;
  --sf-radius: 6px;
}

body.sf-unified-page {
  background: var(--sf-color-canvas);
  color: var(--sf-color-ink);
  font-size: var(--sf-font-body);
  line-height: 1.5;
}

body.sf-unified-page .community-main,
body.sf-unified-page .community-detail {
  max-width: 1480px;
  padding: 24px clamp(16px, 2.5vw, 32px) 56px;
}

body.sf-unified-page h1,
body.sf-unified-page .community-home-hero h1,
body.sf-unified-page .community-discovery-intro h1,
body.sf-unified-page .community-dashboard-page-head h1 {
  font-size: var(--sf-font-title);
  line-height: 1.3;
  margin: 0;
}

body.sf-unified-page h2,
body.sf-unified-page .community-section-head h2,
body.sf-unified-page .community-dashboard-section h2 {
  font-size: var(--sf-font-section);
  line-height: 1.35;
  margin: 0;
}

body.sf-unified-page .community-kicker {
  font-size: 11px;
  letter-spacing: 0;
  margin-bottom: 5px;
}

body.sf-unified-page .community-button {
  border-radius: var(--sf-radius);
  font-size: 13px;
  min-height: 40px;
}

body.sf-unified-page input,
body.sf-unified-page select,
body.sf-unified-page textarea {
  font-size: 16px;
}

body.sf-unified-page .community-toolbar,
body.sf-unified-page .community-discovery-intro,
body.sf-unified-page .community-home-hero,
body.sf-unified-page .community-detail-header,
body.sf-unified-page .community-detail-body,
body.sf-unified-page .community-card,
body.sf-unified-page .community-result-row,
body.sf-unified-page .community-manage-panel {
  border-radius: var(--sf-radius);
  box-shadow: none;
}

/* Home: real public records precede counts and product explanation. */
body.sf-unified-page .community-main.community-home {
  display: grid;
  gap: 20px;
}

body.sf-unified-page .sf-home-intro {
  background: var(--sf-color-surface);
  border: 1px solid var(--sf-color-line);
  border-radius: var(--sf-radius);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.7fr);
  padding: 22px 24px;
}

body.sf-unified-page .sf-home-copy p:last-child {
  color: var(--sf-color-muted);
  margin: 7px 0 0;
  max-width: 64ch;
}

body.sf-unified-page .sf-home-search {
  align-self: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

body.sf-unified-page .sf-home-search input {
  background: #fff;
  border: 1px solid #bdcbc2;
  border-radius: var(--sf-radius);
  min-width: 0;
  padding: 8px 12px;
  width: 100%;
}

body.sf-unified-page .sf-home-search .community-button {
  flex: 0 0 auto;
  min-width: 52px;
  white-space: nowrap;
  width: auto;
  word-break: keep-all;
  writing-mode: horizontal-tb;
}

body.sf-unified-page .sf-home-shortcuts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 1 / -1;
}

body.sf-unified-page .sf-home-shortcuts a {
  background: var(--sf-color-primary-soft);
  border-radius: 999px;
  color: #174b39;
  font-size: 12px;
  font-weight: 700;
  min-height: 32px;
  padding: 7px 12px;
  text-decoration: none;
}

body.sf-unified-page .sf-home-shortcuts a:hover,
body.sf-unified-page .sf-home-shortcuts a:focus-visible {
  background: #dcebe1;
  outline: 2px solid var(--sf-color-primary);
  outline-offset: 1px;
}

body.sf-unified-page .sf-home-feed-status {
  color: var(--sf-color-muted);
  font-size: var(--sf-font-small);
  margin: -8px 0;
  min-height: 18px;
}

body.sf-unified-page .sf-home-feed-section {
  min-width: 0;
}

body.sf-unified-page .sf-home-feed-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
}

body.sf-unified-page .sf-home-feed-heading a {
  color: var(--sf-color-primary);
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  padding: 9px 2px 7px 10px;
  text-decoration: none;
}

body.sf-unified-page .sf-home-feed-list {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

body.sf-unified-page .sf-home-feed-list[aria-busy="true"] {
  opacity: .68;
}

body.sf-unified-page .sf-home-feed-item {
  background: var(--sf-color-surface);
  border: 1px solid var(--sf-color-line);
  border-radius: var(--sf-radius);
  min-width: 0;
  padding: 13px 14px;
}

body.sf-unified-page .sf-home-feed-kind {
  color: var(--sf-color-primary);
  display: block;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

body.sf-unified-page .sf-home-feed-item h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

body.sf-unified-page .sf-home-feed-item h3 a {
  color: var(--sf-color-ink);
  text-decoration: none;
}

body.sf-unified-page .sf-home-feed-item h3 a:hover,
body.sf-unified-page .sf-home-feed-item h3 a:focus-visible {
  color: var(--sf-color-primary);
  text-decoration: underline;
}

body.sf-unified-page .sf-home-feed-meta,
body.sf-unified-page .sf-home-feed-summary {
  color: var(--sf-color-muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

body.sf-unified-page .sf-home-feed-summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

body.sf-unified-page .sf-home-feed-empty {
  background: var(--sf-color-surface);
  border: 1px dashed var(--sf-color-line);
  border-radius: var(--sf-radius);
  color: var(--sf-color-muted);
  font-size: 12px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 13px 14px;
}

/* Lists remain full-width; query controls are owned by /search/. */
body.sf-unified-page.community-discovery-list-page .community-discovery-layout {
  margin-top: 14px;
}

body.sf-unified-page.community-discovery-list-page .community-discovery-intro {
  align-items: center;
  background: transparent;
  border: 0;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 0;
}

body.sf-unified-page.community-discovery-list-page .community-discovery-intro p:last-child {
  font-size: 13px;
  margin-top: 5px;
}

body.sf-unified-page.community-discovery-list-page .community-discovery-results {
  margin-top: 0;
}

body.sf-unified-page .community-result-row {
  border-radius: var(--sf-radius);
  gap: 12px;
  padding: 12px 14px;
}

body.sf-unified-page .community-result-row h3 {
  font-size: 14px;
}

body.sf-unified-page .community-result-row-meta,
body.sf-unified-page .community-result-row-spec {
  font-size: 11px;
}

/* Progressive disclosure in role-specific offering forms. */
body.platform-surface .role-module-form-disclosure {
  background: #fff;
  border: 1px solid var(--line, #d8e1db);
  border-radius: 6px;
  grid-column: 1 / -1;
  margin: 0;
  min-width: 0;
}

body.platform-surface .role-module-form-disclosure > summary {
  align-items: center;
  color: var(--text, #17211d);
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: space-between;
  list-style-position: inside;
  min-height: 46px;
  padding: 10px 14px;
}

body.platform-surface .role-module-form-disclosure > summary::marker {
  color: var(--primary, #126b4e);
}

body.platform-surface .role-module-form-disclosure > summary span {
  color: var(--muted, #5f6d66);
  font-size: 11px;
  font-weight: 500;
  margin-left: 12px;
}

body.platform-surface .role-module-form-disclosure[open] > summary {
  border-bottom: 1px solid var(--line, #d8e1db);
}

body.platform-surface .role-module-form-disclosure-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

body.platform-surface .role-module-form-disclosure-body .role-module-field-group,
body.platform-surface .role-module-form-disclosure-body .role-module-structured-group {
  margin-top: 0;
}

body.platform-surface .role-module-quick-note {
  color: var(--muted, #5f6d66);
  font-size: 12px;
  grid-column: 1 / -1;
  margin: -2px 0 0;
}

body.platform-surface .role-module-repeat-row {
  overflow-x: auto;
}

@media (max-width: 640px) {
  body.sf-unified-page .community-main,
  body.sf-unified-page .community-detail {
    padding: 16px 14px calc(72px + env(safe-area-inset-bottom));
  }

  body.sf-unified-page h1,
  body.sf-unified-page .community-home-hero h1,
  body.sf-unified-page .community-discovery-intro h1,
  body.sf-unified-page .community-dashboard-page-head h1 {
    font-size: 21px;
  }

  body.sf-unified-page .sf-home-intro {
    gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    padding: 17px 15px;
  }

  body.sf-unified-page .sf-home-search {
    grid-row: 2;
  }

  body.sf-unified-page .sf-home-search .community-button {
    flex: 0 0 auto;
  }

  body.sf-unified-page .sf-home-shortcuts {
    flex-wrap: nowrap;
    grid-column: auto;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  body.sf-unified-page .sf-home-shortcuts a {
    flex: 0 0 auto;
  }

  body.sf-unified-page .sf-home-feed-list {
    grid-template-columns: minmax(0, 1fr);
  }

  body.sf-unified-page .sf-home-feed-item {
    padding: 12px;
  }

  body.sf-unified-page.community-discovery-list-page .community-discovery-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  body.platform-surface .role-module-form-disclosure > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  body.platform-surface .role-module-form-disclosure > summary span {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.sf-unified-page *,
  body.platform-surface * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
