/* Profile surfaces share the white and blue application palette. */
.profile-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 0 64px;
  color: var(--ink, #10203F);
}
.profile-heading { margin-bottom: 24px; }
.profile-heading .eyebrow {
  margin-bottom: 8px;
  color: var(--accent, #0000FF);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
}
.profile-heading h1 { margin: 0 0 12px; font-size: 36px; line-height: 1.35; letter-spacing: -.6px; font-weight: 400; }
.profile-heading p:last-child { margin: 0; color: var(--muted, #52617F); font-size: 15px; line-height: 1.65; }
.profile-public-notice {
  margin: 0 0 24px;
  padding: 16px 24px;
  border: 1px solid var(--line, #D8E2F5);
  border-radius: 16px;
  background: var(--surface-raised, #F0F4FF);
  color: var(--accent, #0000FF);
  font-size: 14px;
  line-height: 1.65;
}
.profile-saved, .profile-form {
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--line, #D8E2F5);
  border-radius: 20px;
  background: var(--surface, #F7F9FF);
  box-shadow: none;
}
.profile-saved > .button-primary { min-width: 144px; margin-top: 26px; }
.profile-identity { display: flex; align-items: center; gap: 24px; min-width: 0; }
.profile-identity > div { min-width: 0; }
.profile-identity h2 { margin: 0 0 9px; color: var(--ink, #10203F); font-size: 24px; line-height: 1.4; letter-spacing: -.35px; overflow-wrap: anywhere; font-weight: 600; }
.profile-picture {
  display: grid;
  flex: none;
  place-items: center;
  width: 100px;
  height: 100px;
  overflow: hidden;
  border: 2px solid var(--line, #D8E2F5);
  border-radius: 50%;
  background: var(--surface-raised, #F0F4FF);
  color: var(--accent, #0000FF);
  font-size: 32px;
  font-weight: 600;
  box-shadow: none;
}
.profile-picture img, .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.avatar { overflow: hidden; }
.user-avatar > .avatar { width: 100%; height: 100%; margin: 0; border: 0; }
.session-controls { min-width: 0; max-width: 100%; }
#session-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-button { flex: none; padding: 0; cursor: pointer; }
.profile-avatar-button:hover { z-index: 2; outline: 1px solid var(--accent, #0000FF); outline-offset: 2px; }
.profile-avatar-button:focus-visible { z-index: 2; outline: 2px solid var(--accent, #0000FF); outline-offset: 3px; }
.profile-meta { margin: 0; color: var(--muted, #52617F); font-size: 14px; line-height: 1.65; }
.profile-about { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line, #D8E2F5); }
.profile-about h3 { margin: 0 0 12px; color: var(--accent, #0000FF); font-size: 14px; font-weight: 600; }
.profile-about p { margin: 0; color: var(--ink, #10203F); font-size: 15px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.profile-photo-editor { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; padding-bottom: 24px; border-bottom: 1px solid var(--line, #D8E2F5); }
.profile-photo-editor > div { min-width: 0; }
.profile-photo-preview { flex: none; }
.profile-photo-editor strong { display: block; margin-bottom: 8px; color: var(--ink, #10203F); font-size: 15px; font-weight: 600; }
.profile-photo-editor p { margin: 0 0 12px; color: var(--muted, #52617F); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.profile-photo-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.profile-photo-actions .button-secondary { min-height: 44px; padding: 12px 16px; font-size: 14px; }
.profile-photo-actions .refresh-button { min-height: 44px; color: var(--muted, #52617F); font-size: 13px; }
.profile-photo-actions .refresh-button:hover:not(:disabled) { color: var(--ink, #10203F); }
.profile-file-label { position: relative; overflow: hidden; cursor: pointer; }
.profile-file-label input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.profile-file-label:focus-within { outline: 2px solid var(--accent, #0000FF); outline-offset: 3px; }
.profile-file-label:has(input:disabled) { background: #EEF1F7; color: #5D6B87; cursor: not-allowed; }
.profile-file-label input:disabled { cursor: not-allowed; }
#profile-photo-status { margin: 11px 0 0; color: var(--accent, #0000FF); font-size: 12px; }
#profile-photo-status:empty { display: none; }
.profile-form { color-scheme: light; }
.profile-form .form-field { margin-bottom: 24px; }
.profile-form .form-field > label { color: var(--ink, #10203F); font-size: 14px; font-weight: 600; }
.profile-form .form-field input, .profile-form .form-field textarea, .profile-form .form-field select {
  min-width: 0;
  padding: 12px 16px;
  border: 1px solid var(--line, #D8E2F5);
  border-radius: 14px;
  background: var(--paper, #F7F9FF);
  color: var(--ink, #10203F);
  font-size: 16px;
  line-height: 1.65;
  caret-color: var(--accent, #0000FF);
}
.profile-form .form-field textarea { min-height: 128px; resize: vertical; }
.profile-form .form-field input::placeholder, .profile-form .form-field textarea::placeholder { color: var(--muted, #52617F); opacity: 1; }
.profile-form .form-field input:focus, .profile-form .form-field textarea:focus, .profile-form .form-field select:focus {
  border-color: var(--accent, #0000FF);
  outline: 1px solid var(--accent, #0000FF);
  outline-offset: 2px;
}
.profile-form .form-field input:disabled, .profile-form .form-field textarea:disabled, .profile-form .form-field select:disabled { background: #EEF1F7; color: #5D6B87; cursor: not-allowed; }
.profile-form .form-field small, .profile-form .optional-label { color: var(--muted, #52617F); font-size: 12px; line-height: 1.75; }
.profile-form .required-dot { color: var(--accent, #0000FF); }
.profile-form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; padding-top: 24px; border-top: 1px solid var(--line, #D8E2F5); }
.profile-form-actions button { min-height: 48px; font-size: 15px; }
.profile-section .button-primary { background: #FFFFFF; color: var(--brand, #0000FF); border-color: var(--brand, #0000FF); box-shadow: none; }
.profile-section .button-primary:hover:not(:disabled) { background: #F0F4FF; }
.profile-section .button-primary:disabled, .profile-section .button-secondary:disabled, .user-profile-dialog .button-secondary:disabled { background: #EEF1F7; color: #5D6B87; border-color: var(--line, #D8E2F5); opacity: 1; }
.profile-section .button-secondary, .user-profile-dialog .button-secondary { border-color: var(--line, #D8E2F5); background: var(--surface-raised, #F0F4FF); color: var(--ink, #10203F); }
.profile-section .button-secondary:hover:not(:disabled), .user-profile-dialog .button-secondary:hover:not(:disabled) { border-color: #9AAFE0; background: #E7EEFF; }
.profile-section button:focus-visible, .user-profile-dialog button:focus-visible { outline: 2px solid var(--accent, #0000FF); outline-offset: 3px; }
.profile-section .error-message, .user-profile-dialog .error-message { border: 1px solid #E8B6C3; background: #FFF1F4; color: #A91E43; font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
#profile-retry { margin-top: 8px; }
.user-profile-dialog { max-width: 480px; border-color: var(--line, #D8E2F5); background: var(--surface, #F7F9FF); color: var(--ink, #10203F); box-shadow: none; }
.user-profile-dialog .dialog-heading { margin-bottom: 24px; }
.user-profile-dialog .dialog-heading h2 { color: var(--ink, #10203F); font-size: 24px; font-weight: 600; }
.user-profile-dialog .profile-picture { width: 84px; height: 84px; font-size: 30px; }
.user-profile-dialog .profile-identity { gap: 20px; }
.user-profile-dialog .profile-identity h2 { font-size: 24px; }
.profile-view-note, .profile-view-loading { margin: 24px 0 0; color: var(--muted, #52617F); font-size: 13px; line-height: 1.65; }
button.member-chip { font-family: inherit; cursor: pointer; }
button.member-chip:hover { border-color: #9AAFE0; background: var(--surface-raised, #F0F4FF); color: var(--ink, #10203F); }
button.member-chip:focus-visible { outline: 2px solid var(--accent, #0000FF); outline-offset: 3px; }
.chat-profile-button { display: inline-flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border-radius: 5px; color: var(--ink, #10203F); font-size: inherit; font-weight: 600; text-align: left; min-height: 32px; }
.chat-profile-button strong { min-width: 0; overflow-wrap: anywhere; }
.chat-profile-button .avatar { width: 26px; height: 26px; margin: 0; border: 0; font-size: 10px; }
.chat-profile-button:hover { color: var(--accent, #0000FF); }
.chat-profile-button:focus-visible { outline: 2px solid var(--accent, #0000FF); outline-offset: 4px; }

@media (max-width: 760px) {
  .header-inner { gap: 24px; }
  .main-nav { gap: 20px; }
  #session-name { max-width: 110px; }
}
@media (max-width: 760px) {
  .map-first-page .site-header { height: auto; min-height: 120px; }
  .header-inner { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; min-height: 120px; gap: 0 12px; padding-top: 16px; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; display: flex; align-self: stretch; width: 100%; min-width: 0; height: 48px; gap: 8px; }
  .main-nav .nav-button { flex: 1; min-width: 0; padding-inline: 4px; font-size: 18px; text-align: center; }
  .user-control, .session-controls { grid-column: 2; grid-row: 1; justify-self: end; min-width: 0; max-width: 100%; margin-left: 0; }
  .session-controls { gap: 8px; }
  #session-name { max-width: 88px; }
  .session-controls .button-secondary { padding: 8px 10px; font-size: 11px; }
  .session-controls .refresh-button { font-size: 11px; white-space: nowrap; }
  .user-picker label { font-size: 10px; }
  .user-picker select { max-width: 100px; font-size: 16px; }
}
@media (max-width: 520px) {
  .profile-section { padding-top: 30px; padding-bottom: 44px; }
  .profile-heading { margin-bottom: 22px; }
  .profile-heading h1 { font-size: 32px; }
  .profile-heading p:last-child { font-size: 14px; }
  .profile-public-notice { margin-bottom: 24px; padding: 16px; font-size: 13px; }
  .profile-saved, .profile-form { padding: 24px; border-radius: 20px; }
  .profile-picture { width: 80px; height: 80px; font-size: 30px; }
  .profile-identity { gap: 18px; }
  .profile-identity h2 { font-size: 22px; }
  .profile-photo-editor { align-items: flex-start; gap: 18px; margin-bottom: 24px; padding-bottom: 24px; }
  .profile-photo-editor p { font-size: 13px; }
  .profile-photo-actions { gap: 8px 12px; }
  .profile-form .form-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .profile-form .form-field input, .profile-form .form-field textarea, .profile-form .form-field select { font-size: 16px; }
  .profile-form-actions { gap: 10px; }
  .profile-form-actions button { flex: 1; min-width: 0; padding-inline: 12px; }
  .user-profile-dialog .profile-identity { gap: 16px; }
  .user-profile-dialog .profile-identity h2 { font-size: 21px; }
}
@media (max-width: 380px) {
  .header-inner { gap: 0 9px; }
  .main-nav { gap: 4px; }
  .main-nav .nav-button { font-size: 18px; }
  #session-name { max-width: 68px; }
  .profile-saved, .profile-form { padding: 24px 16px; }
  .profile-photo-editor { flex-direction: column; align-items: flex-start; gap: 18px; }
  .profile-identity { gap: 14px; }
  .profile-picture { width: 68px; height: 68px; font-size: 26px; }
  .profile-identity h2 { font-size: 21px; }
  .profile-form-actions button { font-size: 18px; }
  .user-profile-dialog .profile-picture { width: 68px; height: 68px; font-size: 26px; }
}

/* Profile titles and editing labels keep the shared rounded blue outline. */
.profile-section .button-primary, .profile-section .button-secondary,
.user-profile-dialog .button-secondary, .profile-form-actions button,
.profile-form .form-field > label, .profile-photo-editor strong, .profile-about h3 {
  color: #0000FF;
  font-size: 18px;
  font-weight: 400;
  line-height: 1.55;
}
.profile-identity h2, .user-profile-dialog .dialog-heading h2 { color: #0000FF; font-weight: 400; }
.profile-file-label:has(input:disabled) { -webkit-text-stroke-color: #5D6B87; }
