/* NF Audios — customer account area (my-account, library, orders, profile). Loaded last on public pages. */

/* Everything here is scoped to the account pages:
   body.sw-acct-page   /my-account and its sections
   body.nf-profile-page /profile (avatar, password, two-step sign-in) */

/* ── /my-account ─────────────────────────────────────────────────────── */

/* Overview → "Your software": one round download button per row, never a stack of pills over the name. */
body.sw-acct-page .sw-pt-mini li { gap: 12px; min-height: 60px; }
body.sw-acct-page .sw-pt-mini li > div { gap: 1px; }
body.sw-acct-page .sw-pt-mini strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.sw-acct-page .sw-pt-icon-btn { transition: background .15s ease, color .15s ease; }
body.sw-acct-page .sw-pt-icon-btn i { font-size: 14px; }

/* Overview: the two columns end level, and cards breathe the same amount. */
body.sw-acct-page .sw-pt-grid { align-items: stretch; }
body.sw-acct-page .sw-pt-col { display: grid; gap: 20px; align-content: start; }
body.sw-acct-page .sw-pt-col > .sw-pt-card { margin: 0; }

/* "Updates are ready" and Downloads rows: the system buttons stay on one line beside the name
   and wrap as a group, right-aligned, when the row gets tight. */
body.sw-acct-page .sw-pt-updates .sw-own-builds,
body.sw-acct-page .sw-pt-dl .sw-own-builds { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex: none; max-width: 100%; }
body.sw-acct-page .sw-pt-dl li { padding: 12px 0; }

/* Download history: the product names never break mid-word and the table reads as a table on a phone too. */
body.sw-acct-page .sw-pt-table td { vertical-align: top; }
body.sw-acct-page .sw-pt-table td:first-child { white-space: nowrap; }

/* Profile & security: two cards side by side on a wide screen. */
@media (min-width: 1180px) {
  body.sw-acct-page .sw-acct-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* "optional" sits beside its label instead of on a line of its own. */
body.sw-acct-page .sw-acct-card label:has(> small),
body.sw-acct-page .sw-pt-close label:has(> small) { grid-template-columns: auto minmax(0, 1fr); column-gap: 6px; align-items: baseline; }
body.sw-acct-page .sw-acct-card label:has(> small) > :is(input, textarea, select),
body.sw-acct-page .sw-pt-close label:has(> small) > :is(input, textarea, select) { grid-column: 1 / -1; }
body.sw-acct-page .sw-acct-card label small,
body.sw-acct-page .sw-pt-close label small { font-size: 12px; }
body.sw-acct-page .sw-pt-close label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); margin: 10px 0; }
body.sw-acct-page .sw-pt-close[open] summary { margin-bottom: 8px; }
body.sw-acct-page .sw-pt-close summary { cursor: pointer; }

/* Security / data rows: the text keeps a readable width; the button drops under it when there is no room. */
body.sw-acct-page .sw-pt-sec { flex-wrap: wrap; }
body.sw-acct-page .sw-pt-sec > div { flex: 1 1 230px; min-width: 0; }

/* Licence keys never push a card wider than the screen. */
body.sw-acct-page :is(.sw-pt-key, .sw-own-key) code { overflow-wrap: anywhere; min-width: 0; }

/* Empty states: same card as the rest of the area. */
body.sw-acct-page .sw-pt-empty { margin: 0 0 12px; }
body.sw-acct-page .sw-pt-card > .sw-pt-empty:last-child { margin-bottom: 0; }

@media (max-width: 860px) {
  /* The section pills scroll sideways; fade the edge so it reads as "more this way". */
  body.sw-acct-page .sw-pt-nav { scroll-snap-type: x proximity; scroll-padding-inline: 1rem; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 2rem; }
  body.sw-acct-page .sw-pt-nav a { scroll-snap-align: start; }
}

@media (max-width: 700px) {
  /* Download history stays a compact four-column table (the generic reflow turned 9 rows into 9 tall cards). */
  body.sw-acct-page table.sw-pt-table { display: table; width: 100%; font-size: 13px; }
  body.sw-acct-page table.sw-pt-table thead { display: table-header-group; }
  body.sw-acct-page table.sw-pt-table tbody { display: table-row-group; width: auto; }
  body.sw-acct-page table.sw-pt-table tr { display: table-row; width: auto; border: 0; border-radius: 0; margin: 0; padding: 0; }
  body.sw-acct-page table.sw-pt-table :is(th, td) { display: table-cell; width: auto; text-align: left; padding: 9px 8px 9px 0; }
  body.sw-acct-page table.sw-pt-table td { border-top: 1px solid var(--sw-hair, var(--line)); }
  body.sw-acct-page table.sw-pt-table td::before { content: none; }
  body.sw-acct-page table.sw-pt-table td:first-child { white-space: normal; }
  body.sw-acct-page table.sw-pt-table :is(th, td):last-child { padding-right: 0; }
}

@media (max-width: 620px) {
  /* Rows with system buttons: buttons sit under the name, side by side, in line with the text. */
  body.sw-acct-page .sw-pt-updates .sw-own-builds,
  body.sw-acct-page .sw-pt-dl .sw-own-builds { flex: 1 1 100%; justify-content: flex-start; flex-wrap: nowrap; }
  body.sw-acct-page .sw-own-builds { display: flex; flex-wrap: nowrap; gap: 8px; }
  body.sw-acct-page .sw.sw-clean .sw-own-builds .bcos-btn,
  body.sw-acct-page .sw-own-builds .bcos-btn { flex: 1 1 0; min-width: 0; margin-left: 0; padding: 0 10px; font-size: 13px; gap: 6px; white-space: nowrap; justify-content: center; }
  /* The floating Help button no longer sits on top of the last line of a page. */
  body.sw-acct-page .sw-pt-main { padding-bottom: 56px; }
}

@media (max-width: 520px) {
  body.sw-acct-page table.sw-pt-table :is(th, td):nth-child(3) { display: none; }
  body.sw-acct-page table.sw-pt-table :is(th, td):nth-child(4) { display: table-cell; }
}

/* ── /profile (avatar, password, two-step sign-in) ───────────────────── */

body.nf-profile-page .bcos-page-hero { padding-bottom: 0; }
body.nf-profile-page .nf-profile-back { margin: 0 0 14px; font-size: 14px; }
body.nf-profile-page .nf-profile-back a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
body.nf-profile-page .nf-profile-back a:hover { color: var(--ink); }
body.nf-profile-page .bcos-profile { max-width: 720px; margin-inline: auto; }
body.nf-profile-page .bcos-profile-head h2 { margin: 0 0 2px; font-size: clamp(1.5rem, 3.4vw, 2rem); line-height: 1.15; }
body.nf-profile-page .bcos-profile-head p { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
body.nf-profile-page .bcos-profile-head { margin-bottom: 20px; }
/* Each block is a card, like the cards in /my-account. */
body.nf-profile-page .bcos-profile > form,
body.nf-profile-page .bcos-profile > div[style] > form,
body.nf-profile-page .bcos-profile > div[style] { max-width: none; }
body.nf-profile-page .bcos-profile > form.bcos-form,
body.nf-profile-page .bcos-profile > div[style] { background: #fff; border: 1px solid var(--line, #e3e6e1); border-radius: 22px; padding: clamp(18px, 3vw, 28px); margin: 0 0 18px !important; box-sizing: border-box; }
body.nf-profile-page .bcos-profile .bcos-form { max-width: none; }
body.nf-profile-page .bcos-profile .bcos-form-h:first-child,
body.nf-profile-page .bcos-profile div[style] > :first-child { margin-top: 0; }
body.nf-profile-page .bcos-profile .bcos-form .bcos-btn { width: auto; justify-self: start; min-height: 46px; padding-inline: 22px; }
body.nf-profile-page .bcos-avatar-pack { margin-bottom: 14px; }
body.nf-profile-page .bcos-profile > div[style] > form:first-child > .bcos-form-h { margin-top: 0; }
body.nf-profile-page .bcos-profile > div[style] > form + form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line, #e3e6e1); }
body.nf-profile-page .bcos-profile > div[style] > form + form > .bcos-form-h { margin-top: 0; }
body.nf-profile-page .bcos-avatar-choice.is-on img,
body.nf-profile-page .bcos-avatar-choice:has(input:checked) img { border-color: var(--th-accent, #2F6B4F); box-shadow: 0 0 0 3px color-mix(in srgb, var(--th-accent, #2F6B4F) 22%, transparent); }
body.nf-profile-page .bcos-avatar-choice:has(input:focus-visible) img { outline: 2px solid var(--ink); outline-offset: 2px; }
/* The file picker, styled like the other controls. */
body.nf-profile-page .bcos-form input[type="file"] { font: inherit; font-size: 14px; color: var(--muted); padding: 8px; border: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 12px; background: #fafbf9; width: 100%; box-sizing: border-box; }
body.nf-profile-page .bcos-form input[type="file"]::file-selector-button { font: inherit; font-weight: 600; font-size: 13.5px; color: var(--ink); background: #fff; border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); border-radius: 99px; padding: 7px 14px; margin-right: 12px; cursor: pointer; }
body.nf-profile-page .bcos-form input[type="file"]::file-selector-button:hover { background: var(--ink); color: #fff; }
body.nf-profile-page .mfa-card { max-width: none; border-radius: 22px; box-shadow: none; }
@media (max-width: 560px) {
  body.nf-profile-page .bcos-profile .bcos-form .bcos-btn { width: 100%; justify-self: stretch; }
}

/* ── Order receipt (/shop/order/…) with licence keys ─────────────────── */

/* On a phone the keys panel was wider than the page (a long key set the column's minimum width). */
.shx-order-grid:has(.sw-order-keys) > *,
.shx-order-side:has(.sw-order-keys) > * { min-width: 0; }
.sw-order-keys .sw-key code { max-width: 100%; box-sizing: border-box; overflow-wrap: anywhere; }
