:root {
    --primary: #1f8abe;
    --primary-dark: #1870a0;
    --primary-light: #40a8d8;
    --bg: #f5f7fc;
    --card-bg: #ffffff;
    --text: #1e2a3e;
    --text-secondary: #6b7f8a;
    --border: #e8edf2;
    --danger: #e74c3c;
    --warning: #f39c12;
    --success: #27ae60;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
    --sidebar-width: 240px;
    --nav-height: 56px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
}

/* Login */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fc 0%, #e8edf2 100%);
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    width: 380px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    text-align: center;
}

.login-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 20px rgba(31,138,190,0.25);
}

.login-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.login-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
    position: relative;
}

.form-group label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(31,138,190,0.10);
    background: white;
}

.login-error {
    color: var(--danger);
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-align: left;
    min-height: 20px;
}

.login-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--radius);
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(31,138,190,0.25);
}

.login-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31,138,190,0.30);
}

.login-btn i {
    transition: transform 0.2s;
}

.login-btn:hover i {
    transform: translateX(3px);
}

.login-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.login-back:hover {
    color: var(--primary);
}

/* Nav */
.ota-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    z-index: 100;
    background: rgba(255,255,255,0.90);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border);
}

.ota-nav-inner {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ota-nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.ota-nav-brand i {
    font-size: 1.2rem;
}

.ota-nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.83rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(31,138,190,0.05);
}

.nav-btn.nav-btn-danger {
    border-color: rgba(231,76,60,0.2);
    color: var(--danger);
}

.nav-btn.nav-btn-danger:hover {
    background: rgba(231,76,60,0.06);
    color: var(--danger);
    border-color: rgba(231,76,60,0.3);
}

/* Dashboard */
.main-content {
    padding-top: var(--nav-height);
    height: 100vh;
    height: 100dvh;
}

.dashboard {
    display: flex;
    height: calc(100vh - var(--nav-height));
    height: calc(100dvh - var(--nav-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.sidebar-backdrop {
    display: none;
}

.mobile-sidebar-edge-toggle {
    display: none;
}

.sidebar-header {
    padding: 20px 16px 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-header h3 i {
    margin-right: 6px;
}

.sidebar-add-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.sidebar-add-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(31,138,190,0.05);
}

.product-list {
    padding: 8px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 2px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: none;
}

.product-item:hover {
    background: rgba(31,138,190,0.05);
    color: var(--text);
}

.product-item.active {
    background: rgba(31,138,190,0.08);
    border-right: 3px solid var(--primary);
    color: var(--primary);
}

.product-item i {
    font-size: 1rem;
    color: var(--primary);
    width: 20px;
    text-align: center;
}

/* Content */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.no-product {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60%;
    color: var(--text-secondary);
}

.no-product i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.4;
}

.no-product p {
    font-size: 1rem;
}

/* Product Detail */
.product-detail {
    max-width: 900px;
}

.detail-header {
    margin-bottom: 24px;
}

.detail-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-title h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.status-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge.on {
    background: rgba(39,174,96,0.10);
    color: var(--success);
}

.status-badge.off {
    background: rgba(231,76,60,0.08);
    color: var(--danger);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.detail-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
}

.card-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.card-label i {
    margin-right: 4px;
}

.card-value {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 500;
}

.card-value.editable {
    justify-content: space-between;
}

.edit-btn {
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
}

.edit-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(31,138,190,0.05);
}

/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.25s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.switch input:checked + .slider {
    background: var(--primary);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.switch input:disabled + .slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Gray Section */
.gray-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.gray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.gray-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.gray-header h3 i {
    color: var(--primary);
    margin-right: 6px;
}

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

.gray-tools {
    margin-bottom: 12px;
}

.gray-input-group {
    display: flex;
    gap: 8px;
}

.gray-input-group input {
    flex: 1;
    min-width: 0;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.gray-input-group .btn-sm {
    flex-shrink: 0;
}

.gray-input-group input:focus {
    border-color: var(--primary);
    background: white;
}

.gray-id-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gray-id-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(31,138,190,0.07);
    border: 1px solid rgba(31,138,190,0.12);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary);
}

.gray-id-tag .remove-id {
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.gray-id-tag .remove-id:hover {
    color: var(--danger);
}

/* Firmware Section */
.fw-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: var(--shadow);
}

.fw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.fw-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.fw-header h3 i {
    color: var(--primary);
    margin-right: 6px;
}

.fw-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fw-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.15s;
}

.fw-item:hover {
    border-color: rgba(31,138,190,0.15);
    background: rgba(31,138,190,0.02);
}

.fw-item.target {
    border-color: var(--primary);
    background: rgba(31,138,190,0.04);
}

.fw-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.fw-item-info i {
    color: var(--text-secondary);
    font-size: 1rem;
}

.fw-item-info .fw-name {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fw-item-info .fw-size {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.fw-item .target-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid rgba(39,174,96,0.20);
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    background: transparent;
    color: var(--success);
    margin-left: 8px;
}

.fw-item-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.fw-item-actions .target-badge {
    margin-left: 0;
    margin-right: 2px;
}

/* Buttons */
.btn-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(31,138,190,0.04);
}

.btn-danger {
    background: transparent;
    border: 1px solid rgba(231,76,60,0.20);
    color: var(--danger);
}

.btn-danger:hover {
    background: rgba(231,76,60,0.06);
    border-color: rgba(231,76,60,0.30);
}

.btn-success {
    background: transparent;
    border: 1px solid rgba(31,138,190,0.20);
    color: var(--primary);
}

.btn-success:hover {
    background: rgba(31,138,190,0.06);
    border-color: rgba(31,138,190,0.30);
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 420px;
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

#rename-old-name {
    color: var(--text-secondary);
    background: var(--bg-secondary);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 12px;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 20px;
}

.modal-body .form-group label {
    display: block;
    position: static;
    transform: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 8px;
}

.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    border-color: var(--primary);
    background: white;
}

.modal-body .form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px 18px;
}

/* Progress Bar */
.progress-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill.active {
    background: linear-gradient(90deg, var(--primary), var(--primary-light), #5bc0eb, var(--primary-light), var(--primary));
    background-size: 400% 100%;
    animation: progressPulse 1.8s ease-in-out infinite;
}

.progress-fill.active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    background-size: 200% 100%;
    animation: progressShimmer 1.2s ease-in-out infinite;
}

@keyframes progressPulse {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 42px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.progress-text.waiting::after {
    content: '';
    animation: dots 1.5s steps(3, end) infinite;
}

@keyframes dots {
    0% { content: ''; }
    33% { content: '.'; }
    66% { content: '..'; }
    100% { content: '...'; }
}

/* Upgrade Stats */
.upgrade-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
    font-weight: 600;
}

.stat-item i {
    font-size: 0.9rem;
}

.stat-success {
    color: var(--success);
}

.stat-fail {
    color: var(--danger);
}

.stat-divider {
    width: 1px;
    height: 18px;
    background: var(--border);
}

.stat-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin-left: 4px;
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.file-label:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(31,138,190,0.03);
}

.file-label i {
    font-size: 1.2rem;
}

/* Toast */
.toast {
    position: fixed;
    top: 70px;
    right: 20px;
    z-index: 2000;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    color: white;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background: var(--success);
    box-shadow: 0 4px 16px rgba(39,174,96,0.30);
}

.toast.error {
    background: var(--danger);
    box-shadow: 0 4px 16px rgba(231,76,60,0.30);
}

/* Loading */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #d0d8e0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b0b8c0;
}

@media (max-width: 768px) {
    body {
        height: 100dvh;
    }

    .main-content {
        height: 100dvh;
    }

    .dashboard {
        position: relative;
        height: calc(100dvh - var(--nav-height));
    }

    .sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(280px, 78vw);
        z-index: 30;
        transform: translateX(calc(-100% - 12px));
        box-shadow: none;
    }

    .mobile-sidebar-edge-toggle {
        position: absolute;
        top: 50%;
        left: -3px;
        z-index: 40;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 44px;
        padding: 0;
        border: none;
        background: transparent;
        color: rgba(30,42,62,0.55);
        font-size: 1rem;
        cursor: pointer;
        transform: translateY(-50%);
        transition: left 0.25s ease, color 0.2s ease, transform 0.2s ease;
        text-shadow: 0 1px 6px rgba(255,255,255,0.9);
    }

    .mobile-sidebar-edge-toggle::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(246,180,40,0.8) 0%, rgba(246,180,40,0.38) 45%, rgba(246,180,40,0) 75%);
        box-shadow: 0 0 18px rgba(246,180,40,0.5);
        transform: translate(-50%, -50%) scale(0.6);
        opacity: 0;
        pointer-events: none;
    }

    body.mobile-sidebar-hint-active .mobile-sidebar-edge-toggle::before {
        animation: mobile-sidebar-halo 1.8s ease-out infinite;
    }

    body.mobile-sidebar-hint-active .mobile-sidebar-edge-toggle {
        animation: mobile-sidebar-arrow-pulse 1.8s ease-in-out infinite;
    }

    .mobile-sidebar-edge-toggle:hover {
        color: var(--primary);
    }

    body.mobile-sidebar-open .mobile-sidebar-edge-toggle {
        left: calc(min(280px, 78vw) - 3px);
        color: var(--primary);
    }

    body.mobile-sidebar-open .mobile-sidebar-edge-toggle i {
        transform: rotate(180deg);
    }

    @keyframes mobile-sidebar-halo {
        0% {
            opacity: 0.9;
            transform: translate(-50%, -50%) scale(0.7);
        }
        70% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(2);
        }
        100% {
            opacity: 0;
            transform: translate(-50%, -50%) scale(2);
        }
    }

    @keyframes mobile-sidebar-arrow-pulse {
        0% {
            opacity: 0.55;
            text-shadow: 0 1px 6px rgba(255,255,255,0.55);
        }
        50% {
            opacity: 1;
            text-shadow: 0 1px 10px rgba(255,255,255,0.95);
        }
        100% {
            opacity: 0.55;
            text-shadow: 0 1px 6px rgba(255,255,255,0.55);
        }
    }

    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 0 12px 32px rgba(0,0,0,0.18);
    }

    .sidebar-backdrop {
        display: block;
        position: absolute;
        inset: 0;
        background: rgba(10,22,40,0.28);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
        z-index: 20;
    }

    body.mobile-sidebar-open .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .content-area {
        width: 100%;
        padding: 16px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px) + 32px);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .gray-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .gray-actions {
        width: 100%;
    }

    .fw-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .fw-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .fw-item-info {
        display: grid;
        grid-template-columns: 20px minmax(0, 1fr);
        grid-template-areas:
            'icon name'
            'icon size';
        align-items: start;
        column-gap: 10px;
        row-gap: 4px;
    }

    .fw-item-info i {
        grid-area: icon;
        margin-top: 2px;
    }

    .fw-item-info .fw-name {
        grid-area: name;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        word-break: break-all;
    }

    .fw-item-info .fw-size {
        grid-area: size;
    }

    .fw-item-actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .fw-item-actions .btn-sm,
    .fw-item-actions .target-badge {
        width: 100%;
        justify-content: center;
        margin: 0;
        padding: 5px 8px;
        font-size: 0.74rem;
        gap: 4px;
    }
}
