@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --navy-950:#05070f;
  --navy-900:#080d1a;
  --navy-800:#0b1226;
  --navy-700:#101a34;
  --navy-600:#16223f;
  --line:#1c2740;

  --blue-500:#2f7bff;
  --blue-600:#1f63e6;
  --blue-400:#5c98ff;
  --cyan-300:#5cc8ff;

  --text-hi:#eaf1ff;
  --text-mid:#aeb9d4;
  --text-low:#6c7796;

  --vynix-a:#8b5cf6;
  --vynix-b:#22d3ee;

  --danger:#ff5c72;
  --online:#33e08a;

  --radius-sm:8px;
  --radius-md:14px;
  --radius-lg:22px;

  --shadow-lift: 0 20px 60px -20px rgba(0,0,0,0.65);
  --shadow-soft: 0 8px 24px -8px rgba(0,0,0,0.5);

  --font-display:'Sora', sans-serif;
  --font-body:'Inter', sans-serif;
  --font-mono:'JetBrains Mono', monospace;
}

html[data-theme="light"]{
  --navy-950:#f4f6fb;
  --navy-900:#ffffff;
  --navy-800:#f0f2f9;
  --navy-700:#e7eaf4;
  --navy-600:#d7dcec;
  --line:#e2e6f2;

  --text-hi:#141a2e;
  --text-mid:#525d80;
  --text-low:#8791ac;

  --shadow-lift: 0 20px 60px -20px rgba(20,26,46,.16);
  --shadow-soft: 0 8px 24px -8px rgba(20,26,46,.10);
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; overscroll-behavior:none; }
body.chat-body{ overflow:hidden; height:100%; }
body{
  margin:0;
  background: radial-gradient(120% 120% at 15% 0%, #0c1530 0%, var(--navy-950) 55%) fixed;
  color:var(--text-hi);
  font-family:var(--font-body);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  transition: background-color .2s ease, color .2s ease;
}
html[data-theme="light"] body{
  background: radial-gradient(120% 120% at 15% 0%, #eef1fb 0%, var(--navy-950) 55%) fixed;
}

a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }
img{ display:block; max-width:100%; }

::selection{ background:var(--blue-600); color:#fff; }

:focus-visible{
  outline:2px solid var(--cyan-300);
  outline-offset:2px;
  border-radius:6px;
}

::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{ background:var(--navy-600); border-radius:8px; }
::-webkit-scrollbar-thumb:hover{ background:var(--line); }

.eyebrow{
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--blue-400);
}

#boot-splash{
  position:fixed; inset:0; z-index:9999;
  background:#000;
  display:flex; align-items:center; justify-content:center;
  flex-direction:column;
  animation: splash-out .5s ease forwards;
  animation-delay: 1.6s;
}
#boot-splash .boot-mark{
  width:min(46vw, 300px);
  opacity:0;
  transform: scale(.92);
  animation: mark-in .55s cubic-bezier(.2,.9,.25,1) forwards, mark-hold-out .5s ease forwards;
  animation-delay: .05s, 1.35s;
}
#boot-splash .boot-caption{
  margin-top:18px;
  font-family:var(--font-mono);
  font-size:11px;
  letter-spacing:.32em;
  text-transform:uppercase;
  color:#5b6d95;
  opacity:0;
  animation: caption-in .5s ease forwards, mark-hold-out .5s ease forwards;
  animation-delay:.3s, 1.35s;
}
@keyframes mark-in{
  to{ opacity:1; transform:scale(1); }
}
@keyframes caption-in{
  to{ opacity:1; }
}
@keyframes mark-hold-out{
  to{ opacity:0; transform:scale(1.03); }
}
@keyframes splash-out{
  to{ opacity:0; visibility:hidden; pointer-events:none; }
}
body.boot-lock{ overflow:hidden; height:100%; }

@media (prefers-reduced-motion: reduce){
  #boot-splash, #boot-splash .boot-mark, #boot-splash .boot-caption{ animation-duration:.01s !important; animation-delay:0s !important; }
}

.spoke-field{
  position:absolute; inset:0;
  pointer-events:none;
  overflow:hidden;
  z-index:0;
}
.spoke-field svg{
  position:absolute;
  top:50%; left:50%;
  width:1400px; height:1400px;
  transform:translate(-50%,-50%);
  opacity:.08;
  animation: spoke-spin 140s linear infinite;
}
@keyframes spoke-spin{
  from{ transform:translate(-50%,-50%) rotate(0deg); }
  to{ transform:translate(-50%,-50%) rotate(360deg); }
}

.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px;
  padding:13px 22px;
  border-radius:999px;
  border:1px solid transparent;
  font-family:var(--font-display);
  font-weight:600;
  font-size:14.5px;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.btn:active{ transform:scale(.97); }
.btn-primary{
  background:linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color:#fff;
  box-shadow:0 10px 30px -8px rgba(47,123,255,.55);
}
.btn-primary:hover{ box-shadow:0 14px 36px -6px rgba(47,123,255,.7); }
.btn-ghost{
  background:transparent;
  border-color:var(--line);
  color:var(--text-mid);
}
.btn-ghost:hover{ border-color:var(--blue-400); color:var(--text-hi); }
.btn-block{ width:100%; }
.btn[disabled]{ opacity:.55; cursor:not-allowed; }

.field{ margin-bottom:16px; text-align:left; }
.field label{
  display:block;
  font-size:12.5px;
  color:var(--text-low);
  margin-bottom:7px;
  font-weight:600;
  letter-spacing:.02em;
}
.field input{
  width:100%;
  padding:13px 14px;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:var(--radius-sm);
  color:var(--text-hi);
  font-size:14.5px;
  font-family:var(--font-body);
  transition:border-color .15s ease, background .15s ease;
}
.field input::placeholder{ color:var(--text-low); }
.field input:focus{
  border-color:var(--blue-500);
  background:#0d1730;
  outline:none;
}
.field-error{
  font-size:12px; color:var(--danger);
  margin-top:6px; min-height:14px;
}

.auth-shell{
  position:relative;
  min-height:100vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.brand-row{
  position:fixed;
  top:26px; left:32px;
  display:flex; align-items:center; gap:10px;
  z-index:2;
}
.brand-row img{ width:30px; height:30px; }
.brand-row span{
  font-family:var(--font-display);
  font-weight:700;
  font-size:18px;
  letter-spacing:-.01em;
}

.auth-card{
  position:relative;
  z-index:1;
  width:100%;
  max-width:396px;
  background:linear-gradient(180deg, rgba(16,26,52,.85), rgba(8,13,26,.85));
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  padding:38px 34px 30px;
  backdrop-filter:blur(18px);
  box-shadow:var(--shadow-lift);
  text-align:center;
}
.auth-card .mark{
  width:52px; height:52px;
  margin:0 auto 18px;
}
.auth-card h1{
  font-family:var(--font-display);
  font-size:24px;
  margin:0 0 6px;
  letter-spacing:-.01em;
}
.auth-card p.sub{
  color:var(--text-mid);
  font-size:14px;
  margin:0 0 26px;
}
.auth-tabs{
  display:flex;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:999px;
  padding:4px;
  margin-bottom:26px;
}
.auth-tabs button{
  flex:1;
  border:none;
  background:transparent;
  color:var(--text-low);
  padding:9px 0;
  border-radius:999px;
  font-family:var(--font-display);
  font-weight:600;
  font-size:13.5px;
  cursor:pointer;
  transition:all .2s ease;
}
.auth-tabs button.active{
  background:linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color:#fff;
}
.auth-panel{ display:none; }
.auth-panel.active{ display:block; }

.google-btn{
  width:100%;
  display:flex; align-items:center; justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:999px;
  border:1px solid #e3e6ec;
  background:#fff;
  color:#1f1f1f;
  font-family:var(--font-display);
  font-weight:600;
  font-size:14px;
  cursor:pointer;
  transition:box-shadow .15s ease, transform .15s ease, background .15s ease;
  margin-bottom:18px;
}
.google-btn:hover{ box-shadow:0 8px 20px -6px rgba(0,0,0,.35); background:#fafafa; }
.google-btn:active{ transform:scale(.98); }
.google-btn[disabled]{ opacity:.6; cursor:not-allowed; }
.google-btn svg{ flex-shrink:0; }

.auth-divider{
  display:flex; align-items:center; gap:12px;
  margin-bottom:18px;
  color:var(--text-low);
  font-size:12px;
}
.auth-divider::before, .auth-divider::after{
  content:'';
  flex:1;
  height:1px;
  background:var(--line);
}

.spin-dark{
  width:16px; height:16px; border-radius:50%;
  border:2px solid rgba(0,0,0,.2); border-top-color:#1f1f1f;
  display:inline-block;
  animation: rot .7s linear infinite;
}
.auth-foot-link{
  margin-top:18px;
  font-size:13px;
  color:var(--text-low);
}
.auth-foot-link a{ color:var(--blue-400); font-weight:600; }

.site-footer{
  position:fixed;
  bottom:18px; left:0; right:0;
  display:flex; align-items:center; justify-content:center;
  gap:9px;
  z-index:2;
  font-size:11.5px;
  color:var(--text-low);
  font-family:var(--font-mono);
  letter-spacing:.04em;
}
.site-footer img{ width:16px; height:16px; opacity:.9; }
.site-footer .vx{
  background:linear-gradient(135deg, var(--vynix-a), var(--vynix-b));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  font-weight:600;
}

.app-shell{
  position:relative;
  z-index:0;
  height:100vh;
  height:100dvh;
  height:var(--app-height, 100dvh);
  display:grid;
  grid-template-columns:76px 320px 1fr;
  overflow:hidden;
  min-height:0;
}
@media (max-width: 900px){
  .app-shell{ grid-template-columns: 64px 1fr; position:relative; }
  .thread-col{
    position:absolute; inset:0;
    z-index:5;
    transform:translateX(100%);
    transition:transform .32s cubic-bezier(.22,.9,.28,1);
  }
  .app-shell.thread-open .thread-col{ transform:translateX(0); }
}

.rail-col{
  min-height:0;
  background:var(--navy-900);
  border-right:1px solid var(--line);
  display:flex; flex-direction:column; align-items:center;
  padding:18px 0;
}
.rail-logo{ width:34px; height:34px; margin-bottom:26px; }
.rail-nav{ display:flex; flex-direction:column; gap:6px; flex:1; }
.rail-btn{
  width:44px; height:44px;
  display:flex; align-items:center; justify-content:center;
  border-radius:12px;
  color:var(--text-low);
  cursor:pointer;
  border:1px solid transparent;
  background:transparent;
  transition:all .15s ease;
}
.rail-btn:hover{ background:var(--navy-800); color:var(--text-hi); }
.rail-btn.active{ background:var(--navy-800); color:var(--blue-400); border-color:var(--line); }
.rail-btn svg{ width:20px; height:20px; }
.rail-btn{ position:relative; }
.rail-badge{
  position:absolute; top:-2px; right:-2px;
  min-width:16px; height:16px; padding:0 4px;
  border-radius:999px;
  background:var(--danger); color:#fff;
  font-size:9.5px; font-weight:700; font-family:var(--font-mono);
  display:flex; align-items:center; justify-content:center;
  border:2px solid var(--navy-900);
}
.rail-avatar{
  width:38px; height:38px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--blue-500), var(--vynix-a));
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:700; font-size:14px;
  cursor:pointer;
  border:2px solid var(--navy-700);
  overflow:hidden;
}
.rail-avatar img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }

.list-col{
  min-height:0;
  background:var(--navy-950);
  border-right:1px solid var(--line);
  display:flex; flex-direction:column;
  min-width:0;
}
.list-head{
  padding:22px 20px 14px;
}
.list-head h2{
  font-family:var(--font-display); font-size:20px; margin:0 0 14px;
}
.search-box{
  position:relative;
}
.search-box input{
  width:100%;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px 10px 34px;
  color:var(--text-hi);
  font-size:13.5px;
}
.search-box svg{
  position:absolute; left:11px; top:50%; transform:translateY(-50%);
  width:14px; height:14px; color:var(--text-low);
}
.search-results{
  position:absolute;
  top:calc(100% + 8px); left:20px; right:20px;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:12px;
  box-shadow:var(--shadow-lift);
  max-height:280px; overflow-y:auto;
  z-index:5;
  display:none;
}
.search-results.show{ display:block; }
.search-row{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px;
  cursor:pointer;
}
.search-row:hover{ background:var(--navy-700); }

.convo-scroll{ flex:1; overflow-y:auto; padding:4px 10px 16px; min-height:0; }
.convo-item{
  display:flex; align-items:center; gap:12px;
  padding:11px 10px;
  border-radius:12px;
  cursor:pointer;
  margin-bottom:2px;
  transition:background .15s ease;
  position:relative;
}
.convo-item:hover{ background:var(--navy-800); }
.convo-item.active{ background:var(--navy-700); }
.avatar{
  width:44px; height:44px; border-radius:50%;
  background:linear-gradient(135deg, var(--blue-500), var(--vynix-a));
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-weight:700; font-size:15px;
  flex-shrink:0;
  position:relative;
  overflow:hidden;
}
.avatar-img{ width:100%; height:100%; object-fit:cover; border-radius:50%; }
.avatar .dot{
  position:absolute; right:-1px; bottom:-1px;
  width:11px; height:11px; border-radius:50%;
  background:var(--online);
  border:2px solid var(--navy-950);
}
.convo-meta{ min-width:0; flex:1; }
.convo-meta .row1{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.convo-meta .name{ font-weight:600; font-size:14.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.convo-meta .name .staff-tag{
  font-family:var(--font-mono);
  font-size:9px;
  letter-spacing:.06em;
  color:var(--vynix-b);
  border:1px solid rgba(34,211,238,.35);
  padding:1px 5px;
  border-radius:5px;
  margin-left:6px;
  vertical-align:middle;
}
.convo-meta .time{ font-size:11px; color:var(--text-low); font-family:var(--font-mono); flex-shrink:0; }
.convo-meta .preview{ font-size:12.5px; color:var(--text-mid); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
.unread-badge{
  min-width:19px; height:19px; padding:0 5px;
  border-radius:999px;
  background:var(--blue-500);
  color:#fff;
  font-size:10.5px; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0;
}
.empty-state{
  padding:40px 24px;
  text-align:center;
  color:var(--text-low);
  font-size:13.5px;
}

.thread-col{
  display:flex; flex-direction:column;
  min-width:0; min-height:0;
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(47,123,255,.06), transparent 60%),
    var(--navy-900);
}
.thread-head{
  position:absolute; top:0; left:0; right:0; z-index:3;
  display:flex; align-items:center; gap:12px;
  padding:16px 22px;
  border-bottom:1px solid var(--line);
  background:var(--navy-900);
}
.thread-head .back-btn{ display:none; }
@media (max-width:900px){ .thread-head .back-btn{ display:flex; } }
.thread-head .identity{ display:flex; align-items:center; gap:12px; cursor:pointer; min-width:0; }
.thread-head .name{ font-family:var(--font-display); font-weight:600; font-size:15.5px; }
.thread-head .status{ font-size:12px; color:var(--text-low); }
.thread-head .status.online{ color:var(--online); }
.thread-head .actions{ margin-left:auto; display:flex; gap:6px; }

#thread-active{ min-height:0; }
.thread-scroll{
  position:absolute; left:0; right:0;
  /* top/bottom are set in px by JS to match the measured header and
     bottom-bar heights — this is a hard pixel box, not flex math, so
     it can't be pushed around by anything else on the page. */
  top:0; bottom:0;
  overflow-y:auto; overflow-x:hidden;
  padding:22px;
}
.day-divider{
  text-align:center; margin:20px 0 16px;
  font-family:var(--font-mono);
  font-size:10.5px; letter-spacing:.1em; text-transform:uppercase;
  color:var(--text-low);
}
.msg-row{ display:flex; margin-bottom:4px; max-width:100%; min-width:0; }
.msg-row.me{ justify-content:flex-end; }
.msg-bubble{
  max-width:56%;
  padding:11px 15px;
  border-radius:16px;
  font-size:14px;
  line-height:1.5;
  position:relative;
  word-wrap:break-word;
  overflow-wrap:anywhere;
  word-break:break-word;
}
@media (max-width: 900px){ .msg-bubble{ max-width:80%; } }
.msg-row.them .msg-bubble{
  background:var(--navy-700);
  border-bottom-left-radius:5px;
  color:var(--text-hi);
}
.msg-row.me .msg-bubble{
  background:linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color:#fff;
  border-bottom-right-radius:5px;
}
.msg-time{
  font-family:var(--font-mono);
  font-size:10px;
  opacity:.65;
  margin-top:5px;
  display:block;
}
.msg-row.system{ align-items:center; margin:14px 0; }
.msg-row.system .msg-bubble{
  background:transparent; border:1px dashed var(--line);
  color:var(--text-low); font-size:12px;
}

/* ---------- Message actions (edit / delete / reply) ---------- */
.msg-row{ position:relative; }
.msg-row-inner{ display:flex; align-items:center; gap:6px; max-width:100%; }
.msg-row.me .msg-row-inner{ justify-content:flex-end; }
.msg-row.them .msg-row-inner{ justify-content:flex-start; }

.msg-actions{
  display:flex; align-items:center; gap:2px;
  opacity:0; transition:opacity .12s;
  flex:none;
}
.msg-row:hover .msg-actions,
.msg-row.menu-open .msg-actions{ opacity:1; }
@media (hover: none){ .msg-actions{ opacity:1; } } /* always reachable on touch */

.msg-action-btn{
  width:26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:none; background:transparent; color:var(--text-low); cursor:pointer;
}
.msg-action-btn:hover{ background:var(--navy-700); color:var(--text-hi); }
.msg-action-btn svg{ width:14px; height:14px; }

.msg-menu{
  position:fixed; z-index:60;
  min-width:150px; padding:6px;
  background:var(--navy-800); border:1px solid var(--line); border-radius:12px;
  box-shadow:var(--shadow-lift, 0 20px 50px -18px rgba(0,0,0,.6));
}
.msg-menu button{
  display:flex; align-items:center; gap:10px; width:100%;
  padding:9px 10px; border-radius:8px; border:none; background:transparent;
  color:var(--text-hi); font-size:13px; font-family:var(--font-body); text-align:left; cursor:pointer;
}
.msg-menu button:hover{ background:var(--navy-700); }
.msg-menu button.danger{ color:#ff6b6b; }
.msg-menu button svg{ width:15px; height:15px; flex:none; opacity:.8; }

.msg-bubble.editing{ padding:8px 10px; }
.msg-edit-input{
  width:100%; min-width:180px; resize:none; border:none; outline:none;
  background:rgba(255,255,255,0.08); border-radius:8px; padding:7px 9px;
  color:inherit; font:inherit; line-height:1.4;
}
.msg-row.them .msg-edit-input{ background:var(--navy-800); }
.msg-edit-hint{ font-size:10.5px; opacity:.65; margin-top:5px; }
.msg-edit-actions{ display:flex; gap:8px; margin-top:6px; }
.msg-edit-actions button{
  font-family:var(--font-body); font-size:11.5px; font-weight:600;
  padding:4px 10px; border-radius:7px; border:none; cursor:pointer;
}
.msg-edit-save{ background:#fff; color:var(--navy-900); }
.msg-edit-cancel{ background:transparent; color:inherit; border:1px solid rgba(255,255,255,0.3) !important; }

.msg-edited-tag{ opacity:.6; font-size:10px; margin-left:5px; }
.msg-bubble.deleted{ font-style:italic; opacity:.6; }
.msg-bubble.deleted .msg-reply-quote{ display:none; }

.msg-reply-quote{
  display:block; margin-bottom:6px; padding:6px 9px;
  border-left:2.5px solid rgba(255,255,255,0.55);
  border-radius:6px; background:rgba(255,255,255,0.08);
  font-size:12px; line-height:1.35; cursor:pointer;
}
.msg-row.them .msg-reply-quote{ border-left-color:var(--blue-400); background:rgba(255,255,255,0.04); }
.msg-reply-quote .rq-name{ font-weight:600; color:var(--cyan-300); display:block; margin-bottom:1px; }
.msg-reply-quote .rq-text{ opacity:.85; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:34ch; }

.msg-row.flash .msg-bubble{ animation:msgFlash 1.1s ease; }
@keyframes msgFlash{
  0%{ box-shadow:0 0 0 3px var(--cyan-300); } 100%{ box-shadow:0 0 0 0 transparent; }
}

/* ---------- Reply preview bar (composer) ---------- */
.reply-preview{
  display:flex; align-items:center; gap:10px;
  padding:9px 22px; border-top:1px solid var(--line);
  background:var(--navy-800);
}
.reply-preview.hidden{ display:none; }
.reply-preview-bar{ width:3px; align-self:stretch; border-radius:2px; background:var(--blue-400); flex:none; }
.reply-preview-body{ flex:1; min-width:0; }
.reply-preview-label{ font-size:11px; color:var(--cyan-300); font-weight:600; }
.reply-preview-text{ font-size:12.5px; color:var(--text-mid); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.reply-preview-close{
  flex:none; width:26px; height:26px; border-radius:50%; border:none;
  background:transparent; color:var(--text-low); display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.reply-preview-close:hover{ background:var(--navy-700); color:var(--text-hi); }
.reply-preview-close svg{ width:13px; height:13px; }

/* ---------- Calls ---------- */
.call-start-btn{ margin-left:auto; }

.call-incoming{
  position:fixed; top:16px; left:50%; transform:translateX(-50%);
  z-index:200; width:min(360px, 92vw);
  display:flex; align-items:center; gap:12px; padding:14px;
  background:var(--navy-800); border:1px solid var(--line); border-radius:16px;
  box-shadow:0 20px 50px -18px rgba(0,0,0,.7);
  animation:callSlideIn .25s ease;
}
.call-incoming.hidden{ display:none; }
@keyframes callSlideIn{ from{ opacity:0; transform:translate(-50%,-14px); } to{ opacity:1; transform:translate(-50%,0); } }
.call-incoming-avatar{ width:46px; height:46px; border-radius:50%; overflow:hidden; flex:none; }
.call-incoming-avatar img{ width:100%; height:100%; object-fit:cover; }
.call-incoming-info{ flex:1; min-width:0; }
.call-incoming-name{ font-weight:600; font-size:14px; color:var(--text-hi); }
.call-incoming-sub{ font-size:12px; color:var(--cyan-300); margin-top:2px; }
.call-incoming-actions{ display:flex; gap:8px; flex:none; }
.call-btn{
  width:38px; height:38px; border-radius:50%; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:#fff;
}
.call-btn svg{ width:17px; height:17px; }
.call-btn.accept{ background:#2fbf6c; }
.call-btn.decline{ background:#e5484d; }

.call-screen{
  position:fixed; inset:0; z-index:250;
  background:radial-gradient(120% 120% at 50% 0%, #0c1530 0%, var(--navy-950) 60%);
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px;
}
.call-screen.hidden{ display:none; }
.call-screen-avatar-wrap{ position:relative; width:104px; height:104px; display:flex; align-items:center; justify-content:center; }
.call-avatar-ring{
  position:absolute; inset:-14px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(92,152,255,0.35) 0%, rgba(92,152,255,0.12) 55%, transparent 75%);
  transform:scale(0.72);
  opacity:0;
  transition:transform 90ms ease-out, opacity 200ms ease;
  pointer-events:none;
}
.call-avatar-ring.speaking{ opacity:1; }
.call-screen-avatar{
  position:relative; z-index:1;
  width:104px; height:104px; border-radius:50%; overflow:hidden;
  display:flex; align-items:center; justify-content:center;
  font-family:var(--font-display); font-size:32px; font-weight:700;
  background:var(--navy-700); color:var(--text-hi);
  box-shadow:0 0 0 6px rgba(92,152,255,0.12);
}
.call-screen-avatar img{ width:100%; height:100%; object-fit:cover; }
.call-screen-name{ margin-top:20px; font-family:var(--font-display); font-size:1.3rem; font-weight:700; color:var(--text-hi); }
.call-screen-status{ margin-top:6px; font-size:13px; color:var(--text-mid); font-family:var(--font-mono); }
.call-screen-timer{ margin-top:4px; font-size:13px; color:var(--cyan-300); font-family:var(--font-mono); letter-spacing:.04em; }
.call-screen-timer.hidden{ display:none; }
.call-screen-actions{ display:flex; align-items:center; gap:18px; margin-top:48px; }
.call-round-btn{
  position:relative;
  width:56px; height:56px; border-radius:50%; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:var(--navy-700); color:var(--text-hi);
}
.call-round-btn svg{ width:22px; height:22px; }
.call-round-btn.active{ background:var(--blue-500); color:#fff; }
.call-round-btn.hangup{ background:#e5484d; color:#fff; }
.call-round-btn.hidden{ display:none; }
.mic-select-chip{
  position:absolute; bottom:-2px; right:-2px;
  width:15px; height:15px; border-radius:50%;
  background:var(--navy-900); color:var(--text-low);
  font-size:10px; line-height:15px; text-align:center;
}

.mic-menu{
  position:fixed; z-index:260;
  min-width:220px; max-width:280px; padding:6px;
  background:var(--navy-800); border:1px solid var(--line); border-radius:12px;
  box-shadow:0 20px 50px -18px rgba(0,0,0,.7);
}
.mic-menu.hidden{ display:none; }
.mic-menu-label{ padding:8px 10px 4px; font-family:var(--font-mono); font-size:10px; letter-spacing:.08em; text-transform:uppercase; color:var(--text-low); }
.mic-menu button{
  display:flex; align-items:center; gap:9px; width:100%;
  padding:9px 10px; border-radius:8px; border:none; background:transparent;
  color:var(--text-hi); font-size:13px; font-family:var(--font-body); text-align:left; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.mic-menu button:hover{ background:var(--navy-700); }
.mic-menu button.active{ color:var(--cyan-300); }
.mic-menu button.active::before{ content:'✓ '; }

.thread-bottom-bar{
  position:absolute; left:0; right:0; bottom:0; z-index:3;
  background:var(--navy-900);
}

.composer{
  border-top:1px solid var(--line);
  padding:16px 22px 20px;
}
.composer-row{
  display:flex; align-items:flex-end; gap:10px;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:16px;
  padding:8px 8px 8px 16px;
}
.composer-row textarea{
  flex:1; resize:none; border:none; outline:none;
  background:transparent; color:var(--text-hi);
  font-family:var(--font-body); font-size:14px; line-height:1.5;
  max-height:120px; padding:8px 0;
}
.composer-row textarea::placeholder{ color:var(--text-low); }
.send-btn{
  width:40px; height:40px; border-radius:12px; flex-shrink:0;
  background:linear-gradient(135deg, var(--blue-500), var(--blue-600));
  color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:transform .12s ease;
}
.send-btn:hover{ transform:scale(1.05); }
.send-btn:disabled{ opacity:.4; cursor:default; transform:none; }

.thread-empty{
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px; color:var(--text-low); text-align:center; padding:40px;
}
.thread-empty .mark{ width:64px; height:64px; opacity:.5; }
.thread-empty h3{ font-family:var(--font-display); color:var(--text-mid); font-size:16px; margin:0; }

.staff-pill{
  font-family:var(--font-mono);
  font-size:10px; letter-spacing:.08em; text-transform:uppercase;
  padding:2px 8px; border-radius:999px;
  border:1px solid rgba(34,211,238,.35);
  color:var(--vynix-b);
  margin-left:8px;
}

.toast{
  position:fixed; bottom:24px; left:50%; transform:translateX(-50%) translateY(20px);
  background:var(--navy-700); border:1px solid var(--line);
  padding:12px 20px; border-radius:12px;
  font-size:13px; color:var(--text-hi);
  box-shadow:var(--shadow-lift);
  opacity:0; pointer-events:none;
  transition:all .25s ease;
  z-index:999;
}
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }

.hidden{ display:none !important; }
.spin{
  width:18px; height:18px; border-radius:50%;
  border:2px solid rgba(255,255,255,.3); border-top-color:#fff;
  animation: rot .7s linear infinite;
}
@keyframes rot{ to{ transform:rotate(360deg); } }

/* ---------- Settings modal ---------- */
.modal-overlay{
  position:fixed; inset:0; z-index:300;
  background:rgba(4,6,12,.6);
  backdrop-filter:blur(6px);
  display:flex; align-items:center; justify-content:center;
  padding:20px;
  opacity:0; pointer-events:none;
  transition:opacity .18s ease;
}
.modal-overlay.show{ opacity:1; pointer-events:auto; }

.settings-modal{
  position:relative;
  width:min(680px, 100%);
  max-height:min(600px, 86vh);
  background:var(--navy-900);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-lift);
  display:flex;
  overflow:hidden;
  transform:scale(.97) translateY(6px);
  opacity:0;
  transition:transform .18s cubic-bezier(.2,.9,.25,1), opacity .18s ease;
}
.modal-overlay.show .settings-modal{ transform:scale(1) translateY(0); opacity:1; }

.settings-side{
  width:188px; flex-shrink:0;
  background:var(--navy-950);
  border-right:1px solid var(--line);
  padding:20px 10px;
  overflow-y:auto;
}
.settings-side h3{
  font-family:var(--font-display); font-size:16px; font-weight:700;
  margin:2px 10px 16px;
}
.settings-tab{
  display:flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:10px;
  color:var(--text-mid); font-size:13.5px; font-weight:600;
  cursor:pointer; margin-bottom:2px;
  background:transparent; border:none; width:100%; text-align:left;
  font-family:inherit;
  transition:background .15s ease, color .15s ease;
}
.settings-tab svg{ width:16px; height:16px; flex-shrink:0; }
.settings-tab:hover{ background:var(--navy-800); color:var(--text-hi); }
.settings-tab.active{ background:var(--navy-800); color:var(--blue-400); }

.settings-main{ flex:1; padding:26px 30px; overflow-y:auto; min-width:0; }
.settings-main h4{
  font-family:var(--font-mono); font-size:11px; font-weight:600;
  text-transform:uppercase; letter-spacing:.12em; color:var(--text-low);
  margin:0 0 16px;
}
.settings-panel{ display:none; }
.settings-panel.active{ display:block; animation:panel-in .15s ease; }
@keyframes panel-in{ from{ opacity:0; transform:translateY(4px); } to{ opacity:1; transform:translateY(0); } }

.settings-row{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:15px 0; border-bottom:1px solid var(--line);
}
.settings-row:last-child{ border-bottom:none; }
.settings-row-label{ font-size:14px; font-weight:600; }
.settings-row-desc{ font-size:12px; color:var(--text-low); margin-top:3px; line-height:1.4; }

.theme-options{ display:flex; gap:10px; margin-bottom:8px; }
.theme-opt{
  flex:1; border:1.5px solid var(--line); border-radius:12px;
  padding:10px; cursor:pointer; text-align:center;
  background:var(--navy-800);
  transition:border-color .15s ease, box-shadow .15s ease;
}
.theme-opt.active{ border-color:var(--blue-500); box-shadow:0 0 0 1px var(--blue-500); }
.theme-opt-swatch{
  height:42px; border-radius:8px; margin-bottom:9px;
  border:1px solid rgba(255,255,255,.08);
}
.theme-opt-swatch.sw-dark{ background:linear-gradient(135deg,#0b1226,#05070f); }
.theme-opt-swatch.sw-light{ background:linear-gradient(135deg,#ffffff,#e7eaf4); }
.theme-opt-swatch.sw-system{ background:linear-gradient(135deg,#0b1226 50%,#ffffff 50%); }
.theme-opt span{ font-size:12.5px; font-weight:600; color:var(--text-mid); }
.theme-opt.active span{ color:var(--text-hi); }

.toggle{ position:relative; width:42px; height:24px; flex-shrink:0; display:inline-block; }
.toggle input{ opacity:0; width:0; height:0; position:absolute; }
.toggle-track{
  position:absolute; inset:0; background:var(--navy-600);
  border-radius:999px; cursor:pointer; transition:background .18s ease;
}
.toggle-track::before{
  content:""; position:absolute; width:18px; height:18px; left:3px; top:3px;
  background:#fff; border-radius:50%; box-shadow:0 2px 4px rgba(0,0,0,.25);
  transition:transform .18s ease;
}
.toggle input:checked + .toggle-track{ background:var(--blue-500); }
.toggle input:checked + .toggle-track::before{ transform:translateX(18px); }

.modal-close-btn{
  position:absolute; top:16px; right:16px;
  width:32px; height:32px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:var(--text-low); background:transparent; border:none; cursor:pointer;
  transition:background .15s ease, color .15s ease;
  z-index:2;
}
.modal-close-btn:hover{ background:var(--navy-800); color:var(--text-hi); }
.modal-close-btn svg{ width:17px; height:17px; }

.about-block{ font-size:13px; color:var(--text-mid); line-height:1.7; }
.about-block .eyebrow{ display:block; margin-bottom:6px; }

@media (max-width: 640px){
  .settings-modal{ flex-direction:column; max-height:90vh; }
  .settings-side{
    width:100%; display:flex; flex-direction:row; gap:4px;
    border-right:none; border-bottom:1px solid var(--line);
    padding:12px 14px; overflow-x:auto;
  }
  .settings-side h3{ display:none; }
  .settings-tab{ white-space:nowrap; width:auto; }
  .settings-main{ padding:22px 20px; }
}

/* ---------- Profile modal ---------- */
.profile-modal{ flex-direction:column; width:380px; max-width:92vw; max-height:min(600px,88vh); }
.profile-modal-body{ padding:36px 28px 26px; overflow-y:auto; }

.profile-avatar-wrap{ position:relative; width:96px; height:96px; margin:0 auto 16px; }
.profile-avatar-wrap .avatar{ width:96px; height:96px; font-size:30px; }
.profile-avatar-wrap.editable{ cursor:pointer; }
.avatar-edit-btn{
  position:absolute; right:-3px; bottom:-3px;
  width:32px; height:32px; border-radius:50%;
  background:var(--blue-500); color:#fff;
  display:flex; align-items:center; justify-content:center;
  border:3px solid var(--navy-900); cursor:pointer;
  transition:transform .15s ease;
}
.avatar-edit-btn:hover{ transform:scale(1.08); }
.avatar-edit-btn svg{ width:14px; height:14px; }
.avatar-uploading{ opacity:.5; pointer-events:none; }

.profile-name{
  text-align:center; font-family:var(--font-display); font-size:19px; font-weight:700;
  margin:0 0 2px;
}
.profile-name-input{
  display:block; width:100%; text-align:center;
  font-family:var(--font-display); font-size:18px; font-weight:700;
  background:transparent; border:none; border-bottom:1.5px solid transparent;
  color:var(--text-hi); padding:2px 4px 4px; margin-bottom:2px;
  transition:border-color .15s ease;
}
.profile-name-input:focus{ outline:none; border-color:var(--blue-500); }
.profile-username{ text-align:center; color:var(--text-low); font-size:13px; margin-bottom:6px; }
.profile-status{ text-align:center; font-size:12px; color:var(--text-low); margin-bottom:20px; }
.profile-status.online{ color:var(--online); }
.profile-status::before{
  content:""; display:inline-block; width:7px; height:7px; border-radius:50%;
  background:currentColor; margin-right:6px; vertical-align:middle;
}

.profile-bio{ font-size:13.5px; color:var(--text-mid); line-height:1.6; text-align:center; padding:0 4px; white-space:pre-wrap; }
.profile-bio-input{
  width:100%; background:var(--navy-800); border:1px solid var(--line); border-radius:10px;
  padding:10px 12px; color:var(--text-hi); font-family:inherit; font-size:13.5px;
  resize:none; min-height:74px; line-height:1.5;
}
.profile-bio-input:focus{ outline:none; border-color:var(--blue-500); }
.profile-charcount{ text-align:right; font-size:11px; color:var(--text-low); margin-top:5px; }

.profile-actions{ display:flex; gap:10px; margin-top:22px; }
.profile-actions .btn{ flex:1; padding:11px; font-size:13.5px; }
.profile-signout{ margin-top:10px; }
.profile-signout .btn{ width:100%; color:var(--danger); }
.profile-signout .btn:hover{ border-color:var(--danger); }

/* ---------- Friends / requests ---------- */
.friend-subtabs{
  display:flex; gap:4px; padding:0 20px 12px;
}
.friend-subtab{
  display:flex; align-items:center; gap:7px;
  padding:8px 14px; border-radius:999px;
  background:transparent; border:1px solid var(--line);
  color:var(--text-mid); font-family:inherit; font-size:13px; font-weight:600;
  cursor:pointer; transition:all .15s ease;
}
.friend-subtab:hover{ color:var(--text-hi); border-color:var(--blue-400); }
.friend-subtab.active{ background:var(--navy-800); color:var(--blue-400); border-color:var(--blue-500); }
.subtab-badge{
  min-width:17px; height:17px; padding:0 5px;
  border-radius:999px;
  background:var(--danger); color:#fff;
  font-size:10px; font-weight:700; font-family:var(--font-mono);
  display:flex; align-items:center; justify-content:center;
}

.convo-item .row-actions{
  display:flex; gap:6px; flex-shrink:0;
}
.icon-btn{
  width:32px; height:32px; border-radius:10px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line); background:var(--navy-800);
  color:var(--text-mid); cursor:pointer;
  transition:all .15s ease;
}
.icon-btn svg{ width:15px; height:15px; }
.icon-btn:hover{ color:var(--text-hi); border-color:var(--blue-400); }
.icon-btn.accept{ color:var(--online); }
.icon-btn.accept:hover{ background:rgba(51,224,138,.12); border-color:var(--online); }
.icon-btn.decline{ color:var(--danger); }
.icon-btn.decline:hover{ background:rgba(255,92,114,.12); border-color:var(--danger); }

.pending-tag{
  font-family:var(--font-mono);
  font-size:9.5px; letter-spacing:.06em; text-transform:uppercase;
  color:var(--text-low);
  border:1px solid var(--line);
  padding:1px 6px; border-radius:5px;
  margin-left:6px; vertical-align:middle;
}

.request-banner{
  display:flex; align-items:center; justify-content:space-between; gap:14px;
  padding:14px 22px;
  background:var(--navy-800);
  border-top:1px solid var(--line);
  flex-shrink:0;
}
.request-banner-text{ font-size:13.5px; color:var(--text-mid); }
.request-banner-actions{ display:flex; gap:8px; flex-shrink:0; }
.btn-sm{ padding:9px 16px; font-size:13px; }

.pending-hint{
  padding:10px 22px;
  font-size:12px; color:var(--text-low); text-align:center;
  border-top:1px solid var(--line);
  flex-shrink:0;
}

/* ---------- Verified badge ---------- */
.verified-badge{
  width:15px; height:15px;
  display:inline-block;
  vertical-align:middle;
  margin-left:4px;
  margin-top:-2px;
  flex-shrink:0;
  object-fit:contain;
  transform:none;
  border-radius:0;
}
.profile-name .verified-badge, .profile-name-input + .verified-badge{ width:19px; height:19px; margin-top:-3px; }

/* ---------- Message status (sent / delivered / seen) ---------- */
.msg-status{
  text-align:right;
  font-size:11px;
  color:var(--text-low);
  margin-top:5px;
  padding-right:2px;
}

/* ---------- Typing indicator ---------- */
.typing-bubble{
  display:inline-flex; align-items:center; gap:4px;
  padding:13px 16px;
  border-radius:16px;
  border-bottom-left-radius:5px;
  background:var(--navy-700);
}
.typing-dot{
  width:6px; height:6px; border-radius:50%;
  background:var(--text-mid);
  animation:typing-bounce 1.2s infinite ease-in-out;
}
.typing-dot:nth-child(2){ animation-delay:.15s; }
.typing-dot:nth-child(3){ animation-delay:.3s; }
@keyframes typing-bounce{
  0%, 60%, 100%{ transform:translateY(0); opacity:.5; }
  30%{ transform:translateY(-4px); opacity:1; }
}

/* ---------- Reactions ---------- */
.msg-row{ flex-direction:column; }
.msg-row.me{ align-items:flex-end; }
.msg-row.them{ align-items:flex-start; }
.msg-reactions{
  display:flex; gap:4px; flex-wrap:wrap;
  margin-top:-8px;
  padding:0 6px;
  position:relative;
  z-index:2;
}
.msg-row.me .msg-reactions{ justify-content:flex-end; }
.reaction-chip{
  display:inline-flex; align-items:center; gap:3px;
  background:var(--navy-800); border:1.5px solid var(--navy-900);
  border-radius:999px;
  padding:2px 7px;
  font-size:12px; line-height:1.4;
  color:var(--text-mid);
  cursor:pointer;
  box-shadow:var(--shadow-soft);
  transition:transform .1s ease, border-color .15s ease;
}
.reaction-chip:hover{ transform:scale(1.06); }
.reaction-chip.mine{ border-color:var(--blue-500); color:var(--text-hi); }
.reaction-picker{
  position:fixed;
  display:flex; gap:2px;
  background:var(--navy-800);
  border:1px solid var(--line);
  border-radius:999px;
  padding:6px 8px;
  box-shadow:var(--shadow-lift);
  z-index:400;
  animation:panel-in .12s ease;
}
.reaction-picker button{
  background:none; border:none; cursor:pointer;
  font-size:21px; line-height:1;
  padding:4px 5px; border-radius:999px;
  transition:transform .12s ease, background .12s ease;
}
.reaction-picker button:hover{ transform:scale(1.28); }
.reaction-picker button.active{ background:var(--navy-700); }

@media (max-width: 900px){
  .msg-reactions{ margin-top:-6px; }
}

/* ---------- Standalone profile page ---------- */
.profile-page-body{ overflow-y:auto; }
.profile-page-shell{ min-height:100%; display:flex; flex-direction:column; }
.profile-page-head{
  display:flex; align-items:center; gap:12px;
  padding:14px 20px;
  border-bottom:1px solid var(--line);
  position:sticky; top:0;
  background:var(--navy-950);
  z-index:5;
}
.profile-page-back{ display:flex; }
.profile-page-title{ font-family:var(--font-display); font-weight:600; font-size:15.5px; }
.profile-page-main{
  flex:1;
  display:flex; align-items:flex-start; justify-content:center;
  padding:48px 20px;
}
.profile-page-card{
  width:min(420px, 100%);
  background:var(--navy-900);
  border:1px solid var(--line);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-soft);
  padding:40px 30px 32px;
  text-align:center;
}
.profile-page-card .profile-avatar-wrap{ margin:0 auto 18px; }
.profile-page-card .profile-name{ font-size:21px; }
.profile-page-card .profile-bio{ margin-top:4px; }
.profile-page-card .profile-actions{ margin-top:26px; }
.profile-page-card .profile-actions .btn{ width:100%; }

/* ================================================================
   Ambient Spoke Field — premium background, opt-out in Settings
   ================================================================ */
.app-shell .spoke-field{
  position:absolute; inset:0;
  z-index:-1;
  pointer-events:none;
  overflow:hidden;
  opacity:0;
  transition:opacity .6s ease;
}
html.spoke-field-on .app-shell .spoke-field{ opacity:1; }
.app-shell .spoke-field svg{
  position:absolute;
  top:50%; left:50%;
  width:1400px; height:1400px;
  transform:translate(-50%,-50%);
  opacity:.1;
  animation: spoke-spin 140s linear infinite;
}
@media (max-width:900px){
  .app-shell .spoke-field svg{ width:900px; height:900px; opacity:.13; }
}
.profile-page-body .spoke-field{
  z-index:-1;
  opacity:0;
  transition:opacity .6s ease;
}
html.spoke-field-on .profile-page-body .spoke-field{ opacity:1; }
.profile-page-body .spoke-field svg{
  position:absolute; top:50%; left:50%;
  width:1400px; height:1400px;
  transform:translate(-50%,-50%);
  opacity:.1;
  animation: spoke-spin 140s linear infinite;
}
html.spoke-field-on .profile-page-card{
  background:color-mix(in srgb, var(--navy-900) 78%, transparent);
  backdrop-filter:blur(28px) saturate(160%);
  -webkit-backdrop-filter:blur(28px) saturate(160%);
}

/* Frosted glass panels so the wheel glows through — this is the
   "premium" look: content floats over the ambient field instead of
   sitting on a flat opaque background. */
html.spoke-field-on .rail-col{
  background:color-mix(in srgb, var(--navy-900) 80%, transparent);
  backdrop-filter:blur(28px) saturate(160%);
  -webkit-backdrop-filter:blur(28px) saturate(160%);
}
html.spoke-field-on .list-col{
  background:color-mix(in srgb, var(--navy-950) 78%, transparent);
  backdrop-filter:blur(28px) saturate(160%);
  -webkit-backdrop-filter:blur(28px) saturate(160%);
}
html.spoke-field-on .thread-col{
  background:
    radial-gradient(60% 40% at 100% 0%, rgba(47,123,255,.09), transparent 60%),
    color-mix(in srgb, var(--navy-900) 74%, transparent);
}
html.spoke-field-on .thread-head,
html.spoke-field-on .thread-bottom-bar{
  background:color-mix(in srgb, var(--navy-900) 66%, transparent);
  backdrop-filter:blur(22px) saturate(160%);
  -webkit-backdrop-filter:blur(22px) saturate(160%);
}
html.spoke-field-on .msg-row.them .msg-bubble{
  background:color-mix(in srgb, var(--navy-700) 82%, transparent);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
html.spoke-field-on .composer-row{
  background:color-mix(in srgb, var(--navy-800) 75%, transparent);
}
@supports not (backdrop-filter: blur(1px)){
  /* Browsers without backdrop-filter support: fall back to fully
     opaque panels rather than a half-transparent, unblurred mess. */
  html.spoke-field-on .rail-col,
  html.spoke-field-on .list-col,
  html.spoke-field-on .thread-col,
  html.spoke-field-on .thread-head,
  html.spoke-field-on .thread-bottom-bar{
    background:var(--navy-900);
  }
}

/* ================================================================
   Mobile premium pass — native-app feel
   ================================================================ */
@media (max-width:900px){
  /* Respect notches / home indicators on phones. */
  .rail-col{ padding-top:env(safe-area-inset-top); }
  .thread-head{ padding-top:calc(16px + env(safe-area-inset-top)); }
  .thread-bottom-bar .composer{ padding-bottom:calc(20px + env(safe-area-inset-bottom)); }
  .list-head{ padding-top:calc(16px + env(safe-area-inset-top)); }

  /* Frosted, native-feeling header/composer even with the field off —
     a flat opaque bar reads as "website"; a soft blur reads as "app". */
  .thread-head, .thread-bottom-bar{
    background:color-mix(in srgb, var(--navy-900) 88%, transparent);
    backdrop-filter:blur(18px) saturate(150%);
    -webkit-backdrop-filter:blur(18px) saturate(150%);
  }
  .list-head{
    background:color-mix(in srgb, var(--navy-950) 88%, transparent);
    backdrop-filter:blur(18px) saturate(150%);
    -webkit-backdrop-filter:blur(18px) saturate(150%);
  }

  /* Slightly larger, springier tap feedback on touch targets. */
  .send-btn:active, .rail-btn:active{ transform:scale(.9); }
  .convo-item:active{ background:var(--navy-800); }
}
@media (prefers-reduced-motion: reduce){
  .thread-col{ transition:none !important; }
  .app-shell .spoke-field svg{ animation:none !important; }
}
