:root{
  color-scheme:dark;
  --bg:#080a0f;
  --panel:#0f131b;
  --panel-2:#141923;
  --line:#232a36;
  --line-soft:rgba(255,255,255,.055);
  --text:#f6f7fb;
  --muted:#8f98aa;
  --soft:#b9c1cf;
  --accent:#ff8a1f;
  --accent-2:#ffb347;
  --accent-3:#ffd17d;
  --good:#67d391;
  --danger:#ff7b86;
  --shadow:0 20px 60px rgba(0,0,0,.32);
  --radius:20px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  min-height:100vh;
  min-height:100dvh;
  background:
    radial-gradient(circle at 12% -10%,rgba(255,138,31,.14),transparent 30%),
    radial-gradient(circle at 100% 100%,rgba(255,179,71,.07),transparent 24%),
    linear-gradient(180deg,#090b10 0%,#07090d 100%);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  overflow-x:hidden;
}
button,input{font:inherit}
button{cursor:pointer;-webkit-tap-highlight-color:transparent}
a{-webkit-tap-highlight-color:transparent}

.topbar{
  position:sticky;
  top:0;
  z-index:20;
  min-height:68px;
  padding:calc(12px + env(safe-area-inset-top)) max(18px,env(safe-area-inset-right)) 12px max(18px,env(safe-area-inset-left));
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid var(--line-soft);
  background:rgba(8,10,15,.82);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
}
.brand{display:flex;align-items:center;gap:11px;color:inherit;text-decoration:none;min-width:0}
.brand-mark{
  width:40px;
  height:40px;
  flex:0 0 auto;
  border:1px solid rgba(255,179,71,.42);
  border-radius:12px;
  display:grid;
  place-items:center;
  font-weight:900;
  letter-spacing:-.06em;
  background:linear-gradient(145deg,rgba(255,138,31,.2),rgba(255,138,31,.04));
  color:var(--accent-3);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.025),0 0 20px rgba(255,138,31,.08);
}
.brand-copy{min-width:0}
.brand strong{display:block;font-size:13px;letter-spacing:.13em;white-space:nowrap}
.brand small{display:block;margin-top:2px;color:var(--muted);font-size:10px;letter-spacing:.03em}
.brand-mark.large{width:58px;height:58px;border-radius:18px;font-size:18px;margin:0 auto 16px}

.shell{
  width:min(1180px,calc(100% - 32px));
  margin:0 auto;
  padding:clamp(26px,4vw,48px) 0 44px;
}

.upload-card{
  position:relative;
  min-height:250px;
  padding:clamp(28px,5vw,48px) 24px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  border:1px dashed rgba(255,179,71,.26);
  border-radius:var(--radius);
  background:linear-gradient(180deg,rgba(20,25,35,.88),rgba(13,16,23,.95));
  box-shadow:var(--shadow);
  outline:none;
  transition:border-color .18s ease,background .18s ease,transform .18s ease,box-shadow .18s ease;
  contain:layout paint;
}
.upload-card:hover,.upload-card.dragover,.upload-card:focus-visible{
  border-color:rgba(255,179,71,.62);
  background:linear-gradient(180deg,rgba(29,26,21,.92),rgba(13,16,23,.97));
  transform:translateY(-1px);
  box-shadow:var(--shadow),0 0 45px rgba(255,138,31,.08);
}

.primary,.ghost{
  min-height:42px;
  border-radius:12px;
  border:1px solid transparent;
  padding:10px 18px;
  font-weight:800;
  transition:transform .16s ease,border-color .16s ease,color .16s ease,filter .16s ease,background .16s ease,box-shadow .16s ease;
  touch-action:manipulation;
}
.primary{
  background:linear-gradient(135deg,var(--accent-3) 0%,var(--accent-2) 38%,var(--accent) 100%);
  color:#1c1204;
  border-color:rgba(255,209,125,.35);
  box-shadow:0 8px 24px rgba(255,138,31,.26),0 0 26px rgba(255,179,71,.16),inset 0 1px 0 rgba(255,255,255,.35);
}
.primary:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
  box-shadow:0 12px 28px rgba(255,138,31,.34),0 0 36px rgba(255,179,71,.2),inset 0 1px 0 rgba(255,255,255,.42);
}
.primary:active,.ghost:active{transform:translateY(0)}
.primary.wide{width:100%}
.ghost{background:#121721;border-color:#272e3a;color:var(--soft)}
.ghost:hover{border-color:rgba(255,179,71,.34);color:#fff;box-shadow:0 0 18px rgba(255,138,31,.08)}
.ghost.small{min-height:36px;padding:7px 12px;font-size:12px}

.queue{display:grid;gap:9px;margin-top:14px}
.queue-item{padding:14px 16px;border:1px solid var(--line);background:var(--panel);border-radius:14px}
.queue-row{display:flex;align-items:center;justify-content:space-between;gap:14px}
.queue-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;font-size:13px}
.queue-meta{color:var(--muted);font-size:12px;flex:0 0 auto}
.progress{height:6px;background:#090c12;border-radius:999px;overflow:hidden;margin-top:10px}
.progress i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent-2));border-radius:inherit;transition:width .18s linear}

.stats-grid{
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(190px,.6fr);
  gap:12px;
  margin:14px 0 22px;
}
.stat-card{
  min-width:0;
  padding:18px;
  border-radius:16px;
  border:1px solid var(--line);
  background:linear-gradient(180deg,#11151e,#0d1118);
}
.stat-top{display:flex;align-items:center;justify-content:space-between;gap:18px}
.stat-card span{display:block;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.08em}
.stat-card strong{display:block;font-size:23px;line-height:1;letter-spacing:-.04em}
.stat-card small{display:block;color:#7c8697;margin-top:9px;line-height:1.4;font-size:11px}
.count-card{display:flex;flex-direction:column;justify-content:center}
.count-card strong{margin-top:8px;font-size:28px}
.meter{height:5px;background:#080b10;border-radius:999px;overflow:hidden;margin-top:12px}
.meter i{display:block;width:0;height:100%;background:linear-gradient(90deg,var(--accent),var(--accent-2),var(--accent-3));border-radius:inherit;transition:width .25s ease}

.files-panel{
  border:1px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
  background:rgba(15,19,27,.9);
  box-shadow:var(--shadow);
}
.panel-head{
  padding:18px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  border-bottom:1px solid var(--line);
}
.panel-title{min-width:0}
.eyebrow{color:var(--accent-2);font-size:10px;font-weight:800;letter-spacing:.17em}
.panel-head h2{margin:4px 0 0;font-size:20px;letter-spacing:-.03em}
.toolbar{display:flex;align-items:center;gap:9px;min-width:0}
.search{
  height:40px;
  width:clamp(180px,26vw,280px);
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 11px;
  border:1px solid #282f3b;
  background:#0a0d13;
  border-radius:11px;
  color:var(--muted);
}
.search:focus-within{border-color:rgba(255,179,71,.36);box-shadow:0 0 0 3px rgba(255,138,31,.08)}
.search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--text)}
.search input::placeholder{color:#657083}
.file-list{min-height:130px}
.file-row{
  display:grid;
  grid-template-columns:minmax(0,1fr) 100px 145px auto;
  gap:16px;
  align-items:center;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.045);
  transition:background .14s ease;
}
.file-row:last-child{border-bottom:0}
.file-row:hover{background:rgba(255,255,255,.018)}
.file-main{display:flex;align-items:center;min-width:0;gap:12px}
.file-icon{width:40px;height:40px;flex:0 0 auto;border-radius:11px;display:grid;place-items:center;background:#171d27;border:1px solid #27303c;font-size:16px;font-weight:700;color:#fff}
.file-text{min-width:0}
.file-name{font-weight:720;font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-id{margin-top:4px;color:#697386;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-size,.file-date{font-size:11px;color:var(--muted);white-space:nowrap}
.file-actions{display:flex;justify-content:flex-end;gap:6px}
.icon-btn{
  width:34px;
  height:34px;
  padding:0;
  border-radius:9px;
  border:1px solid #29313d;
  background:#11161f;
  color:#aab2c1;
  transition:.15s ease;
  touch-action:manipulation;
}
.icon-btn:hover{color:#fff;border-color:rgba(255,179,71,.34);box-shadow:0 0 16px rgba(255,138,31,.08)}
.icon-btn.danger:hover{color:var(--danger);border-color:rgba(255,123,134,.35);box-shadow:none}
.empty-state{padding:48px 18px;text-align:center;color:var(--muted);font-size:13px}

footer{text-align:center;color:#798395;font-size:10px;letter-spacing:.15em;padding:0 20px calc(28px + env(safe-area-inset-bottom))}

.modal-backdrop{
  position:fixed;
  inset:0;
  z-index:50;
  display:grid;
  place-items:center;
  background:rgba(3,5,8,.8);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  padding:20px max(20px,env(safe-area-inset-right)) max(20px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));
}
.modal-backdrop.hidden{display:none}
.login-card{width:min(390px,100%);padding:30px;border:1px solid rgba(255,179,71,.16);border-radius:20px;background:linear-gradient(180deg,#131822,#0d1118);box-shadow:0 30px 100px rgba(0,0,0,.55),0 0 28px rgba(255,138,31,.08);text-align:center}
.login-card h2{margin:7px 0 12px;font-size:25px}
.login-card input{width:100%;height:47px;border-radius:11px;border:1px solid rgba(255,179,71,.28);background:#090c11;padding:0 14px;color:#fff;outline:none;margin-bottom:10px}
.login-card input:focus{border-color:rgba(255,179,71,.62);box-shadow:0 0 0 3px rgba(255,138,31,.08)}
.form-error{min-height:18px;margin-top:12px;color:var(--danger);font-size:12px}

.toast-wrap{position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:70;display:grid;gap:8px;width:min(350px,calc(100% - 32px))}
.toast{padding:12px 14px;border:1px solid #303846;border-radius:11px;background:#151a23;box-shadow:var(--shadow);font-size:12px}
.toast.success{border-color:rgba(255,179,71,.25)}
.toast.error{border-color:rgba(255,123,134,.3)}

@media(max-width:900px){
  .shell{width:min(100% - 24px,1180px);padding-top:26px}
  .stats-grid{grid-template-columns:1fr 170px}
  .file-row{grid-template-columns:minmax(0,1fr) auto;gap:10px 12px}
  .file-size,.file-date{display:none}
  .file-actions{grid-column:2;grid-row:1}
}

@media(max-width:680px){
  .topbar{min-height:62px;padding-top:calc(10px + env(safe-area-inset-top));padding-bottom:10px}
  .brand-mark{width:36px;height:36px;border-radius:11px;font-size:13px}
  .brand strong{font-size:12px}
  .brand small{font-size:9px}
  .shell{width:min(100% - 20px,1180px);padding:20px 0 34px}
  .upload-card{min-height:220px;padding:30px 16px;border-radius:17px}
  .stats-grid{grid-template-columns:1fr 120px;gap:9px;margin:10px 0 16px}
  .stat-card{padding:14px;border-radius:14px}
  .stat-card strong{font-size:20px}
  .count-card strong{font-size:25px}
  .panel-head{padding:15px;align-items:stretch;flex-direction:column;gap:12px}
  .toolbar{width:100%}
  .search{width:auto;flex:1}
  .file-row{padding:12px 13px}
  .file-icon{width:38px;height:38px}
  .files-panel{border-radius:17px}
}

@media(max-width:460px){
  .brand small{display:none}
  .ghost.small{min-height:34px;padding:6px 10px}
  .shell{width:min(100% - 16px,1180px)}
  .upload-card{min-height:205px;padding:26px 14px}
  .stats-grid{grid-template-columns:1fr}
  .count-card{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px 12px}
  .count-card strong{margin:0;grid-column:2;grid-row:1 / span 2}
  .toolbar{display:grid;grid-template-columns:1fr auto}
  .file-actions{gap:5px}
  .icon-btn{width:32px;height:32px}
  footer{padding-bottom:calc(22px + env(safe-area-inset-bottom))}
}
