/* Public Services V1: shared modal and the /services catalog. */

:where(body.ps-page-route, .ps-page, .ps-dialog) {
  --ps-page: var(--hp-page, var(--cp-navy, #f4f6f8));
  --ps-surface: var(--hp-surface, var(--cp-panel, #ffffff));
  --ps-surface-soft: var(--hp-surface-elevated, var(--cp-panel-soft, #f8fafc));
  --ps-surface-strong: var(--hp-surface-secondary, var(--cp-panel-raised, #edf3fb));
  --ps-border: var(--hp-border, var(--cp-line, #dfe4ea));
  --ps-border-strong: var(--hp-border-strong, #b9c7d7);
  --ps-text: var(--hp-text, var(--cp-text, #172033));
  --ps-muted: var(--hp-muted, var(--cp-muted, #667085));
  --ps-faint: var(--hp-faint, #7f8ca0);
  --ps-brand: var(--hp-brand, var(--cp-blue, #3268d6));
  --ps-brand-hover: var(--hp-brand-hover, var(--cp-blue-hover, #295bc2));
  --ps-brand-ink: var(--hp-brand-ink, #225fc8);
  --ps-brand-soft: var(--hp-brand-soft, #e3edff);
  --ps-on-brand: var(--hp-on-brand, #ffffff);
  --ps-shadow: var(--hp-shadow, 0 12px 34px rgba(20, 36, 58, .1));
  --ps-shadow-large: var(--hp-shadow-large, 0 28px 80px rgba(10, 20, 36, .22));
  color-scheme: light;
}

html[data-theme="dark"] :where(body.ps-page-route, .ps-page, .ps-dialog) {
  --ps-page: var(--hp-page, #07111d);
  --ps-surface: var(--hp-surface, #0f1b29);
  --ps-surface-soft: var(--hp-surface-elevated, #17283c);
  --ps-surface-strong: var(--hp-surface-secondary, #132337);
  --ps-border: var(--hp-border, #263a50);
  --ps-border-strong: var(--hp-border-strong, #38506a);
  --ps-text: var(--hp-text, #f2f6fb);
  --ps-muted: var(--hp-muted, #9baabe);
  --ps-faint: var(--hp-faint, #7f91a8);
  --ps-brand: var(--hp-brand, #3167d4);
  --ps-brand-hover: var(--hp-brand-hover, #2858b8);
  --ps-brand-ink: var(--hp-brand-ink, #82a9ff);
  --ps-brand-soft: var(--hp-brand-soft, #1b3760);
  --ps-shadow: var(--hp-shadow, 0 14px 34px rgba(0, 6, 13, .26));
  --ps-shadow-large: var(--hp-shadow-large, 0 28px 88px rgba(0, 6, 13, .52));
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) :where(body.ps-page-route, .ps-page, .ps-dialog) {
    --ps-page: var(--hp-page, #07111d);
    --ps-surface: var(--hp-surface, #0f1b29);
    --ps-surface-soft: var(--hp-surface-elevated, #17283c);
    --ps-surface-strong: var(--hp-surface-secondary, #132337);
    --ps-border: var(--hp-border, #263a50);
    --ps-border-strong: var(--hp-border-strong, #38506a);
    --ps-text: var(--hp-text, #f2f6fb);
    --ps-muted: var(--hp-muted, #9baabe);
    --ps-faint: var(--hp-faint, #7f91a8);
    --ps-brand: var(--hp-brand, #3167d4);
    --ps-brand-hover: var(--hp-brand-hover, #2858b8);
    --ps-brand-ink: var(--hp-brand-ink, #82a9ff);
    --ps-brand-soft: var(--hp-brand-soft, #1b3760);
    --ps-shadow: var(--hp-shadow, 0 14px 34px rgba(0, 6, 13, .26));
    --ps-shadow-large: var(--hp-shadow-large, 0 28px 88px rgba(0, 6, 13, .52));
    color-scheme: dark;
  }
}

body.ps-dialog-open {
  overscroll-behavior: none;
}

.ps-dialog {
  --ps-dialog-bg: #181d25;
  --ps-dialog-surface: #20252e;
  --ps-dialog-surface-hover: #252c37;
  --ps-dialog-border: #353c48;
  --ps-dialog-border-strong: #4c5a6d;
  --ps-dialog-text: #f4f7fb;
  --ps-dialog-muted: #9da8b8;
  --ps-dialog-faint: #778395;
  --ps-dialog-brand: #80a6ff;
  width: min(840px, calc(100% - 32px));
  max-width: 840px;
  max-height: min(calc(100vh - 32px), 92vh);
  max-height: min(calc(100dvh - 32px), 92dvh);
  margin: auto;
  padding: 0;
  overflow: visible;
  color: var(--ps-dialog-text);
  color-scheme: dark;
  background: transparent;
  border: 0;
}

.ps-dialog:not([open]) {
  display: none;
}

@media (min-width: 701px) {
  .ps-dialog {
    transform: translateY(18px);
  }
}

.ps-dialog::backdrop {
  background: rgba(4, 8, 14, .74);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.ps-dialog-shell {
  position: relative;
  display: flex;
  max-height: min(calc(100vh - 32px), 92vh);
  max-height: min(calc(100dvh - 32px), 92dvh);
  overflow: hidden;
  flex-direction: column;
  background: var(--ps-dialog-bg);
  border: 1px solid var(--ps-dialog-border);
  border-radius: 20px;
  box-shadow: 0 32px 90px rgba(0, 0, 0, .5), 0 2px 12px rgba(0, 0, 0, .28);
  animation: ps-dialog-enter .16s ease-out;
}

@keyframes ps-dialog-enter {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ps-dialog-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 15px;
  background: var(--ps-dialog-bg);
  border-bottom: 1px solid color-mix(in srgb, var(--ps-dialog-border) 58%, transparent);
}

.ps-dialog-header > div {
  min-width: 0;
}

.ps-dialog-header h2 {
  margin: 0;
  color: var(--ps-dialog-text);
  font-size: clamp(28px, 3vw, 32px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.ps-dialog-header p {
  max-width: 62ch;
  margin: 9px 0 0;
  color: var(--ps-dialog-muted);
  font-size: 12px;
  line-height: 1.4;
}

.ps-dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  flex: 0 0 44px;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  color: var(--ps-dialog-muted);
  background: transparent;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.ps-dialog-close:hover {
  color: var(--ps-dialog-text);
  background: rgba(255, 255, 255, .06);
}

.ps-dialog-close-mark,
.ps-dialog-close-mark::before,
.ps-dialog-close-mark::after {
  display: block;
}

.ps-dialog-close-mark {
  position: relative;
  width: 18px;
  height: 18px;
}

.ps-dialog-close-mark::before,
.ps-dialog-close-mark::after {
  position: absolute;
  top: 8px;
  left: 1px;
  width: 16px;
  height: 2px;
  content: "";
  background: currentColor;
  border-radius: 999px;
}

.ps-dialog-close-mark::before { transform: rotate(45deg); }
.ps-dialog-close-mark::after { transform: rotate(-45deg); }

.ps-dialog-scroll {
  min-height: 0;
  padding: 14px 24px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: var(--ps-dialog-border-strong) transparent;
}

.ps-dialog-catalog {
  display: grid;
  gap: 12px;
}

.ps-dialog-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}

.ps-dialog-columns[data-column-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ps-dialog-columns[data-column-count="1"] {
  grid-template-columns: minmax(0, 1fr);
}

.ps-dialog-category,
.ps-dialog-column {
  min-width: 0;
}

.ps-dialog-column > summary {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: var(--ps-dialog-text);
  background: rgba(255, 255, 255, .025);
  border: 1px solid color-mix(in srgb, var(--ps-dialog-border) 72%, transparent);
  border-radius: 10px 10px 0 0;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.2;
  list-style: none;
  pointer-events: none;
}

.ps-dialog-column > summary::-webkit-details-marker {
  display: none;
}

.ps-dialog-summary-mark {
  display: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform .16s ease;
}

.ps-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
}

.ps-dialog-list {
  padding: 8px;
  background: rgba(255, 255, 255, .016);
  border: 1px solid color-mix(in srgb, var(--ps-dialog-border) 72%, transparent);
  border-top: 0;
  border-radius: 0 0 10px 10px;
}

.ps-dialog-column:not([open]) > .ps-dialog-list {
  display: grid;
}

.ps-dialog-service {
  display: grid;
  min-width: 0;
  min-height: 52px;
  padding: 7px 8px;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  color: var(--ps-dialog-text);
  background: var(--ps-dialog-surface);
  border: 1px solid var(--ps-dialog-border);
  border-radius: 9px;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.ps-dialog-service:hover {
  color: var(--ps-dialog-text);
  background: var(--ps-dialog-surface-hover);
  border-color: var(--ps-dialog-border-strong);
  transform: translateY(-1px);
}

.ps-dialog .ps-service-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  margin-bottom: 0;
  place-items: center;
  color: var(--ps-dialog-brand);
  background: rgba(106, 145, 238, .08);
  border-radius: 9px;
}

.ps-dialog .ps-service-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.ps-dialog .ps-service-copy strong {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: currentColor;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: -.012em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ps-dialog .ps-service-copy small {
  display: none;
  overflow: hidden;
  color: var(--ps-dialog-muted);
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ps-service-source {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  color: var(--ps-faint);
  font-size: 9px;
  font-weight: 720;
  line-height: 1.25;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.ps-dialog .ps-service-source {
  display: none;
  color: var(--ps-dialog-faint);
}

.ps-dialog-service[data-service-source="partner"][data-service-visibility="preview"],
.ps-dialog-service[data-service-source="marketplace"][data-service-visibility="preview"] {
  border-color: color-mix(in srgb, var(--ps-dialog-brand) 44%, var(--ps-dialog-border));
}

.ps-dialog-service[data-service-source="partner"][data-service-visibility="live"],
.ps-dialog-service[data-service-source="marketplace"][data-service-visibility="live"] {
  border-color: color-mix(in srgb, #38c898 38%, var(--ps-dialog-border));
}

.ps-dialog-service[data-service-source="partner"][data-service-visibility="preview"] .ps-service-source,
.ps-dialog-service[data-service-source="marketplace"][data-service-visibility="preview"] .ps-service-source {
  color: var(--ps-dialog-brand);
}

.ps-dialog-service[data-service-source="partner"][data-service-visibility="live"] .ps-service-source,
.ps-dialog-service[data-service-source="marketplace"][data-service-visibility="live"] .ps-service-source {
  color: #62d7b3;
}

.ps-preview-notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 0 16px;
  padding: 10px 12px;
  color: var(--ps-dialog-muted);
  background: color-mix(in srgb, var(--ps-dialog-brand) 8%, var(--ps-dialog-surface));
  border: 1px solid color-mix(in srgb, var(--ps-dialog-brand) 28%, var(--ps-dialog-border));
  border-radius: 11px;
  font-size: 10px;
  line-height: 1.45;
}

.ps-preview-notice .cv1-icon {
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--ps-dialog-brand);
}

.ps-preview-notice strong {
  color: var(--ps-dialog-text);
}

.ps-dialog .ps-service-arrow {
  display: grid;
  margin: 0;
  padding: 0;
  color: var(--ps-dialog-faint);
  place-items: center;
}

.ps-dialog-secondary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 7px;
  padding: 8px;
}

.ps-dialog-help {
  display: none;
}

.ps-dialog-secondary-link {
  display: grid;
  min-height: 52px;
  grid-template-columns: 30px minmax(0, 1fr) 14px;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  color: var(--ps-dialog-text);
  background: var(--ps-dialog-surface);
  border: 1px solid var(--ps-dialog-border);
  border-radius: 9px;
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.ps-dialog-secondary-link:hover {
  color: var(--ps-dialog-text);
  background: var(--ps-dialog-surface-hover);
  border-color: var(--ps-dialog-border-strong);
  transform: translateY(-1px);
}

.ps-dialog-secondary-link .ps-service-icon {
  margin: 0;
}

.ps-dialog-secondary-link .ps-service-arrow {
  margin: 0;
  padding: 0;
}

.ps-dialog-footer {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: flex;
  min-height: 42px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 7px 30px 11px;
  color: var(--ps-dialog-muted);
  font-size: 11px;
  background: var(--ps-dialog-bg);
  border-top: 1px solid color-mix(in srgb, var(--ps-dialog-border) 58%, transparent);
}

.ps-dialog-footer span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.ps-dialog-empty {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 20px;
  color: var(--ps-dialog-text);
  background: var(--ps-dialog-surface);
  border: 1px solid var(--ps-dialog-border);
  border-radius: 16px;
}

.ps-dialog-empty strong {
  display: block;
  font-size: 14px;
}

.ps-dialog-empty p {
  margin: 4px 0 0;
  color: var(--ps-dialog-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ps-page-services {
  display: grid;
  gap: 7px;
}

.ps-page-service {
  display: grid;
  min-width: 0;
  min-height: 58px;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  color: var(--ps-text);
  background: var(--ps-surface);
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.ps-page-service:hover {
  color: var(--ps-brand-ink);
  background: var(--ps-brand-soft);
  border-color: var(--ps-border-strong);
  transform: translateY(-1px);
}

.ps-service-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--ps-brand-ink);
  background: var(--ps-brand-soft);
  border-radius: 11px;
}

.ps-service-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ps-service-copy strong {
  overflow-wrap: anywhere;
  color: currentColor;
  font-size: 13px;
  line-height: 1.25;
}

.ps-service-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ps-muted);
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ps-service-arrow {
  display: grid;
  color: var(--ps-faint);
  place-items: center;
}

.ps-page-empty {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 20px;
  color: var(--ps-text);
  background: var(--ps-surface-soft);
  border: 1px solid var(--ps-border);
  border-radius: 16px;
}

.ps-page-empty strong {
  display: block;
  font-size: 14px;
}

.ps-page-empty p {
  margin: 4px 0 0;
  color: var(--ps-muted);
  font-size: 12px;
  line-height: 1.45;
}

body.ps-page-route {
  background: var(--ps-page);
  color: var(--ps-text);
}

body.ps-page-route .pf-header {
  background: var(--ps-surface);
  border-color: var(--ps-border);
}

body.ps-page-route :is(.pf-brand, .pf-brand strong) {
  color: var(--ps-text);
}

body.ps-page-route :is(.pf-navigation, .pf-login) {
  color: var(--ps-muted);
}

body.ps-page-route .pf-footer {
  border-color: var(--ps-border);
}

body.ps-page-route .pf-footer :is(p, nav, small) {
  color: var(--ps-muted);
}

body.ps-page-route .cp-mobile-menu > summary,
body.ps-page-route .cp-mobile-menu > nav {
  color: var(--ps-text);
  background: var(--ps-surface);
  border-color: var(--ps-border);
}

body.ps-page-route .cp-mobile-menu > summary span {
  background: var(--ps-text);
}

body.ps-page-route .cp-mobile-menu nav a {
  color: var(--ps-muted);
}

.ps-page {
  width: 100%;
  color: var(--ps-text);
}

.ps-page *,
.ps-page *::before,
.ps-page *::after,
.ps-dialog *,
.ps-dialog *::before,
.ps-dialog *::after {
  box-sizing: border-box;
  min-width: 0;
}

.ps-page :is(a, button, input):focus-visible {
  outline: 3px solid var(--ps-brand-ink);
  outline-offset: 3px;
}

.ps-dialog :is(a, button, [tabindex]):focus-visible {
  outline: 3px solid var(--ps-dialog-brand);
  outline-offset: 3px;
}

.ps-page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr);
  align-items: stretch;
  gap: 16px;
}

.ps-page-hero-copy,
.ps-page-hero-note {
  border: 1px solid var(--ps-border);
  border-radius: 24px;
  box-shadow: var(--ps-shadow);
}

.ps-page-hero-copy {
  padding: clamp(28px, 4vw, 48px);
  background: var(--ps-surface);
}

.ps-page-hero h1 {
  max-width: 18ch;
  margin: 8px 0 0;
  color: var(--ps-text);
  font-size: clamp(36px, 4.6vw, 56px);
  line-height: 1.02;
  letter-spacing: -.048em;
  text-wrap: balance;
}

.ps-page-hero-copy > p {
  max-width: 66ch;
  margin: 17px 0 0;
  color: var(--ps-muted);
  font-size: 16px;
  line-height: 1.55;
}

.ps-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}

.ps-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: var(--ps-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 13px;
  font: inherit;
  font-size: 13px;
  font-weight: 740;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.ps-button:hover { transform: translateY(-1px); }

.ps-button-primary {
  color: var(--ps-on-brand);
  background: var(--ps-brand);
  border-color: var(--ps-brand);
}

.ps-button-primary:hover {
  color: var(--ps-on-brand);
  background: var(--ps-brand-hover);
  border-color: var(--ps-brand-hover);
}

.ps-button-secondary {
  color: var(--ps-text);
  background: var(--ps-surface);
  border-color: var(--ps-border);
}

.ps-button-secondary:hover {
  border-color: var(--ps-border-strong);
}

.ps-page-hero-note {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 26px;
  background: var(--ps-surface-strong);
}

.ps-page-hero-note strong {
  color: var(--ps-text);
  font-size: 16px;
  line-height: 1.25;
}

.ps-page-hero-note p {
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 13px;
  line-height: 1.55;
}

.ps-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding: 17px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: 18px;
  box-shadow: var(--ps-shadow);
}

.ps-search > label {
  display: grid;
  gap: 7px;
  color: var(--ps-text);
  font-size: 12px;
  font-weight: 700;
}

.ps-search-field {
  display: grid;
  min-height: 46px;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  color: var(--ps-muted);
  background: var(--ps-surface-soft);
  border: 1px solid var(--ps-border);
  border-radius: 13px;
}

.ps-search-field:focus-within {
  color: var(--ps-brand-ink);
  border-color: var(--ps-brand-ink);
}

.ps-search-field input {
  width: 100%;
  min-height: 44px;
  padding: 0;
  color: var(--ps-text);
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  font-size: 14px;
}

.ps-search-field input::placeholder { color: var(--ps-faint); }

.ps-search-clear {
  min-height: 44px;
  padding: 0 12px;
  color: var(--ps-muted);
  background: transparent;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.ps-search-clear:hover { color: var(--ps-text); }

.ps-search-count {
  grid-column: 1 / -1;
  color: var(--ps-muted);
  font-size: 12px;
}

.ps-catalog {
  margin-top: 16px;
  padding: 26px;
  background: var(--ps-surface);
  border: 1px solid var(--ps-border);
  border-radius: 24px;
  box-shadow: var(--ps-shadow);
  scroll-margin-top: 88px;
}

.ps-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.ps-section-header h2,
.ps-support h2 {
  margin: 5px 0 0;
  color: var(--ps-text);
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -.035em;
}

.ps-section-header > p {
  max-width: 43ch;
  margin: 0;
  color: var(--ps-muted);
  font-size: 13px;
  line-height: 1.5;
  text-align: right;
}

.ps-page-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  margin-top: 18px;
}

.ps-page-category {
  min-width: 0;
  padding: 15px;
  background: var(--ps-surface-soft);
  border: 1px solid var(--ps-border);
  border-radius: 16px;
}

.ps-page-category > header {
  min-height: 62px;
}

.ps-page-category h3 {
  margin: 0;
  color: var(--ps-text);
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: -.025em;
}

.ps-page-category > header p {
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 12px;
  line-height: 1.45;
}

.ps-page-services { margin-top: 14px; }

.ps-page-service {
  min-height: 68px;
  grid-template-columns: 42px minmax(0, 1fr) 20px;
  gap: 12px;
  padding: 10px;
  border-color: var(--ps-border);
}

.ps-page-service .ps-service-icon {
  width: 42px;
  height: 42px;
}

.ps-page-service .ps-service-copy strong { font-size: 14px; }
.ps-page-service .ps-service-copy small { font-size: 12px; }

.ps-service-heading {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ps-service-heading > strong {
  min-width: 0;
}

.ps-page-service .ps-service-source {
  flex: 0 0 auto;
  padding: 3px 5px;
  color: var(--ps-faint);
  background: var(--ps-surface-strong);
  border: 1px solid var(--ps-border);
  border-radius: 999px;
  font-size: 8px;
}

.ps-page-service[data-service-source="partner"][data-service-visibility="preview"],
.ps-page-service[data-service-source="marketplace"][data-service-visibility="preview"] {
  border-color: color-mix(in srgb, var(--ps-brand-ink) 34%, var(--ps-border));
}

.ps-page-service[data-service-source="partner"][data-service-visibility="preview"] .ps-service-source,
.ps-page-service[data-service-source="marketplace"][data-service-visibility="preview"] .ps-service-source {
  color: var(--ps-brand-ink);
  background: var(--ps-brand-soft);
  border-color: color-mix(in srgb, var(--ps-brand-ink) 22%, var(--ps-border));
}

.ps-page-service[data-service-source="partner"][data-service-visibility="live"],
.ps-page-service[data-service-source="marketplace"][data-service-visibility="live"] {
  border-color: color-mix(in srgb, #1a9b76 34%, var(--ps-border));
}

.ps-page-service[data-service-source="partner"][data-service-visibility="live"] .ps-service-source,
.ps-page-service[data-service-source="marketplace"][data-service-visibility="live"] .ps-service-source {
  color: #13785d;
  background: color-mix(in srgb, #32c296 10%, var(--ps-surface));
  border-color: color-mix(in srgb, #1a9b76 25%, var(--ps-border));
}

html[data-theme="dark"] .ps-page-service[data-service-source="partner"][data-service-visibility="live"] .ps-service-source,
html[data-theme="dark"] .ps-page-service[data-service-source="marketplace"][data-service-visibility="live"] .ps-service-source {
  color: #63d8b4;
}

.ps-service-disclosure {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ps-faint);
  font-size: 9px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ps-page-preview-notice {
  --ps-dialog-surface: var(--ps-surface-soft);
  --ps-dialog-border: var(--ps-border);
  --ps-dialog-text: var(--ps-text);
  --ps-dialog-muted: var(--ps-muted);
  --ps-dialog-brand: var(--ps-brand-ink);
  margin: 18px 0 0;
  font-size: 11px;
}

.ps-page-empty { margin-top: 22px; }

.ps-support {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 17px;
  margin-top: 16px;
  padding: 24px 26px;
  background: var(--ps-surface-strong);
  border: 1px solid var(--ps-border);
  border-radius: 22px;
  box-shadow: var(--ps-shadow);
  scroll-margin-top: 88px;
}

.ps-support-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  color: var(--ps-brand-ink);
  background: var(--ps-brand-soft);
  border-radius: 14px;
}

.ps-support h2 { font-size: 21px; }

.ps-support p {
  max-width: 72ch;
  margin: 7px 0 0;
  color: var(--ps-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ps-page [hidden],
.ps-dialog [hidden] {
  display: none;
}

@media (max-width: 1100px) {
  .ps-page-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .ps-page-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-page-hero-note { min-height: 0; }
  .ps-section-header { align-items: flex-start; flex-direction: column; gap: 8px; }
  .ps-section-header > p { text-align: left; }
  .ps-page-category > header { min-height: 0; }
}

@media (max-width: 700px) {
  .ps-dialog-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .ps-dialog-column,
  .ps-dialog-help {
    display: block;
    overflow: hidden;
    background: var(--ps-dialog-surface);
    border: 1px solid var(--ps-dialog-border);
    border-radius: 11px;
  }

  .ps-dialog-column > summary {
    min-height: 50px;
    padding: 0 14px;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 12px;
    pointer-events: auto;
    cursor: pointer;
  }

  .ps-dialog-column[open] > summary {
    border-bottom: 1px solid var(--ps-dialog-border);
  }

  .ps-dialog-summary-mark {
    display: block;
  }

  .ps-dialog-column[open] .ps-dialog-summary-mark {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  .ps-dialog-column:not([open]) > .ps-dialog-list,
  .ps-dialog-column:not([open]) > .ps-dialog-secondary {
    display: none;
  }

  .ps-dialog-list {
    padding: 8px;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .ps-dialog-service,
  .ps-dialog-secondary-link {
    background: color-mix(in srgb, var(--ps-dialog-surface-hover) 68%, transparent);
  }

  .ps-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .ps-search > label,
  .ps-search-count {
    grid-column: 1 / -1;
  }

  .ps-support {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .ps-support > .ps-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ps-dialog {
    width: calc(100% - 16px);
    max-height: min(calc(100vh - 16px), 94vh);
    max-height: min(calc(100dvh - 16px), 94dvh);
  }

  .ps-dialog-shell {
    max-height: min(calc(100vh - 16px), 94vh);
    max-height: min(calc(100dvh - 16px), 94dvh);
    border-radius: 18px;
  }

  .ps-dialog-header { gap: 12px; padding: 22px 20px 15px; }
  .ps-dialog-header h2 { font-size: 26px; }
  .ps-dialog-header p { max-width: 26ch; font-size: 11px; }
  .ps-dialog-close { top: 8px; right: 8px; }
  .ps-dialog-scroll { padding: 14px 16px 16px; scrollbar-gutter: auto; }
  .ps-dialog-catalog { gap: 8px; }
  .ps-dialog-grid { gap: 7px; }
  .ps-dialog-service { min-height: 52px; padding: 7px 8px; }
  .ps-dialog .ps-service-icon { width: 29px; height: 29px; margin-bottom: 0; }
  .ps-dialog .ps-service-copy { gap: 2px; }
  .ps-dialog .ps-service-copy strong { font-size: 11px; line-height: 1.2; }
  .ps-dialog .ps-service-copy small { font-size: 10px; -webkit-line-clamp: 2; }
  .ps-dialog .ps-service-arrow { padding-top: 0; }
  .ps-dialog-secondary { gap: 7px; margin-top: 0; padding: 8px; }
  .ps-dialog-secondary-link { min-height: 52px; grid-template-columns: 29px minmax(0, 1fr) 14px; gap: 8px; padding: 7px 8px; }
  .ps-dialog-secondary-link .ps-service-copy small { display: none; }
  .ps-dialog-footer { min-height: 40px; padding: 6px 16px 10px; font-size: 10px; }

  .ps-page-hero-copy,
  .ps-page-hero-note,
  .ps-catalog,
  .ps-support {
    border-radius: 18px;
  }

  .ps-page-hero-copy { padding: 24px 19px; }
  .ps-page-hero h1 { font-size: clamp(32px, 10vw, 40px); }
  .ps-page-hero-copy > p { font-size: 14px; }
  .ps-page-actions { display: grid; }
  .ps-page-actions .ps-button { width: 100%; }
  .ps-page-hero-note { padding: 19px; }
  .ps-search { padding: 13px; }
  .ps-search-submit { padding-inline: 13px; }
  .ps-catalog { padding: 19px 13px; }
  .ps-page-category { padding: 13px; border-radius: 15px; }
  .ps-page-service { grid-template-columns: 40px minmax(0, 1fr) 18px; gap: 9px; padding: 9px; }
  .ps-page-service .ps-service-icon { width: 40px; height: 40px; }
  .ps-support { padding: 19px; }
}

@media (max-width: 620px) {
  .ps-page-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-page-category > header {
    min-height: 0;
  }
}

@media (max-width: 374px) {
  .ps-dialog { width: calc(100% - 12px); }
  .ps-dialog-header { padding-inline: 17px; }
  .ps-dialog-scroll { padding-inline: 12px; }
  .ps-dialog-service { padding-inline: 10px; }
  .ps-dialog-footer { padding-inline: 12px; }
  .ps-search { grid-template-columns: minmax(0, 1fr); }
  .ps-search > label,
  .ps-search-count { grid-column: auto; }
  .ps-search-submit,
  .ps-search-clear { width: 100%; }
  .ps-support { grid-template-columns: minmax(0, 1fr); }

  .ps-dialog-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-dialog-service {
    min-height: 52px;
  }
}

@media (max-width: 330px) {
  .ps-dialog-grid,
  .ps-dialog-secondary {
    grid-template-columns: minmax(0, 1fr);
  }

  .ps-dialog-service {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ps-dialog-shell { animation: none; }
  .ps-dialog-service,
  .ps-page-service,
  .ps-button { transition: none; }
  .ps-dialog-service:hover,
  .ps-page-service:hover,
  .ps-button:hover { transform: none; }
  .ps-dialog-scroll { scroll-behavior: auto; }
}
