/* AxisChat — dark institutional theme, Helvetica (Axis Meridi house rule).
   Built to sit comfortably inside AxisCommand's dark chrome when embedded. */

:root {
  --bg:        #0a0f1a;
  --panel:     #0e1626;
  --panel-2:   #111c30;
  --raised:    #16223a;
  --border:    rgba(255,255,255,0.08);
  --border-2:  rgba(255,255,255,0.14);
  --ink:       #e6edf6;
  --ink-soft:  #aab6c8;
  --ink-mute:  #6c7a90;
  --accent:    #4d8dff;
  --accent-2:  #2e5a9a;
  --danger:    #e5564b;
  --radius:    8px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

.hidden { display: none !important; }

/* ── wordmark ─────────────────────────────────────────────── */
.wordmark {
  font-weight: 500;
  letter-spacing: -0.02em;
  font-size: 22px;
  color: var(--ink);
}
.wordmark span { color: var(--accent); }
.wordmark.sm { font-size: 17px; }

/* ── sign-in ──────────────────────────────────────────────── */
.signin {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 18%, rgba(77,141,255,0.10) 0%, transparent 55%),
    var(--bg);
  padding: 24px;
}
.signin-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 44px 32px;
}
.signin-card .wordmark { font-size: 30px; margin-bottom: 10px; }
.signin-sub { color: var(--ink-soft); font-weight: 300; margin-bottom: 28px; }
.signin-note { margin-top: 16px; font-size: 12px; color: var(--ink-mute); min-height: 16px; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  padding: 12px 20px;
  background: var(--accent);
  color: #061021;
  font-weight: 500;
  font-size: 14px;
  border: none; border-radius: 99px;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, background .12s ease;
}
.btn-primary:hover { background: #5e98ff; transform: translateY(-1px); }
.btn-primary.sm { width: auto; padding: 9px 18px; font-size: 13px; }

/* ── app layout ───────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 264px 1fr; height: 100vh; }

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  min-height: 0;
}
.sidebar-head { padding: 18px 18px 12px; border-bottom: 1px solid var(--border); }

.side-section { padding: 14px 8px 6px; flex-shrink: 0; }
.side-section:nth-of-type(2) { flex: 1; overflow-y: auto; min-height: 0; }
.side-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 6px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-mute);
}
.icon-btn {
  background: transparent; border: none; color: var(--ink-mute);
  font-size: 18px; line-height: 1; cursor: pointer; border-radius: 5px;
  width: 22px; height: 22px;
}
.icon-btn:hover { color: var(--ink); background: var(--raised); }

.channel-list { list-style: none; }
.channel-list li {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; margin: 1px 2px;
  border-radius: 6px; cursor: pointer;
  color: var(--ink-soft);
  font-size: 14px;
}
.channel-list li:hover { background: var(--panel-2); color: var(--ink); }
.channel-list li.active { background: var(--accent-2); color: #fff; }
.channel-list li .hash { color: var(--ink-mute); font-weight: 400; }
.channel-list li.active .hash { color: rgba(255,255,255,0.7); }
.channel-list li .cname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.channel-list li .badge {
  background: var(--accent); color: #061021;
  font-size: 11px; font-weight: 500;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; display: grid; place-items: center;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-mute); flex-shrink: 0; }

.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex; align-items: center; gap: 8px;
}
.me { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent-2); color: #fff;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.me-meta { min-width: 0; }
.me-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-email { font-size: 11px; color: var(--ink-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signout { color: var(--ink-mute); text-decoration: none; font-size: 16px; padding: 4px; border-radius: 5px; }
.signout:hover { color: var(--ink); background: var(--raised); }

/* ── main ─────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chan-head {
  padding: 14px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; min-height: 58px;
}
.chan-title { font-size: 15px; font-weight: 500; }
.chan-topic { font-size: 12px; color: var(--ink-mute); margin-top: 1px; }

.messages { flex: 1; overflow-y: auto; padding: 18px 22px 8px; min-height: 0; }
.empty { color: var(--ink-mute); text-align: center; margin-top: 80px; font-weight: 300; }

.msg { display: flex; gap: 11px; padding: 5px 0; }
.msg .avatar { width: 34px; height: 34px; font-size: 13px; }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; }
.msg-name { font-weight: 500; font-size: 13px; }
.msg-time { font-size: 11px; color: var(--ink-mute); }
.msg-text { color: var(--ink-soft); white-space: pre-wrap; word-wrap: break-word; }
.msg.grouped { padding-top: 1px; }
.msg.grouped .avatar { visibility: hidden; height: 0; }
.msg.grouped .msg-head { display: none; }

.day-sep { text-align: center; color: var(--ink-mute); font-size: 11px; margin: 16px 0 8px; position: relative; }
.day-sep::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); z-index: 0; }
.day-sep span { background: var(--bg); padding: 0 12px; position: relative; z-index: 1; }

.composer { display: flex; gap: 10px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }
.composer textarea {
  flex: 1; resize: none;
  background: var(--panel-2); border: 1px solid var(--border-2);
  color: var(--ink); border-radius: 8px;
  padding: 11px 14px; font: inherit; max-height: 160px;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.btn-send {
  background: var(--accent); color: #061021; border: none;
  border-radius: 8px; padding: 0 20px; font-weight: 500; cursor: pointer;
}
.btn-send:hover { background: #5e98ff; }

/* ── modal ────────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(2,6,14,0.66); display: grid; place-items: center; z-index: 50; padding: 24px; }
.modal-card { background: var(--panel); border: 1px solid var(--border-2); border-radius: 12px; width: 100%; max-width: 380px; padding: 22px; }
.modal-title { font-weight: 500; font-size: 15px; margin-bottom: 14px; }
.modal-card input {
  width: 100%; background: var(--panel-2); border: 1px solid var(--border-2);
  color: var(--ink); border-radius: 8px; padding: 10px 12px; font: inherit; margin-bottom: 8px;
}
.modal-card input:focus { outline: none; border-color: var(--accent); }
.people { max-height: 240px; overflow-y: auto; }
.person { padding: 9px 11px; border-radius: 6px; cursor: pointer; color: var(--ink-soft); display: flex; align-items: center; gap: 9px; }
.person:hover { background: var(--panel-2); color: var(--ink); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.btn-ghost { background: transparent; border: 1px solid var(--border-2); color: var(--ink-soft); border-radius: 99px; padding: 9px 16px; cursor: pointer; }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-mute); }

/* scrollbars */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.16); background-clip: content-box; }

@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
