/* Theme Studio (app/themestudio.js). The live preview is a small phone drawn with
   --tp-* variables, so editing never repaints the whole OS. Moving rules at the bottom. */

.xa-themestudio .ok-body { padding-bottom: 0; }
.ts-home { padding-bottom: 40px; }
.ts-hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px 8px 4px; }
.ts-hero h2 { margin: 16px 0 4px; font-size: 1.55rem; letter-spacing: -0.02em; }
.ts-hero p { margin: 0; max-width: 330px; font-size: 0.9rem; line-height: 1.45; color: color-mix(in srgb, var(--on-surface, #fff) 65%, transparent); }
.ts-hero-art { position: relative; width: 120px; height: 84px; }
.ts-hero-art span { position: absolute; width: 54px; height: 84px; border-radius: 14px; border: 2px solid color-mix(in srgb, var(--on-surface, #fff) 14%, transparent); }
.ts-hero-art span:nth-child(1) { left: 0; transform: rotate(-12deg); background: linear-gradient(160deg, #f472b6, #7c3aed); }
.ts-hero-art span:nth-child(2) { left: 33px; z-index: 2; background: linear-gradient(160deg, #38bdf8, #1e3a8a); }
.ts-hero-art span:nth-child(3) { left: 66px; transform: rotate(12deg); background: linear-gradient(160deg, #fde68a, #f97316); }

.ts-start { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 20px 0 4px; }
.ts-start-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 9%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); text-align: left; cursor: pointer; font-family: var(--font-main); }
.ts-start-card svg { color: var(--accent-primary, #6aa4f5); margin-bottom: 6px; }
.ts-start-card b { font-size: 0.98rem; }
.ts-start-card span { font-size: 0.78rem; color: color-mix(in srgb, var(--on-surface, #fff) 60%, transparent); }
.ts-start--ai { grid-column: 1 / -1; position: relative; overflow: hidden; background: linear-gradient(135deg, color-mix(in srgb, #e6508a 26%, var(--surface-color, #191d25)), color-mix(in srgb, #7c5cff 30%, var(--surface-color, #191d25))); }
.ts-start--ai svg { color: #fff; }
.ts-start--ai::after { content: ''; position: absolute; inset: -40% auto auto 60%; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%); pointer-events: none; }

.ok-section small { margin-left: 6px; opacity: 0.6; }
.ts-empty { margin: 4px 4px 0; font-size: 0.88rem; color: color-mix(in srgb, var(--on-surface, #fff) 55%, transparent); }
.ts-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: 12px; }
.ts-theme { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0; border: none; background: none; color: var(--on-surface); cursor: pointer; font-family: var(--font-main); }
.ts-mini { position: relative; display: flex; flex-direction: column; gap: 6px; width: 100%; aspect-ratio: 9 / 15; box-sizing: border-box; padding: 10px 8px; border-radius: 16px; background: var(--a); border: 2px solid color-mix(in srgb, var(--on-surface, #fff) 10%, transparent); overflow: hidden; }
.ts-theme.is-on .ts-mini { border-color: var(--accent-primary, #6aa4f5); }
.ts-mini-bar { height: 6px; width: 46%; border-radius: 3px; background: var(--d); opacity: 0.55; }
.ts-mini-card { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; padding: 8px; border-radius: 10px; background: var(--b); }
.ts-mini-card i { display: block; height: 5px; border-radius: 3px; background: var(--d); opacity: 0.45; }
.ts-mini-card i:last-child { width: 60%; background: var(--e); opacity: 0.9; }
.ts-mini-btn { align-self: flex-end; padding: 3px 10px; border-radius: 999px; background: var(--c); color: var(--a); font-size: 0.72rem; font-weight: 800; }
.ts-theme-name { font-size: 0.8rem; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ts-theme-on { position: absolute; top: 6px; left: 6px; display: inline-flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px; background: var(--accent-primary, #6aa4f5); color: #fff; font-size: 0.64rem; font-weight: 800; }
.ts-off { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 14px; padding: 12px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--on-surface, #fff) 22%, transparent); background: none; color: var(--on-surface); font: 600 0.86rem var(--font-main); cursor: pointer; }
.ts-builtins { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.ts-builtin { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 8px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); font: 600 0.76rem var(--font-main); cursor: pointer; text-align: left; overflow: hidden; }
.ts-builtin span { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--a); border: 1px solid color-mix(in srgb, var(--d) 30%, transparent); display: inline-flex; align-items: center; justify-content: center; }
.ts-builtin span i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }

/* ---------- Editor ---------- */
.ts-name-wrap { flex: 1; min-width: 0; }
.ts-name { width: 100%; min-width: 0; border: none; background: transparent; color: var(--on-surface); font: 700 1.1rem var(--font-main); padding: 6px 8px; border-radius: 10px; outline: none; text-overflow: ellipsis; }
.ts-name:focus { background: color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); }
#themestudio-fullscreen .ts-editor { padding: 0 0 calc(92px + env(safe-area-inset-bottom, 0px)) !important; }
.ts-stage { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px 16px 10px; background: var(--background, #0b0e13); box-shadow: 0 10px 14px -12px rgba(0,0,0,0.5); }
.ts-stage { --pw: min(36vw, 150px); }
@media (min-height: 760px) { .ts-stage { --pw: min(40vw, 166px); } }
.ts-phone { --tp-r: 18px; display: flex; justify-content: center; }
.tp-phone { width: var(--pw, 150px); aspect-ratio: 9 / 18.5; padding: 5px; box-sizing: border-box; border-radius: 26px; background: #0a0a0c; box-shadow: 0 14px 40px rgba(0,0,0,0.35), inset 0 0 0 1.5px rgba(255,255,255,0.12); }
.tp-screen { position: relative; width: 100%; height: 100%; border-radius: 21px; overflow: hidden; background: var(--tp-bg) center / cover no-repeat; color: var(--tp-text); font-family: var(--tp-font); font-size: 7px; display: flex; flex-direction: column; }
.tp-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 2px; font-size: 6.5px; }
.tp-status span { display: inline-flex; align-items: center; gap: 3px; }
.tp-batt { width: 11px; height: 6px; border-radius: 2px; border: 1px solid currentColor; box-sizing: border-box; background: linear-gradient(90deg, currentColor 75%, transparent 75%); }
/* Home */
.tp-home { flex: 1; display: flex; flex-direction: column; gap: 7px; padding: 6px 9px 8px; }
.tp-widget { display: flex; flex-direction: column; gap: 1px; padding: 8px 9px; border-radius: var(--tp-r); background: var(--tp-surface); border: 1px solid var(--tp-outline); box-shadow: var(--tp-shadow); }
.tp-widget b { font-size: 17px; font-weight: 300; letter-spacing: -0.03em; line-height: 1; }
.tp-widget span { font-size: 6.5px; opacity: 0.8; }
.tp-widget small { display: inline-flex; align-items: center; gap: 2px; font-size: 6px; color: var(--tp-accent); margin-top: 2px; }
.tp-widget--small { flex-direction: row; align-items: center; gap: 6px; padding: 6px 8px; }
.tp-widget--small span:last-child { display: flex; flex-direction: column; opacity: 1; }
.tp-widget--small b { font-size: 7px; font-weight: 700; letter-spacing: 0; }
.tp-widget--small small { color: inherit; opacity: 0.65; margin: 0; }
.tp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tp-error); flex-shrink: 0; }
.tp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px 4px; padding: 2px 0; }
.tp-app-ico { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.tp-app-ico i { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: var(--tp-icon-r, 32%); background: var(--c); color: #fff; }
.tp-app-ico small { font-size: 5px; opacity: 0.85; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,0.4); }
.tp-nolabels .tp-app-ico small { display: none; }
.tp-dock { margin-top: auto; display: flex; justify-content: space-around; padding: 6px; border-radius: calc(var(--tp-r) + 4px); background: var(--tp-surface); }
/* App */
.tp-app { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 4px 9px 8px; background: var(--tp-bg); }
.tp-app-head { display: flex; align-items: center; gap: 5px; font-size: 9px; }
.tp-back { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: var(--tp-surface-solid); }
.tp-search { display: flex; align-items: center; gap: 4px; padding: 5px 7px; border-radius: 999px; background: var(--tp-input); opacity: 0.95; font-size: 6.5px; color: color-mix(in srgb, var(--tp-text) 60%, transparent); }
.tp-card { border-radius: var(--tp-r); background: var(--tp-surface); border: 1px solid var(--tp-outline); box-shadow: var(--tp-shadow); overflow: hidden; }
.tp-row { display: flex; align-items: center; gap: 6px; padding: 6px 7px; }
.tp-row + .tp-row { border-top: 1px solid color-mix(in srgb, var(--tp-text) 9%, transparent); }
.tp-row i { width: 13px; height: 13px; border-radius: 4px; background: var(--c); flex-shrink: 0; }
.tp-row span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tp-row b { font-size: 7px; }
.tp-row small { font-size: 5.6px; opacity: 0.6; }
.tp-switch { width: 17px; height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--tp-text) 25%, transparent); position: relative; flex-shrink: 0; }
.tp-switch::after { content: ''; position: absolute; top: 1.5px; left: 1.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.tp-switch.is-on { background: var(--tp-accent); box-shadow: 0 0 8px var(--tp-glow); }
.tp-switch.is-on::after { left: 8.5px; }
.tp-chev { width: 4px; height: 4px; border-right: 1.3px solid currentColor; border-top: 1.3px solid currentColor; transform: rotate(45deg); opacity: 0.5; margin-right: 2px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.tp-chip { padding: 2px 6px; border-radius: 999px; font-size: 5.8px; font-weight: 700; background: color-mix(in srgb, var(--tp-text) 10%, transparent); }
.tp-chip.is-on { background: var(--tp-accent); color: var(--tp-bg); }
.tp-chip--2 { color: var(--tp-accent2); background: color-mix(in srgb, var(--tp-accent2) 18%, transparent); }
.tp-chip--ok { color: var(--tp-success); background: color-mix(in srgb, var(--tp-success) 16%, transparent); }
.tp-chip--err { color: var(--tp-error); background: color-mix(in srgb, var(--tp-error) 16%, transparent); }
.tp-input { padding: 6px 8px; border-radius: calc(var(--tp-r) * 0.6); background: var(--tp-input); border: 1px solid var(--tp-outline); font-size: 6.5px; opacity: 0.85; }
.tp-btns { display: flex; gap: 5px; }
.tp-btn { flex: 1; text-align: center; padding: 5px; border-radius: 999px; background: var(--tp-accent); color: var(--tp-bg); font-weight: 800; font-size: 7px; box-shadow: 0 2px 10px var(--tp-glow); }
.tp-btn--ghost { background: none; color: var(--tp-text); border: 1px solid color-mix(in srgb, var(--tp-text) 25%, transparent); box-shadow: none; }
.tp-light .tp-btn:not(.tp-btn--ghost), .tp-light .tp-chip.is-on { color: #fff; }
.tp-muted { margin: 0; font-size: 6.2px; opacity: 0.65; line-height: 1.4; }
.tp-muted a { color: var(--tp-accent); font-weight: 700; opacity: 1; }
/* Lock */
.tp-lock { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 18px 9px 9px; background: color-mix(in srgb, var(--tp-bg) 30%, transparent); }
.tp-lock-ico { display: inline-flex; padding: 4px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--tp-text) 30%, transparent); margin-bottom: 6px; }
.tp-lock-time { font-family: var(--tp-lock-font); font-weight: var(--tp-lock-weight, 300); color: var(--tp-lock-color); font-size: 38px; letter-spacing: -0.05em; line-height: 1; }
.tp-lock-date { font-family: var(--tp-lock-font); color: var(--tp-lock-color); font-size: 7.5px; margin-top: 4px; opacity: 0.9; }
.tp-lock-notif { display: flex; align-items: center; gap: 5px; width: 100%; box-sizing: border-box; margin-top: 16px; padding: 6px 7px; border-radius: var(--tp-r); background: var(--tp-surface); box-shadow: var(--tp-shadow); }
.tp-lock-notif i { width: 13px; height: 13px; border-radius: 4px; background: var(--c); }
.tp-lock-notif span { display: flex; flex-direction: column; }
.tp-lock-notif b { font-size: 6.5px; }
.tp-lock-notif small { font-size: 6px; opacity: 0.65; }
.tp-lock-pill { margin-top: auto; padding: 4px 9px; border-radius: 999px; background: var(--tp-surface-solid); font-size: 6px; font-weight: 700; }

.ts-phone { transform-origin: 50% 0; }
.ts-stage.is-compact .ts-phone { transform: scale(0.55); margin-bottom: calc(var(--pw) * 18.5 / 9 * -0.45); }
.ts-stage.is-compact .ts-views { display: none; }
.ts-ai-ideas .ok-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 14%, transparent); background: color-mix(in srgb, var(--on-surface, #fff) 6%, transparent); color: var(--on-surface); font: 600 0.78rem var(--font-main); cursor: pointer; }
.ts-chips .ok-chip { padding: 7px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); font: 600 0.78rem var(--font-main); cursor: pointer; }
.ts-chips .ok-chip.is-active { background: var(--accent-primary, #6aa4f5); border-color: var(--accent-primary, #6aa4f5); color: var(--background, #0b0e13); }
.ts-addvar .ok-chip { padding: 0 14px; border-radius: 10px; border: none; background: var(--accent-primary, #6aa4f5); color: var(--background, #0b0e13); font: 700 0.8rem var(--font-main); cursor: pointer; }
.ts-views { display: inline-flex; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); }
.ts-view { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; border: none; background: none; color: color-mix(in srgb, var(--on-surface, #fff) 70%, transparent); font: 600 0.8rem var(--font-main); cursor: pointer; }
.ts-view.is-on { background: var(--surface-color, #191d25); color: var(--on-surface); box-shadow: 0 1px 6px rgba(0,0,0,0.2); }
.ts-tabs { display: flex; gap: 4px; overflow-x: auto; width: 100%; max-width: 640px; padding: 2px 0 0; scrollbar-width: none; }
.ts-tabs::-webkit-scrollbar { display: none; }
.ts-tab { flex: 1 0 auto; padding: 9px 14px; border-radius: 12px; border: none; background: color-mix(in srgb, var(--on-surface, #fff) 6%, transparent); color: var(--on-surface); font: 600 0.85rem var(--font-main); cursor: pointer; }
.ts-tab.is-on { background: var(--accent-primary, #6aa4f5); color: var(--background, #0b0e13); }
html.ts-light .ts-tab.is-on, html.theme-paper .ts-tab.is-on, html.theme-arctic .ts-tab.is-on, html.theme-blossom .ts-tab.is-on, html.theme-sage .ts-tab.is-on, html.theme-solar-flare .ts-tab.is-on { color: #fff; }
.ts-pane { padding: 0 16px 20px; max-width: 640px; margin: 0 auto; }
.ts-h { margin: 18px 2px 8px; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--on-surface, #fff) 55%, transparent); }
.ts-note { margin: -2px 2px 10px; font-size: 0.8rem; line-height: 1.45; color: color-mix(in srgb, var(--on-surface, #fff) 58%, transparent); }
.ts-note code, .ts-var code { font-family: var(--font-mono); font-size: 0.78em; }
.ts-group { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 18px; background: var(--surface-color, #191d25); margin-bottom: 12px; }
.ts-group-row { display: flex; gap: 8px; align-items: center; }
.ts-group-row .ts-seg { flex: 1; }
.ts-label { font-size: 0.82rem; font-weight: 600; margin-bottom: -6px; }
.ts-seg { display: flex; padding: 3px; border-radius: 12px; background: color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); }
.ts-seg-btn { flex: 1; padding: 8px 6px; border: none; border-radius: 9px; background: none; color: var(--on-surface); font: 600 0.82rem var(--font-main); cursor: pointer; white-space: nowrap; }
.ts-seg-btn.is-on { background: var(--surface-color, #191d25); box-shadow: 0 1px 6px rgba(0,0,0,0.25); color: var(--accent-primary, #6aa4f5); }
.ts-group .ts-seg-btn.is-on { background: var(--background, #0b0e13); }
.ts-mini-btn2, .ts-q { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); background: none; color: var(--on-surface); font: 600 0.8rem var(--font-main); cursor: pointer; white-space: nowrap; }
.ts-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-quick .ts-q { flex: 1 1 auto; justify-content: center; }
.ts-palette { display: flex; flex-direction: column; border-radius: 18px; background: var(--surface-color, #191d25); overflow: hidden; }
.ts-pick { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.ts-pick + .ts-pick { border-top: 1px solid color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); }
.ts-swatch { position: relative; flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--c); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--on-surface, #fff) 18%, transparent); cursor: pointer; overflow: hidden; }
.ts-swatch input { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); opacity: 0; cursor: pointer; border: none; padding: 0; }
.ts-pick-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ts-pick-text b { font-size: 0.9rem; }
.ts-pick-text small { font-size: 0.74rem; color: color-mix(in srgb, var(--on-surface, #fff) 55%, transparent); }
.ts-hex { width: 82px; flex-shrink: 0; padding: 8px 9px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); background: var(--input-bg, #1e232c); color: var(--on-surface); font: 500 0.8rem var(--font-mono); text-transform: lowercase; }
.ts-hex.is-bad { border-color: var(--error, #f87171); }
.ts-presets { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 16px; }
.ts-presets > span { font-size: 0.8rem; font-weight: 600; }
.ts-presets > div { display: flex; flex-wrap: wrap; gap: 10px; }
.ts-dot { position: relative; width: 34px; height: 34px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--on-surface, #fff) 14%, transparent); background: var(--c); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--on-surface); font: 700 0.8rem var(--font-main); overflow: hidden; }
.ts-dot.is-on { outline: 2.5px solid var(--accent-primary, #6aa4f5); outline-offset: 2px; }
.ts-dot--txt { background: none; }
.ts-dot--pick { background: conic-gradient(#f87171, #facc15, #4ade80, #38bdf8, #a78bfa, #f472b6, #f87171); color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.ts-dot--pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ts-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.ts-font { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 4px 9px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); cursor: pointer; overflow: hidden; }
.ts-font b { font-size: 1.35rem; font-weight: 600; line-height: 1.1; white-space: nowrap; }
.ts-font span { font: 600 0.66rem var(--font-main); opacity: 0.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-font.is-on { border-color: var(--accent-primary, #6aa4f5); background: color-mix(in srgb, var(--accent-primary, #6aa4f5) 12%, var(--surface-color, #191d25)); }
.ts-slide { display: flex; flex-direction: column; gap: 8px; }
.ts-slide-head { display: flex; justify-content: space-between; font-size: 0.86rem; }
.ts-slide-head output { font-variant-numeric: tabular-nums; color: var(--accent-primary, #6aa4f5); font-weight: 700; }
.ts-slide input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; margin: 0; }
.ts-slide input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-primary, #6aa4f5) var(--p, 50%), color-mix(in srgb, var(--on-surface, #fff) 14%, transparent) var(--p, 50%)); }
.ts-slide input[type="range"]::-moz-range-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-primary, #6aa4f5) var(--p, 50%), color-mix(in srgb, var(--on-surface, #fff) 14%, transparent) var(--p, 50%)); }
.ts-slide input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.ts-slide input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.ts-list { margin-bottom: 12px; }
.ts-toggle { width: 100%; text-align: left; }
.ts-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ts-walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
.ts-wall { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 0; border: none; background: none; color: var(--on-surface); font: 600 0.7rem var(--font-main); cursor: pointer; }
.ts-wall-thumb { width: 100%; aspect-ratio: 3 / 5; border-radius: 12px; overflow: hidden; border: 2px solid color-mix(in srgb, var(--on-surface, #fff) 10%, transparent); display: flex; align-items: center; justify-content: center; background: var(--surface-color, #191d25); box-sizing: border-box; }
.ts-wall-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ts-wall.is-on .ts-wall-thumb { border-color: var(--accent-primary, #6aa4f5); }
/* Dev */
.ts-contrast { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--surface-color, #191d25); }
.ts-cr { display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 0.84rem; }
.ts-cr + .ts-cr { border-top: 1px solid color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); }
.ts-cr span:nth-child(2) { flex: 1; }
.ts-cr b { font-variant-numeric: tabular-nums; }
.ts-cr.is-ok b { color: var(--success, #4ade80); }
.ts-cr.is-meh b { color: #f59e0b; }
.ts-cr.is-bad b { color: var(--error, #f87171); }
.ts-cr-sw { width: 34px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: var(--b); color: var(--a); font-weight: 800; font-size: 0.82rem; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); }
.ts-vars { display: flex; flex-direction: column; gap: 6px; }
.ts-var { display: flex; align-items: center; gap: 8px; }
.ts-var code { flex: 0 0 44%; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: var(--accent-primary, #6aa4f5); }
.ts-var input, .ts-addvar input { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); background: var(--input-bg, #1e232c); color: var(--on-surface); font: 0.8rem var(--font-mono); }
.ts-var-x { width: 30px; height: 30px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--error, #f87171) 18%, transparent); color: var(--error, #f87171); font-size: 1.1rem; cursor: pointer; }
.ts-addvar { display: flex; gap: 6px; margin-top: 8px; }
.ts-css { width: 100%; min-height: 140px; box-sizing: border-box; padding: 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); background: var(--input-bg, #1e232c); color: var(--on-surface); font: 0.8rem/1.5 var(--font-mono); resize: vertical; }
.ts-code { margin: 12px 0 0; max-height: 220px; overflow: auto; padding: 12px; border-radius: 14px; background: color-mix(in srgb, var(--background, #000) 70%, #000); color: color-mix(in srgb, var(--on-surface, #fff) 80%, transparent); font: 0.72rem/1.45 var(--font-mono); white-space: pre-wrap; word-break: break-all; }
.ts-savebar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--background, #0b0e13) 30%); }
.ts-savebar > * { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.ts-savebar > :last-child { flex: 1.6; }

/* Make with AI sheet */
.ts-ai-card { text-align: center; }
.ts-ai-orb { display: inline-flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%; color: #fff; background: conic-gradient(from 0deg, #e6508a, #7c5cff, #38bdf8, #e6508a); margin-bottom: 6px; }
.ts-ai-input { width: 100%; box-sizing: border-box; margin: 6px 0 10px; padding: 12px 14px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 14%, transparent); background: var(--input-bg, #1e232c); color: var(--on-surface); font: 0.95rem/1.4 var(--font-main); resize: none; }
.ts-ai-ideas { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 8px; }
.ts-ai-status { min-height: 1.3em; margin: 4px 0 12px; font-size: 0.84rem; color: color-mix(in srgb, var(--on-surface, #fff) 70%, transparent); }
.ts-ai-connect { margin-top: 10px; border: none; background: none; color: var(--accent-primary, #6aa4f5); font: 600 0.86rem var(--font-main); cursor: pointer; }
.ts-ai-card [data-go] { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
    :root:not(.no-animations) body:not(.no-animations) .ts-hero-art span { animation: tsFan 0.6s cubic-bezier(0.25, 1.3, 0.5, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) .ts-hero-art span:nth-child(2) { animation-delay: 0.06s; }
    :root:not(.no-animations) body:not(.no-animations) .ts-hero-art span:nth-child(3) { animation-delay: 0.12s; }
    :root:not(.no-animations) body:not(.no-animations) :is(.ts-start-card, .ts-theme, .ts-builtin, .ts-pick) { animation: tsRise 0.42s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; animation-delay: calc(var(--i, 0) * 0.035s); }
    :root:not(.no-animations) body:not(.no-animations) :is(.ts-start-card, .ts-theme, .ts-builtin, .ts-font, .ts-wall, .ts-dot, .ts-q, .ts-mini-btn2, .ts-tab, .ts-view, .ts-seg-btn) { transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
    :root:not(.no-animations) body:not(.no-animations) :is(.ts-start-card, .ts-theme, .ts-builtin, .ts-font, .ts-wall, .ts-dot, .ts-q, .ts-mini-btn2):active { transform: scale(0.95); }
    :root:not(.no-animations) body:not(.no-animations) .ts-start--ai svg { animation: tsTwinkle 2.6s ease-in-out infinite; }
    :root:not(.no-animations) body:not(.no-animations) .ts-theme-on { animation: tsPop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) .ts-pane-in { animation: tsPane 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) .tp-phone { animation: tsPhone 0.5s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; }
    :root:not(.no-animations) body:not(.no-animations) .ts-phone { transition: transform 0.32s cubic-bezier(0.2, 0.9, 0.3, 1); }
    :root:not(.no-animations) body:not(.no-animations) .tp-screen { transition: background-color 0.25s ease, color 0.25s ease; }
    :root:not(.no-animations) body:not(.no-animations) .tp-screen.is-swap > :not(.tp-status) { animation: tsSwap 0.34s cubic-bezier(0.2, 0.9, 0.3, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) :is(.tp-widget, .tp-card, .tp-dock, .tp-btn, .tp-chip, .tp-switch, .tp-input, .tp-app-ico i, .tp-lock-notif, .tp-lock-time) { transition: background-color 0.25s ease, border-radius 0.25s ease, box-shadow 0.25s ease, color 0.25s ease; }
    :root:not(.no-animations) body:not(.no-animations) .tp-screen.is-swap .tp-app-ico { animation: tsPop 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(0.05s + var(--i, 0) * 0.03s); }
    :root:not(.no-animations) body:not(.no-animations) .ts-swatch { transition: background-color 0.15s ease, transform 0.15s ease; }
    :root:not(.no-animations) body:not(.no-animations) .ts-swatch:active { transform: scale(0.9); }
    :root:not(.no-animations) body:not(.no-animations) .ts-font.is-on, :root:not(.no-animations) body:not(.no-animations) .ts-dot.is-on { animation: tsPop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
    :root:not(.no-animations) body:not(.no-animations) .ts-savebar { animation: tsBar 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) 0.1s both; }
    :root:not(.no-animations) body:not(.no-animations) .ts-ai-card .ok-chip { animation: tsRise 0.35s cubic-bezier(0.2, 0.9, 0.3, 1) both; animation-delay: calc(0.1s + var(--i, 0) * 0.03s); }
    :root:not(.no-animations) body:not(.no-animations) .ts-ai-orb { animation: tsPop 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) .ts-ai-card.is-thinking .ts-ai-orb { animation: tsSpin 1.1s linear infinite; }
    :root:not(.no-animations) body:not(.no-animations) .ts-ai-sheet.is-leaving { animation: fadeOut 0.2s ease-in forwards; }
    :root:not(.no-animations) body:not(.no-animations) .ts-var { animation: tsRise 0.3s ease both; animation-delay: calc(var(--i, 0) * 0.015s); }
}
@keyframes tsFan { from { opacity: 0; transform: translateY(18px) rotate(0deg) scale(0.8); } }
@keyframes tsRise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes tsPop { 0% { transform: scale(0.5); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes tsTwinkle { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(18deg) scale(1.15); } }
@keyframes tsPane { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes tsPhone { from { opacity: 0; transform: translate3d(0, 20px, 0) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes tsSwap { from { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes tsBar { from { opacity: 0; transform: translate3d(0, 100%, 0); } to { opacity: 1; transform: none; } }
@keyframes tsSpin { to { transform: rotate(360deg); } }
