:root{
  --primary:#2b63ff;
  --bg:#f6f8fb;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --success:#10b981;
  --danger:#ef4444;
  --radius:12px;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family:-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif}
a{color:var(--primary);text-decoration:none}
.container{max-width:1024px;margin:24px auto;padding:0 16px}
.container.narrow{max-width:760px}
.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius);padding:18px 18px 22px;box-shadow:0 8px 30px rgba(0,0,0,.05);margin-bottom:18px}
.label{display:block;margin:10px 0 6px;color:#374151;font-weight:600}
textarea,input[type=text],input[type=password],input[type=file]{width:100%;padding:12px;border:1px solid var(--border);border-radius:10px;background:#fff;outline:none}
textarea{resize:vertical}
.btn-primary{display:inline-block;background:var(--primary);border:none;color:#fff;padding:10px 16px;border-radius:8px;cursor:pointer}
.btn-outline{display:inline-block;background:#fff;border:1px solid var(--border);color:#111;padding:10px 16px;border-radius:8px;cursor:pointer}
.btn-copy{display:inline-block;margin-left:10px;border:1px solid var(--border);padding:4px 8px;border-radius:6px;background:#fff;cursor:pointer}
.link{color:var(--primary)}
.alert{padding:10px 14px;border-radius:8px;margin:8px 0}
.alert.error{background:#fee2e2;color:#991b1b}
.success{background:#ecfeff;border:1px solid #bae6fd;padding:10px 14px;border-radius:10px}
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:16px}
.vcenter{display:flex;align-items:center}
.progress-wrap{background:#edf2ff;border-radius:10px;margin:14px 0;height:16px}
.progress-bar{background:var(--primary);height:16px;border-radius:10px;color:#fff;font-size:12px;line-height:16px;text-align:center;transition:width .2s}
.result .actions{margin-top:12px}
.topbar{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;background:#fff;border-bottom:1px solid var(--border)}
.topbar__title{font-size:18px;font-weight:700}
.topbar__nav .link{margin-left:12px}
.files{display:flex;flex-wrap:wrap;gap:12px}
.thumb{border:1px solid var(--border);border-radius:10px;overflow:hidden;width:160px;background:#fafafa}
.thumb img{width:100%;height:120px;object-fit:cover;display:block}
.thumb figcaption{padding:6px 8px;font-size:12px;color:#374151;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.file-item{display:flex;align-items:center;justify-content:space-between;border:1px dashed var(--border);border-radius:8px;padding:8px 12px;margin:8px 0;background:#fafafa}
.file-item .file-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:12px}
.text-preview pre{background:#0f172a;color:#e5e7eb;padding:12px;border-radius:8px;overflow:auto}
.viewer-block pre{background:#0f172a;color:#e5e7eb;padding:12px;border-radius:8px;overflow:auto}
.muted{color:var(--muted)}
.tiny{font-size:12px}
.centered{display:flex;align-items:center;justify-content:center;height:100vh}
.login-card{width:min(480px,90vw);background:#fff;border:1px solid var(--border);border-radius:16px;padding:24px 22px 18px;box-shadow:0 10px 40px rgba(0,0,0,.06)}
.login-card h2{margin:0 0 10px 0}
.only-input{display:grid;grid-template-columns:1fr auto;gap:8px}
.hist-head{display:grid;grid-template-columns:1fr auto auto;gap:12px;align-items:center;margin-bottom:10px}
@media (max-width:720px){
  .grid-2{grid-template-columns:1fr}
  .hist-head{grid-template-columns:1fr;gap:8px}
  .only-input{grid-template-columns:1fr}
}
