/* ============================================================
   Profile — stage #017B composition
   Mobile: identity → stats → status card → entries (2-col) →
   tickets → account actions.
   Desktop: sticky identity rail (avatar, stats, account actions)
   beside the main participation column — no mobile-in-the-middle.
   ============================================================ */

.profile-grid { display: grid; gap: 16px; }
.profile-main { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.profile-main .section { margin-top: 22px; }

.profile-identity { padding: 20px; }
.profile-header { display: flex; gap: 16px; align-items: center; }
.profile-avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 176, 33, 0.55);
  box-shadow: 0 0 18px rgba(244, 176, 33, 0.12);
  object-fit: cover;
  flex: none;
}
.profile-info { min-width: 0; }
.profile-name { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.2; }
.profile-city { font-size: 13px; color: var(--muted); margin-top: 3px; }
.profile-joined { font-size: 12px; color: var(--muted); margin-top: 6px; display: inline-flex; align-items: center; gap: 6px; }
.profile-joined svg { width: 13px; height: 13px; color: var(--gold); }

.profile-stats { margin-top: 16px; }

/* status cards */
.status-card { margin-bottom: 0; }
.status-card .sc-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
/* SHARED component (stage #023 §13/§99): every .sc-head icon gets an
   explicit intrinsic size — without this, SVGs fall back to default
   300x150 intrinsic sizing and blow the card layout apart (the huge
   icon on the Profile desktop view). */
.sc-head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sc-head svg {
  width: 17px; height: 17px;
  color: var(--gold);
  flex: none;
  max-width: 17px; max-height: 17px;
}
.sc-head .h3 { min-width: 0; }
.status-card .sc-head .h3 { flex: 1; }
.status-card p { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.sc-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }

/* entries grid: 2 cols mobile, 3 cols on wide screens */
.entries-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.entries-grid .empty-state { grid-column: 1 / -1; padding: 26px 16px; }
.empty-compact { padding: 20px 16px; }
.entry-card .pending-overlay {
  position: absolute;
  top: 8px; left: 8px; right: 8px;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
}
.profile-entry-actions { padding: 0 2px; }

/* actions */
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.account-actions .btn { justify-content: flex-start; padding-left: 18px; }
.account-actions svg { width: 17px; height: 17px; }

/* quiet variant for the "submit another entry" state */
.status-card-quiet { border-color: var(--line); background: rgba(255, 255, 255, 0.02); }
.status-card-quiet .sc-head svg { color: var(--muted); }

/* legal links */
.profile-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.profile-legal a {
  padding: 10px 4px;
  margin: -10px -4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
  transition: color 0.2s;
}
.profile-legal a:hover { color: var(--gold); }

/* skeleton */
.sk-prof { display: flex; gap: 16px; align-items: center; }
.sk-av { width: 84px; height: 84px; border-radius: 50%; flex: none; }
.sk-line { height: 16px; margin-bottom: 10px; }

/* ---------- desktop: identity rail + main column ---------- */
@media (min-width: 1024px) {
  .profile-grid { grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
  .profile-side { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 0; }
  .profile-identity { padding: 22px; }
  .profile-header { flex-direction: column; align-items: flex-start; gap: 14px; }
  .profile-avatar { width: 88px; height: 88px; }
  /* stats as compact rows inside the narrow rail */
  .profile-stats { grid-template-columns: 1fr; gap: 6px; }
  .profile-stats .stat { flex-direction: row; align-items: center; justify-content: space-between; padding: 10px 14px; text-align: left; }
  .profile-stats .stat b { font-size: 16px; }
  .profile-main .section { margin-top: 26px; }
  .entries-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  /* stage #023B §14-§15: the 300px rail cannot hold three actions in a
     row — a vertical list of full-width rows, intuitive order, logout
     never dominates the primary content */
  .account-actions { flex-direction: column; gap: 8px; }
  .account-actions .btn { width: 100%; justify-content: flex-start; }
}

@media (min-width: 768px) and (max-width: 1023.98px) {
  .entries-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- avatar management (social features #025) ---------- */
#avatar-controls { margin-top: 16px; }
.avatar-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.avatar-actions .muted { margin: 2px 0 0; }
.avatar-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.avatar-preview img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid rgba(244, 176, 33, 0.55);
  flex: none;
}
.avatar-preview-actions { display: flex; gap: 8px; flex-wrap: wrap; }
