/* The editor follows the portal’s Atelier palette and minimum touch targets. */
#portal-profile .pp-page {
  --pp-radius: 14px;
  --pp-gap: clamp(16px, 3vw, 30px);
  min-width: 0;
  color: var(--ink);
}

#portal-profile .pp-page [hidden] { display: none !important; }
#portal-profile .pp-page :is(button, a, summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}
#portal-profile .pp-page :is(h2, h3, h4, p, small, dt, dd) { overflow-wrap: anywhere; }
#portal-profile .pp-page :is(svg.pp-icon, .pp-glyph svg) { width: 17px; height: 17px; flex: none; }
#portal-profile .pp-page [id] { scroll-margin-top: 105px; }

#portal-profile .pp-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 8px 0 22px;
}
#portal-profile .pp-identity { min-width: 0; flex: 1; }
#portal-profile .pp-identity :is(.eyebrow, .section-kicker, p) { margin: 0; }
#portal-profile .pp-identity > p { color: var(--muted); font-size: 12px; }
#portal-profile .pp-identity h2 {
  margin: 4px 0 7px;
  font: 400 clamp(27px, 4.3vw, 42px)/1.13 var(--display);
}
#portal-profile .pp-avatar {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  flex: 0 0 70px;
  overflow: hidden;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--paper);
  color: var(--gold-bright);
  font: 400 23px/1 var(--display);
}
#portal-profile .pp-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
#portal-profile .pp-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 0;
  color: var(--gold-bright);
  font-size: 12px;
  line-height: 1.4;
}
#portal-profile .pp-status .status-badge {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}
#portal-profile .pp-status .status-badge i { box-shadow: none; }
#portal-profile .pp-status :is(.pp-published, .status-published) { color: var(--green); }
#portal-profile .pp-status .status-in_review { color: var(--blue); }
#portal-profile .pp-status .status-changes_requested { color: var(--gold-bright); }
#portal-profile .pp-published { display: inline-flex; align-items: center; gap: 5px; }
#portal-profile .pp-status svg { width: 14px; height: 14px; }
#portal-profile #profile-feedback { margin: 15px 0 0; color: var(--gold-bright); }

#portal #portal-profile :is(.pp-button, .pp-page .button-link, .pp-page button.primary, .pp-page button.secondary) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: none;
  color: var(--ink);
  font: 500 13px/1.35 var(--sans);
  text-align: center;
  text-decoration: none;
  letter-spacing: normal;
  white-space: normal;
}
#portal #portal-profile :is(.pp-primary, .pp-page button.primary) {
  border-color: var(--gold-bright);
  background: var(--gold-bright);
  color: var(--card);
}
#portal-profile .pp-page button:hover:not(:disabled) { transform: none; }
#portal #portal-profile :is(.pp-button, .pp-page button.secondary):hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--paper-deep);
}
#portal #portal-profile :is(.pp-primary, .pp-page button.primary):hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold);
}
#portal-profile .pp-open-preview { flex: 0 0 auto; }
#portal #portal-profile .pp-page .pp-close-preview { display: none; }

#portal-profile :is(.pp-nav, .pp-preview-tabs) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--paper);
}
#portal #portal-profile :is(.pp-nav, .pp-preview-tabs) button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 7px 5px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: 500 13px/1.25 var(--sans);
  overflow-wrap: anywhere;
}
#portal #portal-profile :is(.pp-nav, .pp-preview-tabs) button:is([aria-pressed="true"], [aria-selected="true"]) {
  background: var(--paper-deep);
  color: var(--gold-bright);
}
#portal #portal-profile :is(.pp-nav, .pp-preview-tabs) button:hover:not(:disabled) { background: var(--paper-deep); }
#portal-profile .pp-nav svg { width: 17px; height: 17px; flex: none; }

#portal-profile .pp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(240px, 30%, 365px);
  align-items: start;
  gap: var(--pp-gap);
  margin-top: 24px;
}
#portal-profile :is(.pp-main, .pp-pane, .pp-preview) { min-width: 0; }
#portal-profile .pp-section-heading { margin-bottom: 17px; }
#portal #portal-profile :is(.pp-section-heading, .pp-preview-head) :is(h2, h3) {
  margin: 0;
  font: 400 clamp(22px, 3vw, 29px)/1.2 var(--display);
}
#portal-profile :is(.pp-subtitle, .pp-help, .pp-section-heading p, .pp-field-note, .pp-preview-feedback) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}
#portal-profile .pp-optional { color: var(--muted); font-size: .9em; font-weight: 400; }
#portal-profile .pp-jumps { display: grid; padding: 0; margin: 15px 0 0; border-top: 1px solid var(--line); }
#portal #portal-profile .pp-jump {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 66px;
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: 500 14px/1.45 var(--sans);
  text-align: left;
  text-decoration: none;
  letter-spacing: normal;
}
#portal #portal-profile .pp-jump:hover { background: var(--paper); }
#portal-profile .pp-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--paper);
  color: var(--gold-bright);
}
#portal-profile .pp-jump :is(strong, small) { display: block; }
#portal-profile .pp-jump strong { font-weight: 600; }
#portal-profile .pp-jump small { color: var(--muted); font-size: 12px; font-weight: 400; }
#portal-profile .pp-jump > svg { width: 16px; height: 16px; color: var(--gold-bright); }
#portal-profile .pp-jump :is(.pp-jump-copy, span:nth-child(2)) { min-width: 0; }
#portal-profile .pp-row-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 12px;
}
#portal-profile .pp-row-note svg { color: var(--gold-bright); }
#portal-profile .pp-row-note :is(.verification-summary, #identity-verification, #license-verification) {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
}
#portal #portal-profile .pp-verification {
  margin-top: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  gap: 6px 12px;
}
#portal-profile .pp-verification h4 { margin: 0; color: var(--ink-soft); font-size: 12px; }
#portal #portal-profile .pp-verification span { padding: 0; background: transparent; color: var(--muted); font-weight: 500; }

#portal-profile :is(.pp-accordion, .smart-card-editor-group) {
  padding: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
#portal-profile :is(.pp-accordion, .smart-card-editor-group) > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  min-height: 52px;
  padding: 9px 6px;
  list-style: none;
  color: var(--ink);
  font: 600 14px/1.45 var(--sans);
  cursor: pointer;
}
#portal-profile :is(.pp-accordion, .smart-card-editor-group) > summary::-webkit-details-marker { display: none; }
#portal-profile .pp-accordion > summary svg { color: var(--gold-bright); flex: none; }
#portal-profile .pp-accordion[open] > summary > svg:last-child { transform: rotate(90deg); }
#portal-profile :is(.pp-accordion, .smart-card-editor-group) > summary small { display: block; color: var(--muted); font: 400 12px/1.4 var(--sans); }
#portal-profile .smart-card-editor-summary::after { flex: none; color: var(--gold-bright); }
#portal-profile .pp-accordion-body { display: grid; gap: 10px; padding: 3px 6px 13px; }
#portal-profile .pp-week { padding: 0; margin: 0; list-style: none; }
#portal-profile .pp-week > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
#portal-profile .pp-week dt { font-weight: 500; }
#portal-profile .pp-week dd { margin: 0; color: var(--muted); text-align: end; }

#portal #portal-profile :is(.profile-form, .smart-card-editor) { margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
#portal #portal-profile .profile-form .form-grid { gap: 13px; }
#portal #portal-profile .profile-form label { margin: 0; font-weight: 500; }
#portal-profile .pp-profile-fields { margin-bottom: 12px; }
#portal #portal-profile .profile-form :is(input:not([type="file"]):not([type="hidden"]), textarea) {
  min-width: 0;
  min-height: 45px;
  margin-top: 5px;
  padding: 10px 11px;
  border-color: var(--line);
  border-radius: 8px;
  background: var(--card);
  font-size: 16px;
}
#portal #portal-profile .profile-form textarea { min-height: 94px; }
#portal #portal-profile .profile-photo-row { align-items: center; flex-direction: row; flex-wrap: wrap; gap: 13px; margin: 0 0 14px; }
#portal #portal-profile .profile-photo-row .profile-photo-placeholder { width: 55px; height: 55px; flex: 0 0 55px; font-size: 21px; }
#portal-profile .profile-photo-controls { min-width: 200px; }
#portal-profile .profile-photo-controls > b { display: block; margin-bottom: 4px; font-size: 13px; }
#portal-profile .profile-photo-controls button { margin-top: 0; }
#portal-profile .profile-photo-controls small { max-width: 55ch; }
#portal #portal-profile .profile-specialty-choices { gap: 6px; margin-top: 9px; }
#portal #portal-profile .profile-specialty-choices button { min-height: 44px; border-radius: 8px; }
#portal-profile .pp-page #profile-error:empty { display: none; }
#portal-profile .pp-page :is(#profile-error, .pp-error) { color: var(--red); }
#portal-profile .pp-actions, #portal-profile .pp-page .profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 8px;
}
#portal-profile .pp-actions { align-items: center; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
#portal-profile .pp-actions .profile-actions { margin: 0; }
#portal-profile .pp-action-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#portal-profile .pp-actions :is(.pp-help, p, small) { flex-basis: 100%; }
#portal-profile .pp-inline-status { color: var(--green); font-size: 13px; }
#portal-profile .pp-inline-status:empty { display: none; }

#portal #portal-profile .profile-gallery-editor { margin: 0; padding: 0; border: 0; }
#portal #portal-profile .gallery-editor-head { align-items: flex-start; flex-wrap: wrap; }
#portal #portal-profile .profile-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 16px 0; }
#portal #portal-profile .profile-gallery-grid img { aspect-ratio: 1; border-radius: 9px; }
#portal #portal-profile .profile-gallery-grid figcaption { flex-wrap: wrap; }
#portal #portal-profile .profile-gallery-grid button { min-height: 44px; }
#portal #portal-profile #upload-gallery-button { width: auto; border-style: solid; }

#portal-profile .smart-card-editor > :is(p, small) { color: var(--muted); font-size: 13px; line-height: 1.5; }
#portal-profile .smart-card-editor [data-smart-status] { color: var(--green); }
#portal-profile .smart-card-editor [data-smart-error] { color: var(--red); }
#portal-profile .smart-card-editor :is([data-smart-status], [data-smart-error]):empty { display: none; }
#portal-profile .smart-card-editor > button[type="submit"] { margin-top: 16px; }
#portal-profile .smart-card-editor-compact-groups { border-top: 1px solid var(--line); }
#portal-profile .smart-card-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0; gap: 12px; }
#portal-profile .smart-card-fields fieldset { border-color: var(--line); border-radius: 8px; }
#portal-profile .smart-card-fields :is(input:not([type="checkbox"]), select) { min-width: 0; border-color: var(--line); background: var(--card); }
#portal-profile .smart-card-visibility { margin-bottom: 0; color: var(--muted); flex-wrap: wrap; }
#portal-profile .smart-card-visibility input { flex: 0 0 20px; margin: 0; }

#portal-profile .pp-preview {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--pp-radius);
  background: var(--card);
}
#portal-profile .pp-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 10px; }
#portal #portal-profile .pp-preview-head :is(h2, h3) { font-size: 21px; }
#portal-profile .pp-preview-tabs { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 10px; }
#portal #portal-profile .pp-preview-tabs button { font-size: 12px; }
#portal-profile .pp-preview-caption { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
#portal-profile .pp-preview #view-public-profile { margin-top: 11px; }
#portal-profile .pp-public { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--card); }
#portal-profile .pp-cover { display: block; width: 100%; height: clamp(108px, 12vw, 150px); object-fit: cover; object-position: center; background: var(--paper); }
#portal-profile .pp-public-body { padding: 0 13px 15px; overflow-wrap: anywhere; }
#portal-profile .pp-public-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-top: -25px;
  overflow: hidden;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: var(--paper);
  color: var(--gold-bright);
  font: 400 21px/1 var(--display);
  object-fit: cover;
  object-position: center 28%;
}
#portal-profile .pp-public-photo > img { width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
#portal #portal-profile .pp-public :is(h3, h4) { margin: 8px 0 4px; font: 400 23px/1.2 var(--display); }
#portal-profile .pp-public :is(.pp-location, .pp-public-bio) { margin: 6px 0; color: var(--muted); font-size: 13px; }
#portal-profile .pp-public-signature { margin: 8px 0; color: var(--gold-bright); font: italic 400 17px/1.3 var(--display); }
#portal-profile .pp-public .pp-location { display: flex; align-items: center; gap: 4px; }
#portal-profile .pp-public .pp-location svg { flex: none; width: 14px; height: 14px; }
#portal-profile .pp-public-bio { white-space: pre-line; }
#portal-profile .pp-specialty-text { margin: 5px 0; color: var(--gold-bright); font-size: 12px; }
#portal-profile .pp-public-actions { display: grid; grid-template-columns: minmax(0, 1fr); margin: 10px 0; gap: 5px; container-type: inline-size; }
#portal-profile .pp-public-actions .atelier-profile-button {
  min-width: 0;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 3px;
  border: 1px solid var(--gold);
  border-radius: 5px;
  background: var(--card);
  color: var(--gold-bright);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
}
#portal-profile .pp-public-actions .smart-card-action-icon { width: 15px; height: 15px; flex: none; }
#portal-profile .pp-public-actions .smart-card-action-label { overflow-wrap: normal; }
#portal-profile .pp-public-actions > .is-gold {
  position: relative;
  min-height: 43px;
  padding: 8px 20px;
  border-color: var(--gold);
  background: linear-gradient(115deg, var(--gold), var(--gold-bright) 55%, var(--gold));
  color: var(--card);
  font-size: 12px;
}
#portal-profile .pp-public-actions > .is-gold > svg:last-child { position: absolute; right: 6px; width: 12px; }
#portal-profile .pp-public-actions .smart-card-action-group { display: grid; gap: 5px; }
#portal-profile .pp-public-actions :is(.smart-card-action-group--primary, .smart-card-action-group--payments) {
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
#portal-profile .pp-public-actions :is(.smart-card-action-group--primary, .smart-card-action-group--payments, .smart-card-action-group--connect) .atelier-profile-button {
  flex-direction: column;
}
#portal-profile .pp-public-actions .smart-card-connect-heading { margin: 3px 0 0; }
#portal #portal-profile .pp-public-actions .smart-card-section-kicker {
  margin: 0;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .16em;
}
#portal-profile .pp-public-actions .smart-card-action-group--payments .smart-card-action-icon {
  width: 29px;
  height: 29px;
  padding: 3px;
  border-radius: 6px;
}
#portal-profile .pp-public-actions .smart-card-action-group--connect { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#portal-profile .pp-public-actions .smart-card-action-group--utilities { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 10px; }
#portal-profile .pp-public-actions .smart-card-action-group--utilities .atelier-profile-button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
}
@container (min-width: 240px) {
  #portal-profile .pp-public-actions .smart-card-action-group--primary .atelier-profile-button { flex-direction: row; }
}
#portal-profile .pp-public-work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
#portal-profile .pp-public-work img { display: block; width: 100%; aspect-ratio: 1; border-radius: 5px; object-fit: cover; }
#portal-profile .pp-public-products { margin: 4px 0 0; padding-left: 18px; color: var(--ink-soft); font-size: 12px; }
#portal-profile .pp-public .pp-week { font-size: 12px; }

@media (max-width: 960px) {
  #portal-profile .smart-card-fields { grid-template-columns: minmax(0, 1fr); }
  #portal-profile .smart-essential-slots { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 680px) {
  #portal-profile .pp-layout { grid-template-columns: minmax(0, 1fr); margin-top: 18px; }
  #portal-profile .pp-header { flex-wrap: wrap; gap: 9px 12px; padding-bottom: 16px; }
  #portal-profile .pp-avatar { width: 57px; height: 57px; flex-basis: 57px; }
  #portal-profile .pp-open-preview { width: 100%; }
  #portal #portal-profile .pp-nav button { flex-direction: column; gap: 4px; min-height: 54px; font-size: 12px; }
  #portal-profile .pp-preview, #portal-profile .pp-page[data-preview-open="true"] .pp-main { display: none; }
  #portal-profile .pp-page[data-preview-open="true"] .pp-preview { display: block; }
  #portal #portal-profile .pp-page .pp-close-preview { display: inline-flex; }
  #portal #portal-profile .pp-page .profile-actions button { width: auto; }
  /* The legacy mobile card rule sets important padding on the standalone editor. */
  #portal #portal-profile .smart-card-editor { padding: 0 !important; }
}

@media (max-width: 390px) {
  #portal #portal-profile .profile-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #portal #portal-profile .profile-actions > button { flex-basis: 100%; }
  #portal-profile .profile-photo-controls { min-width: 0; }
  #portal-profile .smart-card-fields fieldset { padding: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  #portal-profile .pp-page * { scroll-behavior: auto !important; transition: none !important; }
}
