/* Area "account" (docs/V2_BUILD.md). Only this area edits this file.
   Accounts, allauth pages, follows, notifications. Every selector is scoped (hsm-acc-*,
   hsm-bell, hsm-follow) because every area stylesheet is loaded on every page. */

/* Page frame ----------------------------------------------------------------------------- */
/* allauth pages have no wrapper of their own: their title element gives main the page frame. */
#content:has(> .hsm-acc-auth) { position: relative; width: var(--hsm-page-w); margin-left: var(--hsm-page-left); padding-bottom: 96px; }
.hsm-acc-head { margin-top: var(--hsm-gap); }
.hsm-acc-title { position: relative; margin-top: 32px; }
.hsm-acc-title .hsm-h1 { margin: 0; overflow-wrap: anywhere; }
.hsm-acc-title .hsm-accent { top: -4px; }
.hsm-acc-intro { display: flex; align-items: center; gap: 20px; margin: 20px 0 0; }
.hsm-acc-lead { max-width: 720px; margin: 0 0 24px; }
.hsm-acc-head > .hsm-acc-lead { margin: 20px 0 0; }
.hsm-acc-lead a, .hsm-acc-p a, .hsm-acc-help a, .hsm-message a { color: var(--hsm-white); text-decoration: underline; }
.hsm-acc-body { margin-top: 8px; }
.hsm-acc-section { margin-top: var(--hsm-gap); }
.hsm-acc-section > .hsm-label { margin-bottom: 28px; }
.hsm-acc-section > .hsm-message { margin: 0 0 24px; }
.hsm-acc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hsm-acc-empty { padding: 32px 0; list-style: none; }
.hsm-acc-list { margin: 16px 0; padding-left: 18px; list-style: square; }
.hsm-acc-list li { margin: 6px 0; }

.hsm-acc-back { display: inline-flex; align-items: center; gap: 10px; margin-top: 28px; color: var(--hsm-muted);
  font: 600 12px var(--hsm-font); letter-spacing: var(--hsm-track); text-transform: uppercase; text-decoration: none; }
.hsm-acc-back:hover { color: var(--hsm-white); }

/* Settings tabs */
.hsm-acc-nav { margin-top: 28px; }
.hsm-acc-nav ul { display: flex; gap: 0 36px; margin: 16px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hsm-rule);
  overflow-x: auto; scrollbar-width: none; }
.hsm-acc-nav a:not(.hsm-acc-back) { display: block; padding: 14px 0 12px; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap;
  font: 600 12px var(--hsm-font); letter-spacing: var(--hsm-track); text-transform: uppercase; text-decoration: none; color: var(--hsm-muted); }
.hsm-acc-nav a:not(.hsm-acc-back):hover { color: var(--hsm-white); }
.hsm-acc-nav a[aria-current="page"] { color: var(--hsm-white); border-bottom-color: var(--hsm-coral); }
@media (max-width: 800px) { .hsm-acc-nav ul { flex-wrap: wrap; gap: 0 22px; overflow: visible; } }

/* Hub rows: the menu pattern (wide capitals, rule, arrow) ------------------------------- */
.hsm-acc-rows { margin: 40px 0 0; padding: 0; list-style: none; border-bottom: 1px solid var(--hsm-rule); }
.hsm-acc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 60px; gap: 40px; align-items: center;
  padding: 26px 0; border-top: 1px solid var(--hsm-rule); text-decoration: none; }
.hsm-acc-row__name { font: 600 30px/1.1 var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; color: var(--hsm-white); }
.hsm-acc-row__desc { color: var(--hsm-muted); font-size: 14px; text-align: right; }
.hsm-acc-row__arrow { width: 60px; color: var(--hsm-white); transition: transform .15s; }
.hsm-acc-row:hover .hsm-acc-row__arrow { transform: translateX(6px); }
.hsm-acc-row:hover .hsm-acc-row__name { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 6px; }
.hsm-acc-rows--small { margin-top: 0; }
.hsm-acc-rows--small .hsm-acc-row { padding: 18px 0; }
.hsm-acc-rows--small .hsm-acc-row__name { font-size: 20px; }
.hsm-acc-count { display: inline-block; min-width: 26px; padding: 4px 6px 3px; vertical-align: middle; background: var(--hsm-coral); color: var(--hsm-ink);
  font: 700 13px/1.2 var(--hsm-font); letter-spacing: 0; text-align: center; }
@media (max-width: 800px) {
  .hsm-acc-row { grid-template-columns: minmax(0, 1fr) 28px; gap: 6px 16px; padding: 20px 0; }
  .hsm-acc-row__name { font-size: 20px; }
  .hsm-acc-row__desc { grid-row: 2; text-align: left; }
  .hsm-acc-row__arrow { grid-row: 1 / 3; grid-column: 2; width: 28px; }
}

.hsm-acc-avatar { width: 72px; height: 72px; object-fit: cover; flex: none; }
.hsm-acc-avatar--none { display: grid; place-items: center; background: var(--hsm-field); color: var(--hsm-muted); font: 600 30px var(--hsm-font-wide); }

/* Forms ------------------------------------------------------------------------------------ */
.hsm-acc-form { margin: 0; }
.hsm-acc-narrow { max-width: 520px; }
/* Buttons of a narrow form may stand side by side beyond the width of its fields. */
.hsm-acc-narrow > .hsm-acc-actions { width: max-content; max-width: var(--hsm-page-w); }
.hsm-acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 40px; align-items: start; max-width: 980px; }
.hsm-acc-grid__full { grid-column: 1 / -1; }
.hsm-acc-field { display: grid; gap: 8px; align-content: start; margin-bottom: 20px; }
.hsm-acc-field .hsm-field, .hsm-acc-city .hsm-field { align-content: start; }
.hsm-acc-grid .hsm-acc-field { margin-bottom: 0; }
.hsm-acc-field .hsm-field input[disabled], .hsm-acc-field .hsm-field textarea[readonly] { color: var(--hsm-muted); }
.hsm-acc-field textarea { resize: vertical; font-family: var(--hsm-font); }
.hsm-acc input[type="date"], #content:has(> .hsm-acc-auth) input { color-scheme: dark; }
.hsm-acc-field--error .hsm-field input, .hsm-acc-field--error .hsm-field select, .hsm-acc-field--error .hsm-field textarea { outline: 1px solid var(--hsm-coral); }
.hsm-acc-help { color: var(--hsm-muted); font-size: 13px; line-height: 1.5; }
.hsm-acc-help ul { margin: 4px 0 0; padding-left: 16px; list-style: square; }
.hsm-acc-error { margin: 0; color: var(--hsm-coral); font-size: 13px; font-weight: 600; }
.hsm-acc-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.hsm-acc-form .hsm-message p, .hsm-acc-alert p { margin: 0; }
.hsm-acc-form > .hsm-message { margin-bottom: 24px; }
@media (max-width: 800px) { .hsm-acc-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; } }

/* Square boxes (checkbox and radio): never a toggle switch, never a round dot. */
.hsm-acc-check label, .hsm-acc-radios label, .hsm-acc-family__head { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.hsm-acc-check { display: grid; gap: 6px; margin-bottom: 16px; }
.hsm-acc-check .hsm-acc-help { padding-left: 30px; }
.hsm-acc-check input, .hsm-acc-radios input, .hsm-acc-family input {
  appearance: none; -webkit-appearance: none; flex: none; display: inline-grid; place-content: center;
  width: 18px; height: 18px; margin: 0; border: 1px solid var(--hsm-muted); border-radius: 0; background: var(--hsm-field); cursor: pointer;
}
.hsm-acc-check input:checked, .hsm-acc-radios input:checked, .hsm-acc-family input:checked { background: var(--hsm-coral); border-color: var(--hsm-coral); }
.hsm-acc-check input[type="checkbox"]:checked::before, .hsm-acc-family input:checked::before {
  content: ""; width: 10px; height: 10px; background: var(--hsm-ink);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0, 43% 62%);
}
.hsm-acc-check input[type="radio"]:checked::before, .hsm-acc-radios input:checked::before { content: ""; width: 6px; height: 6px; background: var(--hsm-ink); }

/* Home city picker */
.hsm-acc-city { position: relative; display: grid; gap: 8px; }
.hsm-acc-city__results { display: grid; }
.hsm-acc-city__results:empty { display: none; }
.hsm-acc-city__option { display: flex; justify-content: space-between; gap: 16px; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--hsm-rule);
  background: var(--hsm-field); color: var(--hsm-text); font: 400 14px var(--hsm-font); text-align: left; cursor: pointer; }
.hsm-acc-city__option:hover, .hsm-acc-city__option:focus-visible { background: var(--hsm-rule); color: var(--hsm-white); }
.hsm-acc-city__none { margin: 4px 0 0; }

/* Avatar */
.hsm-acc-avatarfield__row { display: flex; align-items: center; gap: 20px; min-height: 72px; }
.hsm-acc-file input { color: var(--hsm-muted); font: 400 13px var(--hsm-font); max-width: 100%; }
.hsm-acc-file input::file-selector-button { margin-right: 14px; padding: 10px 14px; border: 1px solid var(--hsm-white); border-radius: 0; background: transparent;
  color: var(--hsm-white); font: 600 12px var(--hsm-font); letter-spacing: 1.5px; text-transform: uppercase; cursor: pointer; }
.hsm-acc-avatarfield .hsm-acc-check { margin: 4px 0 0; }

/* Preferences: style families, notification kinds */
.hsm-acc-families { display: grid; gap: 0; border-top: 1px solid var(--hsm-rule); }
.hsm-acc-family { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px 40px; align-items: start; margin: 0; padding: 20px 0;
  border: 0; border-bottom: 1px solid var(--hsm-rule); }
.hsm-acc-family__children { padding-top: 2px; }
.hsm-acc-family__children label { cursor: pointer; }
@media (max-width: 800px) { .hsm-acc-family { grid-template-columns: minmax(0, 1fr); } }

.hsm-acc-kinds { border-top: 1px solid var(--hsm-rule); }
.hsm-acc-kind { margin: 0; padding: 22px 0; border: 0; border-bottom: 1px solid var(--hsm-rule); min-width: 0; }
/* A floated legend is laid out inside the fieldset, not on its border. */
.hsm-acc-kind__label { float: left; width: 100%; padding: 0; margin: 0 0 6px; font: 600 16px var(--hsm-font); color: var(--hsm-white); }
.hsm-acc-kind__row { clear: both; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 40px; align-items: center; }
.hsm-acc-kind__help { margin: 0; }
.hsm-acc-radios { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; font-size: 14px; }
@media (max-width: 900px) {
  .hsm-acc-kind__row { grid-template-columns: minmax(0, 1fr); }
  .hsm-acc-radios { display: grid; gap: 12px; }
}

/* Privacy: consents */
.hsm-acc-consents { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); max-width: 980px; }
.hsm-acc-consent { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 40px; align-items: start; padding: 20px 0 6px; border-bottom: 1px solid var(--hsm-rule); }
.hsm-acc-consent__date { margin: 2px 0 0; color: var(--hsm-muted); text-align: right; }
@media (max-width: 800px) { .hsm-acc-consent { grid-template-columns: minmax(0, 1fr); } .hsm-acc-consent__date { text-align: left; margin: -8px 0 14px 30px; } }

/* Follow button and /me/follows/ ------------------------------------------------------- */
.hsm-follow-form { display: inline-block; margin: 0; }
.hsm-follow[disabled] { cursor: progress; }

.hsm-acc-follows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); }
.hsm-acc-follows__item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px 40px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--hsm-rule); }
.hsm-acc-follows__name { font: 600 22px/1.15 var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; color: var(--hsm-white); text-decoration: none; overflow-wrap: anywhere; }
.hsm-acc-follows__name:hover { text-decoration: underline; }
.hsm-acc-follows__meta { text-align: right; }
@media (max-width: 800px) {
  .hsm-acc-follows__item { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hsm-acc-follows__name { font-size: 18px; }
  .hsm-acc-follows__meta { text-align: left; }
}

/* Notifications ------------------------------------------------------------------------- */
.hsm-bell { position: relative; display: inline-flex; color: var(--hsm-white); text-decoration: none; }
.hsm-bell__icon { width: 24px; height: 24px; }
.hsm-bell__count { position: absolute; top: -7px; left: 14px; min-width: 18px; height: 18px; padding: 0 4px; background: var(--hsm-coral); color: var(--hsm-ink);
  font: 700 11px/18px var(--hsm-font); text-align: center; }

.hsm-acc-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 40px; }
.hsm-acc-toolbar .hsm-overline { margin: 0; }
.hsm-acc-toolbar form { margin: 0; }
.hsm-acc-notifs { margin: 24px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--hsm-rule); }
.hsm-acc-notif__link { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 60px; gap: 24px; align-items: center; padding: 22px 0;
  border-bottom: 1px solid var(--hsm-rule); text-decoration: none; }
a.hsm-acc-notif__link:hover .hsm-acc-notif__title { text-decoration: underline; }
.hsm-acc-notif__mark { width: 10px; height: 10px; }
.hsm-acc-notif--unread .hsm-acc-notif__mark { background: var(--hsm-coral); }
.hsm-acc-notif__text { display: grid; gap: 4px; }
.hsm-acc-notif__title { font: 600 17px/1.35 var(--hsm-font); color: var(--hsm-text); }
.hsm-acc-notif--unread .hsm-acc-notif__title { color: var(--hsm-white); }
.hsm-acc-notif__time { color: var(--hsm-muted); text-align: right; white-space: nowrap; }
.hsm-acc-notif__arrow { width: 60px; color: var(--hsm-white); }
.hsm-acc-pager { display: flex; gap: 32px; align-items: center; margin-top: 32px; }
@media (max-width: 800px) {
  .hsm-acc-notif__link { grid-template-columns: 10px minmax(0, 1fr); gap: 6px 16px; padding: 18px 0; }
  .hsm-acc-notif__mark { align-self: start; margin-top: 7px; }
  .hsm-acc-notif__time { grid-column: 2; text-align: left; }
  .hsm-acc-notif__arrow { display: none; }
}

/* allauth elements ------------------------------------------------------------------------ */
.hsm-acc-auth + .hsm-acc-p, .hsm-acc-auth + .hsm-acc-form, .hsm-acc-auth + .hsm-acc-entrance { margin-top: 40px; }
.hsm-acc-auth + .hsm-acc-nav + * { margin-top: 40px; }
.hsm-acc-p { max-width: 640px; margin: 0 0 20px; }
.hsm-acc-h2 { margin: 56px 0 24px; }
.hsm-acc-hr { margin: 40px 0; border: 0; border-top: 1px solid var(--hsm-rule); max-width: 980px; }
.hsm-acc-alert { margin: 0 0 24px; max-width: 640px; }
.hsm-acc-badge { margin-left: 10px; vertical-align: middle; font-size: 10px; }
.hsm-acc-badge--muted { color: var(--hsm-muted); }
.hsm-acc-linkbtn { padding: 0; border: 0; background: none; color: var(--hsm-text); font: 400 14px var(--hsm-font); cursor: pointer; text-decoration: none; }
.hsm-acc-linkbtn:hover { text-decoration: underline; }
.hsm-acc-details { margin-top: 32px; max-width: 520px; }
.hsm-acc-details summary { cursor: pointer; margin-bottom: 20px; }
.hsm-acc-qr { width: 220px; height: auto; margin: 0 0 24px; padding: 14px; background: var(--hsm-white); }
.hsm-acc-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 48px; align-items: center; max-width: 980px; padding: 28px 0;
  border-top: 1px solid var(--hsm-rule); }
.hsm-acc-panel:last-of-type { border-bottom: 1px solid var(--hsm-rule); }
.hsm-acc-auth + .hsm-acc-nav + .hsm-acc-panel { margin-top: 48px; }
.hsm-acc-panel__title { margin: 0 0 6px; font: 600 20px/1.2 var(--hsm-font-wide); letter-spacing: var(--hsm-track); text-transform: uppercase; color: var(--hsm-white); }
.hsm-acc-panel__text .hsm-acc-p { margin: 0; color: var(--hsm-muted); }
.hsm-acc-panel__actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-end; }
.hsm-acc-table { border-collapse: collapse; width: 100%; max-width: 980px; font-size: 14px; }
.hsm-acc-table th, .hsm-acc-table td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--hsm-rule); text-align: left; }
.hsm-acc-table th { font: 600 12px var(--hsm-font); letter-spacing: var(--hsm-track); text-transform: uppercase; color: var(--hsm-muted); }
.hsm-acc-td--right { text-align: right; }
@media (max-width: 800px) {
  .hsm-acc-panel { grid-template-columns: minmax(0, 1fr); }
  .hsm-acc-panel__actions { justify-content: flex-start; }
}

/* Login and signup: the form, the other way in on the side */
.hsm-acc-entrance { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 360px); gap: 48px 96px; align-items: start; }
.hsm-acc-entrance__side { padding-left: 48px; border-left: 1px solid var(--hsm-rule); }
.hsm-acc-entrance__side p { color: var(--hsm-muted); font-size: 14px; margin: 12px 0 24px; }
.hsm-acc-entrance .hsm-acc-p { font-size: 14px; }
.hsm-acc-form + .hsm-acc-p { margin-top: 24px; }
@media (max-width: 900px) {
  .hsm-acc-entrance { grid-template-columns: minmax(0, 1fr); }
  .hsm-acc-entrance__side { padding: 32px 0 0; border-left: 0; border-top: 1px solid var(--hsm-rule); }
}
