:root {
    --blue-primary: #007aff;
    --blue-primary-active: #0056b3;
    --green-confirm: #34c759;
    --green-confirm-active: #2a9e48;
    --red-destructive: #ff3b30;
    --red-destructive-active: #c7000e;
    --white-primary: #ffffff;
    --black-primary: #000000;
    --system-gray-1: #f2f2f7;
    --system-gray-2: #e5e5ea;
    --system-gray-3: #d1d1d6;
    --system-gray-4: #8e8e93;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --status-bar-height: 44px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--system-gray-1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--black-primary);
}

.app-container {
    background: var(--white-primary);
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--white-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loader {
    width: 48px;
    height: 48px;
    border: 4px solid var(--system-gray-2);
    border-top-color: var(--blue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.connection-status {
    display: flex;
    align-items: center;
    padding: 5px;
    position: relative;
    cursor: pointer;
}

.connection-status svg {
    width: 24px;
    height: 24px;
    transition: stroke 0.3s ease;
}

.network-status-popup {
    display: none;
    position: fixed;
    padding: 10px 14px;
    background: var(--white-primary);
    border: 1px solid var(--system-gray-3);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    font-size: 14px;
    z-index: 1000;
    max-width: calc(100vw - 40px);
}

.network-status-popup.show {
    display: block;
}

.network-status-popup::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

.network-status-popup::after {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.network-status-popup.popup-bottom::before {
    bottom: 100%;
    border-bottom: 6px solid var(--system-gray-3);
}

.network-status-popup.popup-bottom::after {
    bottom: 100%;
    border-bottom: 5px solid var(--white-primary);
    margin-bottom: -1px;
}

.network-status-popup.popup-top::before {
    top: 100%;
    border-top: 6px solid var(--system-gray-3);
}

.network-status-popup.popup-top::after {
    top: 100%;
    border-top: 5px solid var(--white-primary);
    margin-top: -1px;
}

.network-status-popup.popup-left::before,
.network-status-popup.popup-left::after {
    left: 20px;
    right: auto;
}

.network-status-popup.popup-right::before,
.network-status-popup.popup-right::after {
    right: 20px;
    left: auto;
}

.connection-status.online svg {
    stroke: var(--green-confirm);
}

.connection-status.offline svg {
    stroke: var(--red-destructive);
}

.sync-notification {
    position: fixed;
    top: calc(var(--safe-top) + 60px);
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--green-confirm);
    color: var(--white-primary);
    padding: 12px 20px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    z-index: 999;
    opacity: 0;
    transition: all 0.3s ease;
}

.sync-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sync-notification.error {
    background: var(--red-destructive);
}

.sync-icon {
    animation: checkmark 0.5s ease;
}

@keyframes checkmark {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.header {
    padding: calc(var(--safe-top) + 10px) 20px 10px;
    background: var(--white-primary);
    border-bottom: 0.5px solid var(--system-gray-2);
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,0.05);
    position: relative;
    z-index: 100;
}

@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: calc(env(safe-area-inset-top) + 10px);
    }
}

.app-title {
    font-size: clamp(17px, 5vw, 22px);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 450px;
    margin: 0 auto;
}

.nav-btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
}

.nav-btn-icon svg {
    width: 24px;
    height: 24px;
    stroke: var(--system-gray-4);
    transition: transform 0.3s ease, stroke 0.2s ease;
}

.nav-btn-icon:active svg {
    transform: scale(0.95);
    stroke: var(--blue-primary);
}

.nav-btn-icon:disabled svg {
    stroke: var(--system-gray-3);
}

.datetime-display {
    color: var(--system-gray-4);
    font-size: clamp(12px, 3.5vw, 14px);
    font-weight: 500;
    background: var(--system-gray-1);
    padding: 5px 12px;
    border-radius: 8px;
}

.screen {
    display: none;
    flex: 1;
    flex-direction: column;
    overflow-y: auto;
    min-height: 0;
    padding: 20px;
    padding-left: calc(20px + var(--safe-left));
    padding-right: calc(20px + var(--safe-right));
    padding-bottom: calc(20px + var(--safe-bottom));
}

.screen.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.content-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 15px 0;
    min-height: 0;
}

.login-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: var(--black-primary);
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: clamp(16px, 4.5vw, 18px);
    text-align: center;
}

.text-input, .dropdown {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid var(--system-gray-3);
    border-radius: 12px;
    font-size: clamp(16px, 4vw, 17px);
    background-color: var(--white-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input:focus, .dropdown:focus {
    border-color: var(--blue-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.dropdown {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.zone-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    max-width: 420px;
    width: 100%;
    margin: 0 auto;
    padding: 10px 0;
}

.zone-input-group {
    text-align: center;
}

.zone-label {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: clamp(12px, 3.5vw, 14px);
    color: var(--black-primary);
}

.zone-input {
    width: 100%;
    height: 44px;
    border: 1.5px solid var(--system-gray-3);
    border-radius: 12px;
    font-size: clamp(16px, 4.5vw, 18px);
    text-align: center;
    font-weight: 600;
    background: var(--white-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.zone-input.active {
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.single-value-input {
    width: clamp(150px, 50vw, 200px);
    margin: 0 auto;
    padding: 16px;
    border: 1.5px solid var(--system-gray-3);
    border-radius: 14px;
    font-size: clamp(28px, 8vw, 36px);
    text-align: center;
    font-weight: 700;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.single-value-input:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.room-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 12px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 4px;
}

.room-select-btn {
    padding: 16px 12px;
    background: var(--white-primary);
    border: 2px solid var(--system-gray-3);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: var(--black-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.room-select-btn:hover {
    background: var(--system-gray-1);
    border-color: var(--blue-primary);
}

.room-select-btn:active {
    background: var(--blue-primary);
    color: var(--white-primary);
    transform: scale(0.98);
}

.notes-textarea {
    width: 100%;
    height: 120px;
    padding: 14px;
    border: 1px solid var(--system-gray-3);
    border-radius: 12px;
    font-size: clamp(14px, 4vw, 16px);
    font-family: inherit;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
    flex-shrink: 0;
}

/* Confirmation screen specific styles */
#emitterConfirmScreen .content-body,
#runoffConfirmScreen .content-body {
    flex: initial;
    justify-content: flex-start;
    overflow: visible;
}

#emitterConfirmScreen .screen-footer,
#runoffConfirmScreen .screen-footer {
    margin-top: 20px;
    position: sticky;
    bottom: 0;
    background: var(--white-primary);
    z-index: 10;
}

/* Landscape layout for confirmation screens */
@media (orientation: landscape) and (max-height: 600px) {
    #emitterConfirmScreen,
    #runoffConfirmScreen {
        flex-direction: row;
        align-items: stretch;
        gap: 20px;
        padding-top: 10px;
    }
    
    #emitterConfirmScreen .content-body,
    #runoffConfirmScreen .content-body {
        flex: 1;
        width: 75%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding-top: 5px;
        overflow-y: auto;
    }
    
    #emitterConfirmScreen .screen-footer,
    #runoffConfirmScreen .screen-footer {
        width: 25%;
        min-width: 200px;
        margin-top: 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 20px;
    }
    
    #emitterConfirmScreen .confirm-btn,
    #runoffConfirmScreen .confirm-btn {
        width: 100%;
        max-width: 200px;
    }
    
    #emitterConfirmScreen .summary-container,
    #runoffConfirmScreen .summary-container {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    #emitterConfirmScreen .summary-title,
    #runoffConfirmScreen .summary-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    #emitterConfirmScreen .notes-textarea,
    #runoffConfirmScreen .notes-textarea {
        height: 80px;
        max-height: 120px;
    }
    
    #emitterConfirmScreen .input-label,
    #runoffConfirmScreen .input-label {
        margin-bottom: 5px;
        font-size: 14px;
    }
}

.notes-textarea:focus {
    outline: none;
    border-color: var(--blue-primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.screen-footer {
    padding-top: 10px;
    padding-bottom: calc(10px + var(--safe-bottom));
    margin-top: auto;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    background: var(--white-primary);
    z-index: 10;
}

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(8px, 2vw, 12px);
    max-width: 320px;
    margin: 0 auto 10px;
}

.keypad-btn {
    aspect-ratio: 1.5;
    min-height: 44px;
    border: none;
    border-radius: 12px;
    font-size: clamp(18px, 4.5vw, 22px);
    font-weight: 600;
    background: var(--system-gray-1);
    border: 1px solid var(--system-gray-2);
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s ease, background-color 0.1s ease;
}

.keypad-btn:active {
    transform: scale(0.96);
    background: var(--system-gray-2);
}

.keypad .nav-btn {
    background: var(--blue-primary);
    color: var(--white-primary);
    border: none;
}

.keypad .nav-btn:active {
    background: var(--blue-primary-active);
}

.keypad .clear-btn {
    background: var(--red-destructive);
    color: var(--white-primary);
    border: none;
}

.keypad .clear-btn:active {
    background: var(--red-destructive-active);
}

.keypad-full-span {
    grid-column: 1 / -1;
    display: grid;
    gap: clamp(10px, 2.5vw, 15px);
}

.keypad-row-2 {
    grid-template-columns: repeat(2, 1fr);
}

.keypad-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.keypad-row-4 {
    grid-template-columns: repeat(4, 1fr);
}

.confirm-btn, .login-btn {
    width: 100%;
    height: 50px;
    border: none;
    border-radius: 14px;
    background: var(--green-confirm);
    color: var(--white-primary);
    font-size: clamp(16px, 4vw, 18px);
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.confirm-btn:active, .login-btn:active {
    transform: scale(0.98);
}

.confirm-btn:disabled, .login-btn:disabled {
    background: var(--system-gray-3);
    color: var(--system-gray-4);
    cursor: not-allowed;
    transform: none;
}

.home-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 400px;
    margin: auto;
}

.menu-btn {
    padding: 20px;
    font-size: 18px;
    font-weight: 600;
    border: 1.5px solid var(--system-gray-2);
    background: var(--white-primary);
    border-radius: 14px;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.1s ease, box-shadow 0.2s ease;
    text-align: left;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    touch-action: manipulation;
    -webkit-touch-callout: none;
    position: relative;
}

.menu-btn:active {
    transform: scale(0.97);
    background-color: var(--system-gray-1);
}

.menu-btn:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.menu-btn * {
    pointer-events: none;
}

.summary-container {
    background: var(--system-gray-1);
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid var(--system-gray-2);
}

.summary-title {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 15px;
    text-align: center;
    color: var(--black-primary);
}

.summary-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 15px;
    font-size: 15px;
}

.summary-label {
    font-weight: 600;
    color: var(--system-gray-4);
    text-align: right;
}

.summary-value {
    font-weight: 500;
    color: var(--black-primary);
}

.admin-link {
    text-align: center;
    margin-top: 20px;
}

.admin-link a {
    color: var(--blue-primary);
    text-decoration: none;
    font-size: 14px;
}

.admin-dashboard {
    padding: 20px;
}

.admin-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.admin-nav button {
    padding: 10px 20px;
    background: var(--blue-primary);
    color: var(--white-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.admin-nav button:active {
    background: var(--blue-primary-active);
}

.admin-nav button.active {
    background: var(--green-confirm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.data-table th,
.data-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid var(--system-gray-2);
}

.data-table th {
    background: var(--system-gray-1);
    font-weight: 600;
}

.data-table tr:hover {
    background: var(--system-gray-1);
}

.action-btns {
    display: flex;
    gap: 5px;
}

.edit-btn, .delete-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.edit-btn {
    background: var(--blue-primary);
    color: var(--white-primary);
}

.delete-btn {
    background: var(--red-destructive);
    color: var(--white-primary);
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: var(--white-primary);
    padding: 25px;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 20px;
}

.modal-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease;
}

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

.modal-cancel-btn {
    background: var(--system-gray-2);
    color: var(--blue-primary);
}

.modal-confirm-btn {
    background: var(--green-confirm);
    color: var(--white-primary);
}

.modal-delete-btn {
    background: var(--red-destructive);
    color: var(--white-primary);
}

@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding-top: 10px;
        padding-bottom: 5px;
    }

    .app-title {
        margin-bottom: 8px;
    }

    .screen {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    #emitterZoneScreen.landscape,
    #emitterPhScreen.landscape,
    #emitterConfirmScreen.landscape,
    #runoffRoomScreen.landscape,
    #runoffVolumeScreen.landscape,
    #runoffEcScreen.landscape,
    #runoffPhScreen.landscape,
    #runoffConfirmScreen.landscape {
        flex-direction: row;
        align-items: center;
        gap: 20px;
    }

    .content-body,
    .screen-footer {
        flex: 1;
        height: 100%;
        padding: 0;
        margin: 0;
    }

    .screen-footer {
        max-width: 300px;
    }

    .keypad {
        gap: 5px;
        margin-bottom: 5px;
    }

    .keypad-btn {
        aspect-ratio: 1.8;
        font-size: clamp(16px, 3vw, 18px);
    }
}

/* Mobile viewport optimization */
@supports (height: 100vh) {
    .app-container {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
    }
}

#emitterZoneScreen .content-body,
#emitterPhScreen .content-body,
#runoffVolumeScreen .content-body,
#runoffEcScreen .content-body,
#runoffPhScreen .content-body {
    flex: 0 1 auto;
    justify-content: flex-start;
    overflow: visible;
}

#emitterZoneScreen .screen-footer,
#emitterPhScreen .screen-footer,
#runoffVolumeScreen .screen-footer,
#runoffEcScreen .screen-footer,
#runoffPhScreen .screen-footer {
    margin-top: auto;
}

/* iOS-specific adjustments */
.ios-device .header {
    padding-top: calc(env(safe-area-inset-top, 20px) + 10px);
}

.ios-device .screen {
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 15px);
}

.ios-device .screen-footer {
    padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 10px);
}

/* Mobile-specific adjustments */
@media (max-width: 768px) and (orientation: portrait) {
    .screen {
        padding: 15px;
        padding-left: calc(15px + var(--safe-left));
        padding-right: calc(15px + var(--safe-right));
    }
    
    .content-body {
        padding: 10px 0;
    }
    
    .input-label {
        margin-bottom: 8px;
        font-size: 16px;
    }
    
    .zone-inputs {
        gap: 10px;
    }
    
    .keypad {
        gap: 8px;
        margin-bottom: 8px;
    }
    
    .keypad-btn {
        font-size: 18px;
    }
    
    .confirm-btn {
        height: 48px;
        font-size: 17px;
    }
}

/* Touch optimization for mobile */
@media (pointer: coarse) {
    /* Ensure minimum touch target size */
    button, .btn, .keypad-btn, .menu-btn, .confirm-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Prevent text selection on touch */
    * {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    input, textarea {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Improve touch responsiveness */
    button, a, .clickable {
        touch-action: manipulation;
    }
    
    /* Disable hover effects on touch devices */
    @media (hover: none) {
        button:hover, a:hover {
            background-color: inherit;
        }
    }
}

/* Auto-scroll to input on focus (mobile keyboards) */
input:focus, textarea:focus, select:focus {
    scroll-margin-bottom: 100px;
}

/* Prevent zoom on input focus */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
textarea,
select {
    font-size: 16px !important;
}

/* Touch feedback */
button:active, .btn:active, .clickable:active {
    opacity: 0.8;
    transform: scale(0.98);
}

/* Version Update Modal */
.version-update-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.version-update-modal.force {
    background: rgba(0, 0, 0, 0.9);
}

.version-update-content {
    background: var(--white-primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 90%;
    width: 320px;
    text-align: center;
    animation: slideUp 0.3s ease;
}

.version-update-content h2,
.version-update-content h3 {
    margin: 0 0 16px 0;
    color: var(--black-primary);
}

.version-update-content p {
    margin: 8px 0;
    color: var(--system-gray-5);
}

.version-info {
    font-size: 18px;
    font-weight: 600;
    color: var(--blue-primary);
    margin: 12px 0;
}

.version-changelog {
    text-align: left;
    margin: 16px 0;
    padding: 12px;
    background: var(--system-gray-1);
    border-radius: 8px;
}

.version-changelog h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: var(--system-gray-5);
}

.version-changelog ul {
    margin: 0;
    padding-left: 20px;
}

.version-changelog li {
    font-size: 13px;
    color: var(--black-primary);
    margin: 4px 0;
}

.version-update-buttons {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.version-update-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.version-update-btn.primary,
.version-update-modal.force .version-update-btn {
    background: var(--blue-primary);
    color: var(--white-primary);
}

.version-update-btn.primary:active {
    background: var(--blue-primary-active);
    transform: scale(0.98);
}

.version-update-btn.secondary {
    background: var(--system-gray-2);
    color: var(--system-gray-5);
}

.version-update-btn.secondary:active {
    background: var(--system-gray-3);
    transform: scale(0.98);
}

.version-updating {
    padding: 20px;
}

.version-updating .loader {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 4px solid var(--system-gray-2);
    border-top-color: var(--blue-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Update Notification Styles */
.update-notification {
    position: fixed;
    bottom: calc(var(--safe-bottom) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    background: var(--white-primary);
    border: 2px solid var(--blue-tint);
    padding: 16px 20px;
    border-radius: 14px;
    max-width: 90%;
    width: 350px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
}

.update-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.update-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
    text-align: center;
}

.update-icon {
    stroke: var(--blue-tint);
    animation: rotate 2s linear infinite;
}

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

.update-message {
    font-size: 15px;
    font-weight: 600;
    color: var(--black-primary);
}

.update-btn, .dismiss-update-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.update-btn {
    background: var(--blue-tint);
    color: var(--white-primary);
}

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

.dismiss-update-btn {
    background: transparent;
    color: var(--system-gray-4);
    text-decoration: underline;
}

/* Database connection issue indicator */
.connection-status.database-issue svg {
    stroke: #ff9500;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}