/* Settings keeps the existing profile forms and controller. Theme only this view,
   using the published New Generation palette, controls and surface rhythm. */
body:has(#profileShell:not(.hidden) #profileDataForm) {
  --accent: var(--brand-emerald-strong);
  --accent-dark: var(--brand-emerald-pressed);
  --blue-soft: var(--brand-emerald-soft);
  --text: #111827;
  --text-secondary: #596579;
  --muted: #596579;
  --line: #d1d5db;
  --success: var(--brand-emerald-strong);
  --service-nav-accent: var(--brand-emerald-strong);
}

#profileShell:has(#profileDataForm) {
  color: #111827;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}
#profileShell:has(#profileDataForm) .profile-main {
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
#profileShell:has(#profileDataForm) :is(.profile-hero, .profile-card) {
  min-width: 0;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 4px 18px rgb(17 24 39 / 4%);
}
#profileShell:has(#profileDataForm) .profile-hero { min-height: 0; }
#profileShell:has(#profileDataForm) .profile-hero .eyebrow {
  margin: 0 0 4px;
  color: var(--brand-emerald-strong);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
}
#profileShell:has(#profileDataForm) h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.2px;
}
#profileShell:has(#profileDataForm) h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
#profileShell:has(#profileDataForm) .profile-card { display: grid; gap: 16px; }
#profileShell:has(#profileDataForm) .section-head { margin: 0; align-items: start; }
#profileShell:has(#profileDataForm) .section-head > div { min-width: 0; }
#profileShell:has(#profileDataForm) .capacity-note {
  margin: 4px 0 0;
  color: #596579;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}
#profileShell:has(#profileDataForm) .profile-fields { gap: 12px; }
#profileShell:has(#profileDataForm) #passwordForm .profile-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#profileShell:has(#profileDataForm) label {
  min-width: 0;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  line-height: 20px;
}
#profileShell:has(#profileDataForm) input:not([type="checkbox"]) {
  min-width: 0;
  min-height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  color: #111827;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
#profileShell:has(#profileDataForm) input::placeholder { color: #737e8e; font-weight: 400; opacity: 1; }
#profileShell:has(#profileDataForm) input:is([readonly], :disabled) { color: #596579; background: #f9fafb; }
#profileShell:has(#profileDataForm) input[aria-invalid="true"] { border-color: #b91c1c; background: #fff7f7; }
#profileShell:has(#profileDataForm) input:focus { border-color: var(--brand-emerald-strong); outline: 2px solid var(--brand-emerald-strong); outline-offset: 2px; }
#profileShell:has(#profileDataForm) .confirmation-check { margin: 0; min-height: 32px; }
#profileShell:has(#profileDataForm) input[type="checkbox"] { flex: 0 0 20px; width: 20px; height: 20px; accent-color: var(--brand-emerald-strong); }
#profileShell:has(#profileDataForm) .button {
  justify-self: start;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 16px;
  color: #111827;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
}
#profileShell:has(#profileDataForm) .button.primary { border-color: var(--brand-emerald-strong); background: var(--brand-emerald-strong); color: #fff; }
#profileShell:has(#profileDataForm) .button:hover:not(:disabled) { border-color: var(--brand-emerald-strong); background: var(--brand-emerald-soft); }
#profileShell:has(#profileDataForm) .button.primary:hover:not(:disabled) { background: var(--brand-emerald-pressed); }
#profileShell:has(#profileDataForm) .button:disabled { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; opacity: 1; }
#profileShell:has(#profileDataForm) :is(button, input, summary):focus-visible { outline: 2px solid var(--brand-emerald-strong); outline-offset: 3px; }
#profileShell:has(#profileDataForm) .auth-message { min-height: 0; font-weight: 400; overflow-wrap: anywhere; }
#profileShell:has(#profileDataForm) .auth-message:empty { display: none; }
#profileShell:has(#profileDataForm) .profile-history { margin: 0; }
#profileShell:has(#profileDataForm) .profile-history summary { width: fit-content; max-width: 100%; color: var(--brand-emerald-strong); font-size: 13px; font-weight: 500; }
#profileShell:has(#profileDataForm) .profile-history > div { grid-template-columns: 100px minmax(0, 1fr) auto; margin-top: 8px; }
#profileShell:has(#profileDataForm) .profile-history strong { min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
#profileShell:has(#profileDataForm) .profile-history time { white-space: nowrap; }

@media (max-width: 760px) {
  #profileShell:has(#profileDataForm) :is(.profile-hero, .profile-card) { padding: 16px; }
  #profileShell:has(#profileDataForm) :is(.profile-fields, #passwordForm .profile-fields) { grid-template-columns: minmax(0, 1fr); }
  #profileShell:has(#profileDataForm) .profile-history > div { grid-template-columns: 1fr; gap: 4px; }
}
@media (max-width: 480px) {
  #profileShell:has(#profileDataForm) .section-head { flex-direction: column; align-items: stretch; gap: 12px; }
  #profileShell:has(#profileDataForm) .button { width: 100%; }
}
