/* settings.css — Settings and the screens it opens: Account, Playlists, Manage categories, Speed test,
 * What's new and Diagnostics (screens/settings, screens/playlists). Sizes are the Android app's dp
 * values in CSS pixels; layout classes come from orientation.js (no vw/vh or media queries). */

/* ======================= building blocks (settings/common.js) ======================= */
.st-tile { display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.st-group { padding-bottom: 22px; }
.st-group-head { display: flex; align-items: center; gap: 8px; padding: 0 6px 8px; }
.st-group-title { flex: 1; min-width: 0; font: 600 15px/20px var(--font); letter-spacing: -0.1px; color: var(--text); }
.st-group-head .st-tile { margin-right: 0; }
.st-card { background: var(--surface); border: 0.6px solid var(--separator); border-radius: 14px; padding: 4px; }
.st-group-foot { padding: 8px 8px 0; font: 400 12px/16px var(--font); color: var(--text-2); }
.st-divider { height: 0.6px; background: var(--separator); margin: 0 14px; }
.st-divider.inset { margin-left: 58px; }
.st-end { height: 28px; }

/* a row (SettingsRow): 54 tall at least, the whole row is the tap target */
.set-row { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 54px; padding: 10px 14px; border-radius: 10px;
  text-align: left; color: var(--text); transition: background-color 120ms, color 120ms; }
.set-row.press.hot { transform: none; background: var(--accent); color: var(--on-accent); }
.set-row.hot .st-row-desc, .set-row.hot .st-value, .set-row.hot .st-chev, .set-row.hot .st-row-title { color: var(--on-accent) !important; }
.set-row.hot .st-row-desc { opacity: 0.8; }
.set-row.hot .st-push, .set-row.hot .st-step { background: rgba(255,255,255,0.22); color: var(--on-accent); }
.set-row.hot .st-note { color: var(--on-accent); }
.set-row.off > .st-row-main, .set-row.off > .st-trail, .set-row.off > .st-tile { opacity: 0.45; }
.set-row.danger .st-row-title { color: var(--danger); }
.set-row.inert { cursor: default; }
.set-row > .st-tile { margin-right: -2px; }
.st-row-main { flex: 1; min-width: 0; }
.st-row-title { font: 500 15px/21px var(--font); }
.st-row-desc { margin-top: 2px; font: 400 13px/18px var(--font); color: var(--text-2); }
.st-trail { display: flex; align-items: center; gap: 8px; flex: none; max-width: 52%; }
.st-value { font: 400 14px/19px var(--font); color: var(--text-2); max-width: 230px; }
.compact .st-value { max-width: 130px; }
.st-info-v { text-align: right; white-space: normal; max-width: 320px; }
.compact .st-info-v { max-width: 170px; }
.st-chev { display: inline-flex; color: var(--text-3); margin-right: -4px; }
.st-push { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px; background: var(--surface-high); color: var(--text);
  font: 600 13px/18px var(--font); white-space: nowrap; }
.st-push.danger { color: var(--danger); }
.st-note { display: inline-flex; align-items: center; gap: 5px; color: var(--success); font: 500 13px/18px var(--font); white-space: nowrap; }
.st-note.err { color: var(--warning); }
.st-cdot { display: inline-block; border-radius: 50%; box-shadow: inset 0 0 0 0.8px var(--separator); flex: none; }
.st-dots { display: inline-flex; align-items: center; gap: 5px; }
.st-dots:empty { display: none; }
.st-adot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.st-adot.sel { width: 16px; height: 16px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(127,127,127,0.75); margin: 0 2px; }
.set-row.hot .st-adot.sel { box-shadow: 0 0 0 2px var(--accent), 0 0 0 4px var(--on-accent); }

/* the − / + stepper (StepperRow) */
.st-step { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-high); color: var(--text); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.st-step.hot { transform: scale(0.92); background: var(--accent); color: var(--on-accent); }
.st-step.dim .mi { opacity: 0.35; }
.st-step-value { min-width: 84px; padding: 0 6px; text-align: center; font: 600 14px/19px var(--font); white-space: nowrap; }
.compact .st-step-value { min-width: 64px; }

/* the switch's haptic overlay (lib/haptics.js) on these rows */
.set-row.has-hap > label.hap-in { position: absolute; inset: 0; z-index: 3; margin: 0; padding: 0; border: 0; opacity: 0; border-radius: inherit; }

/* a read-only line (InfoLine) */
.st-info { padding: 11px 14px; }
.st-info-row { display: flex; align-items: center; gap: 12px; }
.st-info-label { flex: 1; min-width: 0; font: 400 15px/21px var(--font); color: var(--text-2); }
.st-info-value { font: 500 15px/21px var(--font); color: var(--text); text-align: right; max-width: 320px; }
.compact .st-info-value { max-width: 180px; }
.st-info-foot { margin-top: 3px; font: 400 12px/16px var(--font); color: var(--text-3); }
.st-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-right: -5px; }
.st-text { padding: 12px 14px; font: 400 14px/19px var(--font); color: var(--text); white-space: pre-line; }
.st-text.small { padding: 10px 14px; font: 400 12px/16px var(--font); color: var(--text-2); }

/* the PIN gate behind its dialog */
.st-locked { display: flex; align-items: center; justify-content: center; }

/* ======================= Settings ======================= */
.settings .st-wide { position: absolute; inset: 0; display: flex; gap: 24px;
  padding: calc(var(--safe-top) + 14px) calc(var(--pad-h) + var(--safe-right)) calc(var(--safe-bottom) + 14px) calc(var(--pad-h) + var(--safe-left)); }
.lh-short .settings .st-wide { gap: 18px; padding-top: calc(var(--safe-top) + 10px); padding-bottom: calc(var(--safe-bottom) + 10px); }
/* the sidebar: a floating translucent panel, like macOS */
.st-side { flex: none; display: flex; flex-direction: column; min-height: 0; padding: 12px 10px; border-radius: 18px; background: var(--sidebar);
  border: 0.6px solid rgba(255,255,255,0.10); -webkit-backdrop-filter: blur(30px) saturate(1.4); backdrop-filter: blur(30px) saturate(1.4); }
:root[data-theme="light"] .st-side { border-color: rgba(0,0,0,0.08); }
.st-side-head { display: flex; align-items: center; gap: 10px; padding: 0 0 10px 4px; }
.st-side-head .t-title { min-width: 0; }
.ibtn.st-back { width: 34px; height: 34px; }
.st-search { flex: none; }
.st-side-list { flex: 1; min-height: 0; margin: 10px -4px 0; padding: 0 4px 8px; }
.st-side-row { display: flex; align-items: center; gap: 10px; width: 100%; height: 42px; margin: 1px 0; padding: 0 8px; border-radius: 10px;
  font: 500 14px/19px var(--font); color: var(--text); transition: background-color 120ms, color 120ms; }
.st-side-row.sel { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.st-side-row.hot { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.st-side-gap { height: 10px; }
.lh-short .st-side { padding: 10px 8px; }
.lh-short .st-side-row { height: 38px; }
/* the pane */
.st-pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.st-pane-head { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; flex: none; }
.st-pane-titles { flex: 1; min-width: 0; }
.st-pane-title { font: 600 28px/34px var(--font); letter-spacing: -0.4px; }
.lh-short .st-pane-head { padding-bottom: 10px; gap: 12px; }
.lh-short .st-pane-head > .st-tile { width: 38px !important; height: 38px !important; border-radius: 10px !important; }
.lh-short .st-pane-head > .st-tile .mi { font-size: 24px !important; }
.lh-short .st-pane-title { font-size: 24px; line-height: 30px; }
.st-pane-body { flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.st-pane-body > .state { min-height: 70%; }
.st-restore { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding-bottom: 8px; }
.st-restore-note:empty { display: none; }
/* narrow: the section list, a section's page */
.st-search-wrap { padding-top: 0; padding-bottom: 14px; flex: none; }
.st-page { padding-top: 10px; }
.st-sec-row { gap: 12px; }
/* the swatch picker (accent and subtitle colours) */
.st-swatch-grid { display: grid; justify-content: space-evenly; row-gap: 14px; padding: 4px 0 6px; }
.st-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; }
.st-swatch-dot { width: 42px; height: 42px; margin: 6px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 0.8px var(--separator); transition: transform 140ms var(--ease), box-shadow 140ms; }
.st-swatch.hot .st-swatch-dot { transform: scale(1.12); box-shadow: 0 0 0 3px var(--accent), 0 0 18px rgba(var(--accent-rgb),0.45); }
.st-swatch-label { max-width: 76px; font: 400 12px/16px var(--font); color: var(--text-2); }
.st-swatch.sel .st-swatch-label { color: var(--text); font-weight: 600; }
.st-swatch-foot { display: flex; justify-content: flex-end; padding: 14px 0 4px; }

/* ======================= Account ======================= */
.ac-top { display: flex; flex-direction: column; gap: 10px; padding-bottom: 14px; flex: none; }
.account.ac-wide .ac-top { flex-direction: row; align-items: center; gap: 18px; }
.ac-actions { display: flex; gap: 10px; flex: none; max-width: 100%; }
.ac-status { display: flex; align-items: center; gap: 8px; font: 400 13px/18px var(--font); min-width: 0; }
.ac-status > span:last-child { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ac-status .mi { flex: none; }
.ac-warn { color: var(--warning); display: inline-flex; }
.ac-body { padding-top: 0; }
.ac-cols { display: flex; gap: 18px; align-items: flex-start; }
.ac-col { flex: 1; min-width: 0; }
.ac-lifetime { --gold: #FFC53D; display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; color: var(--gold);
  background: color-mix(in srgb, var(--gold) 14%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); font: 600 13px/18px var(--font); white-space: nowrap; }
:root[data-theme="light"] .ac-lifetime { --gold: #B7791F; }
.ac-plan { padding-top: 10px; padding-bottom: 10px; }
.ac-support { padding: 12px 14px; }
.ac-support-text { margin-top: 4px; color: var(--text); white-space: pre-line; -webkit-user-select: text; user-select: text; }
.ac-signout { display: flex; justify-content: center; padding: 4px 0 8px; }

/* ======================= Playlists ======================= */
.pl-list { display: flex; flex-direction: column; gap: 12px; }
.pl-row { display: flex; align-items: center; gap: 10px; }
.pl-card { flex: 1; min-width: 0; display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: 16px; background: var(--surface); text-align: left; color: var(--text);
  transition: transform 160ms var(--ease), box-shadow 160ms, background-color 160ms; }
.pl-card.hot { transform: scale(0.985); box-shadow: 0 0 0 2px var(--accent); }
.pl-avatar { width: 54px; height: 54px; border-radius: 15px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff;
  font: 600 18px/24px var(--font); letter-spacing: -0.2px; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-name-row { display: flex; align-items: center; gap: 10px; min-width: 0; margin-bottom: 1px; }
.pl-name { font: 600 18px/24px var(--font); letter-spacing: -0.2px; min-width: 0; }
.badge.pl-active { background: var(--success); color: #fff; flex: none; }
.pl-account { font: 500 13px/18px var(--font); }
.pl-sync { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.pl-progress { background: var(--surface-highest); }
.pl-hint { margin: 16px 4px 0; }

/* ======================= Manage categories ======================= */
.categories .cm-tools { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; flex: none; }
.cm-tabs { flex: none; }
.cm-hint { margin: 0; padding-bottom: 8px; flex: none; }
.cm-listbox { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }
.cm-listbox > .vl { flex: 1; min-height: 0; }
.cm-listbox > .state { flex: 1; }
.cm-list { padding-bottom: var(--safe-bottom); }
.cm-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.cm-main { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; gap: 0; padding: 8px 14px; margin-right: 2px; border-radius: 12px; background: var(--surface);
  text-align: left; color: var(--text); transition: background-color 120ms, color 120ms; }
.cm-main.hot { background: var(--accent); color: var(--on-accent); }
.cm-main.hot .cm-num, .cm-main.hot .cm-status, .cm-main.hot .cm-lock { color: var(--on-accent); }
.cm-num { width: 34px; flex: none; font: 400 12px/16px var(--font); color: var(--text-2); }
.cm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cm-name { font: 500 15px/21px var(--font); }
.cm-main.hidden-cat .cm-name { color: var(--text-3); text-decoration: line-through; }
.cm-main.hidden-cat.hot .cm-name { color: var(--on-accent); }
.cm-status { font: 400 12px/16px var(--font); color: var(--text-2); }
.cm-adult { margin-left: 8px; padding: 2px 6px; border-radius: 5px; background: rgba(255,69,58,0.18); color: var(--danger); font: 600 10px/14px var(--font); flex: none; }
.cm-main.hot .cm-adult { background: rgba(255,255,255,0.25); color: var(--on-accent); }
.cm-lock { margin-left: 8px; display: inline-flex; color: var(--text-2); flex: none; }
.cm-btn { border-radius: 50%; }
.cm-btn.dim .mi { color: var(--text-3); }
.cm-btn.hot .mi { color: var(--on-accent); }

/* ======================= What's new ======================= */
.wn-list { display: flex; flex-direction: column; gap: 14px; padding: 6px 0 32px; max-width: 900px; }
.wn-card { padding: 18px; border-radius: 16px; background: var(--surface); border: 0.6px solid var(--separator); }
.wn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wn-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wn-lines li { display: flex; font: 400 14px/19px var(--font); color: var(--text); }
.wn-bullet { width: 16px; flex: none; color: var(--accent); }

/* ======================= Speed test ======================= */
.speedtest .sp-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2px calc(var(--pad-h) + var(--safe-right)) calc(var(--safe-bottom) + 14px) calc(var(--pad-h) + var(--safe-left)); }
.speedtest.sp-wide .sp-body { flex-direction: row; gap: 18px; }
.sp-scroll { flex: 1; min-height: 0; margin: 0 -4px; padding: 0 4px 24px; }
.sp-scroll .sp-panel { height: 400px; margin-bottom: 18px; }
.sp-wide .sp-panel { flex: 1; min-width: 0; }
.sp-side { flex: 1; min-width: 0; min-height: 0; margin-right: -4px; padding-right: 4px; }
.sp-panel { position: relative; display: flex; align-items: center; justify-content: center; padding: 18px; border-radius: 20px; background: var(--surface); border: 0.6px solid var(--separator); overflow: hidden; }
.sp-panel-in { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.sp-gauge { position: relative; flex: none; }
.sp-dial { position: absolute; inset: 0; overflow: visible; }
.sp-track { stroke: rgba(255,255,255,0.08); }
:root[data-theme="light"] .sp-track { stroke: rgba(0,0,0,0.08); }
.sp-glow { stroke: rgba(var(--accent-rgb), 0.13); }
.sp-arc { stroke: var(--accent); }
.sp-tip { fill: #fff; }
.sp-scale { fill: var(--text-3); font-family: var(--font); font-weight: 500; }
text.sp-mark { fill: var(--text-3); opacity: 0.7; font-family: var(--font); font-weight: 600; }
circle.sp-mark { fill: var(--text-3); opacity: 0.7; }
.sp-mark.lit { fill: var(--accent); opacity: 1; }
.sp-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; pointer-events: none; }
.sp-label { font: 600 11px/14px var(--font); letter-spacing: 1.2px; color: var(--text-2); }
.sp-label.ca { color: var(--accent); }
.sp-number { font-family: var(--font); font-weight: 700; letter-spacing: -1px; line-height: 1.15; color: var(--text); font-variant-numeric: tabular-nums; }
.sp-unit { font: 600 15px/20px var(--font); color: var(--text-2); }
.sp-stats { display: flex; gap: 10px; width: 100%; max-width: 360px; }
.sp-stat { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,0.05); }
:root[data-theme="light"] .sp-stat { background: rgba(0,0,0,0.05); }
.sp-stat-label { font: 600 11px/14px var(--font); letter-spacing: 0.4px; color: var(--text-3); white-space: nowrap; }
.sp-verdict { display: flex; align-items: center; gap: 14px; padding: 12px 14px; }
.sp-vtile { position: relative; width: 40px; height: 40px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; overflow: hidden; }
.sp-vtile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(255,255,255,0.16), transparent); }
.sp-vtile .mi { position: relative; z-index: 1; }
.sp-vtext { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sp-quality { display: flex; align-items: center; gap: 10px; padding: 9px 14px; }
.sp-qname { font: 500 15px/21px var(--font); }
.sp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: color-mix(in srgb, var(--pill) 14%, transparent);
  font: 600 13px/18px var(--font); white-space: nowrap; flex: none; }
.sp-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--pill); }

/* ======================= Diagnostics ======================= */
.dg-body { padding-top: 2px; }
.dg-row { display: flex; align-items: center; padding: 10px 14px; min-width: 0; }
.dg-head { padding-top: 8px; padding-bottom: 8px; font: 600 11px/14px var(--font); letter-spacing: 0.4px; color: var(--text-3); }
.dg-col { width: 86px; flex: none; display: flex; justify-content: center; text-align: center; }
.dg-codecs.compact .dg-col { width: 48px; }
.dg-name { min-width: 0; padding-right: 6px; }
.dg-title { font: 500 15px/21px var(--font); }
.dg-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(127,127,127,0.55); }
.dg-dot.on { background: var(--success); box-shadow: none; }
.dg-plays .mi { display: block; }
.dg-log { margin: 0; max-height: 240px; padding: 10px 14px; font: 400 11px/16px ui-monospace, Menlo, monospace; color: var(--text-2); white-space: pre-wrap; word-break: break-all;
  -webkit-user-select: text; user-select: text; }
.sp-panel-in.side { flex-direction: row; justify-content: center; gap: 14px; }
.sp-panel-in.side .sp-stats { flex-direction: column; width: 106px; max-width: none; }
