:root {
  --bg:#fff;
  --side:#f7f7f8;
  --text:#202127;
  --muted:#777d88;
  --border:#e8eaf0;
  --brand:#171a22;
  --blue:#2563eb;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  height:100%;
  font-family:Inter,ui-sans-serif,system-ui,
  -apple-system,"Segoe UI",sans-serif;
  color:var(--text);
  background:var(--bg);
}

button,input,textarea{font:inherit}

button{cursor:pointer}

a{color:inherit;text-decoration:none}

.logo{
  display:flex;
  align-items:center;
  gap:11px;
  font-weight:850;
  letter-spacing:-.5px;
  font-size:19px;
}

.symbol{
  width:34px;
  height:34px;
  border-radius:12px;
  background:#171a22;
  color:white;
  display:grid;
  place-items:center;
  font-size:22px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:11px 15px;
  color:var(--text);
  font-weight:650;
}

.btn.primary{
  color:white;
  border-color:#171a22;
  background:#171a22;
}

.btn:hover{filter:brightness(.96)}

.landing{
  min-height:100vh;
  background:
    radial-gradient(circle at 50% 20%,#e9efff,transparent 45%),
    #fff;
}

.topnav{
  height:78px;
  max-width:1200px;
  margin:auto;
  padding:0 25px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.hero{
  max-width:900px;
  margin:0 auto;
  padding:110px 22px 130px;
  text-align:center;
}

.eyebrow{
  font-size:12px;
  font-weight:750;
  letter-spacing:2px;
  color:#6b7280;
}

.hero h1{
  font-size:clamp(44px,7vw,78px);
  letter-spacing:-4px;
  line-height:1.05;
  margin:18px 0;
}

.hero p{
  font-size:18px;
  color:#636a75;
  line-height:1.8;
}

.actions{
  display:flex;
  gap:12px;
  justify-content:center;
  margin-top:30px;
  flex-wrap:wrap;
}

.features{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:16px;
  margin-top:85px;
  text-align:left;
}

.feature{
  border:1px solid #e8ebf2;
  padding:24px;
  border-radius:20px;
  background:#ffffffb8;
}

.feature h3{margin:0 0 8px}
.feature p{font-size:14px;margin:0}

.authwrap{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:25px;
  background:#fafbfd;
}

.authcard{
  width:min(100%,430px);
  background:white;
  border:1px solid #e9eaf0;
  border-radius:24px;
  padding:35px;
  box-shadow:0 18px 55px #1a25400a;
}

.authcard h1{font-size:28px;letter-spacing:-1px}
.authcard p{color:var(--muted)}

.field{
  display:block;
  width:100%;
  border:1px solid #dfe3ea;
  border-radius:12px;
  padding:13px 14px;
  margin:10px 0 18px;
  outline:none;
}

.field:focus{border-color:#64748b}

.error{
  padding:12px;
  border-radius:10px;
  color:#991b1b;
  background:#fef2f2;
  margin-bottom:15px;
}

.layout{
  display:grid;
  grid-template-columns:265px minmax(0,1fr);
  height:100dvh;
  overflow:hidden;
}

.sidebar{
  min-height:0;
  padding:20px 13px;
  background:var(--side);
  border-right:1px solid #e9e9ee;
  display:flex;
  flex-direction:column;
  gap:18px;
}

.sidebar .logo{padding:4px 10px}

.chatlist{
  flex:1;
  min-height:0;
  overflow-y:auto;
}

.chatitem{
  display:flex;
  align-items:center;
  justify-content:space-between;
  width:100%;
  border:0;
  background:transparent;
  padding:12px;
  text-align:left;
  border-radius:11px;
  font-size:13px;
}

.chatitem:hover,.chatitem.active{background:#e9eaee}

.chatitem span{
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.sidefoot{
  border-top:1px solid #e5e7eb;
  padding:15px 10px 0;
  font-size:12px;
  color:#5b6472;
  overflow-wrap:anywhere;
}

.main{
  display:flex;
  flex-direction:column;
  min-width:0;
  min-height:0;
  overflow:hidden;
}

.chathead{
  height:65px;
  flex-shrink:0;
  border-bottom:1px solid #f0f1f3;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 25px;
  font-weight:750;
}

.chathead small{
  color:#858b94;
  font-size:11px;
  font-weight:500;
}

#messages{
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  scroll-behavior:auto;
  padding:35px 20px;
}

.msginner{
  max-width:820px;
  margin:0 auto;
  display:flex;
  flex-direction:column;
  gap:26px;
}

.message{
  max-width:100%;
  min-width:0;
  line-height:1.8;
  font-size:15px;
  overflow-wrap:anywhere;
}

.message.user{
  align-self:flex-end;
  max-width:min(80%,680px);
  background:#f2f3f5;
  border:1px solid #ecedf0;
  border-radius:20px;
  padding:12px 18px;
}

.message.assistant{
  align-self:stretch;
  padding:4px 0 10px;
}

.message .author{
  color:#858b94;
  font-size:11px;
  font-weight:750;
  margin-bottom:9px;
}

.message .body{
  min-width:0;
  white-space:pre-wrap;
}

.message .body.markdown{
  white-space:normal;
}

.markdown p{margin:0 0 15px}
.markdown h1,.markdown h2,.markdown h3{
  line-height:1.35;
  margin:25px 0 12px;
  letter-spacing:-.5px;
}
.markdown ul,.markdown ol{padding-left:25px}
.markdown li{margin:7px 0}
.markdown a{color:#2563eb;text-decoration:underline}
.markdown blockquote{
  border-left:3px solid #94a3b8;
  padding-left:16px;
  color:#64748b;
}
.markdown :not(pre)>code{
  background:#f0f2f5;
  color:#bd2866;
  padding:3px 5px;
  border-radius:5px;
}

.codebox{
  border:1px solid #303744;
  border-radius:15px;
  overflow:hidden;
  margin:18px 0;
  background:#0d1117;
  color:#e6edf3;
}

.codehead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 16px;
  background:#19212b;
  color:#cbd5e1;
  font-size:12px;
}

.codehead button{
  color:#e5e7eb;
  background:#263344;
  border:1px solid #445369;
  padding:6px 10px;
  border-radius:7px;
}

.codebox pre{
  margin:0;
  padding:17px;
  overflow-x:auto;
  background:#0d1117;
}

.codebox code{
  background:transparent;
  color:#e6edf3;
  font:13px/1.7 Consolas,monospace;
}

.hljs-keyword,.hljs-literal{color:#c792ea}
.hljs-string,.hljs-attr{color:#a5d6a7}
.hljs-title,.hljs-title.function_{color:#ffd580}
.hljs-number{color:#f78c6c}
.hljs-comment{color:#8b949e}
.hljs-built_in,.hljs-type{color:#89ddff}
.hljs-variable{color:#82aaff}

.composerzone{
  flex-shrink:0;
  background:white;
  padding:13px 20px 19px;
}

.composer{
  max-width:850px;
  margin:auto;
  border:1px solid #e0e3e9;
  border-radius:23px;
  box-shadow:0 8px 35px #1b25400b;
  padding:12px;
}

.composer textarea{
  border:0;
  outline:0;
  resize:none;
  width:100%;
  min-height:50px;
  max-height:180px;
  padding:10px;
  font-size:15px;
  background:transparent;
}

.composerbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.status{
  font-size:12px;
  color:#64748b;
  padding-left:10px;
}

.send{
  background:#171a22;
  color:white;
  border:0;
  border-radius:12px;
  padding:10px 19px;
  font-weight:750;
}

.send:disabled{opacity:.45}

.adminwrap{
  max-width:1200px;
  margin:auto;
  padding:35px 18px;
}

.statgrid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:15px;
}

.stat{
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
}

.stat strong{font-size:30px}

.tablewrap{overflow-x:auto}

table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}

th,td{
  text-align:left;
  border-bottom:1px solid #e9ebef;
  padding:13px 10px;
}

td input{max-width:115px}

@media(max-width:760px){
  .layout{grid-template-columns:1fr}
  .sidebar{
    position:absolute;
    z-index:20;
    top:0;
    left:0;
    bottom:0;
    width:260px;
    transform:translateX(-100%);
    transition:transform .18s;
    box-shadow:8px 0 25px #11182715;
  }
  .sidebar.open{transform:translateX(0)}
  .chathead{padding:0 15px}
  #messages{padding:20px 13px}
  .message.user{max-width:91%}
  .composerzone{padding:9px 10px 12px}
  .features{grid-template-columns:1fr}
  .statgrid{grid-template-columns:1fr}
  .hero h1{letter-spacing:-2px}
}

/* AXION REALTIME V1.5 */

.axion-chat-row{
  display:flex;
  align-items:center;
  gap:3px;
  border-radius:12px;
}

.axion-chat-row .chatitem{
  flex:1;
  min-width:0;
}

.axion-delete{
  background:transparent;
  border:0;
  border-radius:9px;
  color:#9ca3af;
  font-size:20px;
  padding:5px 10px;
}

.axion-delete:hover{
  background:#fee2e2;
  color:#dc2626;
}

.axion-stop{
  border:1px solid #fecaca;
  background:#fff1f2;
  color:#be123c;
  border-radius:11px;
  padding:10px 14px;
  font-weight:700;
}

.axion-stop:hover{
  background:#ffe4e6;
}

.axion-stop[hidden]{
  display:none !important;
}

#messages{
  overflow-y:auto !important;
  scroll-behavior:auto !important;
  overscroll-behavior:contain;
  overflow-anchor:none;
}

#msginner{
  overflow-anchor:none;
}

.message.assistant{
  overflow-anchor:none;
}

@media(max-width:640px){
  .axion-stop{
    padding:9px;
    font-size:12px;
  }
}
