/* BCS app · same "Sunset Glass" world as the website (see DESIGN.md) */
:root {
  --canvas: #FFFFFF; --parchment: #F5F5F7; --ink: #1D1D1F; --muted: #5E5E63; --hairline: #D2D2D7;
  --tile: #111113; --accent: #F28B30; --accent-press: #E07A20; --accent-ink: #B4561A;
  --peach: #FFC4A1; --amber: #FFD48C; --sky: #A8D5FF; --danger: #C4352B;
  --font: -apple-system, "SF Pro Text", "Inter", system-ui, "Segoe UI", sans-serif;
  --r: 22px; --r-small: 14px; --ease: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
  --surface: rgb(255 255 255 / .82); --field: #fff; --bar: rgb(255 255 255 / .72);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; font-family: var(--font); font-size: 17px; line-height: 1.45; color: var(--ink);
  background:
    radial-gradient(60vmax 40vmax at 0% 0%, rgb(255 196 161 / .55), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 0%, rgb(168 213 255 / .45), transparent 70%),
    var(--canvas) fixed;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.12; }
h1 { font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem); font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
p { margin: 0; }
a { color: var(--accent-ink); }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.stack { display: grid; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }

/* top bar */
.bar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgb(0 0 0 / .06);
}
.bar__brand { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: 0.04em; }
.bar__nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.bar__nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink); text-decoration: none; font-size: 0.9375rem; white-space: nowrap; }
.bar__nav a[aria-current="page"] { background: var(--ink); color: #fff; }

.view { width: min(760px, 100%); margin: 0 auto; padding: 24px 16px calc(48px + env(safe-area-inset-bottom)); outline: none; }
.view > * + * { margin-top: 18px; }

/* cards & forms */
.card { padding: 20px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .9), 0 14px 40px -22px rgb(30 20 10 / .35); }
.card--flat { background: var(--parchment); box-shadow: none; }
label { display: grid; gap: 6px; font-weight: 600; font-size: 0.9375rem; }
input, select, textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--hairline); border-radius: var(--r-small);
  background: var(--field); color: var(--ink); font: inherit; font-weight: 400;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgb(242 139 48 / .35); border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice label { padding: 14px; border: 1px solid var(--hairline); border-radius: var(--r-small); background: var(--field); cursor: pointer; font-weight: 600; }
.choice label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px rgb(242 139 48 / .25); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice small { display: block; font-weight: 400; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 0; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--ink); transition: transform .2s var(--ease), background-color .2s;
}
.btn:active { transform: scale(.96); }
.btn:hover { background: var(--accent-press); }
.btn--ghost { background: rgb(0 0 0 / .06); }
.btn--ghost:hover { background: rgb(0 0 0 / .1); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--dark:hover { background: #000; }
.btn--danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px currentColor; }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 0.9375rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.error { color: var(--danger); font-weight: 600; }

/* lists */
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.item { display: grid; gap: 4px; padding: 16px 18px; border-radius: var(--r); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .9), 0 10px 30px -22px rgb(30 20 10 / .4); }
.item__top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.item__title { font-weight: 650; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8125rem; font-weight: 650; white-space: nowrap; background: var(--parchment); }
.pill--new { background: var(--amber); }
.pill--assigned { background: var(--sky); }
.pill--in_progress { background: var(--peach); }
.pill--done { background: #CDEFD3; }
.pill--cancelled, .pill--refused, .pill--blocked { background: #F2D6D3; }
.pill--pending { background: var(--amber); }
.pill--approved { background: #CDEFD3; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-small); background: var(--parchment); }
dl.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* chat */
.chat { display: grid; gap: 8px; max-height: 55dvh; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 18px; background: var(--field); box-shadow: 0 1px 2px rgb(0 0 0 / .06); white-space: pre-wrap; overflow-wrap: anywhere; }
.msg--me { justify-self: end; background: var(--accent); border-bottom-right-radius: 6px; }
.msg--them { justify-self: start; border-bottom-left-radius: 6px; }
.msg__who { display: block; font-size: 0.75rem; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.msg__time { display: block; font-size: 0.6875rem; opacity: .6; margin-top: 4px; text-align: right; }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { min-height: 46px; max-height: 160px; }
.composer .btn { flex: none; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 0; padding: 8px 14px; border-radius: 999px; background: rgb(0 0 0 / .06); font: inherit; font-size: 0.9375rem; cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); opacity: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; pointer-events: none; transition: opacity .3s, transform .4s var(--ease); max-width: calc(100% - 32px); }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.legal h2 { margin-top: 22px; }
.legal p, .legal li { margin-top: 8px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* back to the website */
.bar__nav a.bar__site { color: var(--muted); }
.bar__nav a.bar__site::before { content: "\2190\00a0"; }
/* how-it-works guides */
.guide summary { font-weight: 650; cursor: pointer; }
.guide ol { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 8px; color: var(--muted); }
.guide b { color: var(--ink); }
#tabHelp { margin-top: 10px; }

/* admin: wider screens for numbers */
.view:has(#dash), .view:has(.tiles) { width: min(1040px, 100%); }
.dash__h { margin-top: 26px; font-size: 1rem; color: var(--muted); font-weight: 650; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin-top: 10px; }
.tile { display: grid; gap: 2px; align-content: start; padding: 16px 18px; border-radius: var(--r); background: var(--surface); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .9), 0 10px 30px -22px rgb(30 20 10 / .4); }
.tile__label { font-size: 0.875rem; color: var(--muted); font-weight: 600; }
.tile__value { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tile__note { font-size: 0.8125rem; color: var(--muted); }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-top: 18px; }
.chart h2 { font-size: 1.0625rem; }
.chart > .muted { margin-top: 2px; }

/* columns (one series, one hue) */
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 190px; margin-top: 14px; }
.col { display: grid; grid-template-rows: 18px 1fr 18px; height: 100%; text-align: center; }
.col__val { font-size: 0.75rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col__track { position: relative; border-bottom: 1px solid var(--hairline); }
.col__fill { position: absolute; left: 50%; bottom: 0; width: min(70%, 28px); transform: translateX(-50%); border-radius: 4px 4px 0 0; background: var(--accent); }
.col:hover .col__fill { background: var(--accent-press); }
.col__label { font-size: 0.6875rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
.cols:has(.col:nth-child(9)) .col:nth-child(odd):not(:last-child) .col__label { visibility: hidden; }

/* horizontal bars */
.hbars { display: grid; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.hbars li { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 0.9375rem; }
.hbars__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars__track { height: 10px; border-radius: 0 4px 4px 0; background: var(--parchment); }
.hbars__fill { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); }
.hbars__val { font-weight: 650; font-variant-numeric: tabular-nums; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.qty { margin-top: 8px; }
.qty b { min-width: 2ch; text-align: center; font-variant-numeric: tabular-nums; }
.qty select, .qty input { width: auto; padding: 8px 10px; }
a.item__title { color: var(--ink); }

/* faces (photo or coloured BCS avatar) */
.face { flex: none; border-radius: 50%; object-fit: cover; background: var(--parchment); }
.bar__nav a .face { width: 22px; height: 22px; margin: -3px 6px -3px -4px; vertical-align: middle; display: inline-block; }
.person { display: inline-flex; align-items: center; gap: 10px; }
.msg__who { display: flex; align-items: center; gap: 6px; }
.faces { display: flex; flex-wrap: wrap; gap: 8px; }
.faces button { padding: 3px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; }
.faces button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--accent); }
.faces img { display: block; }

/* messages */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.75rem; font-weight: 700; vertical-align: 1px; }
.badge[hidden] { display: none; }
.thread { grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; }
.thread__body { display: grid; gap: 2px; min-width: 0; }
.thread__last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 0.9375rem; }
.thread.is-unread .thread__last { color: var(--ink); font-weight: 600; }
.chat__title { font-size: 1.375rem; }

/* theme button */
.theme-btn { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 999px; background: rgb(0 0 0 / .06); color: var(--ink); cursor: pointer; transition: transform .3s var(--ease), background-color .2s; }
.theme-btn:hover { transform: rotate(-14deg) scale(1.06); }
.theme-btn svg { width: 18px; height: 18px; }
.theme-btn__sun { display: none; }
[data-theme="dark"] .theme-btn__sun { display: block; }
[data-theme="dark"] .theme-btn__moon { display: none; }

/* ─── Dark theme: same sunset, after dark ─────────────────── */
[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0C0C0E; --parchment: #1A1A1D; --ink: #F5F5F7; --muted: #A1A1A6; --hairline: #2E2E33;
  --tile: #1C1C1F; --accent-ink: #FFB273; --danger: #FF6B5E;
  --peach: #7A3E22; --amber: #6B4A12; --sky: #1C3A5E;
  --surface: rgb(30 30 34 / .82); --field: #1E1E22; --bar: rgb(18 18 20 / .72);
}
[data-theme="dark"] body {
  background:
    radial-gradient(60vmax 40vmax at 0% 0%, rgb(242 139 48 / .16), transparent 70%),
    radial-gradient(50vmax 40vmax at 100% 0%, rgb(77 107 255 / .14), transparent 70%),
    var(--canvas) fixed;
}
[data-theme="dark"] .bar { border-bottom-color: rgb(255 255 255 / .06); }
[data-theme="dark"] .bar__nav a[aria-current="page"], [data-theme="dark"] .tabs button[aria-pressed="true"] { background: var(--ink); color: var(--canvas); }
[data-theme="dark"] .card, [data-theme="dark"] .item, [data-theme="dark"] .tile { box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06), 0 14px 40px -22px rgb(0 0 0 / .8); }
[data-theme="dark"] .btn--ghost, [data-theme="dark"] .tabs button, [data-theme="dark"] .theme-btn { background: rgb(255 255 255 / .08); color: var(--ink); }
[data-theme="dark"] .btn--ghost:hover { background: rgb(255 255 255 / .14); }
[data-theme="dark"] .btn--dark { background: var(--ink); color: var(--canvas); }
[data-theme="dark"] .msg--me { color: #1D1D1F; }
[data-theme="dark"] .pill { color: #1D1D1F; }
[data-theme="dark"] .pill--new, [data-theme="dark"] .pill--pending { background: #FFD48C; }
[data-theme="dark"] .pill--assigned { background: #A8D5FF; }
[data-theme="dark"] .pill--in_progress { background: #FFC4A1; }
[data-theme="dark"] .pill:not([class*="pill--"]) { background: var(--parchment); color: var(--ink); }
[data-theme="dark"] .hbars__track { background: rgb(255 255 255 / .08); }
[data-theme="dark"] .bar__brand img, [data-theme="dark"] .face[src$="logo.svg"] { filter: drop-shadow(0 0 1px rgb(255 255 255 / .35)); }
[data-theme="dark"] .toast { color: var(--canvas); }

/* ─── Home button + phone navigation (2026-11-08) ─────────────
   The logo and the house both lead to the website's home (the "Hello" page).
   On a phone the tabs move to their own row, in a grid: every tab visible, nothing to scroll,
   and the BCS name keeps its room. */
.bar__brand img { border-radius: 50%; }
.home-btn { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 999px; background: rgb(0 0 0 / .05); color: var(--ink); transition: transform .4s cubic-bezier(.34, 1.56, .64, 1); }
.home-btn:hover { transform: scale(1.08); }
.home-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .home-btn { background: rgb(255 255 255 / .08); }
.bar__brand { order: 0; }
.bar__nav { order: 1; }
.home-btn { order: 2; }
.theme-btn { order: 3; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; row-gap: 10px; }
  .bar__nav { order: 4; flex: 1 0 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; overflow: visible; }
  .bar__nav a { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 8px 6px; font-size: 0.8125rem; font-weight: 550; text-align: center; background: rgb(0 0 0 / .045); border-radius: 14px; }
  [data-theme="dark"] .bar__nav a { background: rgb(255 255 255 / .06); }
  [data-theme="dark"] .bar__nav a[aria-current="page"] { background: var(--ink); color: var(--canvas); }
  .bar__nav a .face { margin: 0 2px 0 0; width: 18px; height: 18px; }
  .bar__nav .badge { margin-left: 2px; }
}

/* ─── The messenger (2026-11-08) ──────────────────────────────
   A conversation takes the whole screen, like a real messaging app:
   header with the other person (tap = their profile), messages, then the composer
   with photos and documents. On a phone the app bar steps aside. */
body.chat-mode { overflow: hidden; }
body.chat-mode .view { width: min(860px, 100%); padding: 16px 16px 0; }
.cv { position: relative; display: flex; flex-direction: column; height: calc(100dvh - 96px); border-radius: 28px; overflow: hidden;
  background: var(--surface); box-shadow: inset 0 0 0 1px rgb(255 255 255 / .08), 0 30px 80px -40px rgb(0 0 0 / .5); }
.cv.is-drop { box-shadow: inset 0 0 0 2px var(--accent); }
.cv__head { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 10px 10px 6px; border-bottom: 1px solid rgb(127 127 127 / .14);
  background: var(--bar); -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); }
.cv__icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; color: var(--accent-ink, var(--ink)); }
.cv__icon:hover { background: rgb(127 127 127 / .12); }
.cv__icon svg { width: 24px; height: 24px; }
.cv__who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 2px; border-radius: 16px; color: var(--ink); text-decoration: none; }
.cv__who:hover { background: rgb(127 127 127 / .08); }
.cv__who .face { flex: none; }
.cv__names { min-width: 0; display: grid; }
.cv__names b { font-size: 1.0625rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv__names small { color: var(--muted); font-size: 0.8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cv__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 3px; padding: 14px 14px 18px; }
.cv__empty { margin: auto; max-width: 30ch; text-align: center; color: var(--muted); }
.cv__day { align-self: center; margin: 14px 0 8px; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.cv__day span { padding: 4px 12px; border-radius: 999px; background: rgb(127 127 127 / .12); }
.cv__from { display: flex; align-items: center; gap: 6px; margin: 10px 0 2px 4px; font-size: 0.75rem; font-weight: 650; color: var(--muted); }
.cv__msg { position: relative; max-width: min(78%, 520px); padding: 8px 12px 6px; border-radius: 20px; background: var(--field); color: var(--ink);
  box-shadow: 0 1px 1px rgb(0 0 0 / .06); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.38; }
.cv__msg.is-new { animation: cv-in .35s cubic-bezier(.2, .9, .3, 1.2) both; }
.cv__msg.is-me { align-self: flex-end; background: var(--accent); color: #1D1D1F; border-bottom-right-radius: 6px; }
.cv__msg.is-them { align-self: flex-start; border-bottom-left-radius: 6px; }
.cv__msg:not(.is-joined) { margin-top: 6px; }
.cv__msg.is-joined.is-me { border-top-right-radius: 8px; }
.cv__msg.is-joined.is-them { border-top-left-radius: 8px; }
.cv__msg.is-files { padding: 4px; }
.cv__text { display: block; }
.cv__msg.is-files .cv__time { position: absolute; right: 10px; bottom: 8px; padding: 2px 7px; border-radius: 999px; background: rgb(0 0 0 / .45); color: #fff; opacity: 1; }
.cv__time { display: block; margin-top: 2px; font-size: 0.6875rem; text-align: right; opacity: .6; }
@keyframes cv-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.cv__imgs { display: grid; gap: 3px; margin: -4px -8px 6px; border-radius: 16px; overflow: hidden; width: min(300px, 62vw); }
.cv__msg.is-files .cv__imgs { margin: 0; }
.cv__imgs--2, .cv__imgs--3 { grid-template-columns: 1fr 1fr; }
.cv__imgs--3 .cv__img:first-child { grid-column: 1 / -1; }
.cv__img { display: block; padding: 0; border: 0; background: rgb(127 127 127 / .15); cursor: zoom-in; }
.cv__img img { display: block; width: 100%; max-height: 360px; min-height: 90px; object-fit: cover; }
.cv__imgs--2 .cv__img img, .cv__imgs--3 .cv__img img { aspect-ratio: 1 !important; height: auto; }
.cv__doc { display: flex; align-items: center; gap: 10px; margin: 2px -4px 6px; padding: 10px 12px; min-width: min(240px, 56vw); border-radius: 14px;
  background: rgb(0 0 0 / .07); color: inherit; text-decoration: none; }
.cv__msg.is-files .cv__doc { margin: 2px 2px 26px; }
.cv__doc:hover { background: rgb(0 0 0 / .11); }
.cv__docicon { position: relative; flex: none; display: grid; place-items: center; width: 38px; height: 44px; }
.cv__docicon svg { width: 38px; height: 44px; opacity: .8; }
.cv__docicon i { position: absolute; bottom: 7px; font-style: normal; font-size: 0.5625rem; font-weight: 800; letter-spacing: .03em; }
.cv__docname { min-width: 0; display: grid; }
.cv__docname b { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv__docname small { font-size: 0.75rem; opacity: .7; }

.cv__tray { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 12px 2px; border-top: 1px solid rgb(127 127 127 / .14); }
.cv__chip { position: relative; flex: none; display: grid; justify-items: center; gap: 4px; width: 76px; }
.cv__chip img, .cv__chip .cv__docicon { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: rgb(127 127 127 / .14); }
.cv__chip .cv__docicon svg { width: 30px; height: 36px; }
.cv__chipname { width: 100%; font-size: 0.6875rem; color: var(--muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv__chip button { position: absolute; top: -4px; right: 2px; display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 999px; background: var(--ink); color: var(--canvas); cursor: pointer; }
.cv__chip button svg { width: 12px; height: 12px; }

.cv__compose { flex: none; display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
.cv__tray[hidden] + .cv__compose { border-top: 1px solid rgb(127 127 127 / .14); }
.cv__plus, .cv__send { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 999px; cursor: pointer; transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), opacity .2s; }
.cv__plus { background: rgb(127 127 127 / .14); color: var(--ink); }
.cv__plus:hover { transform: rotate(90deg); }
.cv__send { background: var(--accent); color: #1D1D1F; }
.cv__send:disabled { opacity: .35; cursor: default; }
.cv__send:not(:disabled):hover { transform: scale(1.08); }
.cv__plus svg, .cv__send svg { width: 22px; height: 22px; }
.cv__compose textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 16px; border-radius: 22px; resize: none; line-height: 1.35; font-size: 1rem; }
.cv__compose.is-busy .cv__send { animation: cv-pulse 1s ease-in-out infinite; }
@keyframes cv-pulse { 50% { transform: scale(.88); } }
.cv__closed { flex: none; padding: 14px; text-align: center; color: var(--muted); border-top: 1px solid rgb(127 127 127 / .14); }

/* the photo viewer */
.lb { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: calc(56px + env(safe-area-inset-top)) 12px calc(20px + env(safe-area-inset-bottom)); background: rgb(0 0 0 / .92); }
.lb[hidden] { display: none; }
.lb img { max-width: 100%; max-height: 100%; border-radius: 12px; object-fit: contain; animation: cv-in .3s ease both; }
.lb__bar { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; }
.lb__btn { display: inline-grid; place-items: center; min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: rgb(255 255 255 / .14); color: #fff; font: inherit; font-size: 0.9375rem; text-decoration: none; cursor: pointer; }
.lb__close { width: 40px; padding: 0; }
.lb__close svg { width: 20px; height: 20px; }

/* link from the request page to its chat */
.chatlink { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; transition: transform .3s var(--ease); }
.chatlink:hover { transform: translateY(-2px); }
.chatlink > span:nth-child(2) { flex: 1; display: grid; gap: 2px; }
.chatlink__icon { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 16px; background: var(--accent); color: #1D1D1F; }
.chatlink__icon svg { width: 24px; height: 24px; }
.chatlink__go { font-size: 1.75rem; color: var(--muted); }
/* someone's profile */
.pp { justify-items: center; padding-top: 28px; }
.pp .face { box-shadow: 0 16px 40px -18px rgb(0 0 0 / .5); }
.pp h1 { margin: 0; }
.pp__actions { justify-content: center; }

[data-theme="dark"] .cv__doc { background: rgb(255 255 255 / .07); }
[data-theme="dark"] .cv__msg.is-me .cv__doc { background: rgb(0 0 0 / .1); }

@media (max-width: 760px) {
  body.chat-mode .bar { display: none; }
  body.chat-mode .view { padding: 0; width: 100%; }
  .cv { height: var(--vvh, 100dvh); border-radius: 0; box-shadow: none; }
  .cv__head { padding-top: calc(8px + env(safe-area-inset-top)); }
  .cv__msg { max-width: 82%; }
}
@media (prefers-reduced-motion: reduce) { .cv__msg, .lb img { animation: none; } }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cv__tray[hidden] { display: none; }
