/* Account entry at the foot of the workspace rail. */
@media (min-width: 981px) {
  .project-rail { display: flex; flex-direction: column; min-height: calc(100vh - 48px); }
}
.project-rail-account { min-width: 0; margin: auto 0 0; padding: 12px 2px 0; border-top: 1px solid var(--line); }
.account-entry {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 6px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.account-entry-avatar, .account-avatar-preview {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
}
.account-entry-avatar.is-guest { border: 0; background: transparent; color: var(--ink); }
.guest-avatar-art { display: block; width: 100%; height: 100%; }
.avatar-art {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-image: url("./avatar-grid.png");
  background-repeat: no-repeat;
  background-size: 768% 512%;
}
.avatar-art-replacement { background-image: url("./avatar-sunglasses-orange.png"); background-size: cover; background-position: center; }
.account-entry-copy { display: grid; gap: 2px; min-width: 0; }
.account-entry-copy strong { font-size: 11px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.account-entry-copy small { font-size: 10px; line-height: 1.3; color: var(--muted); }
.account-entry-chevron { width: 15px; height: 15px; color: var(--muted); transition: transform 150ms ease; }
.account-entry:hover, .account-entry:focus-visible { background: var(--theme-hover, #f1f2f1); }
.account-entry:hover .account-entry-avatar, .account-entry:focus-visible .account-entry-avatar { border-color: var(--ink); }
.account-entry:hover .account-entry-chevron, .account-entry:focus-visible .account-entry-chevron { transform: translateX(2px); color: var(--ink); }
.account-entry:focus-visible { outline: 3px solid var(--theme-ring, #8aa9a0); outline-offset: 2px; }

/* The active deal is marked by its dot, never a theme-coloured pill. */
:root .project-rail .project-rail-item.active,
:root .project-rail .project-rail-item.active:hover { background: transparent !important; box-shadow: none !important; }

/* One settings surface, with rules separating each preference and account action. */
.settings-view .settings-panel { max-width: 1120px; padding: 0 32px; }
.settings-panel .settings-section { max-width: none; padding: 30px 0; }
.settings-panel .settings-section + .settings-section { border-top: 1px solid var(--line); }
.settings-panel .theme-settings-heading h3 { margin-bottom: 8px; }
.settings-panel .theme-settings-heading p { max-width: 60ch; }
.settings-panel .theme-options { margin-top: 20px; }
.settings-panel .account-settings > .eyebrow { display: block; }
.settings-panel .account-settings > h3 { margin-bottom: 6px; }
.settings-panel .account-settings > p { max-width: 65ch; }
.settings-panel .account-settings > p + [data-account-form] { margin-top: 12px; }
.settings-panel .account-settings h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--ink); }
.settings-panel .account-settings .settings-subsection { border-top: 1px solid var(--line); padding: 22px 0; }
.settings-panel .account-settings .account-avatar-settings { margin-top: 24px; }
.settings-panel .account-settings .settings-subsection p { margin: 0; }
.settings-panel .account-settings .account-actions { margin: 0; }
.settings-panel .account-settings > .account-actions { margin: 18px 0; }
.settings-panel .account-settings [data-account-import]:not(:empty),
.settings-panel .account-settings .account-security-settings { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.settings-panel .account-settings .account-message { margin-top: 0; }
.settings-panel .account-settings .account-message:empty { display: none; }
.settings-panel .account-settings:has(.account-security-settings) { padding-bottom: 0; }
.account-form-actions button { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.account-form-actions:has([data-account-action="sign-in"]:is(:hover, :focus-visible)) [data-account-action="create"] { background: var(--surface); border-color: var(--line); color: var(--ink); }
.account-form-actions [data-account-action="sign-in"]:is(:hover, :focus-visible) { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (hover: hover) {
  .settings-panel .theme-option:hover,
  .settings-panel .theme-option:has(input:checked):hover { background: color-mix(in srgb, var(--theme-hover, #f1f2f1) 76%, #d5d9d7); }
}
.account-password-settings form { margin-top: 18px; }
.account-password-actions button {
  min-height: 38px;
  padding: 9px 17px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.account-password-actions [data-password-review],
.account-password-actions [data-password-confirm] { background: var(--ink); border-color: var(--ink); color: #fff; }
.account-password-actions button:hover { filter: brightness(.94); }
.account-password-actions button:disabled { cursor: wait; opacity: .6; }
.account-password-confirmation { max-width: 420px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); }
.account-password-confirmation[hidden], .account-password-actions [hidden] { display: none !important; }
.account-password-confirmation strong { display: block; font-size: 13px; color: var(--ink); }
.account-password-confirmation p { margin: 4px 0 12px !important; }
.account-password-confirmation > div { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-panel .account-settings .account-password-status { margin: 8px 0 0; color: #365f49; }
.account-password-status:empty { display: none; }
.settings-panel .account-settings .account-password-status.account-error { color: #9d3939; }
.account-avatar-intro { display: flex; align-items: center; gap: 14px; }
.account-avatar-preview { width: 58px; height: 58px; }
.account-avatar-groups { display: grid; gap: 2px; margin-top: 20px; }
.account-avatar-group { display: grid; grid-template-columns: 88px minmax(0, 1fr); align-items: center; gap: 16px; min-height: 65px; }
.settings-panel .account-settings .account-avatar-group-label { margin: 0; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .03em; }
.account-avatar-options { display: grid; grid-template-columns: repeat(6, 54px); gap: 10px; }
.account-avatar-options button {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  padding: 0;
  overflow: visible;
  border: 2px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease;
}
.account-avatar-options button .avatar-art { overflow: hidden; }
.account-avatar-options button:hover { transform: translateY(-2px); box-shadow: 0 3px 9px #15251d29; }
.account-avatar-options button[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 3px var(--theme-selected, #e9ecea); }
.account-avatar-options button:focus-visible { outline: 3px solid var(--theme-ring, #8aa9a0); outline-offset: 4px; }

@media (max-width: 980px) {
  .project-rail { position: relative; top: 0; }
  .project-rail-account {
    position: absolute;
    z-index: 2;
    top: 22px;
    right: 0;
    width: 40px;
    margin: 0;
    padding: 0;
    border: 0;
  }
  .project-rail-account .account-entry {
    display: flex;
    justify-content: center;
    width: 40px;
    min-height: 40px;
    padding: 0;
  }
  .project-rail-account .account-entry-copy,
  .project-rail-account .account-entry-chevron { display: none; }
}
@media (max-width: 700px) {
  .settings-view .settings-panel { padding: 0 22px; }
  .settings-panel .settings-section { padding: 25px 0; }
  .account-avatar-group { grid-template-columns: 1fr; gap: 8px; padding: 8px 0; }
  .account-avatar-options { grid-template-columns: repeat(3, 54px); }
  .settings-panel .account-settings [data-account-import]:not(:empty),
  .settings-panel .account-settings .account-security-settings { display: grid; justify-content: start; gap: 12px; }
}
@media (min-width: 981px) {
  main.workspace-rail-collapsed .project-rail > .project-rail-account { display: block; padding: 12px 0 0; }
  main.workspace-rail-collapsed .account-entry { display: flex; justify-content: center; width: 44px; min-height: 44px; padding: 2px; margin: 0 auto; }
  main.workspace-rail-collapsed .account-entry-copy, main.workspace-rail-collapsed .account-entry-chevron { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .account-entry-chevron, .account-avatar-options button, .account-form-actions button { transition: none; }
  .account-avatar-options button:hover { transform: none; }
}
