/* Contacts keeps compact rows while using the shared member appearance. */
.profiles-shell {
  --bg: var(--theme-canvas);
  --card: var(--theme-surface);
  --text: var(--theme-text);
  --muted: var(--theme-muted);
  --line: var(--theme-border);
  --soft: var(--theme-surface-strong);
  color: var(--text);
  font: 15px/1.4 var(--ds-font-family);
}
.profiles-content { max-width: 700px; margin: auto; padding: 12px 14px 24px; }
.profiles-shell .theme-logo-light { display: none; }
html[data-theme="light"] .profiles-shell .theme-logo-dark { display: none; }
html[data-theme="light"] .profiles-shell .theme-logo-light { display: block; }
.profiles-shell .app-primary-navigation a[aria-current="location"] { border-color: var(--line); background: var(--soft); color: var(--text); }
.profiles-shell .app-bottom-navigation { background: var(--card); border-color: var(--line); }
.profiles-shell .app-bottom-navigation-item { color: var(--muted); }
.profiles-shell .app-bottom-navigation-item.active { color: var(--text); }
.profiles-content a { color: var(--text); }
.profiles-content :is(button,input,textarea,select) { font: inherit; touch-action: manipulation; }
.profiles-content button, .profiles-tools a, #contacts-back, .head-actions a, .status-actions a {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text);
  padding: 8px 12px; font-weight: 600; text-decoration: none;
}
.profiles-content button:disabled { opacity: .6; cursor: default; }
.profiles-content .primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 700; }
.profiles-content :is(input,textarea,select) { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); font-size: 16px; }
.profiles-content textarea { resize: vertical; min-height: 64px; }
.profiles-content label { color: var(--text); font-weight: 600; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.page-header h1 { margin: 0; color: var(--text); font-size: 24px; line-height: 1.2; letter-spacing: -.025em; }
.profiles-tools { display: flex; align-items: center; gap: 6px; }
.profiles-tools a, #contacts-back { font-size: 13px; padding-inline: 9px; white-space: nowrap; }
#contacts-back { border: 0; padding-left: 0; background: transparent; }
#status { color: var(--muted); margin: 10px 0; }
#status-message { margin: 0; }
.status-actions { display: flex; gap: 8px; margin-top: 8px; }
.status-actions:has(> [hidden]):not(:has(> :not([hidden]))) { display: none; }
#search { margin: 0 0 10px; }
#people { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.person { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 5px 10px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person:hover { background: var(--soft); }
.initials { display: grid; place-items: center; flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--soft); color: var(--text); font-size: 11px; font-weight: 700; }
.person strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.person small { display: block; font-size: 12px; color: var(--muted); line-height: 15px; }
.person .arrow { margin-left: auto; }
.person-lines { min-width: 0; flex: 1; }
.person-top { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.person-top small { white-space: nowrap; }
.person-lines>small { overflow-wrap: anywhere; }
.profile-head { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.profile-head h1 { font-size: 22px; line-height: 1.15; letter-spacing: -.025em; margin: 0; color: var(--text); overflow-wrap: anywhere; }
.head-actions { margin-left: auto; display: flex; gap: 5px; flex: 0 0 auto; }
.profile-avatar { width: 48px; height: 48px; flex: 0 0 48px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--soft); color: var(--text); font-size: 18px; font-weight: 700; }
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profiles-content .card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; }
.profiles-content dl { display: grid; grid-template-columns: 90px minmax(0,1fr); gap: 10px 12px; margin: 0; }
.profiles-content dt { font-size: 12px; color: var(--muted); padding-top: 2px; }
.profiles-content dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.profiles-content dd a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; text-underline-offset: 3px; }
.private-tag { font-size: 11px; color: var(--muted); }
.profiles-content .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.field { margin: 10px 0; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.field-heading>label { font-size: 13px; }
.profiles-content .sharing, .check-label { display: flex; align-items: center; gap: 7px; min-height: 44px; font-size: 13px; }
.profiles-content .sharing { padding: 0 6px; color: var(--muted); }
.profiles-content :is(.sharing,.check-label) input { display: inline-block; width: 18px; min-height: 18px; height: 18px; flex: 0 0 18px; margin: 0; padding: 0; accent-color: var(--text); }
.photo-settings, .team-roles { font-size: 13px; margin: 8px 0 12px; }
.profiles-content summary { display: list-item; cursor: pointer; color: var(--text); padding: 12px 0; min-height: 44px; font-weight: 600; }
.photo-settings input { font-size: 13px; margin: 5px 0; }
.photo-settings .actions { margin: 5px 0; }
.profiles-content dialog { width: min(540px,calc(100vw - 24px)); max-width: none; margin: auto; max-height: 90dvh; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--text); padding: 16px; }
.profiles-content dialog::backdrop { background: #0007; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 20px; color: var(--text); }
.edit-note { font-size: 12px; color: var(--muted); margin: 8px 0; }
.profiles-content .dialog-heading button { min-width: 44px; border: 0; font-size: 20px; }
.preview-label { font-size: 14px; font-weight: 650; }
.empty { padding: 10px; color: var(--muted); }
.profiles-content :focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.role-badges { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.role-badges span { font-size: 10px; line-height: 16px; padding: 0 4px; border: 1px solid currentColor; border-radius: 4px; opacity: .8; }
.team-roles p { margin: 6px 0; }
.team-roles form, .team-roles fieldset { display: grid; gap: 10px; }
.team-roles form { padding: 10px 0; }
.team-roles fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
#save-status, #roles-status, #photo-status { color: var(--muted); }
@media(min-width:760px) { .profiles-content { padding-top: 20px; } }
@media(max-width:350px) {
  .profiles-content { padding: 8px 10px 20px; }
  .page-header { gap: 5px; }
  .page-header h1 { font-size: 22px; }
  .profiles-tools { gap: 4px; }
  .profiles-tools a { padding-inline: 7px; font-size: 12px; }
  .profile-head { gap: 8px; }
  .profile-head h1 { font-size: 20px; }
  .profiles-content dl { grid-template-columns: 76px minmax(0,1fr); gap: 8px; }
}
