/* --- /profiles: Netflix-style "who's practicing" picker ---
   #profilesWrap is a flex child of the shared #pageBody (see base.css),
   which already sizes it to fill the viewport below the top bar. */

#profilesWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
}

#profilesCard {
  width: 520px;
  max-width: 92vw;
  text-align: center;
}

#profilesTitle {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  margin: 0 0 6px;
}

#profilesSubtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0 0 36px;
}

#profileTiles {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.profile-tile {
  position: relative;
  width: 104px;
}

.profile-tile-select {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
}

.profile-tile-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--panel-raised);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.profile-tile-select:hover .profile-tile-avatar,
.profile-tile-select:focus-visible .profile-tile-avatar {
  border-color: var(--accent);
  transform: scale(1.05);
}
.profile-tile.active .profile-tile-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.profile-tile-name {
  font-size: 0.85rem;
  color: var(--text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-tile-delete {
  position: absolute;
  top: -4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: #e53e3e;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.profile-tile:hover .profile-tile-delete,
.profile-tile-delete:focus-visible {
  opacity: 1;
}
.profile-tile-delete:hover { background: #e53e3e; color: #fff; }

.profile-tile-add .profile-tile-avatar {
  border-style: dashed;
  font-size: 2rem;
  font-weight: 400;
}

/* Sits between the Add-profile and Import-profile tiles (see
   profilesPage.js) - height matches .profile-tile-avatar so it lines up
   with the circles rather than the tiles' full column height (which
   includes the name label below). */
.profile-tile-or {
  display: flex;
  align-items: center;
  height: 84px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

#profilesEmptyHint {
  margin-top: 28px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- Profile detail modal (mic + languages for one profile) --- */

#profileDetailOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
#profileDetailOverlay.visible { display: flex; }

#profileDetailModal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  width: 380px;
  max-width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
}
#profileDetailModal h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  margin: 0 0 16px;
}
#profileDetailModal .sidebar-section h3 {
  margin-bottom: 8px;
}
#profileDetailLanguages .conv-option {
  cursor: pointer;
}
