/* ═══════════════════════════════════════════════════════
   CLOCK APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

.clock-tabs {
    display: flex;
    background: var(--fill-secondary, rgba(255,255,255,0.06));
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.08));
    padding: 8px 12px;
}

.clock-tab {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s;
    font-family: 'Inter', sans-serif;
}

.clock-tab.active {
    color: var(--text-primary, #fff);
    position: relative;
}

.clock-tab.active::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 2px;
    background: #007aff;
    border-radius: 1px;
}

.clock-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.clock-tab-content {
    display: none;
}

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

.clock-digital {
    text-align: center;
    padding: 60px 20px;
}

.clock-digit-time {
    font-size: 72px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    letter-spacing: -3px;
    margin-bottom: 8px;
}

.clock-digit-location {
    font-size: 17px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
}

.stopwatch-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    gap: 40px;
}

.stopwatch-time {
    font-size: 64px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}

.stopwatch-controls {
    display: flex;
    gap: 40px;
}

.stopwatch-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--separator, rgba(255,255,255,0.2));
    background: var(--card-bg, linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04)));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary, #fff);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

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

.timer-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 80px 20px;
    gap: 40px;
}

.timer-time {
    font-size: 64px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
}

.timer-controls {
    display: flex;
    gap: 20px;
}

.timer-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px solid var(--separator, rgba(255,255,255,0.2));
    background: var(--card-bg, linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.04)));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

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

.timer-btn.primary {
    background: linear-gradient(135deg, rgba(52,199,89,0.7), rgba(48,209,88,0.5));
    border-color: rgba(52,199,89,0.4);
}

.alarm-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}

.alarm-time {
    flex: 1;
    font-size: 32px;
    font-weight: 200;
    color: var(--text-primary, #fff);
}

.alarm-label {
    flex: 1;
    font-size: 14px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
}

.alarm-toggle {
    width: 51px;
    height: 31px;
    border-radius: 16px;
    background: var(--fill-primary, rgba(255,255,255,0.2));
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

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

.alarm-toggle::after {
    content: '';
    position: absolute;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.alarm-toggle.active::after {
    transform: translateX(20px);
}

.header-action-btn {
    background: none;
    border: none;
    color: #007aff;
    font-size: 20px;
    cursor: pointer;
    padding: 8px;
    transition: opacity 0.2s;
}

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

.stopwatch-btn.primary {
    background: linear-gradient(135deg, rgba(52,199,89,0.7), rgba(48,209,88,0.5));
    border-color: rgba(52,199,89,0.4);
}

/* ═══════════════════════════════════════════════════════
   CALCULATOR APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

#app-calculator {
    background:
        radial-gradient(120% 85% at 18% 8%, rgba(90, 200, 250, 0.18), transparent 48%),
        radial-gradient(130% 90% at 86% 100%, rgba(175, 82, 222, 0.14), transparent 55%),
        linear-gradient(165deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

#app-calculator .app-header {
    background: transparent;
    border-bottom: 0;
}

.calc-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    margin: -2px 10px 20px;
    padding: 14px 16px 22px;
    border-radius: 32px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(36px) saturate(170%);
    -webkit-backdrop-filter: blur(36px) saturate(170%);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    overflow: hidden;
    position: relative;
}

.calc-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(95% 70% at 12% 8%, rgba(255, 255, 255, 0.16), transparent 55%),
        radial-gradient(120% 90% at 88% 100%, rgba(175, 82, 222, 0.12), transparent 60%);
    pointer-events: none;
}

.calc-display {
    flex: 0 0 auto;
    min-height: 120px;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 18px 16px 12px;
    border-radius: 22px;
    border: 0.5px solid rgba(255, 255, 255, 0.18);
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
    font-size: clamp(40px, 8vw, 62px);
    font-weight: 300;
    color: var(--text-primary);
    letter-spacing: -1.8px;
    font-variant-numeric: tabular-nums;
    overflow: hidden;
    text-align: right;
    word-wrap: break-word;
}

.calc-pad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    grid-auto-rows: minmax(78px, 1fr);
    justify-items: center;
    padding: 14px 0 0;
    flex: 1;
    min-height: 0;
}

.calc-btn {
    width: 100%;
    max-width: 84px;
    border-radius: 999px;
    border: 0.5px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.22),
        0 5px 12px rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    font-size: 31px;
    font-weight: 400;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.2s ease, background 0.2s ease;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    justify-self: center;
    align-self: center;
}

.calc-btn:active {
    transform: scale(0.95);
    filter: brightness(1.06);
}

.calc-btn.func {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.12));
    color: rgba(14, 14, 16, 0.9);
    font-weight: 400;
}

.calc-btn.op {
    background: linear-gradient(145deg, rgba(255, 149, 10, 0.95), rgba(255, 115, 0, 0.75));
    border-color: rgba(255, 185, 93, 0.55);
    color: #fff;
    font-size: 34px;
    font-weight: 500;
}

.calc-btn.zero {
    grid-column: auto;
    justify-content: center;
    padding-left: 0;
}

#phone-frame.dark-mode #app-calculator .calc-container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    border-color: rgba(255, 255, 255, 0.18);
}

#phone-frame.dark-mode #app-calculator .calc-display {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
}

#phone-frame.dark-mode #app-calculator .calc-btn.func {
    color: rgba(255, 255, 255, 0.95);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
}

.radio-app {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 14px;
}

.radio-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 0.5px solid var(--separator);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.radio-card-copy {
    min-width: 0;
    flex: 1;
}

.radio-freq-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.radio-freq-input {
    width: 128px;
    margin-top: 6px;
    padding: 0;
    border: none;
    outline: none;
    background: transparent;
    appearance: textfield;
    -moz-appearance: textfield;
    font-size: 40px;
    font-weight: 250;
    letter-spacing: -1.4px;
    color: var(--text-primary);
    font-family: inherit;
}

.radio-freq-input::-webkit-outer-spin-button,
.radio-freq-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.radio-status {
    align-self: center;
    font-size: 13px;
    font-weight: 700;
}

.radio-status.disconnected {
    color: #ff453a;
}

.radio-status.connected {
    color: #34c759;
}

.radio-status.transmitting {
    color: #ff9f0a;
}

.radio-controls {
    display: flex;
    gap: 10px;
}

.radio-btn {
    flex: 1;
    padding: 14px 12px;
    border-radius: 16px;
    border: 0.5px solid var(--separator);
    background: var(--fill-secondary);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: transform 0.14s ease, filter 0.2s ease, background 0.2s ease;
}

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

.radio-connect-btn {
    flex: 2;
    font-size: 15px;
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.92), rgba(0, 99, 224, 0.76));
    border-color: rgba(10, 132, 255, 0.35);
    color: #fff;
}

.radio-connect-btn.connected {
    background: linear-gradient(135deg, rgba(255, 69, 58, 0.92), rgba(215, 50, 40, 0.78));
    border-color: rgba(255, 69, 58, 0.34);
}

.radio-hint {
    padding-top: 4px;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ═══════════════════════════════════════════════════════
   NOTES APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

#notes-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.note-item {
    background: var(--card-bg, 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 var(--separator, rgba(255,255,255,0.06));
    cursor: pointer;
    transition: opacity 0.15s;
}

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

.note-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.note-preview {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-date {
    font-size: 11px;
    color: var(--text-quaternary, rgba(255,255,255,0.3));
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   WEATHER APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

.weather-current {
    text-align: center;
    padding: 60px 20px;
}

.weather-icon {
    font-size: 80px;
    color: #ffcc00;
    margin-bottom: 20px;
}

.weather-temp {
    font-size: 72px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    letter-spacing: -3px;
    margin-bottom: 8px;
}

.weather-desc {
    font-size: 20px;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    margin-bottom: 4px;
}

.weather-location {
    font-size: 15px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
}

/* ═══════════════════════════════════════════════════════
   APP STORE DETAIL (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

.store-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 30px;
    gap: 12px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.store-detail-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #fff;
    box-shadow:
        0 8px 24px 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);
}

.store-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.store-detail-dev {
    font-size: 14px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
}

.store-detail-actions {
    position: relative;
    bottom: auto;
    z-index: 6;
    padding: 0 20px 18px;
    margin-top: 0;
    background: transparent;
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.store-detail-btn {
    width: 100%;
    min-height: 56px;
    padding: 14px;
    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;
    transition: transform 0.15s;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 4px 16px rgba(0,122,255,0.15), inset 0 1px 0 rgba(255,255,255,0.1);
}

.store-detail-btn.installing {
    min-width: 0;
    padding: 14px 18px !important;
    color: #fff !important;
}

.store-detail-progress-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: inherit;
}

.store-detail-progress-label i {
    font-size: 13px;
    opacity: 0.9;
}

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

.store-detail-btn.installed {
    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.1);
    color: rgba(255,255,255,0.5);
    box-shadow: none;
}

.store-detail-section {
    padding: 20px;
    border-top: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}

.store-detail-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 12px;
}

.store-detail-desc {
    font-size: 14px;
    color: var(--text-secondary, rgba(255,255,255,0.6));
    line-height: 1.6;
}

.store-detail-features {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.store-detail-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary, rgba(255,255,255,0.6));
    line-height: 1.5;
}

.store-detail-feature i {
    color: #007aff;
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════════════
   EMPTY STATE (Universal)
   ═══════════════════════════════════════════════════════ */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    font-size: 14px;
    gap: 12px;
}

.empty-state i {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════
   CRYPTO APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

.crypto-balance {
    background: linear-gradient(135deg, rgba(247,147,26,0.2), rgba(247,147,26,0.05));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    padding: 32px 20px;
    text-align: center;
}

.crypto-balance-label {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.crypto-balance-amount {
    font-size: 40px;
    font-weight: 200;
    color: #f7931a;
    letter-spacing: -1px;
}

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

.crypto-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
    cursor: pointer;
    transition: background 0.15s;
}

.crypto-item:active {
    background: rgba(255,255,255,0.03);
}

.crypto-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

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

.crypto-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: flex;
    align-items: center;
    gap: 6px;
}

.crypto-symbol {
    font-size: 14px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 2px;
}

.crypto-price-info {
    text-align: right;
}

.crypto-price {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.crypto-change {
    font-size: 13px;
    margin-top: 2px;
}

.crypto-change.positive {
    color: #34c759;
}

.crypto-change.negative {
    color: #ff3b30;
}

/* Crypto Detail */
.crypto-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 30px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.crypto-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 12px;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.crypto-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.crypto-detail-symbol {
    font-size: 15px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    text-transform: uppercase;
}

.crypto-detail-price {
    font-size: 36px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    margin-top: 8px;
    letter-spacing: -1px;
}

.crypto-detail-change {
    font-size: 16px;
    font-weight: 500;
    margin-top: 4px;
}

.crypto-detail-change.positive {
    color: #34c759;
}

.crypto-detail-change.negative {
    color: #ff3b30;
}

.crypto-holdings {
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(255,255,255,0.06);
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    text-align: center;
}

.crypto-holdings-label {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    margin-bottom: 8px;
}

.crypto-holdings-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.crypto-holdings-value {
    font-size: 14px;
    color: var(--text-secondary, rgba(255,255,255,0.6));
}

.crypto-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
}

.crypto-action-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.crypto-action-btn.buy {
    background: linear-gradient(135deg, rgba(52,199,89,0.7), rgba(48,209,88,0.5));
    border: 0.5px solid rgba(52,199,89,0.4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,199,89,0.15);
}

.crypto-action-btn.sell {
    background: linear-gradient(135deg, rgba(255,59,48,0.7), rgba(215,50,40,0.5));
    border: 0.5px solid rgba(255,59,48,0.4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,59,48,0.15);
}

.crypto-action-btn:active {
    transform: scale(0.96);
}

/* ═══════════════════════════════════════════════════════
   STOCKS TRADING APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

.stocks-balance {
    background: linear-gradient(135deg, rgba(0,122,255,0.2), rgba(88,86,214,0.05));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    padding: 32px 20px;
    text-align: center;
}

.stocks-balance-label {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stocks-balance-amount {
    font-size: 40px;
    font-weight: 200;
    color: #007aff;
    letter-spacing: -1px;
}

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

.stock-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.15s;
}

.stock-item:active {
    background: rgba(255,255,255,0.03);
}

.stock-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #fff;
}

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

.stock-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #fff);
}

.stock-symbol {
    font-size: 14px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 2px;
}

.stock-price-info {
    text-align: right;
}

.stock-price {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary, #fff);
}

.stock-change {
    font-size: 13px;
    margin-top: 2px;
}

.stock-change.positive {
    color: #34c759;
}

.stock-change.negative {
    color: #ff3b30;
}

.stock-detail-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 30px;
    gap: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, transparent 100%);
}

.stock-detail-icon {
    width: 80px;
    height: 80px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 12px;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    color: #fff;
}

.stock-detail-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.stock-detail-symbol {
    font-size: 15px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    text-transform: uppercase;
}

.stock-detail-price {
    font-size: 36px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    margin-top: 8px;
    letter-spacing: -1px;
}

.stock-detail-change {
    font-size: 16px;
    font-weight: 500;
    margin-top: 4px;
}

.stock-detail-change.positive {
    color: #34c759;
}

.stock-detail-change.negative {
    color: #ff3b30;
}

.stock-holdings {
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid rgba(255,255,255,0.06);
    border-bottom: 0.5px solid rgba(255,255,255,0.06);
    text-align: center;
}

.stock-holdings-label {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    margin-bottom: 8px;
}

.stock-holdings-amount {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-bottom: 4px;
}

.stock-holdings-value {
    font-size: 14px;
    color: var(--text-secondary, rgba(255,255,255,0.6));
}

.stock-actions {
    display: flex;
    gap: 12px;
    padding: 20px;
}

.stock-action-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.stock-action-btn.buy {
    background: linear-gradient(135deg, rgba(52,199,89,0.7), rgba(48,209,88,0.5));
    border: 0.5px solid rgba(52,199,89,0.4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52,199,89,0.15);
}

.stock-action-btn.sell {
    background: linear-gradient(135deg, rgba(255,59,48,0.7), rgba(215,50,40,0.5));
    border: 0.5px solid rgba(255,59,48,0.4);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255,59,48,0.15);
}

.stock-action-btn:active {
    transform: scale(0.96);
}

/* ═══════════════════════════════════════════════════════
   WEATHER APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

#app-weather.screen {
    background: var(--weather-bg, linear-gradient(180deg, #1a8fe3 0%, #47b8e0 35%, #87ceeb 65%, #f7d794 100%)) !important;
}

#app-weather > .app-header {
    background: transparent !important;
    border-bottom: none !important;
}

#app-weather > .app-header .app-title,
#app-weather > .app-header .header-action {
    color: var(--weather-text, #fff);
}

#app-weather > .app-content {
    background: transparent !important;
}

.weather-current {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 12px;
}

.weather-icon {
    font-size: 72px;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 20px rgba(255, 255, 255, 0.2));
}

.weather-temp {
    font-size: 72px;
    font-weight: 200;
    color: var(--text-primary, #fff);
    letter-spacing: -3px;
}

.weather-desc {
    font-size: 20px;
    font-weight: 500;
    color: var(--text-secondary, rgba(255,255,255,0.8));
}

.weather-location {
    font-size: 14px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   WALLET APP (AgencyOS26.3 Style)
   ═══════════════════════════════════════════════════════ */

#wallet-balance-card {
    background: linear-gradient(135deg, rgba(52,199,89,0.2), rgba(48,209,88,0.05));
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 0.5px solid rgba(255,255,255,0.08);
    padding: 40px 20px;
    text-align: center;
}

.wallet-balance-label {
    font-size: 13px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

#wallet-amount {
    font-size: 44px;
    font-weight: 200;
    color: #34c759;
    letter-spacing: -1px;
}

#wallet-transfer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#wallet-transfer input {
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 0.5px solid var(--separator, rgba(255,255,255,0.1));
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    color: var(--text-primary, #fff);
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

#wallet-transfer input:focus {
    border-color: rgba(52,199,89,0.5);
}

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

#transfer-btn {
    background: linear-gradient(135deg, rgba(52,199,89,0.7), rgba(48,209,88,0.5));
    border: 0.5px solid rgba(52,199,89,0.4);
    border-radius: 14px;
    padding: 16px;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

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

/* ═══════════════════════════════════════════════════════
   THEME OVERRIDES FOR APPS
   ═══════════════════════════════════════════════════════ */

/* Notes */
.note-item {
    background: var(--card-bg, rgba(255,255,255,0.05));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}
.note-title { color: var(--text-primary, #fff); }
.note-preview { color: var(--text-tertiary, rgba(255,255,255,0.4)); }
.note-date { color: var(--text-quaternary, rgba(255,255,255,0.3)); }

/* Weather */
.weather-temp { color: var(--text-primary, #fff); }
.weather-desc { color: var(--text-secondary, rgba(255,255,255,0.7)); }
.weather-location { color: var(--text-tertiary, rgba(255,255,255,0.4)); }

/* Crypto */
.crypto-item { border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06)); }
.crypto-item:active { background: var(--fill-secondary, rgba(255,255,255,0.03)); }
.crypto-name { color: var(--text-primary, #fff); }
.crypto-symbol { color: var(--text-tertiary, rgba(255,255,255,0.4)); }
.crypto-price { color: var(--text-primary, #fff); }
.crypto-detail-name { color: var(--text-primary, #fff); }
.crypto-detail-symbol { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
.crypto-detail-price { color: var(--text-primary, #fff); }
.crypto-holdings {
    background: var(--fill-secondary, rgba(255,255,255,0.04));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 0.5px solid var(--separator, rgba(255,255,255,0.06));
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}
.crypto-holdings-label { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
.crypto-holdings-amount { color: var(--text-primary, #fff); }
.crypto-holdings-value { color: var(--text-secondary, rgba(255,255,255,0.6)); }

/* Stocks */
.stock-item { border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06)); }
.stock-item:active { background: var(--fill-secondary, rgba(255,255,255,0.03)); }
.stock-name { color: var(--text-primary, #fff); }
.stock-symbol { color: var(--text-tertiary, rgba(255,255,255,0.4)); }
.stock-price { color: var(--text-primary, #fff); }
.stock-detail-name { color: var(--text-primary, #fff); }
.stock-detail-symbol { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
.stock-detail-price { color: var(--text-primary, #fff); }
.stock-holdings {
    background: var(--fill-secondary, rgba(255,255,255,0.04));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-top: 0.5px solid var(--separator, rgba(255,255,255,0.06));
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}
.stock-holdings-label { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
.stock-holdings-amount { color: var(--text-primary, #fff); }
.stock-holdings-value { color: var(--text-secondary, rgba(255,255,255,0.6)); }

/* Store Detail */
.store-detail-name { color: var(--text-primary, #fff); }
.store-detail-dev { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
.store-detail-section { border-top: 0.5px solid var(--separator, rgba(255,255,255,0.06)); }
.store-detail-section-title { color: var(--text-primary, #fff); }
.store-detail-desc { color: var(--text-secondary, rgba(255,255,255,0.6)); }
.store-detail-feature { color: var(--text-secondary, rgba(255,255,255,0.6)); }

/* Wallet */
.wallet-balance-label { color: var(--text-tertiary, rgba(255,255,255,0.5)); }
#wallet-transfer input {
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 0.5px solid var(--separator, rgba(255,255,255,0.1));
    color: var(--text-primary, #fff);
}
#wallet-transfer input::placeholder { color: var(--text-tertiary, rgba(255,255,255,0.3)); }

/* Clock */
.clock-display { color: var(--text-primary, #fff); }
.alarm-item {
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}
.alarm-time { color: var(--text-primary, #fff); }
.alarm-label { color: var(--text-tertiary, rgba(255,255,255,0.4)); }
.stopwatch-time, .timer-time { color: var(--text-primary, #fff); }

/* Empty State override for apps */
.empty-state { color: var(--empty-state-color, rgba(255,255,255,0.4)); }

/* ═══════════════════════════════════════════════════════════
   VIDFLOW (Video App)
   ═══════════════════════════════════════════════════════════ */

.vf-search-bar {
    display: flex;
    padding: 10px 14px;
    gap: 8px;
    background: var(--bg-secondary, rgba(28,28,30,0.95));
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
    position: relative;
    z-index: 2;
}

.vf-search-bar input {
    flex: 1;
    background: var(--input-bg, var(--fill-tertiary, rgba(118,118,128,0.24)));
    border: none;
    border-radius: 10px;
    padding: 9px 14px;
    color: var(--text-primary, #fff);
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.vf-search-bar input::placeholder {
    color: var(--text-tertiary, rgba(255,255,255,0.4));
}

.vf-search-bar button {
    background: #ff2d55;
    border: none;
    border-radius: 10px;
    width: 38px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.vf-player-wrap {
    background: #000;
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}

.vf-player-wrap.hidden { display: none; }

.vf-player-wrap iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.vf-now-playing {
    padding: 10px 14px;
    background: var(--bg-secondary, rgba(28,28,30,0.95));
}

.vf-np-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vf-np-channel {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 2px;
}

.vf-results {
    padding: 6px 0;
    overflow-y: auto;
}

.vf-video-item {
    display: flex;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.vf-video-item:active { background: var(--fill-tertiary, rgba(118,118,128,0.12)); }

.vf-video-thumb {
    width: 120px;
    min-width: 120px;
    height: 68px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--fill-secondary, rgba(118,118,128,0.24));
}

.vf-video-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

.vf-video-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.vf-video-channel {
    font-size: 11px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
}

.vf-video-views {
    font-size: 11px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
}

/* ═══════════════════════════════════════════════════════════
   MUSIC APP (Agency Music style)
   ═══════════════════════════════════════════════════════════ */

.mu-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 12px 8px;
    margin: 8px 12px 0;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

.mu-tab {
    flex: 1;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    background: transparent;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mu-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 82, 100, 0.94), rgba(175, 82, 222, 0.84));
    box-shadow: 0 12px 24px rgba(252, 60, 68, 0.26);
}

.mu-tab:active {
    transform: scale(0.97);
}

.mu-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.mu-tab-content.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mu-search-bar,
.mu-url-bar {
    display: flex;
    padding: 10px 14px 4px;
    gap: 8px;
}

#app-appstore-detail .app-content {
    padding-bottom: 132px !important;
}

#phone-frame:not(.dark-mode) .store-detail-actions {
    background: transparent;
}

#phone-frame:not(.dark-mode) .store-detail-btn.installed {
    background: linear-gradient(135deg, rgba(20, 20, 24, 0.06), rgba(20, 20, 24, 0.03));
    border-color: rgba(20, 20, 24, 0.08);
    color: var(--text-secondary);
}

#phone-frame:not(.dark-mode) .store-detail-name,
#phone-frame:not(.dark-mode) .store-detail-section-title {
    color: var(--text-primary);
}

#phone-frame:not(.dark-mode) .store-detail-dev,
#phone-frame:not(.dark-mode) .store-detail-desc,
#phone-frame:not(.dark-mode) .store-detail-feature {
    color: var(--text-secondary);
}

.mu-url-bar {
    padding-top: 4px;
    padding-bottom: 10px;
}

.mu-search-bar input,
.mu-url-bar input {
    flex: 1;
    background: var(--fill-tertiary, rgba(118,118,128,0.24));
    border: none;
    border-radius: 14px;
    padding: 11px 14px;
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

.mu-search-bar button,
.mu-url-bar button {
    background: linear-gradient(135deg, #ff5469, #ff7a45);
    border: none;
    border-radius: 14px;
    width: 42px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 10px 18px rgba(255, 84, 105, 0.24);
}

.mu-song-list {
    padding: 4px 0 24px;
}

.mu-song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.mu-song-item:active {
    background: var(--fill-tertiary, rgba(118,118,128,0.12));
}

.mu-song-item + .mu-song-item {
    border-top: 0.5px solid var(--separator, rgba(255,255,255,0.04));
}

.mu-song-thumb {
    width: 50px;
    height: 50px;
    min-width: 50px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--fill-secondary, rgba(118,118,128,0.24));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

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

.mu-song-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mu-song-artist {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mu-song-actions {
    display: flex;
    gap: 6px;
}

.mu-song-play-btn,
.mu-song-fav-btn {
    background: none;
    border: none;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.mu-song-play-btn:hover {
    color: #fc3c44;
}

.mu-song-fav-btn.active {
    color: #fc3c44;
}

.mu-song-item.now-playing .mu-song-title {
    color: #fc3c44;
}

.mu-song-item.now-playing::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    background: linear-gradient(180deg, #ff5a6d, #af52de);
    border-radius: 0 2px 2px 0;
}

.mu-now-playing {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 0 0 auto;
    min-height: 100%;
    padding: 16px 14px calc(78px + env(safe-area-inset-bottom, 0px));
    overflow: visible;
    isolation: isolate;
}

#mu-tab-playing {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

.mu-now-backdrop {
    position: absolute;
    inset: -10% -8% auto;
    height: 58%;
    background-position: center;
    background-size: cover;
    filter: blur(42px) saturate(140%);
    opacity: 0.24;
    z-index: -3;
    transition: background-image 0.28s ease, opacity 0.28s ease;
}

.mu-now-backdrop::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 11, 16, 0.15), rgba(9, 11, 16, 0.85));
}

.mu-now-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(16px);
    z-index: -2;
    opacity: 0.7;
}

.mu-now-orb-a {
    width: 170px;
    height: 170px;
    top: 60px;
    right: -42px;
    background: rgba(255, 84, 105, 0.28);
}

.mu-now-orb-b {
    width: 200px;
    height: 200px;
    left: -70px;
    bottom: 70px;
    background: rgba(104, 92, 255, 0.22);
}

.mu-now-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 2;
}

.mu-glass-chip,
.mu-top-icon-btn,
.mu-now-card,
.mu-playback-card,
.mu-volume-wrap {
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 16px 40px rgba(0,0,0,0.18);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

.mu-glass-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--text-primary, #fff);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.mu-top-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 15px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mu-now-card {
    border-radius: 28px;
    padding: 18px;
}

.mu-artwork-wrap {
    width: 100%;
    max-width: 266px;
    margin: 0 auto;
    position: relative;
}

.mu-artwork {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 28px;
    overflow: hidden;
    background: linear-gradient(145deg, rgba(22, 24, 30, 0.96), rgba(42, 45, 54, 0.92));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: rgba(255,255,255,0.15);
    box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}

.mu-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mu-video-container {
    display: none;
    width: 100%;
    height: 100%;
    border-radius: 28px;
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.mu-track-info {
    text-align: center;
    width: 100%;
    padding: 16px 8px 0;
}

.mu-track-title {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-primary, #fff);
    line-height: 1.05;
    letter-spacing: -0.6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mu-track-artist {
    font-size: 14px;
    color: #ff6678;
    margin-top: 8px;
    font-weight: 700;
}

.mu-playback-card {
    border-radius: 28px;
    padding: 16px 16px 18px;
}

#app-music.music-now-playing-mode .mu-tabs {
    display: none;
}

#app-music.music-now-playing-mode #mu-tab-playing {
    padding-top: 6px;
}

#app-music.music-now-playing-mode .mu-now-playing {
    padding-top: 8px;
    gap: 14px;
}

#app-music.music-now-playing-mode .mu-add-to-playlist-row {
    display: flex;
}

.mu-time-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mu-time-current,
.mu-time-total {
    font-size: 11px;
    color: var(--text-secondary, rgba(255,255,255,0.7));
    min-width: 32px;
    font-variant-numeric: tabular-nums;
}

.mu-time-total {
    text-align: right;
}

.mu-progress-shell {
    flex: 1;
}

.mu-progress-bar {
    position: relative;
    width: 100%;
    height: 24px;
    cursor: pointer;
}

.mu-progress-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
}

.mu-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    transform: translateY(-50%);
    background: linear-gradient(90deg, #ff5a6d, #ff9a44);
    border-radius: 999px;
    width: 0%;
    transition: width 0.45s linear;
    box-shadow: 0 0 18px rgba(255, 90, 109, 0.28);
}

.mu-progress-knob {
    position: absolute;
    top: 50%;
    left: 0;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(255, 90, 109, 0.9);
    transform: translate(-50%, -50%);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    pointer-events: none;
}

.mu-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 10px;
}

.mu-ctrl-btn {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    border: none;
    background: transparent;
    color: var(--text-primary, #fff);
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease;
}

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

.mu-play-btn {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #ff5469, #ff8a3d);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    color: #fff;
    box-shadow: 0 18px 30px rgba(255, 84, 105, 0.3);
}

.mu-extra-controls {
    display: flex;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    justify-content: center;
    margin-top: 14px;
}

.mu-icon-btn {
    background: none;
    border: none;
    color: var(--text-tertiary, rgba(255,255,255,0.55));
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    transition: color 0.2s, transform 0.2s;
}

.mu-icon-btn.active {
    color: #ff5a6d;
}

.mu-icon-btn:active {
    transform: scale(0.94);
}

.mu-top-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0.5px solid rgba(255,255,255,0.12);
    background: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
}

.mu-glass-chip.active,
.mu-top-icon-btn.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 90, 109, 0.94), rgba(175, 82, 222, 0.84));
    box-shadow: 0 14px 26px rgba(255, 90, 109, 0.22);
}

.mu-volume-wrap {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    color: var(--text-secondary, rgba(255,255,255,0.74));
    font-size: 12px;
    padding: 14px;
    border-radius: 20px;
}

.mu-volume-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
}

.mu-volume-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mu-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: linear-gradient(90deg,
        #ff5a6d 0%,
        #ff5a6d var(--mu-volume-progress, 70%),
        rgba(255,255,255,0.16) var(--mu-volume-progress, 70%),
        rgba(255,255,255,0.16) 100%);
    border-radius: 999px;
    outline: none;
}

.mu-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22);
}

.mu-ctrl-shuffle,
.mu-ctrl-repeat {
    font-size: 16px !important;
    color: var(--text-tertiary, rgba(255,255,255,0.46));
    padding: 6px !important;
}

.mu-ctrl-shuffle.active,
.mu-ctrl-repeat.active {
    color: #ff5a6d;
}

.mu-add-to-playlist-row {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 18px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

.mu-add-to-playlist-row .mu-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    padding: 12px 18px;
    border-radius: 999px;
    background: linear-gradient(145deg, rgba(255,255,255,0.14), rgba(255,255,255,0.05));
    border: 0.5px solid rgba(255,255,255,0.12);
    color: var(--text-primary, #fff);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

#phone-frame:not(.dark-mode) .mu-tabs,
#phone-frame:not(.dark-mode) .mu-glass-chip,
#phone-frame:not(.dark-mode) .mu-top-icon-btn,
#phone-frame:not(.dark-mode) .mu-now-card,
#phone-frame:not(.dark-mode) .mu-playback-card,
#phone-frame:not(.dark-mode) .mu-volume-wrap,
#phone-frame:not(.dark-mode) .mu-add-to-playlist-row .mu-icon-btn {
    background: linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.55));
    border-color: rgba(16, 24, 40, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 18px 40px rgba(24, 39, 75, 0.1);
}

#phone-frame:not(.dark-mode) .mu-tab {
    color: rgba(29, 31, 40, 0.54);
}

#phone-frame:not(.dark-mode) .mu-tab.active {
    color: #fff;
}

#phone-frame:not(.dark-mode) .mu-top-icon-btn {
    background: linear-gradient(145deg, rgba(255,255,255,0.78), rgba(255,255,255,0.55));
    border-color: rgba(16, 24, 40, 0.08);
}

#phone-frame:not(.dark-mode) .mu-now-backdrop::after {
    background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(243,244,248,0.82));
}

#phone-frame:not(.dark-mode) .mu-progress-track {
    background: rgba(17, 24, 39, 0.12);
}

#phone-frame:not(.dark-mode) .mu-volume-slider {
    background: linear-gradient(90deg,
        #ff5a6d 0%,
        #ff5a6d var(--mu-volume-progress, 70%),
        rgba(17,24,39,0.14) var(--mu-volume-progress, 70%),
        rgba(17,24,39,0.14) 100%);
}

/* ── For You Tab ── */
.mu-foryou-section {
    padding: 16px 14px calc(110px + env(safe-area-inset-bottom, 0px));
}

.mu-ai-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(252,60,68,0.15), rgba(175,82,222,0.15));
    margin-bottom: 20px;
}
.mu-ai-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #fc3c44, #af52de);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
}
.mu-ai-banner-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}
.mu-ai-banner-sub {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    margin-top: 2px;
}

.mu-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mu-ai-badge {
    font-size: 10px;
    font-weight: 600;
    color: #af52de;
    background: rgba(175,82,222,0.12);
    padding: 3px 8px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.mu-ai-badge i { font-size: 9px; }

/* Horizontal scroll for recent tracks */
.mu-horizontal-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 16px;
    scrollbar-width: none;
}
.mu-horizontal-scroll::-webkit-scrollbar { display: none; }

.mu-recent-card {
    flex-shrink: 0;
    width: 110px;
    cursor: pointer;
    transition: transform 0.15s;
}
.mu-recent-card:active { transform: scale(0.95); }
.mu-recent-card img {
    width: 110px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--fill-secondary, rgba(118,118,128,0.24));
    display: block;
}
.mu-recent-card .mu-recent-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    margin-top: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mu-recent-card .mu-recent-artist {
    font-size: 10px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Quick Mix buttons */
.mu-quickmix-row {
    display: flex;
    gap: 10px;
    margin-bottom: calc(36px + env(safe-area-inset-bottom, 0px));
}
.mu-quickmix-btn {
    flex: 1;
    padding: 14px 12px;
    border: none;
    border-radius: 14px;
    background: var(--fill-tertiary, rgba(118,118,128,0.24));
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.mu-quickmix-btn:active { transform: scale(0.96); opacity: 0.7; }
.mu-quickmix-btn i { color: #fc3c44; }

/* ── Playlists Tab ── */
.mu-playlists-header {
    padding: 12px 14px;
    display: flex;
    justify-content: flex-end;
}
.mu-create-playlist-btn {
    background: #fc3c44;
    border: none;
    border-radius: 20px;
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: transform 0.15s;
}
.mu-create-playlist-btn:active { transform: scale(0.95); }

.mu-playlists-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 14px 14px;
}

.mu-playlist-card {
    background: var(--card-bg, #1c1c1e);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: transform 0.15s;
    position: relative;
    overflow: hidden;
}
.mu-playlist-card:active { transform: scale(0.96); }
.mu-playlist-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #fc3c44, #af52de);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    margin-bottom: 10px;
}
.mu-playlist-card-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mu-playlist-card-count {
    font-size: 11px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 2px;
}
.mu-playlist-card-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,59,48,0.15);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: #ff3b30;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Playlist Detail */
.mu-playlist-detail { padding: 0; }
.mu-playlist-detail.hidden { display: none !important; }
.mu-playlist-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 0.5px solid var(--separator, rgba(255,255,255,0.06));
}
.mu-playlist-back-btn {
    background: none;
    border: none;
    color: #fc3c44;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
}
.mu-playlist-detail-name {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}
.mu-playlist-play-all {
    background: #fc3c44;
    border: none;
    border-radius: 16px;
    color: #fff;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mu-share-active { color: #34c759 !important; }

.mu-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    font-size: 14px;
}

.mu-empty i {
    font-size: 36px;
    display: block;
    margin-bottom: 12px;
    color: var(--fill-primary, rgba(255,255,255,0.12));
}

/* ═══════════════════════════════════════════════════════
   AGENCYAI INSIGHT CARDS (shared across apps)
   ═══════════════════════════════════════════════════════ */

.ai-insight-card {
    margin: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(175,82,222,0.1), rgba(90,200,250,0.08));
    border: 0.5px solid rgba(175,82,222,0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.ai-insight-header {
    font-size: 11px;
    font-weight: 700;
    color: #af52de;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ai-insight-header i { font-size: 12px; }
.ai-insight-text {
    font-size: 13px;
    color: var(--text-primary, #fff);
    line-height: 1.5;
}
.ai-insight-sub {
    font-size: 11px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════
   PICTOGRAM (Instagram-like App)
   ═══════════════════════════════════════════════════════ */

#pictogram-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    background:
        radial-gradient(120% 90% at 10% 0%, rgba(255, 55, 95, 0.08), transparent 45%),
        radial-gradient(140% 100% at 100% 0%, rgba(88, 86, 214, 0.1), transparent 50%),
        linear-gradient(180deg, var(--bg-primary, #000) 0%, var(--bg-secondary, #0f1014) 100%);
}

.pg-container {
    flex: 1;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.pg-container::-webkit-scrollbar { display: none; }

/* During livestream: all .screen elements are hidden via phone.css.
   The #pg-live-full-overlay (child of #phone-frame, z-index 120000)
   renders above everything.  #call-screen and #modal-overlay are
   kept visible via phone.css overrides so calls still work. */

.pg-tab-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    background: var(--card-bg, rgba(255,255,255,0.06));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    flex-shrink: 0;
    margin: 0 16px 8px;
    border-radius: 30px;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.pg-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    padding: 4px 16px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
    transition: color 0.2s;
    font-size: 10px;
    font-weight: 600;
    flex: 1;
    letter-spacing: 0.2px;
}
.pg-tab.active { color: #007aff; }
.pg-tab i { font-size: 22px; }

.pg-feed { padding-bottom: 8px; }

.pg-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pg-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary, #fff);
}

.pg-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin: 8px 16px 0;
    background: var(--card-bg, rgba(255,255,255,0.06));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 22px;
    border: 0.5px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.pg-topbar-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pg-topbar-wordmark {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.6px;
    color: var(--text-primary, #fff);
}

.pg-topbar-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary, rgba(255,255,255,0.48));
}

.pg-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pg-topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: 19px;
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    background: var(--fill-secondary, rgba(255, 255, 255, 0.08));
    color: var(--text-primary, #fff);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
}

.pg-stories-wrap {
    margin-top: -4px;
}

.pg-stories-rail {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 4px;
}

.pg-story-card {
    position: relative;
    min-width: 72px;
    max-width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: none;
    color: var(--text-primary, #fff);
    cursor: pointer;
    padding: 0;
}

.pg-story-card span {
    width: 100%;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
    color: var(--text-secondary, rgba(255, 255, 255, 0.82));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-story-ring {
    width: 70px;
    height: 70px;
    padding: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd776, #ff3672 45%, #9340ff);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-story-card.viewed .pg-story-ring {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.12));
}

.pg-story-card.own .pg-story-ring {
    background: linear-gradient(135deg, rgba(10, 132, 255, 0.9), rgba(90, 200, 250, 0.8));
}

.pg-story-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(10, 11, 16, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-transform: uppercase;
}

.pg-story-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-story-add {
    position: absolute;
    right: 4px;
    top: 46px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #0a84ff;
    border: 2px solid rgba(10, 11, 16, 0.92);
    color: #fff;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-post {
    margin: 0 14px 16px;
    border-radius: 26px;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.14);
}

.pg-post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
}

.pg-follow-toggle.compact {
    flex-shrink: 0;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 12px;
    line-height: 1;
}

.pg-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e1306c, #c13584);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

.pg-username {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    flex: 1;
}

.pg-time {
    font-size: 11px;
    color: var(--text-tertiary, rgba(255,255,255,0.4));
}

.pg-post-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--fill-secondary, rgba(255,255,255,0.06));
    overflow: hidden;
}
.pg-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-post-actions {
    display: flex;
    gap: 12px;
    padding: 10px 14px 4px;
}

.pg-action-btn {
    background: none;
    border: none;
    color: var(--text-primary, #fff);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    transition: transform 0.15s;
}
.pg-action-btn:active { transform: scale(1.2); }

.pg-post-likes {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    padding: 0 14px 4px;
}

.pg-post-caption {
    font-size: 13px;
    color: var(--text-primary, #fff);
    padding: 0 14px 10px;
    line-height: 1.4;
}
.pg-post-caption strong {
    font-weight: 600;
    margin-right: 4px;
}

/* Post comments */
.pg-post-comments {
    padding: 0 14px 4px;
}
.pg-comment-item {
    font-size: 13px;
    color: var(--text-primary, #fff);
    line-height: 1.4;
    margin-bottom: 3px;
}
.pg-comment-item strong {
    font-weight: 600;
    margin-right: 4px;
}
.pg-comment-more {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.5));
    margin-top: 2px;
    cursor: pointer;
}
.pg-comment-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 10px;
    border-top: 0.5px solid var(--separator, rgba(255,255,255,0.08));
    margin-top: 4px;
}
.pg-comment-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    padding: 6px 0;
}
.pg-comment-input::placeholder {
    color: var(--text-quaternary, rgba(255,255,255,0.35));
}
.pg-comment-send {
    background: transparent;
    border: none;
    color: #007aff;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.15s;
}
.pg-comment-send:active {
    opacity: 0.5;
}

.pg-live-rail {
    display: grid;
    gap: 12px;
}

.pg-live-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
    border: 0.5px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pg-live-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(88, 86, 214, 0.42), rgba(255, 55, 95, 0.38));
}

.pg-live-thumb img,
.pg-live-launcher-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-live-fallback,
.pg-live-preview-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 34px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.24), transparent 42%),
        linear-gradient(135deg, rgba(88, 86, 214, 0.9), rgba(255, 55, 95, 0.72));
}

.pg-live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: #fff;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.94), rgba(255, 55, 95, 0.88));
    box-shadow: 0 8px 18px rgba(255, 59, 48, 0.22);
}

.pg-live-pill i {
    font-size: 9px;
}

.pg-live-thumb .pg-live-pill {
    position: absolute;
    top: 10px;
    left: 10px;
}

.pg-live-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pg-live-actions {
    display: flex;
    gap: 8px;
}

.pg-live-actions .pg-live-join-btn {
    flex: 1;
}

.pg-search-profile-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.pg-search-profile-card + .pg-search-profile-card {
    border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}

.pg-search-profile-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #e1306c, #c13584);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
}

.pg-search-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-search-profile-meta {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pg-search-profile-meta strong {
    font-size: 14px;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-search-profile-meta span {
    font-size: 12px;
    color: var(--text-tertiary, rgba(255,255,255,0.48));
}

.pg-live-title,
.pg-live-panel-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary, #fff);
}

.pg-live-sub,
.pg-live-panel-sub {
    font-size: 12px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.72));
    line-height: 1.45;
}

.pg-live-join-btn {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    background: linear-gradient(135deg, #ff375f, #af52de);
}

.pg-live-panel {
    padding: 16px;
}

.pg-live-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.pg-live-panel-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.pg-live-panel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, rgba(255,255,255,0.74));
    font-size: 12px;
    line-height: 1.4;
}

.pg-live-panel-chip i {
    color: #ff5d7c;
    flex-shrink: 0;
}

.pg-live-panel-note {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 55, 95, 0.14), rgba(88, 86, 214, 0.16));
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
    font-size: 12px;
    line-height: 1.5;
}

.pg-live-comments-wrap {
    margin-top: 14px;
}

.pg-live-comments {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 180px;
    overflow-y: auto;
    padding: 12px 0 0;
}

.pg-live-comment {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.pg-live-comment strong {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary, #fff);
}

.pg-live-comment span {
    font-size: 13px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.74));
    line-height: 1.45;
    word-break: break-word;
}

.pg-live-comment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-top: 14px;
}

.pg-live-comment-row .social-btn {
    padding-left: 18px;
    padding-right: 18px;
}

.pg-live-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    padding: 34px 20px;
}

.pg-live-loading i {
    font-size: 24px;
    color: #ff4d73;
}

.pg-story-compose-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.pg-composer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.pg-composer-pill {
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-radius: 18px;
    min-height: 54px;
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.pg-live-launcher {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.pg-live-launcher-preview {
    width: 66px;
    height: 66px;
    border-radius: 22px;
    overflow: hidden;
    flex-shrink: 0;
    border: 0.5px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 55, 95, 0.22), rgba(88, 86, 214, 0.24));
}

.pg-live-launcher-preview .pg-live-preview-fallback {
    font-size: 22px;
}

.pg-story-compose-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    max-height: 220px;
    overflow-y: auto;
}

.pg-story-compose-thumb {
    aspect-ratio: 1 / 1;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
}

.pg-story-compose-thumb.active {
    border-color: #ff4d73;
    box-shadow: 0 0 0 1px rgba(255, 77, 115, 0.4);
}

.pg-story-compose-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-story-compose-empty {
    min-height: 180px;
    border-radius: 18px;
    border: 0.5px dashed rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary, rgba(255, 255, 255, 0.72));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
    padding: 18px;
}

.pg-story-compose-empty.small {
    min-height: 86px;
    border-radius: 14px;
}

.pg-profile-hero {
    overflow: hidden;
}

.pg-profile-top {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.pg-profile-story-btn {
    padding: 0;
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary, #fff);
    cursor: pointer;
}

.pg-profile-story-btn span {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, rgba(255,255,255,0.72));
}

.pg-profile-avatar {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e1306c, #c13584);
    color: #fff;
    font-size: 30px;
    font-weight: 800;
    border: 3px solid rgba(10, 11, 16, 0.82);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.pg-profile-story-btn.has-story .pg-profile-avatar {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08), 0 0 0 7px rgba(255, 55, 95, 0.62);
}

.pg-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-profile-meta {
    flex: 1;
    min-width: 0;
}

.pg-profile-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.pg-profile-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
}

.pg-profile-stats strong {
    font-size: 16px;
    color: var(--text-primary, #fff);
}

.pg-profile-stats span {
    font-size: 11px;
    color: var(--text-secondary, rgba(255,255,255,0.72));
}

.pg-profile-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.pg-search-hero {
    padding-top: 16px;
    padding-bottom: 16px;
}

.pg-story-mini-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
}

.pg-story-mini {
    min-width: 78px;
    max-width: 78px;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

.pg-story-mini img,
.pg-story-mini span {
    width: 66px;
    height: 66px;
    border-radius: 22px;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 55, 95, 0.22), rgba(88, 86, 214, 0.24));
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    border: 2px solid rgba(255, 55, 95, 0.72);
}

.pg-story-mini.viewed img,
.pg-story-mini.viewed span {
    border-color: rgba(255,255,255,0.16);
}

.pg-story-mini strong {
    width: 100%;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, rgba(255,255,255,0.72));
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-explore-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.pg-explore-tile {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.05);
}

.pg-explore-tile.large {
    grid-column: span 2;
    grid-row: span 2;
}

.pg-explore-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pg-explore-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
}

.pg-explore-overlay strong {
    font-size: 12px;
    font-weight: 800;
    color: #fff;
}

.pg-explore-overlay span {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.82);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#pg-story-viewer-overlay {
    position: absolute;
    inset: 0;
    z-index: 780;
    background: rgba(0, 0, 0, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pg-story-viewer-shell {
    position: relative;
    width: 100%;
    height: 100%;
}

.pg-story-progress {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    gap: 6px;
}

.pg-story-progress span {
    flex: 1;
    height: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.pg-story-progress span.active {
    background: #fff;
}

.pg-story-head {
    position: absolute;
    top: 26px;
    left: 14px;
    right: 14px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pg-story-head-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff3672, #9340ff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.pg-story-head-meta {
    flex: 1;
    min-width: 0;
}

.pg-story-head-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.pg-story-head-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.72);
}

.pg-story-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.pg-story-body {
    position: absolute;
    inset: 0;
}

.pg-story-body img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-story-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 38%;
    background: transparent;
    border: none;
    cursor: pointer;
}

.pg-story-nav.prev {
    left: 0;
}

.pg-story-nav.next {
    right: 0;
}

#pg-live-full-overlay {
    position: absolute;
    inset: 0;
    z-index: 120000;
    display: none;
    pointer-events: none;
    border-radius: var(--phone-radius, 44px);
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 40%, rgba(18, 18, 28, 0.88), rgba(6, 6, 12, 0.96));
    contain: layout paint style;
}

#pg-live-full-overlay.visible {
    display: block;
    pointer-events: auto;
}

.pg-live-full-shell {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 66px 14px 36px;
    background: transparent;
}

.pg-live-full-shell::before,
.pg-live-full-shell::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

.pg-live-full-shell::before {
    top: 0;
    height: 156px;
    background:
        radial-gradient(120% 80% at 50% -8%, rgba(255, 66, 110, 0.18), transparent 36%),
        linear-gradient(180deg, rgba(4, 6, 11, 0.84) 0%, rgba(7, 10, 17, 0.46) 55%, rgba(7, 10, 17, 0) 100%);
}

.pg-live-full-shell::after {
    bottom: 0;
    height: 214px;
    background:
        linear-gradient(180deg, rgba(7, 10, 17, 0) 0%, rgba(7, 10, 17, 0.2) 18%, rgba(4, 6, 11, 0.76) 100%);
}

.pg-live-full-top {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.pg-live-full-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.95), rgba(255, 55, 95, 0.9));
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}

.pg-live-full-meta {
    flex: 1;
    min-width: 0;
}

.pg-live-full-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-live-full-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-live-full-mode {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.pg-live-full-comments {
    position: relative;
    z-index: 1;
    align-self: flex-start;
    max-width: min(420px, calc(100% - 36px));
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: auto;
    margin-bottom: 16px;
}

.pg-live-full-comment,
.pg-live-full-empty {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(10, 10, 14, 0.34);
    color: #fff;
    font-size: 13px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.pg-live-full-comment strong {
    margin-right: 6px;
}

.pg-live-full-bottom {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pg-live-full-end-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(255, 59, 48, 0.92), rgba(220, 30, 60, 0.95));
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.2px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 4px 18px rgba(255, 59, 48, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    pointer-events: auto;
}

.pg-live-full-end-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 59, 48, 0.25);
}

.pg-live-full-hint {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(10, 10, 14, 0.32);
    color: rgba(255, 255, 255, 0.88);
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    text-align: center;
}

.pg-live-full-viewfinder {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    overflow: hidden;
    pointer-events: none;
}

.pg-live-full-viewfinder::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(88, 86, 214, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 20% 70%, rgba(255, 59, 48, 0.04) 0%, transparent 40%);
    animation: pgLiveViewfinderPulse 4s ease-in-out infinite;
}

@keyframes pgLiveViewfinderPulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.pg-live-full-viewfinder-grid {
    position: absolute;
    inset: 60px 10px 60px 10px;
    pointer-events: none;
}

.pg-live-full-viewfinder-grid::before,
.pg-live-full-viewfinder-grid::after {
    content: '';
    position: absolute;
    background: rgba(255, 255, 255, 0.06);
}

.pg-live-full-viewfinder-grid::before {
    top: 33.33%;
    left: 0;
    right: 0;
    height: 1px;
    box-shadow: 0 calc(33.33% + 1px) 0 0 rgba(255, 255, 255, 0.06);
}

.pg-live-full-viewfinder-grid::after {
    left: 33.33%;
    top: 0;
    bottom: 0;
    width: 1px;
    box-shadow: calc(33.33% + 1px) 0 0 0 rgba(255, 255, 255, 0.06);
}

.pg-live-full-rec-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff3b30;
    animation: pgLiveRecPulse 1.5s ease-in-out infinite;
    margin-right: 2px;
}

@keyframes pgLiveRecPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* =========================
   Maps App
   ========================= */
.maps-hidden-header {
    display: none !important;
}

.maps-app-content {
    padding: 0;
    display: flex;
    flex-direction: column;
    height: calc(100% - 46px);
    box-sizing: border-box;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 46%),
        linear-gradient(180deg, #eef4f7 0%, #d7e2e9 100%);
}

.maps-stage {
    position: relative;
    flex: 1;
    overflow: hidden;
    background: linear-gradient(180deg, #dce8ef 0%, #cddce6 100%);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.maps-stage::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.45), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 1;
}

.maps-stage.sheet-open .maps-bottom-toolbar {
    opacity: 0;
    transform: translateY(140%);
    pointer-events: none;
}

.maps-world {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.maps-terrain,
.maps-road-overlay,
.maps-blips-layer,
.maps-player-marker,
.maps-waypoint-marker {
    position: absolute;
    inset: 0;
}

.maps-terrain {
    background:
        url('../img/GTAV_ATLUS_2048x2048-1024x1024.png') center center / cover no-repeat,
        linear-gradient(180deg, #d4e2ea 0%, #b9d0df 100%);
    filter: saturate(1.03) contrast(1.02);
}

.maps-road-overlay {
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.24), transparent 32%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0));
    mix-blend-mode: screen;
    opacity: 0.6;
    pointer-events: none;
}

.maps-topglass {
    position: absolute;
    top: 50px;
    left: 16px;
    right: 92px;
    z-index: 20;
    pointer-events: none;
}

.maps-topglass-inner {
    padding: 14px 16px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.44));
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        0 18px 40px rgba(21, 34, 49, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(26px) saturate(185%);
    -webkit-backdrop-filter: blur(26px) saturate(185%);
}

.maps-street {
    font-size: 18px;
    font-weight: 800;
    color: #11161b;
    letter-spacing: -0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.maps-meta {
    margin-top: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(17, 22, 27, 0.64);
}

.maps-side-rail {
    position: absolute;
    top: 138px;
    right: 14px;
    z-index: 21;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.58));
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow:
        0 18px 34px rgba(23, 34, 44, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
}

.maps-rail-btn {
    width: 54px;
    height: 63px;
    border: none;
    border-bottom: 1px solid rgba(16, 16, 18, 0.1);
    background: transparent;
    color: #20242b;
    font-size: 21px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.maps-rail-btn:last-child {
    border-bottom: none;
}

.maps-rail-btn:active,
.maps-rail-btn.active {
    background: rgba(255, 255, 255, 0.52);
    color: #000;
    transform: scale(0.98);
}

.maps-center-reticle {
    opacity: 0;
    pointer-events: none;
}

.maps-blips-layer {
    z-index: 4;
}

.maps-blip {
    position: absolute;
    width: 22px;
    height: 22px;
    transform: translate(-50%, -50%);
    border: none;
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 10px 22px rgba(16, 22, 28, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.maps-blip i {
    font-size: 10px;
}

.maps-blip.poi {
    background: linear-gradient(135deg, rgba(12, 122, 255, 0.96), rgba(78, 194, 255, 0.9));
}

.maps-blip.vehicle {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.96), rgba(48, 209, 88, 0.9));
}

.maps-blip.emergency {
    background: linear-gradient(135deg, rgba(255, 88, 66, 0.98), rgba(255, 59, 48, 0.92));
}

.maps-waypoint-marker {
    z-index: 6;
    pointer-events: none;
}

.maps-waypoint-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    transform: translate(-50%, -100%);
    display: none;
    color: #7444ff;
    font-size: 15px;
    text-shadow: 0 12px 28px rgba(72, 56, 160, 0.28);
}

.maps-waypoint-dot.active {
    display: block;
    animation: mapsWaypointPulse 1.2s ease-in-out infinite;
}

@keyframes mapsWaypointPulse {
    0%, 100% { transform: translate(-50%, -100%) scale(1); }
    50% { transform: translate(-50%, -100%) scale(1.08); }
}

.maps-player-marker {
    z-index: 7;
    pointer-events: none;
}

.maps-player-dot {
    position: absolute;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: linear-gradient(135deg, #0a84ff, #5ac8fa);
    box-shadow:
        0 16px 28px rgba(10, 132, 255, 0.24),
        0 0 0 4px rgba(255, 255, 255, 0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maps-player-dot i {
    font-size: 10px;
    transform-origin: center;
}

.maps-bottom-toolbar {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: calc(52px + env(safe-area-inset-bottom, 0px));
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68));
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow:
        0 18px 36px rgba(21, 34, 49, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(26px) saturate(185%);
    -webkit-backdrop-filter: blur(26px) saturate(185%);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.22s ease;
}

.maps-nav-tab {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 10px 8px;
    border-radius: 22px;
    color: rgba(17, 22, 27, 0.68);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.maps-nav-tab i {
    font-size: 18px;
}

.maps-nav-tab.active {
    background: rgba(255, 255, 255, 0.72);
    color: #11161b;
    box-shadow:
        0 10px 20px rgba(26, 39, 56, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.maps-nav-tab:active {
    transform: scale(0.98);
}

.maps-sheet {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 24;
    padding: 10px 0 calc(14px + env(safe-area-inset-bottom, 0px));
    border-radius: 34px 34px 30px 30px;
    background: linear-gradient(180deg, rgba(252, 252, 253, 0.84), rgba(244, 245, 247, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.82);
    box-shadow:
        0 24px 44px rgba(17, 28, 41, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(32px) saturate(185%);
    -webkit-backdrop-filter: blur(32px) saturate(185%);
    transform: translateY(calc(100% + 34px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.26s ease;
}

.maps-sheet.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.maps-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(17, 22, 27, 0.16);
    margin: 0 auto 10px;
}

.maps-sheet-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 0 16px 10px 16px;
}

.maps-sheet-title {
    font-size: 17px;
    font-weight: 800;
    color: #101419;
}

.maps-sheet-subtitle {
    margin-top: 3px;
    font-size: 13px;
    color: rgba(16, 20, 25, 0.58);
}

.maps-sheet-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(17, 22, 27, 0.1);
    color: rgba(17, 22, 27, 0.54);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.maps-sheet-content {
    max-height: min(380px, 52vh);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding: 2px 14px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.maps-sheet-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.maps-sheet-row .maps-sheet-item {
    flex: 1;
}

.maps-sheet-card,
.maps-sheet-item,
.maps-share-button {
    border-radius: 24px;
}

.maps-sheet-card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.maps-route-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.maps-route-copy {
    min-width: 0;
}

.maps-route-title {
    font-size: 14px;
    font-weight: 800;
    color: #101419;
}

.maps-route-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(16, 20, 25, 0.58);
}

.maps-route-clear {
    border: none;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(116, 68, 255, 0.12);
    color: #5b3eff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.maps-sheet-item {
    width: 100%;
    border: none;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid rgba(255, 255, 255, 0.74);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
    padding: 14px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
}

.maps-sheet-delete {
    width: 48px;
    min-width: 48px;
    border: none;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.76);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
    color: rgba(17, 22, 27, 0.62);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.maps-sheet-delete:active {
    transform: scale(0.96);
    background: rgba(255, 255, 255, 0.74);
    color: #101419;
}

.maps-sheet-item-icon {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    background: linear-gradient(135deg, var(--maps-accent, #0a84ff), rgba(255, 255, 255, 0.42));
    box-shadow: 0 12px 24px rgba(18, 29, 40, 0.16);
}

.maps-sheet-item-copy {
    flex: 1;
    min-width: 0;
}

.maps-sheet-item-title {
    font-size: 15px;
    font-weight: 800;
    color: #11161b;
}

.maps-sheet-item-sub {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(17, 22, 27, 0.56);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.maps-sheet-item-action {
    flex-shrink: 0;
    color: rgba(17, 22, 27, 0.42);
    font-size: 17px;
}

.maps-sheet-item-action.route {
    color: #0a84ff;
}

.maps-empty-state {
    padding: 18px 12px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.maps-empty-bubbles {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
}

.maps-empty-bubble {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, #ffb16a, #ff6a88);
    box-shadow: 0 12px 24px rgba(24, 34, 47, 0.18);
}

.maps-empty-bubble.center {
    width: 68px;
    height: 68px;
    background: linear-gradient(135deg, #5c8dff, #9b7cff);
}

.maps-empty-text {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(17, 22, 27, 0.54);
    max-width: 240px;
}

.maps-share-button {
    width: 100%;
    border: none;
    height: 52px;
    background: linear-gradient(135deg, #0a84ff, #4f8dff);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 28px rgba(10, 132, 255, 0.22);
}
