:root{
  --bg:#0b1020;
  --panel: rgba(20,24,38,.72);
  --panel2: rgba(10,12,20,.65);
  --text:#eaf0ff;
  --muted:#a9b6d3;
  --line:rgba(255,255,255,.10);
  --shadow: 0 18px 50px rgba(0,0,0,.45);

  --accent1:#a855f7;
  --accent2:#ec4899;
  --good:#39ff7a;
  --danger:#ff4d4d;
}

/* Themes */
body[data-theme="default"]{
  --accent1:#a855f7;
  --accent2:#ec4899;
}
body[data-theme="ocean"]{
  --accent1:#22c1ff;
  --accent2:#3b82f6;
}
body[data-theme="emerald"]{
  --accent1:#34d399;
  --accent2:#10b981;
}
body[data-theme="sunset"]{
  --accent1:#fb7185;
  --accent2:#f59e0b;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(168,85,247,.20), transparent 65%),
    radial-gradient(1100px 700px at 80% 30%, rgba(34,193,255,.16), transparent 60%),
    radial-gradient(900px 600px at 60% 90%, rgba(236,72,153,.12), transparent 55%),
    #070a12;
  overflow:hidden;
}

.hidden{display:none!important}

.app{
  height:100vh;
  display:grid;
  grid-template-columns:320px 1fr;
  gap:0;
}

/* Sidebar */
.side{
  height:100vh;
  padding:18px;
  border-right:1px solid var(--line);
  background: linear-gradient(180deg, rgba(12,16,28,.86), rgba(8,10,18,.86));
  display:flex;
  flex-direction:column;
  gap:14px;
  overflow-y:auto;
  overflow-x:hidden;
}

.brand{
  display:flex;
  gap:12px;
  align-items:center;
}

.logo{
  width:46px;
  height:46px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: rgba(255,255,255,.08);
  border:1px solid var(--line);
}

.name{
  font-weight:900;
  font-size:24px;
  line-height:1;
}

.tag{
  color:#7CFF8F;
  font-weight:700;
  margin-top:4px;
  font-size:13px;
}

.proBtn{
  border:0;
  padding:16px 18px;
  border-radius:18px;
  font-weight:900;
  letter-spacing:.6px;
  cursor:pointer;
  color:white;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  box-shadow: 0 12px 32px rgba(168,85,247,.22);
}

.proBtn.isPro{ filter:saturate(1.2); }
.proBtn.isTeam{ box-shadow: 0 12px 36px rgba(34,193,255,.28); }

.sideBlock{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-top:4px;
}

.sideItem{
  text-align:left;
  border:1px solid var(--line);
  background: rgba(0,0,0,.18);
  border-radius:18px;
  padding:16px 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
  cursor:pointer;
}

.sideTitle{
  font-size:18px;
  font-weight:900;
}

.sideSub{
  color:var(--muted);
  margin-top:6px;
  font-size:13px;
}

.sideFooter{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:10px;
  padding-bottom:10px;
}

.ghostBtn{
  background: rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  padding:12px 14px;
  border-radius:16px;
  cursor:pointer;
  font-weight:800;
}

/* Main */
.main{
  height:100vh;
  display:grid;
  grid-template-rows:72px 1fr auto 78px 34px;
  overflow:hidden;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  background: rgba(10,12,20,.35);
}

.title{
  font-size:28px;
  font-weight:900;
}

.actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.pill{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-weight:800;
}

.pill.danger{
  border-color: rgba(255,77,77,.35);
}

/* Chat */
.chatWrap{
  position:relative;
  overflow:hidden;
  padding:18px;
}

.chatMessages{
  height:100%;
  overflow:auto;
  padding-right:10px;
  display:flex;
  flex-direction:column;
  gap:16px;
}

.msg{
  display:block;
  width:fit-content;
  max-width:min(900px, 78%);
  padding:22px 26px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  background: linear-gradient(90deg, rgba(168,85,247,.75), rgba(236,72,153,.65));
  line-height:1.5;
  white-space:normal;
  word-break:break-word;
}

.msg.user{
  align-self:flex-end;
  background: rgba(0,0,0,.20);
  box-shadow:none;
  max-width:min(760px, 86%);
}

.msg.assistant{
  align-self:flex-start;
  max-width:min(900px, 78%);
}

/* User image bubble */
.userImageBubble{
  display:block;
  width:fit-content;
  max-width:min(720px, 100%);
}

.userImageBubbleImg{
  display:block;
  width:auto;
  max-width:min(720px, 100%);
  height:auto;
  max-height:300px;
  object-fit:contain;
  border-radius:14px;
  background: rgba(255,255,255,.04);
}

.userImageBubbleCaption{
  margin-top:10px;
  line-height:1.35;
  word-break:break-word;
  max-width:min(720px, 100%);
}

/* Image stage */
.imageStage{
  padding:0 16px 12px 16px;
  background: rgba(10,12,20,.18);
}

.imageDropZone{
  border:1px solid rgba(168,85,247,.28);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03));
  border-radius:20px;
  padding:14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.imageDropZone.dragover{
  border-color: rgba(34,193,255,.65);
  box-shadow:
    0 0 0 1px rgba(34,193,255,.25),
    0 0 30px rgba(34,193,255,.12);
  background: linear-gradient(180deg, rgba(34,193,255,.08), rgba(255,255,255,.04));
}

.imageStageTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.imageStageTitle{
  font-weight:900;
  font-size:15px;
  letter-spacing:.2px;
}

.miniDangerBtn{
  border:1px solid rgba(255,77,77,.32);
  background: rgba(255,77,77,.08);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-weight:800;
}

.imageStageBody{
  display:flex;
  gap:14px;
  align-items:center;
}

.imagePreviewWrap{
  width:90px;
  height:90px;
  border-radius:16px;
  overflow:hidden;
  flex:0 0 90px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.28);
  display:flex;
  align-items:center;
  justify-content:center;
}

.imagePreview{
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
  background: rgba(255,255,255,.04);
}

.imageMeta{
  min-width:0;
  flex:1;
}

.imageName{
  font-weight:800;
  font-size:15px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.imageHint{
  color:var(--muted);
  margin-top:6px;
  font-size:13px;
  line-height:1.35;
}

/* Composer */
.composer{
  border-top:1px solid var(--line);
  background: rgba(10,12,20,.35);
  padding:12px 16px;
  display:flex;
  align-items:center;
  gap:10px;
}

.inputWrap{
  flex:1;
}

.chatInput{
  width:100%;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid rgba(168,85,247,.35);
  background: rgba(0,0,0,.25);
  color:var(--text);
  outline:none;
}

.chatInput::placeholder{
  color: rgba(234,240,255,.58);
}

.roundBtn{
  width:54px;
  height:54px;
  border-radius:18px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.06);
  color:var(--text);
  cursor:pointer;
  font-size:18px;
}

.roundBtn.send{
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  border:0;
  font-weight:900;
}

.footerNote{
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgba(234,240,255,.9);
  font-size:13px;
  border-top:1px solid rgba(255,255,255,.06);
}


/* Simo Pro glow animation */

@keyframes badgeGlow {
  0% { box-shadow:0 0 4px rgba(0,255,156,.4); }
  50% { box-shadow:0 0 14px rgba(0,255,156,.8); }
  100% { box-shadow:0 0 4px rgba(0,255,156,.4); }
}
/* Apply glow to Simo Pro badge */

.planBadge.pro {
  color:#00ff9c;
  border:1px solid #00ff9c;
  background:rgba(0,255,156,.08);
  animation: badgeGlow 2.5s infinite ease-in-out;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  z-index:50;
}

.modalCard{
  width:900px;
  max-width:95vw;
  max-height:90vh;
  display:flex;
  flex-direction:column;
  background: rgba(10,12,20,.92);
  border:1px solid rgba(255,255,255,.12);
  border-radius:22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  overflow:hidden;
}

.modalCard.wide{ width:980px; }

.modalTop{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 18px;
  border-bottom:1px solid rgba(255,255,255,.10);
  flex:0 0 auto;
}

.modalTitle{
  font-weight:900;
  font-size:22px;
}

.xBtn{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  color:var(--text);
  border-radius:14px;
  width:44px;
  height:44px;
  cursor:pointer;
  font-size:18px;
}

.modalBody{
  padding:18px;
  overflow-y:auto;
  flex:1 1 auto;
  min-height:0;
}

.pillRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}

.chip{
  padding:10px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
}

.muted{ color:var(--muted); }
.tiny{ font-size:12px; }

.tiers.two{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  margin-top:14px;
}

.tierCard{
  border-radius:18px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  padding:16px;
}

.tierCard.hot{
  background: linear-gradient(180deg, rgba(168,85,247,.25), rgba(236,72,153,.12));
  border-color: rgba(168,85,247,.25);
}

.tierName{
  font-weight:900;
  font-size:18px;
}

.tierPrice{
  margin-top:6px;
  font-weight:800;
}

.tierList{
  margin:10px 0 0 18px;
  color: var(--muted);
}

.tierBtns{
  display:flex;
  gap:10px;
  margin-top:12px;
  flex-wrap:wrap;
}

.buyBtn{
  padding:12px 14px;
  border-radius:16px;
  border:0;
  cursor:pointer;
  font-weight:900;
  color:white;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
}

.buyBtn.ghost{
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.14);
  color:var(--text);
}

/* Settings */
.setRow{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:18px;
  background: rgba(255,255,255,.04);
  margin-bottom:12px;
}

.setLeft{ max-width:70%; }

.setTitle{
  font-weight:900;
  font-size:18px;
}

.setSub{
  color:var(--muted);
  margin-top:6px;
  font-size:13px;
}

.select{
  padding:12px 14px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color:var(--text);
  min-width:220px;
}

.setButtons{
  display:flex;
  gap:12px;
  margin-top:10px;
}

/* Switch */
.switch{
  position:relative;
  display:inline-block;
  width:58px;
  height:34px;
}

.switch input{ display:none; }

.slider{
  position:absolute;
  cursor:pointer;
  inset:0;
  background: rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  transition:.2s;
}

.slider:before{
  content:"";
  position:absolute;
  height:26px;
  width:26px;
  left:4px;
  top:3px;
  background:white;
  border-radius:999px;
  transition:.2s;
}

.switch input:checked + .slider{
  background: rgba(34,197,94,.40);
  border-color: rgba(34,197,94,.45);
}

.switch input:checked + .slider:before{
  transform: translateX(24px);
}

.accValue{
  font-size:16px;
  font-weight:900;
  margin-top:6px;
}

/* Builder Preview Modal */
.builderPreviewCard{
  width:min(1280px, 96vw);
  max-width:96vw;
}

.builderPreviewFrameWrap{
  width:100%;
  height:min(68vh, 760px);
  border-radius:18px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.10);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.02)),
    rgba(0,0,0,.20);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
  flex:0 0 auto;
}

.builderPreviewFrame{
  width:100%;
  height:100%;
  border:0;
  display:block;
  background:#ffffff;
}

#builderHtmlWrap{
  width:100%;
}

#builderHtmlView{
  width:100%;
  min-height:260px;
  resize:vertical;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(5,8,16,.92);
  color:#dbe7ff;
  padding:16px;
  line-height:1.45;
  outline:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

#builderHtmlView::placeholder{
  color: rgba(219,231,255,.48);
}

/* Responsive */
@media (max-width:980px){
  .app{ grid-template-columns:1fr; }
  .side{ display:none; }
  .tiers.two{ grid-template-columns:1fr; }

  .msg{ max-width:min(92%, 760px); }
  .msg.user{ max-width:min(92%, 760px); }
  .msg.assistant{ max-width:min(92%, 760px); }

  .userImageBubble{ max-width:100%; }
  .userImageBubbleImg{ max-width:100%; }

  .builderPreviewCard{
    width:96vw;
  }

  .builderPreviewFrameWrap{
    height:min(62vh, 620px);
  }
}

@media (max-width:720px){
  .topbar{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
  }

  .actions{ flex-wrap:wrap; }
  .imageStageBody{ align-items:flex-start; }
  .composer{ gap:8px; }

  .roundBtn{
    width:50px;
    height:50px;
  }

  .chatInput{ padding:13px 14px; }

  .msg{
    padding:18px 20px;
    max-width:92%;
  }

  .msg.user{ max-width:92%; }
  .msg.assistant{ max-width:92%; }

  .userImageBubble{ max-width:100%; }
  .userImageBubbleImg{
    max-width:100%;
    max-height:260px;
  }

  .modal{
    padding:12px;
  }

  .modalCard,
  .modalCard.wide,
  .builderPreviewCard{
    width:100%;
    max-width:100%;
    border-radius:18px;
  }

  .modalTop{
    padding:14px 14px;
  }

  .modalBody{
    padding:14px;
  }

  .tierBtns,
  .setButtons{
    flex-direction:column;
  }

  .buyBtn,
  .buyBtn.ghost{
    width:100%;
  }

  .builderPreviewFrameWrap{
    height:52vh;
  }

  #builderHtmlView{
    min-height:220px;
    font-size:13px;
  }
}

.planBadge{
  margin-left:8px;
  padding:3px 10px;
  font-size:11px;
  border-radius:999px;
  font-weight:700;
  letter-spacing:.6px;
}

/* SIMO PRO */

.planBadge.pro{
  color:#00ff9c;
  border:1px solid #00ff9c;
  box-shadow:
    0 0 6px rgba(0,255,156,.8),
    0 0 14px rgba(0,255,156,.6);
  background:rgba(0,255,156,.08);
}

/* TEAM */

.planBadge.team{
  color:#ffd700;
  border:1px solid #ffd700;
  box-shadow:0 0 8px rgba(255,215,0,.8);
}