:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --panel: #12161b;
  --panel2: #171c22;
  --line: #222a33;
  --text: #e6edf3;
  --muted: #8b98a5;
  --faint: #5c6874;
  --accent: #2cd5f5;
  --accent2: #0b6f86;
  --ok: #3ddc84;
  --warn: #f5a742;
  --bad: #ff6b6b;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif; padding-bottom: 64px; }
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 650; }
h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
button, input { font: inherit; color: inherit; }
button {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer;
  transition: background .15s, border-color .15s;
}
button:hover { border-color: #33404d; background: #1c232b; }
button.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
button.primary:hover { background: #0d82a0; }
button.danger:hover { border-color: var(--bad); color: var(--bad); }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; min-width: 0; }

/* ---- the top bar ---- */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 12px 20px; background: rgba(11, 13, 16, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand svg { width: 26px; height: 26px; color: var(--accent); }
.linkbox { flex: 1 1 360px; display: flex; gap: 8px; min-width: 0; }
.linkbox input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; color: var(--accent); }
.status { margin-left: auto; color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 8px rgba(61, 220, 132, .6); }
.dot.wait { background: var(--warn); }
.dot.bad { background: var(--bad); }

main { max-width: 1180px; margin: 0 auto; padding: 24px 20px; }

/* ---- the start ---- */
.drop { border: 2px dashed #2a3440; border-radius: var(--radius); text-align: center; transition: border-color .15s, background .15s; }
.drop.over, .drop:hover { border-color: var(--accent); background: rgba(44, 213, 245, .04); }
.hero { padding: 56px 24px 44px; }
.hero-icon { width: 56px; height: 56px; color: var(--accent); }
.hero h1 { font-size: 28px; margin: 10px 0 8px; }
.hero p { margin: 10px 0; color: var(--muted); }
.hero .hint { font-size: 13px; color: var(--faint); }
.points { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.points li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: 14px; }
.points b { color: var(--text); display: block; margin-bottom: 2px; }
.denied { background: #2a1416; border: 1px solid #5a2a2e; color: #ffb4b4; border-radius: var(--radius); padding: 12px 16px; margin: 16px 0 0; }

.notice { max-width: 560px; margin: 60px auto; text-align: center; color: var(--muted); }
.notice h1 { color: var(--text); font-size: 22px; margin: 18px 0 8px; }
.spinner { width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- the room ---- */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--faint); padding: 20px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); }
.drop.small { padding: 14px; margin-top: 12px; color: var(--faint); font-size: 13px; }

.file { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.file.mine { border-left: 3px solid var(--accent); }
.frow { display: flex; align-items: center; gap: 12px; }
.badge {
  flex: none; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center;
  font: 700 11px/1 ui-monospace, monospace; letter-spacing: .03em; color: #fff; background: #3b4754;
}
.badge.image { background: #7c4dff; } .badge.video { background: #e0457b; } .badge.audio { background: #f09a2b; }
.badge.archive { background: #8d6e63; } .badge.doc { background: #2f80ed; } .badge.code { background: #27ae60; }
.fname { font-weight: 600; overflow-wrap: anywhere; }
.fmeta { color: var(--muted); font-size: 13px; }
.grow { flex: 1; min-width: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions button { padding: 5px 11px; font-size: 13px; }

.bar { height: 8px; border-radius: 6px; background: #1d242c; overflow: hidden; margin: 10px 0 6px; }
.bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #0b8fb0, var(--accent)); transition: width .4s; }
.bar.active i {
  background-image: linear-gradient(90deg, #0b8fb0, var(--accent)), repeating-linear-gradient(45deg, rgba(255,255,255,.14) 0 8px, transparent 8px 16px);
  background-blend-mode: overlay; background-size: 100% 100%, 22px 22px; animation: stripes 1s linear infinite;
}
.bar.done i { background: var(--ok); }
.bar.paused i { background: var(--warn); }
.bar.bad i { background: var(--bad); }
@keyframes stripes { to { background-position: 0 0, 22px 0; } }
.line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.line .ok { color: var(--ok); } .line .bad { color: var(--bad); } .line .warn { color: var(--warn); }

.receivers { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.receiver { display: grid; grid-template-columns: minmax(70px, 140px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.receiver .bar { margin: 0; height: 6px; }
.receiver b { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- the side: people and chat ---- */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 76px; }
@media (max-width: 900px) { .side { position: static; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h2 { margin-bottom: 10px; }
.count { color: var(--faint); font-weight: 500; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.people li { display: flex; align-items: center; gap: 10px; }
.people .who { flex: 1; min-width: 0; }
.people .name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people .route { color: var(--muted); font-size: 12px; }
.people button.rename { padding: 2px 8px; font-size: 12px; }
.chat .log { height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; margin-bottom: 10px; overflow-wrap: anywhere; }
.chat .log:empty::before { content: "No messages yet."; color: var(--faint); font-size: 13px; }
.msg { font-size: 14px; }
.msg .n { font-weight: 650; color: var(--accent); margin-right: 6px; }
.msg.me .n { color: var(--ok); }
.msg .t { color: var(--faint); font-size: 11px; margin-left: 6px; }
.msg.sys { color: var(--faint); font-size: 12px; font-style: italic; }
.say { display: flex; gap: 8px; }
.say input { flex: 1; }

/* ---- keep the page open; dropping files; notices ---- */
.keep {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 11px 16px; background: #0e2a31; border-top: 1px solid #165566; color: #bff3ff; font-size: 14px;
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }
.dropover {
  position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(4, 18, 22, .82); pointer-events: none;
}
.dropover div { border: 3px dashed var(--accent); border-radius: 20px; padding: 48px 64px; font-size: 22px; font-weight: 650; color: var(--accent); }
.toast {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 40; max-width: min(560px, calc(100% - 32px));
  background: #1d2630; border: 1px solid #2c3a47; border-radius: 10px; padding: 10px 16px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
.toast.on { opacity: 1; }

@media (max-width: 560px) {
  .top { padding: 10px 14px; gap: 10px; }
  .status { margin-left: 0; width: 100%; }
  main { padding: 16px 14px; }
  .hero { padding: 40px 16px 32px; }
  .hero h1 { font-size: 23px; }
  .receiver { grid-template-columns: minmax(60px, 100px) minmax(0, 1fr) auto; }
}
