:root {
  color-scheme: light;
  --bg: #f4f7fc;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #ffffff;
  --panel2: #f1f5f9;
  --muted: #64748b;
  --text: #0f172a;
  --line: rgba(15, 23, 42, 0.09);
  --accent: #0ea5e9;
  --accent2: #6366f1;
  --good: #10b981;
  --danger: #e11d48;
  --shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.12), 0 4px 16px -4px rgba(15, 23, 42, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --grad: linear-gradient(135deg, #0ea5e9 0%, #6366f1 55%, #8b5cf6 100%);
  --glow: rgba(14, 165, 233, 0.25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; color: var(--text); background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 75% 50% at 12% 0%, rgba(14, 165, 233, 0.22), transparent 58%),
    radial-gradient(ellipse 65% 45% at 88% 4%, rgba(139, 92, 246, 0.16), transparent 58%),
    radial-gradient(ellipse 60% 45% at 50% 100%, rgba(16, 185, 129, 0.08), transparent 55%),
    linear-gradient(180deg, #f8fafc, #eef5ff 58%, #f4f7fc);
}
button, input, textarea, select { font: inherit; }
button { border: 0; cursor: pointer; }

.app {
  position: relative; min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}
.hidden { display: none !important; }

/* Home Card */
.card {
  width: min(468px, 100%); border: 1px solid var(--line); border-radius: 32px;
  background: var(--panel); backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
  box-shadow: var(--shadow);
}
.home { padding: 24px; }
.homeTop { display: flex; align-items: center; justify-content: space-between; }
.hero { padding: 6px 2px 16px; }
.brandPill {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border: 1px solid rgba(14, 165, 233, 0.25); border-radius: 999px;
  background: rgba(14, 165, 233, 0.10); color: #0284c7;
  font-size: 11.5px; font-weight: 850; letter-spacing: 0.08em;
}
h1 {
  margin: 14px 0 8px; font-size: 30px; font-weight: 850; letter-spacing: -0.03em; line-height: 1.1;
  background: linear-gradient(125deg, var(--text) 30%, #0284c7 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
p { margin: 0; color: var(--muted); line-height: 1.55; font-size: 13.5px; }

/* Vault Room Card */
.roomCard {
  position: relative; overflow: hidden; margin: 4px 0 14px; padding: 20px;
  border: 1px solid rgba(14, 165, 233, 0.22); border-radius: 26px;
  background:
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.14), transparent 45%),
    linear-gradient(135deg, #e0f2fe 0%, #eef2ff 58%, #f5f3ff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 14px 34px -10px rgba(14, 165, 233, 0.16);
}
.roomCard::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: radial-gradient(rgba(14, 165, 233, 0.28) 1px, transparent 1px);
  background-size: 14px 14px;
}
.roomCardRow { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.roomCardRow span { color: #334155; font-weight: 800; font-size: 12.5px; }
.secBadge {
  padding: 3px 9px; border-radius: 999px; background: rgba(16, 185, 129, 0.14);
  color: #047857 !important; font-size: 11px !important; font-weight: 800;
  border: 1px solid rgba(16, 185, 129, 0.22);
}
.bigCode {
  position: relative; display: block; margin: 10px 0 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 46px; font-weight: 850; letter-spacing: 7px; line-height: 1;
  color: #0369a1; text-shadow: 0 10px 24px rgba(14, 165, 233, 0.18);
}
.roomPassRow { position: relative; margin-bottom: 12px; }
.roomPassRow input { padding: 11px 14px; border-radius: 14px; font-size: 13px; background: rgba(255, 255, 255, 0.88); }

.primary {
  position: relative; width: 100%; padding: 14px 18px; border-radius: 17px;
  background: var(--grad); color: #ffffff; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 12px 26px -6px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform .16s ease, filter .16s ease;
}
.primary:hover { filter: brightness(1.06); transform: translateY(-1px); }
.primary:active { transform: scale(0.98); }

.soft {
  padding: 12px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line); color: var(--text); font-weight: 750; font-size: 13px;
  box-shadow: 0 6px 16px -4px rgba(15, 23, 42, 0.06);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.soft:hover { border-color: rgba(14, 165, 233, 0.42); transform: translateY(-1px); }
.tileBtn { display: flex; align-items: center; gap: 9px; text-align: left; }
.tileIcon {
  width: 32px; height: 32px; border-radius: 11px; display: inline-flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.tileIcon.blue { background: rgba(14, 165, 233, 0.13); color: #0284c7; }
.tileIcon.violet { background: rgba(139, 92, 246, 0.13); color: #7c3aed; }
.tileIcon.emerald { background: rgba(16, 185, 129, 0.13); color: #059669; }
.tileIcon.amber { background: rgba(245, 158, 11, 0.13); color: #d97706; }

.ghost, .iconBtn {
  background: rgba(255, 255, 255, 0.86); color: var(--text); border: 1px solid var(--line);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.06);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, border-color .15s ease;
}
.iconBtn:hover { border-color: rgba(14, 165, 233, 0.42); }
.field { display: block; margin-top: 12px; color: #334155; font-weight: 750; font-size: 13px; }
.field input, .field select { margin-top: 6px; }
.field.compact { margin: 0 0 12px; }
input, textarea, select {
  width: 100%; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.94);
  color: var(--text); border-radius: 16px; padding: 12px 14px; outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(14, 165, 233, 0.65); box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}
.quickGrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.quickGrid.four { grid-template-columns: repeat(2, 1fr); }
.deviceMini {
  margin-top: 14px; padding: 10px 13px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.72); color: var(--muted); font-size: 12px;
  display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid var(--line);
}
.miniDot { width: 7px; height: 7px; border-radius: 999px; background: var(--good); box-shadow: 0 0 8px rgba(16, 185, 129, 0.55); flex-shrink: 0; }
.deviceMini strong { color: #6d28d9; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Chat Container */
.chat {
  position: relative; width: min(880px, 100%); height: 100dvh; max-height: 920px;
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 30px;
  background: var(--panel); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow);
}
.topbar {
  display: flex; align-items: center; gap: 7px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
}
.topbar .iconBtn { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 13px; font-weight: 800; flex-shrink: 0; }
.iconBtn.small { min-width: 36px; height: 36px; border-radius: 12px; padding: 0 8px; }
.iconBtn.accent {
  background: var(--grad); color: #fff; border: 0; padding: 0 14px;
  box-shadow: 0 6px 16px -4px var(--glow);
}
#backHome { font-size: 26px; line-height: 0; }
.chatTitle { flex: 1; text-align: left; min-width: 0; padding: 0 4px; }
.titleLine { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.titleLine strong { font-size: 15px; font-weight: 800; color: var(--text); }
.connDot { width: 8px; height: 8px; border-radius: 999px; background: #94a3b8; display: inline-block; flex-shrink: 0; }
.connDot.ok { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.7); animation: pulse 2s infinite; }
.connDot.err { background: #f59e0b; }
.encBadge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(16, 185, 129, 0.12); color: #047857; font-weight: 800; }
.chatTitle small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.keyPromptBar {
  padding: 11px 14px; background: rgba(245, 158, 11, 0.12); border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 13px; font-weight: 650; color: #92400e; display: flex; flex-direction: column; gap: 8px;
}
.keyPromptRow { display: flex; gap: 8px; }
.keyPromptRow input { padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.miniBtn { padding: 7px 13px; border-radius: 11px; background: rgba(14, 165, 233, 0.14); color: #0284c7; font-weight: 800; font-size: 12.5px; text-decoration: none; white-space: nowrap; }

.searchBar { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.9); }
.searchBar input { flex: 1; padding: 9px 13px; border-radius: 13px; }
.searchBar .iconBtn { flex: 0 0 40px; height: 40px; border-radius: 13px; }

.dropOverlay {
  position: absolute; inset: 0; z-index: 25; background: rgba(14, 165, 233, 0.18);
  backdrop-filter: blur(8px); border: 3px dashed #0ea5e9; border-radius: 30px;
  display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 850; color: #0369a1; pointer-events: none;
}

/* Messages Stream with subtle dot grid wallpaper */
.messages {
  flex: 1; overflow: auto; padding: 18px 14px 26px; display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
  background-color: rgba(248, 250, 252, 0.55);
  background-image: radial-gradient(rgba(15, 23, 42, 0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.msg {
  position: relative; max-width: 82%; border-radius: 22px; padding: 11px 14px;
  word-break: break-word; white-space: pre-wrap; line-height: 1.5;
  animation: msgIn .2s cubic-bezier(0.22, 1, 0.36, 1);
}
.msg.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 65%, #6366f1 100%);
  color: #ffffff;
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 26px -8px rgba(14, 165, 233, 0.42);
}
.msg.other {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: var(--text);
  border-bottom-left-radius: 6px;
  box-shadow: 0 8px 22px -6px rgba(15, 23, 42, 0.08);
}
.msg.locked { border: 1px dashed rgba(245, 158, 11, 0.55); background: rgba(254, 243, 199, 0.78); color: #92400e; font-size: 13px; }
.meta { font-size: 11px; margin-bottom: 5px; white-space: nowrap; opacity: 0.78; font-weight: 600; }
.msg.mine .meta { color: rgba(255, 255, 255, 0.88); }
.msg.other .meta { color: #64748b; }

.msgActions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.copyMsg, .delMsg {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 750; text-decoration: none; transition: opacity .15s;
}
.msg.mine .copyMsg { background: rgba(255, 255, 255, 0.2); color: #ffffff; }
.msg.mine .delMsg { background: rgba(255, 255, 255, 0.16); color: #ffe4e6; }
.msg.other .copyMsg { background: rgba(14, 165, 233, 0.11); color: #0284c7; }
.msg.other .delMsg { background: rgba(225, 29, 72, 0.09); color: #be123c; }

.msg img {
  display: block; max-width: min(340px, 100%); max-height: 360px; object-fit: contain;
  border-radius: 14px; margin-top: 6px; background: rgba(0, 0, 0, 0.06); cursor: zoom-in;
}
.fileCard {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 6px;
  border-radius: 14px; background: rgba(255, 255, 255, 0.2); border: 1px solid rgba(255, 255, 255, 0.28);
}
.msg.other .fileCard { background: #f8fafc; border: 1px solid var(--line); }
.fileIcon { font-size: 24px; flex-shrink: 0; }
.fileInfo { flex: 1; min-width: 0; }
.fileInfo b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileInfo small { font-size: 11px; opacity: 0.8; }
.msg.mine .miniBtn { background: rgba(255, 255, 255, 0.25); color: #ffffff; }

/* Markdown inside bubbles */
.md { white-space: normal; }
.md p { margin: 0 0 6px; color: inherit; line-height: 1.52; }
.md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: 2px 0 6px; line-height: 1.25; color: inherit; }
.md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15px; }
.md ul { margin: 4px 0 6px 20px; padding: 0; } .md li { margin: 3px 0; }
.md blockquote { margin: 5px 0; padding: 4px 0 4px 10px; border-left: 3px solid currentColor; opacity: 0.9; background: rgba(0, 0, 0, 0.06); border-radius: 8px; }
.md code { background: rgba(0, 0, 0, 0.1); border-radius: 6px; padding: 1px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.9em; }
.msg.mine .md code { background: rgba(255, 255, 255, 0.2); }
.codeBlockWrap { position: relative; margin: 6px 0; }
.codeCopyBtn { position: absolute; top: 6px; right: 6px; padding: 3px 8px; border-radius: 8px; background: rgba(14, 165, 233, 0.18); color: #0284c7; font-size: 11px; font-weight: 800; }
.msg.mine .codeCopyBtn { background: rgba(255, 255, 255, 0.22); color: #ffffff; }
.md pre { max-width: 100%; overflow: auto; background: rgba(15, 23, 42, 0.07); border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 13px; padding: 30px 11px 11px; margin: 0; white-space: pre; }
.msg.mine .md pre { background: rgba(0, 0, 0, 0.24); border-color: rgba(255, 255, 255, 0.16); }
.md pre code { border: 0; background: transparent; padding: 0; }
.md a { color: inherit; text-decoration: underline; }

.scrollBottomBtn {
  position: absolute; right: 18px; bottom: 80px; z-index: 10; padding: 8px 15px; border-radius: 999px;
  background: var(--grad); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 8px 22px var(--glow);
}

/* Composer */
.composer {
  position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 11px max(12px, env(safe-area-inset-right)) max(11px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(20px);
}
.composer textarea { resize: none; max-height: 120px; min-height: 44px; padding: 11px 14px; border-radius: 18px; }
#pick { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 15px; background: rgba(15, 23, 42, 0.06); color: var(--text); font-size: 22px; font-weight: 700; border: 1px solid var(--line); }
.rawBtn { height: 44px; padding: 0 11px; flex: 0 0 auto; border-radius: 15px; background: rgba(15, 23, 42, 0.06); color: var(--muted); font-size: 12px; font-weight: 800; border: 1px solid var(--line); }
.rawBtn.active { background: rgba(16, 185, 129, 0.15); color: #047857; border-color: rgba(16, 185, 129, 0.35); }
#send { height: 44px; flex: 0 0 auto; border-radius: 15px; padding: 0 18px; background: var(--grad); color: white; font-weight: 800; box-shadow: 0 6px 18px -4px var(--glow); }

/* Drawers */
.drawerShade { position: fixed; inset: 0; z-index: 20; background: rgba(15, 23, 42, 0.34); backdrop-filter: blur(6px); }
.drawer {
  position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(480px, 100%); max-height: 88dvh; overflow: auto;
  padding: 12px 20px max(20px, env(safe-area-inset-bottom));
  border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: rgba(255, 255, 255, 0.97); box-shadow: 0 -24px 70px rgba(15, 23, 42, 0.2);
}
.drawerHandle { width: 44px; height: 5px; border-radius: 999px; margin: 0 auto 14px; background: rgba(100, 116, 139, 0.28); }
.drawerHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.drawerHead strong { font-size: 18px; font-weight: 800; color: var(--text); }
.closeDrawer { width: 34px; height: 34px; border-radius: 11px; background: rgba(15, 23, 42, 0.06); color: var(--text); font-size: 20px; }
.full { width: 100%; margin-top: 14px; }
.drawerTip { margin-top: 12px; color: var(--muted); font-size: 12.5px; }
.recentItem {
  width: 100%; margin: 8px 0 0; padding: 13px 14px; border-radius: 16px;
  background: #f8fafc; border: 1px solid var(--line); color: var(--text);
  text-align: left; font-weight: 750; font-size: 13px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.infoList { display: grid; gap: 10px; margin: 12px 0; }
.infoList div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; }
.infoList span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.infoList strong { display: block; color: #0369a1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.recoveryBox { padding: 13px; border: 1px solid var(--line); border-radius: 16px; background: #f8fafc; margin: 10px 0; }
.recoveryTitle { font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.recoveryRow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dangerSoft { padding: 13px 16px; border-radius: 16px; background: rgba(225, 29, 72, 0.08); border: 1px solid rgba(225, 29, 72, 0.2); color: #be123c; font-weight: 800; }

.qrWrap { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 10px 0 16px; }
.qrBox { padding: 14px; border-radius: 22px; background: #ffffff; border: 1px solid var(--line); box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1); line-height: 0; }
.shareMeta { text-align: center; }
.shareMeta strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; letter-spacing: 3px; color: #0284c7; }
.shareActions { display: grid; gap: 8px; }

.imgModal { position: fixed; inset: 0; z-index: 60; background: rgba(2, 6, 23, 0.9); backdrop-filter: blur(10px); display: flex; flex-direction: column; padding: 16px; }
.imgModalBar { display: flex; justify-content: space-between; align-items: center; color: #f8fafc; margin-bottom: 12px; gap: 10px; }
.imgModalBar span { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imgModal img { max-width: 100%; max-height: calc(100dvh - 80px); object-fit: contain; margin: auto; border-radius: 12px; }

.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; z-index: 90;
  padding: 10px 18px; border-radius: 999px; background: rgba(15, 23, 42, 0.94); color: #fff;
  font-size: 13px; font-weight: 650; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.32); transition: all .2s; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes msgIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

@media (max-width: 640px) {
  .app { padding: 0; }
  .home { width: 100%; min-height: 100dvh; border: 0; border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
  .chat { border: 0; border-radius: 0; height: 100dvh; max-height: none; }
  .msg { max-width: 88%; }
  .bigCode { font-size: 42px; letter-spacing: 5px; }
}

/* Dark Theme */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b16;
  --panel: rgba(15, 23, 42, 0.84);
  --panel-solid: #0f172a;
  --panel2: #1e293b;
  --muted: #94a3b8;
  --text: #f1f5f9;
  --line: rgba(148, 163, 184, 0.16);
  --shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6), 0 4px 16px -4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 75% 50% at 12% 0%, rgba(14, 165, 233, 0.18), transparent 58%),
    radial-gradient(ellipse 65% 45% at 88% 4%, rgba(139, 92, 246, 0.18), transparent 58%),
    linear-gradient(180deg, #070b16, #0d152a 58%, #070b16);
}
:root[data-theme="dark"] h1 {
  background: linear-gradient(125deg, #ffffff 30%, #38bdf8 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
:root[data-theme="dark"] .brandPill { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.28); color: #38bdf8; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .chat, :root[data-theme="dark"] .drawer, :root[data-theme="dark"] .topbar, :root[data-theme="dark"] .composer, :root[data-theme="dark"] .searchBar { background: rgba(15, 23, 42, 0.9); }
:root[data-theme="dark"] .soft, :root[data-theme="dark"] .ghost, :root[data-theme="dark"] .iconBtn, :root[data-theme="dark"] input, :root[data-theme="dark"] textarea, :root[data-theme="dark"] select, :root[data-theme="dark"] .recentItem, :root[data-theme="dark"] .infoList div, :root[data-theme="dark"] .recoveryBox, :root[data-theme="dark"] .msg.other .fileCard { background: rgba(30, 41, 59, 0.85); color: var(--text); }
:root[data-theme="dark"] .roomCard {
  background: radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.25), transparent 45%), linear-gradient(135deg, #0c4a6e, #1e1b4b 62%, #2e1065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 36px -10px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .roomPassRow input { background: rgba(15, 23, 42, 0.78); }
:root[data-theme="dark"] .roomCardRow span { color: #cbd5e1; }
:root[data-theme="dark"] .bigCode, :root[data-theme="dark"] .infoList strong, :root[data-theme="dark"] .shareMeta strong { color: #7dd3fc; }
:root[data-theme="dark"] .msg.mine { background: linear-gradient(135deg, #0284c7, #4f46e5); color: #ffffff; }
:root[data-theme="dark"] .msg.other { background: rgba(30, 41, 59, 0.92); border-color: rgba(148, 163, 184, 0.16); color: #f1f5f9; }
:root[data-theme="dark"] .msg.other .meta { color: #94a3b8; }
:root[data-theme="dark"] .msg.locked { background: rgba(120, 53, 15, 0.45); color: #fde68a; }
:root[data-theme="dark"] .messages {
  background-color: rgba(7, 11, 22, 0.48);
  background-image: radial-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px);
}
:root[data-theme="dark"] .deviceMini { background: rgba(30, 41, 59, 0.65); }
:root[data-theme="dark"] .field { color: #cbd5e1; }
:root[data-theme="dark"] .msg.other .md pre { background: rgba(15, 23, 42, 0.65); border-color: rgba(148, 163, 184, 0.16); }
:root[data-theme="dark"] #pick, :root[data-theme="dark"] .rawBtn { background: rgba(148, 163, 184, 0.14); color: #f1f5f9; }
:root[data-theme="dark"] .keyPromptBar { background: rgba(120, 53, 15, 0.45); color: #fde68a; }
:root[data-theme="dark"] .msg.other .copyMsg, :root[data-theme="dark"] .msg.other .miniBtn, :root[data-theme="dark"] .msg.other .codeCopyBtn { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
:root[data-theme="dark"] .iconBtn.accent { color: #ffffff; }
