:root{
  --bg:#0b0f17;
  --panel:#0f1626;
  --panel2:#0c1220;
  --text:#e7eefc;
  --muted:#a7b3cc;
  --border:rgba(255,255,255,.10);
  --shadow: 0 18px 60px rgba(0,0,0,.45);
  --radius: 14px;
  --radius2: 18px;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:linear-gradient(180deg,#070a10,#0b1020 50%, #070a10);
}

.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 14px;
  border-bottom:1px solid var(--border);
  background:rgba(10,14,24,.92);
  backdrop-filter: blur(10px);
}
.brand{letter-spacing:.2px}
.muted{color:var(--muted)}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;}

.topbar__right{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.toggle{display:flex; gap:8px; align-items:center; color:var(--muted); user-select:none}
.toggle input{transform:translateY(1px)}

.btn{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
}
.btn:disabled{opacity:.45; cursor:not-allowed}
.btn--primary{
  background:rgba(106,92,255,.25);
  border-color:rgba(106,92,255,.55);
}
.btn--ghost{ background:transparent; }

/* Toolbar tool buttons */
.btn--tool{
  padding:7px 9px;
  border-radius:10px;
  background:rgba(255,255,255,.05);
}
.btn--tool:active{
  transform:translateY(1px);
}

.layout{
  height: calc(100vh - 56px);
  display:grid;
  grid-template-columns: 1.6fr 1fr;
  gap:12px;
  padding:12px;
}

.pane{
  background:linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border:1px solid var(--border);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-width:0;
}

.pane__title{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  background:rgba(0,0,0,.10);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.previewWrap{flex:1; background:var(--panel2)}
.previewFrame{
  width:100%;
  height:100%;
  border:0;
  background:white;
}

.pane__body{
  flex:1;
  overflow:auto;
  background:rgba(0,0,0,.08);
  padding:12px;
}

.card{
  background:rgba(15,22,38,.70);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:12px;
  margin-bottom:12px;
}
.label{font-size:12px; color:var(--muted); margin-bottom:6px}
.input,.textarea{
  width:100%;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  border-radius:12px;
  padding:10px 10px;
  outline:none;
}
.textarea{resize:vertical; min-height:120px}

.grid2{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

.row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.row--end{justify-content:flex-end}
.row__actions{display:flex; gap:8px}
.block{margin-top:12px}
.hidden{display:none}

.help{
  font-size:12px;
  margin-top:8px;
}

.tabs{display:flex; gap:8px; flex-wrap:wrap}
.tab{
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--text);
  padding:7px 10px;
  border-radius:999px;
  cursor:pointer;
}
.tab--active{
  background:rgba(106,92,255,.22);
  border-color:rgba(106,92,255,.50);
}

.tabPanel{display:none}
.tabPanel--active{display:block}

.list{padding:0; overflow:hidden}
.listItem{
  padding:10px 12px;
  border-top:1px solid var(--border);
  cursor:pointer;
}
.listItem:hover{background:rgba(255,255,255,.06)}
.listItem__top{display:flex; gap:8px; align-items:center}
.badge{
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.04);
  color:var(--muted);
}

/* Rich text editor */
.rteToolbar{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 10px;
}
.rte{
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  border-radius:12px;
  padding:10px;
  min-height:140px;
  outline:none;
  overflow:auto;
  white-space:normal;
}
.rte:focus{
  border-color:rgba(106,92,255,.55);
  box-shadow: 0 0 0 3px rgba(106,92,255,.18);
}
.toggle--sm{
  gap:6px;
  font-size:12px;
  color:var(--muted);
}
.toggle--sm input{
  transform:none;
}

.rteToolbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  margin:8px 0 10px;
}
.rte ul, .rte ol{
  margin: .5em 0;
  padding-left: 1.4em;
}
.rte li{
  margin: .15em 0;
}
.inspectorActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:10px;
}
.btn--danger{
  background:#b42318;
  color:#fff;
  border-color:transparent;
}
.btn--danger:hover{ filter:brightness(1.05); }

.rteToolbar__left{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.rteToolbar__right{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-left:auto;
}

.rte.rte--disabled{
  opacity:.55;
  pointer-events:none;
}
/* --- CSS tab helpers (optional) --- */
.cssEditor{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  tab-size: 2;
}

.listItem--active{
  outline: 2px solid rgba(106,92,255,.55);
  outline-offset: 2px;
}

@media (max-width: 1050px){
  .layout{grid-template-columns:1fr; height:auto}
  .pane--preview{height:65vh}
}
