:root{
  --bg0:#070B14;
  --bg1:#0B1020;
  --card: rgba(18,26,51,.85);
  --stroke: rgba(255,255,255,.10);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.62);
  --pill: rgba(255,255,255,.07);
  --shadow: 0 10px 30px rgba(0,0,0,.40);

  --r: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 600px at 20% 20%, rgba(91,124,255,.20), transparent 60%),
    radial-gradient(900px 600px at 80% 10%, rgba(255,80,180,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

/* Header */
.top{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 18px;
  border-bottom:1px solid var(--stroke);
  background: rgba(10,16,32,.55);
  backdrop-filter: blur(10px);
}
.left{ display:flex; gap:18px; align-items:center; }
.h1{ font-size:30px; font-weight:800; letter-spacing:.2px; }
.sub{ font-size:12px; color: var(--muted); margin-top:2px; }

.tabs{
  display:flex;
  gap:6px;
  padding:6px;
  border:1px solid var(--stroke);
  border-radius: 999px;
  background: rgba(255,255,255,.04);
}
.tab{
  border:0;
  background:transparent;
  color: var(--muted);
  padding:8px 12px;
  border-radius: 999px;
  font-weight:800;
  cursor:pointer;
}
.tab.active{
  color: var(--text);
  background: rgba(91,124,255,.22);
  box-shadow: inset 0 0 0 1px rgba(91,124,255,.25);
}

.usage-mini{ display:flex; gap:10px; }

.pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background: var(--pill);
  font-size:12px;
  color: var(--muted);
}

/* Layout */
.wrap{
  max-width: 1500px;
  margin: 18px auto;
  padding: 0 18px 22px;
}
.card{
  background: var(--card);
  border:1px solid var(--stroke);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 14px;
}

.top-controls .row{
  display:flex;
  gap:14px;
  align-items:flex-end;
  justify-content:space-between;
  flex-wrap:wrap;
}
.field label{
  display:block;
  font-size:12px;
  color: var(--muted);
  margin:0 0 6px 2px;
}
.field input{
  width: 280px;
  max-width: 78vw;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.20);
  color: var(--text);
  outline:none;
}

.btns{ display:flex; gap:10px; }
button{
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.07);
  color: var(--text);
  font-weight:800;
  cursor:pointer;
}
button:hover{ background: rgba(255,255,255,.10); }

.sys{ margin-top: 10px; display:flex; flex-wrap:wrap; gap:10px; }

.view{ margin-top: 14px; }
.hidden{ display:none; }

/* Chat */
.chatbox{
  height: calc(100vh - 64px - 120px);
  min-height: 420px;
  display:flex;
  flex-direction:column;
}
.log{
  flex:1;
  overflow:auto;
  padding: 10px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
}
.msg{
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.18);
}
.msg.user{ background: rgba(91,124,255,.12); border-color: rgba(91,124,255,.20); }
.msg.bot{ background: rgba(255,184,77,.08); border-color: rgba(255,184,77,.16); }
.msg .who{ display:block; font-size:12px; color: var(--muted); margin-bottom:4px; font-weight:800; }

.composer{
  display:flex;
  gap:10px;
  margin-top: 10px;
}
.composer input{
  flex:1;
  padding:10px 12px;
  border-radius: 12px;
  border:1px solid var(--stroke);
  background: rgba(0,0,0,.22);
  color: var(--text);
  outline:none;
}

/* WebDev grid (wide monitors) */
.webdev-grid{
  height: calc(100vh - 64px - 210px);
  min-height: 520px;
  display:grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 14px;
}
.col-left, .col-right{ min-height:0; display:flex; flex-direction:column; gap: 14px; }

.panel{
  border:1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(0,0,0,.18);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.panel-title{
  padding: 10px 12px;
  border-bottom:1px solid rgba(255,255,255,.08);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  font-weight:900;
}
.panel-body{ padding: 12px; color: var(--muted); }

.yellow .log{ border:0; background: transparent; }
.yellow .composer{ padding: 10px 12px; border-top:1px solid rgba(255,255,255,.08); margin:0; background: rgba(0,0,0,.10); }
.yellow{ flex:1; }

.pink{ height: 210px; }
.blue{ height: 170px; }
.green{ flex:1; }

.blue .meta{
  padding: 12px;
  color: var(--muted);
  display:grid;
  gap:8px;
}
.blue .meta span{ color: rgba(255,255,255,.55); display:inline-block; width: 96px; }
.blue .meta b{ color: var(--text); font-weight:800; }

#code{
  flex:1;
  width:100%;
  resize:none;
  border:0;
  outline:none;
  padding: 12px;
  background: transparent;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height:1.35;
}

/* Workspace dropdown */
.ws{
  margin-left:auto;
  padding:6px 8px;
  border-radius: 10px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
button.mini{
  padding:6px 10px;
  border-radius: 10px;
  font-weight:900;
}

.foot{
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}
