html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #000000;
    color: #cccccc;
    font-family: 'Inter Tight', system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

/* Side by Side Option C: Left Sidebar, Right Player Viewport */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 0;
}

/* Left Column: Tightly structured Sidebar (width 320px) */
.sidebar {
    width: 320px;
    flex-shrink: 0;
    height: 100%;
    background-color: #0a0a0a;
    border-right: 1px solid #262626; /* Crisp structural grid line */
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding: 20px 15px;
    gap: 20px;
}

/* Sidebar Header and Window Controls */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #262626;
}

.sidebar-header h2 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.window-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.window-btn {
    background: transparent;
    border: 1px solid #262626;
    border-radius: 3px;
    color: #666666;
    width: 22px;
    height: 22px;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    line-height: 1;
    padding: 0 0 2px 0; /* Align minus perfectly */
    box-shadow: none !important;
}

.window-btn:hover {
    color: #ffffff;
    border-color: #444444;
    background-color: #1a1a1a;
}

#winExitAll:hover {
    color: #ff4757;
    border-color: #ff4757;
    background-color: rgba(255, 71, 87, 0.08);
}

.status-bar {
    font-size: 0.72em;
    font-weight: 700;
    color: #444444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Sidebar Now Playing Widget */
.now-playing-box {
    font-size: 0.8em;
    color: #666666;
    padding: 10px;
    background-color: #0f0f0f;
    border: 1px solid #262626;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.now-playing-box span {
    display: block;
    margin-top: 4px;
    color: #ffffff;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar Section Titles */
.section {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.section.library-section {
    flex: 1;
}

.section-title {
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666666;
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid #262626;
}

/* Collapsible "Add Video" Header */
.collapsible-title {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.15s ease;
}

.collapsible-title:hover {
    color: #ffffff;
}

/* Video List (scroll container) */
.video-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
    gap: 4px;
    padding: 2px 0 6px;
}

.video-list::-webkit-scrollbar {
    width: 3px;
}
.video-list::-webkit-scrollbar-track {
    background: transparent;
}
.video-list::-webkit-scrollbar-thumb {
    background: #262626;
    border-radius: 2px;
}

/* ── Video List Item ── */
.video-item {
    display: flex;
    align-items: center;
    gap: 0;
    background-color: #0c0c0c;
    border: 1px solid #1e1e1e;
    border-left: 3px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
    font-size: 0.82em;
    overflow: hidden;
    position: relative;
}

.video-item:hover {
    background-color: #161616;
    border-color: #333333;
    border-left-color: #555555;
}

/* Active / Now Playing state */
.video-item.active {
    background-color: #141414;
    border-color: #383838;
    border-left-color: #8a8a8a;
}

.video-item.active:hover {
    background-color: #181818;
    border-color: #444444;
    border-left-color: #9a9a9a;
}

.video-item.active .video-item-title {
    color: #ffffff;
    font-weight: 600;
}

.video-item.active .video-item-type {
    color: #c4c4c4;
    border-color: #3a3a3a;
    background-color: #161616;
}

/* Inner layout */
.video-item-body {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
    padding: 9px 10px;
}

.video-item-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    background-color: #161616;
    border: 1px solid #262626;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555555;
    transition: all 0.15s ease;
}

.video-item:hover .video-item-icon {
    color: #aaaaaa;
    border-color: #444444;
}

.video-item.active .video-item-icon {
    background-color: #1a1a1a;
    border-color: #3a3a3a;
    color: #d0d0d0;
}

.video-item-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.video-item-title {
    display: block;
    overflow: hidden;
    color: #888888;
    transition: color 0.15s ease;
    line-height: 1.3;
    white-space: nowrap;
}

.video-item-title-track {
    display: inline-block;
    min-width: 100%;
    white-space: nowrap;
}

.video-item-title.is-marquee .video-item-title-track {
    padding-right: 32px;
}

.video-item:hover .video-item-title.is-marquee .video-item-title-track,
.video-item.active .video-item-title.is-marquee .video-item-title-track {
    animation: video-title-marquee 8s linear infinite;
}

.video-item:hover .video-item-title {
    color: #dddddd;
}

.video-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-item-type {
    font-size: 0.65em;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    background-color: #111111;
    padding: 1px 5px;
    border-radius: 2px;
    border: 1px solid #1e1e1e;
    transition: all 0.15s ease;
}

/* Delete button */
.video-item-actions {
    padding: 0 8px;
    flex-shrink: 0;
}

.delete-btn {
    background: none;
    border: none;
    color: #2e2e2e;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
    border-radius: 2px;
}

.video-item:hover .delete-btn {
    color: #444444;
}

.delete-btn:hover {
    color: #ff4757 !important;
    background-color: rgba(255, 71, 87, 0.08);
}

@keyframes video-title-marquee {
    0%, 12% {
        transform: translateX(0);
    }
    88%, 100% {
        transform: translateX(calc(-100% + var(--title-visible-width, 160px)));
    }
}

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
    color: #444444;
    font-size: 0.8em;
    text-align: center;
    height: 80px;
}

/* Collapsible Form Styling */
.add-form {
    display: none; /* Collapsed by default */
    flex-direction: column;
    gap: 12px;
    padding-top: 10px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-size: 0.7em;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

input[type="text"], input[type="file"] {
    background: #000000;
    border: 1px solid #262626;
    border-radius: 3px;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 0.8em;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

input[type="text"]:focus {
    border-color: #666666;
}

select {
    background-color: #000000;
    border: 1px solid #262626;
    color: #ffffff;
    padding: 6px 10px;
    font-size: 0.8em;
    outline: none;
    font-family: inherit;
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

select:focus {
    border-color: #666666;
}

/* Monochromatic Flat Button */
.btn {
    background: #121212;
    border: 1px solid #262626;
    border-radius: 3px;
    color: #999999;
    padding: 8px 14px;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: center;
    margin-top: 5px;
    box-shadow: none !important;
}

.btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.helper-text {
    font-size: 0.7em;
    color: #444444;
    line-height: 1.3;
}

/* Right Column: Full-Height Viewport with strictly NO PADDING */
.player-section {
    flex: 1;
    height: 100vh;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background-color: #000000;
    padding: 0;
    margin: 0;
}

.mobile-sidebar-toggle {
    display: none;
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 150;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(8, 8, 8, 0.88);
    color: #f2f2f2;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mobile-sidebar-toggle:hover {
    background: rgba(20, 20, 20, 0.95);
    border-color: rgba(255, 255, 255, 0.22);
}

#vr-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000000;
    overflow: hidden;
    flex: 1;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
}

#startOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #050505;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#startOverlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#bigStartBtn {
    background-color: #0c0c0c;
    border: 1px solid #262626;
    color: #ffffff;
    font-family: 'Inter Tight', sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 16px 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

#bigStartBtn:hover {
    border-color: #ffffff;
    background-color: #111111;
    transform: scale(1.03);
}

#bigStartBtn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

#vr180 {
    width: 100%;
    height: 100%;
}

/* Settings Page View Dashboard styling */
#settingsView {
    background-color: var(--sidebar-bg, #0a0a0a);
    padding: 40px;
    overflow-y: auto;
    box-sizing: border-box;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color, #262626);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.settings-header h2 {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0;
    color: var(--text-highlight, #ffffff);
    letter-spacing: -0.3px;
    text-transform: uppercase;
}

#closeSettingsBtn {
    background: transparent;
    border: 1px solid var(--border-color, #262626);
    color: var(--text-normal, #cccccc);
    width: 34px;
    height: 34px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    border-radius: 3px;
    line-height: 1;
    padding: 0 0 3px 0;
}

#closeSettingsBtn:hover {
    color: #ffffff;
    border-color: #ffffff;
    background-color: var(--item-hover-bg, #1a1a1a);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 1024px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

.settings-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settings-card {
    background-color: var(--item-bg, #0f0f0f);
    border: 1px solid var(--border-color, #262626);
    padding: 24px;
    box-sizing: border-box;
    border-radius: 3px;
}

.settings-card-title {
    font-size: 0.85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted, #666666);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #262626);
    padding-bottom: 8px;
}

/* Live Controller Preview Canvas */
.preview-box {
    height: 140px;
    background-color: #050505;
    border: 1px solid var(--border-color, #262626);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    margin-top: 15px;
    margin-bottom: 20px;
    border-radius: 3px;
}

.preview-box::before {
    content: 'LIVE CONTROLLER PREVIEW';
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 0.65em;
    font-weight: 700;
    color: #444444;
    letter-spacing: 0.8px;
}

.instant-apply-badge {
    font-size: 0.72em;
    color: #4cd137;
    font-weight: 600;
    background-color: rgba(76, 209, 55, 0.06);
    border: 1px solid rgba(76, 209, 55, 0.15);
    padding: 4px 8px;
    border-radius: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.instant-apply-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    background-color: #4cd137;
    border-radius: 50%;
    display: inline-block;
}

@media (max-width: 768px) {
    body {
        overflow: hidden;
        height: 100%;
    }
    .app-container {
        position: relative;
        display: block;
        height: 100%;
    }
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: min(84vw, 320px);
        height: 100dvh;
        border-right: 1px solid #262626;
        border-top: none;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 220;
        padding: 18px 14px;
        gap: 16px;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.45);
    }
    .player-section {
        width: 100%;
        height: 100dvh;
    }
    #vr-container {
        width: 100%;
        height: 100dvh;
        aspect-ratio: auto;
    }
    .mobile-sidebar-toggle {
        display: inline-flex;
    }
    body.mobile-sidebar-open .sidebar {
        transform: translateX(0);
    }
    body.mobile-sidebar-open::after {
        content: '';
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 210;
    }
    .sidebar-header h2,
    .status-bar,
    .now-playing-box,
    .library-header-row .section-title,
    .sidebar-footer .btn span,
    .library-header-row .btn span {
        display: none;
    }
    .sidebar-header,
    .status-bar,
    .now-playing-box {
        border: none;
        padding: 0;
        margin: 0;
        min-height: 0;
    }
    .library-header-row {
        justify-content: flex-end !important;
        margin-bottom: 10px !important;
        padding-bottom: 0 !important;
        border-bottom: none !important;
    }
    .sidebar-footer {
        border-top: none !important;
        padding-top: 10px !important;
    }
    .sidebar-footer .btn,
    .library-header-row .btn {
        width: 44px !important;
        min-width: 44px;
        height: 44px;
        padding: 0 !important;
        justify-content: center !important;
        border-radius: 999px;
        font-size: 0 !important;
    }
    .library-header-row .btn::before {
        content: '+';
        font-size: 18px;
        line-height: 1;
    }
    #openSettingsBtn::before {
        content: '\2699';
        font-size: 16px;
        line-height: 1;
    }
    #openBrowserBtn::before {
        content: '\2197';
        font-size: 16px;
        line-height: 1;
    }
    .video-item {
        border-left-width: 2px;
    }
    .video-item-body {
        padding: 10px 8px;
    }
    .video-item-actions {
        padding: 0 6px;
    }
    html.mobile-layout-stacked,
    body.mobile-layout-stacked {
        overflow-y: auto;
        height: auto;
    }
    body.mobile-layout-stacked .app-container {
        display: flex;
        flex-direction: column;
        height: auto;
        min-height: 100%;
    }
    body.mobile-layout-stacked .player-section {
        order: 1;
        height: auto;
        min-height: 0;
    }
    body.mobile-layout-stacked #playerView {
        height: auto !important;
    }
    body.mobile-layout-stacked #vr-container {
        height: auto;
        aspect-ratio: 16 / 9;
    }
    body.mobile-layout-stacked .sidebar {
        order: 2;
        position: relative;
        top: auto;
        left: auto;
        width: 100%;
        height: auto;
        display: block;
        transform: none;
        transition: none;
        z-index: auto;
        padding: 18px 14px;
        gap: 16px;
        box-shadow: none;
        border-right: none;
        border-top: 1px solid #262626;
    }
    body.mobile-layout-stacked .mobile-sidebar-toggle {
        display: none;
    }
    body.mobile-layout-stacked .section.library-section {
        flex: none;
        min-height: auto;
    }
    body.mobile-layout-stacked .video-list {
        overflow: visible;
        max-height: none;
    }
    body.mobile-layout-stacked .sidebar-footer {
        margin-top: 14px !important;
    }
    body.mobile-layout-stacked::after {
        display: none;
    }
    body.mobile-layout-stacked .sidebar-header h2,
    body.mobile-layout-stacked .status-bar,
    body.mobile-layout-stacked .now-playing-box,
    body.mobile-layout-stacked .library-header-row .section-title,
    body.mobile-layout-stacked .sidebar-footer .btn span,
    body.mobile-layout-stacked .library-header-row .btn span {
        display: revert;
    }
    body.mobile-layout-stacked .sidebar-header,
    body.mobile-layout-stacked .status-bar,
    body.mobile-layout-stacked .now-playing-box {
        border: initial;
        padding: initial;
        margin: initial;
        min-height: initial;
    }
    body.mobile-layout-stacked .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-bottom: 12px;
        border-bottom: 1px solid #262626;
    }
    body.mobile-layout-stacked .status-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    body.mobile-layout-stacked .now-playing-box {
        display: block;
        padding: 10px;
        margin-bottom: 5px;
        border: 1px solid #262626;
    }
    body.mobile-layout-stacked .library-header-row {
        justify-content: space-between !important;
        margin-bottom: 12px !important;
        padding-bottom: 6px !important;
        border-bottom: 1px solid #262626 !important;
    }
    body.mobile-layout-stacked .sidebar-footer {
        border-top: 1px solid #262626 !important;
        padding-top: 15px !important;
    }
    body.mobile-layout-stacked .sidebar-footer .btn,
    body.mobile-layout-stacked .library-header-row .btn {
        width: 100% !important;
        min-width: 0;
        height: auto;
        padding: 8px 14px !important;
        justify-content: center !important;
        border-radius: 3px;
        font-size: 0.85em !important;
    }
    body.mobile-layout-stacked .library-header-row .btn {
        width: auto !important;
        padding: 4px 10px !important;
        font-size: 0.72em !important;
    }
    body.mobile-layout-stacked .library-header-row .btn::before,
    body.mobile-layout-stacked #openSettingsBtn::before,
    body.mobile-layout-stacked #openBrowserBtn::before {
        content: none;
    }
}

/* Modal Overlay Background with frosted glass */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    transition: all 0.3s ease;
}

/* Modal Dialog Box */
.modal-content {
    background-color: var(--item-bg, #0f0f0f);
    border: 1px solid var(--border-color, #262626);
    width: 90%;
    max-width: 420px;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color, #262626);
}

.modal-header h3 {
    margin: 0;
    font-size: 0.95em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-highlight, #ffffff);
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-muted, #666666);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color 0.15s ease;
}

.modal-close-btn:hover {
    color: var(--text-highlight, #ffffff);
}

.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-separator {
    display: flex;
    align-items: center;
    text-align: center;
    font-size: 0.65em;
    font-weight: 700;
    color: #444444;
    letter-spacing: 1px;
    margin: 5px 0;
}

.modal-separator::before, .modal-separator::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color, #262626);
}

.modal-separator:not(:empty)::before {
    margin-right: .5em;
}

.modal-separator:not(:empty)::after {
    margin-left: .5em;
}

/* ── AUTH OVERLAY ─────────────────────────────────────────────────────────── */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.auth-overlay.auth-visible {
    opacity: 1;
    pointer-events: all;
}

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

.auth-overlay.auth-gone {
    animation: authFadeOut 0.35s ease forwards;
    pointer-events: none;
}

.auth-card {
    background: #0a0a0a;
    border: 1px solid #262626;
    border-radius: 6px;
    padding: 40px 36px 32px;
    width: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    box-shadow: 0 24px 64px rgba(0,0,0,0.8);
}

.auth-logo {
    color: #555;
    margin-bottom: 20px;
}

.auth-title {
    font-size: 1.1em;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.2px;
    text-transform: uppercase;
    margin: 0 0 6px 0;
}

.auth-subtitle {
    font-size: 0.72em;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 28px 0;
    text-align: center;
}

.auth-digits {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.auth-digit {
    width: 36px;
    height: 44px;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    background: #0f0f0f;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4em;
    color: #ffffff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.auth-digit.auth-digit-filled {
    border-color: #444;
    background: #161616;
}

.auth-digit.auth-digit-ok {
    border-color: #4cd137 !important;
    color: #4cd137 !important;
}

.auth-digit.auth-digit-err {
    border-color: #ff4757 !important;
    color: #ff4757 !important;
}

.auth-error {
    display: none;
    font-size: 0.7em;
    color: #ff4757;
    letter-spacing: 0.4px;
    margin: 6px 0 16px;
    text-align: center;
    min-height: 1em;
}

.auth-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 12px;
    margin-bottom: 20px;
}

.auth-key {
    background: #111;
    border: 1px solid #222;
    border-radius: 4px;
    color: #cccccc;
    font-family: inherit;
    font-size: 1.1em;
    font-weight: 500;
    height: 52px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease, transform 0.08s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.auth-key:hover {
    background: #1e1e1e;
    border-color: #444;
    color: #fff;
}

.auth-key:active {
    transform: scale(0.93);
    background: #2a2a2a;
}

.auth-key-clear {
    color: #888;
    font-size: 1em;
}

.auth-key-enter {
    color: #4cd137;
    border-color: rgba(76, 209, 55, 0.2);
    font-size: 1.2em;
}

.auth-key-enter:hover {
    border-color: rgba(76, 209, 55, 0.5);
    background: rgba(76, 209, 55, 0.06);
    color: #4cd137;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.72em;
    color: #555555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    accent-color: #4cd137;
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

@keyframes authShake {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(-8px); }
    40%  { transform: translateX(8px); }
    60%  { transform: translateX(-6px); }
    80%  { transform: translateX(6px); }
    100% { transform: translateX(0); }
}

.auth-shake {
    animation: authShake 0.4s cubic-bezier(0.36,0.07,0.19,0.97) both;
}
