:root{
  --bg:#0b0d12;
  --panel:#121623;
  --card:#161b2b;
  --border:rgba(255,255,255,.08);
  --text:#f2f5ff;
  --muted:rgba(242,245,255,.68);
  --accent:#7c5cff;
  --accent2:#22c55e;
  --warn:#f59e0b;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --r:16px;
  --r2:22px;
  --w:1040px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

*{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% -20%, rgba(124,92,255,.35), transparent 55%),
              radial-gradient(1000px 700px at 110% 0%, rgba(34,197,94,.18), transparent 55%),
              var(--bg);
  color:var(--text);
}

a{color:inherit; text-decoration:none}
.container{max-width:var(--w); margin:0 auto; padding:18px}
.row{display:flex}
.center{align-items:center}
.between{justify-content:space-between}
.gap-10{gap:10px}
.gap-12{gap:12px}
.mt-10{margin-top:10px}
.mt-12{margin-top:12px}

.muted{color:var(--muted)}
.mono{font-family:var(--mono)}

.topbar{
  position:sticky; top:0; z-index:20;
  background:rgba(11,13,18,.65);
  backdrop-filter: blur(14px);
  border-bottom:1px solid var(--border);
}
.brand{display:flex; gap:10px; align-items:center}
.brand-mark{font-size:18px}
.brand-name{font-weight:700; letter-spacing:.2px}

.link{opacity:.92}
.link:hover{opacity:1; text-decoration:underline}

.hero{
  margin-top:14px;
  padding:22px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.03));
  border-radius: var(--r2);
  box-shadow: var(--shadow);
}
.hero h1{margin:0 0 6px; font-size:30px}
.hero p{margin:0 0 16px; line-height:1.5}

.controls{
  display:grid;
  grid-template-columns: 1fr 180px 160px 120px;
  gap:12px;
}
@media (max-width: 860px){
  .controls{grid-template-columns:1fr 1fr; }
}
@media (max-width: 520px){
  .controls{grid-template-columns:1fr; }
}

.field{display:flex; flex-direction:column; gap:6px}
.label{font-size:12px; color:var(--muted)}
.input,.select{
  height:42px;
  border-radius: 12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding: 0 12px;
  outline:none;
}
.input:focus,.select:focus{border-color: rgba(124,92,255,.55)}

.btn{
  height:42px;
  padding:0 14px;
  border-radius: 12px;
  border:1px solid rgba(124,92,255,.55);
  background: rgba(124,92,255,.18);
  color:var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.btn:hover{background: rgba(124,92,255,.26)}
.btn:disabled{opacity:.55; cursor:not-allowed}

.btn-ghost{
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
}
.btn-ghost:hover{background: rgba(255,255,255,.07)}

.panel{
  margin-top:16px;
  padding:18px;
  border:1px solid var(--border);
  background: rgba(18,22,35,.75);
  border-radius: var(--r2);
  box-shadow: var(--shadow);
}

.h1{font-size:28px; margin:0}
.h2{font-size:18px; margin:0}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:28px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  font-size:12px;
}
.badge-soft{background: rgba(255,255,255,.03); color:var(--muted)}

.status{margin:12px 0}

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:12px;
  margin-top:12px;
}
@media (max-width: 960px){ .grid{grid-template-columns: repeat(2, minmax(0, 1fr));} }
@media (max-width: 620px){ .grid{grid-template-columns: 1fr;} }

.tile{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--r);
  padding:14px;
  display:flex;
  flex-direction:column;
  gap:12px;
}
.tile-title{font-weight:700}
.tile-actions{display:flex; gap:10px}

.event{margin-top:8px}
.event-head{padding:6px 4px 14px}
.event-title-row{display:flex; gap:10px; align-items:center; justify-content:space-between}
.event-meta{
  margin-top:10px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 720px){ .event-meta{grid-template-columns:1fr} }
.meta-item{
  padding:10px;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
}
.meta-k{color:var(--muted); margin-right:8px}

.pill{
  height:28px; padding:0 10px;
  border-radius:999px;
  border:1px solid var(--border);
  display:inline-flex; align-items:center;
  font-size:12px;
}
.pill-ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12)}
.pill-warn{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12)}

.event-body{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:12px;
}
@media (max-width: 900px){ .event-body{grid-template-columns:1fr} }

.card{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius: var(--r);
  padding:14px;
}
.card-title{font-weight:700; margin-bottom:8px}
.card-body{line-height:1.55}

.note{
  border-left: 3px solid rgba(124,92,255,.7);
  padding-left:10px;
}

.list{display:flex; flex-direction:column; gap:8px}
.list-item{display:flex; align-items:center; gap:10px}
.dot{
  width:8px; height:8px; border-radius:999px;
  background: rgba(124,92,255,.75);
}

.safety{
  margin-top:14px;
  padding:14px;
  border-radius: var(--r);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.03);
}
.safety-title{font-weight:700; margin-bottom:6px}
.safety-list{margin:0; padding-left:18px; color:var(--muted)}
.safety-list li{margin:6px 0}

.chat{
  margin-top:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.18);
  border-radius: var(--r);
  padding:12px;
  height: 380px;
  overflow:auto;
}
.msg{padding:10px; border-radius: 14px; background: rgba(255,255,255,.03); border:1px solid rgba(255,255,255,.06); margin-bottom:10px}
.msg-top{display:flex; justify-content:space-between; gap:10px; margin-bottom:6px}
.msg-name{font-weight:700}
.msg-body{line-height:1.5}

.composer{
  margin-top:12px;
  display:flex;
  gap:10px;
}
.composer .input{flex:1}

.disabled{opacity:.7}

.footer{
  margin-top:18px;
  border-top:1px solid var(--border);
  background: rgba(11,13,18,.55);
}
.toast{
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  opacity:0;
  transition: all .22s ease;
  border:1px solid var(--border);
  background: rgba(18,22,35,.92);
  color:var(--text);
  padding:10px 12px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  z-index: 999;
}
.toast.show{
  opacity:1;
  transform: translateX(-50%) translateY(0);
}
