*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0f172a; color: #f1f5f9; min-height: 100vh; }
.hidden { display: none !important; }

/* Login */
.login { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; gap: 14px; }
.login h1 { font-size: 1.6rem; font-weight: 700; }
.login p { color: #94a3b8; font-size: 0.9rem; }
.login form { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; }
.login input[type=password] { background: #1e293b; border: 1.5px solid #334155; border-radius: 10px; color: #f1f5f9; font-size: 1rem; padding: 12px 16px; outline: none; }
.login input[type=password]:focus { border-color: #D4A853; }
.login button[type=submit] { background: #D4A853; color: #0f172a; font-weight: 700; font-size: 1rem; border: none; border-radius: 10px; padding: 13px; cursor: pointer; }
.err { color: #f87171; font-size: 0.85rem; min-height: 18px; }

/* App layout */
#app { display: flex; flex-direction: column; min-height: 100vh; }

/* Header */
header { position: sticky; top: 0; z-index: 10; background: #1e293b; border-bottom: 1px solid #334155; padding: 0 20px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
header h1 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.home-btn { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: #000; border-radius: 50%; color: #D4A853; text-decoration: none; flex-shrink: 0; }
.home-btn svg { width: 18px; height: 18px; }

/* Main */
main { padding: 20px 16px; max-width: 640px; width: 100%; margin: 0 auto; }

/* File list */
.file-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.file-item { background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.file-icon { color: #D4A853; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: 0.78rem; color: #94a3b8; margin-top: 3px; }
.file-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.btn-open { background: #D4A853; color: #0f172a; font-weight: 700; font-size: 0.8rem; border: none; border-radius: 8px; padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; white-space: nowrap; }
.btn-del { background: transparent; border: 1px solid #334155; color: #64748b; border-radius: 8px; padding: 7px 10px; cursor: pointer; display: inline-flex; align-items: center; line-height: 1; }
.btn-del:hover { border-color: #f87171; color: #f87171; }
.btn-del svg { width: 16px; height: 16px; }
.empty { text-align: center; color: #64748b; padding: 40px 20px; font-size: 0.9rem; }

/* Upload button */
.upload-wrap { margin-top: 4px; }
.upload-btn { display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; border: 2px dashed #334155; border-radius: 12px; padding: 20px; width: 100%; cursor: pointer; color: #64748b; font-size: 0.95rem; font-weight: 600; transition: border-color 0.15s, color 0.15s; font-family: inherit; }
.upload-btn:hover { border-color: #D4A853; color: #D4A853; }
.upload-btn svg { width: 20px; height: 20px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 10px 20px; font-size: 0.88rem; z-index: 200; opacity: 0; transition: opacity 0.25s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }
.toast.ok { border-color: #4ade80; color: #4ade80; }
.toast.fail { border-color: #f87171; color: #f87171; }

/* Spinner */
.spinner { width: 28px; height: 28px; border: 3px solid #334155; border-top-color: #D4A853; border-radius: 50%; animation: spin 0.7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
