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

:root{
  --bg:#080810;
  --card:rgba(255,255,255,0.04);
  --card-border:rgba(255,255,255,0.08);
  --text:#fff;
  --text-muted:rgba(255,255,255,0.65);
  --accent:linear-gradient(135deg,#60b0ff,#c084fc,#f472b6);
  --btn-primary:linear-gradient(135deg,#7c3aed,#a855f7);
  --btn-hover:linear-gradient(135deg,#8b5cf6,#c084fc);
  --radius:14px;
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

body{
  min-height:100vh;
  background:var(--bg);
  font-family:'Inter',sans-serif;
  color:var(--text);
  position:relative;
}

/* Background layers (same as landing) */
.bg-image{
  position:fixed;top:50%;left:50%;
  width:120%;height:120%;
  object-fit:cover;
  transform:translate(-50%,-50%) scale(1);
  opacity:0.4;z-index:0;
  animation:bgPulse 12s ease-in-out infinite alternate;
  pointer-events:none;
}
@keyframes bgPulse{
  0%{transform:translate(-50%,-50%) scale(1);opacity:0.7}
  100%{transform:translate(-50%,-50%) scale(1.08);opacity:0.85}
}
.bg-overlay{
  position:fixed;inset:0;z-index:0;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(8,8,16,0.7) 85%),
    linear-gradient(180deg, rgba(8,8,16,0.1) 0%, rgba(8,8,16,0.4) 100%);
  pointer-events:none;
}
.aurora{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;pointer-events:none;overflow:hidden}
.aurora-band{
  position:absolute;width:200%;height:40%;
  border-radius:50%;filter:blur(80px);opacity:0;
  animation:aurora-drift linear infinite;
}
.aurora-band:nth-child(1){
  background:linear-gradient(90deg,transparent,rgba(100,180,255,0.2),rgba(180,100,255,0.15),transparent);
  top:10%;left:-50%;animation-duration:16s;
}
.aurora-band:nth-child(2){
  background:linear-gradient(90deg,transparent,rgba(255,80,180,0.15),rgba(100,200,255,0.12),transparent);
  top:40%;left:-60%;animation-duration:20s;animation-delay:3s;
}
.aurora-band:nth-child(3){
  background:linear-gradient(90deg,transparent,rgba(140,100,255,0.18),rgba(255,120,200,0.1),transparent);
  top:65%;left:-40%;animation-duration:14s;animation-delay:7s;
}
@keyframes aurora-drift{
  0%{transform:translateX(-30%) rotate(-3deg);opacity:0}
  15%{opacity:1}85%{opacity:1}
  100%{transform:translateX(60%) rotate(3deg);opacity:0}
}
#bgCanvas{position:fixed;top:0;left:0;width:100%;height:100%;z-index:0;pointer-events:none}

.hidden{display:none!important}

/* Screens */
.screen{
  min-height:100vh;
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
#screen-main{
  display:flex;flex-direction:column;
  align-items:stretch;justify-content:flex-start;
  padding:0;
  position:relative;z-index:1;
}

/* Auth */
.auth-divider{
  display:flex;align-items:center;gap:12px;margin:16px 0;
  color:rgba(255,255,255,0.3);font-size:13px;
}
.auth-divider::before,.auth-divider::after{
  content:'';flex:1;height:1px;background:rgba(255,255,255,0.08);
}
#vk-login-wrap,#vk-popup-login-wrap,
#yandex-login-wrap,#yandex-popup-login-wrap,
#google-login-wrap,#google-popup-login-wrap{display:block;width:100%;max-width:336px;margin:0 auto}
.vk-auth-btn,.yandex-auth-btn,.google-auth-btn{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;height:44px;padding:0 16px;border:none;border-radius:8px;
  font-family:inherit;font-size:15px;font-weight:500;cursor:pointer;transition:background .2s;
}
.vk-auth-btn{background:#0077FF;color:#fff}
.vk-auth-btn:hover{background:#0066DD}
.vk-auth-btn:active{background:#0055BB}
.yandex-auth-btn{background:#FC3F1D;color:#fff}
.yandex-auth-btn:hover{background:#E0360F}
.yandex-auth-btn:active{background:#C42E0D}
.google-auth-btn{background:#fff;color:#333;border:1px solid rgba(255,255,255,0.15)}
.google-auth-btn:hover{background:#f5f5f5}
.google-auth-btn:active{background:#eee}
.auth-card{
  text-align:center;
  max-width:400px;width:100%;
  padding:48px 32px;
}
.logo-img{
  width:120px;height:120px;
  object-fit:cover;
  border-radius:50%;
  margin-bottom:12px;
  filter:drop-shadow(0 0 24px rgba(140,80,220,0.4));
}
h1{
  font-size:28px;font-weight:800;margin-bottom:6px;
  background:var(--accent);
  -webkit-background-clip:text;-webkit-text-fill-color:transparent;
}
.subtitle{color:var(--text-muted);font-size:15px;margin-bottom:24px}
#tg-login-wrap{margin:20px 0}
.hint{color:var(--text-muted);font-size:13px;margin-top:12px}
.error{color:#f87171;font-size:14px;margin-top:12px}

/* Card */
.card{
  background:var(--card);
  backdrop-filter:blur(20px);
  border:1px solid var(--card-border);
  border-top:1px solid rgba(168,85,247,0.25);
  border-radius:20px;
  padding:28px 24px;
  transition:border-color .3s, box-shadow .3s;
}
.card:hover{
  border-color:rgba(168,85,247,0.2);
  box-shadow:0 0 30px rgba(140,80,220,0.08);
}

/* Header */
header{
  display:flex;justify-content:space-between;align-items:center;
  padding:14px 24px;
  background:rgba(10,10,20,0.6);
  border-bottom:1px solid rgba(168,85,247,0.15);
  position:sticky;top:0;z-index:10;
  backdrop-filter:blur(30px);
  box-shadow:0 4px 20px rgba(0,0,0,0.3);
}
.header-left{display:flex;align-items:center;gap:10px}
.header-logo{
  width:40px;height:40px;border-radius:50%;object-fit:cover;
  filter:drop-shadow(0 0 8px rgba(140,80,220,0.4));
}
.header-title{
  font-weight:800;font-size:22px;letter-spacing:-0.3px;
  background:var(--accent);-webkit-background-clip:text;-webkit-text-fill-color:transparent;
  filter:brightness(1.2);
}
.header-divider{
  width:1px;height:24px;
  background:rgba(255,255,255,0.15);
  margin:0 4px;
}
.header-right{display:flex;align-items:center;gap:6px}
.header-right>*{
  display:inline-flex;align-items:center;justify-content:center;
  padding:8px 14px;
  border-radius:10px;
  font-size:13px;font-weight:600;
  line-height:1;
  height:34px;
}
.balance{background:rgba(124,58,237,0.2);color:#c084fc;border:none}
.user-name{background:rgba(255,255,255,0.06);color:var(--text-muted);border:1px solid rgba(255,255,255,0.08)}
.btn-logout{
  background:rgba(255,255,255,0.06);
  border:1px solid rgba(255,255,255,0.08);
  color:var(--text-muted);
  cursor:pointer;
}
.btn-login{
  padding:8px 20px;border-radius:10px;font-size:13px;font-weight:600;
  background:linear-gradient(135deg,rgba(124,58,237,0.3),rgba(168,85,247,0.2));
  border:1px solid rgba(168,85,247,0.4);color:#d8b4fe;
  cursor:pointer;transition:all .2s;
}
.btn-login:hover{
  background:linear-gradient(135deg,rgba(124,58,237,0.5),rgba(168,85,247,0.35));
  box-shadow:0 4px 15px rgba(168,85,247,0.25);
}

/* Nav (inline in header) */
nav{
  display:flex;gap:4px;
}
.nav-btn{
  padding:8px 20px;border:none;border-radius:10px;
  background:transparent;color:var(--text-muted);
  font-size:14px;font-weight:600;cursor:pointer;
  transition:all .2s;
}
.nav-btn.active{
  background:rgba(124,58,237,0.2);color:#c084fc;
  border-bottom:2px solid #a855f7;
  box-shadow:0 2px 8px rgba(168,85,247,0.3);
}
.nav-btn:hover{background:rgba(255,255,255,0.05)}

/* Profile button */
.btn-profile{
  padding:8px 18px;border:none;border-radius:10px;
  background:linear-gradient(135deg,rgba(124,58,237,0.25),rgba(168,85,247,0.15));
  color:#c084fc;font-size:14px;font-weight:600;cursor:pointer;
  transition:all .2s;font-family:inherit;
}
.btn-profile:hover{
  background:linear-gradient(135deg,rgba(124,58,237,0.4),rgba(168,85,247,0.3));
  box-shadow:0 4px 15px rgba(168,85,247,0.25);
}

/* Profile dropdown */
.profile-dropdown{
  position:fixed;top:70px;right:20px;z-index:1000;
  width:580px;max-height:calc(100vh - 90px);overflow-y:auto;
  background:rgba(16,12,30,0.97);
  backdrop-filter:blur(40px);
  border:1px solid rgba(255,255,255,0.1);
  border-radius:20px;
  padding:32px;
  box-shadow:0 24px 64px rgba(0,0,0,0.6), 0 0 60px rgba(140,80,220,0.12);
  animation:profileAppear .25s ease-out;
  scrollbar-width:thin;
  scrollbar-color:rgba(168,85,247,0.3) transparent;
}
.profile-dropdown::-webkit-scrollbar{width:6px}
.profile-dropdown::-webkit-scrollbar-track{background:transparent}
.profile-dropdown::-webkit-scrollbar-thumb{background:rgba(168,85,247,0.3);border-radius:3px}
.profile-dropdown::-webkit-scrollbar-thumb:hover{background:rgba(168,85,247,0.5)}
@keyframes profileAppear{0%{opacity:0;transform:translateY(-12px) scale(0.98)}100%{opacity:1;transform:translateY(0) scale(1)}}
.profile-dropdown.hidden{display:none}
.profile-section{padding:18px 0;border-bottom:1px solid rgba(255,255,255,0.06)}
.profile-section:last-child{border-bottom:none}
.profile-section-title{font-size:13px;font-weight:700;text-transform:uppercase;letter-spacing:1.2px;color:rgba(255,255,255,0.35);margin-bottom:12px}
.profile-row{display:flex;justify-content:space-between;align-items:center;padding:7px 0;font-size:16px}
.profile-row .label{color:rgba(255,255,255,0.5)}
.profile-row .value{color:#e8e4ff;font-weight:500}
.profile-badge{display:inline-block;padding:4px 12px;border-radius:8px;font-size:13px;font-weight:600;color:#fff}
.profile-badge.yandex{background:#FC3F1D}
.profile-badge.google{background:#4285F4}
.profile-badge.tg{background:#2AABEE}
.profile-badge.vk{background:#0077FF}
.profile-copy-row{display:flex;align-items:center;gap:10px;background:rgba(255,255,255,0.04);border-radius:12px;padding:12px 16px;margin:8px 0}
.profile-copy-row code{flex:1;font-size:15px;color:#c084fc;word-break:break-all}
.profile-copy-btn{border:none;background:rgba(124,58,237,0.3);color:#c084fc;border-radius:8px;padding:8px 16px;font-size:14px;cursor:pointer;transition:background .2s;white-space:nowrap;font-weight:500}
.profile-copy-btn:hover{background:rgba(124,58,237,0.5)}
.profile-gen-item{padding:8px 0;border-bottom:1px solid rgba(255,255,255,0.03);font-size:14px}
.profile-gen-item:last-child{border-bottom:none}
.profile-gen-prompt{color:rgba(255,255,255,0.6);margin-bottom:3px}
.profile-gen-meta{color:rgba(255,255,255,0.3);font-size:13px}
.profile-select{width:100%;background:rgba(255,255,255,0.06);border:1px solid rgba(255,255,255,0.08);border-radius:12px;padding:12px 16px;color:#e8e4ff;font-size:15px;margin-top:6px;font-family:inherit}
.profile-save-btn{width:100%;margin-top:12px;padding:14px;border:none;border-radius:12px;background:linear-gradient(135deg,rgba(124,58,237,0.4),rgba(168,85,247,0.3));color:#c084fc;font-size:13px;font-weight:600;cursor:pointer;transition:background .2s}
.profile-save-btn:hover{background:linear-gradient(135deg,rgba(124,58,237,0.6),rgba(168,85,247,0.5))}
.profile-logout{width:100%;padding:14px;border:none;border-radius:12px;background:rgba(239,68,68,0.15);color:#f87171;font-size:15px;font-weight:600;cursor:pointer;transition:background .2s;margin-top:4px}
.profile-logout:hover{background:rgba(239,68,68,0.25)}
@media(max-width:560px){.profile-dropdown{width:calc(100vw - 20px);right:-8px}}

/* Pages */
.page{padding:20px;max-width:1200px;margin:0 auto;width:100%}

/* Two-column layout */
.page-two-col{
  display:flex;gap:20px;
  align-items:stretch;
  animation:fadeSlideUp 0.6s ease-out;
}
@keyframes fadeSlideUp{
  0%{opacity:0;transform:translateY(20px)}
  100%{opacity:1;transform:translateY(0)}
}
.col-result{flex:1;min-width:0;display:flex;flex-direction:column}
.col-result .card{flex:1;display:flex;flex-direction:column;justify-content:center;align-items:center;overflow:hidden}
.col-form{width:360px;flex-shrink:0}

/* Result placeholder */
.result-empty{
  text-align:center;padding:60px 20px;
  color:var(--text-muted);
}
.result-empty-icon{font-size:48px;display:block;margin-bottom:12px}
.result-empty p{font-size:14px}

/* Forms */
.form-group{margin-bottom:18px}
.form-group label{
  display:block;font-size:12px;margin-bottom:8px;font-weight:600;
  letter-spacing:1.2px;text-transform:uppercase;
  color:#a78bfa;
}
.form-row{display:flex;gap:12px}
.form-row .form-group{flex:1}

input[type="text"],input[type="number"],input[type="search"],select,textarea{
  width:100%;
  padding:12px 16px;
  background:rgba(15,15,30,0.8);
  border:1px solid rgba(167,139,250,0.15);
  border-radius:var(--radius);
  color:#e2e0ff;
  font-size:14px;font-weight:500;
  font-family:inherit;
  outline:none;
  transition:border-color .2s,box-shadow .2s;
  -webkit-appearance:none;
  appearance:none;
}
input[type="text"]:hover,input[type="number"]:hover,input[type="search"]:hover,select:hover,textarea:hover{border-color:rgba(167,139,250,0.3)}
input[type="text"]:focus,input[type="number"]:focus,input[type="search"]:focus,textarea:focus{border-color:rgba(167,139,250,0.5);box-shadow:0 0 0 3px rgba(167,139,250,0.1)}
input::placeholder{color:rgba(255,255,255,0.25)}
select{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a78bfa' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 14px center;
  padding-right:36px;
  cursor:pointer;
}
select option{background:#14142a;color:#e2e0ff}

/* Custom dropdown */
.custom-select{position:relative;cursor:pointer}
.custom-select-display{
  padding:12px 36px 12px 16px;
  background:rgba(15,15,30,0.8);
  border:1px solid rgba(167,139,250,0.15);
  border-radius:var(--radius);
  color:#e2e0ff;font-size:14px;font-weight:500;
  font-family:inherit;
  transition:border-color .2s;
}
.custom-select-display:hover{border-color:rgba(167,139,250,0.3)}
.custom-select-display::after{
  content:'';position:absolute;right:14px;top:50%;
  transform:translateY(-50%);
  border-left:5px solid transparent;border-right:5px solid transparent;
  border-top:5px solid #a78bfa;
  transition:transform .2s;
}
.custom-select.open .custom-select-display::after{transform:translateY(-50%) rotate(180deg)}
.custom-select.open .custom-select-display{border-color:rgba(168,85,247,0.5)}
.custom-select-options{
  position:absolute;top:100%;left:0;right:0;
  margin-top:4px;
  background:rgba(18,18,36,0.98);
  backdrop-filter:blur(20px);
  border:1px solid rgba(167,139,250,0.2);
  border-radius:12px;
  overflow:hidden;
  z-index:50;
  opacity:0;transform:translateY(-8px);
  pointer-events:none;
  transition:opacity .2s,transform .2s;
  box-shadow:0 8px 24px rgba(0,0,0,0.4);
}
.custom-select.open .custom-select-options{
  opacity:1;transform:translateY(0);pointer-events:auto;
}
.custom-select-option{
  padding:10px 16px;
  color:#c4c0e8;font-size:14px;font-weight:500;
  transition:background .15s,color .15s;
  cursor:pointer;
}
.custom-select-option:hover{background:rgba(124,58,237,0.15);color:#e2e0ff}
.custom-select-option.selected{color:#d8b4fe;background:rgba(124,58,237,0.1)}
.custom-select-option+.custom-select-option{border-top:1px solid rgba(167,139,250,0.08)}
select:focus,textarea:focus{border-color:rgba(168,85,247,0.5);box-shadow:0 0 12px rgba(168,85,247,0.1)}
textarea{resize:vertical}

/* Upload */
.upload-area{
  position:relative;
  border:2px dashed rgba(167,139,250,0.2);
  border-radius:var(--radius);
  padding:24px;
  text-align:center;
  cursor:pointer;
  transition:border-color .2s,background .2s;
  color:#a78bfa;
  font-size:13px;font-weight:500;
  background:rgba(15,15,30,0.4);
}
.upload-clear{
  position:absolute;top:6px;right:6px;
  width:28px;height:28px;border-radius:50%;border:none;
  background:rgba(239,68,68,0.25);color:#f87171;
  font-size:18px;line-height:1;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  transition:background .2s;
}
.upload-clear:hover{background:rgba(239,68,68,0.5)}
.upload-area:hover{border-color:rgba(168,85,247,0.4);background:rgba(15,15,30,0.6)}
#upload-preview{
  max-width:200px;max-height:200px;
  border-radius:10px;margin-top:8px;
}
.upload-previews{
  display:flex;gap:8px;flex-wrap:wrap;justify-content:center;margin-top:8px;
}
.upload-thumb{
  position:relative;width:80px;height:80px;border-radius:8px;overflow:hidden;
}
.upload-thumb img{width:100%;height:100%;object-fit:cover;}
.upload-thumb-clear{
  position:absolute;top:2px;right:2px;
  width:20px;height:20px;border-radius:50%;border:none;
  background:rgba(239,68,68,0.7);color:#fff;font-size:12px;
  cursor:pointer;display:flex;align-items:center;justify-content:center;
}

/* Buttons */
.btn{
  display:block;width:100%;
  padding:14px;border:none;border-radius:var(--radius);
  font-size:16px;font-weight:600;color:#fff;
  cursor:pointer;transition:all .2s;
  text-align:center;text-decoration:none;
}
.btn-primary{
  background:var(--btn-primary);
  box-shadow:0 0 20px rgba(124,58,237,0.3);
  animation:btnGlow 2s ease-in-out infinite alternate;
}
@keyframes btnGlow{
  0%{box-shadow:0 0 15px rgba(124,58,237,0.2)}
  100%{box-shadow:0 0 30px rgba(168,85,247,0.45)}
}
.btn-primary:hover{background:var(--btn-hover);transform:translateY(-2px);box-shadow:0 0 35px rgba(168,85,247,0.5)}
.btn-primary:disabled{opacity:0.5;cursor:not-allowed;transform:none;animation:none;box-shadow:none}
.btn-small{
  display:inline-block;width:auto;
  padding:8px 16px;font-size:13px;
  border-radius:10px;
  background:rgba(124,58,237,0.3);
}
/* Result */
#result-area{flex:1;display:flex;flex-direction:column}
#result-image-wrap{position:relative;display:flex;justify-content:center;max-height:100%;overflow:hidden}
#result-image{
  max-width:100%;max-height:80vh;
  object-fit:contain;
  border-radius:var(--radius);
  display:block;
}
#result-download{
  position:absolute;bottom:12px;right:12px;
  margin:0;opacity:0.8;
  backdrop-filter:blur(10px);
  background:rgba(124,58,237,0.5);
}
#result-download:hover{opacity:1}

/* Spinner */
.loading{text-align:center;padding:24px}
.spinner{
  width:40px;height:40px;margin:0 auto 12px;
  border:3px solid rgba(255,255,255,0.1);
  border-top:3px solid #a855f7;
  border-radius:50%;
  animation:spin 1s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}
#gen-timer{color:var(--text-muted);font-size:14px}

h2{font-size:20px;font-weight:700;margin-bottom:16px;
  background:var(--accent);-webkit-background-clip:text;-webkit-text-fill-color:transparent;
}

/* Card grid (catalog & photoshoots) */
.card-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-top:16px;
}
.grid-card{
  background:var(--card);
  backdrop-filter:blur(20px);
  border:1px solid var(--card-border);
  border-top:1px solid rgba(168,85,247,0.2);
  border-radius:16px;
  overflow:hidden;
  cursor:pointer;
  transition:transform .3s ease,box-shadow .3s ease;
  position:relative;
}
.grid-card:hover{
  transform:translateY(-4px);
  box-shadow:0 12px 30px rgba(140,80,220,0.2);
}
.grid-card-img-wrap{
  position:relative;
  overflow:hidden;
}
.grid-card-img{
  width:100%;aspect-ratio:4/3;
  object-fit:cover;
  background:#0d0d1a;
  transition:transform .4s ease;
  display:block;
}
.grid-card-img-wrap::after{
  content:'Выбрать';
  position:absolute;
  top:50%;left:50%;
  transform:translate(-50%,-50%);
  padding:10px 24px;
  border-radius:10px;
  background:rgba(124,58,237,0.2);
  border:1px solid rgba(168,85,247,0.3);
  color:#c084fc;
  font-size:14px;font-weight:600;
  backdrop-filter:blur(8px);
  opacity:0;
  transition:opacity .3s ease;
  box-shadow:0 2px 8px rgba(168,85,247,0.3);
}
.grid-card-img-wrap::before{
  content:'';
  position:absolute;inset:0;
  background:rgba(0,0,0,0.5);
  opacity:0;
  transition:opacity .3s ease;
  z-index:1;
  pointer-events:none;
}
.grid-card-img-wrap::after{z-index:2}
.grid-card:hover .grid-card-img-wrap::after{
  opacity:1;
}
.grid-card:hover .grid-card-img-wrap::before{
  opacity:1;
}
.grid-card:hover .grid-card-img{
  transform:scale(1.05);
}
.grid-card-price{
  position:absolute;top:10px;right:10px;z-index:3;
  padding:4px 10px;border-radius:8px;
  background:rgba(10,10,20,0.7);
  backdrop-filter:blur(6px);
  border:1px solid rgba(167,139,250,0.2);
  color:#d8b4fe;font-size:12px;font-weight:600;
  display:flex;align-items:center;gap:4px;
}
.grid-card-body{padding:14px;text-align:center}
.card-grid.portrait .grid-card-img,
.card-grid.catalog-grid .grid-card-img{
  aspect-ratio:3/4;
}
.card-grid.catalog-grid{
  grid-template-columns:repeat(3,1fr);
}
.card-grid.photoshoot-grid{
  grid-template-columns:repeat(3,1fr);
}
.card-grid.photoshoot-grid .grid-card-img{
  aspect-ratio:1/1;
}
.grid-card-body{padding:14px;text-align:center}
.grid-card-title{
  font-size:14px;font-weight:600;margin-bottom:3px;
  color:#e8e4ff;letter-spacing:0.1px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.grid-card-sub{font-size:11px;color:#a78bfa;font-weight:500;letter-spacing:0.5px;text-transform:uppercase}

/* Catalog tags & model tabs */
.catalog-header{margin-bottom:4px}
.catalog-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px;justify-content:center}
.tag-btn,.model-tab{
  padding:8px 18px;border:1px solid rgba(167,139,250,0.12);border-radius:10px;
  background:rgba(15,15,30,0.4);color:rgba(255,255,255,0.55);font-size:13px;font-weight:600;
  cursor:pointer;transition:all .2s;letter-spacing:0.3px;
}
.tag-btn.active,.model-tab.active{
  background:rgba(124,58,237,0.2);color:#d8b4fe;
  border-color:rgba(168,85,247,0.35);
  box-shadow:0 0 10px rgba(168,85,247,0.1);
}
.tag-btn:hover,.model-tab:hover{
  border-color:rgba(168,85,247,0.25);color:rgba(255,255,255,0.75);
}
.tag-btn-clear{
  border-color:rgba(239,68,68,0.25);color:#f87171;
}
.tag-btn-clear:hover{
  border-color:rgba(239,68,68,0.4);color:#fca5a5;background:rgba(239,68,68,0.1);
}
.model-tab:hover{background:rgba(255,255,255,0.05)}

/* Input field */
.input-field{
  width:100%;padding:12px 14px;
  background:#1a1a2e;border:1px solid rgba(255,255,255,0.1);
  border-radius:var(--radius);color:var(--text);font-size:15px;
  font-family:inherit;outline:none;transition:border-color .2s;
}
.input-field:focus{border-color:rgba(168,85,247,0.5)}

/* Admin panel */
.admin-tabs{display:flex;gap:4px;margin-bottom:20px;border-bottom:1px solid rgba(255,255,255,0.06);padding-bottom:12px}
.admin-tab{
  padding:8px 20px;border:none;border-radius:10px;
  background:transparent;color:rgba(255,255,255,0.5);
  font-size:13px;font-weight:600;cursor:pointer;transition:all .2s;
}
.admin-tab.active{background:rgba(124,58,237,0.2);color:#c084fc}
.admin-tab:hover{color:#e8e4ff}
.admin-type-filters,.admin-tag-filters{display:flex;flex-wrap:wrap;gap:6px}
.admin-card-list{overflow-y:auto;max-height:calc(100vh - 350px);display:flex;flex-direction:column;gap:8px;padding-right:4px}
.admin-card-list::-webkit-scrollbar{width:4px}
.admin-card-list::-webkit-scrollbar-thumb{background:rgba(168,85,247,0.3);border-radius:4px}
.admin-card-item{
  display:flex;align-items:center;gap:12px;padding:12px;border-radius:12px;
  background:rgba(255,255,255,0.03);border:1px solid rgba(255,255,255,0.06);
  cursor:pointer;transition:all .2s;flex-shrink:0;
}
.admin-card-item:hover{background:rgba(124,58,237,0.08);border-color:rgba(168,85,247,0.2)}
.admin-card-item.expanded{background:rgba(124,58,237,0.1);border-color:rgba(168,85,247,0.3)}
.admin-card-item.inactive{opacity:0.5}
.admin-card-thumb{width:48px;height:48px;border-radius:8px;object-fit:cover;flex-shrink:0;background:rgba(255,255,255,0.05)}
.admin-card-info{flex:1;min-width:0;overflow:hidden}
.admin-card-item-title{font-size:13px;font-weight:600;color:#e8e4ff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.admin-card-badges{display:flex;gap:4px;margin-top:3px;flex-wrap:wrap}
.admin-type-badge{
  display:inline-block;padding:2px 8px;border-radius:5px;
  font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:0.3px;
}
.admin-type-badge.type-prompt{background:rgba(96,176,255,0.15);color:#60b0ff}
.admin-type-badge.type-dream{background:rgba(192,132,252,0.15);color:#c084fc}
.admin-type-badge.type-photoshoot{background:rgba(244,114,182,0.15);color:#f472b6}
.admin-edit-form{
  padding:16px;margin-top:8px;border-radius:12px;
  background:rgba(15,15,30,0.5);border:1px solid rgba(168,85,247,0.15);
}
.admin-edit-actions{display:flex;gap:10px;margin-top:14px}
.admin-edit-actions .btn{flex:1}
.admin-del{
  padding:8px 16px;border:none;border-radius:8px;
  background:rgba(239,68,68,0.2);color:#f87171;
  font-size:12px;font-weight:600;cursor:pointer;transition:background .2s;
}
.admin-del:hover{background:rgba(239,68,68,0.4)}
.admin-toggle-wrap{display:flex;align-items:center;gap:8px;margin-top:8px}
.admin-toggle-wrap label{font-size:13px;color:#a78bfa}

/* Clear history button */
.btn-clear{
  padding:10px 20px;border:none;border-radius:12px;
  background:linear-gradient(135deg,rgba(239,68,68,0.3),rgba(220,38,38,0.4));
  border:1px solid rgba(239,68,68,0.3);
  color:#fca5a5;font-size:13px;font-weight:600;
  cursor:pointer;transition:all .2s;
}
.btn-clear:hover{
  background:linear-gradient(135deg,rgba(239,68,68,0.5),rgba(220,38,38,0.6));
  box-shadow:0 0 20px rgba(239,68,68,0.2);
  transform:translateY(-1px);
}

/* Refresh button */
.btn-refresh{
  padding:10px 20px;border:none;border-radius:12px;
  background:linear-gradient(135deg,rgba(124,58,237,0.3),rgba(168,85,247,0.4));
  border:1px solid rgba(168,85,247,0.3);
  color:#d8b4fe;font-size:13px;font-weight:600;
  cursor:pointer;transition:all .2s;
}
.btn-refresh:hover{
  background:linear-gradient(135deg,rgba(124,58,237,0.5),rgba(168,85,247,0.6));
  box-shadow:0 0 20px rgba(168,85,247,0.2);
  transform:translateY(-1px);
}

/* Badge */
.badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:18px;padding:0 5px;
  border-radius:9px;font-size:11px;font-weight:700;
  background:#a855f7;color:#fff;margin-left:6px;
}

/* Result cards */
.result-card{
  background:var(--card);
  backdrop-filter:blur(20px);
  border:1px solid var(--card-border);
  border-top:1px solid rgba(168,85,247,0.2);
  border-radius:16px;
  overflow:hidden;
  cursor:pointer;
  transition:transform .3s ease,box-shadow .3s ease;
  position:relative;
}
.result-card:hover{
  transform:scale(1.03);
  box-shadow:0 8px 30px rgba(140,80,220,0.15);
}
.result-card-img{
  width:100%;aspect-ratio:4/3;
  object-fit:cover;background:rgba(255,255,255,0.03);
}
.result-card-loading{
  width:100%;aspect-ratio:4/3;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:rgba(255,255,255,0.02);
}
.result-card-body{padding:12px}
.result-card-title{font-size:13px;font-weight:600;margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#e8e4ff}
.result-card-timer{font-size:10px;color:#a78bfa;font-weight:600;letter-spacing:0.5px;text-transform:uppercase}
.result-card-status{font-size:10px;color:rgba(255,255,255,0.5);text-transform:uppercase;letter-spacing:0.5px}
.result-card .spinner{width:28px;height:28px;margin-bottom:8px;border-width:2px}

/* Result collage grid */
.result-collage{
  display:grid;gap:2px;aspect-ratio:4/3;overflow:hidden;background:rgba(0,0,0,0.3);
}
.result-collage img{width:100%;height:100%;object-fit:cover;display:block}
.rc-cols-2{grid-template-columns:1fr 1fr}
.rc-cols-3{grid-template-columns:1fr 1fr 1fr}

/* Download all button */
.modal-result-dl-all{
  display:block;text-align:center;padding:12px 20px;margin-bottom:16px;
  border-radius:12px;font-size:14px;font-weight:700;text-decoration:none;
  background:linear-gradient(135deg,rgba(124,58,237,0.3),rgba(168,85,247,0.2));
  border:1px solid rgba(168,85,247,0.4);color:#d8b4fe;
  transition:all .2s ease;letter-spacing:0.3px;
}
.modal-result-dl-all:hover{
  background:linear-gradient(135deg,rgba(124,58,237,0.5),rgba(168,85,247,0.35));
  box-shadow:0 4px 15px rgba(168,85,247,0.25);
}

/* Modal */
.modal-overlay{
  position:fixed;inset:0;z-index:200;
  background:rgba(0,0,0,0.7);
  backdrop-filter:blur(8px);
  display:flex;align-items:center;justify-content:center;
  padding:20px;
}
/* Custom scrollbar */
.modal-card::-webkit-scrollbar{width:6px}
.modal-card::-webkit-scrollbar-track{background:transparent}
.modal-card::-webkit-scrollbar-thumb{background:rgba(168,85,247,0.3);border-radius:3px}
.modal-card::-webkit-scrollbar-thumb:hover{background:rgba(168,85,247,0.5)}
.modal-card{scrollbar-width:thin;scrollbar-color:rgba(168,85,247,0.3) transparent}
.modal-card{
  background:rgba(20,20,40,0.95);
  backdrop-filter:blur(30px);
  border:1px solid rgba(168,85,247,0.2);
  border-radius:20px;
  padding:32px 28px;
  max-width:500px;width:100%;
  max-height:90vh;overflow-y:auto;
  position:relative;
  animation:fadeSlideUp 0.3s ease-out;
}
.modal-close{
  position:absolute;top:12px;right:16px;
  background:none;border:none;color:var(--text-muted);
  font-size:28px;cursor:pointer;line-height:1;
}
.modal-close:hover{color:#fff}
.modal-preview{
  width:100%;max-height:250px;
  object-fit:contain;border-radius:12px;
  margin-bottom:16px;background:rgba(255,255,255,0.03);
}
.modal-desc{color:rgba(255,255,255,0.6);font-size:14px;margin:8px 0 12px;line-height:1.6}
.modal-price{
  font-size:18px;font-weight:700;
  color:#d8b4fe;margin-bottom:4px;
  letter-spacing:0.3px;
}
.modal-result-img{
  width:100%;border-radius:12px;margin-bottom:12px;
}
.modal-result-dl{
  display:inline-block;padding:8px 16px;font-size:13px;
  border-radius:10px;background:rgba(124,58,237,0.3);
  color:#fff;text-decoration:none;margin-bottom:16px;
}

@media(max-width:768px){
  .page-two-col{flex-direction:column-reverse}
  .col-form{width:100%}
  .col-result{width:100%}
  .card-grid{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:500px){
  .card-grid{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:600px){
  .auth-card{padding:32px 16px}
  header{
    flex-wrap:wrap;gap:8px;
    padding:10px 14px;
  }
  .header-left{order:1}
  .header-right{
    order:2;
    gap:8px;
    flex-wrap:wrap;
    justify-content:flex-end;
  }
  .user-name{display:none}
  nav{padding:8px 14px;overflow-x:auto}
  .nav-btn{padding:8px 14px;font-size:13px;white-space:nowrap}
  .page{padding:14px}
  .form-row{flex-direction:column;gap:0}
  .card{padding:20px 16px}
}
