/* Agency Phone - iPhone-Style Stylesheet */
/* (c) Agency Scripts - All Rights Reserved */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: transparent;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.hidden {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════
   THEME VARIABLES (Light Mode Default)
   ═══════════════════════════════════════════════════════ */

/* Override standard phone shell when Light Mode is active, ensuring the Hardware border remains pitch black. */
html[data-theme="light"] #phone-frame {
    /* Keep hardware exterior pitch black regardless of screen color */
    background: #000;
    box-shadow: 0 0 0 14px #000, 0 0 0 16px #333;
}

html[data-theme="light"] {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5ea;
    --bg-grouped: #f2f2f7;
    --bg-elevated: #ffffff;
    --text-primary: #000000;
    --text-secondary: #3c3c43;
    --text-tertiary: #8e8e93;
    --text-quaternary: #c7c7cc;
    --separator: rgba(60, 60, 67, 0.12);
    --fill-primary: rgba(120, 120, 128, 0.2);
    --fill-secondary: rgba(120, 120, 128, 0.16);
    --fill-tertiary: rgba(120, 120, 128, 0.12);
    --header-bg: rgba(242, 242, 247, 0.78);
    --header-border: rgba(60, 60, 67, 0.12);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(60, 60, 67, 0.08);
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    --input-bg: rgba(120, 120, 128, 0.12);
    --app-screen-bg: #f2f2f7;
    --frame-bg: #f2f2f7;
    --island-bg: #000;
    --home-clock-color: #000;
    --home-date-color: rgba(0, 0, 0, 0.5);
    --label-color: rgba(0, 0, 0, 0.7);
    --icon-label-color: rgba(0, 0, 0, 0.8);
    --badge-border: #f2f2f7;
    --modal-bg: rgba(242, 242, 247, 0.95);
    --modal-text: #000;
    --empty-state-color: rgba(0, 0, 0, 0.3);
    --toggle-bg: #e9e9eb;
    --toggle-active: #34c759;
    --store-item-bg: #ffffff;
    --notif-bg: rgba(255, 255, 255, 0.95);
    --notif-text: #000;
    --calc-bg: #f2f2f7;
    --calc-btn-bg: #ffffff;
    --calc-btn-color: #000;
    --calc-func-bg: #d1d1d6;
    --calc-func-color: #000;
}

#phone-frame {
    --bg-primary: #f2f2f7;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5ea;
    --bg-grouped: #f2f2f7;
    --bg-elevated: #ffffff;
    --text-primary: #000000;
    --text-secondary: #3c3c43;
    --text-tertiary: #8e8e93;
    --text-quaternary: #c7c7cc;
    --separator: rgba(60, 60, 67, 0.12);
    --fill-primary: rgba(120, 120, 128, 0.2);
    --fill-secondary: rgba(120, 120, 128, 0.16);
    --fill-tertiary: rgba(120, 120, 128, 0.12);
    --header-bg: rgba(242, 242, 247, 0.78);
    --header-border: rgba(60, 60, 67, 0.12);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(60, 60, 67, 0.08);
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0.3) 100%);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    --input-bg: rgba(120, 120, 128, 0.12);
    --app-screen-bg: #f2f2f7;
    --frame-bg: #f2f2f7;
    --island-bg: #000;
    --home-clock-color: #000;
    --home-date-color: rgba(0, 0, 0, 0.5);
    --label-color: rgba(0, 0, 0, 0.7);
    --icon-label-color: rgba(0, 0, 0, 0.8);
    --badge-border: #f2f2f7;
    --modal-bg: rgba(242, 242, 247, 0.95);
    --modal-text: #000;
    --empty-state-color: rgba(0, 0, 0, 0.3);
    --toggle-bg: #e9e9eb;
    --toggle-active: #34c759;
    --store-item-bg: #ffffff;
    --notif-bg: rgba(255, 255, 255, 0.95);
    --notif-text: #000;
    --calc-bg: #f2f2f7;
    --calc-btn-bg: #ffffff;
    --calc-btn-color: #000;
    --calc-func-bg: #d1d1d6;
    --calc-func-color: #000;
}

/* Dark Mode Overrides */
#phone-frame.dark-mode {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --bg-grouped: #000000;
    --bg-elevated: #1c1c1e;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.4);
    --text-quaternary: rgba(255, 255, 255, 0.2);
    --separator: rgba(255, 255, 255, 0.08);
    --fill-primary: rgba(255, 255, 255, 0.12);
    --fill-secondary: rgba(255, 255, 255, 0.08);
    --fill-tertiary: rgba(118, 118, 128, 0.24);
    --header-bg: rgba(28, 28, 30, 0.72);
    --header-border: rgba(255, 255, 255, 0.1);
    --card-bg: rgba(28, 28, 30, 0.65);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-bg: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);
    --glass-border: 0.5px solid rgba(255, 255, 255, 0.12);
    --glass-shadow: 0 2px 12px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    --input-bg: rgba(255, 255, 255, 0.06);
    --app-screen-bg: #000000;
    --frame-bg: #000000;
    --island-bg: #000;
    --home-clock-color: #fff;
    --home-date-color: rgba(255, 255, 255, 0.6);
    --label-color: rgba(255, 255, 255, 0.7);
    --icon-label-color: rgba(255, 255, 255, 0.85);
    --badge-border: #000;
    --modal-bg: rgba(44, 44, 46, 0.95);
    --modal-text: #fff;
    --empty-state-color: rgba(255, 255, 255, 0.3);
    --toggle-bg: #39393d;
    --toggle-active: #34c759;
    --store-item-bg: #1c1c1e;
    --notif-bg: rgba(44, 44, 46, 0.95);
    --notif-text: #fff;
    --calc-bg: #000;
    --calc-btn-bg: rgba(255, 255, 255, 0.12);
    --calc-btn-color: #fff;
    --calc-func-bg: rgba(255, 255, 255, 0.2);
    --calc-func-color: #fff;
}

/* ═══════════════════════════════════════════════════════
   PHONE CONTAINER & FRAME (iPhone style)
   ═══════════════════════════════════════════════════════ */

#phone-container {
    --phone-scale: 1;
    --phone-pos-x: 0px;
    --phone-pos-y: 0px;

    position: fixed;
    right: calc(2.5vw + var(--phone-pos-x));
    bottom: calc(2.5vh + var(--phone-pos-y));
    z-index: 9999;
    transform: translateY(120%) scale(0.9);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.3s ease,
        right 0.3s ease,
        bottom 0.3s ease;
    will-change: transform, opacity;
}

#phone-container.visible {
    transform: translateY(0) scale(var(--phone-scale));
    opacity: 1;
}

/* Notification peek: phone slides up partially when notification arrives while closed */
#phone-container.peek {
    transform: translateY(82%) scale(var(--phone-scale, 1));
    opacity: 1;
    pointer-events: none;
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
}

#phone-container.peek.visible {
    transform: translateY(0) scale(var(--phone-scale, 1));
    pointer-events: auto;
}

#phone-frame {
    width: 380px;
    height: 780px;
    background: var(--frame-bg);
    background-clip: padding-box;
    border-radius: 52px;
    border: 3px solid #2a2a2e;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1.5px #1a1a1d,
        0 0 0 4.5px #3a3a40,
        0 0 0 5.5px #222225,
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 80px rgba(0, 0, 0, 0.3);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
    top: -24px;
}

/* Hardware Exterior Buttons */
.hw-btn {
    position: absolute;
    background: linear-gradient(90deg, #111 0%, #333 50%, #111 100%);
    box-shadow:
        inset 1px 0 2px rgba(255, 255, 255, 0.5),
        inset -1px 0 3px rgba(0, 0, 0, 0.9),
        -2px 0 4px rgba(0, 0, 0, 0.8),
        -4px 0 8px rgba(0, 0, 0, 0.4);
    border-radius: 4px;
    z-index: 10;
    transition: transform 0.1s ease, width 0.1s ease, left 0.1s ease, right 0.1s ease;
    cursor: pointer;
}

.hw-btn:active {
    transform: scaleX(0.5);
}

.hw-btn-action {
    width: 6px;
    height: 35px;
    left: -6px;
    top: 140px;
    background: linear-gradient(90deg, #aa1111 0%, #ff3b30 50%, #aa1111 100%);
    box-shadow:
        inset 1px 0 2px rgba(255, 200, 200, 0.6),
        inset -1px 0 2px rgba(0, 0, 0, 0.9),
        -2px 0 5px rgba(255, 59, 48, 0.4),
        -4px 0 8px rgba(0, 0, 0, 0.5);
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.hw-btn-action.silent {
    background: linear-gradient(90deg, #111 0%, #333 50%, #111 100%);
    box-shadow:
        inset 1px 0 2px rgba(255, 255, 255, 0.5),
        inset -1px 0 3px rgba(0, 0, 0, 0.9),
        -2px 0 4px rgba(0, 0, 0, 0.8),
        -4px 0 8px rgba(0, 0, 0, 0.4);
}

.hw-btn-vol-up {
    width: 6px;
    height: 55px;
    left: -6px;
    top: 200px;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.hw-btn-vol-down {
    width: 6px;
    height: 55px;
    left: -6px;
    top: 270px;
    border-top-left-radius: 3px;
    border-bottom-left-radius: 3px;
}

.hw-btn-power {
    width: 6px;
    height: 85px;
    right: -6px;
    top: 220px;
    box-shadow:
        inset -1px 0 2px rgba(255, 255, 255, 0.5),
        inset 1px 0 3px rgba(0, 0, 0, 0.9),
        2px 0 4px rgba(0, 0, 0, 0.8),
        4px 0 8px rgba(0, 0, 0, 0.4);
    transform-origin: left;
    border-top-right-radius: 3px;
    border-bottom-right-radius: 3px;
}

#hw-volume-hud {
    position: absolute;
    left: 10px;
    top: 200px;
    width: 6px;
    height: 125px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 4px;
    z-index: 900;
    overflow: hidden;
    transform: translateX(-20px) translateZ(0);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s ease, width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none;
    will-change: transform, width, opacity;
}

#hw-volume-hud.visible {
    transform: translateX(0) translateZ(0);
    opacity: 1;
}

#hw-volume-hud.active-drag {
    width: 14px;
    border-radius: 7px;
}

#hw-volume-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    border-radius: 4px;
    transition: height 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    will-change: height;
}

/* Light mode frame overrides */
#phone-frame:not(.dark-mode) {
    border-color: #2a2a2e;
    /* Force grey hardware bezel even in light mode */
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1.5px #1a1a1d,
        0 0 0 4.5px #3a3a40,
        0 0 0 5.5px #222225,
        inset 0 0 0 1px rgba(0, 0, 0, 0.04),
        0 0 80px rgba(0, 0, 0, 0.08);
}

/* Siri-like purple gradient border when AgencyAI is active */
#phone-frame.siri-active-border {
    border-color: transparent;
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.6),
        0 0 0 3px rgba(88, 86, 214, 0.7),
        0 0 30px rgba(175, 82, 222, 0.4),
        0 0 0 5px #222225,
        inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

#phone-frame.siri-active-border:not(.dark-mode) {
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.12),
        0 0 0 3px rgba(88, 86, 214, 0.6),
        0 0 30px rgba(175, 82, 222, 0.25),
        0 0 0 5px #d0d0d4,
        inset 0 0 0 1px rgba(88, 86, 214, 0.1);
}

@keyframes siriBorderPulse {

    0%,
    100% {
        box-shadow:
            0 25px 60px rgba(0, 0, 0, 0.6),
            0 0 0 3px rgba(88, 86, 214, 0.7),
            0 0 30px rgba(175, 82, 222, 0.4),
            0 0 60px rgba(88, 86, 214, 0.2),
            inset 0 0 0 1px rgba(175, 82, 222, 0.15);
    }

    33% {
        box-shadow:
            0 25px 60px rgba(0, 0, 0, 0.6),
            0 0 0 3px rgba(175, 82, 222, 0.8),
            0 0 35px rgba(88, 86, 214, 0.5),
            0 0 70px rgba(175, 82, 222, 0.25),
            inset 0 0 0 1px rgba(88, 86, 214, 0.2);
    }

    66% {
        box-shadow:
            0 25px 60px rgba(0, 0, 0, 0.6),
            0 0 0 3px rgba(125, 84, 228, 0.75),
            0 0 25px rgba(175, 82, 222, 0.35),
            0 0 55px rgba(88, 86, 214, 0.15),
            inset 0 0 0 1px rgba(125, 84, 228, 0.15);
    }
}

/* ═══════════════════════════════════════════════════════
   DYNAMIC ISLAND (top notch area)
   ═══════════════════════════════════════════════════════ */

#dynamic-island {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 36px;
    background: #000;
    border-radius: 24px;
    z-index: 600;
    transition: width 0.5s cubic-bezier(0.32, 0.72, 0, 1),
        height 0.5s cubic-bezier(0.32, 0.72, 0, 1),
        background 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Camera Lens (realistic) */
.di-camera {
    position: absolute;
    left: 32px;
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

.di-camera-lens {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #050a12;
    box-shadow: none;
}

.di-camera-ring {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(10, 10, 18, 0.8);
}

/* IR Sensor & Dot Projector */
.di-sensor {
    position: absolute;
    border-radius: 50%;
    transition: opacity 0.25s ease;
}

.di-sensor-ir {
    right: 38px;
    width: 5px;
    height: 5px;
    background: radial-gradient(circle, #1a1025, #0d0816);
    box-shadow: 0 0 0 1px rgba(40, 20, 60, 0.4);
}

.di-sensor-dot {
    right: 28px;
    width: 4px;
    height: 4px;
    background: #0a0a12;
    box-shadow: 0 0 0 0.5px rgba(30, 30, 50, 0.5);
}

/* Face ID Border Animation (SVG path around island) */
.di-faceid-border {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 126px;
    height: 36px;
    pointer-events: none;
    z-index: 601;
    /* Set higher than dynamic island */
    opacity: 0;
    visibility: hidden;
    background: transparent;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.di-faceid-path {
    fill: none;
    stroke-width: 2.5;
    stroke-dasharray: 310;
    stroke-dashoffset: 310;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.di-faceid-border.active {
    opacity: 1;
    visibility: visible;
}

.di-faceid-border.active .di-faceid-path {
    animation: diFaceIdTrace 2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes diFaceIdTrace {
    0% {
        stroke-dashoffset: 310;
        stroke: #34c759;
    }

    80% {
        stroke-dashoffset: 0;
        stroke: #30d158;
    }

    100% {
        stroke-dashoffset: 0;
        stroke: #34c759;
    }
}

.di-faceid-border.success {
    opacity: 1;
}

.di-faceid-border.success .di-faceid-path {
    stroke-dashoffset: 0;
    stroke: #34c759;
    animation: diFaceIdPulse 0.6s ease-in-out;
}

@keyframes diFaceIdPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(52, 199, 89, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 8px rgba(52, 199, 89, 0.8));
    }
}

/* App Info Display (inside expanded island) */
.di-app-info {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
    white-space: nowrap;
}

.di-app-icon {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #fff;
    flex-shrink: 0;
}

.di-app-label {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    letter-spacing: -0.2px;
}

/* App Active State */
#dynamic-island.app-active {
    width: 180px;
    height: 36px;
}

#dynamic-island.app-active .di-app-info {
    opacity: 1;
    transform: scale(1);
}

#dynamic-island.app-active .di-camera,
#dynamic-island.app-active .di-sensor {
    opacity: 0;
    transition: opacity 0.2s ease;
}

/* Call Active State */
#dynamic-island.call-active {
    width: 220px;
    height: 38px;
    background: #0a1a0a;
    animation: diCallPulse 2s ease-in-out infinite;
}

#dynamic-island.call-active .di-camera,
#dynamic-island.call-active .di-sensor {
    opacity: 0;
}

#dynamic-island.call-active .di-call-info {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.di-call-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    pointer-events: none;
}

.di-call-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #34c759;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.di-call-timer {
    color: #34c759;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    flex-grow: 1;
    text-align: center;
}

.di-call-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 18px;
}

.di-call-waveform span {
    display: block;
    width: 3px;
    background: #34c759;
    border-radius: 1.5px;
    animation: diWaveform 1.2s ease-in-out infinite alternate;
}

.di-call-waveform span:nth-child(1) {
    animation-delay: 0.0s;
    height: 8px;
}

.di-call-waveform span:nth-child(2) {
    animation-delay: 0.2s;
    height: 16px;
}

.di-call-waveform span:nth-child(3) {
    animation-delay: 0.4s;
    height: 10px;
}

.di-call-waveform span:nth-child(4) {
    animation-delay: 0.6s;
    height: 18px;
}

.di-call-waveform span:nth-child(5) {
    animation-delay: 0.8s;
    height: 6px;
}

#dynamic-island.music-active {
    width: 180px;
    height: 36px;
}

#dynamic-island.music-active .di-camera,
#dynamic-island.music-active .di-sensor {
    opacity: 0;
}

#dynamic-island.music-active .di-music-info {
    opacity: 1;
    pointer-events: all;
    display: flex;
}

#dynamic-island.music-active.expanded {
    height: 80px;
    border-radius: 36px;
    width: 280px;
}

.di-music-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.di-music-actions {
    display: flex;
    gap: 16px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    width: 0;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    z-index: 50;
}

#dynamic-island.music-active.expanded .di-music-actions {
    opacity: 1;
    pointer-events: auto !important;
    width: 140px;
}

.di-music-cover {
    width: 22px;
    height: 22px;
    min-width: 22px;
    border-radius: 6px;
    background: linear-gradient(135deg, #fc3c44, #f42c6c);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    overflow: hidden;
}

.di-music-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.di-music-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 14px;
    min-width: 18px;
}

.di-music-waveform span {
    display: block;
    width: 3px;
    background: #fc3c44;
    border-radius: 1.5px;
    animation: diWaveform 0.8s ease-in-out infinite alternate;
}

.di-music-waveform span:nth-child(1) {
    animation-delay: 0.0s;
    height: 8px;
}

.di-music-waveform span:nth-child(2) {
    animation-delay: 0.3s;
    height: 14px;
}

.di-music-waveform span:nth-child(3) {
    animation-delay: 0.1s;
    height: 6px;
}

@keyframes diWaveform {
    0% {
        transform: scaleY(0.4);
    }

    100% {
        transform: scaleY(1);
    }
}

@keyframes diCallPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.2);
    }

    50% {
        box-shadow: 0 0 10px 3px rgba(52, 199, 89, 0.1);
    }
}

/* Island collapse animation */
#dynamic-island.collapsing {
    animation: diCollapse 0.4s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes diCollapse {
    0% {
        width: 180px;
    }

    40% {
        width: 116px;
    }

    70% {
        width: 132px;
    }

    100% {
        width: 126px;
    }
}

/* ═══════════════════════════════════════════════════════
   STATUS BAR
   ═══════════════════════════════════════════════════════ */

#status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 30px 6px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    z-index: 500;
    flex-shrink: 0;
    pointer-events: none;
}

#status-icons {
    display: flex;
    gap: 5px;
    font-size: 12px;
    align-items: center;
    color: #fff;
}

#status-icons i {
    opacity: 0.9;
}

html[data-theme="light"] #status-time,
html[data-theme="light"] .status-icons i {
    color: #000 !important;
}

/* ═══════════════════════════════════════════════════════
   SCREEN SYSTEM (smooth iOS transitions)
   ═══════════════════════════════════════════════════════ */

#screen-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    will-change: transform, filter, opacity;
    transform: translateX(100%);
    opacity: 1;
    filter: blur(0px);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        filter 0.35s ease, opacity 0.3s ease;
    pointer-events: none;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    background: var(--app-screen-bg);
    z-index: 10;
    /* Base off-screen layer */
}

/* Apple-style pop/fade down animation when going home */
.screen.app-closing {
    transform: scale(0.80);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

/* Apple-style pop/fade up animation when opening app from home */
.screen.app-opening {
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
    transition: none;
    /* Instant reset before animation starts */
}

.screen.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: blur(0px);
    pointer-events: auto;
    z-index: 20;
    /* Active screen is on top of returning screen elements */
}

.screen.slide-out-left {
    transform: translateX(-25%);
    opacity: 1;
    filter: brightness(0.6);
    pointer-events: none;
    box-shadow: none;
    z-index: 5;
    /* Pushed to the background under the active screen */
}

.screen.slide-out-right {
    transform: translateX(100%);
    opacity: 1;
    pointer-events: none;
    z-index: 30;
    /* Sliding away to the right, stays strictly ABOVE the new active screen */
}

/* Home screen doesn't slide in from right */
#home-screen {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

#home-screen.slide-out-left {
    transform: scale(0.94);
    opacity: 1;
    filter: brightness(0.5);
    pointer-events: none;
}

/* ═══════════════════════════════════════════════════════
   HOME SCREEN
   ═══════════════════════════════════════════════════════ */

#home-screen {
    background: transparent;
    padding: 56px 20px 20px;
    align-items: center;
    overflow-y: auto;
}

#home-screen::-webkit-scrollbar {
    width: 0;
}

#home-clock {
    font-size: 72px;
    font-weight: 200;
    color: var(--home-clock-color);
    letter-spacing: -3px;
    margin-top: 4px;
    line-height: 1;
    transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
    position: relative;
}

/* Edit mode: show delete button on clock */
.editing #home-clock::after {
    content: '\f057';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: -6px;
    right: -10px;
    font-size: 18px;
    color: #ff3b30;
    background: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#home-date {
    font-size: 15px;
    font-weight: 500;
    color: var(--home-date-color);
    margin-top: 4px;
    margin-bottom: 8px;
    transition: opacity 0.3s ease, height 0.3s ease, margin 0.3s ease;
}

/* Home Screen Widgets (now integrated into app grid) */
#home-widgets {
    display: none !important;
}

/* Widget inside app grid - spans 2 columns */
.app-page .hw-widget-grid-item {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.app-page .hw-widget-grid-item .hw-widget {
    flex: none;
    width: 100%;
    min-height: auto;
    max-width: none;
}

.hw-widget {
    border-radius: 18px;
    padding: 12px 14px;
    background: var(--card-bg, #fff);
    border: 0.5px solid var(--card-border, rgba(60, 60, 67, 0.08));
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
    position: relative;
}

.hw-widget:active {
    transform: scale(0.96);
}

/* Small widget (in grid context) */
.hw-widget.hw-small {
    min-height: 80px;
    width: 100%;
}

/* Medium widget (full width) */
.hw-widget.hw-medium {
    min-height: 80px;
    width: 100%;
}

/* Widget grid item wiggle animation */
.hw-widget-grid-item.wiggle {
    animation: appWiggle 0.25s ease-in-out infinite alternate;
}

.hw-widget-grid-item.wiggle:nth-child(even) {
    animation-delay: 0.1s;
    animation-direction: alternate-reverse;
}

.hw-widget-grid-item.drag-over .hw-widget {
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.hw-widget-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.hw-widget-icon {
    font-size: 13px;
    color: var(--text-tertiary);
}

.hw-widget-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hw-widget-value {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.hw-widget-sub {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* Weather widget specific */
.hw-weather-icon {
    font-size: 28px;
    margin-right: 4px;
}

.hw-weather-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Music widget specific */
.hw-music-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hw-music-art {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--fill-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-quaternary);
    overflow: hidden;
    flex-shrink: 0;
}

.hw-music-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hw-music-info {
    min-width: 0;
    flex: 1;
}

.hw-music-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hw-music-artist {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* iPhone-style Dock */
#home-dock {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 18px;
    padding: 16px 12px 14px;
    margin: 6px 4px 10px;
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.dock-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}

.dock-icon:active {
    transform: scale(0.88);
}

.dock-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.dock-icon:active .dock-icon-circle {
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.dock-label {
    font-size: 10px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.2px;
}

#home-os-label {
    margin-top: auto;
    padding: 8px 0 6px;
    font-size: 11px;
    font-weight: 400;
    color: var(--text-quaternary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

#app-pages-container {
    width: 100%;
    overflow: hidden;
    flex: 1;
    position: relative;
    touch-action: pan-y;
}

#app-pages-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    height: 100%;
    will-change: transform;
}

.app-page {
    min-width: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 12px;
    padding: 0 4px;
    align-content: start;
}

#page-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 2px;
}

.page-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.page-dot.active {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.2);
}

#app-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px 12px;
    width: 100%;
    padding: 0 4px;
}

.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform;
    animation: appIconIn 0.4s cubic-bezier(0.32, 0.72, 0, 1) both;
    position: relative;
}

.app-icon:active:not(.wiggle) {
    transform: scale(0.82);
}

@keyframes appIconIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.app-icon-circle {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s;
    margin-bottom: 6px;
    position: relative;
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15);
}

.app-icon-label {
    font-size: 11px;
    font-weight: 500;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), 0 0px 6px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff3b30;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--badge-border);
}

/* Home Screen Edit Mode (wiggle) */
.app-icon.wiggle {
    animation: appWiggle 0.25s ease-in-out infinite alternate;
}

.app-icon.wiggle:nth-child(even) {
    animation-delay: 0.1s;
    animation-direction: alternate-reverse;
}

@keyframes appWiggle {
    0% {
        transform: rotate(-1.5deg) scale(1);
    }

    100% {
        transform: rotate(1.5deg) scale(1);
    }
}

.app-icon .app-delete-btn {
    display: none;
    position: absolute;
    top: -6px;
    left: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(60, 60, 60, 0.9);
    border: none;
    color: #fff;
    font-size: 10px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 5;
    backdrop-filter: blur(8px);
}

.app-icon.wiggle .app-delete-btn {
    display: flex;
}

.app-icon.drag-over .app-icon-circle {
    transform: scale(1.12);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.6), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.app-icon.dragging-source {
    opacity: 0.3 !important;
}

/* Download Progress Ring */
.app-icon-circle .download-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.app-icon-circle .download-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.app-icon-circle .download-ring circle {
    fill: none;
    stroke: rgba(255, 255, 255, 0.9);
    stroke-width: 3;
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.app-icon-circle.downloading {
    position: relative;
}

.app-icon-circle.downloading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 16px;
    animation: downloadDimIn 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@keyframes downloadDimIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.app-icon-circle.download-done {
    animation: downloadBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes downloadBounce {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(0.88);
    }

    50% {
        transform: scale(1.08);
    }

    75% {
        transform: scale(0.96);
    }

    100% {
        transform: scale(1);
    }
}

/* App Download Progress (iOS 26 Style) */
.app-download-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(6px) saturate(180%);
    -webkit-backdrop-filter: blur(6px) saturate(180%);
    border-radius: 16px;
    animation: downloadDimIn 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.app-download-progress svg {
    width: 36px;
    height: 36px;
    transform: rotate(-90deg);
    filter: drop-shadow(0 0 6px rgba(0, 122, 255, 0.4));
}

.download-progress-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 3;
}

.download-progress-ring {
    fill: none;
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 150.8;
    stroke-dashoffset: 150.8;
    transition: stroke-dashoffset 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Pulse glow on the progress ring */
.app-download-progress svg circle.download-progress-ring {
    animation: downloadPulse 2s ease-in-out infinite;
}

@keyframes downloadPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
    }

    50% {
        filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
    }
}

/* ═══════════════════════════════════════════════════════
   GENERIC APP SCREEN
   ═══════════════════════════════════════════════════════ */

.generic-app-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 30px;
    gap: 12px;
}

.generic-app-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.generic-app-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.generic-app-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.5;
    max-width: 260px;
}

#generic-app-body {
    padding: 0 16px 20px;
}

/* ═══════════════════════════════════════════════════════
   AGENCY AI
   ═══════════════════════════════════════════════════════ */

.ai-chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 24px 20px;
    gap: 10px;
}

.ai-welcome.hidden-ai {
    display: none;
}

.ai-avatar-large {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(145deg, #af52de, #5856d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #fff;
    box-shadow: 0 4px 20px rgba(88, 86, 214, 0.4);
    animation: aiGlow 3s ease-in-out infinite;
}

@keyframes aiGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(88, 86, 214, 0.3);
    }

    50% {
        box-shadow: 0 4px 30px rgba(175, 82, 222, 0.5);
    }
}

.ai-welcome-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #af52de, #5856d6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.ai-welcome-sub {
    font-size: 14px;
    color: var(--text-tertiary, rgba(255, 255, 255, 0.5));
    text-align: center;
}

.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
    padding: 0 8px;
}

.ai-suggest-btn {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.12), rgba(88, 86, 214, 0.06));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(175, 82, 222, 0.2);
    border-radius: 18px;
    padding: 8px 14px;
    color: #af52de;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(88, 86, 214, 0.08);
}

.ai-suggest-btn:active {
    background: linear-gradient(135deg, rgba(175, 82, 222, 0.25), rgba(88, 86, 214, 0.15));
    transform: scale(0.95);
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-messages::-webkit-scrollbar {
    width: 0;
}

.ai-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    animation: aiMsgIn 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes aiMsgIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.85), rgba(0, 100, 220, 0.7));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(0, 122, 255, 0.3);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-msg.ai {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
    border-bottom-left-radius: 4px;
}

#phone-frame:not(.dark-mode) .ai-msg.ai {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

/* Light mode: ensure app screens have solid opaque background */
#phone-frame:not(.dark-mode) .app-screen {
    background: var(--app-screen-bg, #f2f2f7);
}

#phone-frame:not(.dark-mode) .app-header {
    background: var(--header-bg, rgba(242, 242, 247, 0.92));
    border-bottom-color: var(--header-border, rgba(60, 60, 67, 0.12));
}

#phone-frame:not(.dark-mode) .app-content {
    background: var(--bg-primary, #f2f2f7);
}

#phone-frame:not(.dark-mode) #home-bar {
    background: #000;
}

#phone-frame:not(.dark-mode) .phone-notification {
    background: rgba(255, 255, 255, 0.92);
    color: #000;
    border-color: rgba(0, 0, 0, 0.08);
}

#phone-frame:not(.dark-mode) .phone-notification .notif-title {
    color: #000;
}

#phone-frame:not(.dark-mode) .phone-notification .notif-text {
    color: rgba(0, 0, 0, 0.6);
}

#phone-frame:not(.dark-mode) .siri-overlay {
    background: rgba(242, 242, 247, 0.85);
}

#phone-frame:not(.dark-mode) .siri-input input {
    background: rgba(0, 0, 0, 0.06);
    color: #000;
    border-color: rgba(0, 0, 0, 0.1);
}

#phone-frame:not(.dark-mode) .siri-input input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.ai-msg.ai.typing {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.4));
}

.ai-typing-dots {
    display: inline-flex;
    gap: 4px;
}

.ai-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-tertiary, rgba(255, 255, 255, 0.4));
    animation: aiDot 1.2s infinite;
}

.ai-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes aiDot {

    0%,
    60%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    30% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.ai-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 30px;
    background: var(--header-bg, rgba(28, 28, 30, 0.85));
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 0.5px solid var(--separator, rgba(255, 255, 255, 0.1));
    flex-shrink: 0;
}

#ai-input {
    flex: 1;
    background: var(--input-bg, rgba(255, 255, 255, 0.06));
    border: 0.5px solid var(--separator, rgba(255, 255, 255, 0.08));
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text-primary, #fff);
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

#ai-input::placeholder {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.3));
}

#ai-send-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(175, 82, 222, 0.8), rgba(88, 86, 214, 0.7));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(175, 82, 222, 0.3);
    box-shadow: 0 2px 8px rgba(88, 86, 214, 0.25);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
    flex-shrink: 0;
}

#ai-send-btn:active {
    transform: scale(0.9);
    opacity: 0.8;
}

/* ═══════════════════════════════════════════════════════
   LIQUID GLASS DESIGN SYSTEM (AgencyOS 26)
   ═══════════════════════════════════════════════════════ */

.glass {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.03) 50%,
            rgba(255, 255, 255, 0.06) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 2px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(255, 255, 255, 0.02);
}

.glass-subtle {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.05) 50%,
            rgba(255, 255, 255, 0.08) 100%);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}

/* ═══════════════════════════════════════════════════════
   APP SCREENS (iOS style)
   ═══════════════════════════════════════════════════════ */

.app-screen {
    background: var(--app-screen-bg);
    margin-top: 0;
}

.app-header {
    padding: 60px 16px 12px;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 0.5px solid var(--header-border);
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
}

.back-btn {
    background: rgba(0, 122, 255, 0.1);
    border: 0.5px solid rgba(0, 122, 255, 0.15);
    border-radius: 18px;
    color: #007aff;
    font-size: 15px;
    cursor: pointer;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    transition: all 0.2s;
    letter-spacing: -0.2px;
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.back-btn:active {
    opacity: 0.6;
    transform: scale(0.95);
    background: rgba(0, 122, 255, 0.18);
}

.app-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-primary);
}

.header-action {
    background: none;
    border: none;
    color: #007aff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.15s;
}

.header-action:active {
    opacity: 0.5;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 18px 50px;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-primary);
}

/* Liquid Glass Card Mixin - used across apps */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 14px;
}

.app-content::-webkit-scrollbar {
    width: 0;
}

/* ═══════════════════════════════════════════════════════
   DIALER
   ═══════════════════════════════════════════════════════ */

#dialer-tabs {
    display: flex;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 2px;
}

.tab-btn {
    flex: 1;
    padding: 6px 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.tab-btn.active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

#dial-number {
    width: 100%;
    text-align: center;
    font-size: 36px;
    font-weight: 300;
    color: #fff;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 0;
    letter-spacing: 2px;
}

#dialpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 8px 20px;
}

.dial-key {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 26px;
    font-weight: 300;
    border-radius: 50%;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.1s;
    will-change: transform;
}

.dial-key:active {
    background: rgba(255, 255, 255, 0.3);
}

#dial-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    margin-top: 12px;
}

#dial-call {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #34c759;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

#dial-call:active {
    transform: scale(0.9);
}

#dial-backspace {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 20px;
    cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   CALL SCREEN
   ═══════════════════════════════════════════════════════ */

#call-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #1c1c1e 0%, #000 100%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 40px;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

#call-screen.visible {
    transform: translateY(0);
}

#call-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

#call-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 12px;
}

#call-name {
    font-size: 28px;
    font-weight: 300;
    color: #fff;
    letter-spacing: -0.5px;
}

#call-number {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5);
}

#call-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
}

#call-timer {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.8);
    font-variant-numeric: tabular-nums;
}

#call-actions {
    display: flex;
    gap: 50px;
    padding-bottom: 20px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.call-btn:active {
    transform: scale(0.88);
}

.call-btn.answer {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.8), rgba(48, 209, 88, 0.6));
    border: 0.5px solid rgba(52, 199, 89, 0.4);
}

.call-btn.end {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.8), rgba(215, 50, 40, 0.6));
    border: 0.5px solid rgba(255, 59, 48, 0.4);
}

/* ═══════════════════════════════════════════════════════
   BUZZ (Messages)
   ═══════════════════════════════════════════════════════ */

#buzz-chat-list {
    display: flex;
    flex-direction: column;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    cursor: pointer;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    transition: opacity 0.15s;
}

.chat-item:active {
    opacity: 0.6;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007aff, #5856d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.chat-info {
    flex: 1;
    min-width: 0;
}

.chat-name {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-preview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

/* Chat View */
#buzz-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

#buzz-messages-container::-webkit-scrollbar {
    width: 0;
}

#buzz-messages {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    justify-content: flex-end;
}

.msg-bubble {
    max-width: 78%;
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.35;
    word-wrap: break-word;
    animation: msgAppear 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes msgAppear {
    from {
        transform: scale(0.9) translateY(6px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.msg-bubble.sent {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.85), rgba(0, 100, 220, 0.7));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(0, 122, 255, 0.3);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-bubble.received {
    align-self: flex-start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
    border-bottom-left-radius: 4px;
}

.msg-time {
    font-size: 10px;
    opacity: 0.5;
    margin-top: 2px;
}

#buzz-input-area {
    display: flex;
    gap: 8px;
    padding: 8px 12px 44px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 0.5px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    align-items: center;
}

#buzz-message-input {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 9px 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    font-family: 'Inter', sans-serif;
}

#buzz-message-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#buzz-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.8), rgba(0, 100, 220, 0.6));
    border: 0.5px solid rgba(0, 122, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s;
}

#buzz-send-btn:active {
    transform: scale(0.88);
}

/* ═══════════════════════════════════════════════════════
   CONTACTS
   ═══════════════════════════════════════════════════════ */

.search-input {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #fff;
    font-size: 15px;
    outline: none;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#contacts-list {
    display: flex;
    flex-direction: column;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: opacity 0.15s;
}

.contact-item:active {
    opacity: 0.6;
}

.contact-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff9500, #ff3b30);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
}

.contact-info {
    flex: 1;
    min-width: 0;
}

.contact-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-color, #000);
}

.contact-number {
    font-size: 13px;
    color: var(--text-muted, rgba(0, 0, 0, 0.5));
    margin-top: 1px;
}

.contact-actions {
    display: flex;
    gap: 12px;
}

.contact-action-btn {
    background: none;
    border: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.15s;
}

.contact-action-btn:active {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════
   CHIRPER
   ═══════════════════════════════════════════════════════ */

#chirper-feed {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.chirp-item {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    padding: 14px;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
}

.chirp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.chirp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #af52de, #5856d6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    font-weight: 600;
    flex-shrink: 0;
}

.chirp-author {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.chirp-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-left: auto;
}

.chirp-message {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.45;
}

.chirp-delete {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
    padding: 2px 8px;
    transition: color 0.15s;
}

.chirp-delete:hover {
    color: #ff3b30;
}

/* ═══════════════════════════════════════════════════════
   POSTBOX (Mail)
   ═══════════════════════════════════════════════════════ */

#mail-list {
    display: flex;
    flex-direction: column;
}

.mail-item {
    padding: 14px 0;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: opacity 0.15s;
}

.mail-item:active {
    opacity: 0.6;
}

.mail-sender {
    font-size: 13px;
    font-weight: 600;
    color: #007aff;
}

.mail-subject {
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    margin-top: 2px;
}

.mail-preview {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mail-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.2);
    margin-top: 4px;
}

.mail-delete-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.2);
    font-size: 12px;
    cursor: pointer;
    float: right;
    padding: 2px 6px;
}

.mail-delete-btn:hover {
    color: #ff3b30;
}

/* ═══════════════════════════════════════════════════════
   WALLET
   ═══════════════════════════════════════════════════════ */

#wallet-balance-card {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.6) 0%, rgba(88, 86, 214, 0.5) 100%);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 28px 24px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow:
        0 8px 32px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

#wallet-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

#wallet-amount {
    font-size: 36px;
    font-weight: 700;
    color: #fff;
    margin-top: 6px;
    letter-spacing: -1px;
}

#wallet-transfer h3 {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 14px;
}

#wallet-transfer input {
    width: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px 16px;
    color: #fff;
    font-size: 15px;
    outline: none;
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
}

#wallet-transfer input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#transfer-btn {
    width: 100%;
    padding: 14px;
    border: 0.5px solid rgba(0, 122, 255, 0.4);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.7), rgba(0, 100, 220, 0.5));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: transform 0.15s;
    font-family: 'Inter', sans-serif;
}

#transfer-btn:active {
    transform: scale(0.98);
}

/* ═══════════════════════════════════════════════════════
   REPORT
   ═══════════════════════════════════════════════════════ */

#report-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 10px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════
   GALLERY
   ═══════════════════════════════════════════════════════ */

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.gallery-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 2px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.gallery-img:active {
    opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════
   APP STORE
   ═══════════════════════════════════════════════════════ */

#appstore-header {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
}

#appstore-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.store-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 14px;
    margin: 0 14px 6px;
    padding: 12px 14px;
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

.store-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.store-info {
    flex: 1;
    min-width: 0;
}

.store-name {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.store-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-btn {
    padding: 6px 18px;
    border: none;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    font-family: 'Inter', sans-serif;
    transition: transform 0.15s;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.store-btn:active {
    transform: scale(0.92);
}

.store-btn.install {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.7), rgba(0, 100, 220, 0.5));
    border: 0.5px solid rgba(0, 122, 255, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

.store-btn.installed,
.store-btn.open {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.7), rgba(0, 100, 220, 0.5));
    border: 0.5px solid rgba(0, 122, 255, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.15);
}

.store-btn.remove {
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.15), rgba(255, 59, 48, 0.08));
    border: 0.5px solid rgba(255, 59, 48, 0.2);
    --app-icon-bg: #8e8e93;
}

/* ═══════════════════════════════════════════════════════
   SETTINGS
   ═══════════════════════════════════════════════════════ */

.settings-group {
    margin-bottom: 16px;
}

.settings-group-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 4px 6px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    background: var(--card-bg);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    cursor: pointer;
    transition: opacity 0.15s;
}

.settings-item:active {
    opacity: 0.7;
}

.settings-item:first-child {
    border-radius: 14px 14px 0 0;
}

.settings-item:last-child {
    border-radius: 0 0 14px 14px;
}

.settings-item:only-child {
    border-radius: 14px;
}

.settings-item+.settings-item {
    border-top: 0.5px solid var(--separator);
}

.settings-label {
    font-size: 15px;
    color: var(--text-primary);
}

.settings-value {
    font-size: 14px;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.settings-value i {
    font-size: 12px;
    color: var(--text-quaternary);
}

/* Settings Wallpaper Grid */
.settings-wallpaper-item {
    padding: 14px !important;
    cursor: default;
}

.settings-wallpaper-item:active {
    opacity: 1 !important;
}

.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}

.wallpaper-option {
    aspect-ratio: 9 / 16;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    position: relative;
}

.wallpaper-option:active {
    transform: scale(0.92);
}

.wallpaper-option.active {
    border-color: #007aff;
}

.wallpaper-option.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #007aff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    color: #fff;
}

/* Custom Wallpaper URL Input - Liquid Glass Style */
.wallpaper-url-section {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wallpaper-url-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.wallpaper-url-input-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wallpaper-url-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 12px;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.3s, background 0.3s;
}

.wallpaper-url-input:focus {
    border-color: rgba(0, 122, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.wallpaper-url-input::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.wallpaper-url-apply {
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #007aff, #5ac8fa);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

.wallpaper-url-apply:active {
    transform: scale(0.95);
    opacity: 0.8;
}

.wallpaper-url-preview {
    margin-top: 10px;
    width: 100%;
    height: 80px;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    display: none;
    position: relative;
    overflow: hidden;
}

.wallpaper-url-preview.visible {
    display: block;
    animation: wallpaperPreviewFade 0.4s ease;
}

@keyframes wallpaperPreviewFade {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.wallpaper-url-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.8);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wallpaper-url-remove:hover {
    background: rgba(255, 59, 48, 0.7);
}

/* Settings Slider Item */
.settings-slider-item {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    cursor: default;
    padding: 14px;
}

.settings-slider-item:active {
    opacity: 1;
}

.settings-slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}

.settings-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.settings-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s;
}

.settings-slider::-moz-range-thumb:active {
    transform: scale(1.1);
}

.settings-slider-value {
    min-width: 50px;
    text-align: right;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Settings Select */
.settings-select {
    background: var(--input-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary);
    border: 0.5px solid var(--separator);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.settings-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════ */

#modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: background 0.3s ease;
    pointer-events: none;
}

#modal-overlay.visible {
    background: rgba(0, 0, 0, 0.5);
    pointer-events: auto;
}

#modal-box {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow:
        0 8px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 24px 20px 18px;
    width: 100%;
    max-width: 260px;
    transform: scale(0.85);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.25s ease;
}

#modal-overlay.visible #modal-box {
    transform: scale(1);
    opacity: 1;
}

#modal-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 14px;
    text-align: center;
}

#modal-body {
    margin-bottom: 18px;
}

#modal-body input {
    width: 100%;
    background: var(--fill-secondary, rgba(255, 255, 255, 0.08));
    border: 0.5px solid var(--separator, rgba(255, 255, 255, 0.15));
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--text-primary, #fff);
    font-size: 15px;
    outline: none;
    margin-bottom: 8px;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

#modal-body input::placeholder {
    color: var(--text-tertiary, rgba(255, 255, 255, 0.35));
}

#modal-actions {
    display: flex;
    gap: 8px;
}

#modal-actions button {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: transform 0.15s;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

#modal-actions button:active {
    transform: scale(0.96);
}

.modal-btn-primary {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.8), rgba(0, 122, 255, 0.6));
    border: 0.5px solid rgba(0, 122, 255, 0.4);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.modal-btn-cancel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
}

/* ═══════════════════════════════════════════════════════
   NOTIFICATIONS
   ═══════════════════════════════════════════════════════ */

#notification-area {
    position: absolute;
    top: 58px;
    left: 10px;
    right: 10px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 6px;
    pointer-events: none;
}

.phone-notification {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.04) 50%,
            rgba(255, 255, 255, 0.07) 100%);
    backdrop-filter: blur(50px) saturate(180%);
    -webkit-backdrop-filter: blur(50px) saturate(180%);
    border-radius: 20px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    transform: translateY(-20px) scale(0.95);
    opacity: 0;
    animation: iosNotifIn 0.4s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.phone-notification.exiting {
    animation: iosNotifOut 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes iosNotifIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes iosNotifOut {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    to {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
}

.notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
}

.notif-content {
    flex: 1;
    min-width: 0;
}

.notif-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.notif-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════
   HOME INDICATOR
   ═══════════════════════════════════════════════════════ */

#home-indicator {
    height: 44px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: transparent;
    touch-action: none;
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    z-index: 9999;
}

/* Show the home bar when inside an app or on the home screen */
#home-indicator.in-app,
#home-indicator.on-home {
    display: flex;
}

/* Hide back buttons on all app screens — only the bottom home bar exits apps. */
.app-screen>.app-header>.back-btn {
    display: none !important;
}

/* Sub-navigation back buttons: higher specificity to override the hide rule */
.app-screen>.app-header>.back-btn.sub-nav-visible {
    display: inline-flex !important;
}

/* Dim on home screen */
#home-indicator.on-home #home-bar {
    opacity: 0.35;
    width: 110px;
}

#home-bar {
    width: 134px;
    height: 5px;
    background: #fff;
    border-radius: 100px;
    opacity: 0.85;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.2);
    transition: width 0.3s cubic-bezier(0.32, 0.72, 0, 1),
        transform 0.3s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.3s ease;
}

/* Subtle float animation when inside an app — mimics iOS dynamic bar */
#home-indicator:not(.on-home) #home-bar {
    animation: homeBarFloat 3s ease-in-out infinite;
}

@keyframes homeBarFloat {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-4px);
    }
}

/* Press feedback */
#home-indicator:active #home-bar {
    width: 90px;
    opacity: 1;
    transform: scaleY(1.2);
}

/* App close animation (shrink + slide up) */
.screen.app-closing {
    animation: appClose 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes appClose {
    0% {
        transform: scale(1);
        opacity: 1;
        border-radius: 0;
    }

    100% {
        transform: scale(0.85);
        opacity: 0;
        border-radius: 20px;
    }
}

/* Swipe visual feedback — bar turns brighter and lifts */
#home-indicator.swiping #home-bar {
    width: 90px;
    opacity: 1;
    background: #fff;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
    transform: translateY(-3px);
    animation: none;
}

/* ═══════════════════════════════════════════════════════
   RECENT CALLS
   ═══════════════════════════════════════════════════════ */

#recents-list {
    display: flex;
    flex-direction: column;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: opacity 0.15s;
}

.recent-item:active {
    opacity: 0.6;
}

.recent-icon {
    font-size: 16px;
    width: 24px;
    text-align: center;
}

.recent-icon.missed {
    color: #ff3b30;
}

.recent-icon.outgoing {
    color: #34c759;
}

.recent-icon.incoming {
    color: #007aff;
}

.recent-info {
    flex: 1;
}

.recent-name {
    font-size: 15px;
    color: #fff;
    font-weight: 500;
}

.recent-time {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════ */

.empty-state {
    text-align: center;
    color: rgba(255, 255, 255, 0.25);
    padding: 40px 20px;
    font-size: 14px;
}

.empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    display: block;
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════════════
   SCROLLBAR & MISC
   ═══════════════════════════════════════════════════════ */

::-webkit-scrollbar {
    width: 0;
}

input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ═══════════════════════════════════════════════════════
   FACE ID OVERLAY
   ═══════════════════════════════════════════════════════ */

#faceid-overlay {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    width: 140px;
    height: auto;
    padding: 42px 16px 14px;
    background: #000;
    border-radius: 32px;
    z-index: 590;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
    transition: opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        transform 0.5s cubic-bezier(0.32, 0.72, 0, 1),
        width 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        border-radius 0.4s cubic-bezier(0.32, 0.72, 0, 1),
        box-shadow 0.5s ease;
}

#faceid-overlay.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
    width: 166px;
    padding: 56px 16px 20px;
    border-radius: 36px;
}

/* Breathing glow during scanning */
#faceid-overlay.scanning {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(52, 199, 89, 0.15),
        0 0 40px rgba(52, 199, 89, 0.08);
    animation: faceidOverlayBreathe 1.6s ease-in-out infinite;
}

@keyframes faceidOverlayBreathe {

    0%,
    100% {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
            0 0 15px rgba(52, 199, 89, 0.1),
            0 0 30px rgba(52, 199, 89, 0.05);
    }

    50% {
        box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
            0 0 25px rgba(52, 199, 89, 0.25),
            0 0 50px rgba(52, 199, 89, 0.12);
    }
}

/* Success state: bright green glow burst and shrink box */
#faceid-overlay.success {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(52, 199, 89, 0.4),
        0 0 60px rgba(52, 199, 89, 0.2);
    width: 120px;
    padding: 30px 16px 16px;
    border-radius: 32px;
}

.faceid-icon-container {
    width: 32px;
    height: 32px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    will-change: transform;
}

.faceid-face {
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

.faceid-bracket {
    position: absolute;
    width: 10px;
    height: 10px;
    border-color: #fff;
    border-style: solid;
    border-width: 0;
    transition: all 0.6s cubic-bezier(0.32, 0.72, 0, 1);
    will-change: transform, border-color, filter;
}

.faceid-bracket.tl {
    top: 0;
    left: 0;
    border-top-width: 2px;
    border-left-width: 2px;
    border-radius: 12px 0 0 0;
}

.faceid-bracket.tr {
    top: 0;
    right: 0;
    border-top-width: 2px;
    border-right-width: 2px;
    border-radius: 0 12px 0 0;
}

.faceid-bracket.bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 2px;
    border-left-width: 2px;
    border-radius: 0 0 0 12px;
}

.faceid-bracket.br {
    bottom: 0;
    right: 0;
    border-bottom-width: 2px;
    border-right-width: 2px;
    border-radius: 0 0 12px 0;
}

/* Scanning: brackets animate inward with breathing + subtle rotation */
#faceid-overlay.scanning .faceid-bracket {
    border-color: #34c759;
    filter: drop-shadow(0 0 3px rgba(52, 199, 89, 0.5));
}

#faceid-overlay.scanning .faceid-bracket.tl {
    animation: faceidBracketTL 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#faceid-overlay.scanning .faceid-bracket.tr {
    animation: faceidBracketTR 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#faceid-overlay.scanning .faceid-bracket.bl {
    animation: faceidBracketBL 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

#faceid-overlay.scanning .faceid-bracket.br {
    animation: faceidBracketBR 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes faceidBracketTL {

    0%,
    100% {
        top: 0;
        left: 0;
    }

    50% {
        top: 3px;
        left: 3px;
    }
}

@keyframes faceidBracketTR {

    0%,
    100% {
        top: 0;
        right: 0;
    }

    50% {
        top: 3px;
        right: 3px;
    }
}

@keyframes faceidBracketBL {

    0%,
    100% {
        bottom: 0;
        left: 0;
    }

    50% {
        bottom: 3px;
        left: 3px;
    }
}

@keyframes faceidBracketBR {

    0%,
    100% {
        bottom: 0;
        right: 0;
    }

    50% {
        bottom: 3px;
        right: 3px;
    }
}

/* Success: brackets snap outward and glow */
#faceid-overlay.success .faceid-bracket {
    display: none;
}

@keyframes faceidBracketSuccess {
    0% {
        filter: drop-shadow(0 0 3px rgba(52, 199, 89, 0.5));
    }

    50% {
        filter: drop-shadow(0 0 12px rgba(52, 199, 89, 1));
    }

    100% {
        filter: drop-shadow(0 0 6px rgba(52, 199, 89, 0.6));
    }
}

/* On success: face features immediately vanish to make room */
#faceid-overlay.success .faceid-bracket {
    display: none;
}

#faceid-overlay.success .faceid-face {
    display: none;
}

#faceid-overlay.success .faceid-checkmark {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 5px;
}

#faceid-overlay.success .faceid-text {
    margin-top: 10px;
}

/* Face elements animate during scan */
#faceid-overlay.scanning .faceid-face {
    animation: faceidFacePulse 2s ease-in-out infinite;
}

@keyframes faceidFacePulse {

    0%,
    100% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.05) rotate(2deg);
    }

    70% {
        transform: scale(0.97) rotate(-1deg);
    }
}

.faceid-eye {
    position: absolute;
    width: 3px;
    height: 5px;
    border: 1.5px solid #fff;
    border-radius: 2px;
    top: 2px;
    transition: border-color 0.4s, height 0.3s, transform 0.3s;
}

.faceid-eye.left {
    left: 2px;
}

.faceid-eye.right {
    right: 2px;
}

/* Eyes blink during scanning */
#faceid-overlay.scanning .faceid-eye {
    border-color: #34c759;
    animation: faceidEyeBlink 2.4s ease-in-out infinite;
}

#faceid-overlay.scanning .faceid-eye.right {
    animation-delay: 0.15s;
}

@keyframes faceidEyeBlink {

    0%,
    40%,
    50%,
    100% {
        height: 5px;
    }

    44%,
    46% {
        height: 1px;
    }
}

.faceid-nose {
    position: absolute;
    width: 1.5px;
    height: 4px;
    background: #fff;
    left: 50%;
    top: 5px;
    transform: translateX(-50%);
    border-radius: 1px;
    transition: background 0.4s;
}

.faceid-nose::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 4px;
    height: 1.5px;
    background: #fff;
    border-radius: 1px;
    transition: background 0.4s;
}

.faceid-mouth {
    position: absolute;
    width: 8px;
    height: 3px;
    border: 1.5px solid #fff;
    border-top: 0;
    border-radius: 0 0 4px 4px;
    bottom: 1px;
    left: 50%;
    transform: translateX(-50%);
    transition: border-color 0.4s, width 0.3s;
}

#faceid-overlay.scanning .faceid-eye {
    border-color: #34c759;
}

#faceid-overlay.scanning .faceid-mouth {
    border-color: #34c759;
    animation: faceidMouthScan 2s ease-in-out infinite;
}

@keyframes faceidMouthScan {

    0%,
    100% {
        width: 8px;
    }

    50% {
        width: 6px;
    }
}

#faceid-overlay.scanning .faceid-nose,
#faceid-overlay.scanning .faceid-nose::after {
    background: #34c759;
}



/* Multi-pass scanline with glow */
.faceid-scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, rgba(52, 199, 89, 0.3) 20%, rgba(52, 199, 89, 0.9) 50%, rgba(52, 199, 89, 0.3) 80%, transparent 100%);
    border-radius: 2px;
    opacity: 0;
    top: 0;
    filter: drop-shadow(0 0 6px rgba(52, 199, 89, 0.6));
}

#faceid-overlay.scanning .faceid-scanline {
    animation: faceidScanMulti 1.6s ease-in-out;
}

@keyframes faceidScanMulti {
    0% {
        top: 0;
        opacity: 0;
    }

    5% {
        opacity: 1;
    }

    48% {
        top: 100%;
        opacity: 0.8;
    }

    52% {
        top: 100%;
        opacity: 0.6;
    }

    55% {
        opacity: 1;
    }

    95% {
        opacity: 0.8;
    }

    100% {
        top: 0;
        opacity: 0;
    }
}

.faceid-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
    font-weight: 500;
    letter-spacing: 0.3px;
    text-align: center;
    transition: color 0.4s, transform 0.3s, opacity 0.3s;
    white-space: nowrap;
}

#faceid-overlay.success .faceid-label {
    color: #34c759;
    animation: faceidLabelSuccess 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

#faceid-overlay.failed .faceid-label {
    color: #ff3b30;
}

@keyframes faceidLabelSuccess {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.faceid-checkmark {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #34c759;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    transform: scale(0) rotate(-90deg);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    margin: 0 auto;
}

/* Show checkmark only on success to fix layout */
#faceid-overlay.success .faceid-checkmark {
    display: flex;
    transform: scale(1) rotate(0deg);
    order: 1;
    margin-top: -10px;
    margin-bottom: 8px;
}

#faceid-overlay.success .faceid-label {
    color: #34c759;
    animation: faceidLabelSuccess 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    order: 2;
}

.faceid-checkmark::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(52, 199, 89, 0.5);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.2s, transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}



#faceid-overlay.success .faceid-checkmark::after {
    opacity: 1;
    transform: scale(1.3);
    animation: faceidRipple 0.35s ease-out forwards;
}

@keyframes faceidRipple {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Face ID: always black pill, all modes (matches Dynamic Island hardware) */

/* ═══════════════════════════════════════════════════════
   SETTINGS TOGGLE SWITCH (iOS style)
   ═══════════════════════════════════════════════════════ */

.ios-toggle {
    position: relative;
    width: 44px;
    height: 26px;
    background: rgba(118, 118, 128, 0.32);
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    flex-shrink: 0;
}

.ios-toggle.active {
    background: #34c759;
}

.ios-toggle::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.ios-toggle.active::after {
    transform: translateX(18px);
}

/* ═══════════════════════════════════════════════════════
   STORE ITEM INSTALL ANIMATION
   ═══════════════════════════════════════════════════════ */

.store-btn.installing {
    position: relative;
    overflow: hidden;
    color: transparent;
    pointer-events: none;
    min-width: 60px;
}

.store-btn-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: #007aff;
    border-radius: 50%;
    animation: btnSpin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes btnSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ═══════════════════════════════════════════════════════
   LOCK SCREEN
   ═══════════════════════════════════════════════════════ */

#lock-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    background-size: cover;
    background-position: center;
    z-index: 250;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 120px;
    gap: 8px;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.3s ease;
}

/* Subtle dark overlay on lock screen for text readability */
#lock-screen::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.1) 40%, rgba(0, 0, 0, 0.3) 100%);
    pointer-events: none;
    z-index: -1;
}

#lock-screen.unlocked {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

#lock-clock {
    font-size: 80px;
    font-weight: 200;
    color: #fff;
    letter-spacing: -4px;
    line-height: 1;
}

#lock-date {
    font-size: 17px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

/* Lock Screen Widgets */
#lock-widgets {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

.lock-widget {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
}

.lock-widget:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.14);
}

.lock-widget i {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
}

#lock-hint {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
}

/* Swipe-up area */
#lock-swipe-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    padding-bottom: 30px;
    cursor: pointer;
    touch-action: none;
}

#lock-swipe-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: lockSwipeBounce 2s ease-in-out infinite;
}

#lock-swi.phone-notification .notif-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.3;
    white-space: pre-wrap;
    word-break: break-word;
}

#lock-swipe-indicator i {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.25);
    line-height: 1;
}

#lock-swipe-indicator i:first-child {
    color: rgba(255, 255, 255, 0.15);
    margin-bottom: -6px;
}

@keyframes lockSwipeBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

#lock-passcode-btn {
    background: none;
    border: none;
    color: #007aff;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 8px 16px;
    margin-top: 12px;
    transition: opacity 0.15s;
}

#lock-passcode-btn:active {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════
   PASSCODE ENTRY (Lock screen + Setup)
   ═══════════════════════════════════════════════════════ */

#passcode-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, #1c1c1e 0%, #000 50%, #1c1c1e 100%);
    z-index: 260;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.32, 0.72, 0, 1);
}

#passcode-screen.visible {
    opacity: 1;
    pointer-events: auto;
}

.passcode-title {
    font-size: 17px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 16px;
}

.passcode-dots {
    display: flex;
    gap: 18px;
    margin-bottom: 32px;
    height: 18px;
}

.passcode-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.passcode-dot.filled {
    background: #fff;
    border-color: #fff;
    transform: scale(1.1);
}

.passcode-dot.error {
    border-color: #ff3b30;
    background: #ff3b30;
    animation: passcodeShake 0.4s ease;
}

@keyframes passcodeShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-8px);
    }

    40% {
        transform: translateX(8px);
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }
}

.passcode-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 240px;
}

.passcode-key {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: 0.5px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    color: #fff;
    font-size: 30px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.passcode-key:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
    transform: scale(0.92);
}

.passcode-key.empty {
    border: none;
    background: none;
    cursor: default;
    visibility: hidden;
}

.passcode-key.backspace {
    border: none;
    background: none;
    font-size: 20px;
    color: rgba(255, 255, 255, 0.5);
}

.passcode-key.backspace:active {
    background: none;
    color: #fff;
}

.passcode-cancel {
    margin-top: 16px;
    background: none;
    border: none;
    color: #007aff;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    padding: 8px 16px;
}

.passcode-cancel:active {
    opacity: 0.5;
}

/* ═══════════════════════════════════════════════════════
   SETUP WIZARD (iPhone first-boot)
   ═══════════════════════════════════════════════════════ */

#setup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f2f2f7;
    z-index: 950;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

#setup-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.setup-step {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 28px 40px;
    gap: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1),
        opacity 0.4s ease;
    pointer-events: none;
}

.setup-step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.setup-step.exit-left {
    opacity: 0;
    transform: translateX(-40%);
    pointer-events: none;
}

.setup-hello {
    font-size: 56px;
    font-weight: 200;
    color: #000;
    letter-spacing: -2px;
    opacity: 0;
    transform: translateY(30px);
    animation: setupFadeUp 1s cubic-bezier(0.32, 0.72, 0, 1) 0.3s forwards;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.setup-hello.cycling {
    animation: none;
    opacity: 1;
    transform: translateY(0);
}

.setup-hello.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}

.setup-hello.fade-in {
    opacity: 1;
    transform: translateY(0);
}

@keyframes setupFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setup-subtitle {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.45);
    text-align: center;
    line-height: 1.5;
    max-width: 260px;
    opacity: 0;
    animation: setupFadeUp 0.8s cubic-bezier(0.32, 0.72, 0, 1) 0.7s forwards;
}

.setup-icon {
    font-size: 64px;
    color: #007aff;
    margin-bottom: 12px;
    opacity: 0;
    animation: setupFadeUp 0.8s cubic-bezier(0.32, 0.72, 0, 1) 0.2s forwards;
}

.setup-icon.green {
    color: #34c759;
}

.setup-icon.purple {
    color: #af52de;
}

.setup-title {
    font-size: 26px;
    font-weight: 600;
    color: #000;
    text-align: center;
    letter-spacing: -0.5px;
}

.setup-desc {
    font-size: 15px;
    color: rgba(0, 0, 0, 0.45);
    text-align: center;
    line-height: 1.5;
    max-width: 270px;
}

.setup-btn {
    width: 100%;
    max-width: 270px;
    padding: 16px;
    border: 0.5px solid rgba(0, 122, 255, 0.4);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.7), rgba(0, 100, 220, 0.5));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    margin-top: 16px;
    transition: transform 0.15s;
    box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.setup-btn:active {
    transform: scale(0.97);
}

.setup-btn.secondary {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
    border: 0.5px solid rgba(0, 0, 0, 0.1);
    color: rgba(0, 0, 0, 0.5);
    margin-top: 8px;
    box-shadow: none;
}

.setup-btn.green {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.7), rgba(48, 209, 88, 0.5));
    border-color: rgba(52, 199, 89, 0.4);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.setup-step-indicator {
    position: absolute;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.step-dot.active {
    background: #007aff;
    width: 24px;
    border-radius: 4px;
}

.setup-passcode-display {
    display: flex;
    gap: 18px;
    margin: 16px 0 20px;
}

.setup-passcode-display .passcode-dot {
    width: 16px;
    height: 16px;
    border-color: rgba(0, 0, 0, 0.3);
}

.setup-passcode-display .passcode-dot.filled {
    background: #000;
    border-color: #000;
}

.setup-dark .setup-passcode-display .passcode-dot {
    border-color: rgba(255, 255, 255, 0.5);
}

.setup-dark .setup-passcode-display .passcode-dot.filled {
    background: #fff;
    border-color: #fff;
}

.setup-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    width: 240px;
}

.setup-numpad .passcode-key {
    width: 70px;
    height: 70px;
    font-size: 30px;
    color: #000;
    border-color: rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.02));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.setup-numpad .passcode-key:active {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.06));
}

.setup-numpad .passcode-key.backspace {
    color: rgba(0, 0, 0, 0.4);
    background: none;
}

.setup-numpad .passcode-key.backspace:active {
    color: #000;
    background: none;
}

.setup-dark .setup-numpad .passcode-key {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.setup-dark .setup-numpad .passcode-key:active {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.1));
}

.setup-dark .setup-numpad .passcode-key.backspace {
    color: rgba(255, 255, 255, 0.5);
    background: none;
}

.setup-dark .setup-numpad .passcode-key.backspace:active {
    color: #fff;
    background: none;
}

.setup-faceid-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.setup-faceid-container .faceid-bracket {
    width: 32px;
    height: 32px;
    border-color: #000;
}

.setup-faceid-container .faceid-face {
    width: 50px;
    height: 50px;
}

.setup-faceid-container .faceid-eye {
    width: 7px;
    height: 14px;
    border-width: 3px;
    top: 6px;
    border-color: #000;
}

.setup-faceid-container .faceid-eye.left {
    left: 8px;
}

.setup-faceid-container .faceid-eye.right {
    right: 8px;
}

.setup-faceid-container .faceid-nose {
    width: 3px;
    height: 14px;
    top: 14px;
    background: #000;
}

.setup-faceid-container .faceid-nose::after {
    width: 12px;
    height: 3px;
    background: #000;
}

.setup-faceid-container .faceid-mouth {
    width: 22px;
    height: 9px;
    border-width: 3px;
    bottom: 3px;
    border-color: #000;
}

.setup-faceid-container .faceid-bracket {
    transition: all 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

.setup-faceid-container .faceid-face {
    transition: all 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

.setup-faceid-container.scanning .faceid-bracket {
    border-color: #34c759;
}

.setup-faceid-container.scanning .faceid-eye,
.setup-faceid-container.scanning .faceid-mouth {
    border-color: #34c759;
    transition: border-color 0.4s ease;
}

.setup-faceid-container.scanning .faceid-nose,
.setup-faceid-container.scanning .faceid-nose::after {
    background: #34c759;
    transition: background 0.4s ease;
}

.setup-faceid-container.scanning .faceid-bracket.tl {
    top: 4px;
    left: 4px;
}

.setup-faceid-container.scanning .faceid-bracket.tr {
    top: 4px;
    right: 4px;
}

.setup-faceid-container.scanning .faceid-bracket.bl {
    bottom: 4px;
    left: 4px;
}

.setup-faceid-container.scanning .faceid-bracket.br {
    bottom: 4px;
    right: 4px;
}

.setup-faceid-container.scanning-pulse {
    animation: setupFaceidPulse 0.8s ease-in-out infinite alternate;
}

@keyframes setupFaceidPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px rgba(52, 199, 89, 0));
    }

    100% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 12px rgba(52, 199, 89, 0.4));
    }
}

.setup-faceid-container.success .faceid-bracket {
    border-color: #34c759;
    border-radius: 8px;
}

.setup-faceid-container.success .faceid-bracket.tl {
    top: 0;
    left: 0;
}

.setup-faceid-container.success .faceid-bracket.tr {
    top: 0;
    right: 0;
}

.setup-faceid-container.success .faceid-bracket.bl {
    bottom: 0;
    left: 0;
}

.setup-faceid-container.success .faceid-bracket.br {
    bottom: 0;
    right: 0;
}

.setup-faceid-container.success .faceid-eye,
.setup-faceid-container.success .faceid-mouth {
    border-color: #34c759;
}

.setup-faceid-container.success .faceid-nose,
.setup-faceid-container.success .faceid-nose::after {
    background: #34c759;
}

.setup-faceid-container.success {
    animation: setupFaceidSuccess 0.6s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

@keyframes setupFaceidSuccess {
    0% {
        transform: scale(1.04);
        filter: drop-shadow(0 0 12px rgba(52, 199, 89, 0.4));
    }

    40% {
        transform: scale(1.12);
        filter: drop-shadow(0 0 24px rgba(52, 199, 89, 0.6));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 16px rgba(52, 199, 89, 0.3));
    }
}

.setup-dark .setup-faceid-container .faceid-bracket {
    border-color: #fff;
}

.setup-dark .setup-faceid-container .faceid-eye {
    border-color: #fff;
}

.setup-dark .setup-faceid-container .faceid-nose {
    background: #fff;
}

.setup-dark .setup-faceid-container .faceid-nose::after {
    background: #fff;
}

.setup-dark .setup-faceid-container .faceid-mouth {
    border-color: #fff;
}

.setup-faceid-container .faceid-scanline {
    height: 3px;
}

.setup-faceid-container.scanning .faceid-scanline {
    animation: faceidScan 1.5s ease-in-out infinite;
}

.setup-success-check {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #34c759;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    transform: scale(0);
    transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1);
    margin-bottom: 16px;
}

.setup-success-check.show {
    transform: scale(1);
}

/* ═══════════════════════════════════════════════════════
   THEME OVERRIDES (applies variables to all elements)
   ═══════════════════════════════════════════════════════ */

/* Settings */
.settings-group-title {
    color: var(--text-tertiary);
}

.settings-item {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
}

.settings-item+.settings-item {
    border-top: 0.5px solid var(--separator);
}

.settings-label {
    color: var(--text-primary);
}

.settings-value {
    color: var(--text-tertiary);
}

.settings-value i {
    color: var(--text-quaternary);
}

.settings-slider {
    background: var(--fill-primary);
}

.settings-slider-value {
    color: var(--text-secondary);
}

.settings-select {
    background: var(--input-bg);
    color: var(--text-primary);
}

.settings-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* iOS Toggle - theme aware */
.ios-toggle {
    background: var(--toggle-bg);
}

.ios-toggle.active {
    background: var(--toggle-active);
}

/* App Store */
#appstore-header {
    color: #fff;
}

/* Dialer */
#dialer-tabs {
    background: var(--fill-secondary);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0.5px solid var(--separator);
}

.tab-btn {
    color: var(--text-tertiary);
}

.tab-btn.active {
    background: var(--card-bg);
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

#dial-number {
    color: var(--text-primary);
}

.dial-key {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
}

.dial-key:active {
    background: var(--fill-primary);
}

#dial-backspace {
    color: var(--text-tertiary);
}

/* Messages / Buzz */
.chat-item {
    border-bottom: 0.5px solid var(--separator);
}

.chat-name {
    color: var(--text-primary);
}

.chat-preview {
    color: var(--text-tertiary);
}

#buzz-input-area {
    background: var(--header-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-top: 0.5px solid var(--header-border);
}

#buzz-message-input {
    background: var(--input-bg);
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
}

#buzz-message-input::placeholder {
    color: var(--text-tertiary);
}

.msg-bubble.received {
    background: var(--fill-secondary);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
}

/* Contacts */
.search-input {
    background: var(--input-bg);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.contact-item {
    border-bottom: 0.5px solid var(--separator);
}

.contact-name {
    color: var(--text-primary);
}

.contact-number {
    color: var(--text-tertiary);
}

/* Chirper */
.chirp-item {
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 0.5px solid var(--separator);
}

.chirp-author {
    color: var(--text-primary);
}

.chirp-time {
    color: var(--text-tertiary);
}

.chirp-message {
    color: var(--text-secondary);
}

.chirp-delete {
    color: var(--text-quaternary);
}

/* Mail */
.mail-item {
    border-bottom: 0.5px solid var(--separator);
}

.mail-subject {
    color: var(--text-primary);
}

.mail-preview {
    color: var(--text-tertiary);
}

.mail-date {
    color: var(--text-quaternary);
}

.mail-delete-btn {
    color: var(--text-quaternary);
}

/* Recent calls */
.recent-item {
    border-bottom: 0.5px solid var(--separator);
}

.recent-name {
    color: var(--text-primary);
}

.recent-number {
    color: var(--text-tertiary);
}

/* Modal */
#modal-box {
    background: var(--modal-bg);
    backdrop-filter: blur(60px) saturate(200%);
    -webkit-backdrop-filter: blur(60px) saturate(200%);
    border: 0.5px solid var(--separator);
}

#modal-title {
    color: var(--text-primary);
}

#modal-body input {
    background: var(--input-bg);
    border: 0.5px solid var(--separator);
    color: var(--text-primary);
}

#modal-body input::placeholder {
    color: var(--text-tertiary);
}

/* Calculator - theme aware */
.calc-container {
    background: var(--calc-bg);
}

.calc-display {
    color: var(--text-primary);
}

.calc-btn {
    background: var(--calc-btn-bg);
    border: 0.5px solid var(--separator);
    color: var(--calc-btn-color);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.calc-btn.func {
    background: var(--calc-func-bg);
    color: var(--calc-func-color);
}

/* Empty states */
.empty-state {
    color: var(--empty-state-color);
}

/* Notifications */
.phone-notification {
    background: var(--notif-bg);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
}

.notif-title {
    color: var(--notif-text, #fff);
}

.notif-text {
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

/* Wallet */
#wallet-amount {
    color: var(--text-primary);
}

#wallet-transfer h3 {
    color: var(--text-primary);
}

.wallet-input {
    background: var(--input-bg);
    border-color: var(--separator);
    color: var(--text-primary);
}

.wallet-input::placeholder {
    color: var(--text-tertiary);
}

/* Notes */
.note-title {
    color: var(--text-primary);
}

.note-preview {
    color: var(--text-tertiary);
}

.note-date {
    color: var(--text-quaternary);
}

.note-item {
    border-bottom: 0.5px solid var(--separator);
}

/* Call Screen */
#call-name {
    color: #fff;
}

/* Contact Input */
.contact-input {
    background: var(--input-bg);
    border-color: var(--separator);
    color: var(--text-primary);
}

.contact-input::placeholder {
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════
   LIGHT MODE: Additional overrides for remaining hardcoded whites
   ═══════════════════════════════════════════════════════ */

#phone-frame:not(.dark-mode) .chat-name {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .chat-preview {
    color: var(--text-tertiary);
}

#phone-frame:not(.dark-mode) .chat-avatar {
    color: #fff;
}

#phone-frame:not(.dark-mode) .tab-btn.active {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .tab-btn {
    color: var(--text-tertiary);
}

#phone-frame:not(.dark-mode) #status-bar {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) #status-icons {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .hw-widget-value {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .hw-music-title {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) #buzz-message-input {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .radio-freq-input {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .msg-bubble.received {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) #appstore-header {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .settings-label {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .settings-group-title {
    color: var(--text-tertiary);
}

/* Appearance Selector (iOS 26 style) */
.appearance-selector {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    justify-content: center;
}

.appearance-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.appearance-preview {
    width: 72px;
    height: 130px;
    border-radius: 16px;
    border: 3px solid transparent;
    transition: border-color 0.3s, transform 0.2s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.appearance-preview:active {
    transform: scale(0.95);
}

.appearance-option.active .appearance-preview {
    border-color: #007aff;
}

.appearance-preview.light-preview {
    background: linear-gradient(180deg, #f2f2f7, #fff);
}

.appearance-preview.light-preview::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 5px;
    background: #000;
    border-radius: 4px;
}

.appearance-preview.light-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.03));
}

.appearance-preview.dark-preview {
    background: linear-gradient(180deg, #1c1c1e, #000);
}

.appearance-preview.dark-preview::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 5px;
    background: #333;
    border-radius: 4px;
}

.appearance-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.appearance-option.active .appearance-label {
    color: #007aff;
    font-weight: 600;
}

/* Home Screen Widget Toggles (Settings) */
.hw-widget-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hw-toggle-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 12px;
    background: var(--fill-tertiary, rgba(118, 118, 128, 0.12));
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.2s;
}

.hw-toggle-item input {
    display: none;
}

.hw-toggle-item:has(input:checked) {
    background: rgba(0, 122, 255, 0.15);
    color: #007aff;
}

.hw-toggle-item i {
    font-size: 14px;
}

/* Lock Clock Style Selector (Settings) */
.lock-clock-styles {
    display: flex;
    gap: 8px;
}

.lock-style-btn {
    flex: 1;
    padding: 10px 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.lock-style-btn.active {
    border-color: #007aff;
    background: rgba(0, 122, 255, 0.1);
    color: #007aff;
}

.appearance-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--text-quaternary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    transition: all 0.2s;
}

.appearance-option.active .appearance-check {
    background: #007aff;
    border-color: #007aff;
    color: #fff;
}

/* Settings Pages (iOS 26 drill-down) */
.settings-page {
    display: none;
    padding: 0;
}

.settings-page.active {
    display: block;
    animation: settingsPageIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

@keyframes settingsPageIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Settings nav item with icon */
.settings-nav-item {
    cursor: pointer;
}

.settings-nav-item:active {
    background: var(--fill-tertiary, rgba(120, 120, 128, 0.12));
}

.settings-nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
    margin-right: 4px;
}

/* Generic App Content */
.generic-app-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 16px;
    text-align: center;
}

.generic-app-icon-large {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.generic-app-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.generic-app-desc {
    font-size: 14px;
    color: var(--text-tertiary);
    line-height: 1.5;
    max-width: 260px;
}

/* ═══════════════════════════════════════════════════════
   LANGUAGE SELECTOR
   ═══════════════════════════════════════════════════════ */

.language-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 4px 0;
}

.language-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 6px;
    border-radius: 12px;
    background: var(--fill-tertiary, rgba(0, 0, 0, 0.04));
    border: 2px solid var(--separator, rgba(0, 0, 0, 0.08));
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary, rgba(0, 0, 0, 0.8));
}

.language-option.active {
    border-color: #007aff;
    background: rgba(0, 122, 255, 0.1);
}

.language-option:active {
    transform: scale(0.95);
}

.lang-flag {
    font-size: 22px;
    line-height: 1;
}

.lang-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary, rgba(0, 0, 0, 0.6));
    text-align: center;
}

.language-option.active .lang-label {
    color: #007aff;
    font-weight: 600;
}

.setup-dark .language-option {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.setup-dark .language-option .lang-label {
    color: rgba(255, 255, 255, 0.7);
}

.setup-dark .language-option.active {
    border-color: #007aff;
    background: rgba(0, 122, 255, 0.2);
}

.setup-dark .language-option.active .lang-label {
    color: #007aff;
}

/* ═══════════════════════════════════════════════════════
   CONTROL CENTER (iOS 26 Style)
   ═══════════════════════════════════════════════════════ */

#cc-swipe-zone {
    position: absolute;
    top: 0;
    right: 20px;
    width: 90px;
    height: 32px;
    z-index: 900;
    cursor: pointer;
}

#control-center {
    position: absolute;
    inset: 0;
    z-index: 800;
    display: none;
    pointer-events: none;
}

#control-center.visible {
    display: block;
    pointer-events: auto;
}

#control-center.closing {
    display: block;
    pointer-events: none;
}

#cc-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(50px) saturate(220%) brightness(0.8);
    -webkit-backdrop-filter: blur(50px) saturate(220%) brightness(0.8);
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1);
}

#control-center.visible #cc-backdrop {
    opacity: 1;
}

#cc-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 48px 12px 16px;
    transform: translateY(-105%);
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#cc-panel::-webkit-scrollbar {
    display: none;
}

#control-center.visible #cc-panel {
    transform: translateY(0);
}

/* Staggered entry animation for CC items - liquid glass cascade */
#control-center.visible .cc-toggle-group {
    animation: ccItemIn 0.5s 0.04s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-music-widget {
    animation: ccItemIn 0.5s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-row {
    animation: ccItemIn 0.5s 0.12s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-slider-row:nth-child(1) {
    animation: ccItemIn 0.5s 0.16s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-slider-row:nth-child(2) {
    animation: ccItemIn 0.5s 0.20s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-slider-row:nth-child(3) {
    animation: ccItemIn 0.5s 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-tile-row {
    animation: ccItemIn 0.5s 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#control-center.visible .cc-utils {
    animation: ccItemIn 0.5s 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes ccItemIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.92);
        filter: blur(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.mu-progress {
    width: 60%;
    height: 4px;
    background: linear-gradient(90deg, #ff2d55, #ff9500);
    border-radius: 2px;
    position: relative;
    box-shadow: 0 0 10px rgba(255, 45, 85, 0.4);
}

.mu-progress-handle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.cc-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    justify-content: space-between;
    min-height: 0;
}

/* Toggle Group (2x2) - Liquid Glass */
.cc-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 18px;
    padding: 8px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cc-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.cc-toggle-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.cc-toggle-icon.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.85), rgba(0, 122, 255, 0.65));
    border-color: rgba(0, 122, 255, 0.3);
    color: #fff;
    box-shadow: 0 2px 16px rgba(0, 122, 255, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: ccTogglePop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

@keyframes ccTogglePop {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
    }
}

/* Airplane mode: orange when active */
#cc-airplane .cc-toggle-icon.active {
    background: linear-gradient(135deg, rgba(255, 149, 0, 0.85), rgba(255, 149, 0, 0.65));
    border-color: rgba(255, 149, 0, 0.3);
    box-shadow: 0 2px 16px rgba(255, 149, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cc-toggle-label {
    font-size: 9px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

/* Music Widget - Liquid Glass */
.cc-music-widget {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 16px;
    padding: 8px 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cc-music-art {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 8px;
    background: rgba(118, 118, 128, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.cc-music-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-music-info {
    flex: 1;
    min-width: 0;
}

.cc-music-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cc-music-artist {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.4);
}

.cc-music-controls {
    display: flex;
    gap: 4px;
}

.cc-music-controls button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
}

.cc-music-controls button:active {
    color: #fff;
}

/* DND / Silent Row */
.cc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cc-tile {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 14px;
    padding: 10px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cc-tile:active {
    background: rgba(255, 255, 255, 0.18);
    transform: scale(0.96);
}

/* Agency Drop tile special styling */
.cc-tile-wide {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 14px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.cc-tile-wide:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.2);
}

.cc-tile-wide.active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.2) 0%, rgba(90, 200, 250, 0.1) 100%);
    border-color: rgba(0, 122, 255, 0.3);
    box-shadow: 0 2px 16px rgba(0, 122, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    animation: ccAirdropActivate 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes ccAirdropActivate {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.03);
        box-shadow: 0 4px 24px rgba(0, 122, 255, 0.35);
    }

    100% {
        transform: scale(1);
    }
}

.cc-tile-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.cc-tile.active .cc-tile-icon {
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.85), rgba(94, 92, 230, 0.65));
    border-color: rgba(94, 92, 230, 0.3);
    color: #fff;
    box-shadow: 0 2px 12px rgba(94, 92, 230, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cc-tile-label {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', sans-serif;
}

/* Sliders - Liquid Glass */
.cc-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: 14px;
    padding: 8px 12px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cc-slider-icon {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    width: 18px;
    text-align: center;
}

.cc-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    outline: none;
}

.cc-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: linear-gradient(180deg, #fff 0%, #e8e8e8 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

/* Bottom Utilities */
.cc-utils {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.cc-util-btn {
    aspect-ratio: 1;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.85);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.cc-util-btn:active {
    transform: scale(0.92);
}

.cc-util-btn.active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.85) 100%);
    border-color: rgba(255, 255, 255, 0.5);
    color: #000;
    box-shadow: 0 2px 16px rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* CC Edit Mode */
#cc-panel.cc-editing .cc-handle {
    background: #007aff;
    width: 60px;
}

#cc-panel.cc-editing .cc-utils {
    outline: 2px dashed rgba(0, 122, 255, 0.4);
    outline-offset: 4px;
    border-radius: 18px;
}

.cc-util-btn.cc-util-disabled {
    opacity: 0.3;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background: rgba(44, 44, 46, 0.3);
}

#cc-panel.cc-editing .cc-util-btn {
    animation: ccWiggle 0.4s ease-in-out infinite alternate;
}

@keyframes ccWiggle {
    0% {
        transform: rotate(-1deg);
    }

    100% {
        transform: rotate(1deg);
    }
}

/* ═══════════════════════════════════════════════════════
   SIRI-LIKE AGENCYAI OVERLAY
   ═══════════════════════════════════════════════════════ */

@keyframes siriPulse {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.6;
    }

    50% {
        transform: translateX(-50%) scale(1.3);
        opacity: 1;
    }
}

@keyframes siriSlideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#siri-overlay.siri-visible {
    display: flex !important;
    animation: siriSlideUp 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
}

#siri-overlay .ai-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 6px;
    word-wrap: break-word;
}

#siri-overlay .ai-msg.user {
    align-self: flex-end;
    background: #007aff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

#siri-overlay .ai-msg.ai {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    border-bottom-left-radius: 4px;
}

/* ═══════════════════════════════════════════════════════════════ */
/* MDT APP STYLES                                                  */
/* ═══════════════════════════════════════════════════════════════ */

.mdt-tabs {
    display: flex;
    background: var(--bg-secondary);
    border-bottom: 0.5px solid var(--separator);
    padding: 0 4px;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.mdt-tab {
    flex: 1;
    padding: 10px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.mdt-tab i {
    font-size: 14px;
}

.mdt-tab.active {
    color: #fff;
    border-bottom-color: #007aff;
}

#app-ems-mdt .mdt-tab.active {
    border-bottom-color: #ff3b30;
}

.mdt-tab-content {
    display: none;
}

.mdt-tab-content.active {
    display: block;
}

.mdt-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 10px;
    border: 0.5px solid var(--separator);
    background: var(--card-bg);
    color: #fff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.mdt-input:focus {
    border-color: #007aff;
}

.mdt-select {
    padding: 8px 12px;
    border-radius: 8px;
    border: 0.5px solid var(--separator);
    background: var(--card-bg);
    color: #fff;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    outline: none;
    cursor: pointer;
}

.mdt-btn-primary {
    padding: 10px 16px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #007aff, #0056cc);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
}

#app-ems-mdt .mdt-btn-primary {
    background: linear-gradient(135deg, #ff3b30, #d63025);
}

.mdt-btn-primary:active {
    opacity: 0.7;
}

.mdt-search-toggle {
    padding: 8px 14px;
    border-radius: 8px;
    border: 0.5px solid var(--separator);
    background: var(--card-bg);
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.mdt-search-toggle.active {
    background: #007aff;
    color: #fff;
    border-color: #007aff;
}

.mdt-card {
    padding: 14px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 0.5px solid var(--separator);
}

.mdt-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.mdt-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
}

.mdt-card-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.mdt-badge-high {
    background: rgba(255, 59, 48, 0.2);
    color: #ff3b30;
}

.mdt-badge-medium {
    background: rgba(255, 149, 0, 0.2);
    color: #ff9500;
}

.mdt-badge-low {
    background: rgba(52, 199, 89, 0.2);
    color: #34c759;
}

.mdt-badge-active {
    background: rgba(0, 122, 255, 0.2);
    color: #007aff;
}

.mdt-card-detail {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
}

.mdt-card-detail i {
    width: 16px;
    text-align: center;
    margin-right: 6px;
    color: rgba(255, 255, 255, 0.3);
}

.mdt-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mdt-card-actions button {
    flex: 1;
    padding: 8px;
    border-radius: 8px;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: opacity 0.2s;
}

.mdt-card-actions button:active {
    opacity: 0.7;
}

.mdt-unit-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--card-bg);
    border: 0.5px solid var(--separator);
}

.mdt-unit-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mdt-unit-info {
    flex: 1;
    min-width: 0;
}

.mdt-unit-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mdt-unit-status {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.mdt-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.mdt-status-available {
    background: #34c759;
}

.mdt-status-busy {
    background: #ff9500;
}

.mdt-status-offline {
    background: #8e8e93;
}

.mdt-status-emergency {
    background: #ff3b30;
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.mdt-protocol-card {
    padding: 14px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 0.5px solid var(--separator);
    border-left: 4px solid #ff3b30;
}

.mdt-protocol-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
}

.mdt-protocol-steps {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.6;
}

.mdt-protocol-steps li {
    margin-bottom: 4px;
}

.mdt-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

.mdt-empty-state i {
    font-size: 40px;
    margin-bottom: 12px;
    display: block;
}

/* Share Sheet slide-up animation */
@keyframes slideUpShare {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}