:root{
  --bg:#000;
  --panel:#050505;
  --panel2:#111318;
  --soft:#1d2028;
  --line:#2b2f38;
  --text:#f5f7fb;
  --muted:#8d95a3;
  --muted2:#b4bcc9;
  --accent:#eff3f6;
  --blue:#3c9dff;
  --green:#69f0ae;
  --danger:#ff7b7b;
  --radius:24px;
  --shadow:0 24px 80px rgba(0,0,0,.46);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:#000;
  color:var(--text);
  overflow:hidden;
}
button,input,textarea{font:inherit}
a{color:inherit}
.app-shell{height:100vh;display:grid;grid-template-columns:292px 1fr;background:#000}
.rail{
  border-right:1px solid var(--line);
  padding:22px 24px 18px;
  display:flex;
  flex-direction:column;
  gap:24px;
  min-width:0;
}
.brand-mark{font-size:40px;font-weight:900;letter-spacing:-.08em;line-height:1;color:#fff;width:46px;height:46px;display:grid;place-items:center}
.nav-list{display:flex;flex-direction:column;gap:6px}
.nav-item{
  width:100%;border:0;background:transparent;color:#eef1f5;
  display:flex;align-items:center;gap:18px;text-align:left;
  padding:12px 8px;border-radius:999px;font-size:22px;cursor:pointer;
  transition:.16s ease;
}
.nav-item:hover,.nav-item.active{background:#101114}
.nav-icon{width:28px;text-align:center;font-size:25px;line-height:1}
.post-btn{
  border:0;border-radius:999px;background:#eff3f6;color:#111318;
  height:56px;font-weight:900;font-size:18px;cursor:pointer;margin-top:2px;
}
.profile-card{margin-top:auto;display:flex;align-items:center;gap:12px;padding:10px 0;color:#f7f9fc;min-width:0}
.profile-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#2c7dff,#75f2c7);color:#001225;font-weight:900}
.profile-card small{display:block;color:var(--muted);font-size:14px}.profile-dot{margin-left:auto;color:var(--muted)}
.workspace{height:100vh;display:flex;flex-direction:column;min-width:0;position:relative;background:#000}
.mobile-topbar{display:none}
.top-actions{height:58px;display:flex;align-items:center;gap:14px;padding:0 28px;border-bottom:1px solid rgba(255,255,255,.04)}
.round-btn{border:0;background:transparent;color:#f4f6fb;border-radius:50%;width:38px;height:38px;display:grid;place-items:center;cursor:pointer;font-size:22px}
.round-btn:hover{background:#111318}.model-title{margin-left:auto;margin-right:auto;font-weight:850}.model-title span{font-size:13px;color:#7eb7ff;background:#06162a;border-radius:6px;padding:2px 8px;margin-left:5px}
.view{display:none;min-height:0;overflow:auto}.active-view{display:block}.chat-view.active-view{display:flex;flex-direction:column;flex:1;overflow:hidden}.home-view{}
#homeView{padding:32px 9vw 120px}.hero-card{max-width:960px;margin:0 auto;padding:38px 44px;border:1px solid var(--line);border-radius:34px;background:radial-gradient(circle at 12% 0,rgba(60,157,255,.18),transparent 32%),linear-gradient(180deg,#0e1118,#050505);box-shadow:var(--shadow)}
.eyebrow{margin:0 0 12px;color:#7eb7ff;text-transform:uppercase;letter-spacing:.16em;font-size:12px;font-weight:800}.hero-card h1{font-size:48px;line-height:1.08;margin:0 0 18px;letter-spacing:-.04em}.hero-copy{color:var(--muted2);font-size:18px;line-height:1.65;max-width:760px}.hero-actions{display:flex;gap:12px;margin-top:28px;flex-wrap:wrap}.primary-btn,.secondary-btn{border:0;border-radius:999px;padding:13px 22px;font-weight:900;cursor:pointer}.primary-btn{background:#fff;color:#000}.secondary-btn{background:#181b22;color:#fff;border:1px solid var(--line)}
.feature-grid{max-width:960px;margin:22px auto 0;display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.feature-card{border:1px solid var(--line);background:#08090b;border-radius:24px;padding:20px}.feature-card span{color:#7eb7ff;font-weight:900}.feature-card h3{margin:14px 0 8px}.feature-card p{margin:0;color:var(--muted);line-height:1.55}
.messages{flex:1;overflow:auto;padding:0 9vw 24px;display:flex;flex-direction:column;gap:18px;scroll-behavior:smooth}.messages:empty:before{content:"Ask Realigns AI";display:block;margin:0 auto;color:#fff;font-weight:900;font-size:34px;padding-top:44px;letter-spacing:-.03em}
.message{display:flex;gap:14px;max-width:920px;margin:0 auto;width:100%}.message.user{justify-content:flex-end}.message.user .bubble{max-width:740px;background:#1d2028}.avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;flex:0 0 42px;background:#20232b;color:#fff;font-weight:900;font-size:13px}.ai .avatar{background:linear-gradient(135deg,#3c9dff,#69f0ae);color:#001226}.bubble{border-radius:24px;padding:16px 18px;line-height:1.58;color:#eef3fa}.bubble p{margin:0;white-space:pre-wrap}.bubble strong{display:block;margin-bottom:7px}.ai .bubble{background:transparent;max-width:760px}.error{color:var(--danger)}
.image-slider{padding:4px 9vw 22px;display:grid;grid-template-columns:repeat(2,minmax(240px,370px));gap:14px;justify-content:center;max-height:430px;overflow:auto}.image-slider.hidden{display:none}.card{border:1px solid rgba(255,255,255,.08);background:#0a0b0d;border-radius:18px;overflow:hidden;box-shadow:0 16px 54px rgba(0,0,0,.3)}.img-card img{width:100%;height:180px;display:block;object-fit:cover;filter:saturate(.92)}.card-body{padding:12px 14px}.card h3{font-size:15px;line-height:1.3;margin:0 0 8px}.card h3 a{text-decoration:none}.card p{font-size:13px;color:var(--muted2);line-height:1.45;margin:0}.card small{display:block;color:var(--muted);font-size:12px;margin-top:9px}.web-card{grid-column:span 1}.web-card h3{font-size:16px}.web-card a{color:#f8fbff;text-decoration:none}.web-card:hover a{text-decoration:underline}
.composer{border-top:1px solid rgba(255,255,255,.05);padding:10px 9vw 18px;background:linear-gradient(180deg,rgba(0,0,0,.1),#000)}.quick-pills{display:flex;gap:8px;justify-content:center;margin-bottom:8px;flex-wrap:wrap}.quick-pills button{border:0;border-radius:999px;background:#20232b;color:#c8ced8;padding:6px 14px;cursor:pointer}.composer-row{max-width:920px;margin:0 auto;display:flex;align-items:flex-end;gap:10px;background:#20232b;border:1px solid #2a2e37;border-radius:999px;padding:8px 8px 8px 12px}.tool-btn,.send-btn{border:0;border-radius:50%;width:38px;height:38px;display:grid;place-items:center;cursor:pointer;flex:0 0 38px}.tool-btn{background:transparent;color:#f1f4f8;font-size:22px}.send-btn{background:#8f98a6;color:#101115;font-weight:900}textarea{flex:1;resize:none;background:transparent;border:0;outline:0;color:#fff;min-height:38px;max-height:130px;padding:8px 2px;font-size:17px}textarea::placeholder{color:#878d98}.toggle-pill{display:flex;align-items:center;gap:5px;border-radius:999px;padding:8px 10px;background:#2a2e37;color:#d8dde6;font-size:13px;white-space:nowrap}.toggle-pill input{accent-color:#3c9dff}
.research-view,.history-view{padding:34px 9vw 120px}.research-header{max-width:920px;margin:0 auto 18px}.research-header h2{font-size:34px;letter-spacing:-.04em;margin:0 0 8px}.research-header p{color:var(--muted2);line-height:1.6}.research-form{max-width:920px;margin:0 auto 20px;display:flex;gap:10px}.research-form input{flex:1;background:#151820;border:1px solid var(--line);border-radius:999px;color:#fff;padding:15px 18px;outline:0}.research-form button{border:0;border-radius:999px;background:#fff;color:#000;font-weight:900;padding:0 22px}.research-results,.history-list{max-width:920px;margin:0 auto;display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px}.history-item{border:1px solid var(--line);border-radius:20px;background:#090a0d;padding:16px;cursor:pointer}.history-item strong{display:block;margin-bottom:8px}.history-item p{color:var(--muted2);font-size:14px;line-height:1.45;margin:0}.history-actions{max-width:920px;margin:0 auto 16px;display:flex;gap:10px}.history-actions button{border:0;border-radius:999px;padding:10px 14px;font-weight:800;cursor:pointer}
@media(max-width:980px){body{overflow:auto}.app-shell{display:block;height:auto;min-height:100vh}.rail{position:fixed;inset:0 auto 0 0;width:280px;z-index:20;background:#000;transform:translateX(-101%);transition:.2s ease}.rail.open{transform:translateX(0)}.workspace{height:auto;min-height:100vh}.mobile-topbar{display:flex;align-items:center;justify-content:space-between;padding:10px 14px;border-bottom:1px solid var(--line);position:sticky;top:0;background:#000;z-index:10}.top-actions{display:none}.hero-card h1{font-size:34px}.feature-grid{grid-template-columns:1fr}.messages,.composer,.image-slider,#homeView,.research-view,.history-view{padding-left:16px;padding-right:16px}.composer{position:sticky;bottom:0}.composer-row{border-radius:24px;align-items:center;flex-wrap:wrap}.toggle-pill{font-size:12px}.image-slider{grid-template-columns:1fr;max-height:none}.research-form{flex-direction:column}.research-form button{height:48px}.nav-item{font-size:20px}}
@media(max-width:560px){.hero-card{padding:26px 22px}.hero-card h1{font-size:30px}.quick-pills{justify-content:flex-start}.messages:empty:before{font-size:27px}.message{gap:10px}.avatar{width:36px;height:36px;flex-basis:36px}.message.user .bubble{max-width:calc(100% - 48px)}}

.open-result{display:inline-flex;align-items:center;margin-top:10px;text-decoration:none;color:#f8fbff;font-size:13px;font-weight:800;opacity:.9}
.open-result:hover{text-decoration:underline;opacity:1}
.card small{display:none!important}

/* =========================================================
   Bigger Professional Image + Video Cards
   Add at bottom of assets/app.css
   ========================================================= */

#searchResults,
#researchResults{
  width:min(760px, 92vw);
  margin-left:auto;
  margin-right:auto;
  display:grid;
  grid-template-columns:repeat(2, minmax(280px, 1fr));
  gap:18px;
  align-items:start;
}

#searchResults .card,
#researchResults .card{
  min-height:260px;
  border-radius:22px;
  overflow:hidden;
}

#searchResults .img-card,
#researchResults .img-card,
#searchResults .video-card,
#researchResults .video-card{
  min-height:330px;
}

#searchResults .pro-image-card img,
#researchResults .pro-image-card img,
#searchResults .video-card img,
#researchResults .video-card img{
  width:100%;
  height:230px;
  object-fit:cover;
  display:block;
  border-radius:22px 22px 0 0;
}

#searchResults .video-thumb,
#researchResults .video-thumb{
  min-height:230px;
}

#searchResults .video-placeholder,
#researchResults .video-placeholder{
  min-height:230px;
}

#searchResults .card-body,
#researchResults .card-body{
  padding:16px 18px 18px;
}

#searchResults .card-body h3,
#researchResults .card-body h3{
  font-size:16px;
  line-height:1.25;
  margin:5px 0 7px;
}

#searchResults .card-body p,
#researchResults .card-body p{
  font-size:13px;
  line-height:1.45;
}

.play-badge{
  width:60px;
  height:60px;
  font-size:23px;
}

/* Full width for single card */
#searchResults .card:only-child,
#researchResults .card:only-child{
  grid-column:1 / -1;
}

/* Mobile responsive */
@media (max-width: 760px){
  #searchResults,
  #researchResults{
    width:94vw;
    grid-template-columns:1fr;
    gap:14px;
  }

  #searchResults .pro-image-card img,
  #researchResults .pro-image-card img,
  #searchResults .video-card img,
  #researchResults .video-card img,
  #searchResults .video-thumb,
  #researchResults .video-thumb,
  #searchResults .video-placeholder,
  #researchResults .video-placeholder{
    height:220px;
    min-height:220px;
  }
}

/* =========================================================
   Realigns Logo + AI Avatar
   ========================================================= */

.logo-brand,
.logo-avatar,
.ai-logo-avatar{
  overflow:hidden;
  background:#ffffff;
  border:1px solid rgba(255,255,255,.16);
  display:grid;
  place-items:center;
}

.logo-brand img,
.logo-avatar img,
.ai-logo-avatar img{
  width:100%;
  height:100%;
  object-fit:contain;
  padding:4px;
  display:block;
}

.brand-mark.logo-brand{
  width:44px;
  height:44px;
  border-radius:14px;
}

.mini-avatar.logo-avatar{
  width:36px;
  height:36px;
  border-radius:999px;
  flex-shrink:0;
}

.avatar.ai-logo-avatar{
  width:38px;
  height:38px;
  min-width:38px;
  border-radius:999px;
  padding:0;
}

.top-brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.top-brand img{
  width:22px;
  height:22px;
  object-fit:contain;
  border-radius:7px;
  background:#fff;
  padding:2px;
}

.top-brand strong{
  font-weight:900;
}

.top-brand span{
  margin-left:2px;
}

/* =========================================================
   Hide Image/Video Result Area When Not Needed
   ========================================================= */

#searchResults.hidden,
#researchResults.hidden{
  display:none !important;
  width:0 !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}

#searchResults:empty,
#researchResults:empty{
  display:none !important;
  width:0 !important;
  height:0 !important;
  min-height:0 !important;
  margin:0 !important;
  padding:0 !important;
  overflow:hidden !important;
}

/* Prevent empty result area from creating horizontal scrollbar */
.image-slider.hidden,
.research-results.hidden{
  display:none !important;
}

/* Only show result grid when cards are actually visible */
#searchResults:not(.hidden),
#researchResults:not(.hidden){
  overflow:visible;
}

/* =========================================================
   Realigns AI Animated Thinking Background
   ========================================================= */

.workspace{
  position:relative;
  overflow:hidden;
}

.ai-thinking-bg{
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:0;
  transition:opacity .35s ease;
  z-index:0;
  overflow:hidden;
}

.ai-thinking-bg.active{
  opacity:1;
}

.ai-orb{
  position:absolute;
  width:360px;
  height:360px;
  border-radius:999px;
  filter:blur(34px);
  opacity:.34;
  mix-blend-mode:screen;
  animation:realignsOrbFloat 7s ease-in-out infinite alternate;
}

.orb-one{
  left:18%;
  top:18%;
  background:radial-gradient(circle, rgba(77,213,255,.9), rgba(77,213,255,0) 68%);
}

.orb-two{
  right:14%;
  top:28%;
  background:radial-gradient(circle, rgba(160,92,255,.85), rgba(160,92,255,0) 70%);
  animation-delay:-2s;
}

.orb-three{
  left:45%;
  bottom:8%;
  background:radial-gradient(circle, rgba(82,255,191,.72), rgba(82,255,191,0) 70%);
  animation-delay:-4s;
}

.ai-grid-glow{
  position:absolute;
  inset:0;
  opacity:.18;
  background:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size:46px 46px;
  mask-image:radial-gradient(circle at center, black 0%, transparent 72%);
  animation:realignsGridMove 9s linear infinite;
}

@keyframes realignsOrbFloat{
  0%{
    transform:translate3d(-18px, 8px, 0) scale(.96);
  }
  100%{
    transform:translate3d(22px, -18px, 0) scale(1.08);
  }
}

@keyframes realignsGridMove{
  from{
    background-position:0 0;
  }
  to{
    background-position:46px 46px;
  }
}

/* Keep real content above animation */
.mobile-topbar,
.top-actions,
.view,
.composer{
  position:relative;
  z-index:2;
}

/* =========================================================
   Page Refresh / Load Animation
   ========================================================= */

.page-refresh-fx{
  position:absolute;
  inset:0;
  z-index:20;
  display:grid;
  place-items:center;
  background:
    radial-gradient(circle at center, rgba(57,213,255,.13), transparent 34%),
    rgba(0,0,0,.48);
  opacity:0;
  pointer-events:none;
  transition:opacity .22s ease;
}

.page-refresh-fx.active{
  opacity:1;
}

.refresh-core{
  width:92px;
  height:92px;
  border-radius:28px;
  display:grid;
  place-items:center;
  position:relative;
  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.15);
  box-shadow:0 24px 80px rgba(57,213,255,.18);
  animation:refreshPop .8s ease forwards;
}

.refresh-core img{
  width:42px;
  height:42px;
  object-fit:contain;
  border-radius:12px;
  background:#fff;
  padding:5px;
  z-index:2;
}

.refresh-core span{
  position:absolute;
  inset:-12px;
  border-radius:34px;
  border:2px solid rgba(77,213,255,.45);
  border-top-color:rgba(255,255,255,.96);
  animation:refreshSpin .8s linear infinite;
}

@keyframes refreshSpin{
  to{
    transform:rotate(360deg);
  }
}

@keyframes refreshPop{
  0%{
    transform:scale(.84);
    opacity:0;
  }
  35%{
    transform:scale(1.04);
    opacity:1;
  }
  100%{
    transform:scale(1);
    opacity:1;
  }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce){
  .ai-orb,
  .ai-grid-glow,
  .refresh-core,
  .refresh-core span{
    animation:none!important;
  }
}