/* Layout, chrome and components for Pathwright Services. Colors, type and
   shape come from PathMX theme tokens, so this file works under the Services
   theme (services-theme.css) and under any PathMX preset. */
html {
  background: var(--pmx-color-bg);
}

/* Header: brand on the left, settings and account on the right. There is no
   global menu; each reader sees only their own start (Kairos pattern). */
.services-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-sizing: border-box;
  width: min(100% - 2rem, 84rem);
  min-height: 3.75rem;
  margin-inline: auto;
  border-bottom: 1px solid var(--pmx-color-border);
  background: color-mix(in oklch, var(--pmx-color-bg) 90%, transparent);
  backdrop-filter: blur(0.75rem);
  /* Chrome keeps its own size; it does not scale with the reading text. */
  font-family: var(--pmx-font-body);
  font-size: 0.9375rem;
  line-height: 1.4;
}
.services-view {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}
.services-view > main {
  flex: 1;
  min-width: 0;
  container-type: inline-size;
}

.services-skip {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
  transform: translateY(-200%);
  padding: 0.75rem 1rem;
  border-radius: var(--pmx-radius);
  background: var(--pmx-color-bg);
  color: var(--pmx-color-fg);
}
.services-skip:focus {
  transform: none;
}

.services-nav {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.services-brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.75rem;
  border-radius: var(--pmx-radius-sm);
  color: var(--pmx-color-fg);
  font-family: var(--pmx-font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.services-brand img {
  display: block;
  width: 38px;
  height: 17px;
}
.services-brand-context {
  color: var(--pmx-color-muted);
  font-weight: 500;
}
/* Staff see where they are, and can return to Backstage from any dashboard. */
.services-badge {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--pmx-color-border);
  border-radius: var(--pmx-radius-full);
  color: var(--pmx-color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}
.services-nav-link {
  margin-inline-start: auto;
  padding: 0.4rem 0.7rem;
  border-radius: var(--pmx-radius-full);
  color: var(--pmx-color-muted);
  text-decoration: none;
}
.services-badge:hover,
.services-nav-link:hover {
  background: var(--pmx-color-surface);
  color: var(--pmx-color-fg);
}
.services-account {
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.4rem;
}
.services-sign-in {
  padding: 0.4rem 0.7rem;
  border-radius: var(--pmx-radius-full);
  color: var(--pmx-color-fg);
  font-weight: 600;
  text-decoration: none;
}
.services-sign-in:hover {
  background: var(--pmx-color-surface);
}
/* Account menu: a native disclosure, so it works without scripts. */
.services-menu {
  position: relative;
}
.services-menu > summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--pmx-color-border);
  border-radius: var(--pmx-radius-full);
  color: var(--pmx-color-fg);
  cursor: pointer;
  list-style: none;
}
.services-menu > summary::-webkit-details-marker {
  display: none;
}
.services-menu > summary:hover,
.services-menu[open] > summary {
  background: var(--pmx-color-surface);
}
.services-menu-name {
  max-width: 10rem;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.services-menu > nav {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 60;
  display: grid;
  min-width: 15rem;
  padding: 0.35rem;
  border: 1px solid var(--pmx-color-border);
  border-radius: var(--pmx-radius);
  background: var(--pmx-color-bg);
  box-shadow: var(--pmx-shadow-lg);
}
.services-menu > nav :is(a, button) {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: var(--pmx-radius-md);
  background: none;
  color: var(--pmx-color-fg);
  cursor: pointer;
  font: inherit;
  text-align: start;
  text-decoration: none;
}
.services-menu > nav :is(a, button):hover {
  background: var(--pmx-color-surface);
}
.services-menu > nav svg {
  flex: none;
  color: var(--pmx-color-muted);
}
.services-menu > nav form {
  margin: 0;
  border-top: 1px solid var(--pmx-color-border);
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}
.services-header a:focus-visible,
.pmx-document a:focus-visible {
  outline: 2px solid var(--pmx-color-focus);
  outline-offset: 3px;
}

/* Dashboard breadcrumb, in the Pathwright daily Paths pattern: each step is a
   link, and its chevron (or hovering it) opens what that level holds. */
.services-crumbs {
  position: relative;
  max-width: var(--services-column);
  margin: 1.5rem auto 0;
  padding-inline: max(1rem, var(--pmx-prose-gutter));
  color: var(--pmx-color-muted);
}
/* The column is measured in the document's type, so only the list is smaller. */
.services-crumbs > ol {
  font-size: 0.875rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.services-crumb {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.1rem;
}
.services-crumb + .services-crumb::before {
  content: "›";
  margin-inline-end: 0.35rem;
  opacity: 0.6;
}
.services-crumb-link {
  color: inherit;
  text-decoration: none;
}
.services-crumb:first-child > .services-crumb-link {
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, currentColor 40%, transparent);
  text-underline-offset: 0.25em;
}
.services-crumb-link:hover {
  color: var(--pmx-color-fg);
}
.services-crumb-link[aria-current="page"] {
  color: var(--pmx-color-fg);
}
.services-crumb-menu {
  position: static;
}
.services-crumb-menu > summary {
  min-height: 1.75rem;
  padding: 0 0.3rem;
  border: 0;
  border-radius: var(--pmx-radius-md);
  color: var(--pmx-color-muted);
}
.services-crumb-menu > nav {
  left: 0;
  right: auto;
  width: min(21rem, calc(100vw - 2rem));
  min-width: 0;
  max-height: min(70dvh, 32rem);
  overflow-y: auto;
  padding: 0.6rem;
  font-size: 0.9375rem;
}
.services-crumb-menu > nav > a {
  color: var(--pmx-color-muted);
  line-height: 1.35;
}
.services-crumb-menu > nav > a:hover {
  color: var(--pmx-color-fg);
}
.services-crumb-menu > nav > .services-crumb-heading {
  color: var(--pmx-color-fg);
  font-weight: 600;
}
.services-crumb-menu > nav > a[aria-current="page"],
.services-crumb-menu > nav > a[data-in-trail] {
  background: color-mix(in oklch, var(--pmx-color-accent) 10%, transparent);
  color: var(--pmx-color-fg);
  font-weight: 600;
}
.services-crumb-label {
  margin: 0.5rem 0 0;
  padding: 0.6rem 0.65rem 0.3rem;
  border-top: 1px solid var(--pmx-color-border);
  color: var(--pmx-color-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
/* On a narrow screen every menu opens full width under the breadcrumb. */
@media (max-width: 40rem) {
  .services-crumb {
    position: static;
  }
  .services-crumb-menu > nav {
    left: max(1rem, var(--pmx-prose-gutter));
    right: max(1rem, var(--pmx-prose-gutter));
    width: auto;
  }
}

/* The quiet link to the public services menu. */
.pmx-document .pmx-prose .services-more {
  font-size: 0.85rem;
}
.pmx-document .pmx-prose .services-more a {
  color: var(--pmx-color-muted);
  text-decoration: none;
}
.pmx-document .pmx-prose .services-more a:hover {
  color: var(--pmx-color-fg);
  text-decoration: underline;
}

/* One column width shared by the breadcrumb and the document. Dashboards need
   room for cards, so they never go narrower than 55rem even when a theme
   chooses a tighter reading measure. */
:root {
  --services-column: var(--pmx-document-measure);
}
:root:has(.project-card, .client-grid) {
  --services-column: max(var(--pmx-document-measure), 55rem);
}
.services-view .pmx-document {
  max-width: var(--services-column);
  padding-block: 1.5rem 5rem;
}
.pmx-source-references {
  --pmx-source-reference-width: clamp(22rem, 34vw, 30rem);
}
html[data-pmx-source-mounted] .pmx-document {
  padding: 32px 24px 48px;
  font-size: 15px;
}
html[data-pmx-source-mounted] .pmx-document .pmx-prose h1 {
  margin-bottom: 2rem;
  font-size: clamp(32px, 8vw, 44px);
}
@media (max-width: 809px) {
  .services-view .pmx-document {
    padding-block-end: 4rem;
  }
}

/* On phones the account icon alone stands in for the name. */
@media (max-width: 480px) {
  .services-menu-name {
    display: none;
  }
}

/* Signing a project scope: where it stands, and the form only while it can be signed. */
.agreement-status {
  margin-block: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--pmx-color-border);
  border-radius: var(--pmx-radius);
  background: var(--pmx-color-surface);
  font-size: 0.9375rem;
}
.pmx-document .agreement-status p {
  margin: 0;
}
.pmx-document .agreement-status p + p {
  margin-top: 0.35rem;
}
.agreement-status[data-state="signed"] {
  border-color: color-mix(in oklch, var(--pmx-color-success) 45%, var(--pmx-color-border));
}
[data-pmx-block]:has(.agreement-status:not([data-state="issued"])) :is(.pmx-field, .input-option, .input-submit),
section:has(> div > .agreement-status:not([data-state="issued"])) :is(.pmx-field, .input-option, .input-submit) {
  display: none;
}

/* The top of a signed record. */
.agreement-record {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--pmx-color-border);
  border-radius: var(--pmx-radius);
  background: var(--pmx-color-surface);
  font-size: 0.9375rem;
}
.agreement-record > div {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.75rem;
}
.agreement-record dt {
  color: var(--pmx-color-muted);
}
.agreement-record dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 480px) {
  .agreement-record > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}

/* A lone email link in a paragraph is a call to action. */
.pmx-document .pmx-prose p:has(> a[href^="mailto:"]:only-child) {
  margin-top: 3rem;
}
.pmx-document .pmx-prose p > a[href^="mailto:"]:only-child {
  display: inline-flex;
  align-items: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border-radius: 999px;
  background: var(--pmx-color-accent);
  color: var(--pmx-color-on-accent);
  font-family: var(--pmx-font-body);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}
.pmx-document .pmx-prose p > a[href^="mailto:"]:only-child:hover {
  background: var(--pmx-color-fg);
  color: var(--pmx-color-on-accent);
}

/* Review navigation belongs to the projection, outside the authored passage. */
.pmx-document .pmx-prose .ijm-review-links {
  margin-block: 1rem;
  padding: .65rem .9rem;
  border-inline-start: 3px solid var(--pmx-color-accent);
  background: var(--services-raised);
  font-size: 14px;
  line-height: 1.5;
}
.pmx-document .pmx-prose .ijm-review-links p {
  margin: 0;
}

.pmx-document [id^="pw-b-"]:target {
  outline: 2px solid var(--pmx-color-accent);
  outline-offset: .6rem;
  scroll-margin-block-start: 1.5rem;
}

/* Staff client directory and partner dashboard home pages. */
.client-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin-top:24px}
.pmx-prose .client-card{display:flex;flex-direction:column;gap:14px;min-width:0;padding:26px;border:1px solid var(--pmx-color-border);border-radius:18px;background:var(--pmx-color-surface);color:var(--pmx-color-fg);text-decoration:none}
.pmx-prose .client-card:hover{border-color:var(--pmx-color-accent);background:var(--services-raised)}
.pmx-prose .client-card h2{font-size:25px;line-height:1.2;margin:0}
.pmx-prose .client-card p{margin:0;color:var(--services-soft);font-size:16px;line-height:1.5}
.client-card-label,.client-card-open{font-size:13px;font-weight:700}
.client-card-label{text-transform:uppercase;letter-spacing:.08em;color:var(--pmx-color-muted)}
.client-card-open{margin-top:auto;color:var(--pmx-color-accent)}
.pmx-document:has(.client-grid) .pmx-prose{max-width:none}
@media(max-width:700px){.client-grid{grid-template-columns:1fr}}

.pmx-document .pmx-prose .client-card{text-decoration:none}
.pmx-document .pmx-prose .client-card h2{margin:0;padding:0;border:0}
.pmx-document:has(.client-grid) .pmx-prose>h2,.pmx-document:has(.client-grid) .pmx-prose>.pmx-heading:has(h2){margin:0 0 24px;padding:0;border:0}
.pmx-document:has(.client-grid) .pmx-prose h2{font-size:27px;margin:0;padding:0;border:0}

/* Headings inside cards are not top-level prose, so name their typeface here. */
.client-card h2,
.project-card h2 {
  font-family: var(--pmx-font-heading);
}

/* Partner dashboard components (dashboard.components.md). */
.pmx-document:has(.project-card) .pmx-prose {
  max-width: none;
}
.project-card {
  margin-top: 32px;
  padding: 32px;
  border: 1px solid var(--pmx-color-border);
  border-radius: 18px;
  background: var(--pmx-color-surface);
}
.pmx-document .project-card .project-card-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pmx-color-accent) 16%, transparent);
  color: color-mix(in oklch, var(--pmx-color-accent) 55%, var(--pmx-color-fg));
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.project-card-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pmx-color-accent);
}
.pmx-document .project-card .project-card-status:empty {
  display: none;
}
.pmx-document .project-card h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: clamp(26px, 3.2vw, 32px);
  line-height: 1.2;
}
/* A card under a page section heading may title its project with an h3. */
.pmx-document .project-card > :is(.project-card-status + .pmx-heading.level-h3, .pmx-heading.level-h3:first-child) h3 {
  margin: 0 0 10px;
  color: var(--pmx-color-fg);
  font-family: var(--pmx-font-heading);
  font-size: clamp(22px, 2.6vw, 26px);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-transform: none;
}
.pmx-document .project-card h3 {
  margin: 32px 0 10px;
  color: var(--pmx-color-muted);
  font-family: var(--pmx-font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.pmx-document .project-card :is(p, ul, ol) {
  margin-block: 0 .75rem;
}
.pmx-document .project-card li {
  margin-block: .4rem;
}
.pmx-document .project-card > :last-child,
.pmx-document .status-panel > :last-child {
  margin-bottom: 0;
}
.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}
.status-panel {
  padding: 20px;
  border-radius: 12px;
  background: var(--services-raised);
  font-size: 15px;
  line-height: 1.55;
}
.pmx-document .status-panel h3 {
  margin: 0 0 12px;
  color: var(--pmx-color-muted);
  font-family: var(--pmx-font-body);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  text-transform: uppercase;
}
@media (max-width: 700px) {
  .project-card {
    padding: 20px;
  }
  .status-grid {
    grid-template-columns: 1fr;
  }
}
