/* ===== SETTINGS PAGE =====
   The shell AND the content typography come from legal.css + theme.css, exactly
   like the privacy / terms / cookies pages. This file only adds the interactive
   controls: toggle switches, buttons and a small status line. */

/* a real, clickable button (Download / Clear cache) */
.setting-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: #dfe2e6;
  background: none;
  border: 1px solid rgba(255,255,255,0.26);
  padding: 10px 18px;
  min-height: 44px;                    /* comfortable touch target (iOS/Android) */
  cursor: pointer;
  text-decoration: none;               /* a.setting-btn is a link; drop the underline */
  touch-action: manipulation;          /* no 300ms tap delay / double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}
.setting-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.05);
}
.setting-btn:disabled { opacity: 0.5; cursor: default; }

/* .content a (in legal.css) underlines every content link and outranks
   .setting-btn, so the button-styled link needs an equally-specific rule to
   stay clean and match the real <button>s. */
.content a.setting-btn { text-decoration: none; }
.content a.setting-btn:hover { color: #fff; text-decoration: none; }

/* high-contrast underlines every content link with !important; keep the
   button-styled link clean there too (it's a control, not body copy) */
html[data-contrast="high"] .content a.setting-btn { text-decoration: none !important; }

.control-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.setting-status { font-size: 0.78rem; letter-spacing: 0.04em; color: #9a9ea6; }

/* the two Offline-access buttons are a matched pair: equal width so they read
   as one consistent control group instead of two mismatched buttons */
.btn-pair { max-width: 440px; }
.btn-pair .setting-btn { flex: 1 1 0; text-align: center; }

/* toggle switch — same hairline language, accent fill when on */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 8px 0;                      /* taller hit area for touch (~42px) */
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-track {
  position: relative;
  flex: none;
  width: 46px;
  height: 26px;
  border-radius: 2px;                 /* sharp, not a pill */
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.32);
  transition: background .25s ease, border-color .25s ease;
}
.switch-thumb {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 1px;                 /* square block, not a dot */
  background: #8a8e96;                 /* monochrome grey when off */
  transform: translateY(-50%);
  transition: transform .25s ease, background .25s ease;
}
.switch input:checked + .switch-track {
  background: #f2f3f5;                 /* fills near-white when on (no colour) */
  border-color: #f2f3f5;
}
.switch input:checked + .switch-track .switch-thumb {
  transform: translateY(-50%) translateX(20px);
  background: #0c0d0f;                 /* dark block on the white track */
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 2px;
}
/* locked (driven by Performance mode): dimmed + not interactive */
.switch input:disabled + .switch-track { opacity: 0.5; cursor: default; }
.switch input:disabled ~ .switch-label { opacity: 0.5; }
.switch-label {
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: #9a9ea6;
}

/* phones: let the paired buttons (Offline access) share the row and wrap
   cleanly instead of overflowing narrow screens */
@media (max-width: 560px) {
  .control-row { gap: 0.7rem 0.8rem; }
  .control-row .setting-btn { flex: 1 1 44%; }
}
