:root{
  --bg:#0b1020;
  --panel:#101a33;
  --panel2:#0f1730;
  --text:#e9edff;
  --muted:#aab2d8;
  --line:rgba(255,255,255,.08);
  --accent:#7c5cff;
  --danger:#ff4d6d;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(124,92,255,.28), transparent 55%),
              radial-gradient(900px 500px at 80% 0%, rgba(0,255,209,.12), transparent 50%),
              var(--bg);
  color:var(--text);
}

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

.app{
  max-width: 980px;
  margin: 0 auto;
  padding: 18px;
  height: 100%;
  display:flex;
  flex-direction:column;
  gap: 14px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.brand{ display:flex; gap:12px; align-items:center; }
.dot{
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(124,92,255,.18);
}
.title{ font-weight: 750; letter-spacing:.2px; }
.subtitle{ font-size: 12.5px; color: var(--muted); margin-top:2px; }

.actions{ display:flex; gap:10px; align-items:center; }

.btn{
  border: 1px solid transparent;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 650;
  cursor:pointer;
  transition: transform .05s ease, opacity .15s ease, background .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn:hover{ opacity:.95; }

.btn.ghost{
  background: rgba(255,255,255,.04);
  border-color: var(--line);
  color: var(--text);
}
.btn.danger{
  background: var(--danger);
}

.chat{
  flex:1;
  min-height: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow:hidden;
  box-shadow: var(--shadow);
}
.messages{
  height: 100%;
  overflow:auto;
  padding: 18px;
  display:flex;
  flex-direction:column;
  gap: 10px;
}

.msg{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.18);
}
.msg .meta{
  min-width: 140px;
  max-width: 140px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}
.msg .meta b{
  display:block;
  color: var(--text);
  font-size: 13px;
  margin-bottom: 4px;
}
.msg .body{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
  flex: 1;
}

.msg img{
  max-width: min(420px, 100%);
  border-radius: 14px;
  border: 1px solid var(--line);
  display:block;
}

.composer{
  display:flex;
  gap: 10px;
  align-items:flex-end;
  padding: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.text{
  width: 100%;
  background: rgba(0,0,0,.22);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 11px 12px;
  border-radius: 14px;
  outline:none;
  min-height: 44px;
  resize: vertical;
}
.text::placeholder{ color: rgba(170,178,216,.75); }

.upload input{ display:none; }

.modal{
  position: fixed;
  inset: 0;
  display:none;
  place-items:center;
  background: rgba(0,0,0,.55);
  padding: 16px;
}
.modal.show{ display:grid; }
.modal-card{
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}
.modal-title{ font-size: 18px; font-weight: 780; }
.modal-sub{ color: var(--muted); margin-top: 6px; margin-bottom: 14px; font-size: 13px; }
.modal-actions{ margin-top: 12px; display:flex; justify-content:flex-end; gap:10px; }

.admin{
  display:grid;
  gap: 14px;
}
.card{
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-title{ font-weight: 760; margin-bottom: 10px; }
.row{ display:flex; gap: 10px; align-items:center; }
.hint{ color: var(--muted); font-size: 13px; margin-top: 10px; }
