/* ═══ RESET ═══ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ═══ THEME VARIABLES ═══ */
:root {
  --bg: #f8f7f4;
  --bg-key: #fff;
  --text-1: #1a1a1a;
  --text-2: #333;
  --text-3: #555;
  --text-4: #777;
  --text-5: #999;
  --red: #c82020;
  --red-text: #c82020;
  --amber: #92400e;
  --border: #e8e6e1;
  --border-key: #d5d3ce;
  --glow: rgba(200,32,32,0.03);
  --hero-glow: rgba(200,32,32,0.1);
  --font: 'Space Grotesk', system-ui, sans-serif;
  --font-d: 'Plus Jakarta Sans', sans-serif;
  --font-zh: 'ZCOOL KuaiLe', sans-serif;
  --font-en: 'Nunito', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e0e10;
    --bg-key: #1a1a1d;
    --text-1: #eee;
    --text-2: #ddd;
    --text-3: #bbb;
    --text-4: #999;
    --text-5: #777;
    --red: #ef4444;
    --red-text: #f87171;
    --amber: #f59e0b;
    --border: #333;
    --border-key: #444;
    --glow: rgba(239,68,68,0.04);
    --hero-glow: rgba(239,68,68,0.15);
  }
}

/* ═══ BASE ═══ */
body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ── ambient glow from brand bar ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(180deg, var(--glow) 0%, transparent 100%);
  pointer-events: none;
  z-index: -1;
}

/* ═══ BRAND BAR ═══ */
.brand-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--red);
  z-index: 200;
}


/* ═══ LAYOUT ═══ */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ═══ ENTRANCE ANIMATION ═══ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.sec {
  opacity: 0;
  animation: fadeUp 0.45s var(--ease) forwards;
  animation-delay: calc(var(--d, 0) * 0.06s);
}

/* ═══ BREAK MARK — the 掰 motif ═══ */
.brk {
  display: flex;
  align-items: center;
}

.brk::before, .brk::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.brk span {
  width: 5px; height: 5px;
  background: var(--red);
  transform: rotate(45deg);
  opacity: 0.3;
  margin: 0 16px;
  flex-shrink: 0;
}

/* ═══ HEADER ═══ */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 56px;
}

.logo {
  display: flex;
  align-items: baseline;
}

.logo-zh {
  font-family: var(--font-zh);
  font-size: 32px;
  color: var(--text-1);
  line-height: 1;
}

.logo-en {
  font-family: var(--font-en);
  font-weight: 800;
  font-size: 24px;
  color: var(--red);
  line-height: 1;
  margin-left: 2px;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-stat {
  font-size: 13px;
  color: var(--text-4);
}

.header-stat b {
  color: var(--text-3);
  font-weight: 600;
}

/* ── header-stat as clickable link ── */
.header-stat-link {
  font-size: 13px;
  color: var(--text-4);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: color 0.15s;
}
.header-stat-link b { color: var(--text-3); font-weight: 600; transition: color 0.15s; }
.header-stat-link:hover { color: var(--text-2); }
.header-stat-link:hover b { color: var(--red-text); }

.gear {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.gear:hover {
  color: var(--text-2);
  border-color: var(--text-4);
}

.gear svg { width: 15px; height: 15px; }

/* ═══ SPOTLIGHT — editorial, not boxed ═══ */
.spot { margin-bottom: 48px; }

.spot-label {
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spot-dismiss {
  font-size: 13px;
  color: var(--text-5);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s;
}

.spot-dismiss:hover { color: var(--text-3); }

.spot-word {
  font-family: var(--font-d);
  font-size: 52px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -2px;
  line-height: 1.1;
  margin-bottom: 6px;
  text-shadow: 0 0 80px var(--hero-glow);
}

.spot-ipa {
  font-size: 16px;
  color: var(--text-4);
  margin-bottom: 20px;
}

.spot-story {
  font-size: 17px;
  line-height: 2;
  color: var(--text-2);
}

.spot-story em {
  font-style: normal;
  color: var(--red-text);
  font-weight: 600;
}

.spot-def {
  font-size: 14px;
  color: var(--text-4);
  margin-top: 16px;
}

.spot-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

/* ═══ BUTTONS ═══ */
.btn-add {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--red);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-add:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-detail {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-detail:hover { color: var(--text-2); border-color: var(--text-3); }

/* ═══ WORD LIST ═══ */
.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 48px 0 16px;
}

.list-title {
  font-family: var(--font-d);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.list-sort { display: flex; gap: 4px; }

.sort-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 5px;
  background: none;
  border: 1px solid transparent;
  color: var(--text-4);
  cursor: pointer;
  transition: all 0.15s;
}

.sort-btn:hover { color: var(--text-2); }
.sort-btn.on { border-color: var(--border); color: var(--text-2); font-weight: 600; }

/* ── word entry ── */
.word {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.word:last-child { border-bottom: none; }

/* hover left accent */
.word::after {
  content: '';
  position: absolute;
  left: -12px;
  top: 12px; bottom: 12px;
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.word:hover::after { opacity: 0.35; }

.word-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.word-name {
  font-family: var(--font-d);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.3px;
}

.word-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-5);
}

/* Story is the main content */
.word-story {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-2);
  margin-bottom: 4px;
}

.word-story em {
  font-style: normal;
  color: var(--red-text);
  font-weight: 500;
}

.word-def {
  font-size: 13px;
  color: var(--text-4);
}

/* Compact variant (no story) */
.word.compact { padding: 16px 0; }
.word.compact .word-head { margin-bottom: 2px; }

/* Mastery button — appears on hover */
.word-master {
  position: absolute;
  right: 0; top: 24px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-4);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}

.word:hover .word-master { opacity: 1; }
.word-master:hover { color: var(--red-text); border-color: var(--red); }
.word-master.done { opacity: 1; color: #fff; background: var(--red); border-color: var(--red); pointer-events: none; }

/* ── mastered date label ── */
.word-date { font-size: 12px; color: var(--text-5); }

/* ── unmaster button — subdued, no celebration ── */
.word-unmaster {
  position: absolute;
  right: 0; top: 24px;
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-4);
  cursor: pointer;
  opacity: 0;
  transition: all 0.15s;
}
.word:hover .word-unmaster { opacity: 1; }
.word-unmaster:hover { color: var(--text-2); border-color: var(--text-4); }
.word-unmaster.done { opacity: 1; color: var(--text-5); border-color: var(--border); pointer-events: none; }

/* Word exit animation */
.word-exiting {
  opacity: 0;
  transform: translateX(16px);
  transition: all 0.4s var(--ease);
  max-height: 0;
  padding: 0;
  border-width: 0;
  overflow: hidden;
}

/* ═══ PAGINATION ═══ */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0;
}

.pager-btn {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
}

.pager-btn:hover:not(:disabled) { color: var(--red-text); border-color: var(--red); }
.pager-btn:disabled { opacity: 0.25; cursor: not-allowed; }

.pager-info {
  font-size: 12px;
  color: var(--text-5);
}

/* ═══ MASTERED AREA ═══ */
.mastered-area {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.mastered-label {
  font-family: var(--font-d);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-5);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.mastered-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastered-chip {
  font-size: 12px;
  color: var(--text-4);
  padding: 6px 12px;
  border-radius: 8px;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: line-through;
  text-decoration-color: var(--text-5);
}

.mastered-chip:hover {
  color: var(--text-2);
  border-color: var(--text-3);
}

/* ═══ DETAIL PAGE ═══ */
.detail-page {
  max-width: 640px;
  margin: 0 auto;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-4);
  background: none;
  border: none;
  cursor: pointer;
  margin-bottom: 56px;
  padding: 6px 14px 6px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}

.back:hover { background: var(--border); color: var(--text-2); }

/* ── hero section ── */
.hero { margin-bottom: 48px; }

.hero-word {
  font-family: var(--font-d);
  font-size: 72px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -3px;
  line-height: 1;
  margin-bottom: 14px;
  text-shadow: 0 0 80px var(--hero-glow);
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  color: var(--text-4);
  margin-bottom: 24px;
}

.hero-play {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-5);
  font-size: 13px;
  transition: color 0.15s;
}

.hero-play:hover { color: var(--red-text); }

.hero-def {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
}

.hero-story {
  margin-top: 36px;
  font-size: 17px;
  line-height: 2;
  color: var(--text-2);
}

.hero-story em {
  font-style: normal;
  color: var(--red-text);
  font-weight: 600;
}

/* ── section label ── */
.sec-label {
  font-family: var(--font-d);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-4);
  letter-spacing: 0.3px;
  margin-bottom: 28px;
}

/* ── encounters ── */
.encounters { padding: 48px 0; }

.enc-item {
  position: relative;
  padding-left: 20px;
  margin-bottom: 32px;
}

.enc-item:last-child { margin-bottom: 0; }

.enc-item::before {
  content: '';
  position: absolute;
  left: 0; top: 5px; bottom: 5px;
  width: 3px;
  background: var(--red);
  border-radius: 2px;
  opacity: 0.35;
  transition: opacity 0.2s;
}

.enc-item:hover::before { opacity: 1; }

.enc-sentence {
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-2);
}

.enc-target { color: var(--red-text); font-weight: 600; }

.enc-source {
  font-size: 12px;
  color: var(--text-5);
  margin-top: 6px;
}

/* ── confusables ── */
.confusables { padding: 48px 0; }

.conf-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 32px;
}

.conf-item {
  position: relative;
  padding-left: 20px;
}

.conf-item::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 3px;
  background: var(--amber);
  border-radius: 2px;
  opacity: 0.5;
}

.conf-word {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--amber);
  margin-bottom: 4px;
  cursor: pointer;
}

.conf-desc {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-3);
}

.conf-anchor {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-2);
}

.conf-anchor::before {
  content: '';
  position: absolute;
  left: 0; top: 3px; bottom: 3px;
  width: 3px;
  background: var(--red);
  border-radius: 2px;
}

.conf-anchor em {
  font-style: normal;
  color: var(--red-text);
  font-weight: 600;
}

/* ── word family ── */
.coda { padding: 48px 0 0; }

.family {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  font-size: 15px;
  color: var(--text-4);
  margin-bottom: 40px;
}

.family-item {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
}

.family-item .w { font-weight: 500; color: var(--text-3); cursor: pointer; transition: color 0.15s; }
.family-item .w:hover { color: var(--red-text); }
.family-item .p { font-size: 12px; }
.family-item.current .w { color: var(--red-text); font-weight: 700; }
.family-sep { color: var(--text-5); margin: 0 14px; font-size: 11px; }

/* ── bottom master button ── */
.btn-master {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 40px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-4);
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: all 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn-master span { position: relative; z-index: 1; }

.btn-master::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
  z-index: 0;
}

.btn-master:hover { border-color: var(--red); color: var(--red-text); }
.btn-master.done { border-color: var(--red); color: #fff; }
.btn-master.done::after { transform: scaleX(1); }

/* Unmaster variant — subdued, no red fill */
.btn-master.btn-unmaster::after { display: none; }
.btn-master.btn-unmaster:hover { border-color: var(--text-4); color: var(--text-2); }
.btn-master.btn-unmaster.undone { color: var(--text-5); border-color: var(--border); pointer-events: none; }

/* ═══ SETTINGS ═══ */
.page-title {
  font-family: var(--font-d);
  font-size: 32px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -1px;
  margin-bottom: 48px;
}

.settings-section { padding: 48px 0; }

.settings-name {
  font-family: var(--font-d);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 16px;
}

.settings-desc {
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.6;
  margin-bottom: 20px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.settings-row:last-child { border-bottom: none; }

.settings-label {
  font-size: 14px;
  color: var(--text-2);
  font-weight: 500;
}

.settings-sub {
  font-size: 12px;
  color: var(--text-4);
  margin-top: 4px;
  line-height: 1.5;
}

.settings-input {
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--bg-key);
  border: 1px solid var(--border);
  color: var(--text-2);
  outline: none;
  width: 320px;
  transition: border-color 0.15s;
}

.settings-input:focus { border-color: var(--red); }
.settings-input::placeholder { color: var(--text-5); }

.settings-select {
  font-family: var(--font);
  font-size: 13px;
  padding: 8px 32px 8px 14px;
  border-radius: 8px;
  background: var(--bg-key);
  border: 1px solid var(--border);
  color: var(--text-2);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23999' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.settings-provider-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.settings-provider-btn {
  font-family: var(--font);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-4);
  cursor: pointer;
  transition: all 0.15s;
}

.settings-provider-btn:hover:not(.active) {
  border-color: var(--text-3);
  color: var(--text-2);
}

.settings-provider-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
  font-weight: 600;
}

.settings-key-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-key-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-4);
}

.settings-key-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22c55e;
}

.settings-model-info {
  font-size: 11px;
  color: var(--text-5);
  line-height: 1.6;
  margin-top: 8px;
}

.settings-verify-btn {
  font-family: var(--font);
  font-size: 12px;
  padding: 7px 16px;
  border-radius: 6px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-4);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.settings-verify-btn:hover { border-color: var(--text-3); color: var(--text-2); }
.settings-verify-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.settings-verify-result { font-size: 12px; padding: 8px 0; }
.settings-verify-result.ok { color: #22c55e; }
.settings-verify-result.error { color: var(--red-text); }

/* ═══ TOGGLE ═══ */
.toggle {
  position: relative;
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--border);
  cursor: pointer;
  transition: background 0.3s;
  flex-shrink: 0;
  border: none;
}

.toggle.on { background: var(--red); }

.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.3s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  pointer-events: none;
}

.toggle.on .toggle-thumb { transform: translateX(18px); }

/* ═══ EMPTY STATE ═══ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state-text {
  font-size: 14px;
  color: var(--text-4);
  line-height: 1.6;
}

/* ═══ FOOTER ═══ */
.foot {
  text-align: center;
  padding: 56px 0 16px;
  font-size: 13px;
  color: var(--text-5);
}

.foot-ver {
  font-size: 12px;
  color: var(--text-5);
  margin-top: 4px;
  opacity: 0.6;
}

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-4); }

/* ═══ SELECTION ═══ */
::selection {
  background: rgba(200,32,32,0.15);
  color: var(--text-1);
}

@media (prefers-color-scheme: dark) {
  ::selection {
    background: rgba(239,68,68,0.3);
  }
}

/* ═══ OPT-IN BANNER ═══ */
.optin-banner {
  max-width: 640px;
  margin: 16px auto;
  padding: 16px 20px;
  background: var(--bg-key);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.optin-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
}
.optin-sub {
  display: block;
  font-size: 11px;
  color: var(--text-5);
  margin-top: 4px;
}
.optin-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.optin-btn {
  padding: 6px 16px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.optin-accept {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
}
.optin-accept:hover { opacity: 0.9; }
.optin-decline:hover { background: var(--border); }

/* ═══ TOGGLE SWITCH ═══ */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  transition: 0.2s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--red);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* ═══ REDUCED MOTION ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.15s !important;
  }
  .sec { opacity: 1; transform: none; animation: none; }
}
