:root{
  --bg0:#070b14;
  --bg1:#0a1021;
  --panel: rgba(10,16,33,.74);
  --panel2: rgba(10,16,33,.56);
  --border: rgba(125,211,252,.16);
  --border2: rgba(125,211,252,.26);
  --text:#e7f1ff;
  --text-dim: rgba(219,234,254,.62);
  --accent:#60a5fa;
  --accent2:#22d3ee;
  --danger:#ef4444;
  --ok:#22c55e;

  --radius:14px;
  --radius-sm:10px;

  --shadow: 0 0 0 1px rgba(96,165,250,0.05), 0 0 22px rgba(59,130,246,0.10);
  --shadow2: 0 0 0 1px rgba(96,165,250,0.05), 0 0 18px rgba(59,130,246,0.10);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Helvetica,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(96,165,250,0.18), transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(34,211,238,0.12), transparent 55%),
    radial-gradient(circle at 55% 88%, rgba(30,64,175,0.16), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

a{ color:inherit; text-decoration:none; }
a:focus{ outline:none; }
button, input, textarea, select{ font:inherit; color:inherit; }
img{ max-width:100%; height:auto; }

.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 60;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(125,211,252,.12);
  background: rgba(7,11,20,.74);
  backdrop-filter: blur(14px) saturate(1.15);
}
.topbar.is-collapsed + .switchbar{ display:none; }

.topbar__left, .topbar__right{
  display:flex;
  align-items:center;
  gap:10px;
}
.topbar__title{
  font-weight: 650;
  letter-spacing: .02em;
  display:flex;
  gap:8px;
  align-items:baseline;
}
.muted{ color: var(--text-dim); }

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}
.brand__dot{
  width:10px; height:10px;
  border-radius:999px;
  background: linear-gradient(180deg, rgba(96,165,250,1), rgba(34,211,238,1));
  box-shadow: 0 0 14px rgba(96,165,250,.35);
}
.brand__title{ font-weight: 750; letter-spacing:.08em; text-transform: lowercase; }
.brand__sub{ color:var(--text-dim); font-size:12px; margin-top:2px; }

.sep{
  width:1px;
  height:18px;
  background: rgba(125,211,252,.18);
}

.switchbar{
  padding: 12px 16px;
  border-bottom: 1px solid rgba(125,211,252,.10);
  background: rgba(7,11,20,.46);
  backdrop-filter: blur(14px) saturate(1.1);
}
.switchbar__row{
  display:flex;
  align-items:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.switchbar__grow{ flex:1; }
.switchbar__actions{ display:flex; gap:10px; align-items:center; }

.page{
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 26px;
}

.page--2col{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
}
@media (max-width: 980px){
  .page{ width: calc(100% - 16px); }
  .page--2col{ grid-template-columns: 1fr; }
}

.side{ display:flex; flex-direction:column; gap:14px; }
.main{ display:flex; flex-direction:column; gap:14px; }

.card{
  position:relative;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow:hidden;
  padding: 14px;
}
.card::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.10;
  background:
    repeating-linear-gradient(to bottom,
      rgba(255,255,255,0.05) 0px,
      rgba(255,255,255,0.05) 1px,
      transparent 2px,
      transparent 4px);
}
.card > *{ position:relative; }

.card__title{
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: lowercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.grid{
  display:grid;
  gap:12px;
}
.grid--2{ grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid--3{ grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 860px){
  .grid--2, .grid--3{ grid-template-columns: 1fr; }
}

.tile{
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--panel2);
  padding: 14px;
  box-shadow: var(--shadow2);
  transition: border-color .18s ease, transform .18s ease;
}
.tile:hover{
  border-color: var(--border2);
  transform: translateY(-1px);
}
.tile__title{ font-weight: 680; }
.tile__sub{ color:var(--text-dim); margin-top:6px; font-size: 13px; }

.field{ display:flex; flex-direction:column; gap:7px; }
.field--inline{ min-width: 220px; }
.label{
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: lowercase;
  color: var(--text-dim);
}

.input{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(125,211,252,.18);
  background: rgba(7,11,20,.46);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.input:focus{
  border-color: rgba(125,211,252,.38);
  box-shadow: 0 0 0 3px rgba(96,165,250,.18);
}
.input--textarea{
  min-height: 120px;
  resize: vertical;
  line-height: 1.45;
}
.select{ position:relative; }
.select::after{
  content:"";
  position:absolute;
  right: 12px;
  top: 50%;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-right: 2px solid rgba(219,234,254,.55);
  border-bottom: 2px solid rgba(219,234,254,.55);
  pointer-events:none;
}
select.input{
  appearance:none;
  padding-right: 36px;
}

.row{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.row--tight{ gap:8px; }

.inline{ display:inline; }

.btn{
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(125,211,252,.18);
  background: rgba(96,165,250,.14);
  cursor:pointer;
  transition: transform .12s ease, border-color .16s ease, background .16s ease;
  font-weight: 650;
}
.btn:hover{
  border-color: rgba(125,211,252,.34);
  background: rgba(96,165,250,.20);
}
.btn:active{ transform: translateY(1px); }

.btn--ghost{
  background: rgba(7,11,20,.20);
}
.btn--danger{
  border-color: rgba(239,68,68,.35);
  background: rgba(239,68,68,.14);
}
.btn--danger:hover{
  border-color: rgba(239,68,68,.55);
  background: rgba(239,68,68,.20);
}
.btn--sm{
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.check{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--text-dim);
}
.check input{ transform: translateY(1px); }

.hint{
  color: var(--text-dim);
  font-size: 12px;
}

.divider{
  height:1px;
  background: rgba(125,211,252,.14);
  margin: 12px 0;
}

.split{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
@media (max-width: 860px){
  .split{ grid-template-columns: 1fr; }
}

.stack{ display:flex; flex-direction:column; gap:10px; }

.chips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,211,252,.18);
  background: rgba(7,11,20,.30);
  font-size: 13px;
}
.chip--form{ padding: 0; overflow:hidden; }
.chip__btn{
  padding: 8px 10px;
  background: transparent;
  border: none;
  cursor:pointer;
  color: rgba(219,234,254,.86);
}
.chip__btn:hover{ background: rgba(96,165,250,.12); }

.list{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height: 58vh;
  overflow:auto;
  padding-right: 2px;
}
.list__item{
  border-radius: 12px;
  border: 1px solid rgba(125,211,252,.14);
  background: rgba(7,11,20,.30);
  padding: 10px 10px;
  transition: border-color .16s ease, background .16s ease;
}
.list__item:hover{
  border-color: rgba(125,211,252,.28);
  background: rgba(7,11,20,.36);
}
.list__item.is-active{
  border-color: rgba(96,165,250,.42);
  background: rgba(96,165,250,.10);
}
.list__title{ font-weight: 650; }
.list__sub{ color: var(--text-dim); font-size: 12px; margin-top: 4px; }

.pill{
  display:inline-flex;
  align-items:center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(125,211,252,.18);
  background: rgba(7,11,20,.30);
  font-size: 13px;
}
.pill--muted{ color: var(--text-dim); }

.pre{
  margin:0;
  white-space: pre-wrap;
  word-break: break-word;
  color: rgba(231,241,255,.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
}

.msgs{ display:flex; flex-direction:column; gap:12px; }
.msg{
  border-radius: var(--radius);
  border: 1px solid rgba(125,211,252,.14);
  background: rgba(7,11,20,.26);
  padding: 12px;
}
.msg__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}
.msg__meta{ display:flex; flex-wrap:wrap; gap:8px; }
.msg__actions{ display:flex; gap:8px; }
.msg__content{ margin-top: 10px; }
.msg__edit{ margin-top: 10px; }

.schedule{
  display:grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap:10px;
}
@media (max-width: 980px){
  .schedule{ grid-template-columns: repeat(2, minmax(0,1fr)); }
}
.schedule__cell{
  border-radius: 12px;
  border: 1px solid rgba(125,211,252,.14);
  background: rgba(7,11,20,.24);
  padding: 10px;
}
.schedule__label{
  color: var(--text-dim);
  font-size: 12px;
  margin-bottom: 7px;
}

/* codemirror integration */
.CodeMirror{
  height: 70vh;
  background: rgba(7,11,20,.40);
  color: var(--text);
  border: 1px solid rgba(125,211,252,.18);
  border-radius: 12px;
  padding: 4px 0;
}
@media (max-width: 980px){
  .CodeMirror{ height: 60vh; }
}
.CodeMirror-gutters{
  background: rgba(7,11,20,.30);
  border-right: 1px solid rgba(125,211,252,.12);
}
.CodeMirror-linenumber{ color: rgba(219,234,254,.55); }
.cm-comment{ color:#9aa5b1; }
.cm-tag{ color:#7dd3fc; }
.cm-attribute{ color:#fde68a; }
.cm-string{ color:#86efac; }
.cm-error{ background: transparent; color:#ff7b7b; }