:root{
  --bg:#050505;
  --panel:#111111;
  --panel2:#0a0a0a;
  --border:rgba(255,255,255,.06);
  --border2:rgba(255,255,255,.10);
  --muted:rgba(255,255,255,.55);
  --muted2:rgba(255,255,255,.35);
  --text:#ffffff;
  --green:#00E676;
  --green2:#00ff84;
  --shadow: 0 20px 60px rgba(0,0,0,.55);
  --radius: 18px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  overflow-x:hidden;
}

.hidden{display:none !important}

/* Glow */
.glow-layer{
  position:fixed; inset:0;
  pointer-events:none;
  z-index:0;
  overflow:hidden;
}
.glow{
  position:absolute;
  border-radius:999px;
  filter: blur(120px);
  opacity:.35;
}
.glow-1{
  width:55vw; height:55vw;
  right:-15vw; top:-15vw;
  background: rgba(0,230,118,.18);
}
.glow-2{
  width:45vw; height:45vw;
  left:-15vw; bottom:-15vw;
  background: rgba(37,99,235,.18);
}

/* Header */
.header{
  position:sticky; top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:14px 18px;
  background: rgba(0,0,0,.60);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 20px 40px rgba(0,0,0,.45);
}

.brand{display:flex; align-items:center; gap:14px; flex-wrap:wrap}
.brand-left{display:flex; flex-direction:column}
.brand-title{display:flex; align-items:baseline; gap:8px}
.brand-name{
  font-weight:900;
  font-size:22px;
  letter-spacing:-.04em;
  font-style:italic;
}
.brand-dot{
  width:10px;height:10px;border-radius:50%;
  background: var(--green);
  box-shadow:0 0 10px var(--green);
  animation:pulse 1.6s infinite ease-in-out;
}
@keyframes pulse{
  0%,100%{opacity:.35; transform:scale(1)}
  50%{opacity:1; transform:scale(1.1)}
}
.brand-sub{
  font-size:9px;
  letter-spacing:.40em;
  color:rgba(255,255,255,.32);
  font-weight:800;
  text-transform:uppercase;
  margin-top:-2px;
}
.brand-sep{width:1px;height:28px;background:var(--border); display:none}
.brand-right{
  font-size:11px;
  font-weight:900;
  letter-spacing:.25em;
  color: var(--green);
  text-transform:uppercase;
  display:none;
}
@media (min-width:720px){
  .brand-sep{display:block}
  .brand-right{display:block}
}

/* Buttons */
.actions{display:flex; align-items:center; gap:10px; flex-wrap:wrap}
.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 14px;
  border-radius:12px;
  border:1px solid var(--border2);
  background: rgba(255,255,255,.04);
  color: rgba(255,255,255,.90);
  font-size:11px;
  font-weight:900;
  letter-spacing:.10em;
  text-transform:uppercase;
  cursor:pointer;
  transition: transform .08s ease, background .2s ease, box-shadow .2s ease, opacity .2s ease;
}
.btn:hover{background: rgba(255,255,255,.08)}
.btn:active{transform:scale(.98)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.btn.primary{
  background: var(--green);
  border-color: var(--green);
  color:#000;
}
.btn.primary:hover{
  background: var(--green2);
  box-shadow:0 0 22px rgba(0,230,118,.35);
}
.btn.light{
  background:#fff; color:#000;
  border-color:#fff;
}
.btn.light:hover{background:#e8e8e8}
.icon-btn{padding:10px 10px}
.icon{display:inline-flex; width:18px; height:18px}
.icon svg{width:18px;height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}

/* Config */
.config-panel{
  position:relative;
  z-index:9;
  border-bottom: 1px solid var(--border);
  background: var(--panel2);
  padding:18px;
  box-shadow: inset 0 -20px 40px rgba(0,0,0,.35);
}
.config-inner{
  max-width:980px;
  margin:0 auto;
  display:grid;
  grid-template-columns: 1fr;
  gap:14px;
}
@media (min-width:900px){
  .config-inner{grid-template-columns: 1fr 1fr auto; align-items:end}
}
.field label{
  display:block;
  font-size:10px;
  font-weight:900;
  letter-spacing:.22em;
  text-transform:uppercase;
  color: rgba(255,255,255,.35);
  margin-bottom:8px;
}
.input-wrap{
  position:relative;
  display:flex;
  align-items:center;
}
.input-icon{
  position:absolute;
  left:12px;
  opacity:.55;
}
.input-icon svg{width:16px;height:16px}
#endpointInput{
  width:100%;
  padding:12px 14px 12px 40px;
  border-radius:14px;
  border:1px solid var(--border2);
  background:#000;
  color: var(--green);
  font-family: var(--mono);
  font-size:12px;
  outline:none;
}
#endpointInput:focus{
  box-shadow:0 0 0 3px rgba(0,230,118,.18);
  border-color: rgba(0,230,118,.45);
}
.checkbox{
  display:flex; align-items:center; gap:10px;
  user-select:none;
  font-size:12px;
  color: rgba(255,255,255,.70);
}
.checkbox input{transform: translateY(1px)}
.hint{
  margin-top:8px;
  font-size:11px;
  color: rgba(255,255,255,.35);
}
.hint code{
  font-family: var(--mono);
  background: rgba(0,230,118,.10);
  border:1px solid rgba(0,230,118,.20);
  padding:2px 6px;
  border-radius:8px;
  color: var(--green);
}
.config-actions{display:flex; justify-content:flex-end}

/* Status bar */
.status{
  position:relative;
  z-index:10;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding:10px 14px;
  font-size:10px;
  font-weight:900;
  letter-spacing:.18em;
  text-transform:uppercase;
}
.status.loading{background:#2563eb}
.status.warning{background:#f59e0b; color:#000}
.status.success{background:var(--green); color:#000}
.status.error{background:#dc2626}
.status-icon{display:inline-flex; width:16px; height:16px}
.status-icon svg{width:16px;height:16px}

/* Main split */
.main{
  position:relative;
  z-index:5;
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:14px;
  height: calc(100vh - 74px - 92px); /* header + footer approx */
  min-height: 520px;
}
@media (min-width:900px){
  .main{
    flex-direction:row;
    height: calc(100vh - 74px - 92px);
  }
}
.panel{
  flex:1;
  display:flex;
  flex-direction:column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
  min-height: 260px;
}
.panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 14px;
  background: rgba(0,0,0,.35);
  border-bottom: 1px solid var(--border);
}
.panel-title{
  display:flex;
  align-items:center;
  gap:10px;
  color: rgba(255,255,255,.60);
  font-size:10px;
  font-weight:900;
  letter-spacing:.20em;
  text-transform:uppercase;
}
.panel-title .icon{color: var(--green)}
.traffic{display:flex; gap:6px}
.t{width:8px;height:8px;border-radius:50%}
.t-red{background:rgba(239,68,68,.18)}
.t-amber{background:rgba(245,158,11,.18)}
.t-green{background:rgba(0,230,118,.18); box-shadow:0 0 10px rgba(0,230,118,.22)}

.editor{
  flex:1;
  width:100%;
  padding:22px;
  resize:none;
  border:0;
  outline:none;
  background:transparent;
  color: rgba(255,255,255,.80);
  font-family: var(--mono);
  font-size:13px;
  line-height:1.7;
}

/* Preview specifics */
.preview{position:relative}
.grid-overlay{
  position:absolute; inset:0;
  pointer-events:none;
  opacity:.03;
  background-image: radial-gradient(#ffffff 1px, transparent 0);
  background-size: 24px 24px;
}
.preview-body{
  flex:1;
  overflow:auto;
  padding:18px;
  position:relative;
  z-index:1;
}
.preview-box{
  background: rgba(0,0,0,.30);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding:18px;
  min-height: 100%;
  box-shadow: inset 0 0 40px rgba(0,0,0,.35);
}
.preview-box h1{
  font-size:26px;
  font-weight:900;
  margin: 0 0 16px 0;
  padding-left:12px;
  border-left: 4px solid var(--green);
}
.preview-box h2{
  font-size:20px;
  font-weight:900;
  color: var(--green);
  margin: 16px 0 10px 0;
}
.preview-box h3{
  font-size:16px;
  font-weight:800;
  opacity:.92;
  margin: 14px 0 8px 0;
}
.preview-box p{
  margin: 0 0 12px 0;
  color: rgba(255,255,255,.86);
  line-height: 1.7;
}
.preview-box ul,
.preview-box ol{
  margin: 0 0 14px 0;
  padding-left: 22px;
}
.preview-box li{
  margin: 0 0 8px 0;
  color: rgba(255,255,255,.86);
  line-height: 1.65;
}
.preview-box hr{
  border: 0;
  height: 1px;
  background: rgba(255,255,255,.10);
  margin: 18px 0;
}
.preview-box pre{
  margin: 0 0 14px 0;
  padding: 14px;
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid rgba(0,230,118,.14);
  background: rgba(0,0,0,.48);
}
.preview-box pre code{
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  color: rgba(255,255,255,.88);
  font-size: 12px;
  line-height: 1.65;
}
.preview-box strong{color: var(--green)}
.preview-box em{color: rgba(255,255,255,.55)}
.preview-box code{
  font-family: var(--mono);
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(0,230,118,.20);
  background: rgba(0,230,118,.08);
  color: var(--green);
}

/* Footer */
.footer{
  position:relative;
  z-index:10;
  padding:16px 18px;
  border-top:1px solid var(--border);
  background: rgba(0,0,0,.80);
  backdrop-filter: blur(14px);
  display:flex;
  flex-direction:column;
  gap:14px;
}
@media (min-width:900px){
  .footer{flex-direction:row; justify-content:space-between; align-items:center}
}
.footer-left{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  align-items:center;
}
.footer-block{display:flex; flex-direction:column; gap:8px}
.footer-label{
  font-size:9px;
  font-weight:900;
  letter-spacing:.22em;
  text-transform:uppercase;
  color: rgba(255,255,255,.35);
}
.footer-row{display:flex; align-items:center; gap:12px; flex-wrap:wrap}
.conn{display:flex; align-items:center; gap:8px}
.conn-dot{width:7px;height:7px;border-radius:50%}
.conn-dot.on{background:var(--green); box-shadow:0 0 10px var(--green)}
.conn-dot.off{background:rgba(255,255,255,.18)}
.conn-text{
  font-size:10px;
  font-weight:900;
  letter-spacing:.16em;
  text-transform:uppercase;
}
.conn-text.on{color:#fff}
.conn-text.off{color:rgba(255,255,255,.35)}
.sep{width:1px;height:14px;background:var(--border)}
.stats{
  font-size:10px;
  color: rgba(255,255,255,.40);
  font-weight:800;
  display:flex; gap:6px; align-items:center;
}
.partners{
  display:flex; gap:10px; flex-wrap:wrap;
  opacity:.30;
  filter: grayscale(1);
  transition:opacity .25s ease, filter .25s ease;
}
.partners:hover{opacity:1; filter: grayscale(0)}
.partner{
  font-size:10px;
  font-weight:900;
  color: rgba(255,255,255,.80);
  letter-spacing:-.02em;
}

.footer-right{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.devby{display:flex; flex-direction:column; align-items:flex-end}
.devby-label{
  font-size:9px;
  font-weight:900;
  letter-spacing:.22em;
  text-transform:uppercase;
  color: var(--green);
}
.devby-name{display:flex; gap:8px; align-items:baseline}
.crescer{font-weight:900; font-size:16px; font-style:italic; letter-spacing:-.04em}
.assessoria{font-size:10px; font-weight:900; color: rgba(255,255,255,.35); text-transform:uppercase}

.zap{
  width:42px; height:42px;
  display:grid; place-items:center;
  border-radius:14px;
  background: var(--green);
  box-shadow: 0 0 18px rgba(0,230,118,.25);
  transition: transform .7s ease;
}
.footer-right:hover .zap{transform: rotate(360deg)}
.zap svg{width:18px;height:18px; stroke:#000}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar{width:6px}
.custom-scrollbar::-webkit-scrollbar-track{background:transparent}
.custom-scrollbar::-webkit-scrollbar-thumb{
  background: rgba(0,230,118,.12);
  border-radius:10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover{
  background: rgba(0,230,118,.30);
}