:root {
  --bg: #f7f7f8;
  --panel: #ffffff;
  --line: #ebebee;
  --line-strong: #dcdce1;
  --ink: #111113;
  --ink-2: #4a4a52;
  --muted: #8a8a93;
  --soft: #f2f2f4;
  --hover: #f6f6f8;
  --green: #22a06b;
  --red: #d93f3f;
  --blue: #2f6fec;
  --radius: 10px;
  font-family: Geist, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); }
#app { height: var(--app-h, 100dvh); background: var(--bg); }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { overscroll-behavior: none; }
button, a, .item, label { touch-action: manipulation; }
body { font-size: 14px; line-height: 1.45; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
svg { display: block; width: 100%; height: 100%; }
.ic { display: inline-block; width: 18px; height: 18px; flex: none; }
.ic-sm { display: inline-block; width: 15px; height: 15px; flex: none; }

/* ---------- buttons & fields ---------- */
.btn { height: 34px; padding: 0 14px; border-radius: 8px; display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: 13.5px; white-space: nowrap; transition: background .15s ease, border-color .15s ease, opacity .15s ease; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2a2e; }
.btn-dark:disabled { opacity: .35; cursor: default; }
.btn-line { border: 1px solid var(--line-strong); background: #fff; }
.btn-line:hover { background: var(--hover); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--soft); }
.field { width: 100%; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 12px; background: #fff; outline: none; transition: border-color .15s ease, box-shadow .15s ease; }
textarea.field { height: auto; padding: 9px 12px; resize: vertical; min-height: 72px; }
.field:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 19, .07); }
select.field { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a8a93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px; padding-right: 32px; }
label.lbl { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- login ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; }
.login .mark { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 20px; }
.login .mark span { width: 22px; height: 22px; }
.login h1 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 4px; }
.login p { color: var(--muted); margin-bottom: 22px; }
.login .row { margin-bottom: 14px; }
.login .btn { width: 100%; height: 40px; justify-content: center; margin-top: 6px; }
.login .error { color: var(--red); font-size: 13px; margin-top: 12px; min-height: 18px; }

/* ---------- shell ---------- */
.shell { height: 100%; display: grid; grid-template-columns: 60px 320px 1fr 300px; }
.shell.settings-mode { grid-template-columns: 60px 1fr; }
.rail { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; }
.rail .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: #fff; display: grid; place-items: center; margin-bottom: 14px; }
.rail .logo span { width: 19px; height: 19px; }
.rail-btn { position: relative; width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); transition: background .15s ease, color .15s ease; }
.rail-btn:hover { background: var(--soft); color: var(--ink); }
.rail-btn.on { background: var(--soft); color: var(--ink); }
.rail-btn .ic { width: 20px; height: 20px; }
.rail-btn .pip { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid #fff; display: none; }
.rail-btn .pip.show { display: block; }
.rail .spacer { flex: 1; }
.rail-btn[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: 48px; top: 50%; transform: translateY(-50%); background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 10; pointer-events: none; }

/* ---------- list ---------- */
.list { border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.list-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--line); }
.list-head h1 { font-size: 17px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); background: var(--soft); border-radius: 999px; padding: 3px 9px 3px 8px; margin-left: auto; cursor: pointer; }
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-pill.away i { background: #b5b5bd; }
.seg { display: flex; background: var(--soft); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { flex: 1; height: 28px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .07); }
.seg .n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.search { position: relative; margin-top: 10px; }
.search .ic-sm { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .field { height: 34px; padding-left: 33px; background: #fff; }
.items { flex: 1; overflow-y: auto; }
.item { display: flex; gap: 11px; padding: 13px 16px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s ease; }
.item:hover { background: var(--hover); }
.item.on { background: var(--soft); }
.item .body { flex: 1; min-width: 0; }
.item .top { display: flex; align-items: baseline; gap: 8px; }
.item .name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.item .time { font-size: 12px; color: var(--muted); flex: none; font-variant-numeric: tabular-nums; }
.item .preview { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.item.unread .name { font-weight: 600; }
.item.unread .preview { color: var(--ink); }
.item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; align-self: center; }
.item .typing-now { color: var(--green); }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 13.5px; }
.empty .ic { display: block; width: 28px; height: 28px; margin: 0 auto 10px; color: #c4c4cb; }

.ava { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; color: #fff; }
.ava .on-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: var(--green); border: 2px solid #fff; }
.ava.lg { width: 56px; height: 56px; font-size: 20px; }
.ava.lg .on-dot { width: 14px; height: 14px; }

/* ---------- thread ---------- */
.thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.thread-head { height: 64px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .who b { font-weight: 600; font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .who span { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.live { color: var(--green); font-weight: 500; }
.back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 24px 28px 12px; }
.day { text-align: center; font-size: 12px; color: var(--muted); margin: 18px 0 8px; }
.m { display: flex; margin-top: 3px; }
.m.first { margin-top: 14px; }
.m.agent { justify-content: flex-end; }
.m .col { max-width: min(560px, 72%); display: flex; flex-direction: column; }
.m.agent .col { align-items: flex-end; }
.bub { padding: 9px 13px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; }
.m.visitor .bub { background: #fff; border: 1px solid var(--line); }
.m.agent .bub { background: var(--ink); color: #fff; }
.m.visitor:not(.first) .bub { border-top-left-radius: 5px; }
.m.visitor:not(.last) .bub { border-bottom-left-radius: 5px; }
.m.agent:not(.first) .bub { border-top-right-radius: 5px; }
.m.agent:not(.last) .bub { border-bottom-right-radius: 5px; }
.bub a { text-decoration: underline; }
.m .meta { font-size: 11.5px; color: var(--muted); margin: 5px 3px 0; display: none; align-items: center; gap: 5px; }
.m.last .meta { display: flex; }
.m .meta .tag { display: inline-flex; align-items: center; gap: 4px; }
.m.pending .bub { opacity: .55; }
.sys { display: flex; justify-content: center; margin: 14px 0; }
.sys div { font-size: 12.5px; color: var(--muted); background: var(--soft); border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; max-width: 90%; }
.sys b { color: var(--ink-2); font-weight: 500; }
.typing-line { font-size: 12.5px; color: var(--muted); padding: 4px 28px 8px; min-height: 26px; font-style: italic; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.composer { flex: none; padding: 0 20px 18px; }
.composer .box { background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; transition: border-color .15s ease, box-shadow .15s ease; }
.composer .box:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 19, .06); }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; padding: 12px 14px 4px; min-height: 48px; max-height: 220px; font-size: 14px; line-height: 1.5; background: transparent; }
.composer .bar { display: flex; align-items: center; gap: 10px; padding: 6px 8px 8px 14px; }
.composer .note { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.composer .note span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; user-select: none; white-space: nowrap; }
.check input { width: 15px; height: 15px; accent-color: var(--ink); }
.check.disabled { opacity: .4; cursor: default; }
.placeholder { flex: 1; display: grid; place-items: center; color: var(--muted); text-align: center; padding: 24px; }
.placeholder .ic { display: block; width: 32px; height: 32px; margin: 0 auto 12px; color: #c4c4cb; }

/* ---------- details ---------- */
.details { border-left: 1px solid var(--line); background: var(--panel); overflow-y: auto; }
.details .card { padding: 24px 20px; border-bottom: 1px solid var(--line); }
.details .who { text-align: center; }
.details .who .ava { margin: 0 auto 12px; }
.details .who b { display: block; font-size: 15px; font-weight: 600; word-break: break-word; }
.details .who a { color: var(--muted); font-size: 13px; text-decoration: none; word-break: break-all; }
.details .who a:hover { color: var(--ink); text-decoration: underline; }
.details h3 { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 10px 12px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { word-break: break-word; min-width: 0; }
.kv dd a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.kv dd a:hover { border-color: var(--ink); }
.no-email { font-size: 12.5px; color: var(--muted); margin-top: 6px; }

/* ---------- settings ---------- */
.settings { overflow-y: auto; }
.settings-inner { max-width: 760px; margin: 0 auto; padding: 32px 28px 120px; }
.settings h1 { font-size: 22px; font-weight: 600; letter-spacing: -.015em; margin-bottom: 4px; }
.settings .lead { color: var(--muted); margin-bottom: 28px; }
.sec { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 16px; }
.sec h2 { font-size: 15px; font-weight: 600; margin-bottom: 3px; }
.sec > p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stack > * + * { margin-top: 16px; }
.days { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-top: 16px; }
.dayrow { display: grid; grid-template-columns: 130px 1fr; align-items: center; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); min-height: 52px; }
.dayrow:first-child { border-top: 0; }
.dayrow .times { display: flex; align-items: center; gap: 8px; }
.dayrow .times .field { width: 136px; height: 34px; }
.dayrow .closed { color: var(--muted); font-size: 13px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.toggle input { display: none; }
.toggle .sw { width: 32px; height: 19px; border-radius: 999px; background: #d6d6dc; position: relative; transition: background .15s ease; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .15s ease; }
.toggle input:checked + .sw { background: var(--ink); }
.toggle input:checked + .sw::after { transform: translateX(13px); }
.seg.wide { max-width: 440px; }
.seg.wide button { height: 32px; }
.now-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; margin-top: 12px; color: var(--ink-2); }
.now-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.now-status.away i { background: #b5b5bd; }
.color-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.color-row input[type=color] { flex: none; }
.color-row input[type=color] { width: 38px; height: 38px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 3px; background: #fff; cursor: pointer; }
.swatches { display: flex; gap: 6px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.code { position: relative; background: #111113; color: #e6e6ea; border-radius: 10px; padding: 14px 16px; font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; white-space: pre; }
.code .btn { position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; font-size: 12px; background: rgba(255, 255, 255, .1); color: #fff; font-family: Geist, sans-serif; }
.code .btn:hover { background: rgba(255, 255, 255, .18); }
.mail-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--soft); font-size: 13px; }
.mail-status .ic { color: var(--muted); margin-top: 1px; }
.mail-status.ok .ic { color: var(--green); }
.mail-status code { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff; border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
.savebar { position: fixed; left: 60px; right: 0; bottom: 0; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 28px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; transform: translateY(100%); transition: transform .2s ease; }
.savebar { visibility: hidden; opacity: 0; pointer-events: none; }
.savebar.show { transform: none; visibility: visible; opacity: 1; pointer-events: auto; }
.savebar span { color: var(--muted); font-size: 13px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- quick responses ---------- */
.composer { position: relative; }
.qr-btn { height: 30px; padding: 0 9px; gap: 5px; font-size: 12.5px; color: var(--ink-2); margin-left: -6px; }
.qr-btn.on { background: var(--soft); color: var(--ink); }
.qr-pop { position: absolute; left: 20px; right: 20px; bottom: calc(100% - 4px); background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 32px rgba(17, 17, 19, .12), 0 2px 6px rgba(17, 17, 19, .06); overflow: hidden; z-index: 20; display: flex; flex-direction: column; max-height: min(360px, 55vh); }
.qr-pop[hidden] { display: none; }
.qr-top { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line); color: var(--muted); }
.qr-search { flex: 1; border: 0; outline: 0; height: 42px; background: transparent; }
.qr-list { overflow-y: auto; padding: 4px; }
.qr-item { padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.qr-item.on { background: var(--soft); }
.qr-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.qr-line b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-line code { font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); background: var(--soft); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; flex: none; }
.qr-item.on .qr-line code { background: #fff; }
.qr-body { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.qr-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.qr-foot button { font-size: 12px; font-weight: 500; color: var(--ink-2); }
.qr-foot button:hover { color: var(--ink); text-decoration: underline; }
.qr-empty { padding: 18px 12px; color: var(--muted); font-size: 13px; text-align: center; }
.link { text-decoration: underline; color: var(--ink); }
.sec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.sec-head p { color: var(--muted); font-size: 13px; }
.sec-head b { font-weight: 600; color: var(--ink-2); }
.qr-rows { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qr-row { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.qr-row:first-child { border-top: 0; }
.qr-row-main { flex: 1; min-width: 0; }
.qr-row-actions { display: flex; gap: 2px; flex: none; }
.qr-row-actions .btn { height: 30px; padding: 0 10px; font-size: 12.5px; }
.danger:hover { color: var(--red); }
.qr-rows .qr-form { border-top: 1px solid var(--line); border-radius: 0; margin: 0; }
.qr-rows .qr-form:first-child { border-top: 0; }
.qr-form { background: var(--hover); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 12px; display: grid; gap: 14px; }
.qr-form textarea.field { min-height: 110px; line-height: 1.5; }
.prefix { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding-left: 11px; }
.prefix:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(17, 17, 19, .07); }
.prefix span { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.prefix .field { border: 0; box-shadow: none !important; padding-left: 4px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12px; color: var(--muted); }
.vars button { font: 11.5px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1px solid var(--line-strong); background: #fff; border-radius: 6px; padding: 2px 7px; color: var(--ink-2); }
.vars button:hover { border-color: var(--ink); color: var(--ink); }
.qr-err { color: var(--red); font-size: 13px; }
.qr-err:empty { display: none; }
.qr-form-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- team ---------- */
.mava { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; object-fit: cover; color: #fff; font-size: 11px; font-weight: 600; background: var(--soft); }
.mava.xs { width: 16px; height: 16px; font-size: 8px; }
.mava.sm { width: 22px; height: 22px; font-size: 9.5px; }
.mava.lg { width: 44px; height: 44px; font-size: 15px; }
.m .meta .mava.xs { margin-right: 1px; }
.me-wrap { position: relative; }
.me-btn { height: 30px; padding: 0 9px 0 4px; gap: 6px; font-size: 12.5px; color: var(--ink-2); margin-left: -6px; border-radius: 999px; }
.me-btn:hover { background: var(--soft); }
.me-menu { position: absolute; bottom: calc(100% + 8px); left: -6px; min-width: 200px; background: #fff; border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 12px 32px rgba(17, 17, 19, .12); padding: 4px; z-index: 25; }
.me-menu[hidden] { display: none; }
.me-cap { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 8px 4px; }
.me-opt { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: 8px; text-align: left; font-size: 13px; }
.me-opt:hover, .me-opt.on { background: var(--soft); }
.me-opt span:not(.ic-sm):not(.mava) { flex: 1; }
.ava-pick { position: relative; flex: none; border-radius: 50%; }
.ava-edit { position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; border: 2px solid #fff; }
.ava-edit .ic-sm { width: 10px; height: 10px; }
.ava-pick:hover .mava { filter: brightness(.92); }
.team-row .qr-line code { font-family: Geist, sans-serif; font-size: 11px; }

/* ---------- notify banner ---------- */
.banner { display: flex; align-items: center; gap: 10px; margin: 10px 12px 0; padding: 10px 10px 10px 12px; border-radius: 10px; background: var(--soft); font-size: 13px; color: var(--ink-2); }
.banner[hidden] { display: none; }
.banner span:not(.ic-sm) { flex: 1; min-width: 0; }
.banner .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.banner .x { width: 26px; height: 26px; border-radius: 6px; color: var(--muted); font-size: 18px; line-height: 1; }
.banner .x:hover { background: #e6e6ea; }
.rail-btn.on .ic { color: var(--ink); }

/* ---------- install sheet (iOS) ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(17, 17, 19, .35); display: flex; align-items: flex-end; justify-content: center; z-index: 60; animation: fade .2s ease; }
.sheet { width: 100%; max-width: 440px; background: #fff; border-radius: 20px 20px 0 0; padding: 28px 24px calc(24px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.3, .7, .4, 1); }
.sheet-icon { width: 60px; height: 60px; border-radius: 14px; display: block; margin-bottom: 16px; }
.sheet h2 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.sheet p { color: var(--muted); margin-bottom: 14px; }
.sheet ol { padding-left: 20px; margin-bottom: 22px; display: grid; gap: 8px; }
.sheet b { font-weight: 600; }
.sheet .btn { width: 100%; height: 46px; justify-content: center; font-size: 15px; border-radius: 12px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.details-close { display: none; margin: 10px 8px 0; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 60px 300px 1fr; }
  .details { display: none; }
}
@media (max-width: 1180px) {
  .shell.show-details .details { display: block; position: fixed; inset: 0; z-index: 40; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .shell.show-details .details-close { display: inline-flex; }
  .thread-head .who { cursor: pointer; }
}
@media (max-width: 760px) {
  .shell, .shell.settings-mode { grid-template-columns: 1fr; grid-template-rows: 1fr calc(56px + env(safe-area-inset-bottom)); }
  .rail { grid-row: 2; flex-direction: row; justify-content: space-around; border-right: 0; border-top: 1px solid var(--line); padding: 0 12px env(safe-area-inset-bottom); }
  .rail .logo, .rail .spacer { display: none; }
  .rail-btn { width: 52px; height: 44px; }
  .rail-btn[data-tip]:hover::after { display: none; }
  /* Conversation view goes full screen like Messages: no tab bar, composer sits on the home indicator. */
  .shell.has-conv { grid-template-rows: 1fr; }
  .shell.has-conv .rail { display: none; }
  .shell.has-conv .list { display: none; }
  .shell:not(.has-conv) .thread { display: none; }
  .list-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .list-head h1 { font-size: 26px; letter-spacing: -.02em; }
  .item { padding: 14px 16px; }
  .ava { width: 44px; height: 44px; font-size: 15px; }
  .thread-head { height: auto; min-height: 60px; padding: env(safe-area-inset-top) 12px 0 4px; gap: 8px; }
  .thread-head .btn-line { height: 36px; padding: 0 12px; }
  .back { display: grid; place-items: center; width: 40px; height: 44px; padding: 0; }
  .back .ic { width: 26px; height: 26px; }
  .thread, .details { will-change: transform; }
  .swiping { transition: none !important; }
  .swipe-back { transition: transform .22s cubic-bezier(.3, .7, .4, 1); }
  .msgs { padding: 12px 14px; }
  .m .col { max-width: 82%; }
  .bub { font-size: 16px; }
  .typing-line { padding: 2px 16px 6px; }
  .composer { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .composer .note { display: none; }
  .qr-pop { left: 10px; right: 10px; max-height: 50vh; }
  .qr-row:not(.team-row) { flex-direction: column; align-items: stretch; }
  .team-row { flex-wrap: wrap; }
  .team-row .qr-row-actions { width: 100%; justify-content: flex-end; }
  .qr-row-actions { justify-content: flex-end; }
  .sec-head { flex-direction: column; }
  .composer .bar { padding: 4px 6px 6px 12px; justify-content: space-between; }
  .composer .btn-dark { height: 38px; border-radius: 10px; }
  .field, .composer textarea, select.field, .search .field { font-size: 16px; }
  .grid2 { grid-template-columns: 1fr; }
  .dayrow { grid-template-columns: 1fr; gap: 8px; }
  .dayrow .times .field { flex: 1; width: auto; }
  .settings-inner { padding: calc(24px + env(safe-area-inset-top)) 16px 140px; }
  .seg.wide { max-width: none; }
  .savebar { left: 0; bottom: calc(56px + env(safe-area-inset-bottom)); padding: 10px 16px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); text-align: center; }
  .login { padding-top: env(safe-area-inset-top); }
}
