.profile-dialog { width: min(620px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 28px));
  padding: 0; border: 1px solid var(--line); border-radius: 16px; background: var(--panel);
  color: var(--ink); box-shadow: var(--lift-strong); overflow: hidden; }
.profile-dialog::backdrop { background: var(--overlay); }
.profile-shell { display: flex; flex-direction: column; max-height: min(760px, calc(100vh - 28px)); }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 12px; }
.profile-brand { color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; }
.profile-head h2 { margin: 4px 0 0; font-size: 22px; }
.profile-close { width: 36px; padding: 0; font-size: 23px; line-height: 1; }
.profile-tabs { display: flex; gap: 5px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.profile-tabs button { border: 0; border-radius: 8px 8px 0 0; background: transparent;
  color: var(--muted); box-shadow: none; }
.profile-tabs button.active { color: var(--accent); box-shadow: inset 0 -2px var(--accent); }
.profile-content { overflow: auto; padding: 20px 24px 26px; overscroll-behavior: contain; }
.profile-identity { display: flex; gap: 13px; align-items: center; margin-bottom: 20px; }
.profile-identity img, .profile-initial { display: grid; place-items: center; width: 48px; height: 48px;
  flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  object-fit: cover; font-size: 20px; font-weight: 800; }
.profile-identity div { min-width: 0; }
.profile-identity strong, .profile-identity span { display: block; overflow-wrap: anywhere; }
.profile-identity span, .profile-muted { color: var(--muted); font-size: 13px; }
.profile-section { padding: 18px 0; border-top: 1px solid var(--line); }
.profile-section h3 { margin: 0 0 14px; font-size: 15px; }
.profile-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.profile-fields label, .profile-inline label { display: grid; gap: 6px; min-width: 0;
  font-size: 12px; font-weight: 600; }
.profile-fields input, .profile-inline input { width: 100%; min-height: 40px; padding: 8px 10px;
  border: 1px solid var(--field-line); border-radius: 8px; background: var(--input);
  color: var(--ink); font: inherit; }
.profile-fields button { align-self: end; justify-self: start; }
.profile-inline { display: flex; align-items: end; gap: 10px; margin-top: 14px; }
.profile-inline label { flex: 1; }
.profile-inline button { min-height: 40px; }
.profile-image-actions, .profile-row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.profile-image-actions { margin-top: 12px; }
.profile-upload { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 14px;
  border: 1px solid var(--field-line); border-radius: 9px; cursor: pointer; font-size: 13px; }
.profile-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.profile-upload:focus-within { outline: 2px solid var(--accent); }
.profile-list { display: grid; gap: 8px; }
.profile-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel2); }
.profile-list-row > div:first-child { min-width: 0; }
.profile-list-row strong, .profile-list-row small { display: block; overflow-wrap: anywhere; }
.profile-list-row strong { font-size: 13px; font-weight: 600; }
.profile-list-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.profile-row-actions button, .profile-list-row > button { padding: 5px 8px; min-height: 30px; font-size: 11px; }
.profile-error, .profile-notice { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.profile-error { background: var(--badsoft); color: var(--bad); }
.profile-notice { background: var(--goodsoft); color: var(--good); }
@media (max-width: 520px) { .profile-head { padding: 18px 18px 10px; }
  .profile-tabs { padding: 0 18px; } .profile-content { padding: 16px 18px 24px; }
  .profile-fields { grid-template-columns: 1fr; }
  .profile-list-row { align-items: flex-start; flex-direction: column; }
  .profile-inline { align-items: stretch; flex-direction: column; } }
