/* =============================================================================
   ACCOUNT PAGES (profile, settings, saved)
   -----------------------------------------------------------------------------
   One shell for the surfaces that belong to the signed-in account: a small
   section nav on the left, one panel on the right. Colour comes from
   tokens.css; nothing here names a value.
   ============================================================================= */

.account-page {
  max-width: 980px;
  margin: 0 auto;
  padding: var(--s6) var(--s4) var(--s7);
}

.account-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: var(--s6);
  align-items: start;
}

.account-nav {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s3);
  background: var(--card);
  border: var(--rule) solid var(--border);
  border-radius: var(--r-card);
}

.account-nav-link {
  display: block;
  padding: var(--s2) var(--s3);
  border-radius: var(--r-btn);
  color: var(--body);
  font-size: var(--fs-sm);
  text-decoration: none;
}

.account-nav-link:hover {
  background: var(--hover);
  color: var(--text);
}

.account-nav-link[aria-current="page"] {
  background: var(--accent);
  color: var(--text);
  font-weight: 600;
}

.account-panel {
  display: flex;
  flex-direction: column;
  gap: var(--s5);
  min-width: 0;
}

.account-head {
  display: flex;
  align-items: center;
  gap: var(--s4);
}

.account-avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  overflow: hidden;
  background: var(--bg);
  border: var(--rule) solid var(--border);
  border-radius: 50%;
  color: var(--muted);
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-avatar svg {
  width: 28px;
  height: 28px;
}

.account-head h1 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: 1.25;
}

.account-handle {
  margin: var(--s1) 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.account-card {
  padding: var(--s5);
  background: var(--card);
  border: var(--rule) solid var(--border);
  border-radius: var(--r-card);
}

.account-card h2 {
  margin: 0 0 var(--s4);
  font-size: var(--fs-modal);
}

.account-card p:last-child {
  margin-bottom: 0;
}

.account-bio {
  margin: 0;
  color: var(--body);
  font-size: var(--fs-base);
  line-height: 1.7;
  white-space: pre-line;
}

.account-empty {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--s4);
  margin: 0;
}

.account-fact-label {
  display: block;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.account-fact-value {
  display: block;
  margin-top: var(--s1);
  font-size: var(--fs-base);
  font-weight: 600;
  word-break: break-word;
}

.account-alias {
  font-family: var(--font);
  letter-spacing: 0.01em;
}

.account-hint {
  margin: var(--s2) 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
  margin-top: var(--s5);
}

.account-form-error {
  margin: 0 0 var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--red-soft);
  border: var(--rule) solid var(--border);
  border-radius: var(--r-card);
  color: var(--text);
  font-size: var(--fs-sm);
}

.account-switches {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.account-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-history li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s4);
  padding: var(--s2) 0;
  border-bottom: var(--rule) solid var(--border);
  font-size: var(--fs-sm);
}

.account-history li:last-child {
  border-bottom: 0;
}

.account-history .account-history-when {
  flex-shrink: 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.account-saved {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-saved-item {
  padding: var(--s4);
  background: var(--card);
  border: var(--rule) solid var(--border);
  border-radius: var(--r-card);
}

.account-saved-item h3 {
  margin: 0 0 var(--s2);
  font-size: var(--fs-modal);
  line-height: 1.35;
}

.account-saved-item h3 a {
  color: var(--text);
  text-decoration: none;
}

.account-saved-item h3 a:hover {
  text-decoration: underline;
}

.account-saved-excerpt {
  margin: 0;
  color: var(--body);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

.account-saved-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin: var(--s3) 0 0;
  color: var(--muted);
  font-size: var(--fs-xs);
}

.account-saved-kind {
  padding: 2px var(--s2);
  background: var(--bg);
  border-radius: var(--r-pill);
}

@media (max-width: 767px) {
  .account-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s4);
  }

  .account-nav {
    flex-direction: row;
    overflow-x: auto;
  }

  .account-nav-link {
    white-space: nowrap;
  }
}
