/* Portal shell adapters; provider rows, controls and tabs share the IT stylesheet. */
#profile-dialog {
  width: min(860px, calc(100vw - 32px));
  max-width: 860px;
  --color-bg-secondary: var(--canvas);
  --color-bg-hover: var(--subtle);
  --color-border-hover: var(--muted);
}
/* Nested overlays sit above the dialog's sticky tab strip and footer. */
#profile-dialog .modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 10; }
#profile-dialog [hidden] { display: none !important; }
#profile-dialog .modal-overlay { position: absolute; inset: 0; background: #0008; backdrop-filter: blur(4px); }
#profile-dialog .modal-content { position: relative; width: min(680px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); }
#profile-dialog .modal-header, #profile-dialog .modal-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; }
#profile-dialog .modal-header { border-bottom: 1px solid var(--line); }
#profile-dialog .modal-header h2 { margin: 0; font-size: 18px; font-weight: 600; }
#profile-dialog .modal-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; margin-right: -6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); }
#profile-dialog .modal-close:hover { background: var(--subtle); color: var(--ink); }
#profile-dialog .modal-actions { border-top: 1px solid var(--line); }
#profile-dialog .modal-body { padding: 16px 20px; }
#profile-dialog .modal-actions { justify-content: flex-end; }
#profile-dialog .form-input { width: 100%; min-width: 0; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); }
#profile-dialog .form-row { margin-bottom: 14px; }
#profile-dialog .btn-primary { background: var(--action-bg); color: var(--action-text); }
#profile-dialog .provider-task-mode input[type="radio"]:checked + label { background: var(--action-bg); color: var(--action-text); }
#profile-dialog .btn-danger { color: var(--danger); }
#profile-dialog .profile-section-desc, #personal-ai-description { color: var(--muted); line-height: 1.5; }
#profile-dialog .signin-step { display: flex; gap: 12px; margin: 10px 0; }
#profile-dialog .step-number { background: var(--accent-soft); border-radius: 50%; padding: 2px 8px; }
#profile-dialog .secure-redirect-notice { background: var(--subtle); padding: 12px; border-radius: 8px; margin-bottom: 12px; }
#profile-dialog .secure-redirect-body { font-size: 13px; line-height: 1.5; }
#personal-ai-error { color: var(--danger); }

/* Shared manager messages use Portal colors in both appearance modes. */
#profile-dialog .inline-message {
  padding: 10px 14px;
  border: 1px solid;
  border-radius: var(--radius-medium);
  font-size: 13px;
  margin-bottom: 16px;
}
#profile-dialog .inline-message.error {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface));
  border-color: var(--danger);
  color: var(--danger);
}
#profile-dialog .inline-message.success {
  --message-success: #18733a;
  background: color-mix(in srgb, var(--message-success) 10%, var(--surface));
  border-color: var(--message-success);
  color: var(--message-success);
}
:root[data-theme="dark"] #profile-dialog .inline-message.success {
  --message-success: #8adea2;
}
#profile-dialog .inline-message.info {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--ink);
}
