:root{
  --bg: #0b0f14;
  --panel: #111822;
  --panel2:#0f1620;
  --text:#e8eef6;
  --muted:#a9b6c7;
  --accent:#5aa9ff;
  --danger:#ff5a70;
  --ok:#43d19e;
  --border:#223044;
  --shadow: rgba(0,0,0,.25);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono","Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--sans);
  background: radial-gradient(1200px 800px at 30% 10%, #152033, var(--bg));
  color: var(--text);
}

.topbar{
  display:flex;
  gap:16px;
  justify-content:space-between;
  align-items:flex-end;
  padding:14px 16px;
  border-bottom:1px solid var(--border);
  background: rgba(10,14,20,.65);
  backdrop-filter: blur(8px);
  position: sticky;
  top:0;
  z-index: 10;
}

.brand-title{
  font-weight: 800;
  letter-spacing: .5px;
  font-size: 20px;
}
.brand-subtitle{
  color: var(--muted);
  font-size: 12px;
  margin-top:2px;
}

.identity{
  display:flex;
  gap:10px;
  align-items:flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.field{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size: 12px;
  color: var(--muted);
}
.field input{
  width: 220px;
  padding: 8px 10px;
  border-radius: 10px;
  border:1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  outline:none;
}
.field input:focus{
  border-color: rgba(90,169,255,.6);
  box-shadow: 0 0 0 4px rgba(90,169,255,.12);
}

.btn{
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #182336, #111a28);
  color: var(--text);
  cursor:pointer;
  box-shadow: 0 8px 20px var(--shadow);
}
.btn:hover{ border-color: rgba(90,169,255,.45); }
.btn:active{ transform: translateY(1px); }
.btn-secondary{
  background: linear-gradient(180deg, #161c26, #0f1620);
}
.btn-danger{
  border-color: rgba(255,90,112,.35);
  background: linear-gradient(180deg, #2a1720, #16101a);
}
.btn-danger:hover{ border-color: rgba(255,90,112,.6); }

.toggle{
  display:flex;
  align-items:center;
  gap:8px;
  color: var(--muted);
  font-size: 13px;
  user-select:none;
}
.toggle input{ accent-color: var(--accent); }

.layout{
  display:grid;
  grid-template-columns: 320px 1fr;
  gap: 16px;
  padding: 16px;
}

.sidebar{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.panel{
  background: rgba(17,24,34,.72);
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 40px var(--shadow);
}
.panel-title{
  font-weight: 700;
  margin-bottom: 10px;
}
.channel-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}
.channel-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  padding: 8px 10px;
  background: rgba(15,22,32,.8);
  border:1px solid var(--border);
  border-radius: 12px;
}
.channel-item .left{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.channel-item .name{
  font-weight:700;
}
.channel-item .secret{
  font-family: var(--mono);
  color: var(--muted);
  font-size: 11px;
}
.channel-item .open{
  white-space: nowrap;
}

.hint{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height:1.35;
}

.notes{
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height:1.5;
}

.channels{
  display:flex;
  flex-direction:column;
  gap: 16px;
}

.channel{
  background: rgba(17,24,34,.65);
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 40px var(--shadow);
}

.channel-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 10px;
}

.channel-title{
  font-weight: 800;
  letter-spacing: .2px;
}

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

.dropzone{
  border: 1px dashed rgba(90,169,255,.35);
  border-radius: 14px;
  background: rgba(15,22,32,.65);
  padding: 12px;
  cursor:pointer;
}
.dropzone.dragover{
  border-color: rgba(90,169,255,.8);
  box-shadow: 0 0 0 4px rgba(90,169,255,.12);
}
.dropzone-inner{
  text-align:center;
  padding: 14px 10px;
}
.dropzone-title{ font-weight: 800; }
.dropzone-sub{ color: var(--muted); font-size: 12px; margin-top: 2px; }

.channel-status{
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  min-height: 18px;
}

.filelist{
  margin-top: 10px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.file{
  border:1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(15,22,32,.72);
}
.file-main{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  align-items:flex-start;
}
.file-name{
  font-weight: 800;
  word-break: break-word;
}
.file-meta{
  color: var(--muted);
  font-size: 12px;
  text-align:right;
  white-space: nowrap;
}

.file-controls{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.version-control{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 6px 8px;
  border:1px solid var(--border);
  border-radius: 12px;
  background: rgba(17,24,34,.55);
}
.version-label{
  font-family: var(--mono);
  color: var(--muted);
  font-size: 12px;
  min-width: 120px;
}
.version-range{
  width: 160px;
}

.file-sub{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}
.file-extra{
  display:flex;
  justify-content:space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-family: var(--mono);
}

.footer{
  padding: 12px 16px;
  color: var(--muted);
  border-top:1px solid var(--border);
  font-size: 12px;
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap: wrap;
}
.footer code{
  font-family: var(--mono);
  background: rgba(17,24,34,.7);
  padding: 2px 6px;
  border-radius: 8px;
  border:1px solid var(--border);
}
.footer .sep{ opacity:.6; }

a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .field input{ width: 180px; }
}
