* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d0d12;
  --panel: #16161f;
  --panel2: #1e1e2a;
  --accent: #00d4d4;
  --accent2: #00a8a8;
  --text: #e8e8f0;
  --muted: #8888a0;
  --danger: #ef4444;
}
html, body { background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; min-height: 100vh; }
body { padding-bottom: 40px; }

.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--panel); border-bottom: 1px solid #22222e; position: sticky; top: 0; z-index: 10; }
.brand { font-size: 18px; font-weight: 600; color: var(--accent); }
.actions { display: flex; gap: 8px; }

.btn { background: var(--panel2); color: var(--text); border: 1px solid #2a2a3a; padding: 8px 14px; border-radius: 8px; font-size: 14px; cursor: pointer; transition: .15s; }
.btn:hover { background: #26263a; }
.btn.primary { background: var(--accent); color: #001a1a; border-color: var(--accent); font-weight: 600; }
.btn.primary:hover { background: var(--accent2); }
.btn.danger { color: var(--danger); border-color: #3a2020; }
.btn.big { display: block; text-align: center; padding: 14px; font-size: 16px; text-decoration: none; margin-top: 16px; }

main { padding: 16px; max-width: 900px; margin: 0 auto; }

.drop { border: 2px dashed #2a2a3a; border-radius: 12px; padding: 24px; text-align: center; color: var(--muted); margin-bottom: 16px; transition: .15s; }
.drop.over { border-color: var(--accent); background: rgba(0,212,212,.05); color: var(--accent); }
.drop-icon { font-size: 32px; margin-bottom: 8px; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid #22222e; border-radius: 10px; padding: 12px 14px; }
.item .icon { font-size: 22px; }
.item .info { flex: 1; min-width: 0; }
.item .name { font-size: 14px; word-break: break-all; }
.item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.item .ops { display: flex; gap: 6px; }
.item .ops .btn { padding: 6px 10px; font-size: 12px; }

.card { background: var(--panel); border: 1px solid #22222e; border-radius: 12px; padding: 24px; text-align: center; margin-bottom: 16px; }
.file-icon { font-size: 48px; margin-bottom: 12px; }
.file-name { font-size: 16px; word-break: break-all; margin-bottom: 6px; }
.file-size { color: var(--muted); font-size: 14px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid #2a2a3a; border-radius: 12px; padding: 20px; max-width: 480px; width: 100%; }
.modal-box h3 { margin-bottom: 14px; color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 16px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field select, .field input { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid #2a2a3a; border-radius: 8px; padding: 10px; font-size: 14px; }
.share-url { background: var(--panel2); border: 1px solid #2a2a3a; border-radius: 8px; padding: 10px; font-size: 13px; word-break: break-all; margin-top: 10px; color: var(--accent); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--accent); color: var(--text); padding: 12px 20px; border-radius: 10px; z-index: 200; font-size: 14px; }
.toast.hidden { display: none; }

.status { margin-top: 10px; font-size: 13px; color: var(--muted); }

@media (max-width: 500px) {
  .item { flex-wrap: wrap; }
  .item .ops { width: 100%; justify-content: flex-end; }
}


/* ===== LOGIN ===== */
#login { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-box { background: var(--panel); border: 1px solid #22222e; border-radius: 16px; padding: 32px 24px; width: 100%; max-width: 360px; text-align: center; }
.login-brand { font-size: 28px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.login-sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.login-box input { width: 100%; background: var(--panel2); color: var(--text); border: 1px solid #2a2a3a; border-radius: 10px; padding: 12px 14px; font-size: 15px; margin-bottom: 14px; }
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box .btn.big { width: 100%; }

/* ===== FIX: hidden должен побеждать display:flex ===== */
#login[hidden], #app[hidden] { display: none !important; }
