/* account.html on the design tokens (DESIGN.md). Shared rules are in app-theme.css; these are the
   account page's own components. account-hub.css loads after accessibility.css; the #account-page id
   outranks both. Every value comes from tokens.css. */

/* Banners: teal fill, white type (7.2:1). Gold fails on teal, so the eyebrow is white too. */
#account-page :is(.account-banner, .subscription-banner) {
  background: var(--bm-teal) !important;
  border-radius: var(--bm-radius-card);
}
#account-page :is(.account-banner, .subscription-banner) :is(h1, h2, p, .eyebrow) {
  color: var(--bm-paper) !important;
}
#account-page .account-banner h1 {
  font-size: var(--bm-type-section);
}

/* Fold sections keep one accent each, all from tokens. Gold and orange marks take ink glyphs. */
#account-page .account-fold {
  --accent: var(--bm-teal);
  --mark-text: var(--bm-paper);
  border-color: var(--bm-line) !important;
  border-radius: var(--bm-radius-card);
}
#account-page .account-fold-head {
  background: var(--bm-surface-warm) !important;
}
#account-page .account-fold:is([data-tone='friends'], [data-tone='export']) {
  --accent: var(--bm-teal-dark);
}
#account-page .account-fold:is([data-tone='groups'], [data-tone='backup']) {
  --accent: var(--bm-gold);
  --mark-text: var(--bm-ink);
}
#account-page .account-fold[data-tone='data'] {
  --accent: var(--bm-orange);
  --mark-text: var(--bm-ink);
}
#account-page .account-fold[data-tone='beta'] {
  --accent: var(--bm-success);
}
#account-page .account-fold-mark {
  background: var(--accent) !important;
  color: var(--mark-text) !important;
  border-radius: var(--bm-radius-control);
}

/* Plan badges: white chip, token text and edge. */
#account-page .plan-badge {
  background: var(--bm-paper) !important;
  border-color: var(--bm-line) !important;
  color: var(--bm-teal) !important;
}
#account-page .plan-badge-beta {
  color: var(--bm-success) !important;
}
#account-page .plan-badge-trial {
  color: var(--bm-ink) !important;
  border-color: var(--bm-gold) !important;
}

/* Cards and empty states */
#account-page :is(.account-card, .account-person, .account-group-card) {
  border-color: var(--bm-line) !important;
}
#account-page .account-card {
  border-radius: var(--bm-radius-card);
}
#account-page :is(.account-empty, .coming-soon-inline) {
  background: var(--bm-surface-warm) !important;
  border-color: var(--bm-muted) !important;
  border-radius: var(--bm-radius-control);
  color: var(--bm-ink) !important;
}
#account-page .coming-soon-inline small {
  color: var(--bm-teal-dark) !important;
}
#account-page .account-checklist button {
  background: var(--bm-paper) !important;
  color: var(--bm-teal) !important;
}

/* Footer */
#account-page footer.public-footer {
  border-color: var(--bm-line) !important;
  color: var(--bm-muted) !important;
}
#account-page :is(footer.public-footer p, .copyright, p.meta) {
  color: var(--bm-muted) !important;
}

/* Favorite-genre picker (Profile tab) */
#account-page #genre-form fieldset {
  margin: 0 0 var(--bm-space-group);
  padding: 0;
  border: 0;
}
#account-page #genre-form legend {
  margin-bottom: var(--bm-space-group);
  color: var(--bm-ink);
  font-weight: 700;
}
#account-page .genre-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  gap: var(--bm-space-group);
}
#account-page .genre-choices label {
  display: flex;
  gap: var(--bm-space-group);
  align-items: center;
  color: var(--bm-ink);
}
#account-page .genre-more-wrap {
  margin-top: var(--bm-space-group);
}
#account-page .genre-more-wrap summary {
  margin-bottom: var(--bm-space-group);
  color: var(--bm-teal-dark);
  font-weight: 700;
  cursor: pointer;
}
/* The jump from Discover's Edit interests clears the fixed menu bar. */
#account-page #reading-preferences {
  scroll-margin-top: calc(var(--bm-space-section) * 3);
}

/* Profile tab, from the November prototype: welcome and hobby ideas, the "Make it yours" checklist, the
   sharing band, then Profile settings in folded sections. Touch targets are 2.75rem (44px). */
#account-page :is(.profile-welcome, .profile-checklist, .profile-privacy) {
  margin: 0 0 var(--bm-space-section);
  border: thin solid var(--bm-line);
  border-radius: var(--bm-radius-card);
}
#account-page .profile-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  overflow: hidden;
  background: var(--bm-surface-warm);
}
#account-page .profile-welcome-copy {
  padding: calc(var(--bm-space-section) * 2);
}
#account-page .profile-eyebrow {
  margin: 0;
  color: var(--bm-teal-dark) !important;
}
#account-page #profile-welcome-heading {
  margin: var(--bm-space-group) 0;
  font-size: var(--bm-type-title);
  line-height: 1.05;
}
#account-page .profile-idea {
  display: grid;
  grid-template-columns: minmax(5.5rem, 0.8fr) minmax(0, 1fr);
  margin: 0;
  background: var(--bm-panel-night);
  color: var(--bm-paper);
}
/* The photo fills the hero's height without setting it. */
#account-page .profile-idea-art {
  display: block;
  width: 100%;
  height: 0;
  min-height: 100%;
  object-fit: cover;
  background: var(--bm-panel-night);
}
#account-page .profile-idea figcaption {
  display: grid;
  align-content: center;
  padding: var(--bm-space-section);
}
#account-page .profile-idea :is(strong, p) {
  color: var(--bm-paper) !important;
}
#account-page .profile-idea p {
  margin: var(--bm-space-line) 0 0;
}
#account-page .profile-idea-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--bm-space-section);
}
/* Text-link buttons: the ideas, the checklist rows and the sharing band. */
#account-page
  :is(.profile-idea-controls, .profile-checklist-row, .profile-privacy)
  button:not(:disabled) {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--bm-teal) !important;
  font-size: var(--bm-type-control) !important;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
#account-page .profile-idea-controls button:not(:disabled) {
  color: var(--bm-chip-gold) !important;
}
#account-page .profile-checklist {
  padding: var(--bm-space-section);
  background: var(--bm-paper);
}
#account-page :is(#profile-checklist-heading, #profile-privacy-heading) {
  margin: 0 0 var(--bm-space-group);
  font-size: var(--bm-type-section);
}
#account-page :is(.profile-start, .profile-checklist-row) {
  margin: 0;
  border-top: thin solid var(--bm-line);
}
#account-page :is(.profile-start > summary, .profile-checklist-row) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--bm-space-section);
  min-height: 2.75rem;
}
#account-page :is(.profile-start, .profile-section) > summary {
  color: var(--bm-ink);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}
#account-page :is(.profile-start, .profile-section) > summary::-webkit-details-marker {
  display: none;
  color: var(--bm-ink);
}
#account-page :is(.profile-start, .profile-section) > summary::before {
  content: '›';
  display: inline-block;
  width: 0.75em;
  color: var(--bm-teal);
  transition: transform 0.15s;
}
#account-page :is(.profile-start, .profile-section)[open] > summary::before {
  transform: rotate(90deg);
  color: var(--bm-teal);
}
#account-page .profile-start-title {
  margin: 0;
  color: var(--bm-ink) !important;
  font-size: var(--bm-type-control);
}
#account-page .profile-start[open] {
  padding-bottom: var(--bm-space-section);
}
#account-page [data-profile-check] {
  margin-left: auto;
  color: var(--bm-success);
  font-size: var(--bm-type-small);
  overflow-wrap: anywhere;
}
#account-page :is([data-profile-check], #profile-status, #profile-topic-status):empty,
#account-page .profile-topic-local a[hidden] {
  display: none;
  color: var(--bm-ink);
}
#account-page .profile-topic-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14.5rem), 1fr));
  gap: var(--bm-space-group) var(--bm-space-section);
}
#account-page .profile-topic-local:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bm-space-line) var(--bm-space-section);
}
#account-page .profile-topic-local a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--bm-teal);
}
/* Profile copy is body size, as in the prototype. */
#account-page #account-panel-profile p {
  font-size: var(--bm-type-body);
}
#account-page #account-panel-profile .profile-note {
  color: var(--bm-muted);
  font-size: var(--bm-type-small);
}
#account-page .profile-privacy {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--bm-space-section) calc(var(--bm-space-section) * 1.5);
  padding: calc(var(--bm-space-section) * 1.5) var(--bm-space-section);
  background: var(--bm-panel-sage);
}
#account-page .profile-privacy a {
  color: var(--bm-teal);
  font-weight: 700;
}
#account-page .profile-section {
  margin: var(--bm-space-group) 0;
  border: thin solid var(--bm-line);
  border-radius: var(--bm-radius-control);
}
#account-page .profile-section > summary {
  display: flex;
  gap: var(--bm-space-group);
  align-items: center;
  min-height: 2.75rem;
  padding: 0 var(--bm-space-section) 0 calc(var(--bm-space-section) * 0.75);
}
#account-page .profile-section-count:not(:empty) {
  margin-left: auto;
  padding: 0.125rem var(--bm-space-group);
  border-radius: var(--bm-radius-control);
  background: var(--bm-chip);
  color: var(--bm-ink);
  font-size: var(--bm-type-small);
}
#account-page .profile-section-fields {
  padding: 0 var(--bm-space-section) var(--bm-space-section);
}
/* Profile field labels read as in the prototype: ink, bold, control size. */
#account-page :is(#profile-form, #profile-topic-form) label {
  color: var(--bm-ink) !important;
  font-size: var(--bm-type-control) !important;
  font-weight: 700;
}
#account-page #profile-preview-dialog {
  width: min(40rem, calc(100vw - 2rem));
  border: thin solid var(--bm-line);
  border-radius: var(--bm-radius-card);
}
@media (max-width: 720px) {
  #account-page .profile-welcome {
    grid-template-columns: 1fr;
    background: var(--bm-surface-warm);
  }
  #account-page .profile-welcome-copy {
    padding: var(--bm-space-section);
  }
  #account-page #profile-welcome-heading,
  #account-page :is(#profile-checklist-heading, #profile-privacy-heading) {
    font-size: var(--bm-type-subsection);
  }
  #account-page .profile-idea-art {
    height: 100%;
    max-height: 10rem;
    background: var(--bm-panel-night);
  }
  #account-page .profile-privacy {
    grid-template-columns: auto auto;
    justify-content: space-between;
    background: var(--bm-panel-sage);
  }
  #account-page .profile-privacy > div {
    grid-column: 1 / -1;
    color: var(--bm-ink);
  }
}

/* Admin: feature tabs, with Settings holding owners, backup and export */
#account-page .admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bm-space-group);
  margin: 0 0 var(--bm-space-section);
}
#account-page .admin-tab {
  min-height: 2.75rem;
  padding: var(--bm-space-group) var(--bm-space-section);
  border: 0.125rem solid var(--bm-teal);
  border-radius: var(--bm-radius-control);
  background: var(--bm-paper);
  color: var(--bm-ink);
  font-weight: 700;
}
#account-page .admin-tab[aria-selected='true'] {
  background: var(--bm-teal);
  color: var(--bm-paper);
}
#account-page #account-panel-admin .account-fold-head {
  display: none;
  box-shadow: none;
}
#account-page #account-panel-admin .admin-panel-off {
  display: none;
  box-shadow: none;
}

/* Subscription: the first tab, always open, with its dates in view */
#account-page .account-subscription .account-fold-head {
  display: none;
  box-shadow: none;
}
#account-page .account-subscription-title {
  margin: 0 0 var(--bm-space-section);
  color: var(--bm-teal-dark);
}
#account-page .subscription-dates {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--bm-space-line) var(--bm-space-section);
  margin: 0 0 var(--bm-space-section);
}
#account-page .subscription-dates dt {
  font-weight: 700;
}
#account-page .subscription-dates dd {
  margin: 0;
  box-shadow: none;
}
