:root {
  --bg-app: #000;
  --bg-surface: #0a0a0a;
  --bg-elevated: #111;
  --bg-hover: #171717;
  --text-primary: #fff;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --text-disabled: #3f3f46;
  --accent-primary: #fff;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --accent-success: #22c55e;
  --border-subtle: #1f1f1f;
  --border-strong: #3f3f46;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --font-sans: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;
  --nav-height: 60px;
  --zoom: 1;
}

/* Zoom wrapper */
#zoom-root {
  transform-origin: top left;
  transform: scale(var(--zoom));
  width: calc(100% / var(--zoom));
  height: calc(100% / var(--zoom));
  display: flex;
  flex-direction: column;
}

/* Zoom controls */
.zoom-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.zoom-btn {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: background .15s;
}

.zoom-btn:hover {
  background: rgba(255, 255, 255, .15);
}

.zoom-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-tertiary);
  min-width: 28px;
  text-align: center;
  font-family: var(--font-mono);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-app);
  font-family: var(--font-sans);
  color: var(--text-primary);
  font-size: 14px;
}

#root {
  height: 100%;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
}

::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 10px;
}

/* TOP BAR */
.top-bar {
  height: 52px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: var(--bg-app);
  flex-shrink: 0;
  gap: 12px;
}

.top-bar-logo {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.top-bar-logo span {
  color: var(--text-tertiary);
}

.top-bar-api {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-status {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
  transition: background .3s;
}

.api-status.online {
  background: var(--accent-success);
}

.api-status.error {
  background: var(--accent-red);
}

.api-status.local {
  background: #f59e0b;
}

/* MAIN CONTENT */
.main-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.view {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 20px 16px 16px;
  animation: fadeIn .2s ease;
}

.view.active {
  display: block;
}

/* BOTTOM NAV */
.bottom-nav {
  height: var(--nav-height);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: stretch;
  background: var(--bg-app);
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-disabled);
  cursor: pointer;
  position: relative;
  transition: color .15s;
  border: none;
  background: none;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.nav-btn.active {
  color: var(--text-primary);
}

.nav-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.nav-badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 18px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(255, 255, 255, .8);
}

/* COMPONENTS */
.surface {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.surface-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.surface-header-title {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.surface-body {
  padding: 16px;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 20px;
}

.page-header {
  margin-bottom: 20px;
}

.input {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
}

.input:focus {
  border-color: var(--border-strong);
}

.input::placeholder {
  color: var(--text-disabled);
}

textarea.input {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

select.input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.btn-primary {
  background: rgba(255, 255, 255, .9);
  color: #000;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
  white-space: nowrap;
  cursor: pointer;
}

.btn-primary:hover {
  background: #fff;
}

.btn-primary:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .15s;
  cursor: pointer;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, .1);
}

.btn-danger {
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .2);
  color: var(--accent-red);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.field-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.row .input {
  flex: 1;
}

/* STAT CARDS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* TOKEN LIST */
.token-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.token-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-disabled);
  flex-shrink: 0;
}

.token-dot.active {
  background: var(--accent-success);
}

.token-info {
  flex: 1;
  min-width: 0;
}

.token-name {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.token-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-top: 2px;
}

.token-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--bg-surface);
}

.token-badge.multi {
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, .2);
}

.token-badge.single {
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* CHAT FEED */
.chat-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.clients-scroll {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  scrollbar-width: none;
}

.clients-scroll::-webkit-scrollbar {
  display: none;
}

.client-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
}

.client-chip.selected {
  background: var(--text-primary);
  color: #000;
  border-color: var(--text-primary);
}

.chat-header {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.chat-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 5px;
  padding: 2px;
  margin-right: auto;
}

.chat-tab {
  padding: 4px 12px;
  border-radius: 4px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-tertiary);
  background: transparent;
  transition: all .15s;
}

.chat-tab.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg-row {
  display: flex;
  gap: 10px;
}

.msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.msg-body {
  flex: 1;
  min-width: 0;
}

.msg-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}

.msg-user {
  font-size: 12px;
  font-weight: 700;
}

.msg-time {
  font-size: 10px;
  color: var(--text-disabled);
}

.msg-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-img {
  margin-top: 6px;
  max-width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  background: var(--bg-surface);
  flex-shrink: 0;
}

.chat-input-row .input {
  flex: 1;
  height: 38px;
  padding: 8px 12px;
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .9);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
}

.channel-config {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.channel-config .input {
  height: 34px;
  font-size: 12px;
  flex: 1;
}

.channel-label {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 600;
  white-space: nowrap;
}

/* MULTI VIEW */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.card-title {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

/* ALERT LIST */
.alert-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.alert-item:last-child {
  border-bottom: none;
}

.alert-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.alert-author {
  font-size: 13px;
  font-weight: 700;
}

.alert-time {
  font-size: 11px;
  color: var(--text-tertiary);
}

.alert-channel {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  color: var(--accent-blue);
  margin-left: 8px;
}

.alert-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* SETTINGS */
.setting-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-info {
  flex: 1;
}

.setting-title {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 3px;
}

.setting-desc {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* API CONFIG MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .8);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  animation: fadeIn .15s;
}

.modal-sheet {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  width: 100%;
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 20px;
}

.modal-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 20px;
}

/* EMPTY STATE */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-disabled);
  gap: 12px;
  text-align: center;
}

.empty-state svg {
  opacity: .1;
}

.empty-state p {
  font-size: 13px;
}

/* RANGE */
input[type=range] {
  width: 100%;
  accent-color: var(--text-primary);
  height: 4px;
  margin: 8px 0;
}

/* SEND RESULT */
.result-box {
  padding: 12px;
  border-radius: var(--radius-md);
  margin-top: 12px;
}

.result-box.success {
  background: rgba(34, 197, 94, .05);
  border: 1px solid rgba(34, 197, 94, .15);
}

.result-box.error {
  background: rgba(239, 68, 68, .05);
  border: 1px solid rgba(239, 68, 68, .15);
}

/* SPLIT TOGGLE */
.split-toggle {
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid var(--border-subtle);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.split-toggle.on {
  background: var(--accent-primary);
  color: #000;
  border-color: var(--accent-primary);
}

/* YOUTUBE */
.yt-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.yt-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}

.yt-search .input {
  flex: 1;
  height: 38px;
}

.yt-frame {
  flex: 1;
  border: none;
  background: #000;
}

/* NO CLIENTS */
.no-clients {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-disabled);
  font-size: 13px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-sheet {
  animation: slideUp .25s ease;
}

/* DANGER ZONE */
.danger-box {
  background: rgba(239, 68, 68, .05);
  border: 1px solid rgba(239, 68, 68, .15);
  border-radius: var(--radius-md);
  padding: 14px;
}

.danger-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-red);
  margin-bottom: 6px;
}

.danger-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* MORE MENU */
.more-menu {
  position: fixed;
  bottom: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  animation: slideUp .2s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.more-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}

.more-item:last-child {
  border-bottom: none;
}

.more-item svg {
  color: var(--text-tertiary);
  width: 18px;
  height: 18px;
}

.more-item.active {
  color: var(--accent-blue);
}

/* SYSTEM INFO */
.sys-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
}

.sys-row:last-child {
  border-bottom: none;
}

.sys-key {
  color: var(--text-tertiary);
}

.sys-val {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* LOCAL MODE BANNER */
.local-banner {
  background: rgba(245, 158, 11, .05);
  border: 1px solid rgba(245, 158, 11, .2);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #f59e0b;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

/* PRECOUNT BANNER */
.precount-banner {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 150;
  background: #0d0d0d;
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .6);
  animation: slideDown .2s ease;
  transition: transform .25s ease, opacity .25s ease;
  touch-action: pan-y;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.pc-body {
  flex: 1;
  min-width: 0;
}

.pc-user {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pc-channel {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, .1);
  border: 1px solid rgba(59, 130, 246, .2);
  border-radius: 3px;
  padding: 1px 5px;
  font-family: var(--font-mono);
}

.pc-msg {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pc-time {
  font-size: 10px;
  color: var(--text-disabled);
  margin-top: 3px;
  font-family: var(--font-mono);
}

.pc-close {
  flex-shrink: 0;
  padding: 4px;
  color: var(--text-disabled);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

/* TELEMETRY */
.telem-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.telem-item:last-child {
  border-bottom: none;
}

.telem-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3px;
}

.telem-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.telem-time {
  font-size: 10px;
  color: var(--text-disabled);
  font-family: var(--font-mono);
}

.telem-text {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  word-break: break-word;
}

/* DM BROWSER */
.dm-container {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dm-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.dm-tab {
  flex: 1;
  padding: 6px 0;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-tertiary);
  background: transparent;
  text-transform: uppercase;
  letter-spacing: .04em;
  transition: all .15s;
  text-align: center;
}

.dm-tab.active {
  background: rgba(255, 255, 255, .1);
  color: var(--text-primary);
}

.dm-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.dm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .1s;
  border-bottom: 1px solid var(--border-subtle);
}

.dm-item:last-child {
  border-bottom: none;
}

.dm-item:hover {
  background: var(--bg-elevated);
}

.dm-item.selected {
  background: var(--bg-elevated);
}

/* Live pulse indicator */
@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .4; transform: scale(.85); }
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-success);
  display: inline-block;
  margin-left: 6px;
  animation: livePulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.dm-live-preview {
  font-size: 11px;
  color: var(--accent-success);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  font-weight: 500;
}

.dm-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
}

.dm-avatar.server {
  border-radius: var(--radius-md);
}

.dm-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-info {
  flex: 1;
  min-width: 0;
}

.dm-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-preview {
  font-size: 11px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.dm-unread {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #5865f2;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dm-chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dm-chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.dm-back {
  padding: 4px 6px;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: none;
}

.dm-chat-name {
  font-size: 14px;
  font-weight: 700;
  flex: 1;
}

.dm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80px;
  color: var(--text-disabled);
  font-size: 13px;
}

.dm-token-pick {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: var(--bg-elevated);
}

.dm-token-pick select {
  flex: 1;
  height: 30px;
  font-size: 12px;
}

.server-channel-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  transition: background .1s;
}

.server-channel-item:hover,
.server-channel-item.selected {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* ── PWA INSTALL PROMPT ──────────────────────────────────────────────── */
#pwa-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #111;
  border-top: 1px solid #2a2a2a;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'DM Sans', -apple-system, sans-serif;
  animation: slideUp .3s ease;
  transition: transform .3s;
}

#pwa-banner.hidden {
  transform: translateY(110%);
  pointer-events: none;
}

#pwa-banner .pwa-icon {
  width: 40px;
  height: 40px;
  background: #000;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#pwa-banner .pwa-text {
  flex: 1;
  min-width: 0;
}

#pwa-banner .pwa-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

#pwa-banner .pwa-sub {
  font-size: 11px;
  color: #71717a;
}

#pwa-banner .pwa-install {
  background: rgba(255, 255, 255, .9);
  color: #000;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
}

#pwa-banner .pwa-dismiss {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: #71717a;
  flex-shrink: 0;
  font-size: 18px;
  line-height: 1;
}

/* iOS guide modal */
#ios-guide {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: none;
  align-items: flex-end;
  background: rgba(0, 0, 0, .8);
}

#ios-guide.open {
  display: flex;
}

#ios-guide-sheet {
  background: #111;
  border: 1px solid #2a2a2a;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  animation: slideUp .25s ease;
}

#ios-guide-sheet h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

#ios-guide-sheet p {
  font-size: 13px;
  color: #a1a1aa;
  margin-bottom: 16px;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

.ios-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #1f1f1f;
  font-family: 'DM Sans', -apple-system, sans-serif;
}

.ios-step:last-of-type {
  border-bottom: none;
}

.ios-step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ios-step-text {
  font-size: 13px;
  color: #fff;
}

.ios-step-text em {
  color: #a1a1aa;
  font-style: normal;
}

#ios-guide-close {
  width: 100%;
  background: rgba(255, 255, 255, .08);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
}