/* OD MarketSpace — account pages and public listings.
   Figma: Catalog — OD MarketSpace (page) and Catalog — Design system › Components / MarketSpace. */

/* Account pages */
.msa {
  display: flex;
  flex-direction: column;
  gap: var(--sp-32);
  padding-bottom: 96px;
}
.msa-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.msa-head__copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 760px;
}
.msa-head--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.msa-head__editing {
  display: flex;
  align-items: baseline;
  gap: 19px;
}
.msa-editing {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pcli-color-text-eyebrow);
}
.status--live {
  background: var(--pcli-color-action-selected);
  color: #fff;
}
.msa-empty {
  padding: 24px 0;
}
.msa-table td {
  vertical-align: middle;
}
.msa-col-status {
  width: 150px;
}
.msa-col-resp {
  width: 120px;
}
.msa-col-act {
  width: 390px;
}
.msa-post {
  display: flex;
  align-items: center;
  gap: 20px;
}
.msa-post__thumb {
  flex: 0 0 88px;
  height: 66px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--pcli-color-bg-muted);
}
.msa-post__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.msa-post__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.msa-post__name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--pcli-color-text-primary);
}
.msa-post__meta {
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-secondary);
}
.msa-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.msa-actions form {
  margin: 0;
}
.msa-link {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--fs-title-s);
  font-weight: 600;
  color: var(--pcli-color-text-link);
  cursor: pointer;
  text-decoration: none;
}
.msa-link:hover {
  text-decoration: underline;
}
.overline {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pcli-color-text-eyebrow);
}

/* Category card (Figma: MarketSpace / Category card) — "What would you like to post?" (Use=Post) and the public
   entry page (Use=Browse). A photo background (--ms-cat-img, set per card from Globals → MarketSpace settings →
   Category images) under a dark gradient, white text at the bottom. Hover: stronger gradient, orange outline and link. */
.ms-cats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.ms-cat {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  height: 100%;
  min-height: 240px;
  padding: 24px;
  border-radius: 12px;
  background: var(--charcoal-800, #252a2b);
  color: #fff;
  text-decoration: none;
}
.ms-cat::before,
.ms-cat::after {
  content: '';
  position: absolute;
  inset: 0;
}
.ms-cat::before {
  z-index: -2;
  background: var(--ms-cat-img, none) center / cover no-repeat;
}
.ms-cat::after {
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(18, 23, 26, 0.05) 25%, rgba(18, 23, 26, 0.82) 100%);
}
a.ms-cat:hover::after,
a.ms-cat:focus-visible::after {
  background: linear-gradient(180deg, rgba(18, 23, 26, 0.35) 25%, rgba(18, 23, 26, 0.92) 100%);
  box-shadow: inset 0 0 0 2px #ff8c00;
}
a.ms-cat:focus-visible {
  outline: none;
}
.ms-cat__title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
.ms-cat__text {
  font-size: var(--fs-body-s);
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
}
.ms-cat__link {
  padding-top: 6px;
  font-size: var(--fs-title-s);
  font-weight: 600;
  color: #fff;
  transition: color 0.15s;
}
a.ms-cat:hover .ms-cat__link,
a.ms-cat:focus-visible .ms-cat__link {
  color: #ff8c00;
}
/* Not open yet / no listings: greyed photo, dimmed text */
.ms-cat--off {
  cursor: default;
}
.ms-cat--off::before {
  filter: grayscale(1) brightness(1.15);
}
.ms-cat--off::after {
  background: linear-gradient(180deg, rgba(18, 23, 26, 0.05) 25%, rgba(18, 23, 26, 0.6) 100%);
}
.ms-cat--off .ms-cat__title {
  color: rgba(255, 255, 255, 0.8);
}
.ms-cat--off .ms-cat__link {
  color: rgba(255, 255, 255, 0.7);
}

/* Form */
.ms-note {
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: #fbe9e7;
  color: #8a2a1e;
  font-size: var(--fs-body-m);
}
.ms-form {
  display: grid;
  grid-template-columns: 760px minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}
.ms-form__main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}
.ms-sec {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 32px;
  border-top: 1px solid var(--pcli-color-border-default);
}
.ms-sec__head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ms-sec__h {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
.ms-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ms-row--csz {
  grid-template-columns: 1fr 170px 170px;
}
.ms-row--name {
  grid-template-columns: 1fr 1fr 1fr;
}
.ms-row--item {
  grid-template-columns: 1fr 220px;
}
.ms-row--pref {
  grid-template-columns: 1fr 120px;
  margin-top: 8px;
}
.ms-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px dashed var(--pcli-color-border-strong);
  border-radius: 8px;
  background: var(--pcli-color-bg-subtle);
}
.ms-file__name {
  font-size: var(--fs-title-s);
  font-weight: 600;
}
.ms-file__size {
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-tertiary);
}
.ms-file__remove {
  margin-left: auto;
  font-size: var(--fs-body-s);
}
.ms-file__input {
  font-size: var(--fs-body-s);
}
.field__hint {
  margin: 0;
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-tertiary);
}
.field__error {
  margin: 0;
  font-size: var(--fs-body-s);
  font-weight: 600;
  color: #b3261e;
}
.field--error .input,
.field--error .rte {
  border-color: #b3261e;
}
.ms-checks {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.ms-checks .check {
  font-size: var(--fs-body-m);
}

/* Rich text field (MarketSpace / Rich text field) */
.rte {
  border: 1px solid var(--pcli-color-border-input);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.rte:focus-within {
  border-color: var(--pcli-color-border-focus);
  box-shadow: 0 0 0 3px rgba(0, 171, 199, 0.2);
}
.rte__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--pcli-color-bg-subtle);
  border-bottom: 1px solid var(--pcli-color-border-subtle);
}
.rte__toolbar button {
  padding: 5px 9px;
  border: 0;
  border-radius: 6px;
  background: none;
  font: inherit;
  font-size: var(--fs-title-s);
  font-weight: 600;
  color: var(--pcli-color-text-secondary);
  cursor: pointer;
}
.rte__toolbar button:hover {
  background: var(--stone-150, #eceae6);
  color: var(--pcli-color-text-primary);
}
.rte__sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: var(--pcli-color-border-default);
}
.rte__area {
  min-height: 150px;
  padding: 16px 18px;
  font-size: var(--fs-body-m);
  line-height: 1.6;
  outline: none;
}
.rte__area > * + * {
  margin-top: 0.6em;
}
.rte__area h2 {
  font-size: 20px;
  font-weight: 600;
}
.rte__area h3 {
  font-size: 17px;
  font-weight: 600;
}
.rte__area ul,
.rte__area ol {
  padding-left: 22px;
}
.rte__area a {
  color: var(--pcli-color-text-link);
}

/* Photo uploader (MarketSpace / Photo uploader) */
.ms-photos {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ms-photos__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ms-photo {
  position: relative;
  width: 140px;
  height: 105px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pcli-color-bg-muted);
  cursor: grab;
}
.ms-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.ms-photo--new {
  cursor: default;
}
.ms-photo:first-child::after {
  content: 'Cover';
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 980px;
  background: var(--pcli-color-bg-inverse);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
.ms-photo__x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.ms-photos__add label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 140px;
  height: 105px;
  border: 1.5px dashed var(--pcli-color-border-strong);
  border-radius: 8px;
  background: var(--pcli-color-bg-subtle);
  color: var(--pcli-color-text-link);
  font-size: var(--fs-title-s);
  font-weight: 600;
  cursor: pointer;
}
.ms-photos__add label span {
  font-size: 22px;
  line-height: 1;
}
.ms-photos__add input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.ms-photos__add label:focus-within {
  outline: 2px solid var(--pcli-color-border-focus);
  outline-offset: 2px;
}

/* Express interest options (MarketSpace / Interest option) */
.ms-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ms-option {
  display: flex;
  gap: 14px;
  padding: 16px 20px 16px 16px;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.ms-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--pcli-color-action-selected);
}
.ms-option > span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ms-option__title {
  font-size: 16px;
  font-weight: 600;
}
.ms-option__text {
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-secondary);
}
.ms-option.is-on {
  border: 2px solid var(--pcli-color-border-focus);
  padding: 15px 19px 15px 15px;
  background: var(--pcli-color-bg-selected, #e3f4f6);
}
.ms-option__more {
  padding-left: 36px;
}
.ms-option__more[hidden] {
  display: none;
}

/* Submit panel */
.ms-form__aside {
  position: sticky;
  top: 104px;
}
.ms-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 12px;
  background: var(--pcli-color-bg-subtle);
}
.ms-panel__status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.ms-panel__rule {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--pcli-color-border-default);
}
.ms-panel__choice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}
.ms-panel__choice legend {
  margin-bottom: 10px;
}
.ms-panel__choice .check {
  align-items: flex-start;
  font-size: var(--fs-body-m);
}
.ms-panel__choice .check input {
  margin-top: 2px;
}

/* Responses */
.ms-resp__contact {
  width: 300px;
}
.ms-resp__date {
  width: 170px;
}
.ms-resp__item tr:first-child td {
  border-bottom: 0;
}
.ms-resp__msg td {
  padding-top: 0;
}
.ms-resp__text {
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--pcli-color-bg-subtle);
  font-size: var(--fs-body-m);
  line-height: 1.6;
}

/* Public: browse */
.ms-top {
  align-items: flex-start;
  padding-top: 56px;
  padding-bottom: 40px;
} /* Figma 05: 56px above, 40px below; the button lines up with the eyebrow */
.ms-top__intro {
  max-width: 760px;
  color: #000;
}
.ms-top .eyebrow,
.ms-top__intro {
  padding-left: 20px;
} /* Figma 05: eyebrow and intro sit 20px in from the heading */

.ms-browse {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding: 0 var(--gutter) 96px; /* same side gutters as the page title, so the tabs' rule and the State/City menus end
     under the Post a listing button and the nav's New to PCLI? button at every width */
}
.ms-filters {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
/* Category tabs — folder tabs on a tan band, same as Education options (ce.css .cex-tabs; Figma: CE — 05e Folder tabs).
   The band runs edge to edge; the selected tab is white with an orange top edge and joins the page below. */
.ms-tabbar {
  margin: 0 20px;
  padding-top: 20px;
  background: var(--pcli-color-bg-muted);
  box-shadow: 0 0 0 100vmax var(--pcli-color-bg-muted);
  clip-path: inset(0 -100vmax);
}
.ms-tabs {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ms-tabs::-webkit-scrollbar {
  display: none;
}
.ms-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: none;
  padding: 16px 28px;
  border-radius: 10px 10px 0 0;
  background: #e9e6e0;
  font-size: 18px;
  font-weight: 600;
  line-height: 20px;
  color: var(--pcli-color-text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.ms-tab span {
  font-size: var(--fs-body-s);
  font-weight: 500;
  color: var(--pcli-color-text-tertiary);
}
.ms-tab:hover {
  background: #dfdbd3;
  color: var(--pcli-color-text-primary);
}
.ms-tab.is-on {
  border-top: 4px solid var(--pcli-color-action-primary);
  background: #fff;
  font-weight: 700;
  color: var(--pcli-color-text-primary);
}
/* Under the band: the type pills */
.ms-subbar {
  padding: 0 20px;
}
.ms-subbar:not(:has(*)) {
  display: none;
}
/* Page title, right column: Post a listing at the top, State / City at the bottom — the menus' bottom edge lines up with the
   intro's last line, however many lines it runs to (Figma 05a) */
.ms-top:has(.ms-top__side) {
  align-items: stretch;
}
.ms-top__side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.ms-top__side .ms-tabbar__filters {
  justify-content: flex-end;
}
.ms-tabbar__state {
  flex: none;
  width: 240px; /* a width, not a flex-basis: Safari sized the wrapper below from its content and the menu ran past
     the right edge */
}
/* State and City side by side; City is disabled until a state is picked */
.ms-tabbar__filters {
  display: flex;
  gap: 12px;
  flex: none;
}
.ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__state {
  width: 220px;
}
.ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__city {
  width: 200px;
} /* Figma 05g: State 220 + City 200, 12 apart, right edge on the content edge */
.select-menu--primary.select-menu--disabled .select-menu__field,
.select-menu--primary.select-menu--disabled .select-menu__field:hover {
  background: #e9e6e0;
  color: #8f918f;
  cursor: not-allowed;
}
/* Type pills — MarketSpace / Filter chip, Size=Small */
.ms-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 6px;
}
.ms-pills__lead {
  margin-right: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--pcli-color-text-secondary);
}
.ms-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 980px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--pcli-color-text-secondary);
  text-decoration: none;
}
.ms-pill span {
  font-size: 12px;
  font-weight: 400;
  color: var(--pcli-color-text-tertiary);
}
.ms-pill:hover {
  border-color: var(--pcli-color-border-strong);
  color: var(--pcli-color-text-primary);
}
.ms-pill.is-on {
  background: var(--pcli-color-bg-selected);
  border-color: var(--pcli-color-action-selected);
  color: var(--pcli-color-action-selected);
}
.ms-pill.is-on span {
  color: var(--pcli-color-action-selected);
}
/* Pages under the listing grid (24 a page): count on the left, pills on the right; stacks on phones */
.ms-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 24px 20px 0;
  border-top: 1px solid var(--pcli-color-border-subtle);
}
.ms-pager__count {
  margin: 0;
  font-size: 13px;
  color: var(--pcli-color-text-tertiary);
}
.ms-pager__links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ms-pager .ms-pill {
  min-width: 34px;
  justify-content: center;
}
.ms-pager__gap {
  padding: 0 2px;
  color: var(--pcli-color-text-tertiary);
}
@media (max-width: 720px) {
  .ms-pager {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0;
    padding-right: 0;
  }
}
.ms-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)); /* Figma 05b/05c: four across */
  gap: 30px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.ms-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.ms-card:hover {
  border-color: var(--pcli-color-border-strong);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}
/* The photo box keeps its 380 × 240 shape whatever the image's own proportions (e.g. the square default images):
   overflow: hidden stops a flex item's automatic minimum height from growing the box to fit a taller image,
   and flex-shrink: 0 stops a long card body from squeezing it. */
.ms-card__photo {
  display: block;
  flex-shrink: 0;
  aspect-ratio: 380/240;
  overflow: hidden;
  background: var(--pcli-color-bg-muted);
}
.ms-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px 22px;
}
.ms-card__title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
}
.ms-card:hover .ms-card__title {
  color: var(--pcli-color-text-link);
}
.ms-card__meta {
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-secondary);
}
.ms-card__detail,
.ms-listing__detail {
  font-size: var(--fs-title-s);
  font-weight: 600;
  color: var(--pcli-color-accent-teal, #0d7a7a);
}
.ms-listing__detail {
  margin: 0;
}
.ms-cv {
  margin-top: 10px;
  justify-content: center;
}
.ms-card__excerpt {
  font-size: var(--fs-body-s);
  line-height: 1.5;
  color: var(--pcli-color-text-secondary);
}
.ms-none {
  padding: 24px 0;
}

/* Public: listing */
.ms-listing {
  padding: 40px var(--gutter) 96px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.ms-listing__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
} /* Figma 06: back link, 40px, then the title block */
.ms-listing__title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.ms-listing__title .eyebrow,
.ms-listing__meta,
.ms-listing__title .ms-listing__detail {
  padding-left: 20px;
} /* eyebrow and meta 20px in from the heading */
.ms-listing__cols {
  display: grid;
  grid-template-columns: 760px minmax(0, 1fr);
  gap: 60px;
  align-items: start;
}
.ms-listing__main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  min-width: 0;
}
.ms-gallery {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ms-gallery__main {
  margin: 0;
  aspect-ratio: 760/460;
  border-radius: 12px;
  overflow: hidden;
  background: var(--pcli-color-bg-muted);
}
.ms-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.ms-gallery__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 165/112;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  background: var(--pcli-color-bg-muted);
  cursor: pointer;
}
.ms-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ms-gallery__thumb.is-on {
  border-color: var(--pcli-color-border-focus);
}
.ms-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 20px;
}
.ms-block__h {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  text-transform: uppercase;
  color: var(--pcli-color-text-primary);
}
.ms-prose {
  font-size: var(--fs-body-m);
  line-height: 1.6;
}
.ms-prose > * + * {
  margin-top: 0.75em;
}
.ms-prose h2 {
  font-size: 22px;
  font-weight: 600;
}
.ms-prose h3 {
  font-size: 18px;
  font-weight: 600;
}
.ms-prose ul,
.ms-prose ol {
  padding-left: 22px;
}
.ms-prose li + li {
  margin-top: 6px;
}
.ms-prose a {
  color: var(--pcli-color-text-link);
}
.ms-prose--s {
  font-size: var(--fs-body-m);
}
.ms-listing__aside {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 104px;
}
.ms-card-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 24px;
  border: 1px solid var(--pcli-color-border-default);
  border-radius: 12px;
}
.ms-card-box p {
  margin: 0;
}
.ms-interest {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px;
  border-radius: 12px;
  background: var(--pcli-color-bg-subtle);
}
.ms-interest__form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ms-interest--sent {
  gap: 12px;
  padding: 28px 24px;
}
.ms-interest--sent:focus {
  outline: none;
}
.ms-interest__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pcli-color-action-selected);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
}
.ms-interest--sent .link {
  margin-top: 4px;
}
.ms-textarea {
  height: auto;
  min-height: 120px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
  line-height: 1.5;
}

/* Narrow screens */
@media (max-width: 1240px) {
  .ms-form,
  .ms-listing__cols {
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
  }
  .ms-cats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ms-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .ms-form,
  .ms-listing__cols {
    grid-template-columns: 1fr;
  }
  .ms-form__aside,
  .ms-listing__aside {
    position: static;
  }
  .ms-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .msa-table thead {
    display: none;
  }
  .msa-table tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--pcli-color-border-subtle);
  }
  .msa-table td {
    border: 0;
    padding: 0;
    width: auto;
  }
  .msa-table td:first-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 720px) {
  .ms-cats,
  .ms-grid {
    grid-template-columns: 1fr;
  }
  .ms-cats,
  .ms-grid,
  .ms-block,
  .ms-gallery__thumbs {
    padding-left: 0;
    padding-right: 0;
  }
  .ms-row,
  .ms-row--csz,
  .ms-row--name,
  .ms-row--item {
    grid-template-columns: 1fr;
  }
  .msa-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .ms-filters {
    flex-direction: column;
    align-items: stretch;
  }
  .ms-filters .select-menu {
    flex: none;
    width: 100%;
  }
  .ms-gallery__thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 960px) {
  /* the right column moves under the intro */
  .ms-top:has(.ms-top__side) {
    flex-direction: column;
    align-items: stretch;
    gap: 24px;
  }
  .ms-top .page-title__copy {
    flex: none;
  }
  .ms-top__side {
    align-items: flex-start;
    gap: 20px;
  }
  .ms-top__side .ms-tabbar__filters {
    justify-content: flex-start;
    width: 100%;
  }
  .ms-tabbar__state {
    flex: none;
    max-width: 320px;
  }
  .ms-tabbar__filters .ms-tabbar__state,
  .ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__state,
  .ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__city {
    width: auto;
    flex: 0 1 320px;
  }
}

/* Phones — Figma: Catalog — OD MarketSpace › "07 Mobile · Browse" and "08 Mobile · Listing". Type on the 20px gutter; buttons
   and the dropdown 20px further in (40px); cards 10px further in (30px); the main photo runs edge to edge. */
@media (max-width: 720px) {
  /* browse */
  .ms-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 40px var(--gutter) 28px;
  }
  .ms-top .eyebrow {
    font-size: 12px;
  }
  .ms-top__intro {
    font-size: 16px;
    line-height: 1.6;
  }
  .ms-top .page-title__copy {
    flex: none;
  } /* its 480px flex-basis became height once the header stacks */
  .ms-top .btn {
    margin: 0 20px;
  }
  .ms-browse {
    gap: 24px;
    padding: 0 var(--gutter) 56px;
  }
  .ms-filters {
    gap: 16px;
  }
  .ms-tabbar {
    margin: 0 calc(-1 * var(--gutter));
    padding: 14px var(--gutter) 0;
  } /* as the Education options tabs on phones: smaller tabs that scroll sideways */
  .ms-tabs {
    gap: 4px;
  }
  .ms-tab {
    gap: 8px;
    padding: 12px 16px;
    font-size: 15px;
  }
  .ms-subbar {
    padding: 0;
  }
  .ms-top__side {
    align-items: stretch;
    gap: 16px;
  }
  .ms-tabbar__state {
    max-width: none;
  }
  /* phones: City under State, 20px further in than the type (as the button) */
  .ms-top__side .ms-tabbar__filters {
    flex-direction: column;
    width: auto;
    margin: 0 20px;
  }
  .ms-tabbar__filters .ms-tabbar__state,
  .ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__state,
  .ms-tabbar__filters:has(.ms-tabbar__city) .ms-tabbar__city {
    width: auto;
    flex: none;
    margin: 0;
  }
  .ms-grid {
    gap: 20px;
    padding: 0 10px;
  }
  /* listing */
  .ms-listing {
    gap: 24px;
    padding: 28px var(--gutter) 56px;
  }
  .ms-listing__head {
    gap: 24px;
  }
  .ms-listing__title .eyebrow {
    font-size: 12px;
  }
  .ms-top .eyebrow,
  .ms-top__intro,
  .ms-listing__title .eyebrow,
  .ms-listing__meta,
  .ms-listing__title .ms-listing__detail {
    padding-left: 0;
  } /* on the gutter with the heading */
  .ms-listing__cols {
    gap: 40px;
  }
  .ms-listing__main {
    gap: 32px;
  }
  .ms-gallery {
    gap: 12px;
    margin-bottom: 8px;
  } /* 40px from the thumbnails to the first section */
  .ms-block {
    padding: 0 0 0 10px;
  } /* Figma: sections 30px from the left edge, 20px from the right */
  .ms-gallery__main {
    margin: 0 calc(-1 * var(--gutter));
    border-radius: 0;
    aspect-ratio: 390/236;
  }
  .ms-gallery__thumb {
    aspect-ratio: 81/55;
    border-radius: 6px;
  }
  .ms-listing__aside {
    gap: 16px;
    margin: 0 10px;
  }
}

/* Preview — Figma: "01 Account · Your posts" (View / Preview listing), "03 … form" (Preview listing),
   "06p Account · Listing preview". The preview bar sits under the breadcrumbs; the interest form is switched off. */
.msa-view {
  width: 140px;
  justify-content: center;
  white-space: nowrap;
}
.msa-actions {
  white-space: nowrap;
}
.ms-preview-btn {
  margin-top: -4px;
}
.ms-preview-bar {
  background: var(--charcoal-800);
  color: #fff;
}
.ms-preview-bar__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.ms-preview-bar__msg {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}
.ms-preview-bar__msg .status {
  flex: none;
}
.ms-preview-bar__back {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ms-preview-bar__back:hover {
  color: #fff;
  text-decoration-thickness: 2px;
}
.ms-interest__off-note {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--pcli-color-text-secondary);
}
.ms-interest__off {
  display: contents;
}
.ms-interest__off > * {
  opacity: 0.45;
}
@media (max-width: 720px) {
  .ms-preview-bar__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ms-preview-bar__msg {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .msa-table td.msa-col-act {
    grid-column: 1/-1;
  }
  .msa-actions {
    flex-wrap: wrap;
    white-space: normal;
    gap: 12px 16px;
  }
}

/* Required fields — Figma: Form field / MarketSpace / Rich text field › Required: a red asterisk after the label,
   and a note above Submit (required only to submit; drafts can be saved with fields empty) */
.req {
  margin-left: 4px;
  font-weight: 600;
  color: var(--pcli-color-status-cancelled-text);
}
.ms-req-note {
  margin: 0;
  font-size: 13px;
  line-height: 20px;
  color: var(--pcli-color-text-secondary);
}
.ms-req-note .req {
  margin: 0 2px 0 0;
}

/* CV upload (Doctors for Hire): an outline button in place of the browser's "Choose File"; the file's name beside it */
.ms-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.ms-upload__input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
  opacity: 0;
}
.ms-upload__btn {
  cursor: pointer;
}
.ms-upload__btn:hover {
  background: var(--stone-100);
}
.ms-upload__input:focus-visible + .ms-upload__btn {
  outline: 2px solid var(--pcli-color-border-focus);
  outline-offset: 2px;
}
.ms-upload__name {
  font-size: var(--fs-body-s);
  color: var(--pcli-color-text-tertiary);
  min-width: 0;
  overflow-wrap: anywhere;
}
.ms-upload__name.is-picked {
  color: var(--pcli-color-text-primary);
  font-weight: 600;
}

/* Entry page (Figma: MarketSpace — 05e Public · Entry): the category cards without descriptions, listing count as the link */
.ms-cats--entry {
  margin: 0;
  padding: 0 20px;
  list-style: none;
}
.ms-cats--entry > li {
  display: flex;
}
.ms-cats--entry .ms-cat {
  flex: 1;
}
/* Sign in / Create an account (or Post a listing) under the entry cards — Figma: MarketSpace — 05e */
.ms-cats-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px 27px;
  margin-top: 0; /* Figma 05f: 32px under the cards — the .ms-browse gap */
  padding: 0 20px; /* lines up with the cards (.ms-cats--entry) */
}
.ms-cats-actions__lead {
  margin: 0;
  font-size: 18px;
  color: var(--pcli-color-text-primary);
}
.ms-cats-actions__btns {
  display: flex;
  gap: 12px;
}
/* Figma 05f: 28px from the buttons to the Consultants rule (4 here + the section's 24px top padding) */
.ms-browse:has(.ms-cats-actions) {
  padding-bottom: 4px;
}
@media (max-width: 720px) {
  .ms-cats-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin: 24px 0 0;
  }
  .ms-cats-actions__lead {
    text-align: center;
  }
  .ms-cats-actions__btns {
    flex-direction: column;
  }
}

/* Eligibility note (Globals → MarketSpace settings) — under the category cards on New post, and under the status
   panel beside the listing forms. Figma: MarketSpace — 02 / 03 */
.ms-eligibility {
  margin: 40px 0 0;
  max-width: 1100px;
  line-height: 1.55;
}
.ms-eligibility--aside {
  margin: 24px 0 0;
  padding: 0 4px;
}

/* Consulting services + OD News under the category cards on /marketspace — Figma: MarketSpace — 05f.
   Groups: services (220px) on the left, consultant cards (three across, filling the rest) on the right, 40px in from
   the rules. */
.ms-consult {
  display: flex;
  flex-direction: column;
  padding: 24px var(--gutter) 80px;
}
.ms-consult__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 48px 20px 28px;
  border-top: 1px solid var(--pcli-color-border-default);
}
.ms-consult__head p,
.ms-consult__head h2 {
  margin: 0;
}
.ms-consult__title {
  font-size: 28px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.03em;
  color: var(--pcli-color-text-primary);
}
.ms-consult__intro {
  font-size: 16px;
  line-height: 1.55;
  color: var(--pcli-color-text-secondary);
}
.ms-consult__group {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  padding: 24px 40px;
  border-bottom: 1px solid #e4e2dd;
}
.ms-consult__services {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--pcli-color-text-primary);
}
/* Figma: MarketSpace — 05f › Services: the category in bold capitals ("PRACTICE SALES:"), its services on a regular,
   indented line below */
.ms-consult__services li {
  display: flex;
  flex-direction: column;
}
.ms-consult__cat {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}
.ms-consult__detail {
  font-weight: 400;
}
.ms-consult__cat + .ms-consult__detail {
  padding-left: 15px; /* indented only under a category */
}
.ms-consult__people {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ms-consultant {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 16px 18px;
  border: 1px solid #e4e2dd;
  border-radius: 10px;
  background: #fff;
}
.ms-consultant p {
  margin: 0;
}
.ms-consultant__name {
  font-size: 15px;
  font-weight: 600;
  color: var(--pcli-color-text-primary);
}
.ms-consultant__co {
  font-size: 13px;
  color: var(--pcli-color-text-tertiary);
}
.ms-consultant__phone {
  font-size: 14px;
  font-weight: 600;
  color: var(--pcli-color-text-link);
  text-decoration: none;
}
.ms-consultant__link {
  font-size: 13px;
  color: var(--pcli-color-text-link);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.ms-consultant__email {
  margin-top: 6px;
}
.ms-consultant__phone:hover,
.ms-consultant__link:hover {
  text-decoration: underline;
}
.ms-news {
  padding: 0 var(--gutter) 96px;
}
.ms-news__card {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 36px 40px;
  border-radius: 16px;
  background: #122026;
}
.ms-news__copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ms-news__copy p,
.ms-news__copy h2 {
  margin: 0;
}
.ms-news__title {
  font-size: 26px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: #fff;
}
.ms-news__text {
  font-size: 15px;
  color: #c9d2d6;
}
.ms-news__card .btn {
  flex: none;
}
@media (max-width: 1200px) {
  .ms-consult__people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .ms-consult__group {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 20px 20px;
  }
  .ms-news__card {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 28px;
  }
}
@media (max-width: 720px) {
  .ms-consult__head {
    padding: 40px 0 20px;
  }
  .ms-consult__group {
    padding: 20px 0;
  }
  .ms-consult__people {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Doctors for Hire: "CV or résumé available upon request" (replaces the CV download) */
.ms-cv-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--pcli-color-text-primary);
}
.ms-cv-note svg {
  flex: none;
  color: var(--teal-800);
}
.ms-interest__cv {
  margin-top: -4px;
}
.ms-resp__cv {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #e5f2f2;
  color: var(--teal-800);
  font-size: 12px;
  font-weight: 600;
}
