/* prefs.js: the profile at the rail foot and its menu — who is signed in,
 * theme, Google's levels, the version line (v1 profile-trigger / profile-menu). */

.profile {
  display: flex;
  align-items: center;
  gap: var(--sv-space-2);
  width: 100%;
  min-height: 44px;
  padding: var(--sv-space-1) var(--sv-space-2);
  background: transparent;
  border: 0;
  border-radius: var(--sv-radius);
  color: var(--sv-ink);
  font-weight: 400;
  text-align: left;
}
.profile:hover, .profile[aria-expanded="true"] { background: var(--ws-hover); }
.profile-face {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--ws-selected);
  color: var(--sv-ink);
  font-size: 0.6875rem;
  font-weight: 500;
}
.profile-face img { width: 100%; height: 100%; object-fit: cover; }
.profile-copy { flex: 1; min-width: 0; display: grid; }
.profile-name, .profile-mail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-name { font-size: var(--ui-text); font-weight: 500; }
.profile-mail { color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.profile-chevron { flex: none; color: var(--sv-ink-tertiary); transform: rotate(-90deg); transition: transform var(--sv-dur-fast) var(--sv-ease-out); }
.profile[aria-expanded="true"] .profile-chevron { transform: rotate(90deg); }

.profile-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 4px);
  z-index: calc(var(--sv-z-overlay) + 1);
  display: grid;
  max-height: calc(100dvh - 6rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--sv-space-1);
}
.profile-menu[hidden] { display: none; }
.profile-head { display: flex; align-items: center; gap: var(--sv-space-2); padding: var(--sv-space-2); }
.profile-head .profile-face { width: 36px; height: 36px; font-size: var(--ui-meta); }
.profile-role {
  flex: none;
  padding: 1px var(--sv-space-2);
  border: var(--sv-hairline-w) solid var(--sv-hairline);
  border-radius: 999px;
  color: var(--sv-ink-secondary);
  font-size: var(--ui-meta);
}
.profile-sep { height: var(--sv-hairline-w); margin: var(--sv-space-1) 0; background: var(--sv-hairline); }
.profile-item {
  display: flex;
  align-items: center;
  gap: var(--sv-space-2);
  width: 100%;
  min-height: 34px;
  padding: 0 var(--sv-space-3);
  background: transparent;
  border: 0;
  border-radius: var(--sv-radius);
  color: var(--sv-ink);
  font-weight: 400;
  text-align: left;
}
.profile-item:hover, .profile-item:focus-visible { background: var(--sv-surface-sunken); }
.profile-item .icon { flex: none; color: var(--sv-ink-secondary); }
.profile-item-label { flex: 1; min-width: 0; }
.profile-item-value { color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.profile-item[aria-checked="true"] .profile-item-value { color: var(--sv-ink); }

/* Theme: one row of three, the chosen one raised. */
.profile-theme { display: grid; gap: var(--sv-space-1); padding: var(--sv-space-1) var(--sv-space-2) var(--sv-space-2); }
.profile-theme-label { color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.profile-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; background: var(--sv-surface-sunken); border-radius: var(--sv-radius); }
.profile-seg .profile-item { justify-content: center; gap: var(--sv-space-1); min-height: 30px; padding: 0 var(--sv-space-1); color: var(--sv-ink-secondary); font-size: var(--ui-meta); }
.profile-seg .profile-item-label { flex: none; }
.profile-seg .profile-item:hover { background: var(--ws-hover); }
.profile-seg .profile-item[aria-checked="true"] { background: var(--sv-surface-raised); color: var(--sv-ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.08); }
.profile-seg .profile-item[aria-checked="true"] .icon { color: var(--sv-ink); }
/* Google (google.js's panel): a note, the mail and calendar levels, Disconnect. */
.profile-note { padding: var(--sv-space-1) var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); line-height: 1.4; }
.profile-levels { display: grid; }
.profile-levels .profile-item[aria-checked="true"] { background: var(--sv-surface-sunken); }
.profile-levels .profile-item[aria-checked="true"] .icon { color: var(--sv-ink); }
/* The version the server runs: one quiet line under Sign out. */
.profile-version { display: flex; gap: var(--sv-space-2); padding: var(--sv-space-1) var(--sv-space-3); color: var(--sv-ink-tertiary); font-size: var(--ui-meta); }
.profile-version a { color: var(--sv-ink-secondary); text-decoration: none; border-radius: var(--sv-radius); }
.profile-version a:hover, .profile-version a:focus-visible { color: var(--sv-ink); text-decoration: underline; }
.profile-version-sha { font-family: var(--sv-font-mono); }
@media (max-width: 760px) { .profile-item { min-height: 44px; } }
