/* Version 174: reuse the quiet grey glass language for existing public fields.
   Scoped to public pages; form structure, validation, focus and actions stay owned
   by their existing controllers. Wrapped searches keep one continuous surface. */
body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) {
  --st-field-surface-174: linear-gradient(142deg, #f1f4f8, #f8fafc 48%, #eef3f7);
  --st-field-base-174: #f4f7fa;
  --st-field-ink-174: #20262f;
  --st-field-muted-174: #576271;
  --st-field-line-174: #bbc6d2;
}
html[data-theme="dark"] body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) {
  --st-field-surface-174: linear-gradient(142deg, #24252b, #292a31 48%, #202127);
  --st-field-base-174: #25262c;
  --st-field-ink-174: #f0f1f4;
  --st-field-muted-174: #bcc0cb;
  --st-field-line-174: #535761;
}

/* Text, contact, billing, optional message, glossary and select controls. */
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-lead-form input:not([type="hidden"], [type="radio"], [type="checkbox"]),
  .st-lead-form textarea, .st-lead-form select,
  .st-billing-grid input, .st-coupon input,
  .ix-glossary-search input, .ix-test-row input, .ix-sort select,
  .wp-packages .wp-plan-select
) {
  background: var(--st-field-surface-174);
  color: var(--st-field-ink-174);
  caret-color: var(--st-field-ink-174);
  color-scheme: light;
}
html[data-theme="dark"] body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-lead-form input:not([type="hidden"], [type="radio"], [type="checkbox"]),
  .st-lead-form textarea, .st-lead-form select,
  .st-billing-grid input, .st-coupon input,
  .ix-glossary-search input, .ix-test-row input, .ix-sort select,
  .wp-packages .wp-plan-select
) { color-scheme: dark; }

/* The package configurator's older dark skin targets all fields with two
   type exclusions. Match that specificity without changing its state rules. */
html[data-theme="dark"] body.st-home .wp-packages .wp-config :is(
  select, textarea, input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"])
) {
  background: var(--st-field-surface-174);
  color: var(--st-field-ink-174);
  caret-color: var(--st-field-ink-174);
  color-scheme: dark;
}

html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-lead-form input:not([type="hidden"], [type="radio"], [type="checkbox"]),
  .st-lead-form textarea, .st-lead-form select,
  .st-billing-grid input, .st-coupon input,
  .ix-glossary-search input, .ix-test-row input, .ix-sort select
):not(:focus, [aria-invalid="true"], :user-invalid) {
  border-color: var(--st-field-line-174);
}
/* The existing callback select has a section-ID rule in the shared skin. */
html body:is(.st-home, .st-acquisition-page) #kontakt .st-lead-form select,
html[data-theme="dark"] body:is(.st-home, .st-acquisition-page) #kontakt .st-lead-form select {
  background: var(--st-field-surface-174);
  color: var(--st-field-ink-174);
}
html body:is(.st-home, .st-acquisition-page) #kontakt .st-lead-form select:not(:focus, [aria-invalid="true"], :user-invalid) {
  border-color: var(--st-field-line-174);
}
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-lead-form input, .st-lead-form textarea,
  .st-billing-grid input, .st-coupon input,
  .ix-glossary-search input, .ix-test-row input
)::placeholder {
  color: var(--st-field-muted-174);
  opacity: 1;
}

/* Paint the wrapper instead of giving its inner input a second rectangle. */
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-faq-search, .st-advisor-ai-field, .ix-search-surface, .st-ai-followup
) { background: var(--st-field-surface-174); }
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-faq-search, .st-advisor-ai-field
):not(:focus-within) { border-color: var(--st-field-line-174); }
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-faq-search input, .st-advisor-ai-field input,
  .ix-search-surface input, .st-ai-followup textarea
) {
  background: transparent;
  color: var(--st-field-ink-174);
  caret-color: var(--st-field-ink-174);
}
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
  .st-faq-search input, .st-advisor-ai-field input,
  .ix-search-surface input, .st-ai-followup textarea
)::placeholder { color: var(--st-field-muted-174); opacity: 1; }

/* Preserve the red border, breathing glow, ready state and focus outline. The
   opaque inner plane also needs the gradient or it would cover this surface. */
html body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface,
html body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface::after,
html[data-theme="dark"] body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface,
html[data-theme="dark"] body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface::after {
  background: var(--st-field-surface-174);
  color: var(--st-field-ink-174);
}
html body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface input,
html[data-theme="dark"] body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface input {
  background: transparent;
  color: var(--st-field-ink-174);
  caret-color: var(--st-field-ink-174);
}
html body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface input::placeholder,
html[data-theme="dark"] body:is(.st-home, .insights-page) .st-ai-search .st-ai-surface input::placeholder {
  color: var(--st-field-muted-174);
  opacity: 1;
}

/* Mira retains an opaque writing surface over its transparent chat panel. */
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page)
  .st-support.st-mira-v113 :is(.st-support-composer, .st-support-composer textarea) {
  background: var(--st-field-surface-174);
  color: var(--st-field-ink-174);
}
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page)
  .st-support.st-mira-v113 .st-support-composer:not(:focus-within) {
  border-color: var(--st-field-line-174);
}
html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page)
  .st-support.st-mira-v113 .st-support-composer textarea::placeholder {
  color: var(--st-field-muted-174);
  opacity: 1;
}

/* Readable native option menus and no input zoom on small touch screens. */
html body:is(.st-home, .insights-page, .st-acquisition-page) :is(
  .st-lead-form select, .ix-sort select, .wp-plan-select
) option { background: var(--st-field-base-174); color: var(--st-field-ink-174); }
@media (max-width: 767px) {
  html body:is(.st-home, .insights-page, .about-page, .public-utility-page, .st-acquisition-page) :is(
    .st-faq-search input, .st-advisor-ai-field input, .st-ai-surface input,
    .ix-search-surface input, .ix-glossary-search input, .ix-test-row input,
    .ix-sort select, .st-lead-form select, .wp-packages .wp-plan-select
  ) { font-size: 16px; }
  html body:is(.st-home, .st-acquisition-page) #kontakt .st-lead-form select { font-size: 16px; }
}
