/* Orbit Player account pages (on top of styles.css): the player's Settings pages in the Nord theme. */
.acct-main { padding-top: 36px; padding-bottom: 60px; max-width: 1040px; }
.acct h1 { font-size: clamp(1.9rem, 3.4vw, 2.5rem); margin-bottom: 12px; }
.acct h2 { font-size: 1.05rem; font-weight: 700; color: var(--accent); max-width: none; margin-bottom: 14px; }
.acct h2.gap { margin-top: 26px; }
.acct h3 { font-size: 1.05rem; font-weight: 700; color: var(--accent); margin: 22px 0 6px; }
.acct a { color: var(--accent); }
.acct .top nav a { color: var(--dim); }
.acct .top nav a.btn { color: var(--on-accent); }
.lead { font-size: 1.05rem; color: var(--dim); max-width: 70ch; margin-bottom: 26px; }
.lead b { color: var(--text); }
.crumb { margin-bottom: 10px; font-size: 0.95rem; }
.hint { color: var(--dim); font-size: 0.88rem; font-weight: 400; }
.meta { color: var(--dim); font-size: 0.9rem; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 20px; margin: 0 0 14px; }
.card.narrow { max-width: 460px; margin: 4vh auto 0; }
.card.narrow h1 { font-size: 1.7rem; margin-bottom: 20px; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-bottom: 14px; }
a.card.profile { display: block; text-decoration: none; color: var(--text); margin: 0; background: var(--tile); border-radius: 12px; }
a.card.profile:hover { background: var(--tile-hover); }
a.card.profile h2 { margin-bottom: 4px; color: var(--text); font-size: 1.15rem; font-weight: 500; }
/* A profile's sections, like the player's Settings menu */
.smenu { display: grid; gap: 10px; max-width: 760px; }
.acct .smenu a { color: var(--text); }
.sback { display: flex; align-items: center; gap: 10px; }
.sback a { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 10px; color: var(--text); }
.sback a:hover { background: var(--tile); }
.sback .ic { width: 26px; height: 26px; }
.plain { list-style: none; padding: 0; margin: 12px 0 0; }
.plain li { padding: 3px 0; }

.acct label { display: block; font-weight: 500; font-size: 0.95rem; margin-bottom: 16px; }
.acct label .hint { margin-left: 6px; }
.acct input:not([type=checkbox]), .acct select {
  display: block; width: 100%; margin-top: 6px;
  font: inherit; color: var(--text); background: #262b35;
  border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px;
}
.acct input[type=number] { max-width: 120px; }
.acct input:focus-visible, .acct select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.acct .btn { cursor: pointer; font-size: 1rem; padding: 11px 20px; font-family: inherit; }
.acct .btn.danger { color: #ff9c8f; }
.acct .btn.danger:hover { background: #ff9c8f; color: var(--on-accent); border-color: #ff9c8f; }
.linkbtn { background: none; border: 0; color: var(--dim); font: inherit; font-weight: 500; font-size: 0.95rem; cursor: pointer; padding: 0; border-radius: 0; }
.linkbtn:hover { color: var(--accent); }
form.inline { display: inline; }
.row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; max-width: none; margin: 0; }
.row label { margin-bottom: 0; flex: 0 1 300px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin-top: 6px; }
.grid .wide, .grid .row, .grid .check { grid-column: 1 / -1; }
/* Playlist boxes: only the ones for the chosen type show (M3U link, Xtream login or MAC portal). */
.grid .kind { grid-column: 1 / -1; display: none; grid-template-columns: inherit; gap: inherit; }
form:has(.kindpick option[value="m3u"]:checked) .kind[data-kind="m3u"],
form:has(.kindpick option[value="xtream"]:checked) .kind[data-kind="xtream"],
form:has(.kindpick option[value="stalker"]:checked) .kind[data-kind="stalker"] { display: grid; }
/* On/off choices are the player's switches: a tile with the label on the left and the switch on the right. */
label.check {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-direction: row-reverse;
  font-weight: 400; font-size: 1rem; cursor: pointer;
  background: var(--tile); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
label.check .lbl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
label.check input {
  appearance: none; -webkit-appearance: none;
  flex: none; width: 46px; height: 26px; margin: 0; padding: 0;
  border-radius: 13px; background: #262b35; border: 1px solid var(--line);
  position: relative; cursor: pointer; transition: background 0.15s;
}
label.check input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--dim); transition: left 0.15s, background 0.15s;
}
label.check input:checked { background: var(--accent); border-color: var(--accent); }
label.check input:checked::after { left: 23px; background: #fff; }
label.check input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 10px 0 18px; }
.cats .check { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { label.check input, label.check input::after { transition: none; } }

/* Players and playlists: tiles that open, like a row in the player's Settings */
details.dev, details.pl { margin-bottom: 8px; }
details.dev > summary, details.pl > summary { padding: 16px 48px 16px 16px; font-size: 1.05rem; font-weight: 400; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
details.dev > summary b, details.pl > summary b { font-weight: 500; }
details.dev > summary .meta, details.pl > summary .meta { margin-left: auto; }
details.dev > form, details.pl > form { padding: 0 16px 16px; }
.acctline { margin: 0; padding: 0 16px 14px; }
.acctline b { font-weight: 500; }
.soon, .acctline.soon b { color: var(--warn, #e0a23c); }
details[open].dev, details[open].pl { border-color: var(--accent); }
.acct .dot { display: inline-block; margin-right: 8px; }
.tag { font-size: 0.78rem; font-weight: 500; padding: 2px 9px; border-radius: 99px; background: var(--page); color: var(--text); }
.tag.ok { background: var(--accent); color: var(--on-accent); }
.tag.warn { background: #4a3f2a; color: #ffd27a; }
.code { background: var(--tile); border: 1px dashed var(--accent); border-radius: 12px; padding: 14px 16px; max-width: none; }
.code b { font-size: 1.6rem; letter-spacing: 0.12em; margin: 0 14px 0 8px; }
.flash { padding: 12px 16px; border-radius: 12px; background: #2f4048; border: 1px solid var(--accent); max-width: none; }
.flash.bad { background: #47323a; border-color: #ff9c8f; }
table { border-collapse: collapse; width: 100%; max-width: 520px; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); }
th { color: var(--dim); font-weight: 500; font-size: 0.9rem; }
.acct-foot { max-width: 1040px; padding-top: 0; padding-bottom: 40px; color: var(--dim); font-size: 0.88rem; }
.acct-foot p { max-width: none; margin: 0; border-top: 1px solid var(--rule); padding-top: 18px; }
.acct-foot p + p { border-top: 0; padding-top: 8px; }
.acct-foot a { margin-right: 18px; }

@media (max-width: 700px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px 14px; }
  /* A player's or playlist's details go on their own line under its name. */
  details.dev > summary .meta, details.pl > summary .meta { flex-basis: 100%; margin-left: 17px; }
  details.pl > summary .meta { margin-left: 0; }
  .acct .brand img { width: 120px; }
}

.mono { font-family: ui-monospace, Consolas, monospace; color: var(--text, #eceff4); user-select: all; }
.acct .hint.mac { grid-column: 1 / -1; margin: 0; }

/* Licences: the counts, then price bands beside the order. */
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 18px; max-width: 560px; }
.stats div { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stats dt { color: var(--dim); font-size: 0.9rem; }
.stats dd { margin: 2px 0 0; font-size: 1.9rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.buy-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 28px; align-items: start; margin-bottom: 18px; }
.acct .buy-label { display: block; font-weight: 500; font-size: 0.95rem; color: var(--text); margin: 0 0 10px; }
.tiers { display: grid; gap: 8px; margin-bottom: 12px; }
.tier {
  display: grid; grid-template-columns: 1fr auto auto; align-items: baseline; gap: 6px; width: 100%; min-height: 56px;
  padding: 12px 16px; font: inherit; color: var(--text); text-align: left; cursor: pointer;
  background: var(--tile); border: 1px solid var(--line); border-radius: 12px;
}
.tier b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.tier:hover { background: var(--tile-hover); }
.tier.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tier:focus-visible, .step:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.order { background: var(--tile); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stepper { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; }
.acct .stepper input[type=number] { max-width: none; margin: 0; height: 48px; padding-top: 0; padding-bottom: 0; text-align: center; font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.step { height: 48px; font: inherit; font-size: 1.4rem; line-height: 1; color: var(--text); background: #262b35; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.step:hover { border-color: var(--accent); color: var(--accent); }
.sum { margin: 18px 0; padding-top: 14px; border-top: 1px solid var(--line); }
.sum p { margin: 0; max-width: none; }
.sum .line { color: var(--dim); font-variant-numeric: tabular-nums; }
.sum .total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 4px; }
.sum .total b { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.sum .nudge { margin-top: 8px; color: var(--accent); }
.order .btn { width: 100%; text-align: center; }
.order > .hint { margin: 10px 0 0; text-align: center; }
@media (max-width: 760px) {
  .buy-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .stats dd { font-size: 1.6rem; }
}

/* Admin: logs from players. */
.acct .pre { white-space: pre-wrap; overflow-wrap: anywhere; max-width: none; margin: 0; }
pre.log {
  margin: 14px 0 0; padding: 14px 16px; max-height: 70vh; overflow: auto;
  background: var(--rail); border: 1px solid var(--line); border-radius: 10px;
  font: 0.82rem/1.5 ui-monospace, Consolas, monospace; color: var(--dim); white-space: pre; tab-size: 4;
}
pre.log:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
pre.log .warn { color: #ebcb8b; }
pre.log .err { color: #ff9c8f; font-weight: 700; }
.card.logrow { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; padding: 14px 16px; }
.logrow .logmain { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.logrow .logmain h2 { margin: 0 0 4px; font-size: 1.05rem; }
.logrow .logmain:hover h2 { text-decoration: underline; }
.logrow .tick { display: grid; place-items: center; width: 32px; height: 32px; margin: 0; flex: none; }
.logrow .tick input { width: 20px; height: 20px; }
.logbar { gap: 10px; margin-bottom: 14px; }
.logrow .note { margin: 6px 0 0; max-width: none; color: var(--text); overflow-wrap: anywhere; }
.card.warn { border-color: #ebcb8b; }
.card.warn h2 { color: #ebcb8b; }
.card.warn pre.log { color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.trial { max-width: 560px; margin: 0 0 18px; padding: 12px 16px; background: var(--tile); border: 1px solid var(--accent); border-radius: 12px; color: var(--dim); }
.trial b { color: var(--text); }
.trial.over { border-color: var(--line); }
/* Sliders, as in the player: the track fills the row, the value sits at its end. */
.acct .slider { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.acct .slider input[type=range] { flex: 1; min-width: 0; max-width: 420px; height: 28px; margin: 0; padding: 0; background: none; border: 0; accent-color: var(--accent); }
.acct .slider b { min-width: 9.5em; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* Licences: card and crypto buttons side by side, stacked when there is no room. */
.pays { display: flex; flex-wrap: wrap; gap: 10px; }
.pays .btn { flex: 1 1 200px; }

/* Admin: tables of accounts and referral codes use the full width and scroll sideways on small screens. */
.scrollx { overflow-x: auto; }
table.wide { max-width: none; white-space: nowrap; }
table.wide td:last-child { text-align: right; }
table.accounts td:first-child { white-space: normal; word-break: break-all; min-width: 14ch; }
.pager { align-items: center; gap: 12px; margin-top: 16px; }
.btn.small { padding: 6px 12px; font-size: 0.88rem; }
/* What's new: the changes wrap instead of scrolling, and on a phone each version becomes its own block. */
table.changes td { vertical-align: top; }
table.changes td:nth-child(3) { white-space: normal; overflow-wrap: anywhere; width: 100%; }
@media (max-width: 640px) {
  table.changes, table.changes tbody, table.changes tr, table.changes td { display: block; }
  table.changes tr:first-child { display: none; }
  table.changes tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
  table.changes tr:last-child { border-bottom: 0; }
  table.changes td { padding: 0; border: 0; white-space: normal; }
  table.changes td:nth-child(1), table.changes td:nth-child(2) { display: inline-block; margin-right: 10px; }
  table.changes td:nth-child(3) { margin: 4px 0 6px; }
  table.changes td:last-child { text-align: left; }
}
table.events td:nth-child(3) { white-space: normal; min-width: 32ch; word-break: break-word; }
table.events td:last-child { text-align: left; }
table.events tr.k-error td:nth-child(2), table.events tr.k-slow td:nth-child(2) { color: var(--warn, #e0a23c); }

/* Admin: the sections, across the top of every Admin page. The current one is underlined in the accent. */
.adminnav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 28px; border-bottom: 1px solid var(--line); }
.adminnav a { padding: 10px 14px; color: var(--dim); text-decoration: none; border-bottom: 3px solid transparent; margin-bottom: -1px; font-weight: 500; }
.adminnav a:hover { color: var(--text); }
.adminnav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Licences: what a licence adds, as a ticked list in two columns when there is room. */
.gets .adds { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px 28px; }
.gets .adds li { position: relative; padding-left: 28px; }
.gets .adds li::before { content: ""; position: absolute; left: 4px; top: 0.3em; width: 12px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }

/* Longer text in a form (the changelog) */
.acct textarea { width: 100%; min-height: 150px; padding: 12px 14px; font: inherit; line-height: 1.5; color: var(--text); background: var(--field, rgba(255,255,255,0.06)); border: 1px solid var(--line); border-radius: 10px; resize: vertical; }
.acct textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Admin > Sales */
.stats { display: flex; flex-wrap: wrap; gap: 14px 40px; }
.stats div { display: flex; flex-direction: column; }
.stats b { font-size: 1.7rem; line-height: 1.2; }
.stats span { color: var(--dim); }
ul.checks { list-style: none; margin: 0; padding: 0; }
ul.checks li { display: flex; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); align-items: baseline; }
ul.checks li:first-child { border-top: 0; }
ul.checks .st { flex: none; width: 3.2em; font-weight: 700; }
ul.checks li.ok .st { color: var(--good, #a3be8c); }
ul.checks li.bad .st { color: var(--bad, #e08a93); }
ul.checks li.off .st { color: var(--dim); }
ul.checks .tx { display: flex; flex-direction: column; min-width: 0; }
ul.checks .tx b { font-weight: 600; }
ul.checks .tx span { color: var(--dim); overflow-wrap: anywhere; }
ul.favs { list-style: none; margin: 0; padding: 0; }
ul.favs li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
ul.favs li:first-child { border-top: 0; }
ul.favs .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
ul.favs .tx b { font-weight: 500; overflow-wrap: anywhere; }
ul.favs .tx span { color: var(--dim); font-size: 0.9rem; }
table.sales td, table.sales th { text-align: right; }
table.sales td:first-child, table.sales th:first-child { text-align: left; }
table.sales th[colspan] { text-align: center; }
table.sales tr.total > * { border-top: 2px solid var(--line); font-weight: 600; }
table.sales .dim { color: var(--dim); }
ul.notes { margin: 0; padding-left: 20px; color: var(--dim); }
ul.notes li { margin: 6px 0; }

/* Codes are shown in capitals on the players, so they are typed in capitals here (site.js makes them so). */
input.upper { text-transform: uppercase; }
input.upper::placeholder { text-transform: none; }

/* Custom categories: the picker's list of channels to tick. */
ul.picks { list-style: none; margin: 12px 0; padding: 0; max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
ul.picks li { border-top: 1px solid var(--line); }
ul.picks li:first-child { border-top: 0; }
ul.picks label { display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; }
ul.picks .tx { display: flex; flex-direction: column; min-width: 0; }
ul.picks .tx b { font-weight: 500; overflow-wrap: anywhere; }
ul.picks .tx span { color: var(--dim); font-size: 0.9rem; }

/* The picker drawn by site.js: a wide search, categories as buttons, a bar with select all, and a footer. */
#picker { display: grid; gap: 12px; margin-top: 4px; }
#picker[hidden] { display: none; }
.pk-search { width: 100%; height: 52px; padding: 0 16px; font-size: 1.1rem; border-radius: 12px; }
.pk-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-chip, .pk-more { font: inherit; font-size: 0.92rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); background: transparent; color: var(--dim); cursor: pointer; }
.pk-chip .n { margin-left: 6px; opacity: 0.7; font-size: 0.85em; }
.pk-chip:hover, .pk-more:hover { color: var(--text); border-color: var(--dim); }
.pk-chip.on, .pk-more.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pk-chip:focus-visible, .pk-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pk-more { width: auto; height: auto; }
.pk-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pk-tools { display: flex; gap: 8px; }
#picker ul.picks { margin: 0; max-height: 52vh; }
#picker ul.picks label.on { background: color-mix(in srgb, var(--accent) 16%, transparent); }
#picker ul.picks label { margin: 0; padding: 7px 12px; user-select: none; }
#picker ul.picks .tx { flex: 1; flex-direction: row; align-items: baseline; justify-content: space-between; gap: 4px 14px; flex-wrap: wrap; }
#picker ul.picks input { accent-color: var(--accent); }
#picker .pk-none { padding: 18px 12px; color: var(--dim); }
.pk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--panel); padding-bottom: 4px; }
.pk-total { color: var(--dim); }

/* Shown over the page while a playlist is being fetched for the channel picker. */
.loading { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: rgba(12, 16, 24, .88); color: #fff; text-align: center; padding: 16px; }
.loading img { width: 128px; height: 128px; }
.loading p { margin: 6px 0 0; font-size: 1.1rem; font-weight: 600; }
.loading small { color: rgba(255, 255, 255, .7); }

/* Players: Cards / Table switch, and the table for many accounts. */
.viewsw { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 0 0 16px; }
.viewsw a { padding: 6px 16px; text-decoration: none; color: var(--dim); }
.viewsw a[aria-current] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
label.grow { flex: 1; max-width: 420px; }
table.players th a { color: inherit; text-decoration: none; }
table.players th a[aria-current] { color: var(--accent); }
table.players th a[aria-current]::after { content: " ▾"; }
table.players td:first-child { white-space: normal; min-width: 16ch; }
table.players td.soon { color: #ffd27a; }
table.players .dot { display: inline-block; vertical-align: middle; margin-right: 8px; }
