/* BLANK INBOX — BLANK CORE look: lemon accent, ink, Endless Mist background, Outfit.
   Shapes: cards 20px · inputs 12px · chips/buttons pill. Springy, quick motion.
   Layout: left panel (views + workflow) · chat list · conversation · contact info (hidden until asked). */
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('/assets/fonts/Outfit-ExtraBold.ttf') format('truetype'); font-weight: 800; font-display: swap; }

:root {
  --accent: #FFFF00; --on-accent: #0B0B0C; --accent-edge: rgba(11, 11, 12, .16);
  --ink: #0B0B0C;
  --bg: #ECF0F1; --card: #FFFFFF; --sunken: #F3F6F6; --line: #E3E9EA;
  --text-1: #0B0B0C; --text-2: #465053; --text-3: #667275;
  --bad: #C62828; --bad-bg: #FDECEC; --good: #1E7A3C; --good-bg: #E7F5EC; --info-bg: #E6F0FA; --warn: #8A5A00; --warn-bg: #FFF4D6;
  --shadow: 0 1px 2px rgba(18, 38, 43, .04), 0 14px 32px -22px rgba(18, 38, 43, .22);
  --shadow-pop: 0 2px 6px rgba(18, 38, 43, .08), 0 24px 48px -16px rgba(18, 38, 43, .28);
  --r-card: 20px; --r-tile: 14px; --r-ctl: 12px; --r-pill: 999px;
  --font: 'Outfit', 'Noto Sans SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --side-w: 252px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 15px/1.45 var(--font); color: var(--text-1); background: var(--bg); overflow: hidden; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3, p, ol, ul { margin: 0; }
svg.lucide { width: 16px; height: 16px; stroke-width: 2; flex: none; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.bmark { height: 30px; width: auto; display: block; } /* B mark keeps its own ratio */

/* ---- shared controls ---- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; font-size: 12px; font-weight: 600; border-radius: var(--r-pill); border: 1px solid transparent; background: var(--sunken); color: var(--text-1); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip svg.lucide { width: 13px; height: 13px; }
.chip.lemon { background: var(--accent); color: var(--on-accent); border-color: var(--accent-edge); }
.chip.outline { background: transparent; border-color: var(--line); color: var(--text-2); }
.chip.good { background: var(--good-bg); color: var(--good); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }
.chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.tiny { height: 20px; padding: 0 6px; }
button.chip { cursor: pointer; transition: transform 160ms var(--spring), background 120ms var(--ease); }
button.chip:active { transform: scale(.95); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; white-space: nowrap; text-decoration: none; transition: transform 180ms var(--spring), background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease); }
.btn:hover { background: var(--text-2); border-color: var(--text-2); }
.btn:active { transform: scale(.95); }
.btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent-edge); }
.btn.accent:hover { background: #F2F200; }
.btn.ghost { background: transparent; color: var(--text-1); border-color: var(--line); }
.btn.ghost:hover { background: var(--card); border-color: var(--text-1); }
.btn.small { height: 32px; padding: 0 12px; font-size: 12px; }
.btn.big { height: 48px; font-size: 14px; padding: 0 22px; }
.btn.icon { width: 40px; padding: 0; } .btn.icon.small { width: 32px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn.on { background: var(--good-bg); color: var(--good); border-color: transparent; }
.btn.danger { background: var(--bad); border-color: var(--bad); }
.btn.danger:hover { background: #A31F1F; border-color: #A31F1F; }
.danger-text { color: var(--bad) !important; }
.danger-text:hover { border-color: var(--bad) !important; }
.spin svg.lucide, svg.lucide.spin { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { border: 0; background: none; padding: 0; font-weight: 700; font-size: 13px; color: var(--text-1); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--text-2); }
.link.small { font-size: 12px; }

.sel { height: 32px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); padding: 0 28px 0 12px; font-size: 12px; font-weight: 600; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: right 14px center, right 9px center; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.inp { width: 100%; min-width: 0; height: 38px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--sunken); padding: 0 12px; outline: 0; font-size: 14px; font-weight: 500; color: var(--text-1); transition: border-color 120ms var(--ease), background 120ms var(--ease); }
textarea.inp { height: auto; padding: 9px 12px; line-height: 1.5; resize: vertical; field-sizing: content; min-height: 62px; max-height: 420px; }
.inp:focus { border-color: var(--ink); background: var(--card); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: var(--r-ctl); background: var(--sunken); color: var(--text-3); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; min-width: 0; color: var(--text-1); font-size: 14px; }
.search.small { height: 36px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chips.center { justify-content: center; }
.warnbox { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--warn-bg); color: var(--warn); }
.warnbox.bad { background: var(--bad-bg); color: var(--bad); }
.warnbox svg.lucide { margin-top: 2px; }
.fh { font-size: 12px; color: var(--text-3); line-height: 1.45; }
.steps { padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-2); margin: 0; }
.none { font-size: 13px; color: var(--text-3); }

/* label colours (Settings picks one per label) */
.lc-green  { --lc-bg: #E7F5EC; --lc-fg: #1E7A3C; --lc-dot: #2DA160; }
.lc-red    { --lc-bg: #FDECEC; --lc-fg: #B42323; --lc-dot: #E53935; }
.lc-blue   { --lc-bg: #E6F0FA; --lc-fg: #1E5AA8; --lc-dot: #2F7BD9; }
.lc-purple { --lc-bg: #EFE9FB; --lc-fg: #5B3FA8; --lc-dot: #7C5CD6; }
.lc-amber  { --lc-bg: #FFF4D6; --lc-fg: #855600; --lc-dot: #E0A100; }
.lc-teal   { --lc-bg: #DFF4F1; --lc-fg: #0F6B63; --lc-dot: #19A397; }
.lc-pink   { --lc-bg: #FCE8F1; --lc-fg: #A2245E; --lc-dot: #D6407F; }
.lc-grey   { --lc-bg: #EEF2F2; --lc-fg: #465053; --lc-dot: #8A9597; }
.lc-none   { --lc-bg: transparent; --lc-fg: var(--text-3); --lc-dot: transparent; }
.chip[class*='lc-'] { background: var(--lc-bg); color: var(--lc-fg); }
.ldot { width: 9px; height: 9px; border-radius: 50%; background: var(--lc-dot); flex: none; }
.ldot.lc-none { box-shadow: inset 0 0 0 1.5px var(--text-3); }

/* avatars: photo over initials */
.av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; position: relative; overflow: hidden; flex: none; background: var(--lc-bg, var(--sunken)); color: var(--lc-fg, var(--text-2)); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.av img.pop-in { animation: avIn 360ms var(--ease); }
@keyframes avIn { from { opacity: 0; transform: scale(.85); } }
.av.xl { width: 88px; height: 88px; font-size: 28px; }
.av.xl svg.lucide { width: 34px; height: 34px; }

/* ================= frame ================= */
.app { height: 100dvh; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.app > main { min-height: 0; min-width: 0; }

/* ---- left panel ---- */
.side { background: var(--ink); color: #E8ECEC; display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; gap: 12px; z-index: 40; }
.side-top { display: flex; align-items: center; gap: 10px; padding: 2px 8px; min-height: 34px; }
.side-name { flex: 1; font-weight: 800; letter-spacing: .14em; font-size: 14px; color: #fff; }
.side-close { display: none; }
.side .btn.ghost { color: #D5DBDC; border-color: #2A2D2F; }
.side .btn.ghost:hover { background: #1A1C1D; border-color: #fff; color: #fff; }
.ws-pick { position: relative; }
.ws-btn { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; gap: 10px; align-items: center; padding: 8px 10px; border-radius: var(--r-tile); border: 1px solid #26292B; background: #151718; color: #fff; text-align: left; transition: border-color 120ms var(--ease), transform 180ms var(--spring); }
.ws-btn:hover { border-color: #42474A; }
.ws-btn:active { transform: scale(.98); }
.ws-ic { position: relative; width: 36px; height: 36px; border-radius: 10px; background: #232627; display: grid; place-items: center; color: var(--accent); }
.ws-dot { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: #5A6264; box-shadow: 0 0 0 2.5px #151718; transition: background 200ms var(--ease); }
.ws-dot.good { background: #3DDC84; } .ws-dot.warn { background: #FFC53D; } .ws-dot.bad { background: #FF6B5E; }
.ws-txt { min-width: 0; display: grid; }
.ws-txt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-txt small { font-size: 11.5px; color: #9AA4A6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-caret { color: #7E888A; }
.ws-menu { left: 0; right: 0; top: calc(100% + 6px); width: auto; color: var(--text-1); transform-origin: top left; }
.ws-menu button { height: auto; min-height: 44px; padding: 6px 10px; }
.ws-menu button > span { display: grid; min-width: 0; }
.ws-menu button b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-menu button small { font-size: 11.5px; color: var(--text-3); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.side-nav { flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 14px; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; scrollbar-color: #2A2D2F transparent; }
.nav-group { display: grid; gap: 1px; }
.nav-title { font-size: 11.5px; font-weight: 600; color: #7E888A; padding: 2px 10px 5px; }
.nav-item { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; height: 38px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent; color: #D5DBDC; font-size: 13.5px; font-weight: 600; text-align: left; transition: background 140ms var(--ease), color 140ms var(--ease), transform 200ms var(--spring); }
.nav-item:hover { background: #1A1C1D; color: #fff; }
.nav-item:active { transform: scale(.97); }
.nav-item.on { background: var(--accent); color: var(--on-accent); }
.nav-ic { width: 22px; height: 22px; display: grid; place-items: center; color: #9AA4A6; }
.nav-item:hover .nav-ic { color: #fff; }
.nav-item.on .nav-ic { color: var(--on-accent); }
.nav-ic .ldot { width: 10px; height: 10px; }
.nav-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item .n { font-size: 12px; font-weight: 600; color: #8A9496; font-variant-numeric: tabular-nums; }
.nav-item.on .n { color: rgba(11, 11, 12, .6); }
.nav-item.hot:not(.on) .n { color: #fff; background: var(--bad); padding: 0 7px; border-radius: var(--r-pill); height: 20px; line-height: 20px; }

.side-foot { display: grid; gap: 8px; border-top: 1px solid #222527; padding-top: 10px; }
.side-ai { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; border-radius: 10px; border: 0; background: #151718; color: #D5DBDC; font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; overflow: hidden; transition: background 120ms var(--ease); }
.side-ai:hover { background: #1D1F20; }
.side-ai span { overflow: hidden; text-overflow: ellipsis; }
.side-ai.warn { background: #3A2E10; color: #FFD866; }
.side-ai.bad { background: #3A1616; color: #FF8A80; }
.me { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 2px 2px 0 4px; }
.me-av { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.me-txt { min-width: 0; display: grid; }
.me-txt b { font-size: 13px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-txt small { font-size: 11.5px; color: #8A9496; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scrim { display: none; }

/* ================= inbox ================= */
.inbox { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 12px; padding: 12px; position: relative; overflow: clip; }
.app[data-info='open'] .inbox { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) 340px; }
.pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* ---- list ---- */
.list-pane { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.list-head { padding: 14px 12px 10px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.list-title { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 4px; }
.list-title h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-n { font-size: 13px; font-weight: 600; color: var(--text-3); }
.menu-btn { display: none; flex: none; }
.filters-wrap { position: relative; min-width: 0; display: none; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; user-select: none; -webkit-user-select: none; cursor: grab; overscroll-behavior-x: contain; }
.filters::-webkit-scrollbar { display: none; }
.filters.dragging { cursor: grabbing; }
.filters.dragging .chip { pointer-events: none; }
.filters .chip { flex: none; height: 30px; padding: 0 12px; background: var(--sunken); border: 1px solid transparent; transition: transform 180ms var(--spring), background 160ms var(--ease), color 160ms var(--ease); }
.filters .chip:active { transform: scale(.94); }
.filters .chip .n { color: var(--text-3); font-weight: 500; }
.filters .chip .n:empty { display: none; }
.filters .chip[aria-selected='true'] { background: var(--ink); color: #fff; }
.filters .chip[aria-selected='true'] .n { color: #A9B3B5; }
.filters .chip[aria-selected='true'] .ldot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.filters .chip.f-waiting[aria-selected='true'] { background: var(--accent); color: var(--on-accent); border-color: var(--accent-edge); }
.filters .chip.f-waiting[aria-selected='true'] .n { color: var(--text-2); }
.filters .chip.f-urgent.hot:not([aria-selected='true']) { background: var(--bad-bg); color: var(--bad); }
.filters .chip.f-urgent.hot:not([aria-selected='true']) .n { color: var(--bad); }
.filters .chip.f-urgent[aria-selected='true'] { background: var(--bad); color: #fff; }
.filters-wrap.can-l .filters { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px); mask-image: linear-gradient(90deg, transparent 0, #000 36px); }
.filters-wrap.can-r .filters { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, #000 calc(100% - 36px), transparent 100%); }
.filters-wrap.can-l.can-r .filters { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%); }

.banner { margin: 8px 10px 0; padding: 8px 10px 8px 12px; font-size: 12.5px; font-weight: 600; border-radius: var(--r-ctl); background: var(--warn-bg); color: var(--warn); display: flex; gap: 8px; align-items: center; animation: openIn 320ms var(--ease); }
.banner span { flex: 1; min-width: 0; }
.banner.bad { background: var(--bad-bg); color: var(--bad); }
.banner .btn { flex: none; }

.chat-list { overflow-y: auto; flex: 1; padding: 6px; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 10px; border: 0; border-radius: var(--r-tile); background: transparent; transition: background 120ms var(--ease), transform 180ms var(--spring); }
.row:hover { background: var(--sunken); }
.row:active { transform: scale(.985); }
.row.active { background: var(--sunken); box-shadow: inset 3px 0 0 var(--ink); }
.row .av { width: 44px; height: 44px; }
.row-main { min-width: 0; display: grid; gap: 2px; }
.row-top { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-prev { font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-prev .me { color: var(--text-3); }
.row-prev .pv-ic { width: 13px; height: 13px; vertical-align: -2px; margin-right: 3px; color: var(--text-3); }
.row-side { display: grid; justify-items: end; gap: 4px; align-self: start; padding-top: 2px; }
.row-time { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.row .chip { height: 20px; padding: 0 8px; font-size: 11px; }
.row-tags { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 2px; }
.row-tags .chip { flex: none; }
.row-head { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--accent-edge); }
.wait { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 7px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.wait.late { background: #FFE2B8; color: #8A4B00; box-shadow: none; }
.wait svg.lucide { width: 12px; height: 12px; }
.list-empty { padding: 40px 16px; text-align: center; color: var(--text-3); display: grid; gap: 8px; justify-items: center; }
.list-empty svg.lucide { width: 28px; height: 28px; }

/* ---- conversation ---- */
.convo-pane { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.convo-empty { flex: 1; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--text-3); }
.convo-empty svg.lucide { width: 36px; height: 36px; }
.convo { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.convo-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); min-width: 0; }
.who-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 8px 4px 4px; border-radius: var(--r-ctl); text-align: left; transition: background 120ms var(--ease); }
.who-btn:hover { background: var(--sunken); }
.who-btn .av { width: 38px; height: 38px; font-size: 13px; }
.who { min-width: 0; display: grid; }
.who-name { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.who-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-sub:empty { display: none; }
.convo-actions { display: flex; gap: 6px; align-items: center; flex: none; }
#infoBtn.on { background: var(--ink); color: var(--accent); border-color: var(--ink); }
.back { display: none; flex: none; }

.msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--sunken); }
.day { align-self: center; font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--card); padding: 3px 10px; border-radius: var(--r-pill); margin: 8px 0; }
.more { align-self: center; margin-bottom: 4px; }
.bub { max-width: min(78%, 560px); padding: 8px 12px 6px; border-radius: 16px; background: var(--card); box-shadow: 0 1px 1px rgba(18, 38, 43, .06); overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; align-items: flex-start; }
.bub > * { max-width: 100%; }
.bub.in { align-self: flex-start; border-bottom-left-radius: 6px; }
.bub.out { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; }
.bub .txt { white-space: pre-wrap; display: block; }
.bub .meta { align-self: flex-end; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.bub.out .meta { color: #A9B3B5; }
.bub .sender { font-size: 11px; font-weight: 700; color: #1E5AA8; margin-bottom: 2px; }
.bub .quote { display: block; align-self: stretch; font-size: 12px; padding: 4px 8px; border-left: 3px solid var(--accent); background: rgba(0, 0, 0, .04); border-radius: 6px; margin-bottom: 4px; color: var(--text-2); white-space: pre-wrap; }
.bub.out .quote { background: rgba(255, 255, 255, .08); color: #C9D0D1; }
.bub .fwd { font-size: 11px; font-style: italic; color: var(--text-3); }
.bub .media { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 8px; background: var(--sunken); color: var(--text-2); margin-bottom: 2px; }
.bub.out .media { background: #232627; color: #E8ECEC; }
.bub.has-visual { padding: 4px 4px 6px; }
.bub.has-visual .txt { padding: 6px 8px 0; }
.bub.has-visual .meta { padding: 0 8px; }
.bub.has-visual .sender, .bub.has-visual .fwd { padding: 2px 8px 0; }
.bub.bare { background: transparent; box-shadow: none; padding: 0; }
.bub.bare .meta { color: var(--text-3); }

/* photos */
.mimg { display: block; position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; width: 280px; max-width: 100%; min-height: 160px; background: linear-gradient(90deg, var(--sunken) 0%, #fff 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; cursor: zoom-in; }
.bub.out .mimg:not(.loaded) { background: linear-gradient(90deg, #1D2021 0%, #2A2E2F 50%, #1D2021 100%); background-size: 200% 100%; }
.mimg img { display: block; width: 100%; max-height: 380px; object-fit: cover; }
.mimg.loaded { min-height: 0; background: none; animation: none; }
.mimg.loaded img { animation: avIn 320ms var(--ease); }
.mimg-err { display: none; }
.mimg.broken { cursor: default; animation: none; background: var(--sunken); min-height: 110px; }
.bub.out .mimg.broken { background: #1D2021; }
.mimg.broken img { display: none; }
.mimg.broken .mimg-err { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.mimg.sticker { width: 150px; background: transparent; animation: none; min-height: 0; cursor: default; }
/* videos */
.mvid { position: relative; display: grid; place-items: center; width: 280px; max-width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: 12px; background: radial-gradient(120% 120% at 100% 0%, #2A2E2F 0%, #0B0B0C 70%); color: #fff; cursor: pointer; }
.mvid-play { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; transition: transform 240ms var(--spring); box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .6); }
.mvid-play svg.lucide { width: 22px; height: 22px; margin-left: 3px; fill: currentColor; }
.mvid:hover .mvid-play { transform: scale(1.08); }
.mvid:active .mvid-play { transform: scale(.94); }
.mvid-meta { position: absolute; left: 10px; bottom: 8px; display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; font-weight: 600; color: #C9D0D1; }
.mvid-meta svg.lucide { width: 13px; height: 13px; }
/* voice notes */
.maud { display: grid; grid-template-columns: 38px minmax(110px, 1fr) auto; gap: 10px; align-items: center; width: 260px; max-width: 100%; padding: 2px 0 2px; }
.maud-play { width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; background: var(--ink); color: #fff; display: grid; place-items: center; transition: transform 220ms var(--spring); }
.maud-play:active { transform: scale(.9); }
.maud-play svg.lucide { fill: currentColor; width: 15px; height: 15px; }
.maud-play .i-play { margin-left: 2px; }
.bub.out .maud-play { background: var(--accent); color: var(--on-accent); }
.maud .i-pause { display: none; }
.maud.playing .i-pause { display: block; }
.maud.playing .i-play { display: none; }
.maud-bar { position: relative; height: 22px; cursor: pointer; display: flex; align-items: center; }
.maud-bar::before { content: ''; position: absolute; left: 0; right: 0; height: 5px; border-radius: var(--r-pill); background: var(--line); }
.bub.out .maud-bar::before { background: #33383A; }
.maud-fill { position: absolute; left: 0; height: 5px; width: 0; border-radius: var(--r-pill); background: var(--ink); transition: width 160ms linear; }
.maud-fill::after { content: ''; position: absolute; right: -6px; top: -4px; width: 13px; height: 13px; border-radius: 50%; background: inherit; opacity: 0; transform: scale(.5); transition: opacity 160ms var(--ease), transform 260ms var(--spring); }
.maud.active .maud-fill::after { opacity: 1; transform: none; }
.bub.out .maud-fill { background: var(--accent); }
.maud-time { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-3); min-width: 32px; display: inline-flex; justify-content: flex-end; }
.bub.out .maud-time { color: #A9B3B5; }
.maud-time svg.lucide { width: 14px; height: 14px; }
/* transcripts */
.tx { margin-top: 6px; font-size: 13px; align-self: stretch; }
.bub.has-visual .tx { padding: 0 4px; }
.tx-btn { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 600; color: var(--text-2); transition: transform 180ms var(--spring), border-color 120ms var(--ease); }
.tx-btn:hover { border-color: var(--text-1); }
.tx-btn:active { transform: scale(.95); }
.tx-btn svg.lucide { width: 13px; height: 13px; }
.bub.out .tx-btn { border-color: #35393B; color: #C9D0D1; }
.tx-wait { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; color: var(--text-3); }
.tx-wait svg.lucide { width: 14px; height: 14px; }
.tx-text { display: block; padding: 8px 10px; border-radius: 10px; background: var(--sunken); line-height: 1.45; white-space: pre-wrap; animation: openIn 320ms var(--ease); }
.bub.out .tx-text { background: #1D2021; color: #E8ECEC; }
.tx-tag { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 2px; }
.tx-tag svg.lucide { width: 12px; height: 12px; }
.tx-fail { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; font-weight: 600; color: var(--bad); }
.tx-fail svg.lucide { width: 13px; height: 13px; }
.bub.out .tx-fail { color: #FF8A80; }
.bub.out .tx-fail .link { color: #fff; }
/* files */
.mdoc { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px; border-radius: 12px; background: var(--sunken); width: 300px; max-width: 100%; margin-bottom: 2px; }
.mdoc-main { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; min-width: 0; text-align: left; color: inherit; font: inherit; background: none; border: 0; padding: 0; border-radius: 10px; }
button.mdoc-main { cursor: pointer; transition: transform .25s var(--spring); }
button.mdoc-main:active { transform: scale(.97); }
button.mdoc-main:hover .mdoc-txt b { text-decoration: underline; }
.mdoc-txt small { white-space: nowrap; }
.bub.out .mdoc { background: #1D2021; }
.mdoc-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--card); color: var(--text-2); }
.mdoc-ic.pdf { background: #FDECEC; color: #C62828; }
.mdoc-txt { min-width: 0; display: grid; }
.mdoc-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdoc-txt small { font-size: 11.5px; color: var(--text-3); }
.bub.out .mdoc-txt small { color: #A9B3B5; }
.mdoc .btn.ghost { background: var(--card); }
.bub.out .mdoc .btn.ghost { background: transparent; color: #fff; border-color: #35393B; }
.bub.out .mdoc .btn.ghost:hover { border-color: #fff; }

/* ---- suggestions + composer ---- */
.assist { border-top: 1px solid var(--line); padding: 10px 12px 4px; display: grid; gap: 8px; }
.assist-head { display: flex; align-items: center; justify-content: space-between; }
.assist-title { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--text-2); }
.assist-body { display: grid; gap: 8px; }
.assist-tools { display: flex; gap: 4px; }
#foldBtn svg { transition: transform 260ms var(--spring); }
.assist.folded .assist-body { display: none; }
.assist.folded #foldBtn svg { transform: rotate(180deg); }
.assist.folded { padding-bottom: 6px; }
.sugs { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; max-height: 210px; overflow-y: auto; }
.sug { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: var(--r-tile); padding: 10px 12px; display: grid; gap: 6px; transition: border-color 120ms var(--ease), transform 180ms var(--spring), box-shadow 120ms var(--ease); }
.sug:hover { border-color: var(--ink); box-shadow: var(--shadow); }
.sug:active { transform: scale(.98); }
.sug-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sug-label { font-size: 11.5px; font-weight: 700; color: var(--text-3); }
.sug-use { font-size: 11px; font-weight: 700; display: inline-flex; gap: 4px; align-items: center; }
.sug-text { font-size: 13.5px; white-space: pre-wrap; line-height: 1.4; }
.missing { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-3); }
.assist-note { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 8px; padding: 2px 0 6px; }
.skel { height: 64px; border-radius: var(--r-tile); background: linear-gradient(90deg, var(--sunken) 0%, #fff 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.composer { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 8px 12px 4px; }
.composer textarea { flex: 1; resize: none; min-height: 44px; max-height: 180px; padding: 11px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--sunken); outline: 0; font-size: 14px; line-height: 1.45; min-width: 0; }
.composer textarea:focus { border-color: var(--ink); background: var(--card); }
.composer .send { height: 44px; padding: 0 18px; }
.qr-btn { height: 44px; width: 44px; flex: none; }
.composer-note { font-size: 11px; color: var(--text-3); padding: 0 16px 10px; }
.composer-note:empty { padding-bottom: 6px; }

/* ---- popovers ---- */
.pick { position: relative; }
.lbl-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card); color: var(--text-2); font-size: 12px; font-weight: 700; max-width: 180px; transition: transform 180ms var(--spring), border-color 120ms var(--ease); }
.lbl-btn[class*='lc-'] { background: var(--lc-bg); color: var(--lc-fg); border-color: transparent; }
.lbl-btn:hover { border-color: var(--text-1); }
.lbl-btn:active { transform: scale(.95); }
.lbl-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lbl-btn .by { width: 12px; height: 12px; opacity: .7; }
.lbl-btn .caret { width: 14px; height: 14px; opacity: .7; transition: transform 240ms var(--spring); }
.lbl-btn[aria-expanded='true'] .caret { transform: rotate(180deg); }
.pop { position: absolute; z-index: 30; background: var(--card); border-radius: var(--r-tile); box-shadow: var(--shadow-pop); border: 1px solid var(--line); }
.pop-anim { animation: popIn 260ms var(--spring); transform-origin: top right; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
.menu { right: 0; top: calc(100% + 6px); width: 220px; padding: 6px; display: grid; gap: 2px; }
.menu button { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.menu button:hover, .menu button[aria-checked='true'] { background: var(--sunken); }
.menu button > span:not(.ldot) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-hint { font-size: 11.5px; color: var(--text-3); padding: 6px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.qr-pop { left: 12px; right: 12px; bottom: calc(100% + 6px); max-height: min(360px, 52vh); display: grid; grid-template-rows: auto minmax(0, 1fr); padding: 8px; gap: 6px; transform-origin: bottom left; }
.qr-list { overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.qr-item { display: grid; gap: 2px; text-align: left; border: 0; background: transparent; border-radius: 10px; padding: 8px 10px; }
.qr-item.on, .qr-item:hover { background: var(--sunken); }
.qr-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.qr-body { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qr-none { padding: 14px 10px; font-size: 13px; color: var(--text-3); }

/* ---- right panel: contact info ---- */
.info-pane { display: none; background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.app[data-info='open'] .info-pane { display: flex; animation: infoIn 420ms var(--ease); }
@keyframes infoIn { from { opacity: 0; transform: translateX(16px); } }
.info { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.info-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.info-head h3 { flex: 1; font-size: 15px; font-weight: 800; }
.info-scroll { overflow-y: auto; padding: 16px; display: grid; gap: 14px; align-content: start; }
.info-who { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 4px 0 2px; }
.info-name { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.info-sub { font-size: 13px; color: var(--text-3); }
.info-sub:empty { display: none; }
.info-sec { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.info-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.info-sec-head > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.info-sec-head .n { color: var(--text-3); font-weight: 600; }
.headline { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -0.005em; }
.headline.empty { color: var(--text-3); font-weight: 500; font-size: 13.5px; }
.kv { margin: 0; display: grid; gap: 6px; }
.kv-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: var(--r-ctl); background: var(--sunken); }
.kv-row dt { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; color: var(--text-3); white-space: nowrap; }
.kv-row dt svg.lucide { width: 13px; height: 13px; }
.kv-row dd { margin: 0; font-size: 13.5px; font-weight: 600; }
.mem-when { font-size: 11.5px; color: var(--text-3); }
.mem-when:empty { display: none; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.fact { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 6px 6px 8px; border-radius: 10px; font-size: 13.5px; transition: background 120ms var(--ease); }
.fact:hover { background: var(--sunken); }
.fact-k { font-size: 12px; font-weight: 700; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; outline: 0; border-radius: 6px; padding: 1px 2px; min-height: 18px; }
.fact-k:empty::before { content: attr(data-ph); color: #B5BEC0; font-weight: 500; }
.fact.nolabel:not(:hover) .fact-k:not(:focus):empty::before { content: '·'; }
.fact-v { font-weight: 600; outline: 0; border-radius: 6px; padding: 1px 2px; overflow-wrap: anywhere; }
.fact-k:focus, .fact-v:focus { background: var(--card); box-shadow: 0 0 0 1px var(--ink); white-space: normal; }
.fact-tools { display: flex; align-items: center; align-self: center; }
.fact-tools .src { width: 18px; display: grid; place-items: center; color: #B5BEC0; }
.fact-tools .src svg.lucide { width: 12px; height: 12px; }
.fact-tools button { width: 26px; height: 26px; border: 0; border-radius: 50%; background: transparent; display: grid; place-items: center; color: var(--text-2); opacity: 0; transition: opacity 120ms var(--ease), background 120ms var(--ease); }
.fact:hover .fact-tools button, .fact.pinned .fact-tools .pin, .fact:focus-within .fact-tools button { opacity: 1; }
@media (hover: none) { .fact-tools button { opacity: .55; } }
.fact-tools button:hover { background: var(--card); color: var(--text-1); }
.fact.pinned .pin svg { fill: var(--accent); color: var(--text-1); }
.fact-tools svg.lucide { width: 14px; height: 14px; }
.facts .none { padding: 4px 8px; }
.add-fact { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; gap: 6px; }
.add-fact input { height: 36px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--sunken); padding: 0 10px; outline: 0; font-size: 13.5px; min-width: 0; width: 100%; }
.add-fact input:focus { border-color: var(--ink); background: var(--card); }
#noteInput { min-height: 72px; font-size: 13.5px; }
.sh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.sh-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; border-radius: 10px; overflow: hidden; background: var(--sunken); cursor: zoom-in; transition: transform 200ms var(--spring); }
.sh-tile:active { transform: scale(.95); }
.sh-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-tile.broken img { display: none; }
.sh-vid { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(120% 120% at 100% 0%, #2A2E2F 0%, #0B0B0C 70%); color: var(--accent); }
.sh-vid svg.lucide { width: 20px; height: 20px; fill: currentColor; }
.sh-files { display: grid; gap: 2px; margin-top: 6px; }
.sh-file { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px; border: 0; border-radius: 10px; background: transparent; text-align: left; transition: background 120ms var(--ease); }
.sh-file:hover { background: var(--sunken); }
.sh-file-ic { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--text-2); }
.sh-file-ic.pdf { background: #FDECEC; color: #C62828; }
.sh-file-txt { min-width: 0; display: grid; }
.sh-file-txt b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-file-txt small { font-size: 11.5px; color: var(--text-3); }

/* ---- viewer: photo, video, PDF ---- */
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(11, 11, 12, .95); color: #fff; }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); animation: fadeIn 200ms var(--ease); }
.viewer::backdrop { background: transparent; }
@keyframes fadeIn { from { opacity: 0; } }
.viewer-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.viewer-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 4px; }
.viewer .btn.ghost { color: #fff; border-color: #35393B; }
.viewer .btn.ghost:hover { background: #1D1F20; border-color: #fff; }
.viewer-body { display: grid; place-items: center; padding: 0 12px 12px; min-height: 0; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 100%; border-radius: 12px; animation: pop 360ms var(--spring); }
.viewer-body iframe { width: min(100%, 1000px); height: 100%; border: 0; border-radius: 12px; background: #fff; }

/* ================= link a WhatsApp ================= */
.onboard { display: grid; place-items: center; padding: 24px; overflow-y: auto; position: relative; }
.onboard-menu { position: absolute; top: 12px; left: 12px; }
.onboard-card { width: min(100%, 520px); background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); padding: 28px; display: grid; gap: 14px; justify-items: start; animation: pop 420ms var(--spring); }
.onboard-card h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.onboard-card p { color: var(--text-2); font-size: 14px; }
.onboard-card .fh { font-size: 12.5px; color: var(--text-3); }
.ob-ic { width: 52px; height: 52px; border-radius: 16px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--accent-edge); }
.ob-ic svg.lucide { width: 24px; height: 24px; }
.ob-pair { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; align-items: center; width: 100%; }
.qr-box { aspect-ratio: 1; width: 100%; display: grid; place-items: center; background: #fff; border-radius: var(--r-tile); border: 1px solid var(--line); overflow: hidden; }
.qr-box img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; grid-area: 1 / 1; animation: avIn 320ms var(--ease); }
.qr-box span { grid-area: 1 / 1; color: var(--text-3); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }

/* ================= settings (opened from the left panel) ================= */
.settings { display: grid; padding: 12px; }
.set-page { background: var(--card); border-radius: var(--r-card); box-shadow: var(--shadow); min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.set-head { display: flex; align-items: flex-start; gap: 10px; padding: 18px 22px 12px; border-bottom: 1px solid var(--line); }
.set-back { display: none; flex: none; }
.set-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.set-head p { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.set-body { overflow-y: auto; padding: 16px 22px 28px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.set-body > * { max-width: 760px; width: 100%; }
.set-card { border: 1px solid var(--line); border-radius: var(--r-tile); padding: 14px; display: grid; gap: 10px; }
.set-card.locked { background: var(--sunken); border-color: transparent; }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; }
.set-actions .fh { flex-basis: 100%; }
.hint { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.fl { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.fl > span small, .fl-title small { font-weight: 500; color: var(--text-3); margin-left: 4px; }
.fl-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 13.5px; font-weight: 700; }
.fl-title small { flex-basis: 100%; margin: 0; font-size: 12px; }
.btn.add { justify-self: start; }
.empty-line { font-size: 13px; color: var(--text-3); padding: 10px 2px; }
.sortlist { display: grid; gap: 8px; }
.sortlist > [data-i] { transition: transform 220ms var(--ease), box-shadow 160ms var(--ease); }
.sortlist.sorting > [data-i] { user-select: none; }
.sortlist > .lifted { transition: box-shadow 160ms var(--ease); z-index: 3; position: relative; box-shadow: var(--shadow-pop); background: var(--card); }
.grip { width: 24px; height: 32px; display: grid; place-items: center; color: #A4AEB0; cursor: grab; touch-action: none; flex: none; border-radius: 8px; }
.grip:hover { color: var(--text-1); background: var(--sunken); }
.sorting .grip { cursor: grabbing; }
.switch { width: 40px; height: 24px; border-radius: var(--r-pill); border: 0; padding: 0; background: #CFD7D8; position: relative; flex: none; transition: background 160ms var(--ease); }
.switch span { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform 300ms var(--spring), width 200ms var(--ease); }
.switch[aria-checked='true'] { background: var(--ink); }
.switch[aria-checked='true'] span { transform: translateX(16px); background: var(--accent); }
.switch:active span { width: 22px; }
.switch[aria-checked='true']:active span { transform: translateX(12px); }
.lcard { border: 1px solid var(--line); border-radius: var(--r-tile); background: var(--card); }
.lcard.off .lcard-title .chip { opacity: .5; }
.lcard-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 6px; }
.lcard-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 4px 0; text-align: left; }
.lcard-title .chip { height: 30px; padding: 0 12px; font-size: 13px; }
.lcard-title .chip svg.lucide { width: 14px; height: 14px; }
.lcard-sum { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.caret-btn svg { transition: transform 260ms var(--spring); }
.lcard.open .caret-btn svg { transform: rotate(180deg); }
.lcard-body { display: grid; gap: 12px; padding: 14px; border-top: 1px solid var(--line); animation: openIn 320ms var(--ease); }
@keyframes openIn { from { opacity: 0; transform: translateY(-4px); } }
.lcard-foot { display: flex; justify-content: flex-end; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--lc-dot); box-shadow: inset 0 0 0 3px var(--lc-bg); transition: transform 200ms var(--spring); }
.swatch:hover { transform: scale(1.08); }
.swatch[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 4px; }
.iconpick button { height: 36px; border-radius: 10px; border: 1px solid transparent; background: var(--sunken); display: grid; place-items: center; color: var(--text-2); transition: transform 180ms var(--spring); }
.iconpick button:hover { color: var(--text-1); border-color: var(--line); }
.iconpick button:active { transform: scale(.92); }
.iconpick button[aria-pressed='true'] { background: var(--ink); color: var(--accent); }
.rrow { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: var(--r-tile); padding: 8px 8px 8px 6px; background: var(--card); }
.rrow.off .rrow-main { opacity: .5; }
.rrow-main { flex: 1; min-width: 0; display: grid; grid-template-columns: 150px minmax(0, 1fr) 16px 150px; gap: 8px; align-items: center; }
.rrow .sel { height: 38px; font-size: 12.5px; width: 100%; }
.rrow .arrow { color: var(--text-3); }
.try { margin-top: 6px; }
.try-out { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; min-height: 26px; }
.try-hit { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.qcard { border: 1px solid var(--line); border-radius: var(--r-tile); padding: 8px 10px 10px 6px; display: grid; gap: 8px; background: var(--card); }
.qcard-head { display: flex; align-items: center; gap: 8px; }
.qcard-head .title { flex: 1; font-weight: 700; }
.qcard-head .sel { height: 38px; flex: 0 0 150px; min-width: 0; }
.qcard textarea { margin-left: 32px; width: calc(100% - 32px); }
.kvlist { display: grid; gap: 6px; }
.kvrow { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.kvrow.one { grid-template-columns: minmax(0, 1fr) auto; }
.kvrow .k { font-weight: 700; }
.ticks { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.ticks li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; align-items: start; }
.ticks svg.lucide { margin-top: 2px; color: var(--good); }
.facts-tbl { margin: 0; display: grid; }
.facts-tbl > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.facts-tbl > div:last-child { border-bottom: 0; }
.facts-tbl dt { font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.facts-tbl dd { margin: 0; font-size: 14px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.hours { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.hours .inp { width: 130px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.daychip { height: 32px; padding: 0 12px; border: 1px solid var(--line); background: var(--card); color: var(--text-2); cursor: pointer; transition: transform 180ms var(--spring), background 120ms var(--ease); }
.daychip:active { transform: scale(.94); }
.daychip[aria-pressed='true'] { background: var(--ink); color: #fff; border-color: var(--ink); }
.numrow { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-3); }
.inp.num { width: 100px; }
.chipin { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--sunken); }
.chipin:focus-within { border-color: var(--ink); background: var(--card); }
.chipin .chip { height: 28px; padding: 0 4px 0 10px; gap: 2px; }
.chipin .chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; }
.chipin .chip button:hover { background: rgba(0, 0, 0, .08); }
.chipin input { flex: 1 1 140px; min-width: 120px; height: 28px; border: 0; outline: 0; background: transparent; font-size: 13.5px; padding: 0 6px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.toggle-row + .toggle-row { border-top: 1px solid var(--line); padding-top: 12px; }
.toggle-row b { font-size: 14px; }
.keyline { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }
.set-row { display: flex; gap: 8px; align-items: center; }
.money { display: flex; align-items: center; gap: 6px; flex: 0 1 180px; font-weight: 600; font-size: 13px; }
.team { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.team li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border-radius: var(--r-ctl); background: var(--sunken); }
.team li.muted { display: block; background: transparent; padding: 4px 2px; font-size: 13px; }
.team .who-line { min-width: 0; display: grid; }
.team .who-line b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .who-line span { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team .acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.savebar { display: flex; align-items: center; gap: 8px; padding: 10px 22px; border-top: 1px solid var(--line); background: var(--card); animation: barIn 320ms var(--spring); }
@keyframes barIn { from { transform: translateY(100%); } }
.savebar-text { flex: 1; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--warn); }
.savebar-text svg.lucide { color: var(--warn); }

/* ---- dialogs + toasts ---- */
.dlg { border: 0; border-radius: var(--r-card); padding: 20px; width: min(92vw, 380px); box-shadow: var(--shadow-pop); }
.dlg::backdrop { background: rgba(11, 11, 12, .45); }
.dlg h3 { font-size: 18px; font-weight: 800; }
.dlg-body { display: grid; gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ask-text { font-size: 14px; color: var(--text-2); line-height: 1.5; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--r-ctl); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-pop); animation: pop 320ms var(--spring); pointer-events: auto; }
.toast.bad { background: var(--bad); }
.toast.good { background: var(--good); }
@keyframes pop { from { transform: translateY(10px) scale(.96); opacity: 0; } }

/* ================= login / sign up: split card ================= */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--bg); overflow-y: auto; }
body:has(.auth:not([hidden])) { overflow: auto; }
.auth-card { width: min(100%, 940px); min-height: 580px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--card); border-radius: 28px; box-shadow: var(--shadow-pop); overflow: hidden; animation: pop 460ms var(--spring); }
.auth-art { position: relative; overflow: hidden; margin: 10px; border-radius: 20px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; color: #fff;
  background: radial-gradient(110% 80% at 0% 100%, rgba(255, 255, 0, .62) 0%, rgba(255, 255, 0, .16) 38%, rgba(255, 255, 0, 0) 62%), linear-gradient(160deg, #1D2021 0%, #0B0B0C 64%); }
.auth-glow { position: absolute; right: -40px; bottom: -60px; height: 78%; aspect-ratio: 412 / 539; background: url('/assets/logos/b-mark-yellow.png') center / contain no-repeat; opacity: .07; pointer-events: none; }
.auth-brand { position: relative; display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .14em; font-size: 14px; }
.auth-brand .bmark { height: 34px; }
.auth-pitch { position: relative; }
.auth-pitch h1 { font-size: 36px; line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 20px; }
.auth-pitch ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: 14px; font-weight: 500; color: #E3E8E9; }
.auth-pitch li { display: flex; gap: 10px; align-items: center; }
.auth-pitch li svg.lucide { color: var(--accent); width: 18px; height: 18px; }
.auth-form { padding: 48px 46px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.auth-form h2 { font-size: 30px; font-weight: 800; letter-spacing: -0.025em; }
.auth-form > .muted { font-size: 14px; }
.auth-form form { display: grid; gap: 14px; margin-top: 22px; }
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.field input { width: 100%; height: 48px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--sunken); padding: 0 14px; outline: 0; font-size: 15px; color: var(--text-1); transition: border-color 120ms var(--ease), background 120ms var(--ease), box-shadow 160ms var(--ease); }
.field input:focus { border-color: var(--ink); background: var(--card); box-shadow: 0 0 0 4px rgba(255, 255, 0, .45); }
.pass { position: relative; display: block; }
.pass input { padding-right: 50px; }
.eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-3); display: grid; place-items: center; transition: color 120ms var(--ease), background 120ms var(--ease); }
.eye:hover { color: var(--text-1); background: var(--card); }
.auth-form .btn.big { width: 100%; margin-top: 4px; }
.auth-msg { font-size: 13px; font-weight: 500; padding: 8px 12px; border-radius: var(--r-ctl); background: var(--bad-bg); color: var(--bad); }
.auth-msg.good { background: var(--good-bg); color: var(--good); }
.auth-switch { margin-top: 18px; font-size: 13.5px; color: var(--text-3); text-align: center; }

/* ================= ≤1439: contact info slides over the conversation ================= */
@media (max-width: 1439px) {
  .app[data-info='open'] .inbox { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); }
  .info-pane { display: flex; position: absolute; top: 12px; right: 12px; bottom: 12px; width: min(360px, calc(100% - 24px)); z-index: 20; box-shadow: var(--shadow-pop); transform: translateX(calc(100% + 24px)); visibility: hidden; transition: transform 420ms var(--ease), visibility 0s linear 420ms; }
  .app[data-info='open'] .info-pane { transform: none; visibility: visible; transition: transform 420ms var(--ease); animation: none; }
}

/* ================= ≤1179: left panel becomes a drawer ================= */
@media (max-width: 1179px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: 0; left: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform 420ms var(--ease), box-shadow 420ms var(--ease); padding-top: max(14px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .app[data-nav='open'] .side { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .35); }
  .side-close { display: inline-flex; }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(11, 11, 12, .42); z-index: 35; opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease); }
  .app[data-nav='open'] .scrim { opacity: 1; pointer-events: auto; }
  .menu-btn, .set-back { display: inline-flex; }
  .filters-wrap { display: block; }
  .list-head { padding-top: 10px; }
  .list-title { padding: 0; }
  .rrow-main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .rrow-main .arrow { display: none; }
  .rrow-main [data-f='phrase'] { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 980px) {
  .inbox { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
  .app[data-info='open'] .inbox { grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
  .kvrow { grid-template-columns: 130px minmax(0, 1fr) auto; }
  .auth-card { grid-template-columns: 1fr 1.1fr; }
  .auth-form { padding: 40px 32px; }
  .auth-pitch h1 { font-size: 30px; }
}

/* ================= phone: one pane at a time ================= */
@media (max-width: 760px) {
  .inbox, .app[data-info='open'] .inbox { grid-template-columns: minmax(0, 1fr); padding: 0; gap: 0; }
  .list-pane, .convo-pane { border-radius: 0; box-shadow: none; }
  .app[data-pane='list'] .convo-pane { display: none; }
  .app[data-pane='chat'] .list-pane { display: none; }
  .back { display: inline-flex; }
  .convo-head { padding: 8px 8px 8px 6px; gap: 4px; }
  .who-btn { padding: 2px 4px; gap: 8px; }
  .who-btn .av { width: 34px; height: 34px; }
  .who-name { font-size: 15px; }
  #doneBtn span { display: none; }
  #doneBtn { width: 32px; padding: 0; }
  .lbl-btn { max-width: 120px; padding: 0 8px 0 10px; }
  .lbl-btn .by { display: none; }
  .msgs { padding: 12px 10px; }
  .bub { max-width: 86%; }
  .mimg, .mvid { width: 240px; }
  .maud { width: 230px; }
  .mdoc { width: 260px; }
  .assist { padding: 8px 8px 2px; gap: 6px; }
  .sugs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 86%; overflow-x: auto; overflow-y: hidden; max-height: none; scroll-snap-type: x mandatory; padding-bottom: 2px; }
  .sug { scroll-snap-align: start; padding: 8px 10px; gap: 4px; }
  .sug-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .missing { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .missing > span:first-child { flex: none; }
  .composer { padding: 8px 8px 4px; }
  .composer .send span { display: none; }
  .composer .send { width: 44px; padding: 0; }
  .composer-note { padding: 0 12px calc(8px + env(safe-area-inset-bottom)); }
  .qr-pop { left: 8px; right: 8px; }
  .row-head { display: none; }
  .info-pane { position: fixed; inset: 0; top: 0; right: 0; bottom: 0; width: auto; border-radius: 0; z-index: 30; transform: translateX(100%); }
  .info-head { padding-top: max(12px, env(safe-area-inset-top)); }
  .settings { padding: 0; }
  .set-page { border-radius: 0; box-shadow: none; }
  .set-head { padding: 10px 12px; align-items: center; }
  .set-head h2 { font-size: 17px; }
  .set-head p { display: none; }
  .set-body { padding: 12px 12px 24px; }
  .savebar { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
  .kvrow { grid-template-columns: minmax(0, 1fr) auto; }
  .kvrow .k { grid-column: 1 / 2; }
  .kvrow .k + .inp { grid-column: 1 / 2; }
  .kvrow .del { grid-column: 2; grid-row: 1 / span 2; }
  .qcard-head { flex-wrap: wrap; }
  .qcard-head .title { flex: 1 1 140px; }
  .qcard-head .sel { flex: 1 1 120px; }
  .qcard textarea { margin-left: 0; width: 100%; }
  .facts-tbl > div { grid-template-columns: 84px minmax(0, 1fr); }
  .team li { grid-template-columns: minmax(0, 1fr); }
  .team .acts { justify-content: flex-start; }
  .onboard { padding: 64px 12px 16px; place-items: start center; }
  .onboard-card { padding: 22px 18px; }
  .ob-pair { grid-template-columns: minmax(0, 1fr); }
  .ob-pair .qr-box { width: min(100%, 280px); justify-self: center; }
  .auth { padding: 12px; place-items: start center; }
  .auth-card { grid-template-columns: minmax(0, 1fr); min-height: 0; border-radius: 24px; }
  .auth-art { padding: 20px; gap: 18px; min-height: 0; }
  .auth-pitch h1 { font-size: 24px; margin-bottom: 0; }
  .auth-pitch ul { display: none; }
  .auth-glow { height: 120%; right: -30px; bottom: -40px; }
  .auth-form { padding: 22px 20px 24px; }
  .auth-form h2 { font-size: 24px; }
  .auth-form form { margin-top: 16px; }
}
@media (max-width: 420px) {
  .who-btn .av { display: none; }
  .rrow { flex-wrap: wrap; }
  .rrow-main { flex-basis: calc(100% - 32px); grid-template-columns: minmax(0, 1fr); }
  .rrow-main [data-f='phrase'] { grid-column: auto; grid-row: auto; }
  .rrow .switch { margin-left: 32px; }
  .rrow .del { margin-left: auto; }
  .set-row { flex-wrap: wrap; }
  .set-row .btn { flex: 1; }
  #keyForm input, #inviteForm input { flex-basis: 100%; }
  .hours .inp { width: auto; min-width: 0; flex: 1 1 0; padding: 0 8px; }
  .lcard-sum { display: none; }
  .fact, .add-fact { grid-template-columns: 76px minmax(0, 1fr) auto; }
  .add-fact input { padding: 0 8px; }
  .mimg, .mvid, .maud { width: 220px; }
  .mdoc { width: 240px; }
}
@media (max-width: 360px) {
  .lbl-btn { max-width: none; padding: 0 8px; }
  .lbl-btn span { display: none; }
  .mimg, .mvid, .maud { width: 200px; }
  .mdoc { width: 232px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
