﻿@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

:root {
  --paper: #EDEEE8;
  --paper-raised: #F7F7F3;
  --ink: #20241F;
  --ink-soft: #565E54;
  --line: #C7C9BE;
  --accent: #E0A72E;
  --accent-ink: #2A2010;
  --slate: #45585C;
  --danger: #B5482F;
  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px);
  background-size: 100% 100%;
  opacity: 0.35;
  z-index: 0;
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* ---------- Top bar (shared across pages) ---------- */
.top-bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-raised);
}

.brand-mark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark span { color: var(--accent); }

/* ---------- Dropdown menu ---------- */
.menu-wrap { position: relative; }

.menu-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.menu-btn:hover { background: var(--ink); color: var(--paper-raised); }
.menu-caret { display: inline-block; margin-left: 2px; font-size: 9px; }

.menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(32, 36, 31, 0.16);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  overflow: hidden;
}
.menu-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.menu-link {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.menu-link + .menu-link { border-top: 1px dashed var(--line); }
.menu-link:hover { background: var(--ink); color: var(--paper-raised); }
.menu-link.active { color: var(--accent-ink); background: var(--accent); }
.menu-link-btn { font-family: 'IBM Plex Mono', monospace; }

.menu-section-label {
  padding: 10px 16px 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}

/* ---------- Manifest strip (filedrop / admin page headers) ---------- */
.manifest-strip {
  position: relative;
  z-index: 1;
  padding: 18px 28px 20px;
  border-bottom: 1px dashed var(--line);
  background: var(--paper-raised);
}
.manifest-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.manifest-title span { color: var(--accent); }
.manifest-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ---------- Hero (home page) ---------- */
.home-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  animation: hero-in 0.5s ease both;
}

@keyframes hero-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.hero-title {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: clamp(32px, 6vw, 52px);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}
.hero-title span {
  color: var(--accent-ink);
  background: var(--accent);
  padding: 0 10px;
  border-radius: var(--radius);
}

.hero-sub {
  font-size: 15px;
  color: var(--ink-soft);
  max-width: 420px;
  margin: 0;
  line-height: 1.5;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px 24px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  border-top: 1px dashed var(--line);
}
.site-footer strong { color: var(--ink); }

/* ---------- Layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 36px 24px 80px;
}

/* ---------- Drop zone (loading dock) ---------- */
.dock {
  position: relative;
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  background:
    repeating-linear-gradient(
      135deg,
      transparent, transparent 10px,
      rgba(32,36,31,0.035) 10px, rgba(32,36,31,0.035) 20px
    ),
    var(--paper-raised);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dock.drag-over {
  border-color: var(--accent);
  background: #FBF0D6;
}

.dock-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
  font-weight: 600;
}

.dock-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

.dock input[type="file"] { display: none; }

/* ---------- Progress ---------- */
.progress-row {
  display: none;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
}
.progress-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

/* ---------- Stamp (upload success) ---------- */
.stamp {
  display: none;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1.5px solid var(--slate);
  border-radius: var(--radius);
  color: var(--slate);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transform: rotate(-0.6deg);
}
.stamp.show { display: flex; }
.stamp .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--slate);
}

/* ---------- Manifest table ---------- */
.section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 40px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.file-row {
  display: grid;
  grid-template-columns: 1fr 90px 140px auto;
  gap: 14px;
  align-items: center;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
}
.file-row:first-of-type { border-top: 1px dashed var(--line); }

.file-name {
  font-weight: 500;
  word-break: break-all;
}
.file-meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
}

.file-actions { display: flex; gap: 8px; justify-content: flex-end; }

.icon-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover { background: var(--ink); color: var(--paper-raised); }
.icon-btn.danger { border-color: var(--danger); color: var(--danger); }
.icon-btn.danger:hover { background: var(--danger); color: var(--paper-raised); }

.empty-state {
  padding: 30px 4px;
  color: var(--ink-soft);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.error-banner {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border-left: 3px solid var(--danger);
  background: #F6E2DB;
  color: var(--danger);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
}
.error-banner.show { display: block; }

/* ---------- Login page ---------- */
.login-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 340px;
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 28px 26px 26px;
}

.login-title {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.login-title span { color: var(--accent); }

.login-sub {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 22px;
}

.field-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 16px;
}
.login-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.login-btn {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper-raised);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s;
}
.login-btn:hover { background: var(--slate); }

.login-error {
  display: none;
  margin-top: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--danger);
}
.login-error.show { display: block; }

@media (max-width: 520px) {
  .file-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .file-actions { justify-content: flex-start; }
}

/* ---------- Admin panel ---------- */
.admin-form {
  max-width: 420px;
  margin-bottom: 8px;
}
.admin-input-inline {
  margin-bottom: 14px;
}
.admin-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.admin-user-row {
  grid-template-columns: 1fr 140px auto;
}
.admin-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--accent-ink);
  background: var(--accent);
  padding: 2px 6px;
  border-radius: var(--radius);
  vertical-align: middle;
}

/* ---------- Owner badge (admin view) ---------- */
.owner-badge {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  padding: 2px 6px;
  border-radius: var(--radius);
  vertical-align: middle;
}

/* ---------- Per-file three-dot menu ---------- */
.row-menu-wrap { position: relative; }

.dots-btn {
  font-size: 18px;
  line-height: 1;
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.dots-btn:hover { background: var(--ink); color: var(--paper-raised); }

.row-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 2;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(32, 36, 31, 0.16);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.12s ease, transform 0.12s ease;
  overflow: hidden;
}
.row-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.row-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: transparent;
  border: none;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.row-menu-item + .row-menu-item { border-top: 1px dashed var(--line); }
.row-menu-item:hover { background: var(--ink); color: var(--paper-raised); }
.row-menu-item.danger { color: var(--danger); }
.row-menu-item.danger:hover { background: var(--danger); color: var(--paper-raised); }

/* ---------- Shared-with chips ---------- */
.shared-with-line {
  padding: 2px 4px 12px;
  margin-top: -8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  border-bottom: 1px dashed var(--line);
}
.shared-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2px 4px 2px 8px;
}
.chip-x {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
}
.chip-x:hover { color: var(--danger); }

/* ================= Chat ================= */
.chat-body { overflow: hidden; }

.chat-shell {
  position: relative;
  z-index: 1;
  display: flex;
  height: calc(100vh - 63px); /* below top-bar */
}

.chat-sidebar {
  width: 320px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  background: var(--paper-raised);
  display: flex;
  flex-direction: column;
}
.chat-sidebar-header { padding: 16px 16px 4px; }
.new-chat-row {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
}
.new-chat-row .login-input { flex: 1; padding: 8px 10px; font-size: 13px; }

.conversation-list { flex: 1; overflow-y: auto; padding: 4px 10px 16px; }
.conversation-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
.conversation-item:hover { background: var(--paper); }
.conversation-item.active { background: var(--accent); }
.conversation-item.active .conv-name,
.conversation-item.active .conv-preview-text,
.conversation-item.active .conv-time { color: var(--accent-ink); }

.conv-avatar-wrap { position: relative; flex-shrink: 0; }
.conv-avatar-wrap .presence-dot { position: absolute; bottom: -1px; right: -1px; }
.conv-main { flex: 1; min-width: 0; }
.conv-top-line { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.conv-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 10.5px; color: var(--ink-soft); flex-shrink: 0; }
.conv-preview { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 2px; }
.conv-preview-text { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unread-badge {
  background: var(--ink);
  color: var(--paper-raised);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 14px;
  color: var(--paper-raised);
  background: var(--slate);
  flex-shrink: 0;
}
.presence-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--ink-soft);
  border: 2px solid var(--paper-raised);
  display: inline-block;
}
.presence-dot.online { background: #3F9142; }

.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-raised);
}
.chat-header .back-btn { display: none; }
.chat-header-name { font-weight: 600; font-size: 14.5px; }
.chat-header-status { font-size: 11px; color: var(--ink-soft); }
.chat-header-status.online { color: #3F9142; }

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 6% 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.date-sep {
  text-align: center;
  font-size: 10.5px;
  color: var(--ink-soft);
  margin: 14px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.msg-row { display: flex; margin-top: 5px; }
.msg-row.mine { justify-content: flex-end; }
.msg-row.theirs { justify-content: flex-start; }
.msg-bubble-wrap { max-width: 62%; position: relative; }
@media (max-width: 900px) { .msg-bubble-wrap { max-width: 82%; } }

.msg-bubble {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}
.msg-row.mine .msg-bubble { background: var(--ink); color: var(--paper-raised); }
.msg-row.theirs .msg-bubble { background: var(--paper-raised); color: var(--ink); border: 1px solid var(--line); }
.msg-row.mine .msg-bubble a { color: var(--paper-raised); }

.msg-reply-quote {
  border-left: 3px solid var(--accent);
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 2px;
  font-size: 11.5px;
  opacity: 0.85;
  background: rgba(255,255,255,0.08);
}
.msg-row.theirs .msg-reply-quote { background: var(--paper); }
.msg-reply-quote .who { font-weight: 600; display: block; }

.msg-deleted { font-style: italic; opacity: 0.7; font-size: 12.5px; }

.msg-meta { display: flex; align-items: center; gap: 4px; font-size: 10px; margin-top: 3px; opacity: 0.75; }
.msg-row.mine .msg-meta { justify-content: flex-end; }
.msg-ticks.read { color: #7BC4E0; }

.msg-actions {
  position: absolute;
  top: -13px;
  display: none;
  gap: 2px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(32,36,31,0.12);
  padding: 2px;
}
.msg-row.mine .msg-actions { right: 0; }
.msg-row.theirs .msg-actions { left: 0; }
.msg-bubble-wrap:hover .msg-actions { display: flex; }
.msg-actions button {
  width: 24px; height: 24px;
  border: none; background: transparent;
  color: var(--ink-soft);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.msg-actions button:hover { background: var(--paper); color: var(--ink); }

.file-card { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.file-icon {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.msg-row.theirs .file-icon { background: var(--paper); }
.file-info { min-width: 0; flex: 1; }
.file-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-sub { font-size: 11px; opacity: 0.85; }
.file-download {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.15);
  color: inherit;
  text-decoration: none;
  flex-shrink: 0;
}
.msg-row.theirs .file-download { background: var(--paper); }
.file-progress-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.25); overflow: hidden; margin-top: 6px; }
.msg-row.theirs .file-progress-track { background: var(--line); }
.file-progress-fill { height: 100%; width: 0%; background: currentColor; transition: width 0.1s linear; }

.voice-card { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.voice-play-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.18);
  color: inherit;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 13px;
}
.msg-row.theirs .voice-play-btn { background: var(--ink); color: var(--paper-raised); }
.voice-waveform { flex: 1; height: 30px; cursor: pointer; }
.voice-duration { font-size: 10.5px; opacity: 0.85; min-width: 30px; text-align: right; }

.video-card { width: 230px; }
.video-card video { width: 100%; border-radius: var(--radius); display: block; background: #000; max-height: 290px; }

.reply-bar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 8px 20px;
  background: var(--paper);
  border-top: 1px solid var(--line);
}
.reply-bar.show { display: flex; }

.composer-wrap { border-top: 1px solid var(--line); background: var(--paper-raised); padding: 10px 14px; }
.composer { display: flex; align-items: flex-end; gap: 4px; }
.composer-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 9px 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.4;
}
.composer-input:focus { outline: none; border-color: var(--accent); }
.composer input[type="file"] { display: none; }

.send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  color: var(--paper-raised);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
}
.send-btn:hover { background: var(--slate); }
.send-btn:disabled { opacity: 0.4; cursor: default; }

.record-bar { display: none; align-items: center; gap: 10px; flex: 1; padding: 2px 4px 2px 10px; }
.record-bar.show { display: flex; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); animation: rec-pulse 1.1s infinite; flex-shrink: 0; }
@keyframes rec-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.rec-time { font-size: 12px; color: var(--ink-soft); min-width: 36px; }
.rec-canvas { flex: 1; height: 30px; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 36, 31, 0.55);
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-overlay.show { display: flex; }
.video-modal {
  background: var(--paper-raised);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  width: 92%;
  max-width: 400px;
}
.video-preview-wrap { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; aspect-ratio: 4/3; }
.video-preview-wrap video { width: 100%; height: 100%; object-fit: cover; }
.video-rec-indicator {
  position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; gap: 6px;
  background: rgba(0,0,0,0.5); color: #fff;
  font-size: 11px; padding: 4px 10px; border-radius: 12px;
}
.video-modal-actions { display: flex; gap: 10px; margin-top: 14px; justify-content: center; }
.round-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
}
.round-btn.start, .round-btn.stop { background: var(--danger); color: #fff; }
.round-btn.cancel { background: var(--line); color: var(--ink); }
.round-btn.confirm { background: var(--ink); color: var(--paper-raised); }

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--ink);
  color: var(--paper-raised);
  font-family: 'IBM Plex Mono', monospace;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 760px) {
  .chat-sidebar { width: 100%; }
  .chat-shell.chat-open .chat-sidebar { display: none; }
  .chat-main { display: none; }
  .chat-shell.chat-open .chat-main { display: flex; }
  .chat-header .back-btn { display: inline-flex; }
  .message-list { padding-left: 4%; padding-right: 4%; }
  .msg-bubble-wrap { max-width: 88%; }
}

/* ================= Veyra (dark / purple) ================= */
.veyra-body {
  --v-bg: #0B0A10;
  --v-surface: #15131C;
  --v-surface-alt: #201C2B;
  --v-surface-hover: #2A2436;
  --v-border: #2E2839;
  --v-text: #F1EEF7;
  --v-text-soft: #A79FC0;
  --v-text-faint: #6E6683;
  --v-accent: #8B5CF6;
  --v-accent-hover: #7C3AED;
  --v-online: #34D399;
  --v-danger: #F87171;
  background: var(--v-bg);
  color: var(--v-text);
}
.veyra-body::before { display: none; }

.veyra-body .veyra-topbar {
  background: var(--v-surface);
  border-bottom: 2px solid var(--v-border);
}
.veyra-body .brand-mark { color: var(--v-text); }
.veyra-body .brand-mark span { color: var(--v-accent); }

.veyra-body .veyra-menu-btn {
  border-color: var(--v-border);
  color: var(--v-text);
}
.veyra-body .veyra-menu-btn:hover { background: var(--v-accent); color: #fff; }

.veyra-body .menu-dropdown {
  background: var(--v-surface);
  border-color: var(--v-border);
  box-shadow: 0 10px 28px rgba(0,0,0,0.5);
}
.veyra-body .menu-link { color: var(--v-text); }
.veyra-body .menu-link + .menu-link { border-top-color: var(--v-border); }
.veyra-body .menu-link:hover { background: var(--v-accent); color: #fff; }
.veyra-body .menu-link.active { background: var(--v-accent); color: #fff; }
.veyra-body .menu-section-label { color: var(--v-text-faint); border-top-color: var(--v-border); }

.veyra-body .chat-sidebar {
  background: var(--v-surface);
  border-right-color: var(--v-border);
}
.veyra-body .veyra-section-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v-text-faint);
  padding: 16px 16px 4px;
}
.veyra-body .veyra-input {
  background: var(--v-bg);
  border-color: var(--v-border);
  color: var(--v-text);
}
.veyra-body .veyra-input:focus { outline: 2px solid var(--v-accent); outline-offset: 1px; }
.veyra-body .veyra-btn {
  border-color: var(--v-border);
  color: var(--v-text);
}
.veyra-body .veyra-btn:hover { background: var(--v-accent); color: #fff; }

.veyra-body .veyra-form-error {
  display: none;
  padding: 0 16px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--v-danger);
}
.veyra-body .veyra-form-error.show { display: block; }

.veyra-body .veyra-empty,
.veyra-body .empty-state {
  color: var(--v-text-faint);
  border-color: var(--v-border);
}

.veyra-body .conversation-item:hover { background: var(--v-surface-hover); }
.veyra-body .conversation-item.active { background: var(--v-accent); }
.veyra-body .conversation-item.active .conv-name,
.veyra-body .conversation-item.active .conv-preview-text,
.veyra-body .conversation-item.active .conv-time { color: #fff; }
.veyra-body .conv-name { color: var(--v-text); }
.veyra-body .conv-time,
.veyra-body .conv-preview-text { color: var(--v-text-soft); }
.veyra-body .unread-badge { background: var(--v-accent); color: #fff; }

.veyra-body .avatar { background: var(--v-accent); color: #fff; }
.veyra-body .presence-dot { border-color: var(--v-surface); background: var(--v-text-faint); }
.veyra-body .presence-dot.online { background: var(--v-online); }

.veyra-body .chat-main { background: var(--v-bg); }
.veyra-body .veyra-wordmark {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.14em;
  color: var(--v-text);
}
.veyra-body .veyra-wordmark span { color: var(--v-accent); }
.veyra-body .veyra-text-soft { color: var(--v-text-faint); }

.veyra-body .chat-header {
  background: var(--v-surface);
  border-bottom-color: var(--v-border);
}
.veyra-body .chat-header-name { color: var(--v-text); }
.veyra-body .chat-header-status { color: var(--v-text-soft); }
.veyra-body .chat-header-status.online { color: var(--v-online); }

.veyra-body .date-sep { color: var(--v-text-faint); }

.veyra-body .msg-row.mine .msg-bubble { background: var(--v-accent); color: #fff; }
.veyra-body .msg-row.theirs .msg-bubble {
  background: var(--v-surface-alt);
  color: var(--v-text);
  border-color: var(--v-border);
}
.veyra-body .msg-row.mine .msg-bubble a { color: #fff; }

.veyra-body .msg-reply-quote { background: rgba(255,255,255,0.12); border-left-color: rgba(255,255,255,0.5); }
.veyra-body .msg-row.theirs .msg-reply-quote { background: rgba(255,255,255,0.05); border-left-color: var(--v-accent); }

.veyra-body .msg-ticks.read { color: #7BD3FF; }

.veyra-body .msg-actions {
  background: var(--v-surface);
  border-color: var(--v-border);
  box-shadow: 0 6px 16px rgba(0,0,0,0.5);
}
.veyra-body .msg-actions button { color: var(--v-text-soft); }
.veyra-body .msg-actions button:hover { background: var(--v-surface-hover); color: var(--v-text); }

.veyra-body .msg-row.theirs .file-icon,
.veyra-body .msg-row.theirs .file-download,
.veyra-body .msg-row.theirs .file-progress-track { background: var(--v-surface-hover); }

.veyra-body .msg-row.theirs .voice-play-btn { background: var(--v-accent); color: #fff; }

.veyra-body .reply-bar { background: var(--v-surface); border-top-color: var(--v-border); }
.veyra-body .veyra-reply-bar-content { border-left: 3px solid var(--v-accent); padding-left: 10px; flex: 1; min-width: 0; }
.veyra-body .veyra-reply-who { font-size: 11px; font-weight: 600; color: var(--v-accent); }
.veyra-body .veyra-reply-text { font-size: 12.5px; color: var(--v-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.veyra-body .composer-wrap { background: var(--v-surface); border-top-color: var(--v-border); }
.veyra-body .composer-input {
  background: var(--v-bg);
  border-color: var(--v-border);
  color: var(--v-text);
}
.veyra-body .composer-input:focus { border-color: var(--v-accent); }
.veyra-body .send-btn { background: var(--v-accent); color: #fff; }
.veyra-body .send-btn:hover { background: var(--v-accent-hover); }

.veyra-body .rec-time { color: var(--v-text-soft); }

.veyra-body .modal-overlay { background: rgba(0,0,0,0.7); }
.veyra-body .video-modal { background: var(--v-surface); border-color: var(--v-border); }
.veyra-body .round-btn.cancel { background: var(--v-surface-hover); color: var(--v-text); }
.veyra-body .round-btn.confirm { background: var(--v-accent); color: #fff; }

.veyra-body .toast { background: var(--v-accent); color: #fff; }
}
