/*
 * From Uiverse.io by mobinkakei - https://uiverse.io/mobinkakei/strong-lizard-79
 * MIT License, Copyright (c) Benjamin Réthoré - https://codepen.io/bnthor/pen/WQBNxO, mobinkakei (Mobeen)
 * Full MIT license text is included in uiverse.css.
 */

.sqtp-theme-control {
  position: fixed;
  z-index: 11;
  top: env(safe-area-inset-top, 0px);
  right: max(.9rem, env(safe-area-inset-right));
  display: grid;
  align-items: center;
  min-height: 2.75rem;
  --switch-unit: .60px;
  -webkit-tap-highlight-color: transparent;
}
.site-shell main { padding-top: calc(3.25rem + env(safe-area-inset-top, 0px)); }
.sqtp-theme-control .sqtp-theme-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
}
.sqtp-theme-control .sqtp-theme-track {
  position: relative;
  display: block;
  width: calc(90 * var(--switch-unit));
  height: calc(50 * var(--switch-unit));
  margin: 0;
  border-radius: calc(84 * var(--switch-unit));
  background: #83d8ff;
  transition: background-color 200ms ease-in-out;
  cursor: pointer;
}
.sqtp-theme-input:focus-visible + .sqtp-theme-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.sqtp-theme-orb {
  position: absolute;
  top: calc(3 * var(--switch-unit));
  left: calc(3 * var(--switch-unit));
  z-index: 1;
  width: calc(44 * var(--switch-unit));
  height: calc(44 * var(--switch-unit));
  border-radius: 50%;
  background: #ffcf96;
  box-shadow: 0 2px 6px #0005;
  transform: rotate(-45deg);
  transition: transform 400ms cubic-bezier(.68,-.55,.265,1.55), background-color 200ms ease;
}
.sqtp-crater, .sqtp-star {
  position: absolute;
  top: var(--top);
  left: var(--left);
  width: var(--width);
  height: var(--height, var(--width));
  border-radius: 50%;
}
.sqtp-crater { background: #e8cda5; opacity: 0; transition: opacity 200ms ease-in-out; }
.sqtp-crater:nth-child(1) { --top: calc(18 * var(--switch-unit)); --left: calc(10 * var(--switch-unit)); --width: calc(4 * var(--switch-unit)); }
.sqtp-crater:nth-child(2) { --top: calc(28 * var(--switch-unit)); --left: calc(22 * var(--switch-unit)); --width: calc(6 * var(--switch-unit)); }
.sqtp-crater:nth-child(3) { --top: calc(10 * var(--switch-unit)); --left: calc(25 * var(--switch-unit)); --width: calc(8 * var(--switch-unit)); }
.sqtp-star { background: #fff; transition: all 300ms cubic-bezier(.445,.05,.55,.95); }
.sqtp-star:nth-of-type(2) { --top: calc(10 * var(--switch-unit)); --left: calc(35 * var(--switch-unit)); --width: calc(30 * var(--switch-unit)); --height: calc(3 * var(--switch-unit)); }
.sqtp-star:nth-of-type(3) { --top: calc(18 * var(--switch-unit)); --left: calc(28 * var(--switch-unit)); --width: calc(30 * var(--switch-unit)); --height: calc(3 * var(--switch-unit)); z-index: 1; }
.sqtp-star:nth-of-type(4) { --top: calc(27 * var(--switch-unit)); --left: calc(40 * var(--switch-unit)); --width: calc(30 * var(--switch-unit)); --height: calc(3 * var(--switch-unit)); }
.sqtp-star:nth-of-type(n+5) { opacity: 0; transform: translateX(calc(3 * var(--switch-unit))); }
.sqtp-star:nth-of-type(5) { --top: calc(16 * var(--switch-unit)); --left: calc(11 * var(--switch-unit)); --width: calc(2 * var(--switch-unit)); }
.sqtp-star:nth-of-type(6) { --top: calc(32 * var(--switch-unit)); --left: calc(17 * var(--switch-unit)); --width: calc(3 * var(--switch-unit)); }
.sqtp-star:nth-of-type(7) { --top: calc(36 * var(--switch-unit)); --left: calc(28 * var(--switch-unit)); --width: calc(2 * var(--switch-unit)); }
.sqtp-theme-input:checked + .sqtp-theme-track {
  background: #749dd6;
  .sqtp-theme-orb { background: #ffe5b5; transform: translateX(calc(40 * var(--switch-unit))) rotate(0); }
  .sqtp-crater { opacity: 1; }
  .sqtp-star:nth-of-type(2) { width: calc(2 * var(--switch-unit)); height: calc(2 * var(--switch-unit)); }
  .sqtp-star:nth-of-type(3) { width: calc(4 * var(--switch-unit)); height: calc(4 * var(--switch-unit)); transform: translateX(-calc(5 * var(--switch-unit))); }
  .sqtp-star:nth-of-type(4) { width: calc(2 * var(--switch-unit)); height: calc(2 * var(--switch-unit)); transform: translateX(-calc(7 * var(--switch-unit))); }
  .sqtp-star:nth-of-type(n+5) { opacity: 1; transform: none; }
  .sqtp-star:nth-of-type(5) { transition-delay: 200ms; }
  .sqtp-star:nth-of-type(6) { transition-delay: 300ms; }
  .sqtp-star:nth-of-type(7) { transition-delay: 400ms; }
}
@media (max-width: 850px) {
  .sqtp-theme-control { right: max(.5rem, env(safe-area-inset-right)); --switch-unit: .54px; }
}
@media (prefers-reduced-motion: reduce) {
  .sqtp-theme-control * { transition-delay: 0ms !important; }
}
@media (forced-colors: active) {
  .sqtp-theme-control .sqtp-theme-input { opacity: 1; position: static; width: 1.125rem; height: 1.125rem; }
  .sqtp-theme-control .sqtp-theme-track { display: none; }
}
@media print { .sqtp-theme-control { display: none; } }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f7faff;
  --surface-raised: #eef5ff;
  --border: #d0e0f1;
  --control-border: #6684a6;
  --text: #122238;
  --text-secondary: #36516f;
  --text-muted: #486485;
  --accent: #175ab5;
  --primary: #175ab5;
  --success: #187247;
  --warning: #7d4d10;
  --danger: #a8283e;
  --blue-hover: #e7f2ff;
  --blue-selected: #deedff;
  --blue-line: #a7c9f0;
  --blue-shadow: #173e7233;
}
[data-theme="light"] .site-rail { background: #f7faff; border-color: var(--border); }
[data-theme="light"] .rail-account { border-top-color: var(--border); }
[data-theme="light"] :is(.site-rail nav a:hover, .rail-account a:hover, .rail-account button:hover, .task-row:hover, .workspace-links > a:hover) { background: var(--blue-hover); }
[data-theme="light"] .site-rail nav a[aria-current] { background: var(--blue-selected); border-color: var(--blue-line); color: #173c70; }
[data-theme="light"] .site-rail nav a[aria-current]::before { background: var(--accent); }
[data-theme="light"] .electric-mark > span { color: var(--accent); text-shadow: 0 0 5px #77acff; }
[data-theme="light"] :is(.button.secondary, button.secondary) { background: var(--surface-raised); border-color: var(--blue-line); color: var(--text); }
[data-theme="light"] :is(.button.secondary, button.secondary):hover { background: var(--blue-selected); border-color: var(--control-border); }
[data-theme="light"] :is(
  .button.primary,
  .action-form > button:not(:where(.secondary, .text-button, .buttons *, .vote-row *, .friend-section *, .more-actions *, .account *)),
  .filters button, #quiz .buttons button:last-child:not(.secondary), .assistant #ask button
) { border-color: #6a96ce; }
[data-theme="light"] .skip { background: var(--blue-selected); color: var(--text); }
[data-theme="light"] :is(.catalog-tools .text-link, .experience-detail .text-link) { text-decoration-color: #679bdd; }

[data-theme="light"] .ocean-stage { --ocean-ink: var(--text); --ocean-muted: var(--text-secondary); }
[data-theme="light"] .ocean-scene::before { background: radial-gradient(ellipse at 55% 62%, #88beff9c, #e6f2ff75 52%, transparent 72%); }
[data-theme="light"] .ocean-stage .task-list li + li { border-color: var(--border); }
[data-theme="light"] .ocean-stage .task-row:hover { background: var(--blue-hover); }
[data-theme="light"] :is(.ocean-stage .task-row-mark, .ocean-stage .task-row .line-icon, .reel-copy .line-icon) { color: var(--accent); border-color: var(--blue-line); }
[data-theme="light"] :is(main .demo-stack .demo-note, .sqtp-demo-face) {
  background: #f7fbfff2; border-color: var(--blue-line); box-shadow: 0 8px 14px var(--blue-shadow);
}
[data-theme="light"] main .demo-stack .sqtp-demo-flip { background: transparent; border: 0; box-shadow: none; }
[data-theme="light"] .sqtp-demo-back { background: #edf6ff; }
[data-theme="light"] .demo-line { color: var(--text-secondary); }
[data-theme="light"] :is(.demo-line b, main .demo-note .demo-person:first-child) { color: var(--accent); }
[data-theme="light"] :is(.orbit-card, .reel-card, .task-carousel[data-ready] .orbit-card[data-back]) {
  background: var(--surface); border-color: var(--blue-line); color: var(--text);
}
[data-theme="light"] .orbit-card { box-shadow: 0 8px 20px var(--blue-shadow); }
[data-theme="light"] .orbit-card small { color: var(--text-secondary); }
[data-theme="light"] :is(.orbit-card:hover, .orbit-card:focus-visible, .reel-card:hover) { background: var(--blue-hover); border-color: var(--accent); }
[data-theme="light"] :is(.orbit-card-art, .experience-image, .reel-card > img) { background: var(--blue-selected); }
[data-theme="light"] :is(.experience-facts, .experience-join, .form-workspace > .editor-panel, .form-workspace > .card.detail) {
  background: var(--surface); border-color: var(--border);
}
[data-theme="light"] .experience-join { box-shadow: 0 16px 40px var(--blue-shadow); }
[data-theme="light"] .experience-facts dt { color: var(--text-muted); }
[data-theme="light"] :is(.experience-facts div + div, .editor-list, .editor-card-list li + li) { border-color: var(--border); }
[data-theme="light"] :is(.choice:has(input:checked), .editor-panel label.editor-choice:has(:checked)) {
  background: var(--blue-selected); border-color: var(--accent);
}
[data-theme="light"] .editor-panel label.editor-choice:not(:has(:checked)) { background: var(--surface); border-color: var(--border); }
[data-theme="light"] :is(.chat-log .mine, .assistant-embedded #dialogue article:nth-child(odd)) { background: var(--blue-selected); }
[data-theme="light"] #assistant-popup { box-shadow: 0 16px 48px var(--blue-shadow); }
[data-theme="light"] #assistant-popup > header > .assistant-mark { background: var(--blue-selected); color: var(--accent); }
[data-theme="light"] #assistant-anchor #mascot { background: linear-gradient(135deg, #1f65c7, #4789db); border-color: #2860a8; }
[data-theme="light"] #assistant-tooltip { background: #f4faff; color: var(--text); }
[data-theme="light"] #assistant-tooltip::before { border-top-color: #f4faff; }
[data-theme="light"] #assistant-anchor[data-tooltip-below] #assistant-tooltip::before { border-bottom-color: #f4faff; }
[data-theme="light"] .sqtp-auth .sqtp-auth-panel {
  background: linear-gradient(#f7faff,#f7faff) padding-box,
    linear-gradient(145deg, transparent 35%, #2368c3, #8fdfff) border-box;
  color: var(--text);
}
[data-theme="light"] :is(.sqtp-auth-panel .sqtp-auth-field label:not(.check), .editor-panel .sqtp-floating-field label:not(.check)) { color: var(--text-secondary); }
[data-theme="light"] .editor-panel .sqtp-floating-field input:focus + label { color: var(--accent); }
[data-theme="light"] :is(.site-shell, .assistant-embedded) :is(
  input:not([type], [readonly], :disabled),
  input:is([type="text"], [type="password"], [type="search"], [type="email"], [type="tel"], [type="url"],
    [type="number"], [type="date"], [type="datetime-local"], [type="time"], [type="week"], [type="month"]):not([readonly], :disabled),
  textarea:not([readonly], :disabled, .assistant #ask textarea),
  select:not(:disabled), .assistant #ask
) {
  --sqtp-field-pink: #76b3fa;
  --sqtp-field-blue: #3079ce;
  --sqtp-field-depth: #bed2ec;
  --sqtp-field-border: linear-gradient(155deg, var(--sqtp-field-pink), var(--sqtp-field-depth) 45% 60%, var(--sqtp-field-blue)) border-box;
  color-scheme: light;
  color: var(--text);
  background: linear-gradient(#fff,#f6faff) padding-box,
    var(--sqtp-field-motion, var(--sqtp-field-border));
  box-shadow: -2px -2px 7px #73adf328, 2px 2px 7px #4387da2c;
  &:focus-within {
    --sqtp-field-pink: #5aa2f4;
    --sqtp-field-blue: #246ac1;
    --sqtp-field-depth: #aac9eb;
    box-shadow: -3px -3px 12px #73adf349, 3px 3px 12px #4387da49;
  }
}
[data-theme="light"] .sqtp-check-disc { background: linear-gradient(43deg, #1959b0, #347dcc 53%, #8bd9ff); box-shadow: 0 2px 3px #76a7df9c; }
[data-theme="light"] .sqtp-check-disc::before { box-shadow: inset 0 2px 3px #afd4fb; }
[data-theme="light"] .sqtp-gradient-check input:focus-visible + .sqtp-check-disc { outline-color: var(--accent); }
