/* I2043_PROFILE_STUDIO_COACH_QUIET_EDITORIAL_STUDIO_V1
   I2044_PROFILE_STUDIO_COACH_ACCESSIBILITY_COMPLETE_V1 is additive.
   I2048_PROFILE_STUDIO_COACH_CROSS_DEVICE_UX_GREEN_V1 preserves full text contrast in bounded states.
   Visual owner: Profile Studio coach, recharge, and adjacent account claim only.
   Structural viewport/scroll safety remains owned by the I2042 block in styles.css. */

.profile-studio-page{
  --profile-studio-editorial-space-1: 4px;
  --profile-studio-editorial-space-2: 8px;
  --profile-studio-editorial-space-3: 12px;
  --profile-studio-editorial-space-4: 16px;
  --profile-studio-editorial-space-5: 24px;
  --profile-studio-editorial-space-6: 32px;
  --profile-studio-editorial-radius-sm: 6px;
  --profile-studio-editorial-radius-md: 10px;
  --profile-studio-editorial-radius-lg: 14px;
  --profile-studio-editorial-line-weight: 1px;
  --profile-studio-editorial-elevation: 0 12px 32px rgba(33, 37, 41, 0.06);
  --profile-studio-editorial-elevation-quiet: 0 6px 18px rgba(33, 37, 41, 0.045);
  --profile-studio-editorial-motion-duration: 160ms;
  --profile-studio-editorial-measure: 74ch;
  --profile-studio-editorial-reading-measure: 68ch;
  --profile-studio-editorial-question-measure: 62ch;
}

.profile-studio-page .profile-studio-coach,
.profile-studio-page .profile-studio-account-claim{
  --text-soft: #59636e; --text-faint: #59636e; --line: #7b848d; --line-strong: #59636e;
}

.profile-studio-page .profile-studio-a11y-live,
.profile-studio-page .profile-studio-a11y-description{
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.profile-studio-page .profile-studio-coach{
  gap: var(--profile-studio-editorial-space-3);
  padding: clamp(16px, 3vw, 24px);
  border: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: var(--profile-studio-editorial-radius-lg);
  background: var(--surface);
  box-shadow: var(--profile-studio-editorial-elevation);
}

.profile-studio-page .profile-studio-coach-scroll{
  gap: var(--profile-studio-editorial-space-4); scroll-padding-block-start: var(--profile-studio-editorial-space-4); scroll-padding-block-end: max(var(--profile-studio-editorial-space-4), var(--profile-studio-coach-safe-bottom));
}

.profile-studio-page .profile-studio-coach :where(
  .profile-studio-button,
  .profile-studio-coach-textarea,
  .profile-studio-coach-message,
  .profile-studio-coach-balance,
  .profile-studio-coach-status,
  .profile-studio-coach-scroll
),
.profile-studio-page .profile-studio-account-claim :where(
  .profile-studio-button,
  .profile-studio-account-claim-status
){ scroll-margin-block: 12px; }

.profile-studio-page .profile-studio-coach-header{
  gap: var(--profile-studio-editorial-space-4); padding-block-end: var(--profile-studio-editorial-space-2); border-block-end: var(--profile-studio-editorial-line-weight) solid var(--line);
}

.profile-studio-page .profile-studio-coach-heading-group{ gap: var(--profile-studio-editorial-space-2); }

.profile-studio-page .profile-studio-coach-title{
  max-inline-size: var(--profile-studio-editorial-question-measure); font-size: clamp(1.22rem, 2.6vw, 1.48rem); font-weight: 800;
  line-height: 1.24; letter-spacing: -0.025em;
}

.profile-studio-page .profile-studio-coach-lead{
  max-inline-size: 62ch; color: var(--text-soft); font-size: clamp(.92rem, 1.8vw, 1rem);
  line-height: 1.68; letter-spacing: -0.012em;
}

.profile-studio-page .profile-studio-coach-private-line{
  max-inline-size: var(--profile-studio-editorial-reading-measure); color: var(--text-soft); font-size: .8rem; line-height: 1.55;
}

.profile-studio-page .profile-studio-coach-balance{
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: var(--profile-studio-editorial-line-weight) solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--brand-strong);
  font-size: .78rem;
  font-weight: 760;
  line-height: 1.25;
  box-shadow: none;
}

.profile-studio-page .profile-studio-coach-status:not(:empty){
  max-inline-size: var(--profile-studio-editorial-reading-measure);
  padding: 10px 12px;
  border-inline-start: var(--profile-studio-editorial-line-weight) solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--text-soft);
  animation: profile-studio-editorial-enter var(--profile-studio-editorial-motion-duration) ease-out both;
}

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="generating"] .profile-studio-coach-status,
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="provider-delay"] .profile-studio-coach-status,
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="reconnecting"] .profile-studio-coach-status,
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="blocked-local"] .profile-studio-coach-status,
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="recharge-confirmed"] .profile-studio-coach-status{
  border-inline-start-color: var(--brand); color: var(--text);
}

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="provider-delay"] .profile-studio-coach-status{ border-inline-start-color: var(--line-strong); }

.profile-studio-page .profile-studio-coach-status[data-profile-studio-coach-status-kind="error"],
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-attachment-state="rejected"] .profile-studio-coach-photo-status{
  border-inline-start: 3px double var(--line-strong); padding-inline-start: 10px; font-weight: 700;
}

.profile-studio-page .profile-studio-coach-history-controls{
  width: 100%; align-items: center; justify-content: space-between;
  gap: var(--profile-studio-editorial-space-3); padding-block: var(--profile-studio-editorial-space-1);
}

.profile-studio-page .profile-studio-coach-history-controls .profile-studio-button{
  min-height: 44px;
  padding-inline: 0;
  border-radius: 0;
  color: var(--brand-strong);
  font-size: .82rem;
  font-weight: 720;
  text-align: start;
}

.profile-studio-page .profile-studio-coach-messages{
  gap: 0;
  padding: 0;
  border: 0;
  border-block: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: 0;
  background: transparent;
}

.profile-studio-page .profile-studio-coach-message{
  width: 100%;
  max-inline-size: var(--profile-studio-editorial-measure);
  gap: var(--profile-studio-editorial-space-2);
  padding: var(--profile-studio-editorial-space-4) 0;
  border: 0;
  border-block-end: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: profile-studio-editorial-enter var(--profile-studio-editorial-motion-duration) ease-out both;
}

.profile-studio-page .profile-studio-coach-message:last-child{ border-block-end: 0; }

.profile-studio-page .profile-studio-coach-message.is-assistant{
  justify-self: start; padding-inline-end: clamp(0px, 5vw, 32px);
}

.profile-studio-page .profile-studio-coach-message.is-user{
  width: min(92%, var(--profile-studio-editorial-question-measure)); justify-self: end; padding-inline-start: var(--profile-studio-editorial-space-4);
  border-inline-start: var(--profile-studio-editorial-line-weight) solid var(--brand); background: transparent;
}

.profile-studio-page .profile-studio-coach-message-meta{
  color: var(--text-soft); font-size: .72rem; font-weight: 780;
  line-height: 1.35; letter-spacing: .035em;
}

.profile-studio-page .profile-studio-coach-message.is-user .profile-studio-coach-message-meta{ color: var(--brand-strong); }

.profile-studio-page .profile-studio-coach-message-text{
  max-inline-size: var(--profile-studio-editorial-reading-measure); color: var(--text); font-size: clamp(.94rem, 1.55vw, 1rem);
  line-height: 1.72; letter-spacing: -0.008em;
}

.profile-studio-page .profile-studio-coach-message-attachment{
  width: fit-content;
  padding-block-start: var(--profile-studio-editorial-space-2);
  border-block-start: var(--profile-studio-editorial-line-weight) solid var(--line);
  color: var(--text-soft);
  font-size: .76rem;
  font-weight: 680;
}

.profile-studio-page .profile-studio-coach-empty{
  max-inline-size: var(--profile-studio-editorial-reading-measure);
  padding: var(--profile-studio-editorial-space-5) var(--profile-studio-editorial-space-4);
  border-block: var(--profile-studio-editorial-line-weight) solid var(--line);
  color: var(--text-soft);
  font-size: .92rem;
  line-height: 1.65;
  text-align: center;
}

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="empty"] .profile-studio-coach-messages{ display: none; }

.profile-studio-page .profile-studio-coach-boundary{
  padding: var(--profile-studio-editorial-space-3) 0;
  border: 0;
  border-block: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text-soft);
  font-size: .84rem;
  line-height: 1.58;
}

.profile-studio-page .profile-studio-coach-recharge{
  gap: var(--profile-studio-editorial-space-4);
  padding: var(--profile-studio-editorial-space-4);
  border: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: var(--profile-studio-editorial-radius-md);
  background: var(--surface);
  box-shadow: var(--profile-studio-editorial-elevation-quiet);
  animation: profile-studio-editorial-enter var(--profile-studio-editorial-motion-duration) ease-out both;
}

.profile-studio-page .profile-studio-coach-recharge > div{ gap: var(--profile-studio-editorial-space-1); }

.profile-studio-page .profile-studio-coach-recharge-title{
  font-size: 1rem; font-weight: 780; letter-spacing: -0.015em;
}

.profile-studio-page .profile-studio-coach-recharge-price{
  color: var(--text); font-size: .88rem; font-weight: 720;
}

.profile-studio-page .profile-studio-coach-recharge-note{
  max-inline-size: 56ch; color: var(--text-soft); font-size: .8rem; line-height: 1.55;
}

.profile-studio-page .profile-studio-coach-recharge-actions{
  align-items: center; justify-content: flex-end;
}

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-credit-state="zero"] [data-profile-studio-coach-action="recharge"]:not(:disabled),
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-payment-state="payment-unknown"] [data-profile-studio-coach-action="recharge-refresh"],
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="retryable"] [data-profile-studio-coach-action="retry"],
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="load-failed"] [data-profile-studio-coach-action="refresh"]{
  border-color: var(--brand); background: var(--brand); color: #fff; transition: none;
}

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-payment-state="payment-unknown"] [data-profile-studio-coach-action="recharge"]{ display: none; }

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="retryable"] [data-profile-studio-coach-action="send"]{ display: none; }

.profile-studio-page .profile-studio-coach-composer{
  gap: var(--profile-studio-editorial-space-3);
  padding: var(--profile-studio-editorial-space-3);
  border: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: var(--profile-studio-editorial-radius-md);
  background: var(--surface);
  box-shadow: var(--profile-studio-editorial-elevation-quiet);
  transition:
    border-color var(--profile-studio-editorial-motion-duration) ease,
    box-shadow var(--profile-studio-editorial-motion-duration) ease,
    opacity var(--profile-studio-editorial-motion-duration) ease;
}

.profile-studio-page .profile-studio-coach-composer:focus-within{
  border-color: var(--line-strong); box-shadow: var(--profile-studio-editorial-elevation);
}

.profile-studio-page .profile-studio-coach-composer-label{
  gap: var(--profile-studio-editorial-space-2); font-size: .82rem; font-weight: 760;
}

.profile-studio-page .profile-studio-coach-textarea{
  min-height: 104px;
  padding: 12px 13px;
  border: var(--profile-studio-editorial-line-weight) solid var(--line-strong);
  border-radius: var(--profile-studio-editorial-radius-sm);
  background: var(--surface-soft);
  line-height: 1.6;
  transition:
    background-color var(--profile-studio-editorial-motion-duration) ease,
    border-color var(--profile-studio-editorial-motion-duration) ease;
}

.profile-studio-page .profile-studio-coach-textarea:focus{ background: var(--surface); }

.profile-studio-page .profile-studio-coach-character-count{
  color: var(--text-faint); font-size: .72rem;
}

.profile-studio-page .profile-studio-coach-photo-area{ gap: var(--profile-studio-editorial-space-2); }

.profile-studio-page .profile-studio-coach-photo-preview{
  gap: var(--profile-studio-editorial-space-3);
  padding: var(--profile-studio-editorial-space-3);
  border: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: var(--profile-studio-editorial-radius-md);
  background: var(--surface-soft);
  animation: profile-studio-editorial-enter var(--profile-studio-editorial-motion-duration) ease-out both;
}

.profile-studio-page .profile-studio-coach-photo-preview img{ border-radius: var(--profile-studio-editorial-radius-sm); }

.profile-studio-page .profile-studio-coach-photo-progress{ accent-color: var(--brand); }

.profile-studio-page .profile-studio-coach-photo-status{ color: var(--text-soft); }

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-attachment-state="rejected"] .profile-studio-coach-photo-status{ color: var(--text); }

.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="zero-credit"] .profile-studio-coach-composer,
.profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="read-only"] .profile-studio-coach-composer{
  box-shadow: none; background: var(--surface-soft); opacity: 1;
}

.profile-studio-page .profile-studio-coach :where(button, textarea, [tabindex]):focus-visible,
.profile-studio-page .profile-studio-account-claim :where(button, [tabindex]):focus-visible,
.profile-studio-page .profile-studio-coach :where(.profile-studio-coach-message, .profile-studio-coach-balance, .profile-studio-coach-status):focus,
.profile-studio-page .profile-studio-account-claim .profile-studio-account-claim-status:focus{
  outline: 3px solid var(--brand-strong); outline-offset: 3px;
}

.profile-studio-page .profile-studio-coach .profile-studio-button,
.profile-studio-page .profile-studio-account-claim .profile-studio-button{
  min-inline-size: 44px; min-block-size: 44px;
}

.profile-studio-page .profile-studio-coach [aria-invalid="true"],
.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="unavailable"]{
  border-style: double; border-width: 3px;
}

.profile-studio-page .profile-studio-account-claim{
  gap: var(--profile-studio-editorial-space-2);
  margin-top: var(--profile-studio-editorial-space-5);
  padding: var(--profile-studio-editorial-space-5) 0 0;
  border: 0;
  border-block-start: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: 0;
  background: transparent;
}

.profile-studio-page .profile-studio-account-claim .profile-studio-paid-section-title{
  max-inline-size: var(--profile-studio-editorial-question-measure); font-size: .98rem; font-weight: 780; letter-spacing: -0.012em;
}

.profile-studio-page .profile-studio-account-claim-lead,
.profile-studio-page .profile-studio-account-claim-status{
  max-inline-size: var(--profile-studio-editorial-reading-measure); color: var(--text-soft); font-size: .82rem; line-height: 1.58;
}

.profile-studio-page .profile-studio-account-claim-controls,
.profile-studio-page .profile-studio-account-claim-providers{ gap: var(--profile-studio-editorial-space-2); }

.profile-studio-page .profile-studio-account-claim-providers .profile-studio-button{
  min-height: 44px; padding: 9px 12px; border: var(--profile-studio-editorial-line-weight) solid var(--line);
  border-radius: var(--profile-studio-editorial-radius-sm); background: var(--surface);
}

.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="saving"],
.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="saved"],
.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="unavailable"]{
  padding-inline-start: var(--profile-studio-editorial-space-3); border-inline-start: var(--profile-studio-editorial-line-weight) solid var(--line-strong);
}

.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="saved"]{
  border-inline-start-color: var(--brand); border-style: solid;
}

@keyframes profile-studio-editorial-enter{
from{
  opacity: 0; transform: translateY(4px);
}
to{
  opacity: 1; transform: translateY(0);
}
}

@media (max-width: 767px), (max-width: 900px) and (max-height: 520px){
  .profile-studio-page .profile-studio-coach{
    gap: var(--profile-studio-editorial-space-2);
    padding-top: max(12px, var(--profile-studio-coach-safe-top));
    padding-right: max(12px, var(--profile-studio-coach-safe-right));
    padding-bottom: max(10px, var(--profile-studio-coach-safe-bottom));
    padding-left: max(12px, var(--profile-studio-coach-safe-left));
    border-radius: var(--profile-studio-editorial-radius-md);
    box-shadow: none;
  }

.profile-studio-page .profile-studio-coach-scroll{ gap: var(--profile-studio-editorial-space-3); }

.profile-studio-page .profile-studio-coach-header{ gap: var(--profile-studio-editorial-space-2); }

.profile-studio-page .profile-studio-coach-message{ padding-block: var(--profile-studio-editorial-space-3); }

.profile-studio-page .profile-studio-coach-message.is-user{
  width: min(94%, var(--profile-studio-editorial-question-measure)); padding-inline-start: var(--profile-studio-editorial-space-3);
}

  .profile-studio-page .profile-studio-coach-recharge,
.profile-studio-page .profile-studio-coach-composer{
  padding: 10px; border-radius: var(--profile-studio-editorial-radius-md); box-shadow: none;
}

.profile-studio-page .profile-studio-coach-textarea{ min-height: 88px; }
}

@media (max-width: 360px){
.profile-studio-page .profile-studio-coach-balance{ min-height: 44px; }

.profile-studio-page .profile-studio-coach-message.is-user{ width: 100%; }

.profile-studio-page .profile-studio-coach-history-controls{
  align-items: stretch; flex-direction: column;
}

  .profile-studio-page .profile-studio-coach-history-controls .profile-studio-button,
  .profile-studio-page .profile-studio-account-claim-controls > .profile-studio-button,
.profile-studio-page .profile-studio-account-claim-providers .profile-studio-button{ width: 100%; }
}

@media (prefers-reduced-motion: reduce){
  .profile-studio-page .profile-studio-coach,
  .profile-studio-page .profile-studio-coach *,
  .profile-studio-page .profile-studio-account-claim,
.profile-studio-page .profile-studio-account-claim *{
  scroll-behavior: auto; animation: none; transition-duration: 0s;
  animation: none !important; transition: none !important;
}
}

@media (forced-colors: active){
  .profile-studio-page .profile-studio-coach,
  .profile-studio-page .profile-studio-coach-composer,
  .profile-studio-page .profile-studio-coach-recharge,
  .profile-studio-page .profile-studio-coach-photo-preview,
.profile-studio-page .profile-studio-account-claim{
  border-color: CanvasText; background: Canvas; color: CanvasText; box-shadow: none;
}

  .profile-studio-page .profile-studio-coach :where(
    .profile-studio-coach-header,
    .profile-studio-coach-messages,
    .profile-studio-coach-message,
    .profile-studio-coach-boundary,
    .profile-studio-coach-textarea,
    .profile-studio-coach-balance,
    .profile-studio-coach-status,
    .profile-studio-coach-photo-status,
    .profile-studio-button,
    progress
  ),
.profile-studio-page .profile-studio-account-claim :where(.profile-studio-button, .profile-studio-account-claim-status){
  border-color: ButtonText; color: CanvasText; forced-color-adjust: auto;
}

  .profile-studio-page .profile-studio-coach :where(button, textarea, [tabindex]):focus-visible,
  .profile-studio-page .profile-studio-account-claim :where(button, [tabindex]):focus-visible,
  .profile-studio-page .profile-studio-coach :where(.profile-studio-coach-message, .profile-studio-coach-balance, .profile-studio-coach-status):focus,
.profile-studio-page .profile-studio-account-claim .profile-studio-account-claim-status:focus{
  outline: 3px solid Highlight; outline-offset: 3px;
}

  .profile-studio-page .profile-studio-coach-message.is-user,
  .profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="generating"] .profile-studio-coach-status,
  .profile-studio-page .profile-studio-coach[data-profile-studio-coach-visual-state="blocked-local"] .profile-studio-coach-status,
.profile-studio-page .profile-studio-account-claim[data-profile-studio-account-claim-state="saved"]{ border-color: Highlight; }

  .profile-studio-page .profile-studio-coach .profile-studio-button:disabled,
.profile-studio-page .profile-studio-account-claim .profile-studio-button:disabled{
  color: GrayText; opacity: 1;
}
}
