/* Life OS — base layer: reset, app shell, top bar and shared controls. */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background: var(--bg-0);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg-0);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

input,
textarea {
  user-select: text;
  -webkit-user-select: text;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
p {
  margin: 0;
}

:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.95);
  outline-offset: 2px;
}

/* User text may be Arabic inside an English interface: never space or upper-case it. */
[data-script="ar"] {
  letter-spacing: 0 !important;
  text-transform: none !important;
}

/* dir="auto" orders mixed-script text correctly; alignment still follows the interface. */
.act-name,
.blk-title,
.blk-note,
.rp-name,
.tpl-name,
.lib-cat,
.sum-chip-name,
.menu-label,
.d-next-title,
.live-title {
  text-align: left;
}
html[dir="rtl"] .act-name,
html[dir="rtl"] .blk-title,
html[dir="rtl"] .blk-note,
html[dir="rtl"] .rp-name,
html[dir="rtl"] .tpl-name,
html[dir="rtl"] .lib-cat,
html[dir="rtl"] .sum-chip-name,
html[dir="rtl"] .menu-label,
html[dir="rtl"] .d-next-title,
html[dir="rtl"] .live-title {
  text-align: right;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(160, 170, 255, 0.2);
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(160, 170, 255, 0.36);
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ------------------------------------------------------------------ world */

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.4s ease;
}
#fx.is-on {
  opacity: 1;
}

/* CSS stand-in for the 3D scene (shown until WebGL is up, or if it is unavailable). */
#fx-fallback {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 1.4s ease;
  background:
    radial-gradient(120% 60% at 50% 104%, rgba(var(--accent-rgb), calc(0.22 * var(--tint))) 0%, transparent 62%),
    radial-gradient(50% 36% at 76% 86%, rgba(var(--accent2-rgb), calc(0.16 * var(--tint))), transparent 70%),
    linear-gradient(180deg, #04050d 0%, #070a1e 58%, #0b0d2a 100%);
}
html.fx-on #fx-fallback {
  opacity: 0;
}
.fxf-floor {
  position: absolute;
  left: -60%;
  right: -60%;
  bottom: -10%;
  height: 34%;
  background-image:
    linear-gradient(rgba(var(--accent-rgb), 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--accent-rgb), 0.26) 1px, transparent 1px);
  background-size: 70px 70px;
  transform: perspective(420px) rotateX(66deg);
  transform-origin: 50% 0;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 40%);
  mask-image: linear-gradient(180deg, transparent, #000 40%);
  animation: fxf-scroll 5s linear infinite;
}
.fxf-horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.75), transparent);
  box-shadow: 0 0 26px 3px rgba(var(--accent-rgb), 0.45);
}
.fxf-glow {
  position: absolute;
  left: 50%;
  bottom: 24%;
  width: min(34vw, 300px);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  border-radius: 999px 999px 0 0;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.85), rgba(var(--accent2-rgb), 0.75));
  -webkit-mask-image: repeating-linear-gradient(180deg, #000 0 62%, transparent 62% 70%, #000 70% 80%, transparent 80% 90%);
  mask-image: repeating-linear-gradient(180deg, #000 0 62%, transparent 62% 70%, #000 70% 80%, transparent 80% 90%);
  opacity: 0.55;
  filter: blur(0.4px);
}
@keyframes fxf-scroll {
  to {
    background-position: 0 70px, 0 0;
  }
}

/* ------------------------------------------------------------------ shell */

#app {
  position: relative;
  z-index: 1;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}
html.is-ready #app {
  opacity: 1;
}

#views {
  position: absolute;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  transition: top 0.5s var(--ease);
}
html.is-immersive #views {
  top: 0;
}

/* Views swap with a small move in depth rather than a flat cut. */
.view {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: perspective(1400px) translateZ(-110px);
  transition: opacity 0.3s var(--ease), transform 0.5s var(--ease), visibility 0s linear 0.5s;
}
.view.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: opacity 0.45s var(--ease) 0.08s, transform 0.65s var(--ease-out) 0.04s, visibility 0s;
}

#layer-drag,
#layer-drawer,
#layer-modal,
#layer-pop,
#layer-toast {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#layer-drag {
  z-index: 40;
}
#layer-drawer {
  z-index: 50;
}
#layer-modal {
  z-index: 60;
}
#layer-pop {
  z-index: 70;
}
#layer-toast {
  z-index: 80;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: var(--bg-0);
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
html.is-ready #splash {
  opacity: 0;
  visibility: hidden;
}
#splash .brand-mark {
  animation: splash-spin 1.4s linear infinite;
}
@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ glass */

.glass {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.014) 60%),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-l);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 30px 60px -34px rgba(0, 0, 0, 0.9);
}
/* a hairline of accent light along the top edge of every panel */
.glass::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 14%;
  right: 14%;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), calc(0.6 * var(--glow))), transparent);
}

/* ------------------------------------------------------------------ icons */

.ic {
  display: block;
  flex: none;
}
.icn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--icn, 1.25em);
  height: var(--icn, 1.25em);
  line-height: 1;
}
.icn > svg {
  width: 100%;
  height: 100%;
}
.icn-emoji {
  font-size: calc(var(--icn, 1.25em) * 0.84);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.icn-img > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24%;
  display: block;
}

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-h);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(7, 9, 26, 0.78), rgba(7, 9, 26, 0.42));
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  transition: transform 0.5s var(--ease), opacity 0.4s ease;
}
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), calc(0.7 * var(--glow))) 50%, transparent);
  pointer-events: none;
}
html.is-immersive .topbar {
  transform: translateY(-105%);
  opacity: 0;
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  flex: none;
  display: block;
}
.brand-mark.is-lg {
  width: 56px;
  height: 56px;
}
.brand-mark i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
}
.brand-mark.is-lg i {
  border-width: 6px;
}
.brand-mark b {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(var(--accent-rgb)) 0 34%, rgb(var(--accent2-rgb)) 62%, transparent 62.5%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3.4px), #000 calc(100% - 2.8px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3.4px), #000 calc(100% - 2.8px));
  filter: drop-shadow(0 0 calc(6px * var(--glow)) rgba(var(--accent-rgb), 0.9));
}
.brand-mark.is-lg b {
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6.6px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 6.6px), #000 calc(100% - 6px));
}
.brand-name {
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: var(--track-wide);
  white-space: nowrap;
}
html[dir="rtl"] .brand-name {
  font-size: 15px;
}

.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--line);
  flex: none;
}
.tabs-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.34), rgba(var(--accent-rgb), 0.14));
  box-shadow:
    inset 0 0 0 1px rgba(var(--accent-rgb), 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 calc(18px * var(--glow)) rgba(var(--accent-rgb), calc(0.4 * var(--glow)));
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out);
}
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.25s ease, transform 0.25s var(--ease);
}
.tab:hover {
  color: var(--ink);
  transform: perspective(600px) translateZ(8px);
}
.tab.is-on {
  color: #fff;
}

.top-end {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.live-chip {
  --c-rgb: var(--accent-rgb);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  max-width: 300px;
  min-width: 0;
  padding: 0 13px;
  border-radius: 999px;
  border: 1px solid rgba(var(--c-rgb), 0.45);
  background: rgba(var(--c-rgb), 0.1);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.25s ease;
}
.live-chip:hover {
  transform: perspective(600px) translateZ(10px);
  background: rgba(var(--c-rgb), 0.18);
  box-shadow: 0 0 calc(20px * var(--glow)) rgba(var(--c-rgb), calc(0.35 * var(--glow)));
}
.live-dot {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: rgb(var(--c-rgb));
  box-shadow: 0 0 10px rgb(var(--c-rgb));
  animation: live-pulse 2.2s ease-in-out infinite;
}
.live-icon {
  display: grid;
  color: rgb(var(--c-rgb));
}
.live-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-rem {
  color: rgb(var(--c-rgb));
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
@keyframes live-pulse {
  50% {
    opacity: 0.35;
    transform: scale(0.8);
  }
}

.top-date {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-inline: 4px;
  white-space: nowrap;
}
.top-date-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  text-align: end;
}
.top-weekday {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: var(--track);
  text-transform: uppercase;
}
.top-fulldate {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink-3);
}
.top-clock {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.top-clock small {
  font-size: 0.6em;
  font-weight: 700;
  margin-inline-start: 0.3em;
  color: var(--ink-3);
}

.lang-btn span {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.settings-btn svg {
  transition: transform 0.6s var(--ease-out);
}
.settings-btn:hover svg {
  transform: rotate(60deg);
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.2s ease, border-color 0.2s ease, box-shadow 0.25s ease, color 0.2s ease, opacity 0.2s ease;
}
/* hover lifts controls toward the viewer */
.btn:hover:not(:disabled) {
  transform: perspective(600px) translateZ(10px);
  background: rgba(255, 255, 255, 0.11);
  border-color: var(--line-2);
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8), 0 0 calc(16px * var(--glow)) rgba(var(--accent-rgb), calc(0.2 * var(--glow)));
}
.btn:active:not(:disabled) {
  transform: perspective(600px) translateZ(-4px);
}
.btn:disabled {
  opacity: 0.36;
  cursor: default;
}
.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 12.5px;
  gap: 7px;
}
.btn-lg {
  height: 48px;
  padding: 0 26px;
  font-size: 15px;
  border-radius: var(--r-m);
}
.btn-primary {
  background: linear-gradient(180deg, rgb(var(--accent-rgb)), rgba(var(--accent-rgb), 0.82));
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 calc(22px * var(--glow)) rgba(var(--accent-rgb), calc(0.4 * var(--glow)));
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgb(var(--accent-rgb)), rgba(var(--accent-rgb), 0.92));
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 0 calc(34px * var(--glow)) rgba(var(--accent-rgb), calc(0.6 * var(--glow)));
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
}
.btn-danger {
  background: var(--danger);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  background: #ff6c85;
  box-shadow: 0 0 26px rgba(255, 84, 112, 0.5);
}
.btn-danger-ghost {
  background: transparent;
  border-color: rgba(255, 84, 112, 0.35);
  color: #ff8196;
}
.btn-danger-ghost:hover:not(:disabled) {
  background: rgba(255, 84, 112, 0.14);
  border-color: rgba(255, 84, 112, 0.7);
  box-shadow: 0 0 20px rgba(255, 84, 112, 0.25);
}

.btn-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border-radius: var(--r-s);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.btn-icon:hover:not(:disabled) {
  transform: perspective(600px) translateZ(12px);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line);
  color: #fff;
}
.btn-icon:active:not(:disabled) {
  transform: perspective(600px) translateZ(-4px);
}
.btn-icon:disabled {
  opacity: 0.3;
  cursor: default;
}
.btn-icon.is-danger:hover:not(:disabled) {
  color: #ff8196;
  background: rgba(255, 84, 112, 0.14);
}

/* ------------------------------------------------------------------ fields */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.field-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: var(--track);
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.input {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: rgba(4, 5, 16, 0.5);
  color: var(--ink);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.input::placeholder {
  color: var(--ink-4);
}
.input:hover {
  border-color: var(--line-2);
}
.input:focus {
  border-color: rgba(var(--accent-rgb), 0.85);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18), 0 0 calc(18px * var(--glow)) rgba(var(--accent-rgb), 0.18);
  background: rgba(4, 5, 16, 0.72);
}
.input.is-invalid {
  border-color: var(--danger);
}
.input-lg {
  height: 44px;
  font-size: 16px;
  font-weight: 700;
}
.input-time {
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 0 6px;
}
.textarea {
  height: auto;
  min-height: 60px;
  padding: 9px 11px;
  line-height: 1.45;
  resize: vertical;
}

.is-shake {
  animation: shake 0.36s var(--ease);
}
@keyframes shake {
  20% {
    translate: -5px 0;
  }
  45% {
    translate: 5px 0;
  }
  70% {
    translate: -3px 0;
  }
  90% {
    translate: 2px 0;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s var(--ease);
}
.chip:hover {
  transform: perspective(500px) translateZ(8px);
  border-color: var(--line-2);
  color: #fff;
}
.chip.is-on {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.8);
  color: #fff;
}

/* segmented control */
.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: 11px;
  background: rgba(4, 5, 16, 0.5);
  border: 1px solid var(--line);
  max-width: 100%;
}
.seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 38px;
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, box-shadow 0.25s ease;
}
.seg-btn:hover {
  color: #fff;
}
.seg-btn.is-on {
  background: linear-gradient(180deg, rgba(var(--accent-rgb), 0.5), rgba(var(--accent-rgb), 0.28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 calc(14px * var(--glow)) rgba(var(--accent-rgb), calc(0.3 * var(--glow)));
}
.seg-lg .seg-btn {
  height: 40px;
  min-width: 120px;
  font-size: 15px;
  font-weight: 700;
}

/* switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex: none;
  cursor: pointer;
}
.switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.switch-track {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--line-2);
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cfd3f2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  transition: transform 0.28s var(--ease-back), background 0.2s ease;
}
.switch input:checked + .switch-track {
  background: rgba(var(--accent-rgb), 0.75);
  border-color: rgba(var(--accent-rgb), 1);
  box-shadow: 0 0 calc(16px * var(--glow)) rgba(var(--accent-rgb), calc(0.5 * var(--glow)));
}
.switch input:checked + .switch-track .switch-knob {
  transform: translateX(18px);
  background: #fff;
}
html[dir="rtl"] .switch-knob {
  left: auto;
  right: 3px;
}
html[dir="rtl"] .switch input:checked + .switch-track .switch-knob {
  transform: translateX(-18px);
}
.switch input:focus-visible + .switch-track {
  outline: 2px solid rgba(var(--accent-rgb), 0.95);
  outline-offset: 2px;
}

/* range */
.range {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 22px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --p: 50%;
}
.range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgb(var(--accent-rgb)) var(--p), rgba(255, 255, 255, 0.14) var(--p));
}
.range::-moz-range-track {
  height: 5px;
  border-radius: 5px;
  background: linear-gradient(90deg, rgb(var(--accent-rgb)) var(--p), rgba(255, 255, 255, 0.14) var(--p));
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 calc(12px * var(--glow)) rgba(var(--accent-rgb), 0.8), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.8);
}

/* dropdown button */
.dd {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 34px;
  min-width: 120px;
  max-width: 100%;
  padding: 0 10px 0 12px;
  padding-inline: 12px 10px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  background: rgba(4, 5, 16, 0.5);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.dd:hover {
  border-color: var(--line-2);
  background: rgba(4, 5, 16, 0.72);
}
.dd-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dd svg {
  color: var(--ink-3);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
}
.check-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: rgb(var(--accent-rgb));
}

/* ------------------------------------------------------------------ tooltips */

[data-tip] {
  position: relative;
}
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  z-index: 30;
  padding: 5px 9px;
  border-radius: 7px;
  background: var(--panel-solid);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 10px 24px -10px #000;
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-delay: 0.5s;
}
/* tips on controls that sit against the trailing edge open inward */
.top-end [data-tip]::after,
.tb-zoom [data-tip]::after {
  left: auto;
  inset-inline-end: 0;
  transform: translateY(-4px);
}
.top-end [data-tip]:hover::after,
.top-end [data-tip]:focus-visible::after,
.tb-zoom [data-tip]:hover::after,
.tb-zoom [data-tip]:focus-visible::after {
  transform: translateY(0);
}
@media (hover: none) {
  [data-tip]::after {
    display: none;
  }
}

/* ------------------------------------------------------------------ motion preferences */

html[data-anim="off"] *,
html[data-anim="off"] *::before,
html[data-anim="off"] *::after {
  animation: none !important;
  transition: none !important;
}
html[data-anim="reduced"] *,
html[data-anim="reduced"] *::before,
html[data-anim="reduced"] *::after {
  animation-duration: 0.2s !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.18s !important;
}

/* ------------------------------------------------------------------ small screens */

@media (max-width: 1180px) {
  .top-date-text {
    display: none;
  }
}
@media (max-width: 1500px) {
  .tab-label {
    display: none;
  }
  .tab {
    padding: 0 12px;
  }
  .live-chip {
    max-width: 200px;
  }
}
@media (max-width: 640px) {
  :root {
    --topbar-h: 52px;
    --gap: 10px;
  }
  .topbar {
    gap: 10px;
    padding: 0 10px;
  }
  .brand-name,
  .top-date,
  .live-title,
  .live-dot {
    display: none;
  }
  .live-chip {
    max-width: 150px;
    padding: 0 10px;
  }
}
