/* ---------- Profile & settings (top bar → your name) ---------- */
button.user-chip {
  background: transparent;
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  color: inherit;
  cursor: pointer;
  padding: 2px 8px 2px 2px;
  transition: background var(--dur-fast) var(--ease);
}
button.user-chip:hover { background: var(--surface-hover); }
button.user-chip:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.user-avatar {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid var(--border);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.user-avatar--lg { width: 72px; height: 72px; font-size: 1.625rem; }

.profile-page { display: grid; gap: 18px; align-content: start; }
.profile-head h1 { margin: 2px 0 0; }
.profile-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.profile-nav {
  display: grid;
  gap: 2px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.profile-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}
.profile-nav button i { width: 16px; text-align: center; color: var(--text-subtle); }
.profile-nav button:hover { background: var(--surface-hover); color: var(--text); }
.profile-nav button[aria-current="true"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; border-left-color: var(--accent); }
.profile-nav button[aria-current="true"] i { color: var(--accent); }
.profile-nav button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.profile-main {
  padding: 20px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
}
.profile-main h2 { margin: 0 0 2px; font-size: 1.125rem; }
.profile-sub { margin: 0 0 18px; color: var(--text-subtle); font-size: 0.84375rem; }
.profile-loading { color: var(--text-subtle); display: flex; gap: 8px; align-items: center; }
.profile-form { display: grid; gap: 16px; max-width: 640px; }
.profile-photo { display: flex; align-items: center; gap: 16px; }
.profile-photo__pic img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); display: block; }
.profile-photo__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-photo__actions .field-help { flex-basis: 100%; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.profile-preview {
  margin: 0;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.84375rem;
}
.profile-preview strong { color: var(--text); }
.profile-error { margin: 0; padding: 9px 12px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 0.84375rem; }
.profile-fieldset { border: 0; min-width: 0; }
.profile-fieldset .field-label { padding: 0; margin-bottom: 6px; }
.profile-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-choice { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); cursor: pointer; }
.profile-choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.profile-choice:has(input:focus-visible), .profile-switch:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.profile-switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.profile-switch input { margin-top: 3px; accent-color: var(--accent); }
.profile-switch span { display: grid; gap: 2px; }
.profile-switch small { color: var(--text-subtle); font-size: 0.78125rem; }
.profile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }

@media (max-width: 720px) {
  .profile-layout { grid-template-columns: 1fr; }
  .profile-nav { display: flex; overflow-x: auto; }
  .profile-nav button { border-left: 0; white-space: nowrap; }
  .profile-grid { grid-template-columns: 1fr; }
  .profile-main { padding: 16px; }
}

/* Storage */
.profile-storage { display: grid; gap: 14px; max-width: 640px; }
.profile-storage__used { margin: 0; font-size: 1.0625rem; }
.profile-storage__bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-hover); border: 1px solid var(--border); }
.profile-storage__seg--files { background: var(--accent); }
.profile-storage__seg--versions { background: var(--warning); }
.profile-storage__seg--bin { background: var(--text-subtle); }
.profile-storage__key { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.84375rem; color: var(--text-subtle); }
.profile-storage__key strong { color: var(--text); }
.profile-storage__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 2px; }
.profile-storage__largest h3 { margin: 4px 0 6px; font-size: 0.9375rem; }
.profile-storage__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.profile-storage__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.profile-storage__item:hover { background: var(--surface-hover); }
.profile-storage__item:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.profile-storage__item i { color: var(--text-subtle); }
.profile-storage__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-storage__size { color: var(--text-subtle); font-variant-numeric: tabular-nums; }
.profile-note { margin: 0; color: var(--text-subtle); }
.profile-storage__problem { margin: 0; }

/* (SecurelyX app) Plan and billing */
.profile-plan { display: grid; gap: 14px; max-width: 640px; }
.profile-plan__name { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.25rem; font-weight: 600; }
.profile-plan__facts { display: grid; margin: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.profile-plan__facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 0.875rem; }
.profile-plan__facts div:first-child { border-top: 0; }
.profile-plan__facts dt { color: var(--text-subtle); }
.profile-plan__facts dd { margin: 0; color: var(--text); }
.profile-plan .field-help { margin: 0; }
/* (SecurelyX app: plan changes) Credit on the account, and the over-the-limit notice */
.profile-plan__credit { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 14px; border-radius: var(--radius-md); background: var(--success-soft); color: var(--text); font-size: 0.875rem; line-height: 1.5; }
.profile-plan__credit i { margin-top: 3px; color: var(--success); }
.profile-plan .plan-storage-notice { margin: 0; }
@media (max-width: 520px) { .profile-plan__facts div { grid-template-columns: 1fr; gap: 2px; } }

/* (SecurelyX app) Team (Profile and settings → Team): licences, people, shared inboxes, buying licences */
.profile-team { display: grid; gap: 22px; max-width: 680px; }
.profile-team__seats { display: grid; gap: 10px; }
.profile-team__fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.profile-team__fill.is-full { background: var(--warning); }
.profile-team__block { display: grid; gap: 10px; padding-top: 18px; border-top: 1px solid var(--border); }
.profile-team__block .field-help { margin: 0; }
.profile-team__h { margin: 0; font-size: 0.9375rem; font-weight: 600; }
.profile-team__invite { display: flex; gap: 8px; }
.profile-team__invite .input-field { flex: 1; min-width: 0; }
.profile-team__list { list-style: none; margin: 0; padding: 0; display: grid; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); }
.profile-team__list > li + li { border-top: 1px solid var(--border); }
.profile-team__row, .profile-inbox__head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.profile-team__who { display: grid; flex: 1; min-width: 0; gap: 1px; }
.profile-team__who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 0.875rem; }
.profile-team__who span { color: var(--text-subtle); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-team__btns { display: flex; gap: 6px; flex-shrink: 0; }
.profile-team__pending { background: var(--surface-sunken); color: var(--text-subtle); }
.profile-team__icon { width: 28px; text-align: center; color: var(--accent); flex-shrink: 0; }
.profile-inbox__people { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0 14px 12px 54px; border: 0; }
.profile-inbox__tick { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84375rem; cursor: pointer; }
.profile-inbox__tick input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.profile-team__stepper { display: flex; align-items: center; gap: 8px; }
.profile-team__count { min-width: 44px; text-align: center; font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.profile-team__stepper [data-lic-save] { margin-left: 8px; }
.profile-team__member { display: flex; align-items: center; gap: 14px; }
.profile-team__member .field-help { margin: 2px 0 0; }
.profile-team__lead { margin: 0; font-size: 1.0625rem; font-weight: 600; }
.user-avatar--md { width: 44px; height: 44px; font-size: 0.9375rem; }
.profile-team__warn { display: flex; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); }
@media (max-width: 560px) {
  .profile-team__row { flex-wrap: wrap; }
  .profile-team__btns { width: 100%; padding-left: 40px; }
  .profile-inbox__head { flex-wrap: wrap; }
  .profile-inbox__people { padding-left: 14px; }
}
