:root{
  --header-offset: 132px;
  --bg: #070A12;
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.66);
  --border: rgba(255,255,255,.12);
  --shadow: 0 25px 80px rgba(0,0,0,.55);
  --r: 22px;

  --led: rgba(255,255,255,.90);
  --ledSoft: rgba(255,255,255,.22);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  overflow-x:hidden;
}
a{ color:inherit; text-decoration:none; }

/* BG */
.bg{ position:fixed; inset:0; pointer-events:none; z-index:-1; }
.orb{ position:absolute; width:560px; height:560px; filter:blur(40px); opacity:.55; animation:float 10s ease-in-out infinite; }
.o1{ left:-160px; top:-140px; background:radial-gradient(circle at 30% 30%, rgba(0,225,255,.50), transparent 60%); }
.o2{ right:-180px; top:30px; background:radial-gradient(circle at 30% 30%, rgba(142,84,255,.50), transparent 60%); animation-delay:-2s; }
.grid{
  position:absolute; inset:0;
  background:
    linear-gradient(to right, rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size:56px 56px;
  mask-image: radial-gradient(circle at 40% 12%, black 0%, transparent 65%);
  opacity:.22;
}
.noise{
  position:absolute; inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
  opacity:.14;
  mix-blend-mode:overlay;
}
@keyframes float{
  0%,100%{ transform:translateY(0) translateX(0) scale(1); }
  50%{ transform:translateY(18px) translateX(10px) scale(1.02); }
}

/* Layout */
.container{
  width:min(1040px, calc(100% - 40px));
  margin:0 auto;
  padding:120px 0 44px;
}
.header{
  position:fixed;
  top:18px; left:50%;
  transform:translateX(-50%);
  width:min(1040px, calc(100% - 40px));
  display:flex; align-items:center; justify-content:space-between;
  gap:16px;
  padding:12px 14px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.38);
  backdrop-filter:blur(16px);
  border-radius:999px;
  box-shadow:var(--shadow);
  z-index:10;
}

/* HUGE LYPO */
.logoWrap{ padding:6px 10px; }
.logo{
  font-size: 44px;
  line-height: 1;
  letter-spacing: .22em;
  font-weight: 1000;
  text-transform: uppercase;
  color: rgba(255,255,255,.95);
  text-shadow:
    
    0 0 14px rgba(255,255,255,.08),
    0 0 36px rgba(255,255,255,.06),
    0 12px 44px rgba(0,0,0,.70)
  ;
  position: relative;
}
.logo::after{
  content:"";
  position:absolute;
  inset:-10px -12px;
  border-radius:16px;
  background: radial-gradient(260px 70px at 15% 30%, rgba(255,255,255,.10), transparent 62%);
  opacity:0; /* removed haze */
  pointer-events:none;
}


/* Modern Animated Tabs - Simplified & OPTIMIZED */
.tabs{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.tabBtn{
  position:relative;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.85);
  padding:10px 16px;
  border-radius:999px;
  cursor:pointer;
  font-weight:900;
  font-size:13px;
  letter-spacing:.02em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  will-change: transform;  /* GPU hint for hover */
}

/* Subtle hover state */
.tabBtn:hover{
  transform:translateY(-1px) translateZ(0);
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.22);
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

/* Active state - white button */
.tabBtn.isActive{
  color:rgba(0,0,0,.95);
  background:linear-gradient(135deg, 
    rgba(255,255,255,.98), 
    rgba(255,255,255,.92));
  border-color:rgba(255,255,255,.4);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.3), 
    0 4px 12px rgba(255,255,255,.2),
    0 6px 20px rgba(0,0,0,.2);
  transform:translateY(0) translateZ(0);
}

/* Press effect */
.tabBtn:active{
  transform:translateY(0) scale(0.98) translateZ(0);
  transition: all .1s ease;
}

/* Panels */
.tabPanel{ display:none; }
.tabPanel.isActive{ display:block; }

.hero{ padding-top:12px; }
.kicker{
  display:inline-flex;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--muted);
  font-size:13px;
}
.h1{
  margin:16px 0 10px;
  font-size: clamp(34px, 5vw, 54px);
  line-height:1.05;
  letter-spacing:-0.03em;
}
.grad{
  background: linear-gradient(90deg, rgba(0,225,255,.95), rgba(142,84,255,.95), rgba(255,120,120,.90));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.sub{
  margin:0;
  max-width:72ch;
  color:var(--muted);
  font-size:17px;
  line-height:1.65;
}

/* 4 Animated CTA buttons */
.ctaRow{ display:flex; gap:12px; flex-wrap:wrap; margin-top:18px; }

.ctaBtn{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:rgba(255,255,255,.90);
  cursor:pointer;
  font-weight:900;
  transition: transform .10s ease, background .18s ease, border-color .18s ease;
  overflow:hidden;
  user-select:none;
}
.ctaBtn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.20);
}
.ctaBtn:active{ transform: translateY(0) scale(.99); }
.ctaIcon{ opacity:.95; }
.ctaFx{
  position:absolute; inset:-2px;
  border-radius:16px;
  pointer-events:none;
  opacity:0;
  transition: opacity .18s ease;
}
.ctaBtn:hover .ctaFx{ opacity:1; }

/* Glow */
.ctaGlow .ctaFx{
  background: radial-gradient(260px 110px at 20% 20%, rgba(255,255,255,.20), transparent 60%),
              radial-gradient(240px 110px at 80% 30%, rgba(255,255,255,.14), transparent 55%);
}

/* Pulse */
.ctaPulse{ background:rgba(255,255,255,.08); }
.ctaPulse::after{
  content:"";
  position:absolute; inset:0;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.26);
  opacity:0;
  transform:scale(.92);
}
.ctaPulse:hover::after{ animation:pulse 1.15s ease-out infinite; }
@keyframes pulse{
  0%{ opacity:0; transform:scale(.92); }
  30%{ opacity:.45; }
  100%{ opacity:0; transform:scale(1.08); }
}

/* Magnetic */
.ctaMag{ background:rgba(255,255,255,.07); }
.ctaMag .ctaFx{
  background: radial-gradient(220px 100px at 30% 30%, rgba(255,255,255,.20), transparent 60%);
}

/* Shine */
.ctaShine{ background:rgba(255,255,255,.07); }
.ctaShine::before{
  content:"";
  position:absolute;
  top:-40%; left:-60%;
  width:55%; height:180%;
  transform:rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.22), transparent);
  opacity:0;
}
.ctaShine:hover::before{
  opacity:1;
  animation: shine 1.1s ease forwards;
}
@keyframes shine{
  from{ transform: translateX(0) rotate(18deg); }
  to{ transform: translateX(260%) rotate(18deg); }
}

/* Demo */
.demoCard{
  margin-top:18px;
  border-radius:var(--r);
  border:1px solid var(--border);
  background:rgba(0,0,0,.26);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.demoTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:12px 14px;
  border-bottom:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.05);
}
.demoTitle{ font-weight:1000; letter-spacing:.01em; }
.chips{ display:flex; gap:8px; flex-wrap:wrap; }
.chip{
  font-size:12px;
  color:rgba(255,255,255,.75);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
}
.demoBody{ padding:14px; display:grid; gap:14px; }

.form{ display:flex; flex-direction:column; gap:12px; }
.field{ display:flex; flex-direction:column; gap:8px; }
.field span{ color:rgba(255,255,255,.72); font-weight:900; font-size:13px; }
.field input{
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.28);
  color:rgba(255,255,255,.88);
  outline:none;
}
.field input:focus{
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.07);
}

/* Match dropdown styling to inputs (darker + more modern) */
.field select{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.30);
  color:rgba(255,255,255,.90);
  outline:none;
  appearance:none;
  -webkit-appearance:none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,.72) 50%),
    linear-gradient(135deg, rgba(255,255,255,.72) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) calc(50% - 2px),
    calc(100% - 13px) calc(50% - 2px);
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
}
.field select:focus{
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 0 0 4px rgba(255,255,255,.07);
}

.actions{ display:flex; gap:10px; flex-wrap:wrap; }
.btnPrimary,.btnGhost{
  position:relative;
  border-radius:14px;
  padding:12px 14px;
  font-weight:1000;
  cursor:pointer;
  border:1px solid rgba(255,255,255,.14);
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  overflow:hidden;
}

/* Slightly smaller primary/ghost buttons in the main action row (matches original compact look). */
.actions .btnPrimary,
.actions .btnGhost{
  padding:10px 12px;
  border-radius:12px;
  font-size:13px;
}

/* Make <a> buttons look identical to button buttons */
.btnLink{ text-decoration:none; display:inline-flex; align-items:center; }
.btnPrimary{ background:rgba(255,255,255,.86); color:rgba(0,0,0,.92); }
.btnGhost{ background:rgba(255,255,255,.06); color:rgba(255,255,255,.86); }
.btnPrimary:hover,.btnGhost:hover{
  transform:translateY(-1px);
  border-color:rgba(255,255,255,.20);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.btnGlow{
  position:absolute; inset:-3px;
  border-radius:16px;
  pointer-events:none;
  opacity:0;
  background: radial-gradient(200px 70px at 20% 30%, rgba(255,255,255,.25), transparent 60%);
  transition: opacity .18s ease;
}
.btnPrimary:hover .btnGlow,
.btnGhost:hover .btnGlow{ opacity:1; }

.statusRow{ display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.statusPill{
  display:inline-flex; gap:10px; align-items:center;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(0,0,0,.24);
}

.hintSep{ opacity:.65; margin: 0 8px; }
.costEstimate{ color: rgba(255,255,255,.82); }

/* Indeterminate progress bar (shown while uploading/processing) */
.progressWrap{
  width: 100%;
  max-width: 520px;
  height: 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.30);
  overflow:hidden;
}
.progressBar{
  position:relative;
  width:100%;
  height:100%;
}
.progressBar::before{
  content:"";
  position:absolute;
  top:-2px; bottom:-2px;
  width: 40%;
  left:-40%;
  background: linear-gradient(90deg,
    rgba(0,225,255,.00),
    rgba(0,225,255,.80),
    rgba(142,84,255,.80),
    rgba(255,120,120,.70),
    rgba(0,225,255,.00)
  );
  filter: blur(0.2px);
  animation: progressSweep 1.15s ease-in-out infinite;
}
@keyframes progressSweep{
  0%{ left:-45%; }
  100%{ left:105%; }
}
.ping{
  width:10px; height:10px; border-radius:999px;
  background:rgba(255,255,255,.92);
  box-shadow:0 0 0 0 rgba(255,255,255,.30);
  animation: ping 1.6s ease-out infinite;
}
@keyframes ping{
  0%{ box-shadow:0 0 0 0 rgba(255,255,255,.30); }
  70%{ box-shadow:0 0 0 12px rgba(255,255,255,0); }
  100%{ box-shadow:0 0 0 0 rgba(255,255,255,0); }
}
.hint{ color:var(--muted); font-size:13px; }

/* Enhanced auth message styling */
#authMsgPage {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  transition: all .3s ease;
  min-height: 18px;
}

#authMsgPage:empty {
  padding: 0;
  border: none;
  background: none;
}

#authMsgPage:not(:empty) {
  animation: slideIn .3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Error messages (❌) */
#authMsgPage:has-text("❌"),
#authMsgPage[style*="color: var(--bad)"] {
  background: rgba(255, 60, 60, .12);
  border: 1px solid rgba(255, 60, 60, .25);
  color: rgba(255, 100, 100, .95);
}

/* Success messages (✅) */
#authMsgPage:has-text("✅") {
  background: rgba(60, 255, 120, .12);
  border: 1px solid rgba(60, 255, 120, .25);
  color: rgba(100, 255, 150, .95);
}

/* Warning messages (⚠️) */
#authMsgPage:has-text("⚠️") {
  background: rgba(255, 200, 60, .12);
  border: 1px solid rgba(255, 200, 60, .25);
  color: rgba(255, 210, 100, .95);
}

.console{
  margin:0;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.20);
  color:rgba(255,255,255,.80);
  overflow:auto;
  max-height:280px;
  line-height:1.55;
}

/* Panels */
.panel{
  border-radius:var(--r);
  border:1px solid var(--border);
  background:rgba(0,0,0,.22);
  box-shadow:var(--shadow);
  padding:18px;
}
.panel h2{ margin:0 0 12px; letter-spacing:-0.02em; }
.grid2{ display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; }
.tile{
  grid-column: span 6;
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
}
.tileTitle{ font-weight:1000; margin-bottom:6px; }
.tile p{ margin:0; color:var(--muted); line-height:1.6; }

.pricing{ display:grid; grid-template-columns: repeat(12, 1fr); gap:12px; }
.priceCard{
  grid-column: span 4;
  padding:16px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
}
.priceCard.featured{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12), 0 24px 80px rgba(0,0,0,.35);
}
.priceTop{ display:flex; justify-content:space-between; align-items:baseline; margin-bottom:10px; }
.priceName{ font-weight:1000; }
.priceValue{ color:rgba(255,255,255,.80); }
.priceCard ul{ margin:0; padding-left:18px; color:rgba(255,255,255,.78); line-height:1.7; }

.codeCard{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.22);
  padding: 12px;
}
.code{ margin:0; color: rgba(255,255,255,.80); line-height:1.55; overflow:auto; }

/* Modern Footer */
.footer{
  margin-top: 60px;
  padding: 32px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}

.footerContent{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 2px;
}

.footerLeft{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footerBrand{
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,.95);
  text-transform: uppercase;
}

.footerLinks{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.footerLink{
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: color .2s ease;
  font-weight: 500;
}

.footerLink:hover{
  color: rgba(255,255,255,.95);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footerSep{
  color: rgba(255,255,255,.3);
  font-size: 12px;
  user-select: none;
}

.footerRight{
  font-size: 13px;
  color: rgba(255,255,255,.55);
  font-weight: 500;
}

@media (max-width: 768px){
  .footerContent{
    flex-direction: column;
    text-align: center;
    gap: 16px;
  }
  
  .footerLeft{
    align-items: center;
  }
  
  .footerLinks{
    justify-content: center;
  }
}
.muted{ color:var(--muted); }

/* --- Modern upload + loaders + progress + pricing hint --- */
.btnLabel{ display:inline-flex; align-items:center; gap:8px; }

/* Upload button (modern, darker, matches CTA vibe) */
.upload{ width:100%; }
.uploadBtn{
  position:relative;
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  min-height: 82px;
  max-height: 82px; /* Prevent button from enlarging */
  border-radius:18px;
  border:1px dashed rgba(255,255,255,.22);
  background:rgba(0,0,0,.30);
  color:rgba(255,255,255,.92);
  cursor:pointer;
  text-align:left;
  overflow:hidden;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.uploadBtn:hover{
  transform:translateY(-1px);
  background:rgba(0,0,0,.38);
  border-color:rgba(255,255,255,.32);
  box-shadow: 0 16px 50px rgba(0,0,0,.45);
}
.uploadBtn:active{ transform: translateY(0) scale(.99); }
.uploadIcon{
  width:42px; height:42px;
  display:grid; place-items:center;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(0,0,0,.35);
  box-shadow: 0 0 0 1px rgba(255,255,255,.06) inset;
  flex:0 0 auto;
  font-size:18px;
}
.uploadText{ display:flex; flex-direction:column; gap:4px; }
.uploadText strong{ font-weight:1000; letter-spacing:.01em; }
.uploadText em{
  font-style:normal;
  color:rgba(255,255,255,.70);
  font-size:13px;
}
.uploadFx{
  position:absolute; inset:-2px;
  border-radius:20px;
  pointer-events:none;
  opacity:0;
  background: conic-gradient(from 180deg,
    rgba(0,225,255,.55),
    rgba(142,84,255,.55),
    rgba(255,120,120,.50),
    rgba(0,225,255,.55)
  );
  filter: blur(14px);
  transition: opacity .18s ease;
}
.uploadBtn:hover .uploadFx{ opacity:.65; }
.uploadBtn.dragOver{
  border-style:solid;
  border-color: rgba(0,225,255,.55);
  background: rgba(0,225,255,.08);
}

/* Hint row (slightly darker) */
.hint{ color: rgba(255,255,255,.68); }
.hint strong{ color: rgba(255,255,255,.88); }
.hintSep{ margin:0 8px; opacity:.65; }
.costEstimate{ color: rgba(255,255,255,.85); }

/* Progress bar (indeterminate) */
.progressWrap{
  width:100%;
  margin-top:8px;
  border-radius:999px;
  background: rgba(0,0,0,.32);
  border: 1px solid rgba(255,255,255,.12);
  overflow:hidden;
}
.progressBar{
  position:relative;
  height:10px;
}
.progressBar::before{
  content:"";
  position:absolute;
  inset:0;
  width:45%;
  border-radius:999px;
  background: conic-gradient(from 180deg,
    rgba(0,225,255,.90),
    rgba(142,84,255,.90),
    rgba(255,120,120,.85),
    rgba(0,225,255,.90)
  );
  filter: blur(.0px);
  animation: indet 1.15s ease-in-out infinite;
}
@keyframes indet{
  0%{ transform: translateX(-120%); }
  100%{ transform: translateX(260%); }
}

/* Loading indicators */
@keyframes spin{ to{ transform: rotate(360deg); } }

.loader,
.btnSpinner{
  width:22px; height:22px;
  border-radius:999px;
  background: conic-gradient(
    rgba(0,225,255,1),
    rgba(142,84,255,1),
    rgba(255,120,120,1),
    rgba(0,225,255,1)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  animation: spin .8s linear infinite;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 0 24px rgba(142,84,255,.20);
}
.loader{ display:none; }
.statusPill.isLoading .loader{ display:inline-block; }
.statusPill.isLoading .ping{ display:none; }

.btnSpinner{
  display:none;
  margin-left:10px;
  width:18px; height:18px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
}
.btnPrimary.isLoading .btnSpinner,
.btnGhost.isLoading .btnSpinner{ display:inline-block; }

.btnPrimary:disabled,
.btnGhost:disabled,
.uploadBtn:disabled{
  opacity:.65;
  cursor:not-allowed;
  transform:none !important;
  box-shadow:none !important;
  pointer-events: none; /* Prevent interaction when disabled */
}

@media (max-width: 980px){
  .tabs{ display:none; }
  .container{ padding-top: 120px; }
  .logo{ font-size: 40px; letter-spacing: .20em; }
  .tile{ grid-column: span 12; }
  .priceCard{ grid-column: span 12; }
}



/* Force hidden attribute to always hide even if display is set elsewhere */
[hidden] { display: none !important; }

/* Upload button + output window side-by-side */
.uploadGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: stretch;
}

/* Mobile: Stack vertically for better space usage */
@media (max-width: 768px) {
  .uploadGrid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* Consistent upload button sizing */
.uploadBtn{
  padding: 14px 14px;
  min-height: 82px;
  max-height: 82px; /* Lock height to prevent resizing */
}

/* Preview Box (Output Window) */
.previewBox{
  min-height: 82px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(10,12,18,.55);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.previewBox:before{
  content:"";
  position:absolute;
  inset:-1px;
  background: radial-gradient(80% 80% at 30% 20%, rgba(120,160,255,.24), rgba(0,0,0,0));
  pointer-events:none;
}

/* Preview Header - Contains status and download button */
.previewHeader{
  position:relative;
  z-index:2;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding: 12px 14px;
  min-height: 60px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.previewInner{
  position:relative;
  z-index:1;
  display:flex;
  gap:10px;
  align-items:center;
  flex: 1;
  min-width: 0;
}

.previewIcon{
  font-size: 18px;
  filter: drop-shadow(0 8px 20px rgba(120,160,255,.35));
  flex-shrink: 0;
}

.previewText{
  font-weight: 700;
  letter-spacing: .1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Download Button in Preview Header */
.btnDownload{
  position:relative;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  transition: all .25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  flex-shrink: 0;
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.9);
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.btnDownload::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius:999px;
  background: radial-gradient(circle at 50% 50%, 
    rgba(140,255,210,.3), 
    transparent 70%);
  opacity:0;
  transition: opacity .3s ease;
  pointer-events:none;
  z-index:-1;
}

.btnDownload:hover{
  transform: scale(1.02) translateY(-1px);
  background: rgba(140,255,210,.15);
  border-color: rgba(140,255,210,.35);
  box-shadow: 
    0 0 0 1px rgba(140,255,210,.2),
    0 8px 24px rgba(0,0,0,.35),
    0 0 30px rgba(140,255,210,.15);
}

.btnDownload:hover::before{
  opacity: 1;
}

.btnDownload:active{
  transform: scale(0.98) translateY(0);
}

/* Download button visible and animated when ready */
.btnDownload.isReady{
  opacity: 1;
  transform: scale(1);
  background: linear-gradient(135deg, 
    rgba(140,255,210,.25), 
    rgba(100,200,255,.2));
  border-color: rgba(140,255,210,.45);
  box-shadow: 
    0 0 0 1px rgba(140,255,210,.3),
    0 4px 16px rgba(140,255,210,.25),
    0 8px 32px rgba(0,0,0,.35);
  animation: downloadPulse 2s ease-in-out infinite;
}

.btnDownload.isReady::before{
  opacity: 0.8;
  animation: shimmer 3s ease-in-out infinite;
}

.btnDownload.isReady .btnGlow{
  opacity: 1;
}

@keyframes downloadPulse{
  0%, 100%{ 
    box-shadow: 
      0 0 0 1px rgba(140,255,210,.3),
      0 4px 16px rgba(140,255,210,.25),
      0 8px 32px rgba(0,0,0,.35);
  }
  50%{ 
    box-shadow: 
      0 0 0 1px rgba(140,255,210,.5),
      0 6px 20px rgba(140,255,210,.35),
      0 12px 40px rgba(0,0,0,.4),
      0 0 40px rgba(140,255,210,.2);
  }
}

.previewHint{
  position:relative;
  z-index:1;
  padding: 0 16px 14px;
  opacity:.7;
  font-size: 12px;
}


/* Output video preview inside the output window (no autoplay) */
.outputVideo{
  width: calc(100% - 24px);
  max-width: 420px; /* Reduced from 560px for more compact display */
  max-height: 320px; /* Prevent video from being too tall */
  margin: 6px auto 12px; /* Center it */
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.28);
  display:block;
  object-fit: contain; /* Maintain aspect ratio without overflow */
}

/* Mobile: Make video even more compact and fit screen */
@media (max-width: 768px) {
  .outputVideo {
    max-width: 100%;
    width: calc(100% - 16px);
    max-height: 280px; /* Limit height on mobile */
    margin: 6px 8px 12px;
  }
}

/* Small mobile: Further constraints */
@media (max-width: 480px) {
  .outputVideo {
    max-height: 220px; /* Even more compact on small screens */
  }
}

button.btnLink{ display:inline-flex; align-items:center; }


/* “Snapshot” placeholder while generating */
.previewSkeleton{
  width: calc(100% - 24px);
  margin: 6px 12px 12px;
  height: 158px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.12);
  background:
    radial-gradient(110px 70px at 28% 35%, rgba(0,225,255,.22), transparent 60%),
    radial-gradient(120px 80px at 70% 55%, rgba(142,84,255,.20), transparent 60%),
    linear-gradient(120deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  position: relative;
  overflow: hidden;
}
.previewSkeleton::before{
  content:"";
  position:absolute;
  inset:-40% -60%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.16), transparent);
  animation: skShine 1.25s ease-in-out infinite;
}
.previewSkeleton::after{
  content:"▶";
  position:absolute;
  left: 14px;
  bottom: 12px;
  width: 40px;
  height: 40px;
  display:grid;
  place-items:center;
  border-radius: 14px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.92);
  box-shadow: 0 18px 46px rgba(0,0,0,.35);
}
@keyframes skShine{
  0%{ transform: translateX(-20%) rotate(18deg); opacity:.0; }
  35%{ opacity: .9; }
  100%{ transform: translateX(40%) rotate(18deg); opacity:.0; }
}


/* Preview window: not pressable/clickable (except the video controls) */
.previewBox{ cursor: default; pointer-events: none; }
.previewBox *{ pointer-events: none; }
.previewBox video{ pointer-events: auto; } /* allow playback controls only */
.previewBox .btnDownload{ pointer-events: auto; cursor: pointer; } /* allow download button clicks */


/* Remove the “fog” overlay when an output video is ready */
.previewBox.hasVideo:before{
  opacity: 0 !important;
}


/* When output is ready, make the preview look “original” (no haze overlay) */
.previewBox.hasVideo{
  background: rgba(0,0,0,.18) !important;
  max-width: 600px; /* Constrain to half size when video finishes */
  margin-left: auto;
  margin-right: auto;
  transition: max-width .4s ease;
}
.previewBox.hasVideo:before{
  opacity: 0 !important;
}


/* Creative generating-text animation */
.previewHint{
  transition: opacity .4s ease;
}

.hintPop{
  animation: hintPop 0.8s ease-out;
}

@keyframes hintPop{
  0%{
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }
  60%{
    opacity: 1;
    transform: translateY(-1px) scale(1.01);
  }
  100%{
    opacity: .85;
    transform: translateY(0) scale(1);
  }
}


/* Landing showcase (English ➜ French) */
.showcaseCard{
  margin-top: 18px;
  border-radius: 20px;
  padding: 16px 16px 14px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 28px 80px rgba(0,0,0,.35);
  position: relative;
  overflow: hidden;
}
.showcaseCard:before{
  content:"";
  position:absolute;
  inset:-40%;
  background:
    radial-gradient(260px 180px at 18% 15%, rgba(0,225,255,.16), transparent 60%),
    radial-gradient(280px 200px at 78% 55%, rgba(142,84,255,.14), transparent 60%),
    linear-gradient(120deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  filter: blur(0px);
  pointer-events:none;
}

.showcaseTop{
  position: relative;
  display:flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.showcaseTitle{
  font-weight: 800;
  letter-spacing: .2px;
}
.showcaseSub{
  color: rgba(255,255,255,.72);
  font-size: 13px;
}

.showcaseGrid{
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: center;
}

.showVid{
  margin: 0;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.24);
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.32);
}
.showVidEl{
  display:block;
  width: 100%;
  max-height: 168px; /* small on purpose */
  object-fit: cover;
  background: rgba(0,0,0,.25);
}
.showVidEl::-webkit-media-controls-panel{
  background: rgba(0,0,0,.35);
}

.showCap{
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}
.capTag{
  display:inline-flex;
  align-items:center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  color: rgba(255,255,255,.86);
}
.capTagAlt{
  background: rgba(0,225,255,.10);
  border-color: rgba(0,225,255,.22);
}
.capText{
  font-weight: 700;
  color: rgba(255,255,255,.92);
}

.showArrow{
  display:grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.arrowLine{
  position:absolute;
  width: 48px;
  height: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,.10), rgba(255,255,255,.24), rgba(255,255,255,.10));
  opacity: .7;
  border-radius: 999px;
}
.arrowHead{
  font-size: 22px;
  opacity: .9;
  transform: translateX(1px);
  filter: drop-shadow(0 10px 22px rgba(0,0,0,.4));
}

.showcaseHint{
  position: relative;
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255,255,255,.62);
}

/* Mobile: stack nicely */
@media (max-width: 720px){
  .showcaseGrid{
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .showArrow{
    width: 42px;
    height: 42px;
    justify-self: center;
    transform: rotate(90deg);
  }
  .arrowLine{
    width: 36px;
  }
}


/* Compact showcase tab (above demo card) */
.showcaseTab{
  margin: 0 0 14px;
  display:flex;
  align-items:center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 22px 62px rgba(0,0,0,.32);
  position: relative;
  overflow: hidden;
}
.showcaseTab:before{
  content:"";
  position:absolute;
  inset:-40%;
  background:
    radial-gradient(220px 150px at 12% 15%, rgba(0,225,255,.14), transparent 60%),
    radial-gradient(240px 160px at 82% 55%, rgba(142,84,255,.12), transparent 60%),
    linear-gradient(120deg, rgba(255,255,255,.06), rgba(255,255,255,0));
  pointer-events:none;
}

.showTabLeft{
  position: relative;
  display:flex;
  flex-direction: column;
  gap: 3px;
  min-width: 160px;
}
.showTabTitle{
  font-weight: 850;
  letter-spacing: .2px;
}
.showTabSub{
  font-size: 12px;
  color: rgba(255,255,255,.68);
}

.showTabMedia{
  position: relative;
  display:flex;
  align-items:center;
  gap: 10px;
}

.miniVid{
  position: relative;
  width: 86px;
  height: 126px; /* portrait */
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(135deg, rgba(124,58,237,0.3), rgba(59,130,246,0.3));
  box-shadow: 0 14px 40px rgba(0,0,0,.30);
}

/* Add icon overlay when video is loading */
.miniVid::before {
  content: "🎬";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}
.miniVidEl{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display:block;
  filter: saturate(1.05) contrast(1.02);
  background: linear-gradient(135deg, rgba(124,58,237,0.2), rgba(59,130,246,0.2));
}
.miniPlay{
  position:absolute;
  left: 8px;
  bottom: 8px;
  width: 30px;
  height: 30px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.38);
  color: rgba(255,255,255,.92);
  cursor: pointer;
  display:grid;
  place-items:center;
  box-shadow: 0 18px 44px rgba(0,0,0,.36);
}
.miniPlay:active{ transform: translateY(1px); }
.miniCap{
  position:absolute;
  right: 8px;
  top: 8px;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.86);
}

.miniArrow{
  font-size: 18px;
  opacity: .9;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,.35));
}

@media (max-width: 820px){
  .showcaseTab{
    flex-direction: column;
    align-items: flex-start;
  }
  .showTabMedia{
    width:100%;
    justify-content: space-between;
  }
  .miniVid{
    width: 46%;
    min-width: 140px;
  }
}


/* Subtle caption under showcase title */
.showTabCaption{
  font-size: 12px;
  color: rgba(255,255,255,.58);
  letter-spacing: .2px;
}

/* Waveform overlay (only visible while playing) */
.miniWave{
  position:absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  display:flex;
  align-items:flex-end;
  gap: 4px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.30);
  border: 1px solid rgba(255,255,255,.14);
  opacity: 0;
  pointer-events:none;
  transition: opacity .2s ease;
}
.miniWave span{
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.86);
  opacity: .9;
  animation: wave 0.95s ease-in-out infinite;
}
.miniWave span:nth-child(2){ animation-delay: .12s; }
.miniWave span:nth-child(3){ animation-delay: .24s; }
.miniWave span:nth-child(4){ animation-delay: .36s; }
.miniWave span:nth-child(5){ animation-delay: .48s; }

@keyframes wave{
  0%{ transform: translateY(0); height: 8px; opacity:.65; }
  35%{ transform: translateY(-3px); height: 16px; opacity:1; }
  70%{ transform: translateY(0); height: 10px; opacity:.75; }
  100%{ transform: translateY(0); height: 8px; opacity:.65; }
}

/* When playing, show waveform */
.miniVid.isPlaying .miniWave{ opacity: 1; }


/* Logo spinner replaces the “O” in LYPO */
.logoSpinner{
  display:inline-block;
  width: 28px;
  height: 28px;
  margin: 0 2px;
  vertical-align: -4px;
  border-radius: 999px;
  background: conic-gradient(
    rgba(0,225,255,1),
    rgba(142,84,255,1),
    rgba(255,120,120,1),
    rgba(0,225,255,1)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  animation: spin 1.2s linear infinite;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.18) inset,
    0 0 22px rgba(142,84,255,.35);
}

/* Small poetic tagline after logo */
.logoTagline{
  display:block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.55);
}

/* --- Auth modal (minimal, hidden by default) --- */
.modal[hidden]{ display:none !important; }
.modal{ position:fixed; inset:0; z-index:50; }
.modalBackdrop{ position:absolute; inset:0; background:rgba(0,0,0,.55); backdrop-filter: blur(10px); }
.modalCard{
  position:relative;
  width:min(520px, calc(100% - 28px));
  margin: 96px auto 0;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.48);
  box-shadow: 0 35px 120px rgba(0,0,0,.65);
  overflow:hidden;
}
.modalTop{
  display:flex; justify-content:space-between; align-items:center;
  gap:12px; padding:12px 14px;
  background: rgba(255,255,255,.05);
  border-bottom:1px solid rgba(255,255,255,.10);
}
.modalTitle{ font-weight: 1000; letter-spacing:.02em; }
.modalBody{ padding:14px; display:grid; gap:12px; }
.modalBody .actions{ display:flex; gap:10px; flex-wrap:wrap; }
.modalNote{ font-size:12px; color: rgba(255,255,255,.62); }


/* Modern Auth Button in Header - Simplified */
.headerRight{ display:flex; align-items:center; gap:10px; }
.headerAuthBtn{
  position:relative;
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  transition: transform .2s ease, box-shadow .2s ease;
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.18), 
    0 6px 20px rgba(0,0,0,.35);
  will-change: transform;
}

.headerAuthBtn:hover{
  transform:translateY(-1px) translateZ(0);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.25), 
    0 8px 24px rgba(0,0,0,.4);
}

.headerAuthBtn:active{
  transform:translateY(0) scale(.98) translateZ(0);
  transition: all .1s ease;
}

/* Active state for auth button */
.headerAuthBtn.isActive{
  background:linear-gradient(135deg, 
    rgba(255,255,255,.98), 
    rgba(255,255,255,.92));
  color:rgba(0,0,0,.95);
  box-shadow: 
    0 0 0 1px rgba(255,255,255,.3), 
    0 4px 16px rgba(255,255,255,.25),
    0 8px 32px rgba(0,0,0,.25);
}

.headerAuthBtn.isActive .btnLabel{
  color:rgba(0,0,0,.95) !important;
}

@media (max-width: 980px){
  .headerRight{ margin-left:auto; }
  .headerAuthBtn{ padding: 10px 16px; }
}


/* Modal close button: same look as tab button, but not part of tabs */
.modalCloseBtn{
  appearance:none;
  border:0;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.modalCloseBtn:hover{ background: rgba(255,255,255,.10); transform: translateY(-1px); }


/* Auth page layout helpers (minimal, uses existing style language) */
.shell{ max-width: 1100px; margin: 0 auto; padding: 18px; }
.topbar{ display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:18px; }
.brand{ display:flex; align-items:center; gap:12px; }
.brand .logo{ width:34px; height:34px; border-radius:10px; background: rgba(255,255,255,.10); box-shadow: 0 0 0 1px rgba(255,255,255,.14) inset; }
.brandName{ font-weight:700; letter-spacing:.02em; }
.brandTag{ font-size:12px; opacity:.75; }
.main{ display:block; }
.card{ background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); border-radius: 18px; padding: 18px; box-shadow: 0 18px 80px rgba(0,0,0,.35); }
.cardHeader{ margin-bottom: 12px; }
.cardTitle{ margin:0 0 6px 0; font-size: 18px; }
.cardSub{ margin:0; opacity:.8; font-size: 13px; line-height: 1.3; }
.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 680px){ .grid2{ grid-template-columns:1fr; } }
.field{ display:flex; flex-direction:column; gap:6px; }
.fieldLabel{ font-size:12px; opacity:.8; }
.input{ width:100%; padding: 12px 12px; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.20); color: rgba(255,255,255,.92); outline:none; }
.input:focus{ border-color: rgba(255,255,255,.28); box-shadow: 0 0 0 4px rgba(255,255,255,.06); }


/* Spinning colorful O in LYPO title */
.spinO{
  display:inline-block;
  width: 1em;
  height: 1em;
  line-height: 1em;
  text-align:center;
  border-radius: 999px;
  background: conic-gradient(from 0deg, #ff4d4d, #ffd84d, #4dff7a, #4dd2ff, #a04dff, #ff4dd2, #ff4d4d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255,255,255,.12));
  animation: spinO 2.4s linear infinite;
  transform-origin: center;
}
@keyframes spinO { to { transform: rotate(360deg); } }


/* Dashboard tables */
.tableWrap{ overflow:auto; border-radius: 14px; border: 1px solid rgba(255,255,255,.10); }
.dashTable{ width:100%; border-collapse: collapse; font-size: 13px; }
.dashTable th, .dashTable td{ padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08); text-align:left; vertical-align: top; }
.dashTable th{ font-size: 12px; opacity: .8; font-weight: 600; }
.dashTable tr:last-child td{ border-bottom: 0; }
.mutedCell{ opacity: .7; }
.pill{ display:inline-flex; gap:8px; align-items:center; padding: 8px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.10); font-size: 12px; }
.dashRow{ display:flex; flex-wrap:wrap; gap:10px; }


/* Buy credits modal */
.payQuick{ display:flex; gap:10px; flex-wrap:wrap; margin: 6px 0 12px; }
.chipBtn{
  appearance:none; border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: inherit;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.chipBtn:hover{ background: rgba(255,255,255,.09); }
.miniRow{ display:flex; justify-content:space-between; align-items:center; margin-top: 8px; }


/* Inline buy credits card */
.buyCard{margin-top:14px;padding:14px 14px 12px;border:1px solid rgba(255,255,255,.08);border-radius:16px;background:rgba(20,20,28,.35);backdrop-filter: blur(8px)}
.buyCardTop{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.buyTitle{font-weight:700}
.payQuick{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.chipBtn{padding:8px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.04);color:inherit;cursor:pointer}
.chipBtn:hover{background:rgba(255,255,255,.08)}
.buyRow{display:flex;gap:12px;align-items:flex-end;flex-wrap:wrap}
.buyField{min-width:180px}
.buyPreview{padding-bottom:10px}
.buyActions{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:10px}
.buyMsg{min-height:18px}

/* Compact main action buttons (Upload & Translate / Buy Credits) */
.actions .btnPrimary, .actions .btnGhost{
  padding:8px 10px;
  border-radius:12px;
  font-size:13px;
}
.actions .btnLabel{ font-size:13px; }


/* ======================================================
   HEADER-STYLE BUTTONS OVERRIDE (clean dark, white text)
   ====================================================== */
.btnPrimary,
.btnGhost,
.uploadBtn,
.chipBtn {
  color: rgba(255,255,255,.92) !important;
  border: 1px solid rgba(255,255,255,.14) !important;
  background: rgba(10,10,14,.55) !important;
  box-shadow: none !important;
  backdrop-filter: blur(6px);
}

.btnPrimary:hover,
.btnGhost:hover,
.uploadBtn:hover,
.chipBtn:hover {
  background: rgba(10,10,14,.70) !important;
  border-color: rgba(255,255,255,.22) !important;
}

.btnPrimary::after,
.btnGhost::after,
.uploadBtn::after,
.chipBtn::after {
  content: "" !important;
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: radial-gradient(160px 60px at 20% 30%, rgba(255,255,255,.12), transparent 60%);
  opacity: .65;
  pointer-events: none;
}

.btnPrimary:hover::after,
.btnGhost:hover::after,
.uploadBtn:hover::after,
.chipBtn:hover::after {
  opacity: .9;
}

/* Keep icon button feel on upload picker without changing layout */
.uploadBtn .uploadFx { opacity: .55; }


/* keep clean like uploadBtn */


/* ======================================================
   BTN RUN EXACT UPLOAD BTN (match 'Choose a video')
   ====================================================== */
#btnRun{
  position:relative;
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:14px 14px !important;
  border-radius:18px !important;
  border:1px dashed rgba(255,255,255,.22) !important;
  background:rgba(0,0,0,.30) !important;
  color:rgba(255,255,255,.92) !important;
  cursor:pointer;
  overflow:hidden;
  transition: transform .12s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
  box-shadow:none !important;
}

#btnRun:hover{
  transform:translateY(-1px);
  background:rgba(0,0,0,.38) !important;
  border-color:rgba(255,255,255,.32) !important;
  box-shadow: 0 16px 50px rgba(0,0,0,.45) !important;
}

#btnRun:active{ transform: translateY(0) scale(.99); }

/* Use the same colorful 'pop' glow as the upload button */
#btnRun .uploadFx{
  position:absolute;
  inset:-2px;
  border-radius:20px;
  pointer-events:none;
  opacity:0;
  background: conic-gradient(from 180deg,
    rgba(0,225,255,.55),
    rgba(142,84,255,.55),
    rgba(255,120,120,.50),
    rgba(0,225,255,.55)
  );
  filter: blur(14px);
  transition: opacity .18s ease;
}

#btnRun:hover .uploadFx{ opacity:.65; }

/* Keep it clean (no extra white haze) */
#btnRun .btnGlow{ opacity:0 !important; }


/* BUY CARD PILL TWEAK (separate Stripe section slightly more) */
.buyCard{
  border-color: rgba(255,255,255,.10) !important;
  background: rgba(0,0,0,.26) !important;
  box-shadow: 0 18px 60px rgba(0,0,0,.35) !important;
}


/* Classified cards: intentionally unreadable */
.classifiedCard{
  position: relative;
}
.classifiedCard *{
  filter: blur(6px);
  opacity: .85;
}
.classifiedCard::after{
  content:"CLASSIFIED";
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-weight: 1000;
  letter-spacing:.24em;
  font-size: 12px;
  color: rgba(255,255,255,.82);
  text-transform: uppercase;
  background: linear-gradient(120deg, rgba(0,0,0,.35), rgba(0,0,0,.20));
  border-radius: 18px;
  pointer-events:none;
}
.classifiedCard::before{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: 20px;
  background: radial-gradient(240px 120px at 30% 30%, rgba(255,255,255,.10), transparent 60%);
  opacity:.55;
  pointer-events:none;
}

/* Keep choose + estimate as left column so output stays next to it */
.uploadLeft{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.genMsg{
  font-size:12px;
  color: rgba(255,255,255,.70);
  padding-left:2px;
}

/* Blog */
.blogList{ display:flex; flex-direction:column; gap:14px; }
.blogItem{ 
  display:flex; 
  gap:14px; 
  text-decoration:none; 
  color:inherit; 
  padding:14px; 
  border-radius:16px; 
  background: rgba(0,0,0,.16); 
  border: 1px solid rgba(255,255,255,.10); 
  transition: all .15s ease;
  align-items:flex-start;
}
.blogItem:hover{ 
  transform: translateY(-2px);
  background: rgba(0,0,0,.22); 
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 12px 40px rgba(0,0,0,.30);
}
.blogCover { flex-shrink: 0; }
.blogCover img{ 
  width:140px; 
  height:90px; 
  object-fit:cover; 
  border-radius:14px; 
  display:block; 
  border:1px solid rgba(255,255,255,.12); 
  background: rgba(0,0,0,.22); 
}
.blogMeta{ 
  display:flex; 
  flex-direction:column; 
  gap:7px; 
  flex:1; 
  min-width:0; 
}
.blogTitle{ 
  font-weight:800; 
  font-size: 16px;
  line-height:1.3;
  color: rgba(255,255,255,.95);
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.blogSub{ 
  font-size:13px; 
  opacity:.82; 
  line-height:1.5;
  color: rgba(255,255,255,.78);
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
}
.blogDate{ 
  font-size:12px; 
  opacity:.65; 
  color: rgba(255,255,255,.68);
  font-weight: 500;
}

.postCover img{ width:100%; aspect-ratio: 16 / 9; height:auto; object-fit:cover; border-radius:18px; display:block; border:1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.22); box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.postVideo video{ width:100%; aspect-ratio: 16 / 9; height:auto; border-radius:18px; margin-top:16px; border:1px solid rgba(255,255,255,.12); background: rgba(0,0,0,.22); }

/* Main blog post body typography */
/* Professional Blog Post Typography */
.postBody{ 
  margin-top: 24px; 
  line-height: 1.65;  /* Tighter, more professional */
  font-size: 17px;
  color: rgba(255,255,255,.90);
  max-width: 100%;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.postBody * {
  text-align: left;
  white-space: normal;
}

.postBody h1 { 
  font-size: 30px; 
  line-height: 1.25;  /* Tighter headings */
  margin: 2.4em 0 0.7em 0;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,.96);
  font-weight: 800;
}

.postBody h1:first-child {
  margin-top: 0.8em;
}

.postBody h2 { 
  font-size: 26px; 
  line-height: 1.3;
  margin: 2em 0 0.6em 0;
  letter-spacing: -0.015em;
  color: rgba(255,255,255,.95);
  font-weight: 700;
}

.postBody h3 { 
  font-size: 22px; 
  line-height: 1.35;
  margin: 1.8em 0 0.5em 0;
  color: rgba(255,255,255,.93);
  font-weight: 700;
}

.postBody h4 {
  font-size: 19px;
  line-height: 1.4;
  margin: 1.6em 0 0.5em 0;
  color: rgba(255,255,255,.91);
  font-weight: 700;
}

.postBody p { 
  margin: 0 0 1em 0;  /* Reduced from 1.4em to 1em */
  line-height: 1.65;  /* Tighter than 1.8 */
  color: rgba(255,255,255,.88);
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
}

.postBody p:last-child {
  margin-bottom: 0;
}

.postBody br {
  display: block;
  content: "";
  margin: 0.3em 0;  /* Reduced from 0.5em */
}

.postBody ul,
.postBody ol {
  margin: 1.3em 0 1.5em 0;
  padding-left: 1.8em; /* Slightly reduced for better alignment */
  text-align: left;
  max-width: 100%;
}

.postBody li {
  margin: 0.6em 0;
  line-height: 1.7;
  color: rgba(255,255,255,.87);
  text-align: left;
  max-width: 100%;
  overflow-wrap: break-word;
}

.postBody li p {
  margin: 0.4em 0;
}

.postBody blockquote {
  margin: 1.8em 0;
  padding: 1.3em 1.5em;
  border-left: 4px solid rgba(100,200,255,.5);
  background: rgba(100,200,255,.08);
  border-radius: 10px;
  color: rgba(255,255,255,.90);
  font-style: italic;
  line-height: 1.7;
  max-width: 100%;
}

.postBody blockquote p {
  margin: 0.5em 0;
}

.postBody blockquote p:last-child {
  margin-bottom: 0;
}

.postBody code {
  background: rgba(100,200,255,.12);
  padding: 0.25em 0.5em;
  border-radius: 6px;
  font-size: 0.9em;
  color: rgba(255,255,255,.95);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.postBody pre {
  background: rgba(0,0,0,.40);
  padding: 1.2em;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.14);
  overflow-x: auto;
  margin: 1.4em 0;
  line-height: 1.5;  /* Tighter for code */
}

.postBody pre code {
  background: none;
  padding: 0;
  font-size: 0.88em;
  color: rgba(255,255,255,.92);
}

.postBody img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  margin: 1.8em 0;
  border: 1px solid rgba(255,255,255,.12);
  display: block;
}

.postBody a {
  color: rgba(100,200,255,.95);
  text-decoration: underline;
  text-decoration-color: rgba(100,200,255,.35);
  text-underline-offset: 3px;
  transition: all .2s ease;
}

.postBody a:hover {
  text-decoration-color: rgba(100,200,255,.95);
  color: rgba(120,210,255,.98);
}

.postBody strong {
  font-weight: 700;
  color: rgba(255,255,255,.96);
}

.postBody em {
  font-style: italic;
  color: rgba(255,255,255,.90);
}

.postBody hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,.15);
  margin: 2.2em 0;
}

.postBody table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  overflow: hidden;
}

.postBody th,
.postBody td {
  padding: 0.7em 1em;
  border: 1px solid rgba(255,255,255,.10);
  text-align: left;
  line-height: 1.5;
}

.postBody th {
  background: rgba(255,255,255,.08);
  font-weight: 700;
  color: rgba(255,255,255,.95);
}

.postBody td {
  background: rgba(255,255,255,.02);
  color: rgba(255,255,255,.87);
}


/* Blog layout polish: prevent single-line overflow and improve readability */
.blogItem{ align-items:flex-start; }
.blogMeta{ flex:1; min-width:0; }
.blogTitle, .blogSub, .blogDate{ min-width:0; overflow-wrap:anywhere; }
.blogTitle{
  line-height:1.3;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
}
.blogSub{
  line-height:1.5;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  overflow:hidden;
}
@media (max-width: 640px){
  .blogItem{ flex-direction:column; gap:12px; }
  .blogCover img{ width:100%; height:200px; }
  .blogTitle { font-size: 15px; }
  .blogSub { font-size: 13px; }
}


/* Removed duplicate .postContent styles - now using .postBody */


/* Dashboard emphasis when logged in */
body.isAuthed .btnGhost[data-nav="dashboard"]{
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
body.isAuthed .btnGhost[data-nav="dashboard"]:hover{
  border-color: rgba(255,255,255,.42);
}


/* ===============================
   BLOG POST VISUAL CLEANUP
   =============================== */

/* Constrain post content width */
.postContainer{
  max-width: 860px;
  margin: 0 auto;
  text-align: left;
}

/* Post card styling */
.postCard {
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 28px 90px rgba(0,0,0,.38);
  text-align: left;
  padding: 32px !important;
}

/* Fix cover image aspect + size */
.postCover{
  margin: 16px 0 20px;
}
.postCover img{
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

/* Post meta styling */
#postMeta{
  font-size: 14px;
  opacity: .75;
  color: rgba(255,255,255,.72);
  font-weight: 500;
}

/* Post title styling */
#postTitle {
  font-size: 36px !important;
  line-height: 1.2 !important;
  font-weight: 900 !important;
  letter-spacing: -0.025em !important;
  margin-bottom: 4px !important;
}

/* Mobile tuning */
@media (max-width: 640px){
  .postContainer{
    max-width: 100%;
  }
  .postCard {
    padding: 28px !important;
  }
  #postTitle{
    font-size: 28px !important;
    line-height: 1.25 !important;
  }
  .postCover img{
    max-height: 220px;
  }
  .postBody{
    font-size: 17px;
    line-height: 1.7;
  }
  .postBody h2 {
    font-size: 24px;
  }
  .postBody h3 {
    font-size: 21px;
  }
  .postBody .lead {
    font-size: 19px;
  }
}


/* Uniform page spacing below fixed header */
.container{ padding-top: var(--header-offset); }

/* Hard reset support spacing */
.supportContainer{
  padding-top: var(--header-offset) !important;
  margin-top: 0 !important;
}

/* Admin panels hidden by default; shown only for admins */
.adminPanel{ display:none; }

/* Blog post page spacing */
.blogPostPage {
  padding-bottom: 60px;
}

/* ========================================
   MOBILE RESPONSIVE FIXES FOR VIDEO DISPLAY
   ======================================== */

/* Compact video output and prevent overflow on mobile */
@media (max-width: 768px) {
  /* Stack upload and output vertically on mobile */
  .uploadGrid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  /* Make output video more compact and fit screen */
  .outputVideo {
    max-width: 100% !important;
    width: calc(100% - 16px) !important;
    max-height: 280px !important;
    margin: 6px 8px 12px !important;
  }
  
  /* Preview box takes full width on mobile */
  .previewBox.hasVideo {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  
  /* Compact skeleton on mobile */
  .previewSkeleton {
    height: 120px !important;
    width: calc(100% - 16px) !important;
    margin: 6px 8px 12px !important;
  }
}

/* Extra small mobile screens */
@media (max-width: 480px) {
  .outputVideo {
    max-height: 220px !important;
  }
  
  .previewSkeleton {
    height: 100px !important;
  }
  
  /* Make download button smaller on tiny screens */
  .btnDownload {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
}

/* Ensure video container doesn't cause horizontal scroll */
.previewBox {
  max-width: 100%;
  overflow-x: hidden;
}


/* ========================================
   TOOLS DROPDOWN MENU
   ======================================== */

/* Dropdown Container */
.toolsDropdown {
  position: relative;
  display: inline-block;
}

/* Dropdown Arrow */
.dropdownArrow {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  transition: transform 0.2s ease;
  opacity: 0.7;
}

#toolsBtn[aria-expanded="true"] .dropdownArrow {
  transform: rotate(180deg);
}

/* Tools Menu (Dropdown) */
.toolsMenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 280px;
  background: rgba(10, 12, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  /* Hidden by default - JavaScript will override with inline styles */
  display: none;
  z-index: 9999;
}

/* When dropdown is open - FORCE VISIBILITY WITH MULTIPLE SELECTORS */
.toolsMenu:not([hidden]),
.toolsMenu[aria-hidden="false"] {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding: 8px;
  z-index: 1000;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toolsMenu[aria-hidden="false"],
.toolsMenu:not([hidden]) {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Tool Item */
.toolItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
  transition: background 0.15s ease, transform 0.1s ease;
  cursor: pointer;
}

.toolItem:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateX(2px);
}

.toolItem:active {
  transform: translateX(2px) scale(0.98);
}

/* Tool Icon */
.toolIcon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

/* Tool Info */
.toolInfo {
  flex: 1;
  min-width: 0;
}

.toolName {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  color: rgba(255, 255, 255, 0.95);
}

.toolDesc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
}

/* Disabled Tool Item (Coming Soon) */
.toolItemDisabled {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  opacity: 0.5;
  cursor: not-allowed;
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
}

.toolItemDisabled .toolIcon {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}

.toolItemDisabled .toolName {
  color: rgba(255, 255, 255, 0.5);
}

.toolItemDisabled .toolDesc {
  color: rgba(255, 255, 255, 0.35);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .toolsMenu {
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    min-width: 260px;
    max-width: calc(100vw - 32px);
  }
  
  .toolsMenu[aria-hidden="false"],
  .toolsMenu:not([hidden]) {
    transform: translateX(-50%) translateY(0);
  }
}

/* Backdrop for mobile (optional - closes dropdown when clicking outside) */
.dropdownBackdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.dropdownBackdrop.active {
  display: block;
}


/* ========================================
   MOBILE HEADER FIX - COMPACT & VISIBLE
   ======================================== */

/* Mobile: Make header more compact and ensure buttons visible */
@media (max-width: 768px) {
  /* Compact header */
  .header {
    top: 12px;
    width: calc(100% - 24px);
    padding: 10px 12px;
    gap: 12px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Hide logo tagline on mobile for space */
  .logoTagline {
    display: none;
  }
  
  /* Compact logo */
  .logo {
    font-size: 18px;
    white-space: nowrap;
  }
  
  /* Make tabs scrollable on mobile */
  .tabs {
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none;
  }
  
  /* Compact tab buttons */
  .tabBtn {
    padding: 8px 12px;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Ensure headerRight (Login button) is always visible */
  .headerRight {
    flex-shrink: 0;
    margin-left: auto;
  }
  
  /* Compact auth button */
  .headerAuthBtn {
    padding: 8px 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
  }
  
  /* Compact container padding */
  .container {
    width: calc(100% - 24px);
    padding-top: 90px;
    padding-bottom: 24px;
  }
  
  /* Tools dropdown more compact on mobile */
  .toolsDropdown {
    flex-shrink: 0;
  }
  
  .dropdownArrow {
    font-size: 9px;
  }
}

/* Extra small mobile - even more compact */
@media (max-width: 480px) {
  .header {
    top: 8px;
    width: calc(100% - 16px);
    padding: 8px 10px;
    gap: 8px;
  }
  
  .logo {
    font-size: 16px;
  }
  
  .tabBtn {
    padding: 7px 10px;
    font-size: 12px;
  }
  
  .headerAuthBtn {
    padding: 7px 12px !important;
    font-size: 11px !important;
  }
  
  .container {
    width: calc(100% - 16px);
    padding-top: 80px;
  }
  
  /* More compact tools menu on tiny screens */
  .toolsMenu {
    min-width: 240px;
  }
  
  .toolItem {
    padding: 10px 12px;
    gap: 10px;
  }
  
  .toolIcon {
    width: 36px;
    height: 36px;
    font-size: 20px;
  }
  
  .toolName {
    font-size: 13px;
  }
  
  .toolDesc {
    font-size: 11px;
  }
}

/* Landscape mobile - keep header visible */
@media (max-width: 768px) and (orientation: landscape) {
  .header {
    top: 8px;
    padding: 8px 12px;
  }
  
  .container {
    padding-top: 75px;
  }
}


/* ========================================
   ULTRA-COMPACT MOBILE HEADER FIX
   ======================================== */

/* Override previous mobile styles with ultra-compact version */
@media (max-width: 768px) {
  /* Ultra-compact header - everything must fit */
  .header {
    top: 8px !important;
    width: calc(100% - 16px) !important;
    padding: 6px 8px !important;
    gap: 6px !important;
    font-size: 12px;
  }
  
  /* Hide logo completely on mobile to save space */
  .logoWrap {
    display: none !important;
  }
  
  /* Compact tabs container */
  .tabs {
    gap: 4px !important;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .tabs::-webkit-scrollbar {
    display: none !important;
  }
  
  /* Ultra-compact tab buttons */
  .tabBtn {
    padding: 6px 8px !important;
    font-size: 11px !important;
    border-radius: 8px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  /* Compact Tools dropdown button */
  #toolsBtn {
    padding: 6px 10px !important;
  }
  
  .dropdownArrow {
    font-size: 8px !important;
    margin-left: 2px !important;
  }
  
  /* Compact header right section */
  .headerRight {
    flex-shrink: 0 !important;
    margin-left: 6px !important;
  }
  
  /* Ultra-compact auth button */
  .headerAuthBtn {
    padding: 6px 10px !important;
    font-size: 11px !important;
    border-radius: 12px !important;
  }
  
  /* Reduce container top padding */
  .container {
    padding-top: 65px !important;
  }
  
  /* Compact tools dropdown menu on mobile */
  .toolsMenu {
    min-width: 240px !important;
    max-width: calc(100vw - 24px) !important;
    padding: 6px !important;
  }
  
  .toolItem {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  
  .toolIcon {
    width: 36px !important;
    height: 36px !important;
    font-size: 18px !important;
  }
  
  .toolName {
    font-size: 13px !important;
  }
  
  .toolDesc {
    font-size: 11px !important;
  }
}

/* Extra small screens - even more aggressive */
@media (max-width: 480px) {
  .header {
    padding: 5px 6px !important;
    gap: 4px !important;
  }
  
  .tabBtn {
    padding: 5px 7px !important;
    font-size: 10px !important;
  }
  
  .headerAuthBtn {
    padding: 5px 8px !important;
    font-size: 10px !important;
  }
  
  .container {
    padding-top: 60px !important;
  }
}


/* ========================================
   FIX TAB BUTTON FLICKERING
   ======================================== */

/* Prevent flickering by ensuring smooth state transitions */
.tabBtn {
  /* Add will-change to optimize rendering */
  will-change: background-color, border-color;
  /* Prevent layout shift during state changes */
  contain: layout style paint;
}

/* Ensure only one active tab at a time - no overlap */
.tabs {
  /* Isolate rendering context */
  contain: layout;
}

/* Hide toolsDropdown temporarily if not initialized */
.toolsDropdown:not(:defined) {
  visibility: hidden;
}

/* HEADER ALWAYS VISIBLE - Removed opacity hiding to prevent disappearing header */


/* ========================================
   CRITICAL FIX: ALL HEADER BUTTONS VISIBLE ON MOBILE
   ======================================== */

/* Mobile: Show ALL navigation buttons - horizontally scrollable */
@media (max-width: 768px) {
  /* Compact but fully functional header */
  .header {
    top: 8px !important;
    width: calc(100% - 16px) !important;
    padding: 8px 10px !important;
    gap: 8px !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  
  .header::-webkit-scrollbar {
    display: none !important;
  }
  
  /* Show logo on mobile - make it compact */
  .logoWrap {
    display: flex !important;
    flex-shrink: 0 !important;
    min-width: auto !important;
  }
  
  .logo {
    font-size: 16px !important;
    white-space: nowrap !important;
  }
  
  /* Hide tagline to save space */
  .logoTagline {
    display: none !important;
  }
  
  /* Navigation tabs - scrollable container */
  .tabs {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex: 1 !important;
    min-width: 0 !important;
  }
  
  .tabs::-webkit-scrollbar {
    display: none !important;
  }
  
  /* All tab buttons visible and tappable */
  .tabBtn {
    padding: 8px 12px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 10px !important;
    min-width: auto !important;
    display: flex !important;
    align-items: center !important;
  }
  
  /* Tools dropdown container */
  .toolsDropdown {
    flex-shrink: 0 !important;
    position: relative !important;
  }
  
  #toolsBtn {
    padding: 8px 12px !important;
    white-space: nowrap !important;
  }
  
  .dropdownArrow {
    margin-left: 3px !important;
    font-size: 9px !important;
  }
  
  /* Header right - login button always visible */
  .headerRight {
    display: flex !important;
    flex-shrink: 0 !important;
    margin-left: 8px !important;
  }
  
  .headerAuthBtn {
    padding: 8px 14px !important;
    font-size: 12px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }
  
  /* Adjust container padding for mobile header */
  .container {
    padding-top: 75px !important;
  }
  
  /* Tools dropdown menu on mobile */
  .toolsMenu {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-8px) !important;
    top: 70px !important;
    min-width: 280px !important;
    max-width: calc(100vw - 32px) !important;
    z-index: 9999 !important;
  }
  
  .toolsMenu[aria-hidden="false"],
  .toolsMenu:not([hidden]) {
    transform: translateX(-50%) translateY(0) !important;
  }
}

/* Extra small screens - even more compact */
@media (max-width: 480px) {
  .header {
    padding: 6px 8px !important;
    gap: 6px !important;
  }
  
  .logo {
    font-size: 14px !important;
  }
  
  .tabBtn {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  
  .headerAuthBtn {
    padding: 7px 12px !important;
    font-size: 11px !important;
  }
  
  .container {
    padding-top: 70px !important;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .header {
    top: 6px !important;
    padding: 6px 8px !important;
  }
  
  .container {
    padding-top: 65px !important;
  }
}


/* ========================================
   FINAL PROFESSIONAL MOBILE HEADER FIX
   HIGH SPECIFICITY - OVERRIDES ALL ABOVE
   ======================================== */

@media only screen and (max-width: 768px) {
  /* Clean, professional mobile header */
  html body .header {
    position: fixed !important;
    top: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    padding: 10px 12px !important;
    gap: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  
  html body .header::-webkit-scrollbar {
    display: none !important;
  }
  
  /* Logo - compact */
  html body .logoWrap {
    display: flex !important;
    flex-shrink: 0 !important;
    padding: 4px 6px !important;
    margin-right: 4px !important;
  }
  
  html body .logo {
    font-size: 18px !important;
    letter-spacing: 0.15em !important;
  }
  
  html body .logoTagline {
    display: none !important;
  }
  
  /* Navigation tabs - with margin to move right */
  html body .tabs {
    display: flex !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    flex: 1 !important;
    min-width: 0 !important;
    margin-left: 12px !important; /* Move buttons to the right */
  }
  
  /* ALL BUTTONS - SAME PROFESSIONAL STYLE */
  html body .tabBtn,
  html body #toolsBtn,
  html body .headerAuthBtn,
  html body .headerRight .btnPrimary {
    padding: 9px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: rgba(255,255,255,0.9) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    /* MOBILE SAFARI - MAKE CLICKABLE */
    -webkit-appearance: none !important;
    -webkit-tap-highlight-color: rgba(255,255,255,0.1) !important;
    touch-action: manipulation !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    position: relative !important;
    z-index: 100 !important;
  }
  
  /* Hover & Active states for touch devices */
  html body .tabBtn:hover,
  html body #toolsBtn:hover,
  html body .headerAuthBtn:hover,
  html body .tabBtn:active,
  html body #toolsBtn:active,
  html body .headerAuthBtn:active {
    background: rgba(255,255,255,0.12) !important;
    border-color: rgba(255,255,255,0.18) !important;
  }
  
  /* Active tab */
  html body .tabBtn.isActive {
    background: rgba(255,255,255,0.15) !important;
    border-color: rgba(255,255,255,0.25) !important;
    color: #fff !important;
  }
  
  /* Tools dropdown */
  html body .toolsDropdown {
    position: relative !important;
    flex-shrink: 0 !important;
    /* Ensure container doesn't block clicks */
    pointer-events: none !important;
  }
  
  /* But button inside IS clickable */
  html body .toolsDropdown #toolsBtn {
    pointer-events: auto !important;
    z-index: 101 !important;
  }
  
  html body .dropdownArrow {
    font-size: 10px !important;
    margin-left: 5px !important;
    display: inline-block !important;
    transition: transform 0.2s ease !important;
  }
  
  /* Header right - Dashboard/Login button */
  html body .headerRight {
    display: flex !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
    padding-left: 6px !important;
  }
  
  /* Fix Dashboard button appearance */
  html body .headerAuthBtn,
  html body .headerRight .btnPrimary {
    min-width: 85px !important;
    justify-content: center !important;
  }
  
  /* Dropdown menu - SIMPLE & WORKS */
  html body .toolsMenu {
    position: fixed !important;
    left: 50% !important;
    top: 70px !important;
    transform: translateX(-50%) !important;
    min-width: 300px !important;
    max-width: calc(100vw - 40px) !important;
    z-index: 99999 !important;
    border-radius: 16px !important;
    background: rgba(10,12,18,0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid rgba(255,255,255,0.2) !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6) !important;
    /* JavaScript handles visibility with inline styles */
    /* These are just positioning */
    overflow: hidden !important;
    transition: opacity 0.2s ease, visibility 0.2s ease !important;
  }
  
  /* JavaScript will handle visibility with inline styles */
  /* These are just fallbacks */
  html body .toolsMenu[hidden] {
    display: none !important;
  }
  
  /* Ensure tool items are clickable */
  html body .toolItem {
    pointer-events: auto !important;
    cursor: pointer !important;
  }
  
  html body .toolItem {
    padding: 12px 14px !important;
    border-radius: 12px !important;
    /* Safari touch improvements */
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }
  
  html body .toolItem:hover,
  html body .toolItem:active {
    background: rgba(255,255,255,0.08) !important;
  }
  
  /* Container spacing */
  html body .container {
    padding-top: 85px !important;
  }
}

/* Extra small phones */
@media only screen and (max-width: 480px) {
  html body .header {
    padding: 8px 10px !important;
    gap: 6px !important;
  }
  
  html body .logo {
    font-size: 16px !important;
  }
  
  html body .tabBtn,
  html body #toolsBtn,
  html body .headerAuthBtn {
    padding: 8px 12px !important;
    font-size: 12px !important;
  }
}

