/* Sparkling CRM. Look (Andriy, 18 Nov 2026): expensive monochrome on a light ground, state by fill and weight; colour only in emoji.
   Layout: phone = one scrolling column + bottom tabs + sheet for a person; desktop (≥ 960px) = rail · list · open person. */
@font-face { font-family: 'TildaSans'; src: url('/fonts/TildaSans-VF.woff2') format('woff2'); font-weight: 300 800; font-display: swap; }
@font-face { font-family: 'Playfair'; src: url('/fonts/PlayfairDisplay-Ital.woff') format('woff'); font-style: italic; font-weight: 400; font-display: swap; }
:root {
  color-scheme: light;
  --bg: #fafafa; --surface: #ffffff; --ink: #0d0d0d; --ink-2: #686868; --ink-3: #767676; --line: #e8e8e8; --line-2: #d4d4d4;
  --fill: #f2f2f2; --fill-2: #e8e8e8; --inv: #ffffff; --scrim: rgba(0,0,0,.28);
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px rgba(0,0,0,.06); --shadow-up: 0 -10px 40px rgba(0,0,0,.14);
  --sans: 'TildaSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --serif: 'Playfair', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --r: 14px; --ease: cubic-bezier(.2,.8,.2,1); --gut: max(16px, env(safe-area-inset-left, 0px)); --gut-r: max(16px, env(safe-area-inset-right, 0px));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* boot + sign-in */
.boot { height: 100%; display: grid; place-items: center; }
.boot-mark { font-family: var(--serif); font-style: italic; font-size: 44px; animation: pulse 1.4s ease-in-out infinite; }
.gate { height: 100%; overflow-y: auto; display: grid; place-items: center; padding: 32px var(--gut-r) calc(32px + env(safe-area-inset-bottom, 0px)) var(--gut); }
.gate-card { width: 100%; max-width: 400px; display: grid; gap: 18px; animation: rise .5s var(--ease) both; }
.gate h1 { font-size: 34px; }
.gate p { margin: 0; color: var(--ink-2); }
.gate .note { font-size: 13px; color: var(--ink-3); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 50px; padding: 0 20px; border-radius: 16px; font-size: 16px; font-weight: 500; transition: transform .15s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.98); } .btn:disabled { opacity: .5; cursor: default; }
.btn-ink { background: var(--ink); color: var(--inv); } .btn-soft { background: var(--fill); } .btn-line { border: 1px solid var(--line-2); background: var(--surface); }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-wide { width: 100%; }
.err { color: var(--ink); background: var(--fill); padding: 10px 12px; border-radius: 12px; font-size: 14px; }

/* shell */
.app { height: 100%; display: grid; grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
.rail { display: none; }
.main { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: calc(18px + env(safe-area-inset-top, 0px)) var(--gut-r) 28px var(--gut); }
.head { display: grid; gap: 6px; margin-bottom: 14px; }
.brandrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 28px; }
.brand { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: var(--ink-2); }
.brand b { color: var(--ink); font-weight: 600; }
.me { display: flex; align-items: center; gap: 8px; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); transition: background .3s; }
.dot-live.on { background: var(--ink); box-shadow: 0 0 0 3px var(--fill-2); }
.noscript { padding: 24px; }
.avatar-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--fill); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
h1 { margin: 2px 0 0; font-weight: 300; font-size: 30px; line-height: 1.08; letter-spacing: -.015em; text-wrap: balance; }
h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; }
.sub { color: var(--ink-2); font-size: 14px; }

/* switch (Live: Tasks | Plays; People: List | Board | Table) */
.switch { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 12px; background: var(--fill); margin-bottom: 14px; position: relative; }
.switch button { position: relative; z-index: 1; padding: 7px 14px; border-radius: 9px; font-size: 14px; color: var(--ink-2); transition: color .25s; white-space: nowrap; }
.switch button[aria-pressed="true"] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.switch .count { font-size: 12px; color: var(--ink-3); margin-left: 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: space-between; }

/* event switcher */
.evbar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut-r)) 14px calc(-1 * var(--gut)); padding: 0 var(--gut-r) 2px var(--gut); }
.evbar::-webkit-scrollbar { display: none; }
.seg { flex: none; display: grid; gap: 1px; text-align: left; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); transition: background .25s var(--ease), color .25s, border-color .25s; min-width: 92px; }
.seg b { font-weight: 500; font-size: 14px; white-space: nowrap; }
.seg small { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; }
.seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--inv); }
.seg[aria-pressed="true"] small { color: var(--ink-3); }

.section-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 20px 2px 8px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.section-h:first-child { margin-top: 0; }
.list { display: grid; gap: 8px; }
.empty { padding: 36px 16px; text-align: center; color: var(--ink-2); display: grid; gap: 6px; justify-items: center; }
.empty .e { font-size: 28px; }
.skeleton { height: 74px; border-radius: var(--r); background: linear-gradient(90deg, var(--fill) 0%, var(--surface) 50%, var(--fill) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }

/* person row */
.row { position: relative; border-radius: var(--r); overflow: hidden; touch-action: pan-y; animation: rise .35s var(--ease) both; }
.row .under { position: absolute; inset: 0; display: flex; justify-content: space-between; align-items: center; padding: 0 22px; font-size: 13px; font-weight: 500; background: var(--fill-2); }
.card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 12px 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: transform .35s var(--ease), border-color .2s, box-shadow .2s; }
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow); }
.card[aria-current="true"] { border-color: var(--ink); }
.card.flash { animation: flash 1.2s var(--ease); }
.card .hit { position: absolute; inset: 0; border-radius: var(--r); }
.av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 500; letter-spacing: .04em; background: var(--fill); position: relative; flex: none; }
.av.hot { background: var(--ink); color: var(--inv); }
.av .emo { position: absolute; right: -4px; bottom: -4px; font-size: 15px; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.who { min-width: 0; pointer-events: none; }
.who .n { font-weight: 500; font-size: 15.5px; display: flex; gap: 8px; align-items: center; min-width: 0; }
.who .n > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .m { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who .last { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.who .last i { font-style: normal; color: var(--ink-2); }
.unread { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.dmbtn { position: relative; z-index: 1; display: grid; justify-items: center; gap: 2px; width: 54px; padding: 8px 0; border-radius: 12px; background: var(--fill); font-size: 11px; font-weight: 500; transition: transform .15s var(--ease), background .2s; }
.dmbtn:hover { background: var(--fill-2); } .dmbtn:active { transform: scale(.94); }
.dmbtn.off { opacity: .45; }
.pill { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; white-space: nowrap; letter-spacing: .02em; flex: none; }
.s-hot, .s-booked { background: var(--ink); color: var(--inv); }
.s-interested { background: var(--fill-2); }
.s-contacted { border: 1px solid var(--line-2); color: var(--ink-2); }
.s-new { border: 1px solid var(--ink); }
.s-nofit, .s-later { color: var(--ink-3); border: 1px solid var(--line); }
.s-booked::before { content: "✓ "; }

/* task card (Live) */
.task { display: grid; gap: 10px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; animation: rise .35s var(--ease) both; }
.task .why { font-size: 13px; color: var(--ink-2); display: flex; gap: 8px; align-items: baseline; }
.task .why b { color: var(--ink); font-weight: 500; }
.draft { position: relative; background: var(--fill); border-radius: 16px 16px 16px 4px; padding: 12px 14px; font-size: 14.5px; white-space: pre-wrap; }
.draft .meta { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--ink-2); margin-top: 8px; white-space: normal; }
.task .acts { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--fill); transition: transform .15s var(--ease), background .2s; }
.icon-btn:hover { background: var(--fill-2); } .icon-btn:active { transform: scale(.94); }

/* plays */
.play { background: var(--ink); color: var(--inv); border-radius: 18px; padding: 16px; display: grid; gap: 10px; animation: rise .4s var(--ease) both; }
.play .k { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #a8a8a8; display: flex; justify-content: space-between; gap: 10px; }
.play .t { font-size: 19px; line-height: 1.25; } .play .t em { font-family: var(--serif); font-style: italic; }
.play .w { font-size: 13px; color: #c9c9c9; }
.play .acts { display: flex; gap: 8px; } .play .acts .btn { flex: 1; height: 44px; font-size: 14px; }
.play .btn-w { background: var(--inv); color: var(--ink); } .play .btn-g { background: #262626; color: var(--inv); }
.prog { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; } .prog div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.prog b { display: block; font-size: 24px; font-weight: 300; line-height: 1.1; } .prog small { font-size: 11px; color: var(--ink-2); }
.bar { height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--ink); transform-origin: left; animation: grow .8s var(--ease) both; }

/* board + table */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 10px; overflow-x: auto; margin: 0 calc(-1 * var(--gut-r)) 0 calc(-1 * var(--gut)); padding: 2px var(--gut-r) 12px var(--gut); scroll-snap-type: x proximity; }
.col { display: grid; gap: 8px; align-content: start; scroll-snap-align: start; min-height: 120px; padding: 8px; border-radius: 16px; background: var(--fill); transition: background .2s; }
.col.over { background: var(--fill-2); }
.col .ch { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); display: flex; justify-content: space-between; padding: 4px 4px 2px; }
.mini { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; text-align: left; cursor: grab; transition: box-shadow .2s, transform .2s var(--ease); }
.mini:hover { box-shadow: var(--shadow); } .mini.drag { opacity: .4; } .mini.quiet { border-style: dashed; border-color: var(--line-2); }
.mini .n { font-weight: 500; font-size: 14px; } .mini .r { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table.t { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 13.5px; }
table.t th { text-align: left; font-weight: 500; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); padding: 10px 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); cursor: pointer; white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
table.t tr:last-child td { border-bottom: 0; } table.t tbody tr { cursor: pointer; } table.t tbody tr:hover { background: var(--bg); }

/* workshops */
.events { display: grid; gap: 10px; }
.ecard { display: grid; gap: 12px; text-align: left; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); animation: rise .4s var(--ease) both; width: 100%; }
.ecard:hover { border-color: var(--line-2); box-shadow: var(--shadow); } .ecard:active { transform: scale(.995); }
.ecard .t { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ecard .t b { font-size: 18px; font-weight: 500; } .ecard .t span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; } .flag { font-size: 12px; padding: 4px 9px; border-radius: 8px; background: var(--fill); } .flag.strong { background: var(--ink); color: var(--inv); }
.seat { display: grid; grid-template-columns: 108px 1fr 52px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--ink-2); }
.seat b { color: var(--ink); font-weight: 500; text-align: right; }
.funnel { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line); padding-top: 10px; }
.funnel b { display: block; font-size: 20px; font-weight: 300; line-height: 1.2; } .funnel small { font-size: 11px; color: var(--ink-2); }
.money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.money div { padding: 10px; border-radius: 12px; background: var(--fill); } .money b { display: block; font-size: 18px; font-weight: 400; } .money small { font-size: 11px; color: var(--ink-2); }

/* ask */
.ask { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px; padding: 4px 5px 4px 14px; box-shadow: var(--shadow); transition: border-color .2s; margin-bottom: 12px; }
.ask:focus-within { border-color: var(--ink); }
.ask input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 11px 0; font-size: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 13px; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, background .2s; text-align: left; }
.chip:hover { border-color: var(--ink); } .chip[aria-pressed="true"] { background: var(--ink); color: var(--inv); border-color: var(--ink); }
.answer { display: grid; gap: 12px; margin: 4px 0 14px; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); animation: rise .4s var(--ease) both; }
.answer .q { font-size: 13px; color: var(--ink-2); display: flex; justify-content: space-between; gap: 10px; }
.answer .big { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .answer .big strong { font-size: 52px; font-weight: 200; line-height: 1; } .answer .big span { color: var(--ink-2); }
.bars { display: grid; gap: 4px; }
.barrow { display: grid; grid-template-columns: minmax(80px, 120px) 1fr 34px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 6px; margin: 0 -6px; border-radius: 8px; text-align: left; width: calc(100% + 12px); transition: background .2s; }
.barrow:hover { background: var(--fill); } .barrow[aria-pressed="true"] { background: var(--fill-2); }
.barrow b { font-weight: 500; text-align: right; }
.thinking { display: flex; gap: 6px; align-items: center; color: var(--ink-2); font-size: 13px; }
.thinking i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); animation: blink 1s infinite; }
.thinking i:nth-child(2) { animation-delay: .15s; } .thinking i:nth-child(3) { animation-delay: .3s; }
.find { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 12px; }
.find input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 10px 0; font-size: 16px; }

/* pulse */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.kpi b { font-size: 28px; font-weight: 300; line-height: 1.1; } .kpi small { font-size: 12px; color: var(--ink-2); } .kpi .d { font-size: 12px; }
.ann { padding: 14px; border-radius: 16px; background: var(--ink); color: var(--inv); display: grid; gap: 4px; animation: rise .4s var(--ease) both; margin-bottom: 10px; }
.ann small { color: #a8a8a8; font-size: 12px; } .ann b { font-weight: 500; }
.form { display: grid; gap: 8px; } .form input, .form textarea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; font-size: 16px; outline: 0; }
.form input:focus, .form textarea:focus { border-color: var(--ink); } .form textarea { min-height: 80px; resize: vertical; }

/* tabs */
.tabs { display: grid; grid-template-columns: repeat(var(--n, 4), 1fr); background: rgba(255,255,255,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line);
  padding: 6px var(--gut-r) calc(6px + env(safe-area-inset-bottom, 0px)) var(--gut); z-index: 4; }
.tab { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 11px; color: var(--ink-3); transition: color .2s; text-decoration: none; }
.tab > span:first-child { position: relative; display: grid; place-items: center; }
.tab svg { transition: transform .3s var(--ease); }
.tab[aria-current="page"] { color: var(--ink); } .tab[aria-current="page"] svg { transform: scale(1.08); }
.badge { position: absolute; transform: translate(12px, -5px); background: var(--ink); color: var(--inv); font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; animation: pop .35s var(--ease); }

/* sheet (person) */
.scrim { position: fixed; inset: 0; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .35s var(--ease); z-index: 8; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; height: calc(100% - 44px - env(safe-area-inset-top, 0px)); z-index: 9; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-up);
  transform: translateY(105%); transition: transform .5s var(--ease); display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; visibility: hidden; }
.sheet.on { transform: translateY(0); visibility: visible; } .sheet.drag { transition: none; }
.grab { padding: 10px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; } .grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--gut-r) 20px var(--gut); }
.dock { display: none; padding: 10px var(--gut-r) calc(10px + env(safe-area-inset-bottom, 0px)) var(--gut); border-top: 1px solid var(--line); background: var(--surface); gap: 8px; grid-template-columns: 1fr auto auto; }
.sheet.on .dock { display: grid; }
.big-dm { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 16px; background: var(--ink); color: var(--inv); font-size: 16px; font-weight: 500; transition: transform .15s var(--ease); text-decoration: none; min-width: 0; }
.big-dm span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .big-dm:active { transform: scale(.98); }
.sq { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--fill); transition: transform .15s var(--ease); } .sq:active { transform: scale(.94); }
.detail { display: grid; gap: 18px; animation: rise .3s var(--ease) both; }
.d-head { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 14px; align-items: center; }
.d-head .av { width: 60px; height: 60px; font-size: 19px; }
.d-head .n { font-size: 22px; font-weight: 500; line-height: 1.2; overflow-wrap: anywhere; } .d-head .m { color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.close { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); display: grid; place-items: center; color: var(--ink-2); }
.agent { display: grid; gap: 8px; padding: 14px; border-radius: var(--r); background: var(--fill); }
.agent .top { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.agent .top span:last-child { letter-spacing: 0; text-transform: none; }
.agent .say { font-size: 15px; } .agent .next { font-size: 14px; display: flex; gap: 8px; align-items: baseline; } .agent .next b { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 600; flex: none; }
.agent .wrong { justify-self: start; font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.status-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gut-r)) 0 calc(-1 * var(--gut)); padding: 2px var(--gut-r) 2px var(--gut); }
.status-row::-webkit-scrollbar { display: none; }
.st { flex: none; font-size: 13px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); transition: background .25s var(--ease), color .25s, border-color .25s; }
.st[aria-pressed="true"] { color: var(--inv); background: var(--ink); border-color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin: 0; }
.facts div { background: var(--surface); padding: 10px 12px; min-width: 0; }
.facts dt { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); } .facts dd { margin: 2px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.h3 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 10px; font-weight: 400; }
.thread { display: grid; gap: 8px; }
.msg { max-width: 86%; padding: 9px 12px; border-radius: 16px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg small { display: block; font-size: 11px; color: var(--ink-2); margin-top: 3px; white-space: normal; }
.msg.in { background: var(--fill); border-bottom-left-radius: 4px; justify-self: start; }
.msg.out { background: var(--ink); color: var(--inv); border-bottom-right-radius: 4px; justify-self: end; } .msg.out small { color: #a8a8a8; }
.msg.mail { border: 1px solid var(--line); background: var(--surface); }
.ev { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; position: relative; }
.ev::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: 0; width: 1px; background: var(--line); } .ev:last-child::before { display: none; }
.ev .ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); font-size: 13px; }
.ev .tx { font-size: 14px; overflow-wrap: anywhere; } .ev .tx small { display: block; color: var(--ink-2); font-size: 12px; }
.ev .quote { margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--fill); font-size: 13.5px; white-space: pre-wrap; }
.note-box { display: grid; gap: 8px; } .note-box textarea { width: 100%; min-height: 60px; resize: vertical; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; outline: 0; font-size: 16px; }
.note-box textarea:focus { border-color: var(--ink); } .note-box .btn { justify-self: end; }
.more { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.act { display: grid; justify-items: center; gap: 6px; padding: 12px 4px 10px; border-radius: 14px; border: 1px solid var(--line); font-size: 12px; transition: transform .15s var(--ease), border-color .2s; }
.act:hover { border-color: var(--ink); } .act:active { transform: scale(.95); }

/* menu (account) */
.menu { position: fixed; z-index: 30; right: var(--gut-r); top: calc(52px + env(safe-area-inset-top, 0px)); width: min(300px, calc(100% - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; display: grid; gap: 2px; animation: rise .2s var(--ease) both; }
.menu button, .menu .row-i { text-align: left; padding: 10px 12px; border-radius: 10px; font-size: 14px; display: flex; justify-content: space-between; gap: 10px; }
.menu button:hover { background: var(--fill); } .menu small { color: var(--ink-2); }

.toast { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); background: var(--ink); color: var(--inv); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0;
  transition: opacity .3s var(--ease), transform .3s var(--ease); z-index: 40; pointer-events: none; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast button { color: var(--inv); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; flex: none; }
.banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 14px; background: var(--fill); font-size: 14px; margin-bottom: 12px; animation: rise .4s var(--ease) both; }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes blink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes pop { 0% { transform: translate(12px, -5px) scale(.4); } 70% { transform: translate(12px, -5px) scale(1.15); } 100% { transform: translate(12px, -5px) scale(1); } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.25); } 100% { box-shadow: 0 0 0 14px rgba(0,0,0,0); } }

@media (min-width: 960px) {
  .app { grid-template-columns: 84px minmax(420px, 520px) minmax(0, 1fr); grid-template-rows: 1fr; }
  .app.wide { grid-template-columns: 84px minmax(0, 1fr) 0; }
  .rail { display: grid; align-content: start; justify-items: center; gap: 6px; padding: 20px 0; border-right: 1px solid var(--line); background: var(--surface); }
  .rail .logo { font-family: var(--serif); font-style: italic; font-size: 26px; margin-bottom: 18px; }
  .rail .tab { width: 64px; padding: 10px 0; border-radius: 12px; } .rail .tab[aria-current="page"] { background: var(--fill); }
  .tabs { display: none; }
  .main { padding: 28px 24px; border-right: 1px solid var(--line); }
  .scrim { display: none; }
  .sheet { position: relative; transform: none; height: 100%; border-radius: 0; box-shadow: none; background: var(--bg); visibility: visible; }
  .app.wide .sheet { display: none; }
  .sheet .grab { display: none; }
  .sheet-body { padding: 36px 44px 24px; max-width: 800px; width: 100%; }
  .dock { padding: 14px 44px 18px; max-width: 800px; background: var(--bg); }
  .sheet:not(.on) .placeholder { display: grid; }
  .placeholder { display: none; place-items: center; height: 100%; color: var(--ink-2); text-align: center; gap: 8px; padding: 40px; }
  .placeholder em { font-family: var(--serif); font-size: 30px; color: var(--ink); display: block; }
  .close { display: none; }
  .toast { bottom: 28px; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .menu { top: 56px; }
}
@media (max-width: 959px) { .placeholder { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
/* person card on the phone: nothing may push the sheet wider than the screen */
.sheet-body { overflow-x: hidden; }
.detail > *, .thread, .task, .agent, .facts div { min-width: 0; }
.task .acts { min-width: 0; }
.task .acts > * { min-width: 0; }
.detail .task .acts { display: flex; flex-wrap: wrap; gap: 8px; }
.msg { max-width: min(86%, 560px); }
.facts select { width: 100%; border: 0; background: transparent; padding: 0; font-size: 14px; outline: 0; }
.ecard .list { gap: 6px; }

/* table on the phone: the name column stays while the rest scrolls sideways */
table.t th:first-child, table.t td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 1; box-shadow: 1px 0 0 var(--line); }
table.t th:first-child { z-index: 2; }

.badbox { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); white-space: normal; }
.draft .meta .chips { gap: 6px; flex-wrap: nowrap; }

/* ── 19 Nov pass (Andriy's phone screenshots): quieter motion, clearer states, a phone layout that never cuts ── */
/* motion only for what is new: a whole screen the first time, then single cards as they arrive or leave */
.row, .task, .ecard, .play, .answer, .detail, .ev { animation: none; }
.first .row, .first .task, .first .ecard, .first .play, .first .answer, .enter { animation: rise .42s var(--ease) both; }
.enter.task, .enter.row { animation: slidein .5s var(--ease) both; }
.leave { animation: slideout .32s var(--ease) forwards; pointer-events: none; }
@keyframes slidein { from { opacity: 0; transform: translateY(-10px) scale(.985); max-height: 0; } 60% { max-height: 600px; } to { opacity: 1; transform: none; max-height: 1200px; } }
@keyframes slideout { to { opacity: 0; transform: translateX(24px); } }
/* statuses: each its own look, the emoji carries the colour */
.pill { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 2px 9px 2px 7px; }
.s-hot { background: var(--ink); color: var(--inv); }
.s-booked { background: var(--ink); color: var(--inv); } .s-booked::before { content: none; }
.s-interested { background: var(--fill-2); color: var(--ink); }
.s-new { background: var(--surface); border: 1px solid var(--ink); }
.s-contacted { background: var(--surface); border: 1px dashed var(--line-2); color: var(--ink-2); }
.s-later, .s-nofit { background: transparent; border: 1px solid var(--line); color: var(--ink-3); }
.waiting { font-weight: 600; color: var(--ink); }
.switch button { position: relative; }
.ping { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 0 rgba(0,0,0,.35); animation: ping 2s infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.35); } 70%, 100% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } }
.who .n { flex-wrap: wrap; row-gap: 2px; }
.who .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-transform: none; }
.why-line { font-size: 13px; color: var(--ink-2); line-height: 1.35; }
.draft .meta { flex-direction: column; align-items: flex-start; gap: 8px; }
.draft .meta .chips { flex-wrap: wrap; }
.chip { white-space: nowrap; }
.task .acts { grid-template-columns: minmax(0, 1fr) 44px 44px; }
.big-dm { min-width: 0; padding: 0 14px; } .big-dm span { min-width: 0; }

/* phones: one consistent, slightly denser scale */
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .main { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  h1 { font-size: 26px; }
  .sub { font-size: 13.5px; }
  .head { margin-bottom: 12px; }
  .switch { margin-bottom: 12px; } .switch button { padding: 7px 12px; font-size: 13.5px; }
  .seg { min-width: 0; padding: 7px 11px; } .seg b { font-size: 13.5px; } .seg small { font-size: 11px; }
  .card { grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; padding: 10px 10px 10px 12px; }
  .av { width: 38px; height: 38px; font-size: 13px; }
  .who .n { font-size: 15px; gap: 6px; }
  .who .m, .who .last { font-size: 12.5px; }
  .dmbtn { width: 46px; padding: 7px 0; font-size: 10.5px; }
  .task { padding: 12px; gap: 9px; border-radius: 16px; }
  .task .d-head { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .task .d-head .av { width: 38px; height: 38px; font-size: 13px; }
  .task .d-head > span:last-child { display: none; }
  .msg { font-size: 14px; padding: 8px 11px; max-width: 92%; }
  .draft { font-size: 14px; padding: 11px 12px; }
  .big-dm { height: 46px; font-size: 15px; border-radius: 14px; }
  .icon-btn { width: 44px; height: 46px; border-radius: 14px; }
  .section-h { margin: 16px 2px 8px; }
  .d-head .n { font-size: 20px; }
  .ecard { padding: 14px; } .ecard .t b { font-size: 16.5px; }
  .seat { grid-template-columns: 92px minmax(0, 1fr) 44px; }
  .answer .big strong { font-size: 44px; }
  .kpi b { font-size: 24px; }
}

/* pull to refresh (iOS-style): drag the list down from the top */
.ptr { height: 0; overflow: hidden; display: grid; place-items: center; color: var(--ink-2); font-size: 12.5px; transition: height .25s var(--ease); }
.ptr i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); display: block; margin-bottom: 4px; }
.ptr.spin i { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ptr-pop { position: fixed; z-index: 5; left: 50%; top: calc(10px + env(safe-area-inset-top, 0px)); transform: translate(-50%, -40px); opacity: 0; display: grid; justify-items: center; gap: 4px;
  font-size: 12px; color: var(--ink-2); pointer-events: none; transition: opacity .2s, transform .35s var(--ease); }
.ptr-pop i { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); display: block; }
.ptr-pop.spin i { animation: spin .7s linear infinite; }
.main { overscroll-behavior-y: contain; }
