/* Infinity Pay support app. Apple interface grammar, one tint, two appearances.
   Colour roles: green = act / needs reply, red = only "open too long",
   orange = urgent or a warning. Everything else is neutral. */

/* Inter stands in for SF on Android and Windows; Apple devices never load it. */
@font-face { font-family: "InterVar"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/app/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "InterVar"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/app/fonts/inter-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "InterVar"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/app/fonts/inter-cyrillic-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "InterVar", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.32, .72, 0, 1);       /* iOS sheet / push */
  --ease-out: cubic-bezier(.23, 1, .32, 1);   /* strong ease-out for UI */
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);

  --fs-large: 34px; --lh-large: 41px;
  --fs-title: 22px; --lh-title: 28px;
  --fs-title3: 20px; --lh-title3: 25px;
  --fs-body: 17px; --lh-body: 22px;
  --fs-sub: 15px; --lh-sub: 20px;
  --fs-foot: 13px; --lh-foot: 18px;
  --fs-cap: 12px; --lh-cap: 16px;
  --row-pad: 11px;
  --gutter: 16px;

  color-scheme: light;
  --bg: #F2F2F7;
  --cell: #FFFFFF;
  --cell-hover: #F6F6F9;
  --cell-press: #E5E5EA;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .2);
  --label: #000000;
  --label-2: #636366;
  --label-3: #AEAEB2;
  --placeholder: #636366;
  --sep: rgba(60, 60, 67, .29);
  --sep-strong: rgba(60, 60, 67, .36);
  --tint: #0B8445;          /* fills: white text on it is 4.8:1 */
  --tint-hover: #09733C;
  --tint-text: #066B36;     /* text and icons: 5.2:1 even on grey fills */
  --badge: #D70015;         /* tab badge: white on it is 5.4:1 */
  --tint-soft: rgba(11, 132, 69, .12);
  --tint-dot: #18A558;
  --on-tint: #FFFFFF;
  --red: #D70015;    --red-vivid: #FF3B30;    --red-soft: rgba(255, 59, 48, .08);
  --orange: #B83A00; --orange-vivid: #FF9500; --orange-soft: rgba(255, 149, 0, .14); --on-orange: #FFFFFF;
  --green: #1E7A36;  --green-vivid: #34C759;  --green-soft: rgba(52, 199, 89, .14);
  --note: #FFF5C9; --note-ink: #4D3D00; --note-line: rgba(191, 144, 0, .35);
  --bubble-in: #E9E9EB; --bubble-in-ink: #000000;
  --thread: #FFFFFF;
  --material: rgba(249, 249, 249, .8);
  --material-strong: rgba(255, 255, 255, .94);
  --material-line: rgba(0, 0, 0, .16);
  --side: #EBEBF0;
  --thumb: #FFFFFF;
  --shadow-thumb: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, .18), 0 2px 6px rgba(0, 0, 0, .06);
}

/* Dark: brand ink ground, brand mint tint. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B0B0C; --cell: #1C1C1E; --cell-hover: #232325; --cell-press: #2C2C2E;
    --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .34);
    --label: #F5F5F7; --label-2: #A1A1A6; --label-3: #636366; --placeholder: #8E8E93;
    --sep: rgba(84, 84, 88, .6); --sep-strong: rgba(84, 84, 88, .8);
    --tint: #3DDC97; --tint-hover: #7BF0BC; --tint-text: #3DDC97; --tint-soft: rgba(61, 220, 151, .16); --tint-dot: #3DDC97; --on-tint: #04130C;
    --red: #FF7A72; --red-vivid: #FF453A; --red-soft: rgba(255, 69, 58, .16); --badge: #C9302A;
    --orange: #FFB340; --orange-vivid: #FF9F0A; --orange-soft: rgba(255, 159, 10, .16); --on-orange: #1F1300;
    --green: #4ADE80; --green-vivid: #30D158; --green-soft: rgba(48, 209, 88, .16);
    --note: rgba(255, 214, 10, .13); --note-ink: #FFE27A; --note-line: rgba(255, 214, 10, .3);
    --bubble-in: #26262A; --bubble-in-ink: #F5F5F7;
    --thread: #000000;
    --material: rgba(24, 24, 26, .78); --material-strong: rgba(38, 38, 40, .94); --material-line: rgba(255, 255, 255, .12);
    --side: #141416; --thumb: #636366;
    --shadow-thumb: 0 3px 8px rgba(0, 0, 0, .3);
    --shadow-pop: 0 10px 40px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0B0C; --cell: #1C1C1E; --cell-hover: #232325; --cell-press: #2C2C2E;
  --fill: rgba(118, 118, 128, .24); --fill-2: rgba(118, 118, 128, .34);
  --label: #F5F5F7; --label-2: #A1A1A6; --label-3: #636366; --placeholder: #8E8E93;
  --sep: rgba(84, 84, 88, .6); --sep-strong: rgba(84, 84, 88, .8);
  --tint: #3DDC97; --tint-hover: #7BF0BC; --tint-text: #3DDC97; --tint-soft: rgba(61, 220, 151, .16); --tint-dot: #3DDC97; --on-tint: #04130C;
  --red: #FF7A72; --red-vivid: #FF453A; --red-soft: rgba(255, 69, 58, .16); --badge: #C9302A;
  --orange: #FFB340; --orange-vivid: #FF9F0A; --orange-soft: rgba(255, 159, 10, .16); --on-orange: #1F1300;
  --green: #4ADE80; --green-vivid: #30D158; --green-soft: rgba(48, 209, 88, .16);
  --note: rgba(255, 214, 10, .13); --note-ink: #FFE27A; --note-line: rgba(255, 214, 10, .3);
  --bubble-in: #26262A; --bubble-in-ink: #F5F5F7;
  --thread: #000000;
  --material: rgba(24, 24, 26, .78); --material-strong: rgba(38, 38, 40, .94); --material-line: rgba(255, 255, 255, .12);
  --side: #141416; --thumb: #636366;
  --shadow-thumb: 0 3px 8px rgba(0, 0, 0, .3);
  --shadow-pop: 0 10px 40px rgba(0, 0, 0, .5);
}

/* Desktop: macOS density. */
@media (min-width: 1024px) {
  :root {
    --fs-large: 28px; --lh-large: 34px;
    --fs-title: 20px; --lh-title: 25px;
    --fs-title3: 18px; --lh-title3: 23px;
    --fs-body: 14px; --lh-body: 19px;
    --fs-sub: 13px; --lh-sub: 17px;
    --fs-foot: 12px; --lh-foot: 16px;
    --fs-cap: 12px; --lh-cap: 16px;
    --row-pad: 8px;
  }
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--label);
  font: 400 var(--fs-body)/var(--lh-body) var(--font); letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent; caret-color: var(--tint); touch-action: manipulation;
}
::selection { background: color-mix(in srgb, var(--tint) 30%, transparent); }
a { color: var(--tint-text); }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
svg.icon { flex: none; display: block; }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--fill-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--fill-2); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tone-red { color: var(--red); } .tone-orange { color: var(--orange); } .tone-green { color: var(--green); }
.tone-gray { color: var(--label-2); } .tone-tint { color: var(--tint-text); }
.link { color: var(--tint-text); background: none; border: 0; padding: 0; text-decoration: none; font: inherit; font-weight: 500; }
@media (hover: hover) and (pointer: fine) { .link:hover { text-decoration: underline; text-underline-offset: 3px; } }

.boot, .gate { min-height: 100dvh; display: grid; place-items: center; }
.boot__mark { color: var(--tint); animation: breathe 1.2s var(--ease-in-out) infinite alternate; }
@keyframes breathe { from { opacity: .35; } to { opacity: 1; } }

/* ── Phone shell ─────────────────────────────────────────────────────────── */
html:not(.vt) .phone__stage { animation: stage-in .32s var(--ease); }

/* Push / pop between screens (View Transitions). The tab bar is captured on
   its own, so it holds still while the screens slide. */
.tabbar { view-transition-name: tabbar; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; animation-timing-function: var(--ease); mix-blend-mode: normal; }
:root[data-nav="forward"]::view-transition-new(root) { animation-name: vt-in-right; }
:root[data-nav="forward"]::view-transition-old(root) { animation-name: vt-out-left; }
:root[data-nav="back"]::view-transition-new(root) { animation-name: vt-in-left; }
:root[data-nav="back"]::view-transition-old(root) { animation-name: vt-out-right; z-index: 2; }
@keyframes vt-in-right { from { transform: translateX(100%); } }
@keyframes vt-out-left { to { transform: translateX(-28%); opacity: .7; } }
@keyframes vt-in-left { from { transform: translateX(-28%); opacity: .7; } }
@keyframes vt-out-right { to { transform: translateX(100%); } }
::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation-duration: .2s; }
@keyframes stage-in { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
.screen { min-height: 100dvh; padding-bottom: calc(50px + env(safe-area-inset-bottom) + 28px); }
.phone--full .screen { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
.phone--full .screen--chat { padding-bottom: 0; }
.screen--chat { display: flex; flex-direction: column; background: var(--thread); }
.screen--chat .screen__body { flex: 1; display: flex; flex-direction: column; }

.navbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  height: calc(44px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 8px 0;
  background: transparent; transition: background-color .2s, box-shadow .2s;
}
/* Every bar that floats over content sits on the same blurred material. */
.navbar--scrolled, .screen--chat .navbar, .tabbar, .composer, .closedbar {
  background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
}
.navbar--scrolled, .screen--chat .navbar { box-shadow: 0 .5px 0 var(--material-line); }
.navbar__side { display: flex; align-items: center; min-width: 0; }
.navbar__side--trail { justify-content: flex-end; gap: 2px; }
.navbar__title { font-weight: 600; font-size: 17px; line-height: 22px; text-align: center; opacity: 0; transition: opacity .2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.navbar__title.is-shown { opacity: 1; }
.navbar__merchant { display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-height: 44px; color: var(--label); text-decoration: none; }
.navbar__merchant span { overflow: hidden; text-overflow: ellipsis; }
.navbar__merchant .icon { color: var(--label-3); }
.navbar__back { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px 0 0; margin-left: -4px; background: none; border: 0; color: var(--tint-text); font-size: 17px; max-width: 100%; }
.navbar__back span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.navbtn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 8px; background: none; border: 0; color: var(--tint-text); font-size: 17px; text-decoration: none; border-radius: 10px; transition: opacity .15s; }
.navbtn--text { padding: 0 12px; font-weight: 600; }
.navbtn:active { opacity: .4; }

.largetitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 2px var(--gutter) 12px; }
.largetitle__text { font-weight: 700; font-size: var(--fs-large); line-height: var(--lh-large); letter-spacing: .01em; }
.largetitle__accessory { flex: none; margin-bottom: 3px; }
.largetitle__sentinel { height: 1px; }
.me-link { position: relative; display: block; border-radius: 50%; text-decoration: none; }
.me-link::before { content: ""; position: absolute; inset: -5px; }

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(2, 1fr);
  height: calc(50px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -.5px 0 var(--material-line);
}
.tabbar__item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding-top: 3px; color: var(--label-2); text-decoration: none; font-size: 10px; font-weight: 500; line-height: 12px; letter-spacing: .01em; }
.tabbar__item.is-active { color: var(--tint-text); }
.tabbar__icon { position: relative; transition: transform .16s var(--ease-out); }
.tabbar__item:active .tabbar__icon { transform: scale(.92); }
.tabbar__badge { position: absolute; top: -3px; left: 17px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--badge); color: #fff; font-size: 12px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* ── Grouped lists ───────────────────────────────────────────────────────── */
.group { margin: 0 var(--gutter) 28px; }
.group__header { display: flex; justify-content: space-between; gap: 12px; padding: 0 16px 7px; font-size: var(--fs-foot); line-height: var(--lh-foot); font-weight: 400; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.group__body { background: var(--cell); border-radius: 10px; overflow: hidden; }
.group__footer { padding: 7px 16px 0; font-size: var(--fs-foot); line-height: var(--lh-foot); color: var(--label-2); }

.row {
  position: relative; display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 44px; padding: var(--row-pad) 16px; margin: 0;
  background: none; border: 0; text-align: left; color: var(--label); text-decoration: none;
  font-size: var(--fs-body); line-height: var(--lh-body);
}
.row + .row::before, .trow + .trow::before, .field + .field::before, .row + .switchrow::before, .switchrow + .row::before,
.disclosure__inner > .row:first-child::before, .disclosure__inner > .field:first-child::before {
  content: ""; position: absolute; top: 0; right: 0; left: 16px; height: 1px; background: var(--sep); transform: scaleY(.5); transform-origin: 0 0;
}
@media (max-resolution: 1dppx) { .row + .row::before, .trow + .trow::before, .field + .field::before { transform: none; } }
.row:has(> .row__lead) + .row::before, .row + .row:has(> .row__lead)::before { left: 52px; }
.row--action { cursor: pointer; transition: background-color .15s; }
@media (hover: hover) and (pointer: fine) { .row--action:hover { background: var(--cell-hover); } }
.row--action:active { background: var(--cell-press); transition: none; }
.row.is-selected { background: var(--tint-soft); }
.row[disabled] { opacity: .45; }
.row--quiet .row__title { color: var(--label-2); }
.row__lead { flex: none; display: grid; place-items: center; min-width: 24px; color: var(--tint-text); }
.row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__title.is-danger { color: var(--red); }
.row--tint .row__title { color: var(--tint-text); }
.row__sub { font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__detail { flex: none; max-width: 60%; color: var(--label-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.row__detail.tone-tint { color: var(--tint-text); } .row__detail.tone-orange, .row__sub.tone-orange { color: var(--orange); }
.row__chevron { color: var(--label-3); margin-right: -4px; }
.row__check, .row__trail-icon { color: var(--tint-text); }

/* Disclosure («Подробнее») */
.disclosure__head { font-weight: 400; }
.disclosure__chev { transition: transform .25s var(--ease-out); }
.disclosure.is-open .disclosure__chev { transform: rotate(90deg); }
.disclosure__body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s var(--ease-out); }
.disclosure.is-open .disclosure__body { grid-template-rows: 1fr; }
.disclosure__inner { min-height: 0; overflow: hidden; }
.disclosure__inner > * { position: relative; }

/* iOS switch */
.switchrow { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 16px; cursor: pointer; }
.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 51px; height: 31px; margin: 0; border-radius: 16px; background: var(--fill-2); cursor: pointer; transition: background-color .25s var(--ease-out); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 3px 1px rgba(0, 0, 0, .06); transition: transform .25s var(--ease-out); }
.switch:checked { background: var(--green-vivid); }
.switch:checked::after { transform: translateX(20px); }
.switch:active::after { width: 31px; }
.switch:checked:active::after { transform: translateX(16px); }

/* ── Ticket rows: two lines ──────────────────────────────────────────────── */
.trow { position: relative; display: flex; align-items: center; gap: 10px; padding: 11px 16px 11px 10px; color: var(--label); transition: background-color .15s; }
.trow + .trow::before { left: 30px; }
@media (hover: hover) and (pointer: fine) { .trow:hover { background: var(--cell-hover); } }
.trow:active { background: var(--cell-press); transition: none; }
.trow.is-selected { background: var(--tint-soft); }
.trow__dot { flex: none; align-self: flex-start; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; }
.trow__dot.is-on { background: var(--tint-dot); }
.trow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trow__top { display: flex; align-items: baseline; gap: 10px; }
.trow__name { flex: 1; min-width: 0; font-weight: 600; color: var(--label); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow__name::after { content: ""; position: absolute; inset: 0; }        /* the whole row is the link */
.trow__age { flex: none; display: inline-flex; align-items: center; gap: 3px; color: var(--label-2); font-size: var(--fs-sub); font-variant-numeric: tabular-nums; }
.trow__age.is-late { color: var(--red); font-weight: 600; }
.trow__sub { display: flex; align-items: baseline; min-width: 0; font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); white-space: nowrap; }
.trow__subject { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trow__extra { flex: none; margin-left: .3em; }
.trow__urgent { flex: none; align-self: center; margin-right: 5px; color: var(--orange-vivid); }
.trow__urgent svg { fill: currentColor; }
.trow.is-leaving { animation: row-leave .28s var(--ease-out) forwards; pointer-events: none; }
@keyframes row-leave { to { opacity: 0; transform: translateX(-24px); } }
/* «новый для вас»: someone handed you this ticket and you have not opened it. */
.trow__new { flex: none; margin-left: .3em; color: var(--tint-text); font-weight: 600; }

/* Swipes, as in Mail: the actions ride on the row's edges and the group's
   rounded body clips them, so at rest they are out of sight. */
.trow { touch-action: pan-y pinch-zoom; }
.trow__swipe {
  position: absolute; top: 0; bottom: 0; width: 100%; display: flex; align-items: center; gap: 6px; padding: 0 20px;
  background: var(--tint); color: var(--on-tint); font-size: var(--fs-sub); font-weight: 600; pointer-events: none;
}
.trow__swipe--take { right: 100%; justify-content: flex-end; }
.trow__swipe--done { left: 100%; }
.trow__swipe > * { opacity: .55; transform: scale(.9); transition: opacity .15s, transform .2s var(--ease-out); }
.trow.is-armed .trow__swipe > *, .trow.is-swiped .trow__swipe > *, .trow.is-hinting .trow__swipe > * { opacity: 1; transform: none; }
.trow.is-dragging, .trow.is-swiped { background: var(--cell); transition: none; }
.trow.is-swiped { animation: none; }
.trow.is-leaving .trow__swipe { display: none; }
.trow.is-hinting { animation: swipe-hint 1.1s var(--ease-in-out); }
@keyframes swipe-hint { 0%, 100% { transform: none; } 35%, 60% { transform: translateX(-108px); } }

.notice { display: flex; align-items: center; gap: 10px; margin: 0 var(--gutter) 16px; padding: 12px 14px; border-radius: 12px; font-size: var(--fs-sub); font-weight: 500; text-decoration: none; transition: transform .16s var(--ease-out); }
.notice--red { background: var(--red-soft); color: var(--red); }
.notice--orange { background: var(--orange-soft); color: var(--orange); }
.notice span { flex: 1; }
a.notice:active { transform: scale(.98); }
.notice__chev { opacity: .7; }

/* ── Segmented, search ───────────────────────────────────────────────────── */
.segmented { position: relative; display: flex; height: 36px; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented__thumb { position: absolute; top: 2px; bottom: 2px; left: 2px; border-radius: 7px; background: var(--thumb); box-shadow: var(--shadow-thumb); transition: transform .25s var(--ease-out); }
.segmented__opt { position: relative; z-index: 1; touch-action: manipulation; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; background: none; border: 0; border-radius: 7px; font-size: 13px; font-weight: 500; white-space: nowrap; color: var(--label); }
.segmented__opt[aria-checked="true"] { font-weight: 600; }
.segmented__opt::before { content: ""; position: absolute; inset: -4px 0; }
.segmented__opt > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.segmented__count { color: var(--label-2); font-weight: 500; font-variant-numeric: tabular-nums; }

.search { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 8px; border-radius: 10px; background: var(--fill); color: var(--label-2); }
.search:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 30%, transparent); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; outline: none; font-size: var(--fs-body); color: var(--label); -webkit-appearance: none; appearance: none; }
.search input::placeholder { color: var(--placeholder); }
.search input::-webkit-search-cancel-button { display: none; }
.search__clear { position: relative; display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: var(--label-3); color: var(--cell); }
.search__clear::before { content: ""; position: absolute; inset: -13px; }
.toolbar-stack { display: grid; gap: 12px; padding: 0 var(--gutter) 18px; }

/* ── Buttons & tiles ─────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; font-weight: 600; text-decoration: none; white-space: nowrap; letter-spacing: -.01em;
  transition: background-color .15s, transform .16s var(--ease-out), opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn.is-busy { opacity: .7; cursor: progress; }
.btn--lg { height: 50px; padding: 0 20px; border-radius: 14px; font-size: 17px; }
.btn--md { height: 40px; padding: 0 16px; border-radius: 10px; font-size: 15px; }
.btn--sm { height: 32px; padding: 0 13px; border-radius: 8px; font-size: 14px; }
.btn--full { width: 100%; }
.btn--filled { background: var(--tint); color: var(--on-tint); }
.btn--gray { background: var(--fill); color: var(--tint-text); }
@media (hover: hover) and (pointer: fine) { .btn--filled:hover:not(:disabled) { background: var(--tint-hover); } .btn--gray:hover:not(:disabled) { background: var(--fill-2); } }

/* Capsule buttons for the one action on a row or bar: «Взять», «Решено», «Позвонить». */
.pill {
  position: relative; z-index: 1; flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-width: 72px; height: 30px; padding: 0 14px; border: 0; border-radius: 15px;
  font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; text-decoration: none;
  transition: transform .16s var(--ease-out), background-color .15s;
}
.pill::before { content: ""; position: absolute; inset: -8px -4px; }      /* 46pt touch target */
.pill:active:not(:disabled) { transform: scale(.96); }
.pill:disabled { opacity: .5; }
.pill--gray { background: var(--fill); color: var(--tint-text); }
.pill--filled { background: var(--tint); color: var(--on-tint); }
@media (hover: hover) and (pointer: fine) { .pill--gray:hover:not(:disabled) { background: var(--fill-2); } .pill--filled:hover:not(:disabled) { background: var(--tint-hover); } }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0 var(--gutter) 20px; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 60px; padding: 8px 4px; border: 0; border-radius: 12px; background: var(--cell); color: var(--tint-text);
  font-size: 12px; font-weight: 500; line-height: 14px; text-align: center; text-decoration: none;
  transition: background-color .15s, transform .16s var(--ease-out);
}
.tile:active:not(:disabled) { transform: scale(.96); background: var(--cell-press); }
.tile.is-disabled, .tile:disabled { color: var(--label-3); }

/* ── Ticket screen ───────────────────────────────────────────────────────── */
.thead { padding: 14px 20px 6px; background: var(--thread); }
.thead__subject { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -.01em; }
.thead__urgent { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 8px; background: var(--orange-soft); color: var(--orange); font-size: var(--fs-sub); line-height: var(--lh-sub); font-weight: 600; vertical-align: 3px; letter-spacing: 0; }
.thead__status { margin-top: 4px; font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); }

.chat { flex: 1; display: flex; flex-direction: column; padding: 4px 16px 16px; background: var(--thread); }
.stamp { margin: 14px 0 8px; text-align: center; font-size: var(--fs-cap); font-weight: 500; color: var(--label-2); }
.sysmsg { margin: 6px 28px; text-align: center; font-size: var(--fs-cap); line-height: var(--lh-cap); color: var(--label-2); }
.msg { display: flex; flex-direction: column; margin: 0 0 2px; }
.msg.has-tail { margin-bottom: 10px; }
.msg--out { align-items: flex-end; } .msg--in { align-items: flex-start; }
.bubble { position: relative; isolation: isolate; max-width: min(76%, 540px); padding: 7px 13px; border-radius: 18px; font-size: var(--fs-body); line-height: var(--lh-body); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble--in { background: var(--bubble-in); color: var(--bubble-in-ink); }
.bubble--out { background: var(--tint); color: var(--on-tint); }
.bubble--bot { background: var(--fill-2); color: var(--label); }
/* iMessage tail: a curved notch on the last bubble of a run. */
/* Painted under the text (z-index -1 inside the bubble's own stacking context). */
.has-tail .bubble::before, .has-tail .bubble::after { content: ""; position: absolute; z-index: -1; bottom: 0; height: 18px; }
.has-tail .bubble--in::before { left: -7px; width: 20px; background: var(--bubble-in); border-bottom-right-radius: 16px 14px; }
.has-tail .bubble--in::after { left: -10px; width: 10px; background: var(--thread); border-bottom-right-radius: 10px; }
.has-tail .bubble--out::before { right: -7px; width: 20px; background: var(--tint); border-bottom-left-radius: 16px 14px; }
.has-tail .bubble--out::after { right: -10px; width: 10px; background: var(--thread); border-bottom-left-radius: 10px; }
.has-tail .bubble--bot::before { right: -7px; width: 20px; background: var(--fill-2); border-bottom-left-radius: 16px 14px; }
.has-tail .bubble--bot::after { right: -10px; width: 10px; background: var(--thread); border-bottom-left-radius: 10px; }
/* A new message rises from the composer, as in Messages. */
.msg.is-new { animation: bubble-in .28s var(--ease-out); transform-origin: bottom right; }
.msg--in.is-new { transform-origin: bottom left; }
.notemsg.is-new, .sysmsg.is-new { animation: fade-in .3s ease; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.msgcap { margin: 4px 8px 0; font-size: var(--fs-cap); line-height: var(--lh-cap); color: var(--label-2); }
.msgcap--warn { color: var(--orange); font-weight: 500; }
.notemsg { margin: 6px 0 12px; }
.notemsg__body { display: flex; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--note); color: var(--note-ink); box-shadow: inset 0 0 0 .5px var(--note-line); font-size: var(--fs-sub); line-height: var(--lh-sub); }
.notemsg__body p { white-space: pre-wrap; overflow-wrap: anywhere; }
.notemsg__body .icon { margin-top: 1px; }
.atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.att { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.att--img img { display: block; max-width: 220px; max-height: 220px; border-radius: 12px; object-fit: cover; }

.composer {
  position: sticky; bottom: 0; z-index: 10; display: grid; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -.5px 0 var(--material-line);
}
.composer__mode { flex: 0 1 230px; height: 32px; }
.composer__mode .segmented__thumb { border-radius: 6px; }
.composer__hint { margin: 0 4px; text-align: center; font-size: var(--fs-foot); line-height: var(--lh-foot); color: var(--label-2); }
.composer__row { display: flex; align-items: flex-end; gap: 8px; }
.composer__attach { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--fill); color: var(--label-2); }
.composer__attach::before { content: ""; position: absolute; inset: -4px; }
.composer__field { flex: 1; display: flex; align-items: flex-end; min-height: 36px; border-radius: 18px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--sep-strong); transition: box-shadow .15s; }
.composer__field:focus-within { box-shadow: inset 0 0 0 1px var(--tint); }
.composer__input { flex: 1; min-width: 0; min-height: 36px; max-height: 160px; padding: 7px 4px 7px 14px; resize: none; outline: none; border: 0; background: none; color: var(--label); font-size: var(--fs-body); line-height: var(--lh-body); }
.composer__input::placeholder { color: var(--placeholder); }
.composer--note .composer__field { background: var(--note); box-shadow: inset 0 0 0 1px var(--note-line); }
.composer--note .composer__input { color: var(--note-ink); }
.composer__send { position: relative; flex: none; display: grid; place-items: center; width: 30px; height: 30px; margin: 3px; border: 0; border-radius: 50%; background: var(--tint); color: var(--on-tint); transition: transform .16s var(--ease-out), background-color .15s, opacity .15s; }
.composer__send::before { content: ""; position: absolute; inset: -7px; }
.composer__send:active:not(:disabled) { transform: scale(.92); }
.composer__send:disabled { opacity: 0; transform: scale(.6); pointer-events: none; }
.composer__files { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 14px; background: var(--fill); font-size: var(--fs-foot); }
.chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--fill-2); color: var(--label-2); }
.closedbar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -.5px 0 var(--material-line); color: var(--label-2); font-size: var(--fs-sub); }

/* ── Merchants ───────────────────────────────────────────────────────────── */
/* Contacts-style monogram: one neutral gradient for everyone. */
.avatar { flex: none; display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; background: linear-gradient(180deg, #8A8F99, #6B6F78); color: #fff; font-weight: 600; font-size: calc(var(--s) * .38); letter-spacing: .02em; }
.row--merchant { padding-top: 10px; padding-bottom: 10px; }
.row--merchant .row__title { font-weight: 600; }
.mhead { display: flex; flex-direction: column; align-items: center; padding: 6px var(--gutter) 18px; text-align: center; }
.mhead__name { margin-top: 12px; font-size: 28px; line-height: 34px; font-weight: 700; letter-spacing: -.01em; }
.mhead__meta { margin-top: 4px; font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); }

.health { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 0 var(--gutter) 28px; padding: 14px 16px; border-radius: 12px; background: var(--cell); }
.health__icon { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.health--green .health__icon { background: var(--green-soft); color: var(--green); }
.health--orange .health__icon { background: var(--orange-soft); color: var(--orange); }
.health--gray .health__icon { background: var(--fill); color: var(--label-2); }
.health__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.health__text b { font-weight: 600; }
.health__text span { font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); }
@media (max-width: 1023px) { .health > .btn { flex: 1 0 100%; height: 44px; font-size: 16px; border-radius: 12px; } }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form { padding-bottom: 12px; }
.screen--form .screen__body { padding-top: 18px; }
.field { position: relative; display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; min-height: 44px; padding: 0 16px; }
.field__label { flex: 0 0 100px; font-size: var(--fs-body); color: var(--label); }
.field input, .field select, .field textarea {
  flex: 1; min-width: 0; padding: 11px 0; border: 0; outline: none; background: none;
  font-size: var(--fs-body); line-height: var(--lh-body); color: var(--label); -webkit-appearance: none; appearance: none;
}
.field ::placeholder, .textfield ::placeholder { color: var(--placeholder); }
.textfield { display: block; }
.textfield textarea { display: block; width: 100%; min-height: 120px; padding: 12px 16px; border: 0; outline: none; resize: vertical; background: none; color: var(--label); font-size: var(--fs-body); line-height: var(--lh-body); }
.form__pad { padding: 10px 12px; }
.form__error { margin: -12px calc(var(--gutter) + 16px) 18px; font-size: var(--fs-sub); color: var(--red); }
.form__actions { padding: 0 var(--gutter) 16px; }
.form__actions--row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.done-mark { display: grid; place-items: center; padding: 12px 0 6px; color: var(--tint-text); animation: pop .4s var(--ease-out); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.done-title { margin: 0 var(--gutter) 22px; text-align: center; font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; }
.stepdot { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--fill); color: var(--label); font-size: 13px; font-weight: 600; }
.stepdot.is-done { background: var(--green-vivid); color: #fff; }

.row:has(> .row__lead .avatar) + .row::before, .row + .row:has(> .row__lead .avatar)::before { left: 60px; }
.row.row--merchant + .row.row--merchant::before { left: 68px; }     /* 40pt monogram */

/* ── Sheet & menu ────────────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; color: var(--label); }
.sheet::backdrop { background: rgba(0, 0, 0, .36); animation: fade-in .25s ease; }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; max-height: 90dvh;
  padding-bottom: env(safe-area-inset-bottom); border-radius: 14px 14px 0 0; background: var(--bg);
  box-shadow: var(--shadow-pop); animation: sheet-in .38s var(--ease);
}
.sheet__panel::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--fill-2); }
.sheet__bar { touch-action: none; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; min-height: 56px; padding: 8px 8px 0; }
.sheet__title { font-size: 17px; font-weight: 600; text-align: center; }
.sheet__side--trail { justify-self: end; }
.sheet__body { overflow: auto; overscroll-behavior: contain; padding: 8px 0 16px; }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-out { to { opacity: 0; } }
.sheet.is-leaving .sheet__panel { animation: sheet-out .22s var(--ease-out) forwards; }
.sheet.is-leaving::backdrop { animation: fade-out .22s ease forwards; }
.sheet__panel.is-dragging { animation: none; transition: none; }
.sheet.is-leaving .sheet__panel[data-dismissed] { animation: none; }
.sheet__panel.is-settling { transition: transform .3s var(--ease); }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Feedback ────────────────────────────────────────────────────────────── */
.toast {
  /* Below the navigation bar, so «Решено» and «•••» stay reachable; taps pass through except on the action. */
  position: fixed; top: calc(env(safe-area-inset-top) + 52px); left: 50%; z-index: 100; transform: translateX(-50%); pointer-events: none;
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: min(92vw, 520px); padding: 10px 10px 10px 16px;
  border-radius: 16px; background: var(--material-strong); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: var(--shadow-pop); font-size: var(--fs-sub); line-height: var(--lh-sub); font-weight: 500;
  animation: toast-in .32s var(--ease-out);
}
.toast__text { padding-right: 6px; }
.toast--ok .icon { color: var(--tint-text); } .toast--warn .icon { color: var(--orange); } .toast--info .icon { color: var(--label-2); }
.toast__action { pointer-events: auto; flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--fill); color: var(--tint-text); font-weight: 600; }
.toast__action:active { transform: scale(.96); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -14px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast.is-leaving { animation: toast-out .18s var(--ease-out) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, -8px) scale(.98); } }
.empty { display: grid; justify-items: center; gap: 6px; padding: 48px 32px; text-align: center; }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 8px; border-radius: 50%; background: var(--fill); color: var(--label-2); }
.empty__title { font-size: var(--fs-title3); line-height: var(--lh-title3); font-weight: 600; }
.empty__text { max-width: 32ch; font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); }
.empty .link { margin-top: 8px; }
.list-foot { padding: 0 var(--gutter) 24px; text-align: center; font-size: var(--fs-foot); color: var(--label-2); }
.skel { pointer-events: none; }
.skel__line { display: block; width: 72%; height: 12px; margin: 4px 0; border-radius: 6px; background: var(--fill); animation: breathe .9s var(--ease-in-out) infinite alternate; }
.skel__line--short { width: 44%; }

/* ── Added in the distill pass ───────────────────────────────────────────── */
/* New tickets waiting to be taken: one line, not a list in the way. */
.newbar { display: flex; align-items: center; gap: 10px; margin: 0 var(--gutter) 16px; padding: 10px 10px 10px 14px; border-radius: 12px; background: var(--cell); }
.newbar__text { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 36px; color: var(--label); text-decoration: none; font-size: var(--fs-sub); line-height: var(--lh-sub); }
.newbar__text b { font-weight: 600; }
.newbar__dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--tint-dot); }
.filterbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 calc(var(--gutter) + 4px) 12px; font-size: var(--fs-sub); color: var(--label-2); }
.is-late { color: var(--red); }
.thead__status .is-late { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.thead__status .icon { display: inline-block; }

/* Description of a ticket opened by the team: a plain block, not a reply. */
.descmsg { margin: 6px 0 12px; }
.descmsg__label { margin: 0 4px 4px; font-size: var(--fs-cap); font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .02em; }
.descmsg__body { padding: 10px 12px; border-radius: 14px; background: var(--fill); font-size: var(--fs-sub); line-height: var(--lh-sub); white-space: pre-wrap; overflow-wrap: anywhere; }

.att--img { padding: 0; border: 0; background: none; cursor: zoom-in; }
.viewer { display: grid; place-items: center; padding: 0 12px 12px; }
.viewer img { max-width: 100%; max-height: 70dvh; border-radius: 12px; }

/* Composer top row: who the message goes to, and «Решено» under the thumb. */
.composer__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer__top .composer__hint { flex: 1; text-align: left; }
.composer__call { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 12px; border-radius: 12px; background: var(--orange-soft); color: var(--orange); font-size: var(--fs-foot); line-height: var(--lh-foot); }

.linkbox { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.linkbox__url { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; line-height: 18px; color: var(--label); word-break: break-all; user-select: all; -webkit-user-select: all; }

/* Undo toasts sit at the bottom, under the thumb, above the tab bar. */
.toast--action { top: auto; bottom: calc(env(safe-area-inset-bottom) + 64px); animation-name: toast-up; }
.toast--action.is-leaving { animation-name: toast-down; }
@keyframes toast-up { from { opacity: 0; transform: translate(-50%, 14px) scale(.97); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-down { to { opacity: 0; transform: translate(-50%, 8px) scale(.98); } }

/* Tablets get the phone layout in a readable column. */
@media (min-width: 700px) and (max-width: 1023px) {
  .phone .screen { max-width: 680px; margin: 0 auto; }
  .phone .composer { margin: 0 auto; max-width: 680px; }
}

/* ── Desktop sidebar (the portal frame is in portal.css) ──────────────────── */
.side { display: flex; flex-direction: column; min-height: 0; padding: 14px 10px 10px; overflow: auto; background: var(--side); box-shadow: inset -.5px 0 0 var(--sep); }
.side__brand { display: flex; align-items: center; gap: 9px; padding: 4px 10px 10px; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.side__brand .brandmark { color: var(--tint); }
.side__nav { display: flex; flex-direction: column; gap: 1px; }
.side__section { padding: 16px 10px 4px; font-size: 11px; font-weight: 600; color: var(--label-2); }
.side__item { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; border-radius: 7px; color: var(--label); text-decoration: none; font-size: 14px; }
@media (hover: hover) and (pointer: fine) { .side__item:hover { background: var(--fill); } }
.side__item.is-selected { background: var(--tint-soft); font-weight: 500; }
.side__icon { display: grid; place-items: center; width: 20px; color: var(--tint-text); }
.side__icon.tone-red { color: var(--red-vivid); }
.side__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__count { color: var(--label-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.side__count.tone-red { color: var(--red); font-weight: 600; }
.side__item.is-selected .side__count:not(.tone-red) { color: var(--label); }
.side__me { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 8px 10px; border-radius: 9px; color: var(--label); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .side__me:hover { background: var(--fill); } }
.side__me.is-selected { background: var(--tint-soft); }
.side__me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.side__me-text b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side__me-text small { font-size: 12px; color: var(--label-2); }


/* ── Помощник: the team's assistant, as a conversation ──────────────────── */
.assist { flex: 1; display: flex; flex-direction: column; min-height: 100%; }
.assist--wide { max-width: 760px; height: 100dvh; min-height: 0; margin: 0 auto; }
.assist__bar { padding: 20px 24px 8px; }
.assist__title { font-size: var(--fs-large); line-height: var(--lh-large); font-weight: 700; letter-spacing: -.01em; }
.assist__sub { max-width: 60ch; margin-top: 2px; font-size: var(--fs-sub); line-height: var(--lh-sub); color: var(--label-2); }
.assist__talk { flex: 1; padding: 12px 16px 8px; }
.assist--wide .assist__talk { min-height: 0; overflow: auto; padding: 8px 24px; }
.assist__empty { display: grid; justify-items: center; gap: 12px; padding: 48px 8px 24px; text-align: center; }
.assist__mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--tint-soft); color: var(--tint-text); }
.assist__lead { font-size: var(--fs-title3); line-height: var(--lh-title3); font-weight: 600; }
.assist__first { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 520px; }
.assist__chip { min-height: 34px; padding: 6px 14px; border: 0; border-radius: 17px; background: var(--cell); box-shadow: inset 0 0 0 1px var(--sep-strong); color: var(--label); font-size: var(--fs-sub); transition: transform .16s var(--ease-out), background-color .15s; }
.assist__chip:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .assist__chip:hover { background: var(--fill); } }
.assist__thinking { display: flex; align-items: center; gap: 8px; margin: 6px 4px; color: var(--label-2); font-size: var(--fs-foot); font-variant-numeric: tabular-nums; }
.assist__dots { display: inline-flex; gap: 3px; }
.assist__dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .3; animation: assist-dot 1.2s infinite ease-in-out; }
.assist__dots i:nth-child(2) { animation-delay: .15s; }
.assist__dots i:nth-child(3) { animation-delay: .3s; }
@keyframes assist-dot { 0%, 80%, 100% { opacity: .25; transform: none; } 40% { opacity: .9; transform: translateY(-2px); } }
.assist--wide .assist__composer { position: static; padding: 10px 24px 16px; }
.assist .bubble a { color: var(--tint-text); text-decoration: underline; text-underline-offset: 2px; }
.assist .bubble code { padding: 1px 4px; border-radius: 5px; background: var(--fill); font: .92em ui-monospace, SFMono-Regular, Menlo, monospace; }
.assist .bubble pre { margin: 4px 0; padding: 8px 10px; border-radius: 10px; background: var(--fill); font: .88em/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.assist .bubble pre code { padding: 0; background: none; font: inherit; }
.assist .bubble blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--sep-strong); color: var(--label-2); }
@media (prefers-reduced-motion: reduce) { .assist__dots i { animation: none; opacity: .6; } }

/* ── The open ticket on the right (the board is in portal.css) ─────────────── */
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 5px; background: var(--fill); color: var(--label); font: 600 11px/18px var(--font); text-align: center; }


/* The open ticket: a panel over the board, as a peek; the board stays live. */
.dpanel { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(600px, 52vw); display: flex; flex-direction: column; background: var(--thread); box-shadow: -1px 0 0 var(--sep), -18px 0 48px rgba(0, 0, 0, .12); animation: panel-in .26s var(--ease-out); }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } }
.dpanel__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 52px; padding: 0 8px; background: var(--material); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: inset 0 -.5px 0 var(--sep); }
.dpanel__scroll { flex: 1; min-height: 0; display: flex; flex-direction: column; overflow: auto; overscroll-behavior: contain; }
.dpanel__head { padding: 18px 24px 12px; }
.dpanel__title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -.01em; }
.dpanel__status { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 6px; font-size: 13px; color: var(--label-2); }
.dpanel__status .is-late { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; }
.dpanel__dept { display: inline-flex; align-items: center; gap: 4px; }
.dpanel__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.dpanel .chat { padding: 4px 24px 16px; }
.dpanel .composer { padding: 10px 24px 14px; }
.dpanel .composer__mode { flex-basis: 360px; }

.escalate { display: flex; align-items: center; gap: 12px; margin: 0 24px 12px; padding: 12px 12px 12px 14px; border-radius: 12px; background: var(--orange-soft); color: var(--orange); }
.escalate__icon { flex: none; display: grid; place-items: center; }
.escalate p { flex: 1; font-size: 13px; line-height: 18px; }
.escalate b { font-weight: 600; }
.pill--orange { background: var(--orange); color: var(--on-orange); }
@media (hover: hover) and (pointer: fine) { .pill--orange:hover { filter: brightness(.93); } }

.dgist { margin: 0 24px 8px; padding: 11px 14px 12px; border-radius: 12px; background: var(--fill); }
.dgist__label { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; font-size: 11px; font-weight: 600; color: var(--label-2); text-transform: uppercase; letter-spacing: .03em; }
.dgist__text { font-size: 13.5px; line-height: 19px; }
.dgist.is-loading .dgist__text { color: var(--label-2); }

/* Wide sheets: the Tekcard letter and a new task. */
.letter { display: block; width: 100%; min-height: 240px; padding: 12px 16px; border: 0; outline: none; resize: vertical; background: none; color: var(--label); font: inherit; font-size: 13.5px; line-height: 20px; }
.letter.is-loading { min-height: 0; color: var(--label-2); }

.solo { max-width: 680px; margin: 0 auto; padding: 36px 0 40px; }

.column { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100dvh; background: var(--bg); }
.column--list { background: var(--cell); box-shadow: inset -.5px 0 0 var(--sep); }
.column--center { display: grid; place-items: center; }
.column__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 12px 10px 18px; }
.column__titles { min-width: 0; }
.column__title { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.column__title .navbar__merchant { font-weight: 700; }
.column__sub { margin-top: 1px; font-size: var(--fs-foot); color: var(--label-2); }
.column__scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.column__scroll--card, .column__scroll--form { padding: 28px max(0px, calc((100% - 680px) / 2)) 24px; }
.column__scroll--card .mhead__name { font-size: 26px; line-height: 32px; }

.column--list .toolbar-stack { padding: 0 12px 10px; }
.column--list .group { margin: 0 0 6px; }
.column--list .group__body { background: transparent; border-radius: 0; overflow: visible; }
.column--list .group__header { position: sticky; top: 0; z-index: 2; padding: 8px 18px 5px; background: color-mix(in srgb, var(--cell) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 11px; font-weight: 600; }
.column--list .group__footer { padding: 4px 18px 8px; }
.column--list .trow, .column--list .row { margin: 0 8px; padding: 9px 10px 9px 6px; border-radius: 10px; width: auto; }
.column--list .row--merchant { padding-left: 10px; }
.column--list .trow + .trow::before { left: 22px; right: 10px; }
.column--list .row.row--merchant + .row.row--merchant::before { left: 56px; right: 10px; }
.column--list .is-selected::before, .column--list .is-selected + *::before { opacity: 0; }
.column--list .notice { margin: 0 12px 10px; }


@media (min-width: 1024px) {
  .row { min-height: 36px; }
  .segmented { height: 28px; }
  .composer__mode { height: 28px; }
  .segmented__opt { font-size: 12px; }
  .search { height: 30px; border-radius: 8px; }
  .tile { min-height: 54px; }
  .btn--lg { height: 42px; font-size: 15px; border-radius: 11px; }
  .bubble { padding: 7px 12px; border-radius: 17px; }
  .composer { padding: 10px 24px 14px; }
  .field__label { flex-basis: 130px; }
  .field input, .field select, .field textarea { padding: 9px 0; }
  .pill { height: 26px; min-width: 60px; padding: 0 11px; font-size: 13px; }
  .sheet__panel { left: 50%; top: 50%; right: auto; bottom: auto; width: min(440px, 90vw); max-height: 80vh; border-radius: 14px; transform: translate(-50%, -50%); animation: pop-in .22s var(--ease-out); padding-bottom: 0; }
  .sheet__panel::before { display: none; }
  .sheet--wide .sheet__panel { width: min(620px, 92vw); }
  .toast { top: 72px; }
  .toast--action { top: auto; bottom: 24px; }
}
@keyframes pop-in { from { opacity: 0; transform: translate(-50%, -48%) scale(.97); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* Reduced motion: nothing slides or scales; state changes still fade so the
   feedback stays legible. */
@media (prefers-reduced-motion: reduce) {
  .phone__stage, .sheet__panel, .sheet.is-leaving .sheet__panel, .toast, .toast.is-leaving,
  .trow.is-leaving, .dpanel, .msg.is-new, .done-mark { animation-name: fade-in !important; animation-duration: .2s !important; }
  .toast.is-leaving, .toast--action.is-leaving, .trow.is-leaving, .sheet.is-leaving .sheet__panel { animation-name: fade-out !important; }
  .toast--action { animation-name: fade-in !important; }
  .segmented__thumb, .switch, .switch::after, .disclosure__chev, .disclosure__body { transition: none !important; }
  .btn:active, .tile:active, .pill:active, .composer__send:active, a.notice:active, .toast__action:active,
  .tabbar__item:active .tabbar__icon { transform: none !important; }
  .boot__mark, .skel__line { animation: none !important; }
}
