/* Settings: grouped lists the iOS Settings way, every control the browser's own (selects, switches, a file picker) */
.set h1 { margin-bottom: 6px; }
.set-form { width: 100%; }
.set-group { width: 100%; border-radius: var(--r); background: var(--bg2); overflow: hidden; }
.set-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 52px;
  padding: 8px 16px; border: 0; background: none; color: var(--label); font: 400 16px/1.3 var(--font); letter-spacing: -.016em; text-align: left; cursor: pointer; }
.set-row + .set-row { border-top: .5px solid var(--sep); }
@media (hover: hover) { .set-row:hover { text-decoration: none; } }   /* the Account row is a link: no underline on hover */
.set-l { display: grid; gap: 2px; min-width: 0; }
.set-l small { color: var(--label2); font-size: 13px; }
.set-state { font-weight: 600; color: var(--label); }   /* On. or Off. at the start of a status line */
.set-row select { flex: none; width: 172px; max-width: 55%; text-overflow: ellipsis; height: 36px; padding: 0 28px 0 12px; border: 0; border-radius: var(--r); font: 500 15px/1 var(--font); color: var(--label); appearance: none; cursor: pointer;
  background: var(--frost) var(--pop-chev) no-repeat right 11px center / 8px 13px; box-shadow: var(--frost-line); }
.set-row input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.set-row input:checked + .sw { background: var(--green); }
.set-row input:checked + .sw::after { translate: 20px 0; }
.set-row input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Safari's own iOS switch where it exists */
.native-sw .set-row input[type="checkbox"] { position: static; opacity: 1; width: auto; height: auto; margin: 0; accent-color: var(--green); font-size: 17px; }
.native-sw .set-row .sw { display: none; }
.set-chev { flex: none; width: 8px; height: 8px; border-right: 2px solid var(--label3); border-bottom: 2px solid var(--label3); transform: rotate(-45deg); }
.set-file { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.set-danger .set-l { color: #ff3b30; }
@media (hover: hover) { .set-link:hover { background: var(--fill); } }
.set-row:focus-visible, .set-row:has(.set-file:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.set-note { min-height: 20px; margin: 12px 4px 0; font-size: 14px; color: var(--green); }
.set-ver { margin: 18px 0 0; color: var(--label2); font-size: 13px; }

.set-note:empty { display: none; }   /* only takes up room when it has something to say */

/* Move to another device: the QR code, white on any theme so phone cameras read it */
.move-qr { display: grid; place-items: center; margin: 16px 0 4px; }
.move-qr svg { width: min(260px, 70vw); height: auto; border-radius: var(--r); box-shadow: 0 0 0 .5px var(--sep), 0 10px 30px rgba(0, 0, 0, .18); }
.move-none { margin: 0; font-size: 14px; color: var(--label2); text-align: center; }

/* ============================================================ the Settings page: a large title, then one rounded panel in
   columns (three on computers, two on tablets, one on phones). Your account is a big picture card with a pill button,
   the settings are grouped lists, and your data is a stack of tiles with an icon, a line of help and a chevron. */
.set-page { --sp-panel: var(--fr-bg); --sp-group: var(--fr-in); --sp-rim: var(--fr-rim);
  width: 100%; max-width: var(--max); margin: 0 auto 0 var(--page-left); padding: 8px var(--gutter-r) 0 var(--gutter); }
@media (max-width: 719px) { :root .set-page { --sp-rim: transparent; } }
.set-page .large-title { margin: 14px 0 6px; padding-inline: 4px; }
.set-lede { margin: 0 0 22px; padding-inline: 4px; font-size: 17px; color: var(--label2); text-wrap: balance; }
.set-page .set-form { container-type: inline-size; }

.set-panel { display: grid; gap: 28px; padding: 26px; border-radius: var(--r); background: var(--sp-panel); box-shadow: inset 0 0 0 .5px var(--sp-rim), var(--lit-glow, 0 0 #0000);
  -webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%); }
.set-col, .set-sec { display: grid; gap: 24px; align-content: start; min-width: 0; }
.set-sec { gap: 10px; }
.set-h { margin: 0; padding-inline: 4px; font: 700 22px/1.2 var(--font); letter-spacing: -.008em; }   /* the site's section heading (.row-h) */
.set-page .set-group { border-radius: var(--r); background: var(--sp-group); box-shadow: inset 0 0 0 .5px var(--sp-rim); }
.set-page .set-row { min-height: 56px; padding: 10px 16px; }
.set-page .set-row + .set-row { border-top: 0; }
.set-page .set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }   /* hairlines inset, the iOS way */
.set-page .set-row select { width: auto; min-width: 112px; max-width: 60%; padding: 0 28px 0 12px; border-radius: var(--r); }   /* as wide as its longest choice, so none is cut off */
@media (hover: hover) { .set-page .set-link:hover { background: none; } }
@media (hover: hover) { .set-page .set-link:hover .set-pill, .set-hero:hover .set-pill { background: var(--bt-hover); } }

/* rows with a little colour square for an icon, the iOS Settings way; hairlines start at the words */
.set-ic.set-ic-s { width: 30px; height: 30px; transition: transform .45s var(--ease-spring); }
.set-ic.set-ic-s svg { width: 18px; height: 18px; stroke-width: 2; }
.set-page .set-row-ic { justify-content: flex-start; gap: 12px; }
.set-page .set-row-ic .set-l { flex: 1; }
@media (hover: hover) { :root:not(.still) .set-page .set-row-ic:hover .set-ic-s { transform: scale(1.08) rotate(-4deg); } }

/* the pill buttons (Choose, Sign in): the house's navy, regular weight, never bold */
.set-pill { flex: none; display: inline-grid; place-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--r); font: 500 15px/1 var(--font);
  -webkit-font-smoothing: antialiased; color: #fff; background: var(--bt-fill); -webkit-backdrop-filter: var(--fr-blur); backdrop-filter: var(--fr-blur); transition: background .2s ease; }

/* your account: the big picture card */
.set-hero { display: grid; gap: 14px; color: var(--label); text-decoration: none; border-radius: var(--r); -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .set-hero:hover { text-decoration: none; } }
.set-hero:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.set-art { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r);
  background: radial-gradient(60% 80% at 18% 20%, #0a84ff 0, transparent 70%), radial-gradient(55% 75% at 85% 25%, #bf5af2 0, transparent 70%),
    radial-gradient(70% 80% at 60% 105%, #ff375f 0, transparent 70%), #1c1c3a; box-shadow: inset 0 0 0 .5px var(--sp-rim); }
/* your colour: the card behind your initial is lit in its shades (and a darker field of it) instead of Tenner's three */
:root[data-me] .set-art { background: radial-gradient(60% 80% at 18% 20%, hsl(var(--me-h) 90% 58%) 0, transparent 70%),
  radial-gradient(55% 75% at 85% 25%, hsl(calc(var(--me-h) + 35) 80% 60%) 0, transparent 70%),
  radial-gradient(70% 80% at 60% 105%, hsl(calc(var(--me-h) - 30) 85% 55%) 0, transparent 70%), hsl(var(--me-h) 45% 14%); }
.set-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(closest-side, rgba(255, 255, 255, .16), transparent); pointer-events: none; }
.set-bg { position: absolute; inset: -20%; width: 140%; height: 140%; object-fit: cover; filter: blur(40px) saturate(1.6) brightness(.85); }
.set-art .set-av { position: relative; z-index: 1; width: 84px; height: 84px; font-size: 34px; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 12px 30px rgba(0, 0, 0, .3); }
.set-art span.av:not([style*="--h"]) { background: rgba(255, 255, 255, .22); color: #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.set-art .set-av svg { width: 46px; height: 46px; }
.set-art .set-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.set-hero-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-inline: 4px; }
.set-hero-foot b { font: 600 20px/1.2 var(--font); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-hero-foot small { font-size: 15px; }

/* your data: tiles */
.set-ic { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); color: #fff;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 80%, #fff), var(--c)); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2); }
.set-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
/* a press shrinks a touch and springs back, when Animations are on */
:root:not(.still) .set-hero { transition: background .2s ease, scale .35s var(--ease-spring); }
:root:not(.still) .set-hero:active { scale: .98; }

/* the "Saved" note floats up from the foot of the screen, like a toast */
.set-page .set-note { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 40; translate: -50% 0; margin: 0;
  padding: 11px 18px; border-radius: var(--r); font: 500 15px/1.2 var(--font); color: var(--label); background: var(--gl-fill);
  box-shadow: inset 0 0 0 .5px var(--gl-rim), 0 10px 30px rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8); }
@media (max-width: 999px) { .set-page .set-note { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); } }   /* clears the floating tab bar */
.set-page .set-ver { padding-inline: 4px; }

/* columns as there's room for them */
@container (min-width: 640px) {
  .set-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .set-col:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }   /* the charts run down the right; alerts and your data follow on under you */
}
@container (min-width: 1000px) {
  .set-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .set-col:nth-child(2) { grid-row: auto; }
  .set-page .set-row-ic select { width: 124px; }
}
/* phones: no outer panel, just the groups, edge to edge in the gutter */
@container (max-width: 639px) {
  .set-panel { padding: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; }
  .set-panel.lit::before { display: none; }
  .set-page .set-form .set-group { background: var(--fr-bg); -webkit-backdrop-filter: var(--fr-blur); backdrop-filter: var(--fr-blur); }
}
/* phones: the groups filled, never outlined (as every box on a phone); Increase Contrast gives them their edge back */
@media (max-width: 719px) { :root .set-page .set-form .set-group, :root .set-page .set-group { background: var(--ph-box); } }
@media (prefers-contrast: more) { :root .set-page { --sp-rim: var(--fr-rim); } :root .set-page .set-group { box-shadow: inset 0 0 0 1px var(--fr-rim); } }
@media (prefers-reduced-transparency: reduce) {
  .set-panel, .set-page .set-note, .set-art span.av { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .set-page { --sp-panel: var(--bg2); --sp-group: var(--card); }
  .set-page .set-note { background: var(--card); }
}

/* signed in: the alert choices under the Alerts switches, and Not interested's list of hidden titles */
.set-group[hidden] { display: none; }
.hid-list { list-style: none; display: grid; max-height: min(52vh, 420px); overflow: auto; margin: 14px 0 4px; padding: 0;
  -webkit-mask-image: linear-gradient(transparent, #000 10px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(transparent, #000 10px, #000 calc(100% - 14px), transparent); }
.hid-list li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; text-align: left; }
.hid-list li + li { border-top: .5px solid var(--sep); }
.hid-list img, .hid-ph { flex: none; width: 40px; aspect-ratio: 2 / 3; border-radius: calc(var(--r) - 3px); object-fit: cover; background: hsl(var(--h, 210) 40% 32%); }
.hid-list .set-l { flex: 1; }
.hid-list .set-l b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hid-list .btn { flex: none; height: 36px; padding: 0 12px; font-size: 14px; }
.hid-none { justify-content: center; color: var(--label2); font-size: 15px; }

/* More: each group's less-used settings, folded away under one row (a native <details>). The row reads like the others,
   with a grey line saying what's inside and a chevron that turns down as it opens. */
.set-more { position: relative; }
.set-more[hidden] { display: none; }
.set-more > summary { list-style: none; -webkit-tap-highlight-color: transparent; }
.set-more > summary::-webkit-details-marker { display: none; }
.set-more > summary .set-l { color: var(--label); }
.set-more > summary .set-chev { margin-right: 4px; rotate: 0deg; }
.set-more[open] > summary .set-chev { rotate: 90deg; }
@media (hover: hover) { .set-page .set-group .set-more > summary:hover { background: var(--fill); } }
.set-more > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* hairlines, inset the iOS way: above the More row, and between it and what it opens */
.set-page .set-group > .set-more::before, .set-page .set-more-in > .set-row:first-child::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.set-page .set-group > .set-more:first-child::before { display: none; }
/* Your data: More is a slim tile, and opens to more tiles */
/* it grows open and folds shut, when Animations are on (and the browser can animate to its height) */
@supports selector(::details-content) {
  :root:not(.still) .set-more { interpolate-size: allow-keywords; }
  :root:not(.still) .set-more::details-content { height: 0; overflow: clip; opacity: 0;
    transition: height .4s var(--ease-out), opacity .3s ease, content-visibility .4s allow-discrete; }
  :root:not(.still) .set-more[open]::details-content { height: auto; opacity: 1; }
  :root:not(.still) .set-more > summary .set-chev { transition: rotate .35s var(--ease-spring); }
}

/* hairlines above a row with an icon start at its words (after the More rows' own rules above) */
.set-page .set-group > .set-row-ic:not(:first-child)::before, .set-page .set-group > .set-more:has(> .set-row-ic)::before { left: 58px; }

/* Your data: Import | Export | Clear all as one button group, with a grey line saying what each does */
.set-acts { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 16px; cursor: default; }
.set-acts .bgrp { width: 100%; }
.set-acts .bgrp .btn { position: relative; height: 44px; gap: 7px; justify-content: center; font-size: 15px; white-space: nowrap; }
.set-acts .bgrp .btn svg { width: 17px; height: 17px; flex: none; }
.set-acts .set-file { z-index: 1; }
.set-acts-note { color: var(--label2); font-size: 13px; line-height: 1.35; }
