/* Razzy Inbox. Concept: the switchboard. Every channel is a coloured line that runs into one calm board; open a line
   and you are inside that app (WhatsApp looks like WhatsApp, email like a mail app), so nobody has to learn anything.
   Signature move: the hand-off (Take over slides the assistant out and you in; a line sweeps the thread).
   Razzy type system (TYPE.md): Bricolage Grotesque display, Figtree text. White, hairlines, one accent (the company's). */
:root {
  /* Light leads for everyone; dark is each staff member's own choice (Settings), or follows the phone on "System". */
  --paper: #f7f7f5; --card: #ffffff; --raise: #ffffff; --ink: #121212; --ink2: #5a5955; --ink3: #8d8b86; --line: #e8e7e3; --line2: #f1f0ed;
  --accent: #f43b28; --on-accent: #fff; --tint: color-mix(in srgb, var(--accent) 8%, var(--card));
  --wa: #1fa855; --ms: #0a7cff; --ig: #d62976; --em: #6b5bd6; --fb: #1877f2;
  --ok: #1f8a4c; --warn: #b7791f; --shadow: 0 1px 2px rgba(17,17,17,.04), 0 8px 24px -18px rgba(17,17,17,.25);
  --fd: 'Bricolage Grotesque', Arial, sans-serif; --ft: Figtree, Arial, sans-serif;
  /* one type scale */
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-2xl: 30px;
  /* one set of radii */
  --r-sm: 10px; --r: 14px; --r2: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.3, 1.2, .5, 1);
  /* the channel looks */
  --wa-head: #008069; --wa-wall: #efeae2; --wa-dot: rgba(0,0,0,.045); --wa-in: #ffffff; --wa-out: #d9fdd3; --wa-ink: #111b21; --wa-time: #667781; --wa-bar: #f0f2f5; --wa-field: #ffffff; --wa-send: #00a884; --wa-tick: #53bdeb;
  --ig-out: #7b4dff; --ig-in: #efefef; --ms-in: #f0f0f0; --em-wall: #f7f7f5; --cm-bub: #f2f2f0;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #0e0e0d; --card: #171716; --raise: #1d1d1b; --ink: #f2f1ee; --ink2: #b4b2ad; --ink3: #7f7d78; --line: #272725; --line2: #1f1f1d; color-scheme: dark;
  --ok: #4cc27f; --warn: #e0a84a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.7);
  --wa-head: #202c33; --wa-wall: #0b141a; --wa-dot: rgba(255,255,255,.03); --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-time: #8696a0; --wa-bar: #202c33; --wa-field: #2a3942;
  --ig-in: #262626; --ms-in: #2c2c2c; --em-wall: #121211; --cm-bub: #2a2a28;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
  --paper: #0e0e0d; --card: #171716; --raise: #1d1d1b; --ink: #f2f1ee; --ink2: #b4b2ad; --ink3: #7f7d78; --line: #272725; --line2: #1f1f1d; color-scheme: dark;
  --ok: #4cc27f; --warn: #e0a84a; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -16px rgba(0,0,0,.7);
  --wa-head: #202c33; --wa-wall: #0b141a; --wa-dot: rgba(255,255,255,.03); --wa-in: #202c33; --wa-out: #005c4b; --wa-ink: #e9edef; --wa-time: #8696a0; --wa-bar: #202c33; --wa-field: #2a3942;
  --ig-in: #262626; --ms-in: #2c2c2c; --em-wall: #121211; --cm-bub: #2a2a28;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--ft); -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.mark { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.mark circle { fill: var(--accent); stroke: none; }
.nojs { padding: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sign-in ---------- */
.si { display: grid; place-items: center; min-height: 100%; padding: 20px 16px; overflow: hidden; }
.si-card { position: relative; width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: var(--r2); padding: 34px 26px 22px; box-shadow: 0 30px 80px -40px rgba(0,0,0,.25); }
.si-lines { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.si-lines i { position: absolute; left: -40%; height: 2px; width: 60%; border-radius: 2px; opacity: .55; animation: run 5.5s var(--ease) infinite; }
.si-lines i:nth-child(1) { top: 88px; background: var(--wa); }
.si-lines i:nth-child(2) { top: 98px; background: var(--em); animation-delay: .7s; }
.si-lines i:nth-child(3) { top: 108px; background: var(--fb); animation-delay: 1.4s; }
.si-lines i:nth-child(4) { top: 118px; background: var(--ig); animation-delay: 2.1s; }
@keyframes run { 0% { transform: translateX(0); opacity: 0; } 15% { opacity: .55; } 70% { opacity: .55; } 100% { transform: translateX(260%); opacity: 0; } }
.si h1 { font: 800 clamp(34px, 9vw, 44px)/1 var(--fd); letter-spacing: -.045em; margin: 70px 0 12px; }
.si h1 span { color: var(--accent); }
.si-lead { color: var(--ink2); margin: 0 0 22px; font-size: 17px; }
.si-form { display: grid; gap: 8px; }
.si-form label { font: 600 12px/1 var(--ft); text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); }
.si-form input { height: 52px; border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; background: var(--paper); font-size: 17px; }
.si-form input#code { letter-spacing: .4em; font: 700 22px/1 var(--fd); text-align: center; }
.si-form input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.si-form button { margin-top: 8px; height: 52px; border: 0; border-radius: var(--r); background: var(--ink); color: var(--paper); font-weight: 700; transition: transform .2s var(--ease); }
.si-form button:active { transform: scale(.98); }
.si-err { background: color-mix(in srgb, var(--accent) 12%, var(--card)); border-radius: 10px; padding: 10px 12px; margin: 0 0 14px; }
.si-again { margin-top: 10px; }
.link { background: none; border: 0; color: var(--ink2); text-decoration: underline; padding: 6px 0; }
.si-foot { margin: 26px 0 0; font-size: 12px; color: var(--ink3); text-align: center; }

/* ---------- shared pieces ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; transition: transform .18s var(--ease), background .2s, box-shadow .2s; white-space: nowrap; text-decoration: none; }
.btn:hover { box-shadow: 0 6px 16px -12px rgba(0,0,0,.4); }
.btn:active { transform: scale(.96); }
.btn.dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.acc { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.sm { height: 34px; padding: 0 11px; font-size: 14px; border-radius: 10px; }
.btn.ico { width: 40px; padding: 0; }
.btn.wide { width: 100%; height: 50px; font-size: 16px; }
.btn svg { width: 18px; height: 18px; }
.note { font-size: 13px; color: var(--ink3); margin: 0; }
.err { color: var(--accent); font-size: 14px; margin: 0; }
.err:empty { display: none; }
.av { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 700 17px/1 var(--fd); color: #fff; background: var(--c, var(--ink3)); position: relative; flex: none; }
.av.sm { width: 32px; height: 32px; font-size: 13px; }
.av.ring { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ig); }
.chb { position: absolute; right: -3px; bottom: -3px; width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: 0 0 0 1px var(--line); color: var(--c); }
.chb svg { width: 13px; height: 13px; stroke-width: 2.4; }
.dots { display: inline-flex; gap: 2px; align-items: center; margin-right: 4px; }
.dots i { width: 4px; height: 4px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite both; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
@keyframes arrive { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.st { font: 600 11px/1 var(--ft); letter-spacing: .05em; text-transform: uppercase; padding: 5px 8px; border-radius: 7px; white-space: nowrap; background: var(--line2); color: var(--ink2); }
.st-booked, .st-held, .st-queued, .st-draft { background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.st-sent, .st-done { background: color-mix(in srgb, var(--ok) 15%, var(--card)); color: var(--ok); }
.st-failed, .st-no_show { background: color-mix(in srgb, var(--warn) 16%, var(--card)); color: var(--warn); }
.st-cancelled, .st-stopped, .st-skipped, .st-wait { background: var(--line2); color: var(--ink3); }
.empty { text-align: center; color: var(--ink3); padding: 56px 24px; list-style: none; }
.empty b { display: block; font: 700 22px/1.1 var(--fd); letter-spacing: -.03em; color: var(--ink); margin: 10px 0 6px; }
.empty-i { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--c); animation: rise .6s var(--spring) both; }
.empty-i svg { width: 26px; height: 26px; }
.empty.soft { padding: 26px 16px; border: 1px dashed var(--line); border-radius: var(--r); }
.empty.soft b { font-size: 18px; margin-top: 0; }

/* ---------- frame: top bar, main, bottom nav (phone) ---------- */
#app { height: 100%; }
.frame { display: grid; height: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
.top { display: flex; align-items: center; gap: 10px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); z-index: 5; min-width: 0; }
.co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co img { width: 34px; height: 34px; border-radius: 10px; object-fit: cover; }
.co-dot { width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 800 15px/1 var(--fd); flex: none; }
.co-name { font: 700 18px/1.1 var(--fd); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co select { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 6px 8px; min-width: 0; max-width: 46vw; font-weight: 600; }
.live { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--ft); letter-spacing: .06em; text-transform: uppercase; color: var(--ok); padding: 6px 9px; border-radius: 99px; background: color-mix(in srgb, var(--ok) 10%, var(--card)); flex: none; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: beat 2s infinite; }
@keyframes beat { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.grow { flex: 1; }
.mechip { display: none; align-items: center; gap: 8px; }
.mechip .av.sm { background: var(--ink); color: var(--paper); }
.mechip .role { font-size: 13px; color: var(--ink3); font-weight: 600; }
.main { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); }
.rail { display: none; }
.bottom { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.bottom .nv { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px; border: 0; background: transparent; font: 600 11.5px/1 var(--ft); color: var(--ink3); text-decoration: none; transition: color .2s; }
.bottom .nv svg { width: 23px; height: 23px; transition: transform .35s var(--spring); }
.bottom .nv[aria-current="true"] { color: var(--ink); }
.bottom .nv[aria-current="true"] svg { transform: translateY(-2px) scale(1.08); stroke: var(--accent); }
.bottom .nv[aria-current="true"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); animation: rise .35s var(--ease); }
.bottom .nv b { position: absolute; top: 5px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent); font: 700 11px/18px var(--fd); }

/* ---------- inbox list ---------- */
.listpane { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--paper); }
.boxbar { position: relative; display: flex; gap: 2px; padding: 8px 10px 0; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); flex: none; }
.boxbar::-webkit-scrollbar, .statusbar::-webkit-scrollbar, .week::-webkit-scrollbar, .days::-webkit-scrollbar { display: none; }
.bx { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 44px; padding: 0 12px; border: 0; background: transparent; font-weight: 600; font-size: 15px; color: var(--ink3); transition: color .25s; }
.bx svg { width: 18px; height: 18px; }
.bx[aria-selected="true"] { color: var(--ink); }
.bx[aria-selected="true"] svg { color: var(--c); }
.bx b { font: 700 12px/1 var(--fd); min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px; display: grid; place-items: center; background: var(--line2); color: var(--ink2); }
.bx[aria-selected="true"] b { background: var(--c); color: #fff; }
.ink { position: absolute; left: 0; bottom: 0; height: 3px; width: var(--w, 0); transform: translateX(var(--x, 0)); background: var(--c, var(--ink)); border-radius: 3px 3px 0 0; transition: transform .45s var(--ease), width .45s var(--ease), background .3s; }
.listhead { padding: 16px 16px 4px; }
.listhead h2 { font: 800 28px/1 var(--fd); letter-spacing: -.045em; margin: 0; animation: arrive .4s var(--ease); }
.listhead .sub { display: block; font-size: 13.5px; color: var(--ink3); margin-top: 6px; }
.statusbar { display: flex; gap: 6px; padding: 10px 16px; overflow-x: auto; scrollbar-width: none; flex: none; }
.chip { flex: none; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 7px; color: var(--ink2); transition: background .2s, color .2s, border-color .2s; }
.chip b { font: 700 12px/1 var(--fd); color: var(--accent); }
.chip[aria-pressed="true"] { border-color: var(--ink); color: var(--paper); background: var(--ink); }
.chip[aria-pressed="true"] b { color: var(--paper); }
.search { margin: 0 16px 8px; position: relative; flex: none; }
.search input { width: 100%; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 14px 0 38px; font-size: 16px; }
.search svg { position: absolute; left: 12px; top: 12px; width: 18px; height: 18px; color: var(--ink3); }
.items { list-style: none; margin: 0; padding: 0 8px 24px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.item { position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 10px 11px 12px; border: 0; border-radius: 16px; background: transparent; transition: background .2s, transform .2s var(--ease); animation: arrive .45s var(--ease) var(--d, 0ms) both; }
.item:hover { background: var(--line2); }
.item:active { transform: scale(.99); }
.item[aria-current="true"] { background: var(--card); box-shadow: 0 1px 0 var(--line), 0 10px 30px -22px rgba(0,0,0,.35); }
.item::before { content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; background: var(--c); transform: scaleY(0); transition: transform .3s var(--ease); }
.item.unread::before, .item[aria-current="true"]::before { transform: scaleY(1); }
.item.fresh { animation: fresh 1.6s var(--ease); }
@keyframes fresh { 0% { background: color-mix(in srgb, var(--c) 22%, transparent); transform: translateX(6px); } 100% { background: transparent; transform: none; } }
.it-main { min-width: 0; display: grid; gap: 1px; }
.it-top { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.it-name { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-time { font-size: 12px; color: var(--ink3); flex: none; }
.unread .it-time { color: var(--c); font-weight: 700; }
.it-sub { font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.it-body { font-size: 14.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 4px; }
.tick svg { width: 16px; height: 16px; color: var(--wa-tick); flex: none; display: block; }
.it-foot { display: flex; align-items: center; gap: 6px; margin-top: 3px; min-height: 20px; }
.it-ch { font-size: 12px; color: var(--ink3); margin-right: auto; }
.unr { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--c); color: #fff; font: 700 12px/20px var(--fd); text-align: center; }
.badge { display: inline-flex; align-items: center; font: 600 10.5px/1 var(--ft); letter-spacing: .06em; text-transform: uppercase; padding: 4px 7px; border-radius: 6px; background: var(--line2); color: var(--ink2); white-space: nowrap; }
.badge.need { background: var(--accent); color: var(--on-accent); }
.badge.bot { background: color-mix(in srgb, var(--wa) 14%, var(--card)); color: color-mix(in srgb, var(--wa) 70%, var(--ink)); }
/* the list takes on its channel's look */
[data-skin="whatsapp"] .it-body, [data-skin="whatsapp"] .it-name { font-size: 16px; }
[data-skin="whatsapp"] .item { border-radius: 0; border-bottom: 1px solid var(--line2); }
[data-skin="email"] .av { border-radius: 50%; }
[data-skin="email"] .unread .it-name, [data-skin="email"] .unread .it-sub { font-weight: 800; }
[data-skin="email"] .it-body { font-size: 14px; color: var(--ink3); }

/* ---------- the pane (a conversation or a business screen) ---------- */
.pane { display: none; min-height: 0; min-width: 0; background: var(--card); }
.sec-inbox.mobile-thread .listpane { display: none; }
.sec-inbox.mobile-thread .pane { display: flex; }
.sec-inbox.mobile-thread .top, .sec-inbox.mobile-thread .bottom { display: none; }
.sec-inbox.mobile-thread.frame { grid-template-rows: minmax(0, 1fr); }
.sec-page .listpane { display: none; }
.sec-page .pane { display: flex; overflow-y: auto; }
.th { display: flex; flex-direction: column; min-height: 0; width: 100%; height: 100%; }
.th.enter { animation: slidein .38s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
.th-head { position: relative; display: flex; gap: 10px; align-items: center; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--card); overflow: hidden; flex: none; }
.th-head .av { width: 40px; height: 40px; font-size: 15px; }
.th-head .sweep { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.th-head.mine .sweep { animation: sweep .7s var(--ease) forwards; }
@keyframes sweep { to { transform: scaleX(1); } }
.th-who { flex: 1; min-width: 0; }
.th-name { font: 700 18px/1.15 var(--fd); letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-meta { font-size: 13px; color: var(--ink3); display: flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; }
.th-meta .hd { overflow: hidden; text-overflow: ellipsis; }
.back { width: 38px; padding: 0; flex: none; }
.th-sum { margin: 10px 12px 0; padding: 11px 14px; border-radius: var(--r); background: var(--tint); border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line)); font-size: 14.5px; cursor: pointer; flex: none; box-shadow: 0 8px 18px -16px rgba(0,0,0,.4); position: relative; z-index: 1; }
.th-sum .lbl { font: 600 11px/1 var(--ft); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); display: block; margin-bottom: 5px; }
.th-sum .txt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.th-sum.open .txt { -webkit-line-clamp: unset; display: block; }
.th-sum .more { font-size: 12px; color: var(--ink3); margin-top: 4px; display: block; }
.th-sum.open .more { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 3px; }
.day { align-self: center; margin: 10px 0 6px; }
.day span { display: inline-block; font-size: 12px; font-weight: 600; color: var(--ink3); background: var(--card); padding: 5px 10px; border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.b { position: relative; max-width: min(80%, 560px); padding: 7px 10px 6px; border-radius: 12px; font-size: 15.5px; line-height: 1.42; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 6px; }
.b.run { margin-top: 0; }
.b.pop { animation: pop .42s var(--spring) var(--d, 0ms) both; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.92); } to { opacity: 1; transform: none; } }
.b.in { align-self: flex-start; transform-origin: left bottom; }
.b.out { align-self: flex-end; transform-origin: right bottom; }
.b .who { font: 700 12.5px/1 var(--ft); display: block; margin-bottom: 4px; }
.b small { float: right; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; margin: 8px 0 -3px 10px; opacity: .75; }
.b .tk { width: 16px; height: 16px; color: var(--wa-tick); opacity: 1; }
.compose { border-top: 1px solid var(--line); padding: 8px 10px; padding-bottom: max(8px, env(safe-area-inset-bottom)); background: var(--card); display: grid; gap: 8px; flex: none; }
.compose details summary { cursor: pointer; list-style: none; padding: 2px 4px; }
.compose details[open] summary { margin-bottom: 8px; }
.handoff { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 16px; background: var(--paper); border: 1px solid var(--line); overflow: hidden; }
.handoff .faces { position: relative; width: 36px; height: 36px; flex: none; }
.handoff .face { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font: 800 13px/1 var(--fd); transition: transform .55s var(--spring), opacity .4s; }
.face.botf { background: var(--wa); color: #fff; }
.face.youf { background: var(--ink); color: var(--paper); transform: translateY(120%); opacity: 0; }
.handoff.mine .face.botf { transform: translateY(-120%); opacity: 0; }
.handoff.mine .face.youf { transform: none; opacity: 1; }
.handoff p { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.3; color: var(--ink2); min-width: 0; }
.handoff p b { color: var(--ink); display: block; font-size: 15px; }
.row { display: flex; gap: 8px; align-items: flex-end; }
.row textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 180px; resize: none; border: 1px solid var(--line); border-radius: 22px; padding: 10px 16px; background: var(--paper); font-size: 16px; line-height: 1.4; }
.row.busy .send { animation: pulse .8s infinite alternate; }
@keyframes pulse { to { transform: scale(.9); opacity: .7; } }
.send { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; transition: transform .3s var(--spring); }
.send:hover { transform: rotate(-8deg) scale(1.05); }
.mode { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; background: var(--paper); justify-self: start; }
.mode button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.mode button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.nothread { margin: auto; text-align: center; color: var(--ink3); padding: 40px; }
.nothread svg { width: 140px; height: 90px; margin-bottom: 14px; }
.nothread path { stroke-width: 3; stroke-dasharray: 140; stroke-dashoffset: 140; animation: draw 1.6s var(--ease) forwards; }
.nothread b { display: block; font: 700 24px/1.1 var(--fd); letter-spacing: -.03em; color: var(--ink); margin-bottom: 6px; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* WhatsApp: green bar, the wallpaper, white and green bubbles with tails, ticks */
.th-wa .th-head { background: var(--wa-head); color: #fff; border-color: transparent; }
.th-wa .th-meta, .th-wa .th-meta a { color: rgba(255,255,255,.82); }
.th-wa .th-head .btn { color: #fff; background: transparent; border-color: rgba(255,255,255,.35); }
.th-wa .th-head .btn.ghost { border-color: transparent; }
.th-wa .msgs { background-color: var(--wa-wall); background-image: radial-gradient(var(--wa-dot) 1.2px, transparent 1.3px), radial-gradient(var(--wa-dot) 1px, transparent 1.1px); background-size: 22px 22px, 34px 34px; background-position: 0 0, 11px 17px; padding: 12px 6%; }
.th-wa .b { color: var(--wa-ink); box-shadow: 0 1px .5px rgba(11,20,26,.13); border-radius: 8px; }
.th-wa .b small { color: var(--wa-time); }
.th-wa .b.in { background: var(--wa-in); border-top-left-radius: 0; }
.th-wa .b.out { background: var(--wa-out); border-top-right-radius: 0; }
.th-wa .b.run.in { border-top-left-radius: 8px; } .th-wa .b.run.out { border-top-right-radius: 8px; }
.th-wa .b:not(.run)::before { content: ''; position: absolute; top: 0; width: 9px; height: 13px; }
.th-wa .b.in:not(.run)::before { left: -8px; background: var(--wa-in); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.th-wa .b.out:not(.run)::before { right: -8px; background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.th-wa .b .who { color: var(--wa-send); }
.th-wa .b.person .who { color: #8b5cf6; }
.th-wa .day span { background: var(--wa-in); color: var(--wa-time); }
.th-wa .th-sum { margin: 0; border-radius: 0; border-width: 0 0 1px; }
.cp-wa { background: var(--wa-bar); border-top: 0; }
.cp-wa .row textarea { background: var(--wa-field); border-color: transparent; border-radius: 24px; color: var(--wa-ink); }
.cp-wa .send { background: var(--wa-send); border-color: var(--wa-send); color: #fff; }
.cp-wa .handoff { background: var(--wa-field); border-color: transparent; color: var(--wa-ink); }

/* Instagram: white, round grey and violet bubbles, ringed avatar */
.th-ig .msgs { padding: 14px 16px; gap: 2px; }
.th-ig .b { border-radius: 22px; padding: 9px 14px; }
.th-ig .b.in { background: var(--ig-in); }
.th-ig .b.out { background: var(--ig-out); color: #fff; }
.th-ig .b.out.run { border-top-right-radius: 6px; } .th-ig .b.in.run { border-top-left-radius: 6px; }
.th-ig .b small { display: none; }
.th-ig .b:hover small { display: inline-flex; }
.th-ig .b .who { color: inherit; opacity: .7; font-weight: 600; }
.th-ig .day span { box-shadow: none; background: transparent; }
.cp-ig .row textarea { border-radius: 24px; border-color: var(--line); background: var(--card); }
.cp-ig .send { background: var(--ig-out); border-color: var(--ig-out); }

/* Messenger: blue round bubbles */
.th-ms .b { border-radius: 18px; padding: 8px 13px; }
.th-ms .b.in { background: var(--ms-in); }
.th-ms .b.out { background: var(--ms); color: #fff; }
.th-ms .b.out.run { border-top-right-radius: 5px; } .th-ms .b.in.run { border-top-left-radius: 5px; }
.th-ms .b .who { color: inherit; opacity: .75; }
.th-ms .day span { box-shadow: none; background: transparent; }
.cp-ms .row textarea { background: var(--ms-in); border-color: transparent; }
.cp-ms .send { background: var(--ms); border-color: var(--ms); }

/* Website chat: the company's own colour */
.th-web .b { border-radius: 16px; }
.th-web .b.in { background: var(--line2); }
.th-web .b.out { background: var(--accent); color: var(--on-accent); }
.th-web .b .who { color: inherit; opacity: .75; }

/* Email: a mail app. Subject on top, one card per message, the last one open */
.th-em .msgs { background: var(--em-wall); padding: 16px 12px; gap: 10px; }
.subj { font: 700 23px/1.2 var(--fd); letter-spacing: -.03em; margin: 2px 4px 6px; }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; cursor: pointer; animation: arrive .4s var(--ease) both; }
.mcard header { display: flex; gap: 10px; align-items: center; }
.mcard .av { width: 36px; height: 36px; font-size: 14px; }
.mfrom { flex: 1; min-width: 0; display: grid; }
.mfrom b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.maddr { font-size: 12.5px; color: var(--ink3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard time { font-size: 12.5px; color: var(--ink3); flex: none; }
.mcard .snip { margin: 6px 0 0 46px; color: var(--ink3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mcard .mbody { display: none; margin: 12px 0 2px 46px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15.5px; line-height: 1.6; }
.mcard.open { cursor: default; box-shadow: 0 14px 34px -26px rgba(0,0,0,.35); }
.mcard.open .snip { display: none; }
.mcard.open .mbody { display: block; }
.cp-em .row { flex-wrap: wrap; border: 1px solid var(--line); border-radius: 16px; padding: 8px; align-items: flex-end; }
.cp-em .to { width: 100%; display: flex; gap: 8px; font-size: 13.5px; color: var(--ink3); padding: 2px 8px 6px; border-bottom: 1px solid var(--line2); }
.cp-em .to b { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cp-em .row textarea { border: 0; background: transparent; border-radius: 0; padding: 6px 8px; min-height: 70px; }
.cp-em .send { width: auto; border-radius: 99px; padding: 0 20px; background: var(--em); border-color: var(--em); }

/* Comments: the post, then comment bubbles with the Page's answers nested under */
.cmts { gap: 12px; padding: 14px; }
.post { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--card); box-shadow: 0 12px 30px -26px rgba(0,0,0,.4); }
.post-h { display: flex; align-items: center; gap: 8px; }
.post-h .note { margin-left: auto; }
.post p { margin: 8px 0 0; }
.cmt { display: flex; gap: 8px; align-items: flex-start; animation: arrive .4s var(--ease) both; }
.cmt.reply { margin-left: 40px; }
.cb { background: var(--cm-bub); border-radius: 18px; padding: 8px 12px; display: grid; font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.cb b { font-size: 13.5px; }
.cmt.reply .cb { background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.cmeta { font-size: 12px; color: var(--ink3); padding: 3px 12px 0; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(10,10,10,0); display: flex; align-items: flex-end; z-index: 30; transition: background .25s; }
.scrim.on { background: rgba(10,10,10,.42); }
.sheet { width: 100%; max-height: 92%; display: flex; flex-direction: column; background: var(--card); border-radius: 24px 24px 0 0; transform: translateY(100%); transition: transform .38s var(--ease); padding-bottom: env(safe-area-inset-bottom); }
.scrim.on .sheet { transform: none; }
.sh-head { position: relative; display: flex; align-items: center; gap: 8px; padding: 18px 12px 8px 20px; }
.sh-head h2 { flex: 1; margin: 0; font: 800 22px/1.1 var(--fd); letter-spacing: -.04em; }
.grab { position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; margin-left: -19px; border-radius: 4px; background: var(--line); }
.sh-body { overflow-y: auto; padding: 4px 20px 12px; }
.sh-foot { padding: 10px 20px 16px; border-top: 1px solid var(--line2); }
.form { display: grid; gap: 14px; }
.form.inline { gap: 10px; }
.fld { display: grid; gap: 6px; min-width: 0; }
.fl { font: 600 12px/1 var(--ft); text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); }
.hint { font-size: 12.5px; color: var(--ink3); }
.fld input, .fld select, .fld textarea, .pg-act select { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--paper); font-size: 16px; }
.fld textarea { resize: vertical; }
.fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.days, .week { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 4px; }
.dy { flex: none; display: grid; justify-items: center; gap: 2px; min-width: 62px; padding: 9px 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); transition: transform .3s var(--spring), background .2s, color .2s; }
.dy small { font-size: 12px; color: var(--ink3); font-weight: 600; }
.dy b { font: 800 21px/1 var(--fd); letter-spacing: -.03em; }
.dy i { font-style: normal; font-size: 11px; color: var(--ink3); white-space: nowrap; }
.dy i.on { color: var(--accent); font-weight: 700; }
.dy[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }
.dy[aria-selected="true"] small, .dy[aria-selected="true"] i { color: color-mix(in srgb, var(--paper) 70%, transparent); }
.times { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; margin-top: 4px; }
.tm { height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font: 700 15px/1 var(--fd); animation: arrive .3s var(--ease) var(--d, 0ms) both; transition: background .2s, transform .25s var(--spring); }
.tm[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); transform: scale(1.04); }
.payopts { display: grid; gap: 8px; }
.payopt { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: left; }
.payopt span { font: 800 18px/1 var(--fd); }
.payopt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.morelist { display: grid; gap: 4px; padding-bottom: 8px; }
.morelist form { margin: 0; }
.moreit { display: flex; align-items: center; gap: 14px; width: 100%; height: 54px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; font-weight: 600; font-size: 16px; text-align: left; }
.moreit:hover { background: var(--line2); }
.moreit svg { width: 22px; height: 22px; color: var(--ink2); }
.checks { margin: 0; padding: 10px 12px 10px 30px; border-radius: 12px; background: color-mix(in srgb, var(--warn) 10%, var(--card)); color: var(--warn); font-size: 14px; }
.checks:empty { display: none; }
.checks.ok:empty { display: block; padding: 10px 12px; background: color-mix(in srgb, var(--ok) 10%, var(--card)); color: var(--ok); }
.checks.ok:empty::before { content: 'Reads well. Ready to save.'; }
.pv { background-color: var(--wa-wall); background-image: radial-gradient(var(--wa-dot) 1.2px, transparent 1.3px); background-size: 22px 22px; border-radius: 14px; padding: 14px; display: flex; }
.pv-b { margin: 0 0 0 auto; background: var(--wa-out); color: var(--wa-ink); border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); display: grid; gap: 8px; max-width: 90%; }
.stopl { font-size: 13px; color: var(--wa-time); }

/* ---------- business pages ---------- */
.page { width: 100%; max-width: 980px; margin: 0 auto; padding: 18px 16px 28px; display: grid; gap: 14px; align-content: start; }
.page.enter > * { animation: arrive .45s var(--ease) both; }
.page.enter > *:nth-child(2) { animation-delay: 50ms; } .page.enter > *:nth-child(3) { animation-delay: 100ms; } .page.enter > *:nth-child(4) { animation-delay: 150ms; } .page.enter > *:nth-child(n+5) { animation-delay: 200ms; }
.pg-head { display: flex; gap: 12px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; }
.pg-head h1 { font: 800 clamp(30px, 7vw, 40px)/1 var(--fd); letter-spacing: -.05em; margin: 0; }
.pg-head .sub { margin: 6px 0 0; color: var(--ink3); font-size: 14.5px; max-width: 56ch; }
.pg-act { display: flex; gap: 8px; align-items: center; }
.pg-act select { min-height: 40px; width: auto; }
.agh { font: 700 13px/1 var(--ft); text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); margin: 8px 0 0; }
.card { border: 1px solid var(--line); border-radius: 18px; padding: 16px; background: var(--card); display: grid; gap: 10px; }
.card h3 { margin: 0; font: 700 18px/1.1 var(--fd); letter-spacing: -.02em; }
.agenda { display: grid; gap: 10px; }
.bk { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); animation: rise .45s var(--ease) var(--d, 0ms) both; position: relative; overflow: hidden; }
.bk::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.bk.st-done::before { background: var(--ok); } .bk.st-cancelled::before, .bk.st-no_show::before { background: var(--line); }
.bk.st-cancelled { opacity: .62; }
.bk-time { display: grid; align-content: start; }
.bk-time b { font: 800 22px/1 var(--fd); letter-spacing: -.03em; }
.bk-time span { font-size: 12px; color: var(--ink3); margin-top: 4px; }
.bk-main { display: grid; gap: 6px; min-width: 0; }
.bk-top { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.bk-top b { font-size: 16.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-svc { font-size: 14px; color: var(--ink2); }
.bk-flags { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.auto .ob { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
.auto .obt { grid-column: 1 / -1; font-size: 14px; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.auto .ob .note { grid-column: 1 / -1; }
.lists { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lst { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); text-align: left; animation: rise .45s var(--ease) var(--d, 0ms) both; }
.lst .chb { position: static; width: 38px; height: 38px; flex: none; box-shadow: none; background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.lst .chb svg { width: 19px; height: 19px; }
.lst div { display: grid; min-width: 0; }
.lst.add { border-style: dashed; color: var(--ink2); justify-content: center; }
.lst.add svg { width: 20px; height: 20px; }
.bc, .py, .sf { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--card); display: grid; gap: 8px; animation: rise .45s var(--ease) var(--d, 0ms) both; }
.bc-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.bc-top b { font: 700 17px/1.2 var(--fd); }
.bc-body { margin: 0; white-space: pre-wrap; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bar { position: relative; height: 26px; border-radius: 8px; background: var(--line2); overflow: hidden; font-size: 12.5px; display: flex; align-items: center; padding: 0 10px; }
.bar i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: color-mix(in srgb, var(--ok) 22%, transparent); animation: grow 1s var(--ease) both; transform-origin: left; }
.bar span { position: relative; }
@keyframes grow { from { transform: scaleX(0); } }
.py { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.py .btn { grid-column: 1 / -1; justify-self: start; }
.py-amt { font: 800 22px/1 var(--fd); letter-spacing: -.03em; min-width: 64px; }
.py-main { display: grid; min-width: 0; }
.banner { border-radius: 16px; padding: 14px 16px; background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line)); font-size: 14.5px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi { border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; background: var(--card); display: grid; gap: 4px; align-content: start; }
.kl { font: 600 12px/1 var(--ft); text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); }
.kv { font: 800 clamp(28px, 7vw, 38px)/1.05 var(--fd); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.split { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--line2); }
.split .sa { width: var(--p); background: var(--wa); animation: grow 1.1s var(--ease) both; transform-origin: left; }
.split .st2 { flex: 1; background: var(--ink); }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 6px 0 0; vertical-align: -1px; }
.lg.sa { background: var(--wa); } .lg.st2 { background: var(--ink); } .lg.ms { background: var(--accent); }
.bars { display: grid; gap: 10px; }
.brow { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 32px; gap: 10px; align-items: center; font-size: 14px; }
.bt { position: relative; height: 12px; border-radius: 6px; background: var(--line2); overflow: hidden; }
.bt i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--c); border-radius: 6px; animation: grow 1s var(--ease) var(--d, 0ms) both; transform-origin: left; }
.bt i.ms { background: var(--accent); opacity: .85; }
.brow b { text-align: right; font-family: var(--fd); }
.sf { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; }
.sf > select, .sf > .btn { grid-column: 2 / -1; }
.sf select { min-height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); padding: 0 8px; }
.sf.off { opacity: .6; }
.sf-main { display: grid; min-width: 0; }
.sf-main .note { overflow: hidden; text-overflow: ellipsis; }
.ask { display: grid; gap: 10px; }
.ask textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--paper); font-size: 16px; }
.ask .btn { justify-self: start; }
.reqs { display: grid; gap: 10px; }
.req { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--card); }
.req .st { margin-right: 6px; }
.req p { margin: 6px 0 0; white-space: pre-wrap; }
.req .ans { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--ink2); }
.toast { position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); transform: translate(-50%, -30px); opacity: 0; background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: 12px; font-weight: 600; transition: transform .35s var(--spring), opacity .3s; z-index: 40; max-width: calc(100% - 32px); box-shadow: 0 14px 34px -18px rgba(0,0,0,.5); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- desktop: rail | list | conversation ---------- */
@media (min-width: 720px) {
  .sheet { border-radius: 24px; max-width: 560px; margin: auto; max-height: 86%; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .32s var(--ease), opacity .25s; }
  .scrim { align-items: center; padding: 24px; }
  .scrim.on .sheet { opacity: 1; }
  .grab { display: none; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .form.inline { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: end; }
  .sf { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .sf > select, .sf > .btn { grid-column: auto; }
  .py { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .py .btn { grid-column: auto; }
}
@media (min-width: 1024px) {
  .frame, .sec-inbox.mobile-thread.frame { grid-template-rows: auto minmax(0, 1fr); }
  .bottom { display: none !important; }
  .sec-inbox.mobile-thread .top { display: flex; }
  .top { padding: 12px 22px; }
  .mechip { display: flex; }
  .main { grid-template-columns: 248px 400px minmax(0, 1fr); }
  .sec-page .main { grid-template-columns: 248px minmax(0, 1fr); }
  .rail { display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; border-right: 1px solid var(--line); overflow-y: auto; background: var(--paper); }
  .rail h3 { font: 600 12px/1 var(--ft); letter-spacing: .12em; text-transform: uppercase; color: var(--ink3); margin: 18px 10px 8px; }
  .rail h3:first-child { margin-top: 2px; }
  .nv { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px; border: 0; border-radius: 11px; background: transparent; font-weight: 600; color: var(--ink2); text-align: left; text-decoration: none; transition: background .2s, color .2s; }
  .nv:hover { background: var(--line2); color: var(--ink); }
  .nv[aria-current="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 var(--line), 0 8px 20px -18px rgba(0,0,0,.4); }
  .nv svg { width: 19px; height: 19px; flex: none; }
  .nv span { flex: 1; }
  .nv b { font: 700 13px/1 var(--fd); color: var(--ink3); }
  .nv[aria-current="true"] b { color: var(--accent); }
  .nv .bi { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 12%, var(--card)); color: var(--c); flex: none; transition: transform .3s var(--spring); }
  .nv .bi svg { width: 15px; height: 15px; }
  .nv.box[aria-current="true"] .bi { transform: scale(1.1); background: var(--c); color: #fff; }
  .listpane, .sec-inbox.mobile-thread .listpane { display: flex; border-right: 1px solid var(--line); }
  .boxbar { display: none; }
  .pane, .sec-inbox.mobile-thread .pane { display: flex; }
  .back { display: none; }
  .th-head { padding: 12px 20px; }
  .th-head .av { width: 44px; height: 44px; }
  .msgs { padding: 20px 28px 10px; }
  .th-wa .msgs { padding: 18px 9%; }
  .th-em .msgs { padding: 24px 32px; }
  .compose { padding: 10px 20px 14px; }
  .th-sum { margin: 14px 28px 0; }
  .th-wa .th-sum { margin: 0; }
  .page { padding: 32px 40px 48px; }
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .agenda { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agenda .agh { grid-column: 1 / -1; }
  .agenda .empty { grid-column: 1 / -1; }
}
@media (min-width: 1440px) { .main { grid-template-columns: 264px 440px minmax(0, 1fr); } .sec-page .main { grid-template-columns: 264px minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .nothread path { stroke-dashoffset: 0; }
}
@media print {
  .top, .rail, .bottom, .pg-act, .listpane { display: none !important; }
  .frame, .main { display: block; height: auto; }
  .pane { display: block !important; overflow: visible; }
  .page { max-width: none; padding: 0; }
  .kpi, .card { break-inside: avoid; }
}

/* the page scrolls inside the pane; it must keep its own height, never shrink its rows */
.page { flex: none; align-self: flex-start; }
/* phone chat header: names first; Done becomes a tick */
.th-head .done-l { display: none; }
@media (min-width: 1024px) { .th-head .done-l { display: inline; } .th-head .done-i { display: none; } }
.th-head .btn.done { width: 40px; padding: 0; }
@media (min-width: 1024px) { .th-head .btn.done { width: auto; padding: 0 14px; } }

/* Ask Razzy: the paid add-ons that are not switched on yet */
.addons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.addon { display: grid; gap: 3px; text-align: left; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--paper); animation: rise .4s var(--ease) var(--d, 0ms) both; transition: border-color .2s, transform .25s var(--spring); }
.addon:hover { border-color: var(--accent); transform: translateY(-2px); }
.addon span { font-size: 13px; color: var(--ink2); }
.addon i { font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--accent); margin-top: 3px; }

/* ======================================================================================================================
   Design pass 2 (1 Nov 2026, Marshal: "clean, smart, neat, finished, commercial"). One type scale, more white space,
   calm hairlines, one accent, the same radii everywhere, sentence-case labels, quieter motion. WhatsApp stays WhatsApp.
   ====================================================================================================================== */
body { font-size: var(--fs-md); background: var(--paper); }
.btn { height: 38px; border-radius: var(--r-sm); font-size: var(--fs-sm); box-shadow: none; }
.btn:hover { box-shadow: none; background: var(--line2); }
.btn.dark:hover { background: var(--ink); opacity: .92; }
.btn.acc:hover { background: var(--accent); opacity: .92; }
.btn.ghost:hover { background: var(--line2); }

/* labels: sentence case, no shouting */
.fl, .kl, .th-sum .lbl, .si-form label, .rail h3, .agh { text-transform: none !important; letter-spacing: 0 !important; font: 600 var(--fs-xs)/1.2 var(--ft) !important; color: var(--ink3); }
.rail h3 { margin: 22px 12px 6px; }
.badge, .st { text-transform: none; letter-spacing: 0; font: 600 11.5px/1 var(--ft); padding: 4px 8px; border-radius: 99px; }

/* top bar: name, a quiet live dot, you */
.top { background: var(--card); border-bottom: 1px solid var(--line); padding: 10px 16px; backdrop-filter: none; }
.co-name { font: 700 var(--fs-lg)/1.1 var(--fd); letter-spacing: -.02em; }
.co-dot, .co img { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
.live { padding: 0; background: none; font-size: 0; gap: 0; }
.live i { width: 7px; height: 7px; animation-duration: 3s; }
.mechip .role { font-weight: 500; }
.bottom { background: var(--card); backdrop-filter: none; }
.bottom .nv { font-size: 11px; color: var(--ink3); padding: 10px 2px 9px; }
.bottom .nv svg { width: 22px; height: 22px; stroke-width: 1.8; }
.bottom .nv[aria-current="true"] svg { transform: none; stroke: var(--ink); }
.bottom .nv[aria-current="true"]::before { display: none; }

/* inbox list: one clean row per conversation */
.listpane { background: var(--card); }
.boxbar { padding: 4px 8px 0; background: var(--card); }
.bx { height: 44px; padding: 0 12px; font-size: var(--fs-sm); color: var(--ink3); }
.bx svg { width: 16px; height: 16px; stroke-width: 1.8; }
.bx b { background: none; color: var(--ink3); min-width: 0; padding: 0; font: 600 var(--fs-xs)/1 var(--ft); }
.bx[aria-selected="true"] b { background: none; color: var(--ink); }
.ink { height: 2px; background: var(--ink); }
.listhead { padding: 22px 20px 6px; }
.listhead h2 { font: 700 var(--fs-2xl)/1.05 var(--fd); letter-spacing: -.035em; animation: none; }
.listhead .sub { display: none; }
.statusbar { gap: 18px; padding: 8px 20px 12px; border-bottom: 1px solid var(--line2); }
.chip { height: auto; padding: 4px 0; border: 0; border-radius: 0; background: none; font-size: var(--fs-sm); font-weight: 500; color: var(--ink3); border-bottom: 2px solid transparent; }
.chip b { color: var(--ink3); font: 500 var(--fs-xs)/1 var(--ft); }
.chip[aria-pressed="true"] { background: none; color: var(--ink); border-color: var(--ink); font-weight: 600; }
.chip[aria-pressed="true"] b { color: var(--accent); }
.search { margin: 12px 20px 6px; }
.search input { height: 40px; border-radius: var(--r-sm); background: var(--paper); border-color: transparent; font-size: var(--fs-sm); }
.search input:focus { border-color: var(--line); background: var(--card); outline: none; }
.items { padding: 4px 8px 24px; }
.item { grid-template-columns: 42px minmax(0, 1fr); gap: 12px; padding: 12px 12px; border-radius: var(--r); animation: arrive .3s var(--ease) var(--d, 0ms) both; }
.item::before { display: none; }
.item:hover { background: var(--paper); }
.item[aria-current="true"] { background: var(--paper); box-shadow: none; }
.item .av { width: 42px; height: 42px; font: 600 15px/1 var(--fd); color: var(--c); background: color-mix(in srgb, var(--c) 13%, var(--card)); }
.chb { width: 19px; height: 19px; right: -2px; bottom: -2px; box-shadow: 0 0 0 2px var(--card); background: var(--card); }
.chb svg { width: 11px; height: 11px; }
.it-name { font-weight: 600; font-size: var(--fs-md); }
.unread .it-name { font-weight: 700; }
.it-time { font-size: var(--fs-xs); }
.unread .it-time { color: var(--accent); font-weight: 600; }
.it-sub { font-size: var(--fs-sm); font-weight: 500; }
.it-body { font-size: var(--fs-sm); color: var(--ink3); }
.unread .it-body { color: var(--ink2); }
.it-foot { margin-top: 4px; min-height: 18px; gap: 8px; }
.it-ch { font-size: var(--fs-xs); }
.badge { background: none; padding: 0; color: var(--ink3); font-weight: 500; }
.badge.need { background: none; color: var(--accent); font-weight: 600; }
.badge.need::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; }
.badge.bot { background: none; color: var(--ink3); }
.badge.bot .dots { display: none; }
.unr { background: var(--accent); min-width: 18px; height: 18px; font: 600 11px/18px var(--ft); }
[data-skin="whatsapp"] .item { border-radius: var(--r); border-bottom: 0; }
.item.fresh { animation: fresh 1.2s var(--ease); }
@keyframes fresh { 0% { background: var(--tint); } 100% { background: transparent; } }
.empty-i { animation: none; border-radius: 16px; }

/* conversation */
.pane { background: var(--card); }
.th.enter { animation: slidein .28s var(--ease); }
@keyframes slidein { from { opacity: 0; transform: translateX(12px); } to { opacity: 1; transform: none; } }
.th-head { padding: 10px 12px; gap: 10px; }
.th-head .av { width: 38px; height: 38px; font: 600 14px/1 var(--fd); }
.th-name { font: 650 var(--fs-lg)/1.2 var(--ft); letter-spacing: -.01em; }
.th-meta { font-size: var(--fs-xs); }
.th-sum { margin: 12px 16px 0; padding: 12px 14px; background: var(--paper); border: 0; box-shadow: none; font-size: var(--fs-sm); color: var(--ink2); border-radius: var(--r); }
.th-sum .lbl { margin-bottom: 4px; }
.b.pop { animation: rise2 .25s var(--ease) var(--d, 0ms) both; }
@keyframes rise2 { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.compose { padding: 10px 12px; gap: 10px; }
.handoff { border: 0; background: var(--paper); border-radius: var(--r); padding: 10px 10px 10px 12px; }
.handoff p { font-size: var(--fs-xs); }
.handoff p b { font-size: var(--fs-sm); font-weight: 600; }
.handoff .face { font: 700 12px/1 var(--fd); }
.row textarea { border-radius: 22px; background: var(--paper); border-color: transparent; font-size: var(--fs-md); }
.row textarea:focus { outline: none; border-color: var(--line); background: var(--card); }
.send:hover { transform: none; }
.mode { border: 0; background: var(--paper); border-radius: var(--r-sm); }
.nothread b { font: 650 var(--fs-xl)/1.2 var(--ft); letter-spacing: -.01em; }
/* WhatsApp keeps its own look; only the quiet header controls follow the app */
.th-wa .th-head .btn { border-color: transparent; }
.th-wa .th-head .btn:hover { background: rgba(255,255,255,.12); }
.th-wa .th-sum { background: var(--card); margin: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.cp-wa .handoff { background: var(--wa-field); }
.cp-wa .handoff p { color: var(--wa-time); } .cp-wa .handoff p b { color: var(--wa-ink); }
.cp-wa .row textarea { background: var(--wa-field); }
/* email and comments: flatter cards */
.mcard { border-radius: var(--r); box-shadow: none; }
.mcard.open { box-shadow: var(--shadow); }
.subj { font: 650 var(--fs-xl)/1.25 var(--ft); letter-spacing: -.01em; }
.post { box-shadow: none; border-radius: var(--r); }

/* pages (settings, staff, Ask Razzy) */
.page { padding: 24px 20px 32px; gap: 16px; max-width: 760px; }
.page.enter > * { animation-duration: .3s; }
.pg-head h1 { font: 700 var(--fs-2xl)/1.05 var(--fd); letter-spacing: -.035em; }
.pg-head .sub { font-size: var(--fs-sm); }
.card, .sf, .req, .bk, .bc, .py, .kpi, .lst { border-radius: var(--r); box-shadow: none; }
.sf { padding: 14px 16px; }
.fld input, .fld select, .fld textarea, .ask textarea { border-radius: var(--r-sm); background: var(--paper); border-color: transparent; font-size: var(--fs-md); }
.fld input:focus-visible, .fld select:focus-visible, .fld textarea:focus-visible, .ask textarea:focus { background: var(--card); border-color: var(--line); box-shadow: none; outline: none; }
.sheet { border-radius: var(--r2) var(--r2) 0 0; }
.sh-head h2 { font: 700 var(--fs-xl)/1.1 var(--fd); letter-spacing: -.03em; }
.toast { border-radius: 99px; padding: 10px 18px; font-size: var(--fs-sm); font-weight: 500; }

/* settings: the theme switch */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--paper); border-radius: var(--r); }
.seg button { display: grid; justify-items: center; gap: 8px; padding: 12px 6px 10px; border: 0; border-radius: var(--r-sm); background: transparent; font-size: var(--fs-sm); font-weight: 500; color: var(--ink2); transition: background .2s, color .2s; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.seg .sw { width: 54px; height: 36px; border-radius: 8px; border: 1px solid var(--line); overflow: hidden; display: grid; grid-template-rows: 9px 1fr; }
.seg .sw i { display: block; }
.sw.light i:first-child { background: #ffffff; border-bottom: 1px solid #e8e7e3; } .sw.light i:last-child { background: #f7f7f5; }
.sw.dark i:first-child { background: #171716; border-bottom: 1px solid #272725; } .sw.dark i:last-child { background: #0e0e0d; }
.sw.system { grid-template-rows: 1fr; grid-template-columns: 1fr 1fr; } .sw.system i:first-child { background: #f7f7f5; } .sw.system i:last-child { background: #0e0e0d; }
.setrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line2); font-size: var(--fs-sm); }
.setrow:first-of-type { border-top: 0; }
.setrow span { color: var(--ink3); }
.setrow b { font-weight: 600; text-align: right; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

/* sign-in: quiet and finished */
.si { background: var(--paper); }
.si-card { box-shadow: var(--shadow); border-color: var(--line); padding: 36px 28px 24px; }
.si-lines i { opacity: .35; animation-duration: 8s; }
.si h1 { font-size: clamp(32px, 8.5vw, 40px); margin-top: 64px; letter-spacing: -.04em; }
.si-lead { font-size: var(--fs-md); }
.si-form input { height: 50px; border-radius: var(--r-sm); background: var(--paper); border-color: transparent; font-size: var(--fs-md); }
.si-form input:focus-visible { background: var(--card); border-color: var(--line); box-shadow: none; }
.si-form button { height: 50px; border-radius: var(--r-sm); font-size: var(--fs-md); }

@media (min-width: 1024px) {
  .top { padding: 10px 20px; }
  .rail { background: var(--paper); padding: 14px 10px; }
  .nv { height: 38px; font-weight: 500; font-size: var(--fs-sm); border-radius: var(--r-sm); }
  .nv[aria-current="true"] { background: var(--card); box-shadow: var(--shadow); font-weight: 600; }
  .nv .bi { width: 24px; height: 24px; border-radius: 7px; }
  .nv.box[aria-current="true"] .bi { transform: none; }
  .listpane { border-right: 1px solid var(--line); }
  .listhead { padding-top: 24px; }
  .th-head { padding: 12px 22px; }
  .th-sum { margin: 14px 28px 0; }
  .page { padding: 40px 48px; }
}

/* critique fixes (pass 2): calm avatars everywhere, tidy staff rows, no repeated channel names, visible swatches */
.av { color: var(--c, var(--ink2)); background: color-mix(in srgb, var(--c, var(--ink3)) 14%, var(--card)); font-weight: 600; }
.sf .av { --c: var(--accent); width: 40px; height: 40px; font-size: 15px; }
.th-wa .th-head .av { color: #fff; background: rgba(255,255,255,.18); }
.mechip .av.sm { color: var(--paper); background: var(--ink); }
.sf { grid-template-columns: auto minmax(0, 1fr) auto; row-gap: 10px; }
.sf > select { grid-column: 2; grid-row: 2; min-height: 36px; width: 100%; }
.sf > .btn { grid-column: 3; grid-row: 2; }
.listpane:not([data-skin="all"]):not([data-skin="comments"]) .it-ch { visibility: hidden; }
.seg .sw { border-color: color-mix(in srgb, var(--ink3) 45%, transparent); }
@media (min-width: 720px) {
  .sf { grid-template-columns: auto minmax(0, 1fr) 180px auto; }
  .sf > select { grid-column: 3; grid-row: 1; }
  .sf > .btn { grid-column: 4; grid-row: 1; }
}
