:root {
    --bg-color: #0f172a;
    --toolbar-bg: #1e293b;
    --tabbar-bg: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #3b82f6;
    --accent-hover: #60a5fa;
    --input-bg: #0f172a;
    --error-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% -20%, #1e293b, #020617);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- Login Screen --- */
.login-container {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background: radial-gradient(circle at 50% 50%, #0f172a, #020617);
    transition: opacity 0.5s ease, visibility 0.5s;
}

.login-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-card {
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    animation: slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.shield-icon {
    margin-bottom: 16px;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.5));
}

.login-header h2 {
    font-weight: 600;
    font-size: 22px;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-group {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 16px;
    height: 48px;
    margin-bottom: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.input-group svg {
    color: var(--text-secondary);
    margin-right: 12px;
    flex-shrink: 0;
}

.input-group input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.error-msg {
    color: var(--error-color);
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.error-msg.hidden {
    display: none;
}

#login-btn {
    width: 100%;
    height: 48px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, box-shadow 0.2s;
    font-family: inherit;
}

#login-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.35);
}

#login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* --- Main App --- */
.app-container {
    width: 96vw;
    height: 92vh;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px var(--border-color);
    background-color: #000;
    position: relative;
    transition: opacity 0.4s ease;
}

.app-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* --- Toolbar --- */
.toolbar {
    height: 52px;
    background: var(--toolbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    flex-shrink: 0;
    z-index: 10;
}

.window-controls {
    display: flex;
    gap: 7px;
    flex-shrink: 0;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.close    { background-color: #ff5f56; }
.minimize { background-color: #ffbd2e; }
.maximize { background-color: #27c93f; }

.address-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    height: 34px;
    padding: 0 10px;
    gap: 8px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.address-bar:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.lock-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
}

#url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 0;
}

#url-input::placeholder {
    color: var(--text-secondary);
}

#go-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    padding: 4px;
    transition: color 0.2s, background 0.2s;
    flex-shrink: 0;
}

#go-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ef4444;
    box-shadow: 0 0 6px #ef4444;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.status-dot.connected {
    background-color: #10b981;
    box-shadow: 0 0 6px #10b981;
}

/* --- Tab Bar --- */
.tab-bar {
    height: 38px;
    background: var(--tabbar-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 8px;
    gap: 4px;
    flex-shrink: 0;
    z-index: 9;
}

.tabs-container {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}

.tabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    border-radius: 6px 6px 0 0;
    padding: 0 10px;
    min-width: 100px;
    max-width: 200px;
    height: 30px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 6px;
    user-select: none;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.tab.active {
    background: var(--toolbar-bg);
    border-color: var(--border-color);
    border-bottom-color: var(--toolbar-bg);
    margin-bottom: -1px;
    position: relative;
    z-index: 10;
}

.tab-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    object-fit: contain;
    flex-shrink: 0;
}

.tab-title {
    flex: 1;
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

.tab.active .tab-title {
    color: var(--text-primary);
    font-weight: 500;
}

.tab-close {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
    padding: 0;
}

.tab:hover .tab-close,
.tab.active .tab-close {
    opacity: 0.6;
}

.tab-close:hover {
    opacity: 1 !important;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.new-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}

.new-tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* --- Browser Viewport --- */
.browser-viewport {
    flex: 1;
    position: relative;
    background: #1a1a1a;
    overflow: hidden;
}

#viewport-container {
    width: 100%;
    height: 100%;
    position: relative;
    outline: none;
    cursor: default;
    background: #1a1a1a;
    overflow: hidden;
}

.screencast-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    visibility: hidden;
    pointer-events: none;
}

.screencast-viewport.active {
    visibility: visible;
}

#interaction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: transparent;
    cursor: inherit;
}

/* --- Loading Overlay --- */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 5;
    transition: opacity 0.3s ease, visibility 0.3s;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 0.9s linear infinite;
}

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

/* --- Navigation Buttons --- */
.nav-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.nav-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

/* --- Toolbar Button --- */
.toolbar-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    margin-left: 4px;
    flex-shrink: 0;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.toolbar-btn:active {
    background: rgba(255, 255, 255, 0.12);
}

/* --- Clipboard Modal --- */
.clip-modal {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 320px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transform: translateY(0);
}

.clip-modal.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

.clip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.clip-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

#clip-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

#clip-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.clip-modal p {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-secondary);
}

#clip-text {
    width: 100%;
    height: 100px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

#clip-text:focus {
    border-color: var(--accent-color);
}

.clip-modal-actions {
    display: flex;
    justify-content: flex-end;
}

#clip-push-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

#clip-push-btn:hover {
    background: #2563eb;
}

#clip-push-btn:active {
    background: #1d4ed8;
}

/* Quick glow animation when clipboard is updated */
@keyframes clip-glow {
    0% { border-color: var(--border-color); box-shadow: none; }
    50% { border-color: var(--accent-color); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
    100% { border-color: var(--border-color); box-shadow: none; }
}

.clip-glow-anim {
    animation: clip-glow 1s ease-in-out;
}

/* --- Bookmarks Bar --- */
.bookmarks-bar {
    height: 32px;
    background: #0f172a;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 8px;
    flex-shrink: 0;
    z-index: 8;
}

.bookmarks-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
}

.bookmarks-container::-webkit-scrollbar {
    display: none;
}

.bookmark-item {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 2px 8px;
    height: 22px;
    font-size: 11px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    user-select: none;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 4px;
}

.bookmark-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.bookmark-item-icon {
    width: 12px;
    height: 12px;
    border-radius: 1px;
    object-fit: contain;
}

#add-bookmark-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 22px;
    height: 22px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

#add-bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

/* --- Progress Bar --- */
.progress-bar-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 10;
    pointer-events: none;
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-color);
    transition: width 0.2s ease, opacity 0.3s ease;
    opacity: 0;
}

/* --- Settings Modal --- */
.settings-modal {
    position: absolute;
    top: 60px;
    right: 16px;
    width: 340px;
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    transform: translateY(0);
}

.settings-modal.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    pointer-events: none;
}

.settings-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

#settings-close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s, color 0.15s;
}

#settings-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

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

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

.settings-group label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-group select,
.settings-group input[type="text"] {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.settings-group select:focus,
.settings-group input[type="text"]:focus {
    border-color: var(--accent-color);
}

.settings-group input[type="text"].hidden {
    display: none;
}

/* Custom Toggle Switch */
.toggle-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.toggle-control span {
    font-size: 13px !important;
    text-transform: none !important;
    color: var(--text-primary) !important;
    letter-spacing: 0px !important;
}

.toggle-control input {
    display: none;
}

.control-indicator {
    width: 34px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    transition: background 0.2s;
    border: 1px solid var(--border-color);
}

.control-indicator::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-secondary);
    top: 2px;
    left: 2px;
    transition: transform 0.2s, background 0.2s;
}

.toggle-control input:checked + .control-indicator {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

.toggle-control input:checked + .control-indicator::after {
    transform: translateX(14px);
    background: white;
}

/* Buttons */
.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    width: 100%;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-danger:active {
    background: #991b1b;
}

/* --- Windows Style Titlebar Controls --- */
.window-controls-win {
    display: flex;
    margin-left: auto;
    height: 100%;
    align-items: center;
}

.win-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 46px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: background 0.15s, color 0.15s;
}

.win-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.win-close:hover {
    background: #e81123 !important;
    color: white !important;
}

.win-btn:active {
    background: rgba(255, 255, 255, 0.15);
}

/* --- Custom Context Menu --- */
.context-menu {
    position: fixed;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    padding: 6px 0;
    min-width: 180px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.context-menu.hidden {
    display: none;
}

.context-menu-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 16px;
    text-align: left;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
    outline: none;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.context-menu-separator {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 4px 0;
}

/* --- Settings Panel Additions --- */
.settings-section-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    padding: 10px 0 4px;
    margin-top: 4px;
}

.label-hint {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 400;
}

.settings-hint {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 5px;
    line-height: 1.5;
}

.proxy-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    align-items: center;
}

.proxy-row input {
    flex: 1;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 6px 10px;
    font-size: 11px;
    font-family: monospace;
    outline: none;
}

.proxy-row input:focus { border-color: var(--accent-color); }

.zoom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

#zoom-level-display {
    font-size: 13px;
    font-weight: 600;
    min-width: 42px;
    text-align: center;
    color: var(--text-primary);
}

.btn-small {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.btn-small:hover { background: var(--accent-hover); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.btn-outline:hover { background: rgba(255,255,255,0.08); }

/* --- Downloads Panel --- */
.downloads-panel {
    position: fixed;
    bottom: 0;
    right: 20px;
    width: 320px;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
    z-index: 900;
    display: flex;
    flex-direction: column;
    max-height: 280px;
}

.downloads-panel.hidden { display: none; }

.downloads-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.downloads-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
}

.downloads-list {
    overflow-y: auto;
    padding: 8px 0;
    flex: 1;
}

.downloads-empty {
    color: var(--text-secondary);
    font-size: 12px;
    padding: 16px;
    text-align: center;
}

.download-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    gap: 10px;
    transition: background 0.1s;
}
.download-item:hover { background: rgba(255,255,255,0.04); }

.download-item-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    color: var(--text-primary);
}

.download-item-link {
    font-size: 11px;
    color: var(--accent-color);
    text-decoration: none;
    flex-shrink: 0;
    font-weight: 600;
}
.download-item-link:hover { color: var(--accent-hover); }

/* --- Upload Panel --- */
.upload-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 950;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.upload-panel.hidden { display: none; }

.upload-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.upload-header button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
}
.upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 14px 16px 8px;
    line-height: 1.5;
}
.upload-filename {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 0 16px;
    font-style: italic;
}
.upload-actions {
    display: flex;
    gap: 8px;
    padding: 14px 16px;
}

/* --- Find Bar --- */
.find-bar {
    position: absolute;
    top: 0;
    right: 0;
    background: #1e293b;
    border: 1px solid var(--border-color);
    border-radius: 0 0 0 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    z-index: 800;
}
.find-bar.hidden { display: none; }

#find-input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    font-family: inherit;
    width: 180px;
    outline: none;
}
#find-input:focus { border-color: var(--accent-color); }

.find-count {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 50px;
}

.find-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 4px;
    width: 26px;
    height: 26px;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.find-btn:hover { background: rgba(255,255,255,0.08); color: var(--text-primary); }
