/* ========================================================================
   PromXAI Theme 2.0.21-test537 — Global Visual System Refinement
   Scope: typography clarity, semantic text contrast, icon language, subtle
   borders and interactive states. No layout, spacing or responsive geometry.
   ======================================================================== */

:root,
html[data-theme="dark"] {
  /* Keep the approved brand palette; strengthen only semantic reading layers. */
  --px-text-primary:#f8faff;
  --px-text-strong:#ffffff;
  --px-text-secondary:#c4cedd;
  --px-text-soft:#c4cedd;
  --px-text-tertiary:#9eacc0;
  --px-text-control:#e1e8f3;
  --px-muted:#c4cedd;
  --px-muted-2:#9eacc0;

  --px-line:rgb(153 171 201 / .19);
  --px-line-soft:rgb(153 171 201 / .11);
  --px-line-strong:rgb(128 151 190 / .36);
  --px-border:var(--px-line);
  --px-border-strong:var(--px-line-strong);

  --px-icon-stroke:2.10;
}

html[data-theme="light"] {
  --px-text-primary:#0d1728;
  --px-text-strong:#081321;
  --px-text-secondary:#3d4e67;
  --px-text-soft:#3d4e67;
  --px-text-tertiary:#53637a;
  --px-text-control:#24364f;
  --px-muted:#3d4e67;
  --px-muted-2:#53637a;

  --px-line:rgb(43 59 87 / .15);
  --px-line-soft:rgb(43 59 87 / .085);
  --px-line-strong:rgb(61 82 119 / .29);
  --px-border:var(--px-line);
  --px-border-strong:var(--px-line-strong);

  --px-icon-stroke:2.10;
}

/* ------------------------------------------------------------------------
   Typography: readable at phone, tablet, laptop and desktop densities.
   Existing font families and all font sizes remain owned by their components.
   ------------------------------------------------------------------------ */
body {
  font-weight:500;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

:where(p, li, label, input, textarea, select) {
  font-weight:500;
}

:where(small, time, figcaption) {
  font-weight:600;
}

:where(h1,h2,h3,h4,h5,h6,
  .px-page-heading h1,
  .px-prompt-head h1,
  .px-request-hero h1,
  .px-how-hero h1,
  .px-pro-hero h1) {
  color:var(--px-text-strong);
  font-weight:700;
}

:where(button,[role="button"],.px-primary-button,.px-secondary-button,.px-card-view,.px-library-download-button) {
  font-weight:700;
}

/* Metadata and muted copy must remain secondary, not faint. */
:where(
  .px-project-summary,
  .px-library-card__summary,
  .px-ai-command-card__summary,
  .px-ai-tools__hero p,
  .px-how-copy-note,
  .px-how-mistakes li,
  .px-auth-form > label,
  .px-required-note
) {
  color:var(--px-text-secondary);
}

/* ------------------------------------------------------------------------
   Unified icon language. Small controls receive a slightly stronger stroke
   because 16–18 px glyphs visually thin out on high-density displays.
   ------------------------------------------------------------------------ */
.px-icon {
  stroke-width:var(--px-icon-stroke,2.10);
}

:where(
  .px-icon-button,
  .px-toolbar-button,
  .px-back-button,
  .px-gallery-arrow,
  .px-detail-theme-toggle,
  .px-detail-lang-toggle,
  .px-media35-tool,
  .px-ai-command-card__copy,
  .px-global-search-dialog__close,
  .px-global-search-dialog__tool
) .px-icon {
  stroke-width:2.18;
}

:where(
  .px-icon-button,
  .px-toolbar-button,
  .px-back-button,
  .px-detail-theme-toggle,
  .px-detail-lang-toggle,
  .px-global-search-dialog__close,
  .px-global-search-dialog__tool
) {
  color:var(--px-text-control);
}

/* ------------------------------------------------------------------------
   Component palettes that historically carried their own weaker text values.
   Tie them back to the canonical semantic system without changing brand color.
   ------------------------------------------------------------------------ */
.px-ai-commands {
  --ac-text:var(--px-text-primary);
  --ac-muted:var(--px-text-secondary);
}
.px-ai-command-card__title small,
.px-ai-command-card__summary,
.px-ai-command-card__tag,
.px-ai-command-card__copy {
  color:var(--px-text-secondary);
}

.px-phone-contact-dialog {
  --px-contact-text:var(--px-text-primary);
  --px-contact-muted:var(--px-text-secondary);
  --px-contact-line:var(--px-line);
  --px-contact-line-strong:var(--px-line-strong);
}

.px-global-search-dialog {
  --px-search-text:var(--px-text-primary);
  --px-search-muted:var(--px-text-secondary);
  --px-search-line:var(--px-line);
  --px-search-line-strong:var(--px-line-strong);
}

.promxai-prompt-focus .px-prompt-detail-140 {
  --px-139-text:var(--px-text-primary);
  --px-139-muted:var(--px-text-secondary);
  --px-139-line:var(--px-line);
}

html.px-prompt-phone-runtime body.single-promxai_prompt {
  --px-phone-view-text:var(--px-text-primary);
  --px-phone-view-muted:var(--px-text-secondary);
  --px-phone-view-border:var(--px-line-strong);
}

/* Shared workspace rail: preserve its distinctive surface, normalize copy. */
.px-account-v3__rail {
  --px-rail-text:var(--px-text-primary);
  --px-rail-muted:var(--px-text-secondary);
}

/* Form readability across every service surface. */
:where(input,textarea,select) {
  color:var(--px-text-primary);
}
:where(input,textarea)::placeholder {
  color:var(--px-text-tertiary);
  opacity:.94;
}

/* Subtle controls must still read as controls in both modes. */
:where(.px-icon-button,.px-toolbar-button,.px-back-button,.px-gallery-arrow) {
  border-color:var(--px-line);
}
:where(.px-icon-button,.px-toolbar-button,.px-back-button,.px-gallery-arrow):hover,
:where(.px-icon-button,.px-toolbar-button,.px-back-button,.px-gallery-arrow):focus-visible {
  border-color:var(--px-line-strong);
}

/* Phone/tablet: keep the same visual system; only reinforce small-label weight. */
@media (max-width: 1024px) {
  :where(small,time,figcaption,.px-mobile-app-dock span,.px-workspace-rail-nav__item) {
    font-weight:600;
  }
  :where(.px-mobile-app-dock .px-icon,.px-workspace-rail-nav__item .px-icon) {
    stroke-width:2.18;
  }
}

/* Respect reduced-motion while keeping visual states intact. */
@media (prefers-reduced-motion: reduce) {
  .px-icon { transition:none; }
}
