/* GhostChat 2 — dark Messages look. System SF on Apple devices, bundled Inter everywhere else. */
@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #1c1c1e;
  --panel-2: #2c2c2e;
  --panel-3: #3a3a3c;
  --sep: rgba(84, 84, 88, .6);
  --label: #fff;
  --label-2: rgba(235, 235, 245, .6);
  --label-3: rgba(235, 235, 245, .3);
  --blue: #0a84ff;
  --green: #30d158;
  --red: #ff453a;
  --orange: #ff9f0a;
  --bubble-in: #262628;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Variable", system-ui, "Helvetica Neue", Arial, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); overscroll-behavior: none; }
body {
  color: var(--label); font: 400 16px/1.3 var(--font); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-size-adjust: 100%;
}
#app { height: 100dvh; display: flex; flex-direction: column; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(10, 132, 255, .45); }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent; }

/* ---------- shared controls ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 50px; padding: 0 18px; border-radius: 14px; background: var(--blue); color: #fff;
  font-weight: 600; font-size: 17px; transition: opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); opacity: .85; }
.btn[disabled] { opacity: .4; cursor: default; }
.btn.quiet { background: var(--panel-2); color: var(--label); }
.btn.danger { background: rgba(255, 69, 58, .16); color: var(--red); }
.btn svg { width: 20px; height: 20px; }
.link { color: var(--blue); font-size: 15px; }
.link.danger { color: var(--red); }

.fields { background: var(--panel); border-radius: 12px; overflow: hidden; }
.field { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 16px; position: relative; }
.field + .field::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.field label { flex: 0 0 104px; font-size: 16px; }
.field input, .field select {
  flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 12px 0; font-size: 16px;
}
.field input::placeholder { color: var(--label-3); }
.field select { appearance: none; text-align: right; color: var(--label-2); }
.hint { font-size: 13px; line-height: 1.38; color: var(--label-2); padding: 8px 16px 0; margin: 0; }
.error { font-size: 14px; line-height: 1.35; color: var(--red); padding: 10px 16px 0; margin: 0; min-height: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px 0; }
.chip { font-size: 13px; padding: 6px 12px; border-radius: 999px; background: var(--panel-2); color: var(--label-2); }
.chip.on { background: rgba(10, 132, 255, .22); color: #6cb6ff; }

/* ---------- sign-in ---------- */
.auth { flex: 1; overflow-y: auto; display: flex; padding: calc(24px + var(--safe-t)) 20px calc(24px + var(--safe-b)); }
.auth-card { width: 100%; max-width: 380px; margin: auto; }
.auth-mark { width: 76px; height: 76px; margin: 0 auto 18px; }
.auth h1 { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -.025em; text-align: center; margin: 0 0 6px; }
.auth .lede { text-align: center; color: var(--label-2); font-size: 15px; line-height: 1.4; margin: 0 auto 26px; max-width: 320px; }
.auth .fields + .fields, .auth .fields + .btn, .auth .error + .btn, .auth .hint + .btn { margin-top: 18px; }
.auth .group-label { font-size: 13px; color: var(--label-2); padding: 18px 16px 7px; }
.auth .foot { text-align: center; color: var(--label-3); font-size: 12.5px; line-height: 1.45; margin: 22px auto 0; max-width: 320px; }
.auth .swap { display: block; margin: 18px auto 0; }

/* ---------- key prompt (the one loud moment) ---------- */
.keyprompt {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px;
  background: rgba(0, 0, 0, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  animation: fade .18s ease-out;
}
.keyprompt-card { width: 100%; max-width: 330px; text-align: center; }
.keyart { position: relative; width: 190px; height: 190px; margin: 0 auto 22px; }
.keyart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.keyart .ring { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; }
.keyprompt.waiting .ring { animation: ring 1.9s cubic-bezier(.2, .6, .3, 1) infinite; }
.keyprompt.waiting .ring:nth-child(2) { animation-delay: .63s; }
.keyprompt.waiting .ring:nth-child(3) { animation-delay: 1.26s; }
.keyart .contact { fill: #2b2b2e; transition: fill .25s; }
.keyprompt.waiting .contact { fill: var(--blue); }
.keyprompt.done .contact { fill: var(--green); }
.keyprompt h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.keyprompt p { color: var(--label-2); font-size: 15px; line-height: 1.4; margin: 0 0 22px; min-height: 42px; }
.keyprompt .link { font-size: 17px; }
@keyframes ring { 0% { transform: scale(.7); opacity: .9; } 100% { transform: scale(3.1); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- app shell ---------- */
.shell { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; min-height: 0; background: #161618; border-right: .5px solid var(--sep); }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); position: relative; }

.side-head { padding: calc(12px + var(--safe-t)) 16px 8px; }
.side-top { display: flex; align-items: center; justify-content: space-between; height: 36px; }
.side-top .who { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: 16px; }
.side-tools { display: flex; gap: 2px; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); }
.icon-btn svg { width: 23px; height: 23px; }
.icon-btn:active { background: rgba(255, 255, 255, .08); }
.side-title { font-size: 32px; font-weight: 700; letter-spacing: -.028em; margin: 6px 0 10px; }
.search { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border-radius: 10px; background: rgba(118, 118, 128, .24); color: var(--label-2); }
.search svg { width: 17px; height: 17px; flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-size: 16px; color: var(--label); }
.search input::placeholder { color: var(--label-2); }
.sheet-body > .search { margin-top: 6px; }

.chatlist { flex: 1; padding: 4px 8px calc(8px + var(--safe-b)); }
.chatrow { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px 9px 6px; border-radius: 12px; text-align: left; position: relative; }
.chatrow .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: transparent; }
.chatrow.unread .dot { background: var(--blue); }
.chatrow .meta { flex: 1; min-width: 0; display: block; }
.chatrow .line1 { display: flex; align-items: baseline; gap: 8px; }
.chatrow .name { flex: 1; min-width: 0; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow .when { flex: none; font-size: 14px; color: var(--label-2); }
.chatrow .preview { font-size: 14.5px; line-height: 1.28; color: var(--label-2); height: 2.56em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.chatrow .timer { display: inline-block; width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; color: var(--orange); }
.chatrow.active { background: var(--blue); }
.chatrow.active .when, .chatrow.active .preview { color: rgba(255, 255, 255, .82); }
.chatrow.active .timer { color: #fff; }
.chatrow.active.unread .dot { background: #fff; }
.empty-list { padding: 40px 24px; text-align: center; color: var(--label-2); font-size: 15px; line-height: 1.4; }
.empty-list .btn { margin-top: 16px; }

.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #a6abb7, #868b98); color: #fff; font-weight: 600; font-size: 18px; letter-spacing: 0; overflow: hidden;
}
.avatar svg { width: 62%; height: 62%; }
.avatar.s { width: 28px; height: 28px; font-size: 11.5px; }
.avatar.m { width: 34px; height: 34px; font-size: 13.5px; }
.avatar.xl { width: 92px; height: 92px; font-size: 38px; }

/* ---------- conversation ---------- */
.thread-head {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center;
  padding: calc(8px + var(--safe-t)) 8px 8px; background: rgba(22, 22, 24, .78);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px); border-bottom: .5px solid var(--sep);
}
.thread-head .back { visibility: hidden; display: flex; align-items: center; color: var(--blue); height: 36px; padding: 0 4px; font-size: 17px; }
.thread-head .back svg { width: 24px; height: 24px; margin-right: -3px; }
.thread-head .back .badge { background: var(--blue); color: #fff; border-radius: 10px; font-size: 12.5px; padding: 1px 7px; margin-left: 4px; }
.thread-head .title { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; padding: 0 4px; }
.thread-head .title .name { font-size: 12px; color: var(--label); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 3px; }
.thread-head .title .name svg { width: 6px; height: 10px; color: var(--label-3); flex: none; }
.thread-head .right { justify-self: end; }

.messages { flex: 1; padding: calc(84px + var(--safe-t)) 14px 6px; display: flex; flex-direction: column; isolation: isolate; }
.messages > * { flex: none; }
.messages > .spacer { flex: 1 0 0; }
.stamp { align-self: center; font-size: 11.5px; color: var(--label-2); margin: 14px 0 6px; text-align: center; }
.stamp b { font-weight: 600; }
.notice { align-self: center; max-width: 300px; text-align: center; font-size: 12px; line-height: 1.35; color: var(--label-2); margin: 4px 0 10px; }
.notice svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; margin-right: 3px; }
.older { align-self: center; margin: 0 0 8px; }
.sender { font-size: 11.5px; color: var(--label-2); margin: 8px 0 2px 46px; }

.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: min(76%, 520px); margin-top: 2px; position: relative; }
.msg.me { align-self: flex-end; align-items: flex-end; }
.msg.gap { margin-top: 9px; }
.msg.grouped { margin-left: 34px; }
.msg .avatar { position: absolute; left: -34px; bottom: 0; }
.msg.pending { opacity: .55; }
.bubble {
  position: relative; padding: 7px 12px 8px; border-radius: 18px; background: var(--bubble-in); font-size: 16.5px; line-height: 1.29;
  white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text;
}
.msg.me .bubble { background: var(--blue); color: #fff; }
.msg.me .bubble a { color: #fff; text-decoration: underline; }
.bubble a { text-decoration: underline; }
.msg.tail .bubble:last-child::before, .msg.tail .bubble:last-child::after { content: ""; position: absolute; bottom: 0; height: 18px; z-index: -1; }
.msg.tail:not(.me) .bubble:last-child::before { left: -7px; width: 20px; background: var(--bubble-in); border-bottom-right-radius: 16px 14px; }
.msg.tail:not(.me) .bubble:last-child::after { left: -26px; width: 26px; background: var(--bg); border-bottom-right-radius: 10px; }
.msg.tail.me .bubble:last-child::before { right: -7px; width: 20px; background: var(--blue); border-bottom-left-radius: 16px 14px; }
.msg.tail.me .bubble:last-child::after { right: -26px; width: 26px; background: var(--bg); border-bottom-left-radius: 10px; }
.msg.emoji .bubble { background: none !important; padding: 2px 0; font-size: 46px; line-height: 1.15; }
.msg.emoji .bubble::before, .msg.emoji .bubble::after { display: none; }
.msg.undecryptable .bubble { color: var(--label-2); font-style: italic; }

.att { display: block; border-radius: 18px; overflow: hidden; background: var(--panel); margin-bottom: 2px; position: relative; max-width: 100%; }
.att.image { cursor: zoom-in; }
.att.image img, .att.video video { display: block; width: 100%; height: 100%; object-fit: cover; }
.att.image, .att.video { width: 280px; max-width: 100%; }
.att .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label-3); font-size: 12px; }
.att.file { display: flex; align-items: center; gap: 10px; padding: 10px 14px 10px 10px; min-width: 200px; text-align: left; }
.att.file .glyph { width: 38px; height: 38px; border-radius: 10px; background: var(--panel-3); display: grid; place-items: center; color: var(--blue); flex: none; }
.att.file .glyph svg { width: 20px; height: 20px; }
.att.file .fname { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.att.file .fsize { font-size: 12.5px; color: var(--label-2); }
.att audio { display: block; width: 280px; max-width: 100%; }
.progress { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.progress i { display: block; height: 100%; background: #fff; width: 0; transition: width .15s; }

.status { align-self: flex-end; font-size: 11.5px; color: var(--label-2); margin: 3px 2px 0; }
.status b { font-weight: 600; }
.status.failed { color: var(--red); }
.status.failed button { color: var(--red); text-decoration: underline; }

.typing { align-self: flex-start; margin-top: 9px; }
.typing .bubble { display: flex; gap: 4px; padding: 12px 13px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: #8e8e93; animation: blink 1.2s infinite both; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .35; } 40% { opacity: 1; } }

.composer { padding: 6px 12px calc(8px + var(--safe-b)); background: var(--bg); }
.tray { display: flex; gap: 8px; padding: 4px 0 8px 44px; overflow-x: auto; }
.tray .thumb { position: relative; flex: none; width: 72px; height: 72px; border-radius: 12px; background: var(--panel); overflow: hidden; display: grid; place-items: center; font-size: 11px; color: var(--label-2); padding: 6px; text-align: center; overflow-wrap: anywhere; }
.tray .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tray .thumb button { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; display: grid; place-items: center; }
.tray .thumb button svg { width: 11px; height: 11px; }
.compose-row { display: flex; align-items: flex-end; gap: 8px; }
.attach { width: 34px; height: 34px; margin-bottom: 1px; border-radius: 50%; background: var(--panel-2); color: var(--label-2); display: grid; place-items: center; flex: none; }
.attach svg { width: 18px; height: 18px; }
.inputwrap { flex: 1; min-width: 0; display: flex; align-items: flex-end; border: 1px solid var(--panel-3); border-radius: 19px; padding: 0 4px 0 13px; min-height: 36px; }
.inputwrap textarea { flex: 1; min-width: 0; resize: none; background: none; border: 0; outline: 0; padding: 7px 0; font-size: 16.5px; line-height: 1.25; max-height: 150px; }
.inputwrap textarea::placeholder { color: var(--label-3); }
.send { width: 28px; height: 28px; margin: 0 0 3px 6px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; flex: none; transition: transform .12s, opacity .12s; }
.send svg { width: 16px; height: 16px; }
.send[disabled] { opacity: 0; transform: scale(.6); pointer-events: none; }
.dropzone { position: absolute; inset: 0; z-index: 8; display: none; place-items: center; background: rgba(10, 132, 255, .14); border: 2px dashed var(--blue); border-radius: 14px; margin: 10px; font-weight: 600; color: #6cb6ff; pointer-events: none; }
.thread.dragging .dropzone { display: grid; }

.blank { flex: 1; display: grid; place-items: center; text-align: center; color: var(--label-2); padding: 24px; }
.blank h2 { color: var(--label); font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.blank p { margin: 0 auto 18px; max-width: 300px; font-size: 15px; line-height: 1.4; }
.blank .btn { width: auto; margin: 0 auto; padding: 0 22px; }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .5); display: flex; align-items: center; justify-content: center; animation: fade .18s ease-out; }
.sheet { width: 100%; max-width: 500px; max-height: min(88dvh, 780px); display: flex; flex-direction: column; background: #111113; border-radius: 16px; overflow: hidden; box-shadow: 0 24px 80px rgba(0, 0, 0, .6); animation: rise .24s cubic-bezier(.2, .8, .2, 1); }
.sheet-head { display: grid; grid-template-columns: 84px 1fr 84px; align-items: center; height: 54px; padding: 0 14px; flex: none; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-head .link { font-size: 17px; justify-self: start; }
.sheet-head .link.end { justify-self: end; font-weight: 600; }
.sheet-body { padding: 4px 16px calc(24px + var(--safe-b)); }
.sheet-body form > .btn { margin-top: 18px; }
@keyframes rise { from { transform: translateY(26px); opacity: 0; } }

.group { margin-top: 22px; }
.group:first-child { margin-top: 6px; }
.group > h3 { font-size: 13px; font-weight: 400; color: var(--label-2); margin: 0 0 7px; padding: 0 16px; }
.group > .hint { padding-top: 7px; }
.rows { background: var(--panel); border-radius: 12px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 16px; text-align: left; position: relative; }
.row + .row::before { content: ""; position: absolute; left: 16px; right: 0; top: 0; height: .5px; background: var(--sep); }
.row.has-icon + .row.has-icon::before { left: 58px; }
button.row:active { background: var(--panel-2); }
.row .ricon { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--panel-3); color: #fff; flex: none; }
.row .ricon svg { width: 18px; height: 18px; }
.row .ricon.blue { background: var(--blue); } .row .ricon.green { background: var(--green); } .row .ricon.red { background: var(--red); } .row .ricon.orange { background: var(--orange); } .row .ricon.gray { background: #8e8e93; }
.row .rmain { flex: 1; min-width: 0; display: block; }
.row .rlabel { font-size: 16px; overflow-wrap: anywhere; }
.row .rsub { font-size: 13px; line-height: 1.3; color: var(--label-2); margin-top: 1px; overflow-wrap: anywhere; }
.row .rdetail { color: var(--label-2); font-size: 16px; flex: none; max-width: 55%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .rlinks { display: flex; gap: 14px; flex: none; }
.row .chev { width: 8px; height: 14px; color: var(--label-3); flex: none; }
.row.blue .rlabel { color: var(--blue); } .row.red .rlabel { color: var(--red); }
.row select { appearance: none; background: none; border: 0; outline: 0; color: var(--label-2); text-align: right; font-size: 16px; max-width: 50%; }
.row select option { background: var(--panel-2); color: var(--label); }
.row .check { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--panel-3); flex: none; display: grid; place-items: center; color: #fff; }
.row .check svg { width: 12px; height: 12px; opacity: 0; stroke-width: 3; }
.row.on .check { background: var(--blue); border-color: var(--blue); }
.row.on .check svg { opacity: 1; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1.5px 7px; border-radius: 999px; background: rgba(48, 209, 88, .16); color: var(--green); margin: 4px 4px 0 0; }
.tag.blue { background: rgba(10, 132, 255, .2); color: #6cb6ff; }
.tag.gray { background: var(--panel-3); color: var(--label-2); }

.switch { position: relative; width: 51px; height: 31px; border-radius: 16px; background: var(--panel-3); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

.segmented { display: flex; background: rgba(118, 118, 128, .24); border-radius: 9px; padding: 2px; }
.segmented button { flex: 1; height: 30px; border-radius: 7px; font-size: 13.5px; font-weight: 500; }
.segmented button.on { background: #636366; font-weight: 600; }

.profile { display: flex; flex-direction: column; align-items: center; padding: 6px 0 2px; text-align: center; }
.profile h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; margin: 12px 0 2px; }
.profile p { margin: 0; color: var(--label-2); font-size: 15px; }
.safety { font: 500 17px/1.7 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; text-align: center; padding: 14px 10px; }
.code { font: 13px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; color: var(--label-2); user-select: all; -webkit-user-select: all; }
.callout { background: rgba(255, 159, 10, .13); color: #ffc266; border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.4; margin-top: 14px; }
.sheet-body > .btn { margin-top: 22px; }
.sheet-body > .btn + .btn { margin-top: 10px; }
.dialog-text { color: var(--label-2); font-size: 15px; line-height: 1.42; margin: 4px 4px 16px; }

/* ---------- misc ---------- */
.menu { position: fixed; z-index: 50; min-width: 190px; background: rgba(44, 44, 46, .92); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 13px; overflow: hidden; box-shadow: 0 10px 40px rgba(0, 0, 0, .55); animation: fade .12s; }
.menu button { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; padding: 11px 15px; font-size: 16px; text-align: left; }
.menu button + button { border-top: .5px solid var(--sep); }
.menu button:active { background: rgba(255, 255, 255, .1); }
.menu button.danger { color: var(--red); }
.menu svg { width: 18px; height: 18px; }

.toast { position: fixed; z-index: 70; left: 50%; bottom: calc(86px + var(--safe-b)); transform: translateX(-50%); max-width: min(92vw, 420px); background: rgba(58, 58, 60, .96); color: #fff; padding: 11px 18px; border-radius: 22px; font-size: 15px; line-height: 1.3; text-align: center; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); }

.lightbox { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, .96); display: flex; flex-direction: column; animation: fade .15s; }
.lightbox .bar { display: flex; justify-content: space-between; padding: calc(10px + var(--safe-t)) 14px 10px; }
.lightbox .bar .link { font-size: 17px; }
.lightbox .stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 0 calc(14px + var(--safe-b)); }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---------- phone layout ---------- */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { background: var(--bg); border-right: 0; }
  .shell[data-pane="thread"] .sidebar, .shell[data-pane="list"] .thread { display: none; }
  .thread-head .back { visibility: visible; }
  .chatrow.active { background: none; }
  .chatrow.active .when, .chatrow.active .preview { color: var(--label-2); }
  .chatrow.active.unread .dot { background: var(--blue); }
  .chatrow.active .timer { color: var(--orange); }
  .msg { max-width: 80%; }
  .backdrop { align-items: flex-end; }
  .sheet { max-width: none; max-height: 93dvh; border-radius: 14px 14px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
