/* The Account page (account.html, account.js). Grouped cards and rows from settings.css, buttons and fields from
   friends.css, colours from design/tokens.css. */

.account-page { padding-top: var(--space-5); }
.account-page h2.set-group-title { font-family: var(--font); }

.acc-stats-link { margin: 0; padding: 10px 14px 0; font-size: 13px; color: var(--muted); }
.acc-stats-link a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* The picture, name and email at the top */
.acc-hero { display: flex; align-items: center; gap: var(--space-4); margin: 0 0 var(--space-4); }
.acc-pic {
  flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--navy); color: #fff;
  font: 600 26px/1 var(--font-display); letter-spacing: .02em;
  box-shadow: 0 0 0 3px #fff, 0 0 0 4px var(--stroke);
}
.acc-pic img { width: 100%; height: 100%; object-fit: cover; }
.acc-who { min-width: 0; }
.acc-who h1 { margin: 0; overflow-wrap: anywhere; }
.acc-email { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.acc-since { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.acc-since:empty, .acc-email:empty { display: none; }

/* Jump links to the sections, one scrolling row on phones */
.acc-jump {
  display: flex; gap: 6px; margin: 0 calc(-1 * var(--gutter)) var(--space-5); padding: 2px var(--gutter);
  overflow-x: auto; scrollbar-width: none;
}
.acc-jump::-webkit-scrollbar { display: none; }
/* On phones the row's right edge fades, so a cut-off link reads as "more this way" (as Home's forecast) */
@media (max-width: 700px) {
  .acc-jump { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 20px), transparent); }
}
.acc-jump a {
  flex: none; padding: 6px 12px; border-radius: 999px;
  background: var(--fill); color: var(--text); text-decoration: none;
  font-size: 13.5px; font-weight: 600; white-space: nowrap;
}
.acc-jump a:hover { background: var(--fill-hover); }
.acc-jump a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.acc-section, #delete-confirm { scroll-margin-top: 84px; }
.acc-section:target .set-card { box-shadow: 0 0 0 1px var(--separator), 0 0 0 4px rgb(var(--accent-rgb) / .18); }

/* Rows that are information or links rather than switches */
.set-row.acc-static { cursor: default; }
.set-row.acc-link { color: inherit; text-decoration: none; }
.set-row.acc-link:hover { background: var(--fill); }
.set-row.acc-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.set-row .btn { flex: none; }
.set-row + .acc-inline, .acc-inline + .set-row, .acc-stats + .set-row, .acc-empty + .set-row,
.acc-days + .acc-foot, .acc-stats + .acc-empty {
  box-shadow: inset 0 1px 0 var(--separator);
}
.acc-chev { flex: none; font-size: 22px; line-height: 1; color: var(--muted); }
.set-text small + small { margin-top: 1px; }
.acc-icon-name { background: var(--navy); }
.acc-icon-email { background: var(--accent); }
.acc-icon-password { background: var(--piste-unknown); }
.acc-icon-device { background: var(--wx-wind); }
.acc-icon-pay { background: var(--live); }
.acc-icon-plan { background: var(--accent); }
#acc-plan small:empty { display: none; }
.acc-icon-download { background: var(--accent); }
.acc-icon-privacy { background: var(--navy); }
.acc-icon-delete { background: var(--destructive); }
.acc-demo { margin: 0; padding: 10px 14px; box-shadow: inset 0 1px 0 var(--separator); }

/* Name editing, and the report form */
.acc-inline, .acc-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.acc-inline .set-actions { margin-top: 0; }
.acc-form .field select, .acc-form .field textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid rgb(var(--navy-rgb) / .5); border-radius: 10px; background: #fff;   /* 3:1 on white (WCAG 1.4.11) */
  font: 400 15px/1.4 var(--font); color: var(--text);
}
.acc-form .field textarea { resize: vertical; min-height: 110px; }
.acc-form .field select:focus, .acc-form .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.acc-form .check span { display: flex; flex-direction: column; gap: 2px; }
.acc-form .check small { font-size: 12.5px; color: var(--muted); line-height: 1.35; }
.acc-count { align-self: flex-end; margin-top: -6px; font-size: 12px; color: var(--muted); }
.acc-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.acc-form .acc-actions { justify-content: flex-end; }

.acc-msg { margin: 0; padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.4; background: rgb(var(--sos-rgb) / .08); color: var(--sos-dark); }
.acc-msg.ok { background: rgb(31 157 85 / .12); color: #14683a; }
.acc-msg[hidden] { display: none; }

/* Three numbers at the top of Ski history */
.acc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 14px; }
.acc-stats > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--fill); }
.acc-stats strong { font: 700 22px/1.1 var(--font-display); }
.acc-stats span { font-size: 12.5px; line-height: 1.3; color: var(--muted); }

/* Ski days, newest first, under season headings */
.acc-days { list-style: none; margin: 0; padding: 0 0 4px; }
.acc-season {
  padding: 10px 14px 4px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.acc-day { display: flex; align-items: center; }
.acc-day + .acc-day { box-shadow: inset 0 1px 0 var(--separator-soft); }
.acc-day-link { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; padding: 9px 4px 9px 14px; color: inherit; text-decoration: none; border-radius: 8px; }
.acc-day-link:hover { background: var(--fill); }
.acc-day-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.acc-day-date { flex: none; width: 118px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.acc-day-name { min-width: 0; display: flex; flex-direction: column; }
.acc-day-name strong { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.acc-day-name small { font-size: 12.5px; color: var(--muted); }
.acc-remove {
  flex: none; width: 44px; height: 44px; margin-right: 4px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.acc-remove:hover { background: var(--fill); color: var(--destructive); }
.acc-remove:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -4px; }
.acc-foot { display: flex; justify-content: space-between; gap: 8px; padding: 10px 14px; }
.acc-foot .danger:only-child { margin-left: auto; }
@media (max-width: 480px) {
  .acc-day-link { flex-direction: column; gap: 0; }
  .acc-day-date { width: auto; font-size: 12px; }
}

/* Nothing yet */
.acc-empty { margin: 0; padding: 14px; font-size: 14px; color: var(--muted); }
.acc-empty .link { font: inherit; }
.acc-empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px 18px; text-align: center; }
.acc-empty-state p { margin: 0 0 8px; max-width: 420px; font-size: 14px; color: var(--muted); }
.acc-empty-state strong { font-size: 16px; }
.acc-empty-state p a { color: var(--accent); font-weight: 600; text-decoration: none; }   /* as .acc-stats-link, not the browser's blue */
.acc-empty-icon {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgb(var(--accent-rgb) / .1); color: var(--accent);
}
.acc-empty-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.acc-empty-state .acc-actions { justify-content: center; }

.acc-chip {
  flex: none; padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--fill); color: var(--muted);
}
.acc-chip.looking { background: rgb(var(--accent-rgb) / .12); color: #0b4f99; }
.acc-chip.fixed { background: rgb(31 157 85 / .12); color: #14683a; }

/* Earlier problem reports */
.acc-reports { box-shadow: inset 0 1px 0 var(--separator); }
.acc-sub { margin: 0; padding: 12px 14px 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.acc-reports-list { list-style: none; margin: 0; padding: 4px 14px 10px; }
.acc-reports-list li { padding: 8px 0; }
.acc-reports-list li + li { box-shadow: inset 0 1px 0 var(--separator-soft); }
.acc-report-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.acc-reports-list small { font-size: 12px; color: var(--muted); }
.acc-reports-list p { margin: 2px 0 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.acc-msg.acc-unavailable { background: rgb(245 163 0 / .12); color: var(--caution-ink); }

.acc-signout { margin-top: var(--space-2); color: var(--destructive); }
#signout-msg { margin-top: 8px; }
.acc-signout-all { margin-top: var(--space-2); }
.acc-signout-note { margin: 6px 0 0; text-align: center; }
.acc-delete-password { display: flex; flex-direction: column; gap: 5px; margin: 12px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.acc-delete-password input {
  max-width: 320px; padding: 10px 12px;
  border: 1px solid rgb(var(--navy-rgb) / .5); border-radius: 10px; background: #fff;   /* 3:1 on white (WCAG 1.4.11) */
  font: 400 15px/1.4 var(--font); color: var(--text);
}
.acc-delete-password input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(var(--accent-rgb) / .25); }
.set-confirm p { margin: 0 0 6px; }

/* Your data: the download's progress and result, and what deleting the account does and doesn't delete */
.acc-export-msg { margin: 0 14px 12px; }
.acc-delete-lists { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 8px 0 10px; }
@media (min-width: 640px) { .acc-delete-lists { grid-template-columns: 1fr 1fr; } }
.set-confirm .acc-sub-small { margin: 0 0 4px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.acc-delete-lists ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.45; }
.acc-delete-lists li[hidden] { display: none; }
.acc-delete-local { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 10px; font-size: 14px; }
.acc-delete-local input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--destructive); }
.acc-delete-local small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.set-confirm .acc-delete-progress { margin: 0 0 10px; font-weight: 600; }
.set-actions a.btn[aria-disabled="true"] { pointer-events: none; opacity: .55; }

.acc-fieldset { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.acc-fieldset:disabled { opacity: .55; }
h3.acc-season { margin: 0; }
.acc-days + h3.acc-season { box-shadow: inset 0 1px 0 var(--separator-soft); }
#history-confirm { margin-top: 0; }
/* Fingers need 44 px targets (Apple's minimum); the shared small buttons are 32 px */
@media (pointer: coarse) {
  .account-page .btn.small, .acc-jump a, .acc-form .field select { min-height: 44px; }
  .acc-jump a { display: inline-flex; align-items: center; }
}

/* Offline mode (auth-gate.js): the account waits for a connection */
.acc-offline { margin: 0 0 var(--space-4); padding: 12px 14px; border-radius: var(--radius); background: var(--fill); color: var(--text); font-size: 14px; }
/* Messages and progress stay in the page as live regions (account.js show()): an empty one takes no room and isn't
   seen, but stays in the accessibility tree, so the text set later is read (A10 SEC-20) */
.acc-msg:empty, .acc-delete-progress:empty {
  position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* A field in error (aria-invalid, set with its message) */
.acc-form .field [aria-invalid="true"], .acc-inline [aria-invalid="true"], .acc-delete-password input[aria-invalid="true"] { border-color: var(--destructive); }
/* After the account was deleted (account.js): no profile menu, whose Sign out would wait behind the held sign-in page */
.account-gone .app-profile { display: none; }
