/* app/phonesys.js: the ringer icon, Settings > Sounds and vibration, the charging
   animation, the low battery card and app shortcuts in the hold menu. */

.status-ringer { display: inline-flex; align-items: center; justify-content: center; opacity: 0.85; color: inherit; }

/* ---------- Sounds and vibration ---------- */
.snd-page { padding-bottom: 40px; }
.snd-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 6px; }
.snd-mode { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px 14px; border-radius: 20px; border: 1.5px solid color-mix(in srgb, var(--on-surface, #fff) 9%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); cursor: pointer; font-family: var(--font-main); text-align: center; }
.snd-mode b { font-size: 0.95rem; }
.snd-mode small { font-size: 0.7rem; line-height: 1.3; color: color-mix(in srgb, var(--on-surface, #fff) 58%, transparent); }
.snd-mode-ico { display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 50%; background: color-mix(in srgb, var(--on-surface, #fff) 8%, transparent); }
.snd-mode.is-on { border-color: var(--accent-primary, #6aa4f5); background: color-mix(in srgb, var(--accent-primary, #6aa4f5) 12%, var(--surface-color, #191d25)); }
.snd-mode.is-on .snd-mode-ico { background: var(--accent-primary, #6aa4f5); color: var(--background, #0b0e13); }
.snd-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px; background: var(--surface-color, #191d25); }
.snd-slide { display: flex; flex-direction: column; gap: 8px; }
.snd-slide > span { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.snd-slide b { flex: 1; }
.snd-slide output { font-weight: 700; color: var(--accent-primary, #6aa4f5); font-variant-numeric: tabular-nums; }
.snd-slide input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 0; background: transparent; }
.snd-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%)); }
.snd-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%)); }
.snd-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); }
.snd-slide input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; border: none; border-radius: 50%; background: #fff; }
.snd-styles { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.snd-styles::-webkit-scrollbar { display: none; }
.snd-style { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px; border: 1.5px solid color-mix(in srgb, var(--on-surface, #fff) 10%, transparent); background: var(--surface-color, #191d25); color: var(--on-surface); font: 600 0.85rem var(--font-main); cursor: pointer; }
.snd-style.is-on { border-color: var(--accent-primary, #6aa4f5); color: var(--accent-primary, #6aa4f5); }
.snd-wave { display: inline-flex; align-items: center; gap: 2px; height: 16px; }
.snd-wave i { width: 3px; height: 40%; border-radius: 2px; background: currentColor; }
.snd-wave i:nth-child(2) { height: 90%; } .snd-wave i:nth-child(3) { height: 60%; } .snd-wave i:nth-child(4) { height: 30%; }
.snd-row { width: 100%; text-align: left; }
.snd-note { margin: 14px 6px 0; font-size: 0.8rem; line-height: 1.45; color: color-mix(in srgb, var(--on-surface, #fff) 55%, transparent); }

/* ---------- Charging ---------- */
.ch-root { position: fixed; inset: 0; z-index: 20020; display: flex; align-items: center; justify-content: center; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0.55), rgba(0,0,0,0.15) 70%); }
.ch-card { position: relative; width: 168px; height: 168px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 50%; background: rgba(10, 14, 20, 0.72); color: #fff; font-family: var(--font-main); box-shadow: 0 20px 60px rgba(0,0,0,0.5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.ch-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ch-track { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 7; }
.ch-fill { fill: none; stroke: #4ade80; stroke-width: 7; stroke-linecap: round; }
.ch-bolt { color: #4ade80; display: inline-flex; }
.ch-pct { font-size: 2rem; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ch-label { font-size: 0.75rem; font-weight: 600; opacity: 0.75; }

/* ---------- Low battery ---------- */
.bt-card { text-align: center; }
.bt-cell { position: relative; display: inline-block; width: 64px; height: 32px; border-radius: 9px; border: 3px solid var(--error, #f87171); box-sizing: border-box; margin: 4px auto 10px; }
.bt-cell::after { content: ''; position: absolute; right: -9px; top: 8px; width: 5px; height: 10px; border-radius: 0 3px 3px 0; background: var(--error, #f87171); }
.bt-cell i { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc((100% - 6px) * var(--l, 20) / 100); min-width: 4px; border-radius: 4px; background: var(--error, #f87171); }

/* ---------- App shortcuts in the hold menu ---------- */
.hs-menu-shortcuts { display: flex; flex-direction: column; gap: 2px; padding: 4px 0 6px; margin-bottom: 4px; border-bottom: 1px solid color-mix(in srgb, var(--on-surface, #fff) 9%, transparent); }
.hs-menu-sc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: none; border-radius: 13px; background: none; color: inherit; text-align: left; cursor: pointer; font-family: var(--font-main); }
.hs-menu-sc:active { background: color-mix(in srgb, var(--on-surface, #fff) 7%, transparent); }
.hs-menu-sc-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 10px; background: color-mix(in srgb, var(--accent-primary, #6aa4f5) 18%, transparent); color: var(--accent-primary, #6aa4f5); }
.hs-menu-sc-text { display: flex; flex-direction: column; min-width: 0; }
.hs-menu-sc-text b { font-size: 0.9rem; font-weight: 600; }
.hs-menu-sc-text small { font-size: 0.74rem; opacity: 0.6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
    :root:not(.no-animations) body:not(.no-animations) .status-ringer { animation: psPop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
    :root:not(.no-animations) body:not(.no-animations) .snd-mode { animation: psRise 0.4s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; animation-delay: calc(var(--i, 0) * 0.05s); transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease; }
    :root:not(.no-animations) body:not(.no-animations) .snd-mode:active, :root:not(.no-animations) body:not(.no-animations) .snd-style:active { transform: scale(0.95); }
    :root:not(.no-animations) body:not(.no-animations) .snd-mode-ico { transition: background-color 0.25s ease, color 0.25s ease; }
    :root:not(.no-animations) body:not(.no-animations) .snd-mode.is-on .snd-mode-ico svg { animation: psRingIt 0.6s ease; }
    :root:not(.no-animations) body:not(.no-animations) .snd-mode[data-mode="vibrate"].is-on .snd-mode-ico svg { animation: psBuzz 0.5s linear; }
    :root:not(.no-animations) body:not(.no-animations) .snd-style { transition: border-color 0.2s ease, color 0.2s ease, transform 0.15s ease; animation: psRise 0.35s ease backwards; animation-delay: calc(var(--i, 0) * 0.04s); }
    :root:not(.no-animations) body:not(.no-animations) .snd-style.is-playing .snd-wave i { animation: psWave 0.5s ease-in-out 2; }
    :root:not(.no-animations) body:not(.no-animations) .snd-style.is-playing .snd-wave i:nth-child(2) { animation-delay: 0.08s; }
    :root:not(.no-animations) body:not(.no-animations) .snd-style.is-playing .snd-wave i:nth-child(3) { animation-delay: 0.16s; }
    :root:not(.no-animations) body:not(.no-animations) .snd-style.is-playing .snd-wave i:nth-child(4) { animation-delay: 0.24s; }
    :root:not(.no-animations) body:not(.no-animations) .ch-root { animation: psFade 0.3s ease both; }
    :root:not(.no-animations) body:not(.no-animations) .ch-root.is-leaving { animation: psFadeOut 0.3s ease forwards; }
    :root:not(.no-animations) body:not(.no-animations) .ch-card { animation: psCharge 0.55s cubic-bezier(0.3, 1.4, 0.5, 1) both; }
    :root:not(.no-animations) body:not(.no-animations) .ch-fill { transition: stroke-dashoffset 1.2s cubic-bezier(0.25, 0.9, 0.3, 1) 0.15s; }
    :root:not(.no-animations) body:not(.no-animations) .ch-bolt { animation: psBolt 1.1s ease-in-out infinite; }
    :root:not(.no-animations) body:not(.no-animations) .ch-card::before { content: ''; position: absolute; inset: -14px; border-radius: 50%; border: 2px solid rgba(74, 222, 128, 0.5); animation: psPulse 1.4s ease-out infinite; }
    :root:not(.no-animations) body:not(.no-animations) .bt-cell i { animation: psLow 1.2s ease-in-out infinite; }
    :root:not(.no-animations) body:not(.no-animations) .bt-low.is-leaving { animation: fadeOut 0.2s ease-in forwards; }
    :root:not(.no-animations) body:not(.no-animations) .hs-menu-sc { animation: psRise 0.3s cubic-bezier(0.2, 0.9, 0.3, 1) backwards; animation-delay: calc(0.04s + var(--i, 0) * 0.04s); transition: background-color 0.15s ease; }
}
@keyframes psPop { 0% { transform: scale(0.4); opacity: 0; } 60% { transform: scale(1.2); opacity: 1; } 100% { transform: scale(1); } }
@keyframes psRise { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes psRingIt { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(18deg); } 40% { transform: rotate(-14deg); } 60% { transform: rotate(9deg); } 80% { transform: rotate(-5deg); } }
@keyframes psBuzz { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-2px); } 40%, 80% { transform: translateX(2px); } }
@keyframes psWave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.8); } }
@keyframes psFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes psFadeOut { to { opacity: 0; } }
@keyframes psCharge { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }
@keyframes psBolt { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.75; } }
@keyframes psPulse { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(1.25); opacity: 0; } }
@keyframes psLow { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
