/* settings.css: the Settings page and its pickers on the Deep Ink kit.
   #set-panel is ONE page for every setting on every screen: a rail of tabs
   (a tab row on phones) and one pane at a time, with the Adventure group shown
   only while a tale is open. Also the `.eu` dropdown, the three floating
   pickers of the Gameplay pane, and the invite panel. */

/* ---------- App settings: a full-screen page, like Home's Memory page ----------
   Shown by its .open class (openSettings). The motion is the same every time,
   both ways: the page fades in as its content rises 16px into place, and fades
   out as it sinks 16px. Transitions, not a one-shot animation, so it replays on
   every open and close (the panel is never display:none, so dialogs.css's
   svl-rise would only ever run once, at page load). */
#set-panel { display: block; padding: 0; overflow: hidden; isolation: isolate;
  background: var(--sv-bg) radial-gradient(ellipse 90% 70% at 50% -10%, var(--sv-violet-ground), var(--sv-bg) 70%) no-repeat;
  opacity: 0; transition: opacity var(--sv-t3) var(--sv-ease), visibility var(--sv-t3) linear; }
#set-panel:not(.open) { visibility: hidden; pointer-events: none; }
#set-panel.open { opacity: 1; transition: opacity var(--sv-t3) var(--sv-ease); }
#set-panel .sp-scrim { display: none; }
/* The starfield sleeps while the page is closed (it pauses when not on screen);
   allow-discrete keeps it up until the fade out ends. */
#set-panel constellation-sky { transition: display var(--sv-t3) allow-discrete; }
#set-panel:not(.open) constellation-sky { display: none; }
#set-panel .sp { position: relative; z-index: 1; animation: none; transform: translateY(16px); transition: transform var(--sv-t3) var(--sv-ease); }
#set-panel.open .sp { transform: none; }   /* Reduce motion zeroes --sv-t3 (tokens.css), so both just snap */

/* The page: a top bar, then the rail and the pane, centred, scrolling together. */
.svl-settings { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; background: none; box-shadow: none; }
#set-panel .sv-modal__head { flex: none; min-height: var(--sv-topbar-h); padding: 0 clamp(14px, 2.4vw, 32px);
  border-bottom: 1px solid var(--sv-line-soft); background: rgba(var(--sv-ground-rgb), .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
/* Inside the iOS app nothing covers the status bar: the head reaches under it and pads its contents. */
html[data-native-app] #set-panel .sv-modal__head { box-sizing: content-box; padding-top: env(safe-area-inset-top); }
.svl-settings__body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; display: grid; align-items: start;
  grid-template-columns: minmax(var(--sv-space-4), 1fr) 228px minmax(0, 820px) minmax(var(--sv-space-4), 1fr); }
.svl-settings__nav { grid-column: 2; position: sticky; top: 0; max-height: calc(100vh - var(--sv-topbar-h)); overflow-y: auto; scrollbar-width: thin;
  display: flex; flex-direction: column; gap: var(--sv-space-5); padding: var(--sv-space-6) var(--sv-space-3) var(--sv-space-5) 0; }
.svl-settings__group[hidden] { display: none; }
.svl-settings__group-label { padding: 0 var(--sv-space-3) var(--sv-space-2); }
.svl-settings__tabs { flex-direction: column; gap: 0; border-bottom: 0; border-left: 1px solid var(--sv-line); overflow: visible; }
.svl-settings__tabs .sv-tab { position: relative; width: 100%; justify-content: flex-start; padding: 0 var(--sv-space-3); text-align: left; }
.svl-settings__tabs .sv-tab .sv-icon { color: var(--sv-text-dim); }
.svl-settings__tabs .sv-tab:focus-visible { outline-offset: -2px; }   /* inside the rail, which clips on phones */
.svl-settings__tabs .sv-tab[aria-selected="true"] { box-shadow: none; }
.svl-settings__tabs .sv-tab[aria-selected="true"] .sv-icon { color: var(--sv-violet-bright); }
.svl-settings__tabs .sv-tab[aria-selected="true"]::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--sv-violet); }
.svl-settings__panes { grid-column: 3; min-width: 0; overflow: visible; padding: var(--sv-space-6) 0 var(--sv-space-7) var(--sv-space-7); }
.svl-set-pane { max-width: 760px; }
.svl-set-pane[hidden] { display: none; }
/* Each pane opens like the Memory page: eyebrow (its group), big title, one-line lead. */
.svl-set-pane__head { margin-bottom: var(--sv-space-6); }
.svl-set-pane__head .sv-eyebrow { display: block; margin-bottom: var(--sv-space-2); }
.svl-set-pane__title { margin: 0; overflow-wrap: anywhere; }
.svl-set-pane__lead { max-width: 620px; margin: var(--sv-space-2) 0 0; }
.svl-set-group { min-width: 0; }
.svl-set-group + .svl-set-group, .svl-section + .svl-set-group { margin-top: var(--sv-space-5); }
.svl-set-sealed { margin: 0 0 var(--sv-space-4); }
.svl-set-sealed[hidden] { display: none; }
.svl-settings__card { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sv-space-3); padding: var(--sv-space-5); }
.svl-settings__card[hidden], #set-acct-user[hidden] { display: none; }
.svl-id__tier { margin-left: auto; }
.svl-ink .sv-btn { margin-left: var(--sv-space-2); }
.svl-ink .sv-btn[hidden] { display: none; }
.svl-danger__label { margin-bottom: var(--sv-space-2); color: var(--sv-danger); }
#set-context-row .cb-foot { flex: 1 0 100%; }
@media (max-width: 720px) {
  .svl-settings__body { grid-template-columns: minmax(0, 1fr); grid-template-rows: max-content; }   /* the scrolling tab row would otherwise size its row to 0 */
  /* the tab row stays pinned under the top bar while the pane scrolls beneath it */
  .svl-settings__nav { grid-column: 1; z-index: 1; max-height: none; flex-direction: row; align-items: center; gap: var(--sv-space-5); overflow-x: auto; overflow-y: hidden;
    padding: 0 var(--sv-space-4); border-bottom: 1px solid var(--sv-line); background: rgba(var(--sv-ground-rgb), .92); }
  .svl-settings__group { flex: none; }   /* a group keeps its tabs' width; the rail scrolls */
  .svl-settings__group-label { display: none; }
  .svl-settings__tabs { flex-direction: row; gap: var(--sv-space-4); border-left: 0; }
  .svl-settings__tabs .sv-tab { width: auto; padding: 0; }
  .svl-settings__tabs .sv-tab[aria-selected="true"] { box-shadow: var(--sv-e-underline); }
  .svl-settings__tabs .sv-tab[aria-selected="true"]::before { display: none; }
  .svl-settings__panes { grid-column: 1; padding: var(--sv-space-5) var(--sv-space-4) var(--sv-space-6); }
  .svl-set-pane__head { margin-bottom: var(--sv-space-5); }
}
.svl-set-h { margin: 0 0 var(--sv-space-1); }
.svl-set-row { flex-wrap: wrap; padding: var(--sv-space-3) 0; }
.svl-set-row:last-child { border-bottom: 0; }
.svl-set-row > .sv-stack { flex: 1 1 200px; }
label.svl-set-row { cursor: pointer; }
.svl-set-name { font-family: var(--sv-font-body); font-size: var(--sv-fs-17); line-height: 1.3; color: var(--sv-text); }
.svl-set-note { margin: var(--sv-space-2) 0; }
.svl-set-slider .sp-sval { color: var(--sv-violet-bright); }
.svl-set-slider .svl-range { flex: 1 0 100%; }
.svl-set-voice { display: inline-flex; align-items: center; gap: var(--sv-space-2); min-width: 0; }
.svl-set-voice .sv-select { width: auto; min-width: 160px; }
.svl-set-seg { flex-wrap: wrap; margin-top: var(--sv-space-2); }
.svl-set-seg .sv-data { font-size: var(--sv-fs-12); }

/* A switch made from a checkbox: the kit's .sv-toggle, keyed on :checked. The
   generic input[type=checkbox] square in styles.css is out-specified here. */
input.sv-toggle { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 40px; height: 22px; margin: 0;
  border: 1px solid var(--sv-line-strong); border-radius: var(--sv-r); background: var(--sv-surface-field); box-shadow: none; }
input.sv-toggle:hover { border-color: var(--sv-rim); }
input.sv-toggle:checked { border-color: var(--sv-rim); background: var(--sv-surface-primary); box-shadow: none; }
input.sv-toggle:checked::after { top: 3px; left: 21px; width: 14px; height: 14px; border: 0; transform: none; background: var(--sv-violet-bright); }
input.sv-toggle:focus-visible { outline: var(--sv-focus); outline-offset: 2px; }

/* Range: a hairline track filled to the value (--svl-pct, set by app.js) and a square thumb. */
.svl-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 24px; margin: 0; padding: 0; background: none; cursor: pointer; accent-color: var(--sv-violet); }
.svl-range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(var(--sv-violet), var(--sv-violet)) 0 0 / var(--svl-pct, 0%) 100% no-repeat, var(--sv-line-strong); }
.svl-range::-moz-range-track { height: 2px; background: var(--sv-line-strong); }
.svl-range::-moz-range-progress { height: 2px; background: var(--sv-violet); }
.svl-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -6px; border: 0; border-radius: var(--sv-r-badge); background: var(--sv-violet-bright); }
.svl-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: var(--sv-r-badge); background: var(--sv-violet-bright); }
.svl-range:focus-visible { outline: var(--sv-focus); outline-offset: 2px; }
.svl-range:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- .eu dropdown: a select-look button over a kit menu ---------- */
.eu { position: relative; display: inline-block; flex: none; max-width: 100%; }
.eu .eu-btn { width: auto; min-width: 180px; max-width: 280px; display: inline-flex; align-items: center; text-align: left; }
.eu .eu-lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eu.open .eu-btn { border-color: var(--sv-rim); }
.eu > span.eu-btn { box-sizing: border-box; height: var(--sv-h-md); padding: 0 var(--sv-space-3); border: 1px solid var(--sv-line); border-radius: var(--sv-r);
  font-family: var(--sv-font-body); font-size: var(--sv-fs-17); color: var(--sv-text-muted); cursor: default; }   /* read-only value */
.eu-menu { top: calc(100% + 4px); right: 0; min-width: 100%; max-height: 280px; overflow-y: auto; box-sizing: border-box; }
.eu-menu[hidden] { display: none; }
.eu--up .eu-menu { top: auto; bottom: calc(100% + 4px); }
.eu-menu .sv-menu__item { justify-content: space-between; white-space: nowrap; }
.eu-menu .sel { color: var(--sv-text); }
.eu-check { visibility: hidden; color: var(--sv-violet-bright); }
.eu-menu .sel .eu-check { visibility: visible; }

/* ---------- the row-with-a-picker rows (Gameplay, This adventure, Administration) ---------- */
.svl-gs-row { box-sizing: border-box; width: 100%; margin: 0; padding: var(--sv-space-3) var(--sv-space-2); justify-content: flex-start; cursor: pointer; text-align: left;
  color: var(--sv-text); background: none; border: 0; border-bottom: 1px solid var(--sv-line); border-radius: 0; transition: background-color var(--sv-t1) var(--sv-ease); }
.svl-gs-row:last-child { border-bottom: 0; }
.svl-gs-row:hover { background-color: rgba(var(--sv-glow-rgb), .04); }
.svl-gs-row:focus-visible { outline: var(--sv-focus); outline-offset: -1px; }
.svl-gs-row:disabled { opacity: .4; cursor: not-allowed; }
.svl-gs-icon { color: var(--sv-violet); }
.svl-gs-info { flex: 1; }
.svl-gs-name { font-family: var(--sv-font-body); font-size: var(--sv-fs-17); line-height: 1.3; color: var(--sv-text); }
.svl-gs-go { color: var(--sv-text-dim); transition: color var(--sv-t1) var(--sv-ease); }
.svl-gs-row:hover .svl-gs-go { color: var(--sv-violet-bright); }
.svl-gs-row .svl-gs-value { flex: none; width: auto; min-width: 160px; max-width: 45%; display: inline-flex; align-items: center; overflow: hidden; white-space: nowrap; pointer-events: none; }
.svl-gs-value > span { overflow: hidden; text-overflow: ellipsis; }
.svl-gs-row[aria-expanded="true"] .svl-gs-value { border-color: var(--sv-rim); }
@media (max-width: 560px) {   /* the value drops under the name on a phone */
  .svl-gs-row { flex-wrap: wrap; row-gap: var(--sv-space-2); }
  .svl-gs-info { flex: 1 1 200px; }
  .svl-gs-row .svl-gs-value { max-width: none; margin-left: calc(16px + var(--sv-space-4)); }
}

/* The three pickers float above the dialog (SVModal sets --sv-layer). */
.svl-pick-menu { position: fixed; z-index: calc(var(--sv-z-modal) + var(--sv-layer, 0) * 2); box-sizing: border-box; width: max-content; min-width: 260px;
  max-width: min(380px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow-y: auto; }
.svl-pick-item { height: auto; min-height: var(--sv-h-md); padding: var(--sv-space-2) var(--sv-space-3); justify-content: space-between; }
.svl-pick-label { font-family: var(--sv-font-body); font-size: var(--sv-fs-17); line-height: 1.25; color: var(--sv-text-soft); }
.svl-pick-item.active .svl-pick-label { color: var(--sv-text); }
.svl-pick-check { visibility: hidden; color: var(--sv-violet-bright); }
.svl-pick-item.active .svl-pick-check { visibility: visible; }
.svl-pick-menu .load-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; vertical-align: middle; }
.load-dot.light { background: var(--sv-success); }
.load-dot.medium { background: var(--sv-warning); }
.load-dot.heavy { background: var(--sv-danger); }
.load-dot.off { background: var(--sv-text-dim); }
.svl-pick-menu .cadence-now { color: var(--sv-violet-bright); }
.ctx-budget .cb-foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sv-space-3); }
.ctx-budget .cb-val { color: var(--sv-violet-bright); }
.ctx-budget .cb-range { margin: var(--sv-space-1) 0; }
.ctx-budget .cb-foot { color: var(--sv-text-dim); }
.ctx-budget .cb-mode { font-family: var(--sv-font-body); font-style: italic; font-size: var(--sv-fs-14); color: var(--sv-danger); }

/* ---------- invite panel ---------- */
.inv-body { display: flex; flex-direction: column; }
.inv-seats { margin: 0 0 var(--sv-space-2); }
.inv-sub { margin: var(--sv-space-5) 0 var(--sv-space-1); }
.inv-sub[hidden] { display: none; }
.inv-list { display: flex; flex-direction: column; }
.inv-row { justify-content: flex-start; gap: var(--sv-space-3); padding: var(--sv-space-2) 0; }
.inv-row:last-child { border-bottom: 0; }
.inv-seatno { flex: none; width: 20px; text-align: center; color: var(--sv-violet); }
.inv-who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--sv-font-body); font-size: var(--sv-fs-17); color: var(--sv-text); }
.inv-who em { color: var(--sv-text-dim); }
.inv-seat, .inv-act { flex: none; }
.inv-empty { margin: 0; padding: var(--sv-space-2) 0; }
.inv-note { margin: var(--sv-space-3) 0 0; min-height: 1.3em; }
.inv-row.pending { opacity: .62; border-bottom-style: dashed; }
@media (max-width: 560px) { .inv-row:not(.pending) .inv-seat { display: none; } }   /* an invitation keeps its label */
