/* OrbitOS system pieces (app/sysui.js, app/wellbeing.js): power menu, the
   volume/brightness slider, share sheet, clipboard, Open with, App info,
   Digital wellbeing, Focus modes, Always On Display. Motion is at the end,
   behind the Disable animations and reduced motion checks. */

/* ---------- Sheets from the bottom ---------- */
.sx-sheet.ok-sheet { justify-content: flex-end; }
.sx-sheet .ok-sheet-card { display: flex; flex-direction: column; gap: 14px; padding: 10px 18px 20px; max-height: 82vh; overflow-y: auto; border-radius: 30px; }
.sx-grab { align-self: center; width: 40px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--on-surface, #fff) 22%, transparent); flex-shrink: 0; }
.sx-sheet-head, .sx-share-preview { display: flex; align-items: center; gap: 12px; }
.sx-sheet-head > span:nth-child(2), .sx-share-preview > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.sx-sheet-head b, .sx-share-preview b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-sheet-head small, .sx-share-preview small { font-size: 0.8rem; color: var(--ok-muted, #8b95a7); line-height: 1.35; }
.sx-sheet-ico { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 13px; background: var(--tile); color: #fff; }
.sx-sheet .hs-icon { width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0; }
.sx-sheet .hs-icon img { border-radius: inherit; }
.sx-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 4px 0; border-top: 1px solid var(--ok-line, rgba(255,255,255,0.08)); font-size: 0.92rem; font-weight: 600; }
.sx-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px; text-align: center; color: var(--ok-muted, #8b95a7); }
.sx-empty b { color: var(--on-surface); font-size: 0.98rem; }
.sx-empty span { font-size: 0.82rem; }

/* Share */
.sx-share-label { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ok-muted, #8b95a7); }
.sx-share-apps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 6px; }
.sx-share-app { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px 0; border: none; background: none; color: inherit; font: 600 0.76rem var(--font-main); cursor: pointer; }
.sx-share-acts { display: flex; flex-direction: column; border-radius: 20px; background: var(--ok-card, rgba(255,255,255,0.04)); border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); overflow: hidden; }
.sx-share-act { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: none; background: none; color: inherit; font: 600 0.92rem var(--font-main); text-align: left; cursor: pointer; }
.sx-share-act + .sx-share-act { border-top: 1px solid var(--ok-line, rgba(255,255,255,0.08)); }
.sx-share-act .sx-sheet-ico { width: 34px; height: 34px; border-radius: 11px; }

/* Clipboard */
.sx-clip-list { display: flex; flex-direction: column; gap: 8px; }
.sx-clip-item { display: flex; align-items: stretch; gap: 4px; border-radius: 18px; background: var(--ok-card, rgba(255,255,255,0.04)); border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); }
.sx-clip-item.is-pin { border-color: color-mix(in srgb, #0ea5e9 45%, transparent); }
.sx-clip-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 12px 4px 12px 14px; border: none; background: none; color: inherit; font: 0.9rem/1.4 var(--font-main); text-align: left; white-space: pre-wrap; word-break: break-word; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sx-clip-text small { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--ok-muted, #8b95a7); }
.sx-clip-act { flex-shrink: 0; width: 40px; border: none; background: none; color: var(--ok-muted, #8b95a7); cursor: pointer; }
.sx-clip-act.is-on { color: #0ea5e9; }

/* Open with / default browser */
.sx-ow-list { display: flex; flex-direction: column; gap: 8px; }
.sx-ow { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); background: var(--ok-card, rgba(255,255,255,0.04)); color: inherit; font-family: var(--font-main); text-align: left; cursor: pointer; }
.sx-ow > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.sx-ow b { font-size: 0.95rem; }
.sx-ow small { font-size: 0.78rem; color: var(--ok-muted, #8b95a7); }
.sx-ow .hs-icon { width: 40px; height: 40px; border-radius: 13px; }
.sx-ow.is-on { border-color: var(--accent-color, #3b82f6); }
.sx-radio { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ok-muted, #8b95a7); transition: border-width 0.2s ease, border-color 0.2s ease; }
.sx-ow.is-on .sx-radio { border: 7px solid var(--accent-color, #3b82f6); }

/* ---------- Power menu ---------- */
.sx-power { position: fixed; inset: 0; z-index: 21000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 24px; background: rgba(4, 6, 12, 0.72); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); font-family: var(--font-main); color: #fff; }
html:is(.lite, .surface-solid) .sx-power { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(4, 6, 12, 0.9); }
.sx-pw-list { display: flex; flex-direction: column; gap: 12px; width: min(320px, 100%); }
.sx-pw-btn { display: flex; align-items: center; gap: 16px; padding: 12px 18px 12px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.08); color: #fff; font-family: inherit; text-align: left; cursor: pointer; }
.sx-pw-ico { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; border-radius: 50%; background: var(--pw); color: #fff; box-shadow: 0 8px 24px color-mix(in srgb, var(--pw) 45%, transparent); flex-shrink: 0; }
.sx-pw-text { display: flex; flex-direction: column; gap: 2px; }
.sx-pw-text b { font-size: 1.05rem; }
.sx-pw-text small { font-size: 0.78rem; opacity: 0.65; }
.sx-pw-cancel { padding: 12px 28px; border-radius: 999px; border: none; background: rgba(255, 255, 255, 0.12); color: #fff; font: 700 0.92rem var(--font-main); cursor: pointer; }

/* ---------- Volume / brightness slider (HUD) ---------- */
.sx-hud { position: fixed; right: 12px; top: 50%; z-index: 20500; display: flex; align-items: center; gap: 10px; translate: 0 -50%; font-family: var(--font-main); }
.sx-hud-col { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; border-radius: 30px; background: color-mix(in srgb, var(--surface-color, #0d1117) 92%, transparent); border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 10%, transparent); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); }
.sx-hud-bar { --v: 0.5; position: relative; width: 46px; height: 190px; border-radius: 23px; overflow: hidden; background: color-mix(in srgb, var(--on-surface, #fff) 12%, transparent); touch-action: none; cursor: pointer; }
.sx-hud-bar i { position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--v) * 100%); background: var(--accent-color, #3b82f6); border-radius: 0 0 23px 23px; }
.sx-hud-num { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; font-size: 0.78rem; font-weight: 800; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); }
.sx-hud-mute, .sx-hud-more { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; color: var(--on-surface, #fff); cursor: pointer; }
.sx-hud-bri { display: none; padding: 0; height: 236px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35); border: 8px solid color-mix(in srgb, var(--surface-color, #0d1117) 92%, transparent); width: 62px; border-radius: 31px; }
.sx-hud-bri i { background: #f5b83d; border-radius: 0; }
.sx-hud-bri .sx-hud-ico { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; color: #fff; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45)); }
.sx-hud.is-wide .sx-hud-bri { display: block; }
#sx-dim { position: fixed; inset: 0; z-index: 2147482000; background: #000; pointer-events: none; transition: opacity 0.2s ease; }

/* Quick panel sliders */
.qp-sliders { display: flex; flex-direction: column; gap: 10px; }
.qp-slider { --v: 0.5; position: relative; display: flex; align-items: center; height: 46px; border-radius: 23px; overflow: hidden; background: color-mix(in srgb, var(--on-surface, #fff) 10%, transparent); }
.qp-slider::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: max(46px, calc(var(--v) * 100%)); border-radius: 23px; background: var(--accent-color, #3b82f6); pointer-events: none; }
.qp-slider-ico { position: relative; z-index: 1; display: inline-flex; width: 46px; justify-content: center; color: #fff; pointer-events: none; }
.qp-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; touch-action: pan-y; }

/* ---------- App info ---------- */
.sx-ai-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 4px; text-align: center; }
.sx-ai-hero .hs-icon { width: 84px; height: 84px; border-radius: 26px; margin-bottom: 6px; }
.sx-ai-hero b { font-size: 1.35rem; }
.sx-ai-hero small { max-width: 300px; font-size: 0.84rem; color: var(--ok-muted, #8b95a7); }
.sx-ai-acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sx-ai-act { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px; border-radius: 20px; border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); background: var(--ok-card, rgba(255,255,255,0.04)); color: var(--accent-color, #3b82f6); font: 700 0.8rem var(--font-main); cursor: pointer; }
.sx-ai-act span { color: var(--on-surface); }
.sx-ai-act.is-danger { color: var(--error, #e5534b); }
.sx-ai-act:disabled { cursor: default; }
.sx-ai-act:disabled > * { opacity: 0.38; }
.sx-ai-row { width: 100%; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.sx-apps-list .hs-icon, .wb-apps .hs-icon, .wb-allow .hs-icon { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; }

/* ---------- Digital wellbeing ---------- */
.wb-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 16px 14px; border-radius: 28px; background: linear-gradient(160deg, color-mix(in srgb, #22a35a 22%, var(--ok-card, #151a22)), var(--ok-card, #151a22)); border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); text-align: center; }
.wb-hero small { font-size: 0.8rem; font-weight: 700; color: var(--ok-muted, #8b95a7); }
.wb-total { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.wb-sub { font-size: 0.8rem; color: var(--ok-muted, #8b95a7); }
.wb-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; width: 100%; height: 130px; margin-top: 14px; }
.wb-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; padding: 0; border: none; background: none; color: var(--ok-muted, #8b95a7); font: 700 0.72rem var(--font-main); cursor: pointer; }
.wb-bar i { width: 100%; max-width: 30px; height: calc(var(--h) * 100px); border-radius: 9px; background: color-mix(in srgb, #22a35a 35%, transparent); transform-origin: bottom; }
.wb-bar.is-sel i { background: #22a35a; }
.wb-bar.is-sel { color: var(--on-surface); }
.wb-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wb-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 20px; background: var(--ok-card, rgba(255,255,255,0.04)); border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); }
.wb-stat b { font-size: 1.15rem; }
.wb-stat small { font-size: 0.74rem; color: var(--ok-muted, #8b95a7); }
.wb-app { width: 100%; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wb-meter { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); overflow: hidden; }
.wb-meter i { display: block; height: 100%; width: calc(var(--w) * 100%); border-radius: 3px; background: var(--c); transform-origin: left; }
.wb-time { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; font-size: 0.84rem; font-weight: 700; }
.wb-time small { display: inline-flex; align-items: center; gap: 3px; font-size: 0.7rem; color: #f59e0b; }
.wb-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wb-chips .ok-chip { height: 34px; padding: 0 13px; }
.wb-timer-sheet .wb-chips { margin: 0; }
.wb-timeout { align-items: flex-start; }

/* Time's up */
.wb-timeup { position: fixed; inset: 0; z-index: 20800; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(4, 6, 12, 0.8); font-family: var(--font-main); }
.wb-timeup-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; width: min(340px, 100%); padding: 26px 22px 20px; border-radius: 30px; background: var(--surface-color, #0d1117); color: var(--on-surface); text-align: center; filter: grayscale(0.6); }
.wb-timeup-card .hs-icon { width: 72px; height: 72px; border-radius: 22px; }
.wb-timeup-ico { position: absolute; top: 72px; left: calc(50% + 22px); display: inline-flex; padding: 6px; border-radius: 50%; background: #f59e0b; color: #fff; }
.wb-timeup-card b { font-size: 1.2rem; margin-top: 6px; }
.wb-timeup-card p { margin: 0 0 6px; font-size: 0.88rem; color: var(--ok-muted, #8b95a7); }
.wb-timeup-card .ok-btn { width: 100%; }

/* Focus */
.wb-focus-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 18px; border-radius: 28px; text-align: center; background: linear-gradient(160deg, color-mix(in srgb, var(--fh) 30%, var(--ok-card, #151a22)), var(--ok-card, #151a22)); border: 1px solid var(--ok-line, rgba(255,255,255,0.08)); }
.wb-focus-orb { display: inline-flex; align-items: center; justify-content: center; width: 66px; height: 66px; border-radius: 50%; background: var(--fh); color: #fff; margin-bottom: 4px; box-shadow: 0 10px 30px color-mix(in srgb, var(--fh) 40%, transparent); }
.wb-focus-hero b { font-size: 1.15rem; }
.wb-focus-hero small { font-size: 0.82rem; color: var(--ok-muted, #8b95a7); max-width: 280px; }
.wb-mode-edit { flex: 1; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; padding: 0; }
.wb-times { gap: 12px; }
.wb-times label { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 0.76rem; font-weight: 700; color: var(--ok-muted, #8b95a7); }
.wb-times.is-off { opacity: 0.45; pointer-events: none; }
.wb-allow-row { width: 100%; border: none; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.wb-check { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ok-muted, #8b95a7); color: transparent; flex-shrink: 0; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.wb-allow-row.is-on .wb-check { background: #6366f1; border-color: #6366f1; color: #fff; }
html.wb-gray body::after { content: ''; position: fixed; inset: 0; z-index: 2147481000; pointer-events: none; -webkit-backdrop-filter: grayscale(1); backdrop-filter: grayscale(1); }

/* Always On Display */
.wb-aod { position: fixed; inset: 0; z-index: 2147482500; display: flex; align-items: center; justify-content: center; background: #000; color: #e6e9ef; font-family: var(--font-main); cursor: pointer; touch-action: none; }
.wb-aod-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; transition: transform 1.5s ease; }
.wb-aod-time { font-size: 4.2rem; font-weight: 300; letter-spacing: -0.02em; line-height: 1; opacity: 0.9; }
.wb-aod-date { font-size: 0.92rem; opacity: 0.6; }
.wb-aod-notifs { display: flex; gap: 8px; margin-top: 6px; opacity: 0.75; }
.wb-aod-notifs .nt-icon { width: 24px; height: 24px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.wb-aod-focus { display: inline-flex; align-items: center; gap: 5px; font-size: 0.78rem; opacity: 0.55; }
.wb-aod-demo { display: flex; justify-content: center; padding: 6px 0 2px; }
.wb-aod-demo-phone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 120px; height: 200px; border-radius: 26px; border: 3px solid var(--ok-line, rgba(255,255,255,0.15)); background: #000; color: #e6e9ef; transition: opacity 0.3s ease; opacity: 0.35; }
.wb-aod-demo.is-on .wb-aod-demo-phone { opacity: 1; }
.wb-aod-demo-phone b { font-size: 1.6rem; font-weight: 300; }
.wb-aod-demo-phone i { width: 44px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.25); }
.wb-aod-demo-phone i + i { width: 28px; }

/* ---------- Motion ---------- */
@keyframes sxRise { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sxFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sxPop { from { opacity: 0; transform: scale(0.92) translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sxSlideIn { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes sxGrow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes sxGrowX { from { transform: scaleX(0); } to { transform: none; } }
@keyframes sxAodIn { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
    :root:not(.no-animations) body:not(.no-animations) .sx-sheet .ok-sheet-card { animation: sxRise 0.34s var(--os-ease-out, cubic-bezier(0.16, 1, 0.3, 1)) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-sheet.is-leaving .ok-sheet-card { animation: sxRise 0.2s ease-in reverse forwards; }
    :root:not(.no-animations) body:not(.no-animations) :is(.sx-share-app, .sx-share-act, .sx-clip-item) { animation: osRise 0.36s var(--os-ease-out, ease) both; animation-delay: calc(var(--i, 0) * 30ms + 80ms); }
    :root:not(.no-animations) body:not(.no-animations) :is(.sx-share-app, .sx-share-act, .sx-pw-btn, .sx-ai-act, .sx-ow, .sx-clip-text, .wb-bar, .sx-pw-cancel):active { transform: scale(0.95); transition: transform 0.12s ease; }
    :root:not(.no-animations) body:not(.no-animations) .sx-power { animation: sxFade 0.22s ease both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-power.is-leaving { animation: sxFade 0.2s ease reverse forwards; }
    :root:not(.no-animations) body:not(.no-animations) .sx-pw-btn { animation: sxPop 0.42s var(--os-spring, cubic-bezier(0.34, 1.56, 0.64, 1)) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-pw-btn:nth-child(2) { animation-delay: 40ms; }
    :root:not(.no-animations) body:not(.no-animations) .sx-pw-btn:nth-child(3) { animation-delay: 80ms; }
    :root:not(.no-animations) body:not(.no-animations) .sx-pw-btn:nth-child(4) { animation-delay: 120ms; }
    :root:not(.no-animations) body:not(.no-animations) .sx-pw-cancel { animation: sxFade 0.3s 0.15s ease both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-hud { animation: sxSlideIn 0.32s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-hud.is-leaving { animation: sxSlideIn 0.2s ease-in reverse forwards; }
    :root:not(.no-animations) body:not(.no-animations) .sx-hud-bar:not(.is-drag) i { transition: height 0.18s var(--os-ease-out, ease); }
    :root:not(.no-animations) body:not(.no-animations) .sx-hud.is-wide .sx-hud-bri { animation: sxSlideIn 0.3s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .qp-sliders { animation: osRise 0.4s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-ai-hero .hs-icon { animation: osPop 0.5s var(--os-spring, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-ai-act { animation: osRise 0.4s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .sx-ai-act:nth-child(2) { animation-delay: 40ms; }
    :root:not(.no-animations) body:not(.no-animations) .sx-ai-act:nth-child(3) { animation-delay: 80ms; }
    :root:not(.no-animations) body:not(.no-animations) .wb-first .wb-bar i { animation: sxGrow 0.6s var(--os-ease-out, ease) both; animation-delay: calc(var(--i) * 45ms + 100ms); }
    :root:not(.no-animations) body:not(.no-animations) .wb-bar i { transition: background 0.2s ease; }
    :root:not(.no-animations) body:not(.no-animations) .wb-meter i { animation: sxGrowX 0.6s var(--os-ease-out, ease) both; animation-delay: calc(var(--i, 0) * 40ms + 150ms); }
    :root:not(.no-animations) body:not(.no-animations) .wb-total { animation: osPop 0.45s var(--os-spring, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .wb-focus-orb { animation: osPop 0.5s var(--os-spring, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .wb-focus-hero.is-on .wb-focus-orb { animation: osPop 0.5s var(--os-spring, ease) both, osBreathe 3.2s 0.6s ease-in-out infinite; }
    :root:not(.no-animations) body:not(.no-animations) .wb-timeup { animation: sxFade 0.25s ease both; }
    :root:not(.no-animations) body:not(.no-animations) .wb-timeup-card { animation: sxPop 0.42s var(--os-spring, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .wb-timeup.is-leaving { animation: sxFade 0.2s ease reverse forwards; }
    :root:not(.no-animations) body:not(.no-animations) .wb-aod { animation: sxAodIn 0.6s ease both; }
    :root:not(.no-animations) body:not(.no-animations) .wb-aod.is-leaving { animation: sxAodIn 0.35s ease reverse forwards; }
    :root:not(.no-animations) body:not(.no-animations) .wb-aod-inner { animation: osRise 0.8s 0.1s var(--os-ease-out, ease) both; }
}
.sx-power.is-leaving, .sx-hud.is-leaving, .wb-timeup.is-leaving, .wb-aod.is-leaving { pointer-events: none; }
:root.no-animations .sx-power.is-leaving, :root.no-animations .sx-hud.is-leaving, :root.no-animations .wb-aod.is-leaving { display: none; }
.sx-head-btn { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none; background: color-mix(in srgb, var(--on-surface, #fff) 9%, transparent); color: var(--on-surface); cursor: pointer; }

/* ---------- Glass on overlays only ----------
   Things that float above everything get a frosted look: the quick panel,
   Recent apps, sheets and pop-up menus, the hold menu on home, the side
   slider. App screens, cards and lists stay solid (cheaper, easier to read).
   Lite mode removes every backdrop blur (css/lite.css), so each one has a
   solid fallback below. */
.quick-panel .qp-card { background: color-mix(in srgb, var(--background, #05080c) 66%, transparent); -webkit-backdrop-filter: blur(30px) saturate(1.5); backdrop-filter: blur(30px) saturate(1.5); }
.quick-panel .qp-block { background: color-mix(in srgb, var(--surface-color, #0d1117) 62%, transparent); border: 1px solid color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); }
#app-switcher { background: color-mix(in srgb, var(--background, #0b0d12) 62%, transparent); -webkit-backdrop-filter: blur(26px) saturate(1.3); backdrop-filter: blur(26px) saturate(1.3); }
.ok-sheet { -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); background: rgba(0, 0, 0, 0.42) !important; }
.hs-menu { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); background: color-mix(in srgb, var(--background, #000) 35%, transparent); }
.sx-hud-col, .sx-hud-bri { background: color-mix(in srgb, var(--surface-color, #0d1117) 70%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4); }
.sx-hud-bri { border-color: transparent; background-clip: padding-box; }

html.lite .quick-panel .qp-card, html.surface-solid .quick-panel .qp-card { background: color-mix(in srgb, var(--background, #05080c) 97%, var(--on-surface, #ffffff)); }
html.lite .quick-panel .qp-block, html.surface-solid .quick-panel .qp-block { background: color-mix(in srgb, var(--surface-color, #0d1117) 88%, var(--on-surface, #ffffff) 4%); }
html.lite #app-switcher, html.surface-solid #app-switcher { background: var(--background, #0b0d12); }
html.lite .ok-sheet, html.surface-solid .ok-sheet { background: rgba(0, 0, 0, 0.6) !important; }
html.lite .hs-menu, html.surface-solid .hs-menu { background: color-mix(in srgb, var(--background, #000) 55%, transparent); }
html:is(.lite, .surface-solid) :is(.sx-hud-col, .sx-hud-bri) { background: var(--surface-color, #0d1117); }

/* ---------- Surfaces: Solid ----------
   No glass anywhere, like Lite mode, but by choice. */
html.surface-solid *,
html.surface-solid *::before,
html.surface-solid *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ---------- Surfaces: Glass everywhere ----------
   App screens see the home screen through frosted glass, cards are tinted
   glass on top. Lite mode (weak phones) keeps everything solid. */
html.surface-glass:not(.lite) body .fullscreen-app:not(.ok-sheet):not(.sx-sheet) {
    background: color-mix(in srgb, var(--background, #0b0d12) 64%, transparent) !important;
    -webkit-backdrop-filter: blur(34px) saturate(1.6);
    backdrop-filter: blur(34px) saturate(1.6);
}
html.surface-glass:not(.lite) .ok-app,
html.surface-glass:not(.lite) .fullscreen-app {
    --ok-card: color-mix(in srgb, var(--surface-color, #0d1117) 52%, transparent) !important;
    --ok-line: color-mix(in srgb, var(--on-surface, #fff) 12%, transparent);
}
html.surface-glass:not(.lite) .settings-v3 {
    --st-card: color-mix(in srgb, var(--surface-color, #0d1117) 50%, transparent) !important;
    --st-card-2: color-mix(in srgb, var(--surface-color, #0d1117) 64%, transparent) !important;
    --st-profile-card: color-mix(in srgb, var(--surface-color, #0d1117) 50%, transparent) !important;
}
html.surface-glass:not(.lite) :is(.modern-card, .settings-group, .ok-sheet-card, .hs-menu-card) {
    background: color-mix(in srgb, var(--surface-color, #0d1117) 60%, transparent) !important;
}
html.surface-glass:not(.lite) :is(.ok-sheet-card, .hs-menu-card) {
    -webkit-backdrop-filter: blur(26px) saturate(1.5);
    backdrop-filter: blur(26px) saturate(1.5);
}
html.surface-glass:not(.lite) :is(.hs-widget, .hs-dock, .hs-search) {
    background: color-mix(in srgb, var(--surface-color, #0d1117) 46%, transparent) !important;
    border-color: color-mix(in srgb, var(--on-surface, #fff) 12%, transparent) !important;
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    backdrop-filter: blur(22px) saturate(1.5);
}
html.surface-glass:not(.lite) .hs-drawer {
    background: color-mix(in srgb, var(--background, #0b0d12) 58%, transparent) !important;
    -webkit-backdrop-filter: blur(30px) saturate(1.4);
    backdrop-filter: blur(30px) saturate(1.4);
}
html.surface-glass:not(.lite) .nt-banner {
    background: color-mix(in srgb, var(--surface-color, #0d1117) 62%, transparent) !important;
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    backdrop-filter: blur(24px) saturate(1.5);
}

/* ---------- Settings > Appearance: theme picker ---------- */
.ap-wrap { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
.ap-picker { display: flex; flex-direction: column; gap: 14px; }
.ap-label { margin-top: 4px; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--on-surface) 55%, transparent); }
.ap-stage { display: flex; align-items: center; gap: 18px; padding: 18px; border-radius: 26px; background: linear-gradient(150deg, color-mix(in srgb, var(--tp-accent) 22%, var(--tp-bg)), var(--tp-bg)); color: var(--tp-text); border: 1px solid color-mix(in srgb, var(--tp-text) 12%, transparent); transition: background 0.4s ease, color 0.4s ease; }
.ap-phone { position: relative; flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; width: 104px; height: 176px; padding: 8px 8px; border-radius: 20px; background: var(--tp-bg); border: 3px solid color-mix(in srgb, var(--tp-text) 18%, transparent); overflow: hidden; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.3); transition: background 0.4s ease; }
.ap-phone span { display: flex; }
.ap-phone-bar { justify-content: space-between; }
.ap-phone-bar i { width: 16px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--tp-text) 50%, transparent); }
.ap-phone-head { align-items: center; gap: 5px; margin-top: 2px; }
.ap-phone-head i { width: 14px; height: 14px; border-radius: 5px; background: var(--tp-accent); }
.ap-phone-head b { width: 40px; height: 5px; border-radius: 3px; background: var(--tp-text); opacity: 0.85; }
.ap-phone-card { flex-direction: column; gap: 5px; padding: 8px; border-radius: 10px; background: var(--tp-surface); }
.ap-phone-card i { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--tp-text) 55%, transparent); }
.ap-phone-card i:nth-child(1) { width: 80%; } .ap-phone-card i:nth-child(2) { width: 60%; } .ap-phone-card i:nth-child(3) { width: 70%; }
.ap-phone-row { align-items: center; justify-content: space-between; }
.ap-phone-btn { width: 44px; height: 14px; border-radius: 7px; background: var(--tp-accent); }
.ap-phone-switch { width: 24px; height: 14px; padding: 2px; border-radius: 7px; background: var(--tp-accent); justify-content: flex-end; }
.ap-phone-switch i { width: 10px; height: 10px; border-radius: 50%; background: var(--tp-bg); }
.ap-phone-sheet { position: absolute; left: 6px; right: 6px; bottom: 6px; flex-direction: column; gap: 4px; padding: 8px; border-radius: 10px; background: color-mix(in srgb, var(--tp-surface) 92%, transparent); border: 1px solid color-mix(in srgb, var(--tp-text) 10%, transparent); transition: background 0.3s ease; }
.ap-phone-sheet i { width: 60%; height: 4px; border-radius: 2px; background: var(--tp-text); opacity: 0.7; }
.ap-phone-sheet b { width: 34px; height: 10px; border-radius: 5px; background: var(--tp-accent); }
.ap-stage[data-surface="overlays"] .ap-phone-sheet,
.ap-stage[data-surface="everywhere"] .ap-phone-sheet { background: color-mix(in srgb, var(--tp-surface) 55%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ap-stage[data-surface="everywhere"] .ap-phone-card { background: color-mix(in srgb, var(--tp-surface) 50%, transparent); }
.ap-stage[data-surface="everywhere"] .ap-phone { background: linear-gradient(160deg, color-mix(in srgb, var(--tp-accent) 30%, var(--tp-bg)), var(--tp-bg)); }
.ap-stage-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ap-stage-text small { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.6; }
.ap-stage-text b { font-size: 1.6rem; line-height: 1.1; }
.ap-stage-text span { font-size: 0.82rem; opacity: 0.7; }
.ap-tabs { display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px; border-radius: 999px; background: color-mix(in srgb, var(--on-surface) 8%, transparent); }
.ap-tab { padding: 7px 16px; border: none; border-radius: 999px; background: transparent; color: color-mix(in srgb, var(--on-surface) 70%, transparent); font: 700 0.84rem var(--font-main); cursor: pointer; transition: background 0.2s ease, color 0.2s ease; }
.ap-tab.is-on { background: var(--on-surface); color: var(--background); }
.ap-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; }
.ap-swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; border: none; background: none; color: var(--on-surface); font: 600 0.74rem var(--font-main); cursor: pointer; min-width: 0; }
.ap-swatch[hidden] { display: none; }
.ap-swatch-dot { position: relative; width: 54px; height: 54px; border-radius: 50%; background: var(--sw-bg); border: 1px solid color-mix(in srgb, var(--on-surface) 16%, transparent); overflow: hidden; box-shadow: 0 0 0 0 var(--accent-primary); transition: box-shadow 0.25s ease, transform 0.25s var(--os-spring, ease); }
.ap-swatch-dot i { position: absolute; inset: 50% 0 0 0; background: var(--sw-surface); }
.ap-swatch-dot b { position: absolute; right: 9px; bottom: 9px; width: 18px; height: 18px; border-radius: 50%; background: var(--sw-accent); }
.ap-swatch.active .ap-swatch-dot { box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--on-surface); }
.ap-swatch.active .ap-swatch-name { font-weight: 800; }
.ap-swatch-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.85; }
.ap-surfaces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ap-surface-option { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 20px; border: 2px solid color-mix(in srgb, var(--on-surface) 10%, transparent); background: color-mix(in srgb, var(--on-surface) 4%, transparent); color: var(--on-surface); font-family: var(--font-main); text-align: center; cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.ap-surface-option.is-on { border-color: var(--accent-primary); background: color-mix(in srgb, var(--accent-primary) 10%, transparent); }
.ap-surf-name { font-size: 0.8rem; font-weight: 700; line-height: 1.2; }
.ap-surface-option small { font-size: 0.68rem; opacity: 0.6; }
.ap-surf-art { position: relative; width: 58px; height: 44px; margin-bottom: 4px; border-radius: 10px; background: linear-gradient(135deg, #f97316, #8b5cf6 55%, #0ea5e9); overflow: hidden; }
.ap-surf-art i, .ap-surf-art b { position: absolute; border-radius: 6px; }
.ap-surf-art i { left: 6px; right: 6px; top: 6px; height: 12px; }
.ap-surf-art b { left: 10px; right: 10px; bottom: 6px; height: 16px; }
.ap-surf-solid i, .ap-surf-solid b { background: var(--surface-color, #1b1f27); }
.ap-surf-overlays i { background: var(--surface-color, #1b1f27); }
.ap-surf-overlays b, .ap-surf-everywhere i, .ap-surf-everywhere b { background: rgba(255, 255, 255, 0.28); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border: 1px solid rgba(255, 255, 255, 0.35); }
.ap-note { margin: 0; font-size: 0.78rem; opacity: 0.6; }
.ap-wall { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.ap-wall-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-btn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--on-surface) 14%, transparent); background: color-mix(in srgb, var(--on-surface) 6%, transparent); color: var(--on-surface); font: 700 0.85rem var(--font-main); cursor: pointer; }
.ap-btn--ink { background: var(--on-surface); color: var(--background); border-color: transparent; }
.ap-btn--danger { color: var(--error, #e5534b); border-color: color-mix(in srgb, var(--error, #e5534b) 40%, transparent); background: transparent; }
.ap-blur { padding: 4px 2px 0; }
.ap-blur-head { display: flex; justify-content: space-between; font-size: 0.84rem; margin-bottom: 6px; }
.ap-blur input { width: 100%; }

@keyframes apSwap { from { opacity: 0.4; transform: scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    :root:not(.no-animations) body:not(.no-animations) .ap-stage { animation: osRise 0.45s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .ap-stage.is-swap .ap-phone { animation: apSwap 0.4s var(--os-spring, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .ap-stage.is-swap .ap-stage-text b { animation: osRise 0.35s var(--os-ease-out, ease) both; }
    :root:not(.no-animations) body:not(.no-animations) .ap-swatch { animation: osPop 0.4s var(--os-spring, ease) both; animation-delay: calc(var(--i, 0) * 14ms + 80ms); }
    :root:not(.no-animations) body:not(.no-animations) .ap-swatches.is-swap .ap-swatch { animation: osPop 0.35s var(--os-spring, ease) both; animation-delay: 0ms; }
    :root:not(.no-animations) body:not(.no-animations) .ap-swatch:active .ap-swatch-dot { transform: scale(0.9); }
    :root:not(.no-animations) body:not(.no-animations) .ap-swatch.active .ap-swatch-dot { transform: scale(1.04); }
    :root:not(.no-animations) body:not(.no-animations) .ap-surface-option:active { transform: scale(0.96); transition: transform 0.12s ease; }
    :root:not(.no-animations) body:not(.no-animations) .ap-surface-option.is-on .ap-surf-art { animation: osPop 0.4s var(--os-spring, ease) both; }
}
/* The swatches keep .theme-card (Settings saves through it), not its old box look. */
.settings-v3 .ap-swatches .ap-swatch.theme-card,
.ap-swatches .ap-swatch.theme-card { padding: 4px 0 0 !important; border: none !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; min-height: 0 !important; aspect-ratio: auto !important; outline: none; }
.ap-swatches .ap-swatch.theme-card::before, .ap-swatches .ap-swatch.theme-card::after { display: none !important; }
.ap-swatches .ap-swatch:focus-visible .ap-swatch-dot { box-shadow: 0 0 0 3px var(--background), 0 0 0 5px var(--accent-primary); }
/* Setup's look step uses the same swatches (still .setup-theme for its handler). */
.ap-swatches .ap-swatch.setup-theme { padding: 4px 0 0 !important; border: none !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; }
.setup-stage { margin-bottom: 2px; }

/* Software update: an "Important" release note section stands out. */
.sw-note-group.is-important { border-color: color-mix(in srgb, #f59e0b 55%, transparent) !important; background: color-mix(in srgb, #f59e0b 9%, var(--ok-card, var(--surface-color))) !important; }
.sw-note-group.is-important .sw-note-head .ok-row-title { color: color-mix(in srgb, #f59e0b 70%, var(--on-surface)); }

/* What's new: an Important card (like the Terminal going away). */
#whatsnew .wn-important { display: inline-flex; align-items: center; gap: 6px; align-self: center; margin-bottom: 6px; padding: 5px 12px; border-radius: 999px; background: color-mix(in srgb, #f59e0b 22%, transparent); color: #fbbf24; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
html:is(.theme-solar-flare, .theme-arctic, .theme-paper, .theme-blossom, .theme-sage) #whatsnew .wn-important { color: #b45309; }
@media (prefers-reduced-motion: no-preference) {
    :root:not(.no-animations) body:not(.no-animations) #whatsnew .wn-card.is-current .wn-important { animation: osPop 0.5s var(--os-spring, ease) 0.15s both; }
}
