/* ==========================================================================
   Profile (#/profile) — layout only. Every visual piece (card, badge, stat tile, field, button) comes
   from base.css, so the page is indistinguishable in language from the rest of the product.
   ========================================================================== */

/* ---------- identity card ---------- */
.pfl-id { display: flex; flex-direction: column; gap: var(--sp-4); }
.pfl-id-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-3) var(--sp-4); }
.pfl-avatar { --av: 64px; border-radius: var(--radius-md); }
.pfl-id-main { min-width: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.pfl-name { font-size: 1.25rem; line-height: 1.3; overflow-wrap: anywhere; }
.pfl-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.pfl-badges:empty { display: none; }
.pfl-email { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; font-size: var(--fs-md); color: var(--text-muted); }
.pfl-email i { flex: none; }
.pfl-ellipsis { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfl-edit { grid-column: 1 / -1; width: 100%; }

.pfl-details { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated-2); }
.pfl-detail { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); min-width: 0; }
.pfl-detail + .pfl-detail { border-top: 1px solid var(--border); }
.pfl-detail dt { flex: none; display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.pfl-detail dt i { width: 16px; text-align: center; }
.pfl-detail dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--sp-2); min-width: 0; font-weight: 700; text-align: right; overflow-wrap: anywhere; }
.pfl-muted { color: var(--text-muted); font-weight: 500; }
.pfl-roll-pop { animation: pfl-pop 0.45s ease-out; }
@keyframes pfl-pop { 0% { transform: scale(0.9); opacity: 0.4; } 100% { transform: scale(1); opacity: 1; } }

@media (min-width: 760px) {
  .pfl-id-top { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pfl-avatar { --av: 72px; }
  .pfl-edit { grid-column: auto; width: auto; }
  .pfl-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pfl-detail { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: var(--sp-1); }
  .pfl-detail + .pfl-detail { border-top: 0; border-inline-start: 1px solid var(--border); }
  .pfl-detail dd { justify-content: flex-start; text-align: left; }
}

/* ---------- settings: personal information | password ---------- */
.pfl-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--page-gap); align-items: start; }
@media (min-width: 1000px) { .pfl-grid { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); } }
.pfl-fields { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: var(--sp-4); }
@media (min-width: 560px) { .pfl-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pfl-wide { grid-column: 1 / -1; } }
.pfl-actions { display: flex; justify-content: flex-end; margin-top: var(--sp-1); }
.pfl-actions .btn { width: 100%; }
@media (min-width: 560px) { .pfl-actions .btn { width: auto; min-width: 160px; } }
.pfl-roll-actions { display: flex; flex: none; }
.pfl-link { color: var(--accent-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.pfl-google .card-head { margin-bottom: 0; align-items: flex-start; }

/* ---------- sign out: a compact danger card, not a hero ---------- */
.pfl-signout { display: flex; flex-direction: column; gap: var(--sp-4); }
.pfl-signout .btn { width: 100%; }
@media (min-width: 640px) {
  .pfl-signout { flex-direction: row; align-items: center; justify-content: space-between; }
  .pfl-signout .btn { width: auto; flex: none; }
}
