:root{
  --bg:#070A10;
  --panel:#0B1020;
  --panel2:#0A0F1C;
  --border:rgba(255,255,255,.08);
  --text:#EAF0FF;
  --muted:rgba(234,240,255,.72);
  --muted2:rgba(234,240,255,.55);

  --shadow: 0 24px 60px rgba(0,0,0,.45);
  --shadow2: 0 10px 30px rgba(0,0,0,.35);

  --radius: 18px;
  --radius2: 14px;

  --cta1:#6D5BFF;
  --cta2:#2F8CFF;
  --cta3:#19D3C5;
  --focus: 0 0 0 4px rgba(109,91,255,.18), 0 0 0 1px rgba(255,255,255,.10) inset;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(109,91,255,.18), transparent 60%),
    radial-gradient(900px 600px at 85% 0%, rgba(47,140,255,.14), transparent 55%),
    radial-gradient(800px 600px at 65% 110%, rgba(25,211,197,.10), transparent 60%),
    linear-gradient(180deg, #060813 0%, #05070F 55%, #04060C 100%);
  letter-spacing: .2px;
}

a{ color:inherit; text-decoration:none; }
.wrap{ max-width:1120px; margin:0 auto; padding: 0 22px; }

/* -------------------------------------------------
   Shared Top Bar (supports BOTH existing .topbar AND injected .lx-topbar)
   ------------------------------------------------- */

/* Existing topbar (kept) */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter: blur(12px);
  background: rgba(7,10,16,.58);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:72px;
  gap: 10px;
}

/* New injected topbar (nav.js) */
.lx-topbar{
  position:sticky;
  top:0;
  z-index:50;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:14px 18px;
  backdrop-filter: blur(14px);
  background: rgba(7,10,16,.58);
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* Brand (shared) */
.brand,
.lux-brand{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 160px;
  text-decoration: none;
  color: inherit;
}

.brand,
.lux-brand-horizontal{
  flex-direction: row;
}

.lux-brand-sidebar{
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.brand-mark,
.lux-brand-symbol,
.lux-brand-wordmark{
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-mark{
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 6px 14px rgba(0,0,0,.28);
}

.lux-brand-horizontal > img{
  height: 40px;
  width: auto;
  box-shadow: 0 12px 26px rgba(0,0,0,.35);
}

.lux-brand-sidebar > img{
  width: min(300px, 100%);
  height: auto;
}

/* Support both: .brand .name (old) and .brand-name (new) */
.brand .name,
.brand-name{
  font-weight: 650;
  font-size: 15px;
  letter-spacing: 0.02em;
}

/* Nav containers */
.nav-actions,
.lx-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Existing nav-links (kept) */
.nav-links{
  display:flex;
  gap: 14px;
  align-items:center;
  color: rgba(234,240,255,.78);
  font-size: 13px;
}
.nav-links a{
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}
.nav-links a:hover{
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(234,240,255,.92);
}

/* New nav links style (nav.js uses .navlink) */
.lx-nav{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

.navlink{
  display:inline-flex;
  align-items:center;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: rgba(234,240,255,.78);
  font-size: 13px;
  line-height: 1;
  user-select: none;
}

.navlink:hover{
  border-color: rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  color: rgba(234,240,255,.92);
}

.navlink.active{
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: rgba(234,240,255,.95);
}

/* Utility used by nav.js */
.is-hidden{ display:none !important; }

/* -------------------------------------------------
   Buttons
   ------------------------------------------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  height:44px;
  padding:0 16px;
  border-radius: 999px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-weight:650;
  font-size:14px;
  cursor:pointer;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
  user-select:none;
  white-space:nowrap;
}
.btn:hover{ transform: translateY(-1px); border-color: rgba(255,255,255,.18); background: rgba(255,255,255,.06); }
.btn:active{ transform: translateY(0px); }
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }

.btn-primary{
  border: 1px solid rgba(255,255,255,.10);
  background: linear-gradient(135deg, rgba(109,91,255,.92), rgba(47,140,255,.85));
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.btn-primary:hover{
  background: linear-gradient(135deg, rgba(109,91,255,.98), rgba(47,140,255,.92));
  box-shadow: 0 22px 48px rgba(0,0,0,.42);
}

/* Optional: ghost button (nav.js can use btn btn-ghost) */
.btn-ghost{
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  color: rgba(234,240,255,.88);
}
.btn-ghost:hover{
  border-color: rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

/* Hero */
.hero{ padding: 64px 0 36px; }
.hero-grid{
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 28px;
  align-items: start;
}

.headline{
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.04;
  letter-spacing: -0.8px;
  margin: 0 0 14px;
  font-weight: 720;
}
.subtext{
  margin: 0 0 22px;
  max-width: 58ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.hero-actions{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.hero-card{
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow2);
}
.hero-card h3{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .3px;
  color: rgba(234,240,255,.9);
}
.hero-card p{
  margin: 0;
  color: var(--muted2);
  font-size: 13.5px;
  line-height: 1.55;
}

/* Pills */
.pill{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  padding: 8px 10px;
  border-radius: 999px;
  color: rgba(234,240,255,.78);
  font-size: 12.5px;
  margin-bottom: 12px;
}
.dot{
  width:8px; height:8px; border-radius: 50%;
  background: rgba(25,211,197,.95);
  box-shadow: 0 0 0 3px rgba(25,211,197,.12);
}

/* Section */
.section{ padding: 34px 0; }
.section-title{
  margin:0 0 14px;
  font-size: 13px;
  letter-spacing: .7px;
  color: rgba(234,240,255,.62);
  text-transform: uppercase;
}

.value-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius2);
  padding: 18px;
  box-shadow: var(--shadow2);
  min-height: 122px;
}
.card h4{
  margin:0 0 8px;
  font-size: 15px;
  font-weight: 680;
  letter-spacing: .2px;
}
.card p{
  margin:0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

/* OS Module Grid */
.modules{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.module{
  display:block;
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.module:hover{
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
}
.module h4{ margin:0 0 6px; font-size:14px; font-weight:700; }
.module p{ margin:0; color: var(--muted); font-size:13px; line-height:1.55; }
.module .tag{
  display:inline-flex;
  margin-top: 10px;
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(234,240,255,.78);
  background: rgba(255,255,255,.03);
}

/* How it works */
.how{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.step{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding: 16px;
  border-radius: var(--radius2);
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.03);
}
.num{
  width:28px;
  height:28px;
  border-radius: 10px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  background: rgba(109,91,255,.14);
  border:1px solid rgba(109,91,255,.20);
  color: rgba(234,240,255,.92);
  flex: 0 0 auto;
}
.step h5{ margin:0 0 5px; font-size: 14.5px; font-weight: 680; }
.step p{ margin:0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

/* Footer */
footer{
  padding: 40px 0 28px;
  border-top: 1px solid rgba(255,255,255,.06);
  margin-top: 22px;
}
.footer-inner{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  flex-wrap: wrap;
}
.footer-links{
  display:flex;
  gap: 14px;
  flex-wrap: wrap;
  color: rgba(234,240,255,.72);
  font-size: 13px;
}
.footer-links a:hover{ color: rgba(234,240,255,.92); }
.copyright{
  color: rgba(234,240,255,.55);
  font-size: 13px;
}

/* Ensure background FX never block clicks */
.bg, .bg * ,
.glow, .glow * ,
.backdrop, .backdrop * ,
.fx, .fx * {
  pointer-events: none !important;
}

/* Ensure top nav always stays above everything */
.topbar, .lx-topbar, header, nav{
  position: relative;
  z-index: 1000;
  pointer-events: auto;
}

/* Responsive */
@media (max-width: 900px){
  .hero-grid{ grid-template-columns: 1fr; }
  .value-grid{ grid-template-columns: 1fr; }
  .modules{ grid-template-columns: 1fr; }
  .how{ grid-template-columns: 1fr; }
  .topbar-inner{ height: 68px; }
  .lx-topbar{ padding: 12px 14px; }
  .brand,
  .lux-brand{ min-width: auto; }
  .lux-brand-horizontal > img{ height: 36px; }
  .lux-brand-sidebar > img{ width: min(300px, 100%); }
}

/* =========================================================
   Luxenova V1 App Shell
   Shared premium application layout
   Safe additive layer for workspace pages
   ========================================================= */

:root{
  --lx-shell-max: 1360px;
  --lx-shell-gap: 24px;
  --lx-rail-width: 320px;
  --lx-surface-1: rgba(255,255,255,.03);
  --lx-surface-2: rgba(255,255,255,.05);
  --lx-surface-3: rgba(255,255,255,.07);
  --lx-border-soft: rgba(255,255,255,.08);
  --lx-border-strong: rgba(255,255,255,.12);
  --lx-text-1: #F5F7FF;
  --lx-text-2: #C5CEE0;
  --lx-text-3: #94A0B8;
  --lx-accent-soft: rgba(109,91,255,.16);
  --lx-shadow-1: 0 18px 48px rgba(0,0,0,.24);
}

.lx-page-shell{
  width: min(var(--lx-shell-max), calc(100% - 32px));
  margin: 0 auto;
  padding: 96px 0 40px;
}

.lx-page-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.lx-page-head__copy{
  min-width: 0;
}

.lx-page-eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--lx-border-soft);
  background: var(--lx-surface-1);
  color: var(--lx-text-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.lx-page-title{
  margin: 0;
  color: var(--lx-text-1);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.02;
  letter-spacing: -.03em;
}

.lx-page-subtitle{
  margin: 12px 0 0;
  max-width: 760px;
  color: var(--lx-text-2);
  font-size: 15px;
  line-height: 1.7;
}

.lx-page-actions{
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lx-workgrid{
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  align-items: start;
}

.lx-maincol{
  min-width: 0;
}

.lx-mainstack{
  display: grid;
  gap: 18px;
}

.lx-rail{
  display: grid;
  gap: 16px;
  position: sticky;
  top: 96px;
  align-self: start;
}

.lx-rail-card{
  padding: 18px;
  border-radius: 20px;
  border: 1px solid var(--lx-border-soft);
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  box-shadow: var(--lx-shadow-1);
}

.lx-rail-card h3{
  margin: 0 0 10px;
  color: var(--lx-text-1);
  font-size: 15px;
  line-height: 1.3;
}

.lx-rail-card p{
  margin: 0;
  color: var(--lx-text-2);
  font-size: 13px;
  line-height: 1.7;
}

.lx-rail-list{
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.lx-rail-list li{
  color: var(--lx-text-2);
  font-size: 13px;
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}

.lx-rail-list li::before{
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #6D5BFF;
  box-shadow: 0 0 0 4px rgba(109,91,255,.12);
}

.lx-stat-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.lx-stat{
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--lx-border-soft);
  background: var(--lx-surface-1);
}

.lx-stat__label{
  margin: 0 0 6px;
  color: var(--lx-text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.lx-stat__value{
  margin: 0;
  color: var(--lx-text-1);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.lx-surface-card{
  border: 1px solid var(--lx-border-soft);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(109,91,255,.10), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  box-shadow: var(--lx-shadow-1);
}

.lx-card-head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 0;
}

.lx-card-head__copy h2,
.lx-card-head__copy h3{
  margin: 0;
  color: var(--lx-text-1);
  line-height: 1.2;
  letter-spacing: -.02em;
}

.lx-card-head__copy p{
  margin: 8px 0 0;
  color: var(--lx-text-2);
  font-size: 14px;
  line-height: 1.7;
}

.lx-card-body{
  padding: 22px;
}

.lx-chip{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--lx-border-soft);
  background: var(--lx-surface-1);
  color: var(--lx-text-2);
  font-size: 12px;
  font-weight: 700;
}

.lx-page-shell .card{
  border-radius: 24px;
  border: 1px solid var(--lx-border-soft);
  background:
    radial-gradient(circle at top left, rgba(109,91,255,.08), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  box-shadow: var(--lx-shadow-1);
}

.lx-page-shell .panel{
  border-radius: 18px;
  border: 1px solid var(--lx-border-soft);
  background: rgba(255,255,255,.025);
}

.lx-page-shell .batch-results-panel{
  border: 1px solid var(--lx-border-soft);
  background: rgba(255,255,255,.025);
}

.lx-page-shell .batch-result-card{
  border-radius: 18px;
  border: 1px solid var(--lx-border-soft);
  background: rgba(255,255,255,.03);
  transition:
    transform .18s ease,
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.lx-page-shell .batch-result-card:hover{
  transform: translateY(-1px);
  border-color: var(--lx-border-strong);
  background: rgba(255,255,255,.05);
}

.lx-page-shell .batch-result-card.is-selected{
  border-color: rgba(109,91,255,.42);
  background: linear-gradient(180deg, rgba(109,91,255,.14), rgba(255,255,255,.04));
  box-shadow: 0 18px 36px rgba(0,0,0,.22);
}

.lx-page-shell .prepared-preview-panel{
  border-radius: 22px;
  border: 1px solid var(--lx-border-soft);
  background:
    radial-gradient(circle at top left, rgba(109,91,255,.08), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  box-shadow: var(--lx-shadow-1);
}

.lx-page-shell .prepared-preview-frame{
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--lx-border-soft);
  background: #070A10;
}

.lx-page-shell .prepared-preview-panel__empty{
  border-radius: 18px;
  border: 1px dashed var(--lx-border-soft);
  background: rgba(255,255,255,.02);
}

.lx-page-shell .library-more{
  margin-top: 14px;
}

.lx-page-shell .btn,
.lx-page-shell button{
  transition:
    transform .16s ease,
    box-shadow .16s ease,
    opacity .16s ease;
}

.lx-page-shell .btn:hover,
.lx-page-shell button:hover{
  transform: translateY(-1px);
}

@media (max-width: 1100px){
  .lx-workgrid{
    grid-template-columns: 1fr;
  }

  .lx-rail{
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px){
  .lx-page-shell{
    width: min(var(--lx-shell-max), calc(100% - 18px));
    padding: 88px 0 28px;
  }

  .lx-page-head{
    flex-direction: column;
    align-items: stretch;
  }

  .lx-page-actions{
    justify-content: flex-start;
  }

  .lx-stat-grid{
    grid-template-columns: 1fr;
  }

  .lx-rail{
    grid-template-columns: 1fr;
  }
}

/* Ensure Luxenova shell layout always respects the grid */

.lx-workgrid{
  display:grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 320px);
  gap:24px;
  align-items:start;
}

.lx-maincol{
  min-width:0;
}

.lx-mainstack{
  display:grid;
  gap:20px;
}

.lx-rail{
  display:grid;
  gap:16px;
  position:sticky;
  top:96px;
  align-self:start;
}

/* =========================================================
   Header stat cards
   ========================================================= */

.lx-stat-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0,1fr));
  gap:16px;
  margin-top:18px;
}

.lx-stat{
  padding:16px 18px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  background:
    radial-gradient(circle at top left, rgba(109,91,255,.10), transparent 40%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  box-shadow:0 10px 28px rgba(0,0,0,.25);
}

.lx-stat__label{
  margin:0 0 6px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#94A0B8;
}

.lx-stat__value{
  margin:0;
  font-size:16px;
  font-weight:700;
  letter-spacing:-.01em;
  color:#F5F7FF;
}

/* =========================================================
   Primary CTA (used for main workflow action)
   ========================================================= */

.primary-cta{
  background: linear-gradient(135deg,#6D5BFF,#8A7BFF);
  border: none;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(109,91,255,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}

.primary-cta:hover{
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(109,91,255,.45);
}

.primary-cta:active{
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(109,91,255,.35);
}

/* =========================================================
   Render page layout safeguards
   Keep review/render rail on the right
   ========================================================= */

.lx-workgrid{
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(300px, 340px);
  gap: 24px;
  align-items: start;
}

.lx-maincol,
.lx-mainstack{
  min-width: 0;
}

.lx-mainstack > *{
  min-width: 0;
}

.lx-rail{
  min-width: 0;
  display: grid;
  gap: 16px;
  align-self: start;
  position: sticky;
  top: 96px;
}

.lx-page-shell video,
.lx-page-shell textarea,
.lx-page-shell input,
.lx-page-shell .card,
.lx-page-shell .panel{
  max-width: 100%;
}

.lx-page-shell .row{
  flex-wrap: wrap;
}

@media (max-width: 1180px){
  .lx-workgrid{
    grid-template-columns: 1fr;
  }

  .lx-rail{
    position: static;
  }
}
