:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --panel-2: #f3f4f6;
  --border: #e7e8ec;
  --text: #16181d;
  --text-dim: #8a8f98;
  --accent: #16181d;      /* основной цвет кнопок — чёрный, как в референсе */
  --accent-soft: #eef0f3;
  --orange: #ff6a3d;       /* акцентный цвет для тегов/бейджей, как "Новое" на скрине */
  --orange-soft: #fff1ea;
  --green: #1fae6b;
  --green-soft: #e7f8f0;
  --yellow: #d69a00;
  --yellow-soft: #fff6df;
  --red: #e5484d;
  --red-soft: #fdecec;
  --gray: #8a8f98;
  --gray-soft: #f0f1f3;
  --chat-bubble-mine: #0a84ff; /* заливка "своих" сообщений в чате — фирменный синий, как в iMessage/референсе */
  --shadow: 0 1px 2px rgba(16,17,20,0.04), 0 6px 20px rgba(16,17,20,0.05);


  --pastel-yellow-bg: #fdeeb8; --pastel-yellow-text: #8a6d00;
  --pastel-blue-bg: #cfe3f5; --pastel-blue-text: #2b5f8a;
  --pastel-purple-bg: #e7defb; --pastel-purple-text: #5b3fa0;
  --pastel-green-bg: #d9f2e3; --pastel-green-text: #1f7a4d;
  --pastel-red-bg: #fbdede; --pastel-red-text: #a02020;




  --green-ink: #12603c;
  --red-ink: #a3282c;
  --yellow-ink: #7a5800;
  --orange-ink: #8a3311;


  --prio-low-bg: #fff1ea;   --prio-low-ink: #a15226;
  --prio-med-bg: #ffe2d1;   --prio-med-ink: #8a3311;
  --prio-high-bg: #ffc9a8;  --prio-high-ink: #6b230a;

  --dir-out-bg: #dbe6ff;    --dir-out-ink: #16306b;
  --dir-in-bg: #d6f2e2;     --dir-in-ink: #0c4d37;

  --tint-vip-bg: #eee6ff;   --tint-vip-text: #7c4dff;
  --tint-repeat-bg: #e6f4ff; --tint-repeat-text: #0080ff;
  --later-bg: #fdf1e2;      --later-ink: #c2761b;
  --mark-bg: #ffe9a8;


  --on-tint-wash: rgba(255, 255, 255, 0.6);



  --danger-bg: #e5484d;





  --accent-ink: #16181d;
  --canvas-shadow: 0 30px 80px rgba(30,34,48,0.14), 0 4px 16px rgba(30,34,48,0.06);
  --app-canvas: linear-gradient(135deg, #eef0f6 0%, #e7e9f2 45%, #eceef5 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}





:root {
  --dur-in: .22s;
  --dur-out: .15s;
  --ease-out: cubic-bezier(.2, .9, .3, 1);     /* быстрый старт, мягкая остановка — появление */
  --ease-in: cubic-bezier(.4, 0, 1, 1);        /* разгон — уход */
  --ease-spring: cubic-bezier(.2, 1.15, .3, 1); /* лёгкий перелёт — окна, кнопки */
}



























:root {
  --chat-canvas: #ffffff;            /* полотно переписки */
  --chat-canvas-side: #fbfbfd;       /* список диалогов слева */
  --chat-canvas-bar: #ffffff;        /* шапка переписки и поле ввода */
  --chat-bubble-in: var(--panel-2);  /* входящий пузырёк в «Сообщениях» */
  --chat-bubble-in-dlg: #edeff3;     /* он же в «Диалогах» — там полотно другое */
  --chat-bubble-in-shadow: none;     /* на приглушённом полотне белый пузырёк приподнят */
  --chat-text-scale: 1;              /* размер текста переписки, три ступени */
}
:root[data-chat-theme="soft"] {
  --chat-canvas: #eef0f4;
  --chat-canvas-side: #e9ecf1;
  --chat-canvas-bar: #f7f8fa;
  --chat-bubble-in: #ffffff;
  --chat-bubble-in-dlg: #ffffff;
  --chat-bubble-in-shadow: 0 1px 2px rgba(16, 17, 20, 0.06);
}
:root[data-chat-theme="warm"] {
  --chat-canvas: #f2f0ec;
  --chat-canvas-side: #ebe8e2;
  --chat-canvas-bar: #f8f6f2;
  --chat-bubble-in: #ffffff;
  --chat-bubble-in-dlg: #ffffff;
  --chat-bubble-in-shadow: 0 1px 2px rgba(40, 34, 24, 0.07);
}




















:root[data-theme="dark"] {
  --bg: #0e0f12;
  --panel: #17181c;
  --panel-2: #1f2127;
  --border: #2a2c33;
  --text: #e5e7ea;
  --text-dim: #8d939c;
  --accent: #3a3f47;
  --accent-soft: #23262c;
  --orange: #ff8256;       --orange-soft: #33231b;
  --green: #35c98b;        --green-soft: #142a20;
  --yellow: #e0a92a;       --yellow-soft: #2b2415;
  --red: #ff6b6f;          --red-soft: #331e20;
  --gray: #8d939c;         --gray-soft: #23262c;
  --chat-bubble-mine: #0a6fd6;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 6px 20px rgba(0, 0, 0, 0.28);
  --canvas-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 4px 16px rgba(0, 0, 0, 0.4);
  --pastel-yellow-bg: #3a3116; --pastel-yellow-text: #f0c869;
  --pastel-blue-bg: #17293a;   --pastel-blue-text: #8fc3ee;
  --pastel-purple-bg: #271f3c; --pastel-purple-text: #b9a3f0;
  --pastel-green-bg: #16301f;  --pastel-green-text: #79d9a2;
  --pastel-red-bg: #351a1b;    --pastel-red-text: #f09a9d;
  --green-ink: #6fdca8;
  --red-ink: #ff8f92;
  --yellow-ink: #ecc45c;
  --orange-ink: #ffab7d;
  --prio-low-bg: #2b201a;   --prio-low-ink: #f0b48c;
  --prio-med-bg: #3a2719;   --prio-med-ink: #ffa877;
  --prio-high-bg: #4a2d18;  --prio-high-ink: #ff9d63;
  --dir-out-bg: #1a2540;    --dir-out-ink: #9cc2ff;
  --dir-in-bg: #143024;     --dir-in-ink: #6fdca8;
  --tint-vip-bg: #29224a;   --tint-vip-text: #b7a0ff;
  --tint-repeat-bg: #16283a; --tint-repeat-text: #7ab8ff;
  --later-bg: #33281a;      --later-ink: #e8a95a;
  --mark-bg: #574712;
  --on-tint-wash: rgba(255, 255, 255, 0.10);
  --danger-bg: #cf3b40;
  --accent-ink: #d6d9de;
  --app-canvas: linear-gradient(135deg, #101116 0%, #0d0e12 45%, #111218 100%);
  --dlg-accent: #3a94ff;
  --dlg-accent-wash: rgba(58, 148, 255, 0.14);
  --dlg-accent-wash-strong: rgba(58, 148, 255, 0.26);
}











:root[data-theme="dark"],
:root[data-theme="dark"][data-chat-theme] {
  --chat-canvas: #17181c;
  --chat-canvas-side: #121316;
  --chat-canvas-bar: #1c1e23;
  --chat-bubble-in: #2a2d34;
  --chat-bubble-in-dlg: #2a2d34;
  --chat-bubble-in-shadow: none;
}



:root[data-theme="dark"][data-chat-theme-dark="night"] {
  --chat-canvas: #1c1a17;
  --chat-canvas-side: #151311;
  --chat-canvas-bar: #221f1b;
  --chat-bubble-in: #2f2b25;
  --chat-bubble-in-dlg: #2f2b25;
}


:root[data-theme="dark"][data-chat-theme-dark="black"] {
  --chat-canvas: #000000;
  --chat-canvas-side: #000000;
  --chat-canvas-bar: #0c0c0d;
  --chat-bubble-in: #1c1c1e;
  --chat-bubble-in-dlg: #1c1c1e;
}
:root[data-chat-text="l"] { --chat-text-scale: 1.12; }
:root[data-chat-text="xl"] { --chat-text-scale: 1.25; }

* { box-sizing: border-box; }



html { background: var(--bg); }
body {
  margin: 0;



  background: var(--app-canvas);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px;
}

#app {
  display: flex;
  position: relative; /* точка отсчёта для кнопки сворачивания правой панели */
  min-height: calc(100vh - 36px);
  min-height: calc(100dvh - 36px);
  background: var(--bg);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--canvas-shadow);
}





.side-panel-toggle {
  position: absolute;
  top: 22px;
  right: 280px; /* прижата к левому краю панели */
  z-index: 6;
  width: 22px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 13px; line-height: 1;
  cursor: pointer;
  transition: right .18s ease, color .12s, background .12s;
}
.side-panel-toggle:hover { background: var(--panel-2); color: var(--text); }

#app.side-collapsed .side-panel { display: none; }
#app.side-collapsed .side-panel-toggle { right: 0; }

@media (max-width: 1150px) {
  .side-panel-toggle { display: none; }
}

.sidebar {
  width: 246px;
  background: var(--panel);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex-shrink: 0;
}
.brand {
  font-size: 15px;
  font-weight: 700;
  padding: 4px 10px 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
}
.brand-mark {




  background: var(--text);
  color: var(--panel);
  font-size: 11px;
  font-weight: 800;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1), box-shadow .35s ease;
  animation: brandEnter .7s cubic-bezier(.22, 1, .36, 1) both,
             brandGlow 4.5s ease-in-out .7s infinite;
}



.brand-mark::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -60%;
  width: 45%;
  height: 220%;


  background: linear-gradient(115deg, transparent 0%, color-mix(in srgb, var(--panel) 70%, transparent) 50%, transparent 100%);
  transform: translateX(0) rotate(20deg);
  animation: brandShine 4.5s ease-in-out .7s infinite;
  pointer-events: none;
}
.brand:hover .brand-mark {
  transform: scale(1.1) rotate(-6deg);
  box-shadow: 0 8px 20px -4px rgba(22, 24, 29, .4);
}
@keyframes brandEnter {
  0% { opacity: 0; transform: scale(.4) rotate(-25deg); }
  60% { opacity: 1; transform: scale(1.08) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
@keyframes brandGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 24, 29, 0); }
  50% { box-shadow: 0 3px 12px -2px rgba(22, 24, 29, .35); }
}





@keyframes brandShine {
  0% { transform: translateX(0) rotate(20deg); }
  30% { transform: translateX(422.2%) rotate(20deg); }
  100% { transform: translateX(422.2%) rotate(20deg); }
}
@media (prefers-reduced-motion: reduce) {
  .brand-mark { animation: none; }
  .brand-mark::after { animation: none; display: none; }
}

.nav-item {
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }

.nav-item.active { background: var(--accent); color: #fff; font-weight: 700; }
.nav-item.active .nav-icon { background: rgba(255,255,255,0.15); }

.project-filter {
  margin-top: 18px;
  padding: 0 10px;
  color: var(--text-dim);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.project-pill {
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 500;
}
.project-pill:hover { background: var(--panel-2); }
.project-pill.active { background: var(--panel-2); color: var(--text); font-weight: 700; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }







.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 14px;
  background: var(--accent-soft);
}
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-logout {
  width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-dim); cursor: pointer;
  transition: color 120ms ease-out, border-color 120ms ease-out;
}


.sidebar-logout:hover { color: var(--red); border-color: var(--red); }
.sidebar-logout:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.sidebar-logout svg { display: block; }
.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6a3d, #ff9466);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}


.avatar-img-fill { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }


.avatar-settings-row {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px;
}
.avatar-settings-row .avatar-lg {
  width: 88px; height: 88px; font-size: 32px;
}
.avatar-settings-actions {
  display: flex; flex-direction: column; gap: 8px;
}
.avatar-preset-grid {
  display: grid; grid-template-columns: repeat(8, 44px); gap: 10px;
}
.avatar-preset-btn {
  width: 44px; height: 44px; border-radius: 50%; padding: 0; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: none; line-height: 0;
}
.avatar-preset-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-preset-btn:hover { border-color: var(--border); }
.avatar-preset-btn.active { border-color: var(--accent, #4C6FFF); }
@media (max-width: 640px) {
  .avatar-preset-grid { grid-template-columns: repeat(6, 40px); }
}
.who-name { font-size: 13px; font-weight: 700; }
.who-sub { font-size: 11px; color: var(--text-dim); }

main {
  flex: 1;
  padding: 30px 40px;
  overflow-y: auto;
  max-height: 100vh;
  min-width: 0;
}


.side-panel {
  width: 280px;
  flex-shrink: 0;
  padding: 26px 20px;
  border-left: 1px solid var(--border);
  overflow-y: auto;
  max-height: 100vh;
}
.profile-card {
  position: relative;
  text-align: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-menu-btn {
  position: absolute;
  top: 0; right: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.profile-menu-btn:hover { background: var(--border); color: var(--text); }
.avatar-lg-wrap { position: relative; width: 62px; margin: 0 auto 10px; }
.avatar-lg {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6a3d, #ff9466);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.avatar-online-dot {
  position: absolute;
  bottom: 1px; right: 1px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--panel);
}
.profile-name { font-weight: 700; font-size: 14.5px; }
.profile-role { color: var(--text-dim); font-size: 12px; margin: 2px 0 12px; }
.status-select-wrap { position: relative; display: inline-block; color: var(--green); }
.status-select-wrap.busy { color: var(--yellow); }
.status-select-wrap.away { color: var(--gray); }
.status-pill {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; font-family: inherit;
  padding: 5px 26px 5px 13px; border-radius: 20px;
  border: none; cursor: pointer;
  background: var(--green-soft); color: var(--green);
}
.status-select-wrap::after {
  content: '▾';
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  font-size: 10px; pointer-events: none; color: inherit;
}
.status-pill.busy { background: var(--yellow-soft); color: var(--yellow); }
.status-pill.away { background: var(--gray-soft); color: var(--gray); }
.status-pill.blocked { background: var(--red-soft); color: var(--red); }

.agenda-head { display: flex; align-items: center; justify-content: space-between; }
.agenda-head h4 { margin: 0 0 14px; font-size: 13px; font-weight: 700; }
.agenda-week-nav { display: flex; gap: 2px; margin-bottom: 14px; }
.agenda-week-arrow {
  width: 22px; height: 22px; border: none; border-radius: 50%; background: transparent;
  color: var(--text-dim); font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.agenda-week-arrow:hover { background: var(--panel-2); color: var(--text); }
.agenda-week-arrow:active { transform: scale(0.9); }




.agenda-week-viewport { overflow: hidden; touch-action: pan-y; }
.agenda-week { display: flex; justify-content: space-between; margin-bottom: 16px; }
.agenda-week.slide-left { animation: agendaSlideLeft .28s cubic-bezier(.22,.68,.36,1); }
.agenda-week.slide-right { animation: agendaSlideRight .28s cubic-bezier(.22,.68,.36,1); }
@keyframes agendaSlideLeft {
  from { transform: translateX(22px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes agendaSlideRight {
  from { transform: translateX(-22px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.agenda-day { text-align: center; font-size: 11px; color: var(--text-dim); padding: 6px 4px; border-radius: 10px; min-width: 28px; font-weight: 600; transition: background .2s ease, color .2s ease; cursor: pointer; user-select: none; }
.agenda-day:hover:not(.active) { background: var(--panel-2); }
.agenda-day .dom { font-weight: 700; font-size: 13px; margin-top: 3px; }
.agenda-day.active { background: var(--accent); color: #fff; }


.agenda-day.is-today .dom { position: relative; }
.agenda-day.is-today .dom::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--accent);
}
.agenda-selected-label { display: flex; align-items: center; justify-content: space-between; margin: -6px 0 10px; font-size: 12px; color: var(--text-dim); }
.agenda-selected-label span { font-weight: 700; color: var(--text); }
.agenda-clear-date { border: none; background: none; color: var(--accent-ink); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.agenda-clear-date:hover { text-decoration: underline; }
.agenda-list { animation: agendaListFade .2s ease; }
@keyframes agendaListFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.agenda-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.agenda-item { display: flex; gap: 10px; align-items: center; background: var(--panel-2); border-radius: 14px; padding: 10px 12px; }





.agenda-item-clickable { cursor: pointer; transition: background 0.12s; }
.agenda-item-clickable:hover { background: var(--accent-soft); }
.agenda-item-clickable:hover .agenda-title { text-decoration: underline; }




.agenda-item.done { opacity: 0.6; }
.agenda-item.done .agenda-title,
.agenda-item.done.agenda-item-clickable:hover .agenda-title { text-decoration: line-through; }
.agenda-icon { font-size: 15px; flex-shrink: 0; }
.agenda-title { font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.agenda-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.agenda-all { width: 100%; }









.unread-notify-block { margin-top: 18px; }
.unread-notify-block h4 { margin: 0 0 10px; }
.unread-notify-list { display: flex; flex-direction: column; gap: 8px; }
.unread-notify-card {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 10px 12px; cursor: pointer;
}



.unread-notify-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 6px var(--accent-soft);
  opacity: 0;
  pointer-events: none;
  animation: unreadNotifyPulse 2.4s ease-in-out infinite;
}
.unread-notify-card:hover { border-color: var(--accent-ink); }
.unread-notify-card:hover::after { animation-play-state: paused; }
@keyframes unreadNotifyPulse {
  0%, 100% { opacity: 0; transform: scale(.97); }
  50% { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .unread-notify-card::after { animation: none; }
}
.unread-notify-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  background: var(--accent-soft); color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.unread-notify-info { min-width: 0; }
.unread-notify-name { font-size: 12.5px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unread-notify-cta { font-size: 11.5px; color: var(--accent-ink); font-weight: 600; margin-top: 2px; }


.grid-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 20px; }
.request-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.request-row:last-child { border-bottom: none; }
.pending-download-row { cursor: pointer; }
.pending-download-row:hover { background: var(--panel-2); border-radius: 10px; }
.request-title { font-weight: 600; font-size: 13.5px; }
.request-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.team-count { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; }
.team-sub { color: var(--text-dim); font-size: 12.5px; margin-bottom: 14px; }
.team-online-now { color: var(--green); font-weight: 700; }


.payout-over-budget {
  margin-top: 4px; font-size: 12.5px; font-weight: 600;
  color: var(--red); background: var(--red-soft);
  display: inline-block; padding: 3px 9px; border-radius: 8px;
}
.payout-waiting { color: var(--text-dim); }
.payout-waiting.stuck { color: var(--red); font-weight: 700; }


.payout-expert-group { border: 1px solid var(--border); border-radius: 14px; padding: 4px 14px; margin-bottom: 12px; }
.payout-expert-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 0 10px; border-bottom: 1px solid var(--border);
}
.payout-expert-name { font-weight: 700; font-size: 14px; flex: 1 1 auto; min-width: 0; }
.payout-expert-sum { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
#payouts-status-tabs { flex-wrap: wrap; margin-bottom: 14px; }


.expert-money-list { display: flex; flex-direction: column; }
.expert-money-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.expert-money-row:last-child { border-bottom: none; }
.expert-money-main { min-width: 0; flex: 1 1 auto; cursor: pointer; }

.expert-money-title { font-weight: 600; font-size: 13.5px; word-break: break-word; }
.expert-money-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.expert-money-sum { font-weight: 800; font-size: 15px; color: var(--green); white-space: nowrap; }
@media (max-width: 640px) {

  .expert-money-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .expert-money-actions { width: 100%; justify-content: space-between; }
}


.team-roles { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.team-role-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 12.5px; color: var(--text); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.team-role-chip:hover { background: var(--panel-2); border-color: var(--text-dim); }
.team-role-chip b { font-weight: 800; }

.team-role-online { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; }

.team-avatars { display: flex; }
.team-avatars .avatar-sm.more:hover { opacity: .85; }


.team-modal-list { max-height: 380px; overflow-y: auto; margin-top: 12px; }
.team-modal-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 10px; border-radius: 10px; cursor: pointer;
  transition: background .12s;
}
.team-modal-row:hover { background: var(--panel-2); }


.team-modal-row.no-hover { cursor: default; }
.team-modal-row.no-hover:hover { background: none; }
.team-modal-name { font-weight: 600; font-size: 13.5px; }
.team-modal-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.team-modal-sub.online { color: var(--green); font-weight: 600; }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--panel-2); color: var(--text);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--panel);
  margin-left: -8px;
}
.avatar-sm:first-child { margin-left: 0; }
.avatar-sm.more { background: var(--text); color: var(--panel); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.01em; }
.topbar .sub { color: var(--text-dim); font-size: 13px; margin-top: 5px; }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: opacity 0.12s ease, transform 0.05s ease;
}
.btn:hover { opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn.secondary { background: var(--panel); border: 1px solid var(--border); color: var(--text); box-shadow: none; }
.btn.secondary:hover { background: var(--panel-2); opacity: 1; }
.btn.danger { background: var(--danger-bg); }
.btn.small { padding: 6px 12px; font-size: 12px; border-radius: 8px; }

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 20px 58px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.stat-card .label { color: var(--text-dim); font-size: 13px; margin-top: 4px; font-weight: 500; }

.stat-card-icon {
  position: absolute;
  bottom: 16px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--on-tint-wash);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.stat-card:not(.pastel-yellow):not(.pastel-blue):not(.pastel-purple):not(.pastel-green):not(.pastel-red) .stat-card-icon {
  background: var(--panel-2);
}


.stat-card.clickable { cursor: pointer; transition: border-color 0.12s ease, box-shadow 0.12s ease; }
.stat-card.clickable:hover { border-color: var(--accent-ink); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }




.stat-card.pastel-yellow { background: var(--pastel-yellow-bg); border-color: transparent; }
.stat-card.pastel-yellow .num, .stat-card.pastel-yellow .label { color: var(--pastel-yellow-text); }
.stat-card.pastel-blue { background: var(--pastel-blue-bg); border-color: transparent; }
.stat-card.pastel-blue .num, .stat-card.pastel-blue .label { color: var(--pastel-blue-text); }
.stat-card.pastel-purple { background: var(--pastel-purple-bg); border-color: transparent; }
.stat-card.pastel-purple .num, .stat-card.pastel-purple .label { color: var(--pastel-purple-text); }
.stat-card.pastel-green { background: var(--pastel-green-bg); border-color: transparent; }
.stat-card.pastel-green .num, .stat-card.pastel-green .label { color: var(--pastel-green-text); }
.stat-card.pastel-red { background: var(--pastel-red-bg); border-color: transparent; }
.stat-card.pastel-red .num, .stat-card.pastel-red .label { color: var(--pastel-red-text); }

.registration-requests-section { border: 1px solid var(--border); }
.registration-request-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.registration-request-row:last-child { border-bottom: none; }
.registration-request-info { flex: 1 1 260px; min-width: 0; }
.registration-request-name { font-weight: 700; }
.registration-request-message {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  font-style: italic;
  max-width: 480px;
}
.registration-request-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.registration-role-select { width: auto; min-width: 140px; }

.payouts-summary-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.payouts-summary-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  min-width: 160px;
  box-shadow: var(--shadow);
}
.payouts-summary-num { font-size: 24px; font-weight: 800; line-height: 1.1; }
.payouts-summary-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.payouts-export-box {
  flex: 1 1 320px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.payouts-export-label { font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.payouts-export-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.payouts-export-controls input[type="date"] { width: auto; min-width: 140px; }

.catalog-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.catalog-tab {
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
}
.catalog-tab .token-hint { margin: 0 0 0 4px; }
.catalog-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.catalog-tab.active .token-hint { color: rgba(255,255,255,0.85); }
.catalog-name { font-weight: 500; }

.section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow-x: auto;
}
.section h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--text-dim); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; padding: 8px 10px; border-bottom: 1px solid var(--border); }
td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--panel-2); }

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
}
.badge.draft { background: var(--gray-soft); color: var(--gray); }
.badge.scheduled { background: var(--yellow-soft); color: var(--yellow); }
.badge.publishing { background: var(--accent-soft); color: var(--text); }
.badge.published { background: var(--green-soft); color: var(--green); }
.badge.failed { background: var(--red-soft); color: var(--red); }
.badge.connected { background: var(--green-soft); color: var(--green); }
.badge.unknown { background: var(--gray-soft); color: var(--gray); }
.badge.error { background: var(--red-soft); color: var(--red); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.item-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}
.item-card .title { font-weight: 700; margin-bottom: 5px; font-size: 13.5px; }
.item-card .meta { color: var(--text-dim); font-size: 12px; margin-bottom: 12px; }
.item-card .actions { display: flex; gap: 6px; flex-wrap: wrap; }

input, textarea, select {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;


  line-height: 1.3;
}








input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  height: 40px;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--text);
}
label { font-size: 12px; font-weight: 600; color: var(--text-dim); display: block; margin: 14px 0 6px; }
label:first-child { margin-top: 0; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16,17,20,0.35);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}








.modal-backdrop.modal-backdrop-over {
  z-index: 60;
  background: rgba(16, 17, 20, 0.16);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 26px;
  width: min(480px, 92vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(16,17,20,0.25);
}
.modal h3 { margin-top: 0; font-size: 17px; font-weight: 800; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }



.confirm-text { font-size: 13.5px; line-height: 1.5; color: var(--text-dim); margin-top: 10px; }


.chat-history-loading {
  text-align: center; color: var(--text-dim); font-size: 12.5px;
  padding: 10px 0; flex: none;
}

.checkbox-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.checkbox-row input { width: auto; }





.quick-groups-dd { position: relative; }
.quick-groups-dd > summary {
  cursor: pointer;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
  background: var(--panel);
  list-style: none;
}
.quick-groups-dd > summary::-webkit-details-marker { display: none; }
.quick-groups-dd[open] > summary { border-color: var(--text-dim); }
.quick-groups-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 4px;
  min-width: 220px;
}
.quick-groups-panel .qg-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.quick-groups-panel .qg-row:hover { background: var(--chat-bubble-mine); color: #fff; }
.quick-groups-panel .qg-check { width: 14px; flex: none; text-align: center; color: var(--chat-bubble-mine); font-weight: 700; visibility: hidden; }
.quick-groups-panel .qg-row.checked .qg-check { visibility: visible; }
.quick-groups-panel .qg-row:hover .qg-check { color: #fff; }


.attach-order-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.attach-order-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.attach-order-row:last-child { border-bottom: none; }
.attach-order-row:hover { background: var(--panel-2); }
.attach-order-row.selected { background: var(--accent-soft); }
.attach-order-number { font-weight: 700; font-size: 13px; flex-shrink: 0; }
.attach-order-title { flex: 1; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.contact-pick-list {
  max-height: 360px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.contact-pick-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.contact-pick-row:last-child { border-bottom: none; }
.contact-pick-row:hover { background: var(--panel-2); }
.contact-pick-row.selected { background: var(--accent-soft); }
.contact-pick-info { flex: 1; min-width: 0; }
.contact-pick-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-pick-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.contact-pick-online { color: var(--green); font-weight: 600; }






.expert-pick-list {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.expert-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border);
}
.expert-pick-row:last-child { border-bottom: none; }
.expert-pick-row:hover { background: var(--panel-2); }
.expert-pick-row.selected { background: var(--accent-soft); }
.expert-pick-info { flex: 1; min-width: 0; }
.expert-pick-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expert-pick-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expert-pick-profile-btn { flex-shrink: 0; white-space: nowrap; }
.expert-pick-radio {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; position: relative; transition: background .12s ease, border-color .12s ease;
}
.expert-pick-row.selected .expert-pick-radio { border-color: var(--accent); background: var(--accent); }
.expert-pick-row.selected .expert-pick-radio::after {
  content: ''; position: absolute; top: 50%; left: 50%; width: 7px; height: 7px;
  border-radius: 50%; background: #fff; transform: translate(-50%, -50%);
}


.chat-chooser-options { display: flex; gap: 10px; margin: 14px 0 4px; }
.chat-chooser-btn { flex: 1; padding: 18px 10px; font-size: 14px; border-radius: 14px; }
.group-contact-list {
  max-height: 260px; overflow-y: auto; margin-top: 8px;
  border: 1px solid var(--border); border-radius: 12px;
}
.group-contact-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer;
}
.group-contact-row:last-child { border-bottom: none; }
.group-contact-row:hover { background: var(--panel-2); }
.group-contact-row input[type="checkbox"] { width: auto; }
.group-participant-row { justify-content: space-between; cursor: default; }
.group-participant-row:hover { background: none; }
.group-avatar-row { display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; }




.group-info-quick-actions {
  display: flex; flex-direction: column; gap: 4px;
  margin: 4px 0 14px;
  border: 1px solid var(--border); border-radius: 12px;
  overflow: hidden;
}
.group-info-quick-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 11px 12px;
  border: none; background: var(--panel);
  cursor: pointer;
  font-size: 13.5px; color: var(--text);
}
.group-info-quick-btn:not(:last-child) { border-bottom: 1px solid var(--border); }
.group-info-quick-btn:hover { background: var(--panel-2); }



.group-participant-info { flex: 1; min-width: 0; }
.group-participant-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-participant-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }


.media-tabs { display: flex; gap: 6px; margin: 14px 0 12px; }
.media-tab {
  flex: 1; padding: 8px 6px; border-radius: 10px; border: none; cursor: pointer;
  background: var(--panel-2); color: var(--text); font-size: 12.5px; font-weight: 600;
}
.media-tab.active { background: var(--accent); color: #fff; }
.media-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 340px; overflow-y: auto; }
.media-photo-thumb { width: 100%; height: 84px; object-fit: cover; border-radius: 10px; cursor: pointer; }
.media-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--border); font-size: 13px;
}
.media-file-row:last-child { border-bottom: none; }
.media-file-row a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-file-date { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }


.modal.modal-wide { width: min(640px, 92vw); }
.order-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.order-form-row.cols-3 { grid-template-columns: 1fr auto auto; align-items: end; }
.order-form-row label { margin: 0 0 6px; }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 30px; }
.select-wrap::after {
  content: '▾'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 11px; color: var(--text-dim); pointer-events: none;
}
.date-input-wrap { position: relative; }
.date-input-wrap input[type="date"] { padding-right: 34px; }


.ss-dropdown { position: relative; }
.ss-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); color: var(--text);
  padding: 10px 12px; border-radius: 10px; font-size: 13px; font-family: inherit;
  cursor: pointer; text-align: left;
}
.ss-dropdown.open .ss-trigger { border-color: var(--text); }
.ss-trigger-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-trigger-label.ss-placeholder { color: var(--text-dim); }
.ss-caret { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.ss-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(16,17,20,0.16); padding: 8px;
}
.ss-panel.open { display: block; }
.ss-search { margin-bottom: 6px; }
.ss-list { max-height: 260px; overflow-y: auto; }
.ss-option { padding: 9px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.ss-option:hover { background: var(--panel-2); }
.ss-option.selected { font-weight: 700; }
.ss-option-custom { color: var(--accent-ink); font-weight: 600; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px; padding-bottom: 10px; }
.ss-empty { padding: 10px; color: var(--text-dim); font-size: 13px; }

.richtext-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0;
  padding: 8px 10px;
  background: var(--panel-2);
}
.richtext-toolbar button {
  background: none; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 7px;
  color: var(--text); font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.richtext-toolbar button:hover { background: var(--border); }
.richtext-body {
  border: 1px solid var(--border);
  border-radius: 0 0 10px 10px;
  padding: 12px;
  min-height: 140px;
  max-height: 260px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
}
.richtext-body:focus { outline: none; border-color: var(--text); }
.richtext-body:empty::before { content: attr(data-placeholder); color: var(--text-dim); }

.file-attach-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px dashed var(--border);
  color: var(--text-dim); font-weight: 600; font-size: 13px;
  padding: 10px 16px; border-radius: 12px; cursor: pointer;
}
.file-attach-btn:hover { border-color: var(--text-dim); color: var(--text); }
.file-chip-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.file-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel-2); border-radius: 10px; padding: 8px 12px; font-size: 12.5px;
}





.file-chip > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip button { flex: none; width: auto; background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 15px; padding: 0; }
.file-chip button:hover { color: var(--red); }


@media (pointer: coarse) {
  .file-chip button { position: relative; }
  .file-chip button::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 44px; height: 44px; transform: translate(-50%, -50%);
  }
}

.file-attach-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.file-attach-name { font-size: 12.5px; color: var(--text); font-weight: 600; }

.order-price-box {
  background: var(--panel-2);
  border-radius: 16px;
  padding: 18px;
  margin-top: 16px;
}
.order-price-box .order-form-row { margin-bottom: 14px; }
.order-price-box .order-form-row:last-child { margin-bottom: 0; }
.price-info-icon { color: var(--text-dim); font-size: 12px; cursor: help; }










.plag-slider-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-self: start; max-width: 100%; }
#o-plagiarism-percent {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 110px !important; max-width: 110px !important; flex-shrink: 0;
  height: 3px !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(to right, var(--accent) 70%, var(--border) 70%);
  outline: none; cursor: pointer;
}
#o-plagiarism-percent::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel);
  box-shadow: 0 1px 3px rgba(16,17,20,0.28);
  cursor: pointer; margin-top: 0;
}
#o-plagiarism-percent::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--panel);
  box-shadow: 0 1px 3px rgba(16,17,20,0.28);
  cursor: pointer;
}
#o-plagiarism-percent::-moz-range-track { background: transparent !important; border: none !important; height: 3px; }
#o-plagiarism-percent:disabled { opacity: 0.5; cursor: not-allowed; }
#o-plagiarism-percent:disabled::-webkit-slider-thumb { cursor: not-allowed; }
.plag-slider-value { font-weight: 700; font-size: 13px; min-width: 34px; text-align: right; flex-shrink: 0; }





#o-citation-percent {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 110px !important; max-width: 110px !important; flex-shrink: 0;
  height: 3px !important; min-height: 0 !important;
  padding: 0 !important; margin: 0 !important; border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(to right, var(--green) 20%, var(--border) 20%);
  outline: none; cursor: pointer;
}
#o-citation-percent::-webkit-slider-thumb {
  -webkit-appearance: none !important;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--panel);
  box-shadow: 0 1px 3px rgba(16,17,20,0.28);
  cursor: pointer; margin-top: 0;
}
#o-citation-percent::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--panel);
  box-shadow: 0 1px 3px rgba(16,17,20,0.28);
  cursor: pointer;
}
#o-citation-percent::-moz-range-track { background: transparent !important; border: none !important; height: 3px; }
#o-citation-percent:disabled { opacity: 0.5; cursor: not-allowed; }
#o-citation-percent:disabled::-webkit-slider-thumb { cursor: not-allowed; }





.o-plag-row { grid-template-columns: auto 1fr; align-items: center; gap: 14px; }
@media (max-width: 480px) {
  .o-plag-row { grid-template-columns: 1fr; gap: 8px; }
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-day-head { color: var(--text-dim); font-size: 10.5px; font-weight: 700; text-transform: uppercase; padding: 4px; text-align: center; }
.cal-cell {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  min-height: 100px;
  padding: 8px;
  font-size: 11px;
}
.cal-cell.other-month { opacity: 0.4; }
.cal-cell .daynum { color: var(--text-dim); margin-bottom: 5px; font-weight: 700; }
.cal-post {
  background: var(--panel);
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-left: 3px solid var(--gray);
  box-shadow: var(--shadow);
}
.cal-post.scheduled { border-color: var(--yellow); }
.cal-post.published { border-color: var(--green); }
.cal-post.failed { border-color: var(--red); }
.cal-post.draft { border-color: var(--gray); }


.cal-cell { position: relative; }
.cal-cell[data-day-key] { cursor: pointer; transition: border-color 0.12s ease, box-shadow 0.12s ease, background 0.12s ease; }
.cal-cell[data-day-key]:hover { border-color: var(--text-dim); }
.cal-cell.today { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.cal-cell.today .daynum { color: var(--accent-ink); }
.cal-cell.selected { border-color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-ink); }
.cal-cell.selected .daynum { color: var(--accent-ink); }
.cal-order-item {
  background: var(--panel);
  border-radius: 6px;
  padding: 4px 6px;
  margin-bottom: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;


  --dot: var(--gray);
  border-left: 3px solid var(--dot);
  box-shadow: var(--shadow);
  font-weight: 600;
}
.cal-order-item.new { --dot: var(--gray); }
.cal-order-item.in_progress { --dot: var(--accent); }
.cal-order-item.review { --dot: var(--yellow); }
.cal-order-item.revision { --dot: var(--red); }
.cal-order-item.closed { --dot: var(--green); }
.cal-order-item.cancelled, .cal-order-item.client_refusal { --dot: var(--red); opacity: 0.7; text-decoration: line-through; }
.cal-order-item.search-match { outline: 2px solid var(--accent-ink); box-shadow: 0 0 0 2px var(--accent-2, var(--accent-ink)); }
.cal-order-item.search-dim { opacity: 0.3; }
.cal-subtask-item {
  background: var(--panel-2);
  border-radius: 6px;
  padding: 3px 6px;
  margin-bottom: 4px;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  --dot: var(--text-dim);
  border-left: 3px dashed var(--dot);
  color: var(--text-dim);
  font-size: 10.5px;
}
.cal-subtask-item.done { text-decoration: line-through; opacity: 0.6; }










.cal-add-task-btn {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--panel); color: var(--text); font-size: 19px; font-weight: 700;
  font-family: inherit; line-height: 1;
  box-shadow: 0 1px 2px rgba(16,17,20,0.10);
  cursor: pointer; opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease;
  display: flex; align-items: center; justify-content: center; padding: 0 0 2px; z-index: 2;
}
.cal-cell:hover .cal-add-task-btn { opacity: 1; }
.cal-add-task-btn:hover { background: var(--orange-soft); color: var(--orange); }

.cal-task-item {
  font-size: 11px; padding: 2px 6px; border-radius: 6px; margin-bottom: 4px; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-left: 3px solid transparent; box-shadow: var(--shadow);
}
.cal-task-item.cal-priority-low { background: var(--prio-low-bg); --dot: #ffb08a; border-left-color: var(--dot); color: var(--prio-low-ink); }
.cal-task-item.cal-priority-medium { background: var(--prio-med-bg); --dot: #ff6a3d; border-left-color: var(--dot); color: var(--prio-med-ink); }
.cal-task-item.cal-priority-high { background: var(--prio-high-bg); --dot: #c2410c; border-left-color: var(--dot); color: var(--prio-high-ink); font-weight: 600; }
.cal-task-item.done { opacity: .55; text-decoration: line-through; }




.cal-task-item.cal-task-out { background: var(--dir-out-bg); --dot: #2f6feb; border-left-color: var(--dot); color: var(--dir-out-ink); }
.cal-task-item.cal-task-in { background: var(--dir-in-bg); --dot: #12805a; border-left-color: var(--dot); color: var(--dir-in-ink); }
.cal-day-task.cal-task-out { background: var(--dir-out-bg); border-left-color: #2f6feb; color: var(--dir-out-ink); }
.cal-day-task.cal-task-in { background: var(--dir-in-bg); border-left-color: #12805a; color: var(--dir-in-ink); }

.cal-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.cal-legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); }
.cal-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--gray); }
.cal-legend-dot.new { background: var(--gray); }
.cal-legend-dot.in_progress { background: var(--accent); }
.cal-legend-dot.review { background: var(--yellow); }
.cal-legend-dot.revision { background: var(--red); }
.cal-legend-dot.closed { background: var(--green); }
.cal-legend-dot.cancelled, .cal-legend-dot.client_refusal { background: var(--red); }
.cal-legend-dot.subtask { background: none; border: 2px dashed var(--text-dim); }
.cal-legend-dot.task-low { background: #ffb08a; margin-right: -4px; }
.cal-legend-dot.task-medium { background: var(--orange); margin-right: -4px; }
.cal-legend-dot.task-high { background: #c2410c; }




.cal-order-popover {
  position: fixed;
  z-index: 500;
  width: 300px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--canvas-shadow);
  padding: 14px 16px;
  font-size: 13px;
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition: opacity 0.14s ease, transform 0.14s ease;
  pointer-events: auto;
}
.cal-order-popover.visible { opacity: 1; transform: translateY(0) scale(1); }
.cal-order-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-order-popover-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--text);
}
.cal-order-popover-badge.new { background: var(--gray-soft); color: var(--gray); }
.cal-order-popover-badge.in_progress { background: var(--accent-soft); color: var(--accent-ink); }
.cal-order-popover-badge.review { background: var(--yellow-soft); color: var(--yellow); }
.cal-order-popover-badge.revision { background: var(--red-soft); color: var(--red); }
.cal-order-popover-badge.closed { background: var(--green-soft); color: var(--green); }
.cal-order-popover-badge.cancelled, .cal-order-popover-badge.client_refusal { background: var(--red-soft); color: var(--red); }
.cal-order-popover-num { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.cal-order-popover-title { font-weight: 700; font-size: 14px; line-height: 1.35; margin-bottom: 10px; color: var(--text); }
.cal-order-popover-body { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.cal-order-popover-row { display: flex; justify-content: space-between; gap: 10px; }
.cal-order-popover-label { color: var(--text-dim); }
.cal-order-popover-row span:last-child { font-weight: 600; text-align: right; }
.cal-order-popover-note {
  background: var(--pastel-yellow-bg, var(--yellow-soft));
  color: var(--pastel-yellow-text, var(--yellow));
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 10px;
  word-break: break-word;
}
.cal-order-popover-btn { width: 100%; justify-content: center; }




.cal-day-orders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 4px;
}
.cal-order-daycard {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  font-size: 13px;
  transition: box-shadow 0.12s ease, border-color 0.12s ease;
}
.cal-order-daycard:hover { border-color: var(--text-dim); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.search-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.search-result-row:last-child { border-bottom: none; }
.search-result-row:hover { background: var(--panel-2); }
.search-result-num { font-weight: 700; flex-shrink: 0; }


.search-result-row.done .search-result-title { text-decoration: line-through; opacity: .6; }






@keyframes calFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(10, 132, 255, 0); }
  15%, 70% { box-shadow: 0 0 0 3px rgba(10, 132, 255, .55); }
}
.cal-flash {
  animation: calFlash 2.4s ease-in-out;
  border-radius: 8px;
  position: relative;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {

  .cal-flash { animation: none; box-shadow: 0 0 0 3px rgba(10, 132, 255, .55); }
}
.search-result-title { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-result-date { color: var(--text-dim); font-size: 12px; flex-shrink: 0; }

.empty-state { color: var(--text-dim); text-align: center; padding: 44px 0; font-size: 13px; }
.token-hint { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.55; }
#vk_allow_messages_group { margin-top: 4px; }
.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.filters select, .filters input { width: auto; min-width: 170px; }

.mock-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--orange-soft);
  color: var(--orange);
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 6px;
}










#login-screen {


  min-height: 100vh;
  min-height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  position: relative;
  overflow-x: hidden; overflow-y: auto;
  display: flex;
  background: var(--v-bg);
  font-family: var(--v-font);
  color: var(--v-text);
}
.login-card {
  width: min(440px, 100%);
  padding: 24px 26px;
  border-radius: 28px;
  background: var(--v-card);
  box-shadow: var(--v-lift-shadow);
  text-align: left;
  position: relative;
}


.login-card.lg-solo { margin: auto; width: min(460px, 100%); }


#login-screen:has(> .lg-solo) { padding: 24px 14px; }
.login-card.subjects-setup-card { width: min(560px, 100%); }
#login-screen .lg-solo .btn { margin-top: 14px; }
#login-screen .lg-solo .btn + .btn { margin-top: 8px; }
#login-screen .subject-picker input.sp-search:not([type="checkbox"]):not([type="radio"]) { margin: 12px 0 10px; }
#login-screen .sp-similar-box { margin-bottom: 12px; }
#login-screen .brand-mark { width: 36px; height: 36px; border-radius: 11px; font-size: 17px; flex: none; }
#login-screen label { display: block; font: 700 12.5px var(--v-font); color: var(--v-text2); margin: 0 0 7px; }
#login-screen label:not(.lg-switch) > span { font-weight: 500; color: var(--v-muted); white-space: nowrap; }


#login-screen input:not([type="checkbox"]):not([type="radio"]), #login-screen textarea {
  width: 100%; height: 52px; padding: 0 16px; margin: 0 0 12px;
  border: 0; border-radius: 15px; background: var(--v-soft);
  font: 500 15px var(--v-font); color: var(--v-strong); outline: none;
  transition: background-color .2s, box-shadow .2s;
}
#login-screen textarea { height: auto; min-height: 84px; padding: 14px 16px; line-height: 1.4; resize: none; }
#login-screen input::placeholder, #login-screen textarea::placeholder { color: var(--v-muted); }
#login-screen input:not([type="checkbox"]):not([type="radio"]):focus, #login-screen textarea:focus { background: var(--v-card); box-shadow: 0 0 0 2px var(--v-accent); }
#login-screen .btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; height: 52px; padding: 0 18px; border: 0; border-radius: 15px;
  background: var(--v-ink); color: var(--v-on-ink);
  font: 700 15px var(--v-font); cursor: pointer; text-decoration: none; box-shadow: none;
  transition: transform .12s, filter .2s, background-color .2s;
}
#login-screen .btn:hover { filter: brightness(1.12); }
#login-screen .btn:active { transform: scale(.985); }
#login-screen .btn + .btn { margin-top: 8px; }
#login-screen .btn.secondary { background: var(--v-soft); color: var(--v-strong); }
#login-screen .btn.secondary:hover { background: var(--v-hover); filter: none; }
.login-divider { display: flex; align-items: center; gap: 12px; font: 600 12px var(--v-font); color: var(--v-muted); margin: 14px 0; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: var(--v-ring); }
.yandex-btn { text-align: center; }


.login-error { color: var(--red); font-size: 12.5px; margin-top: 14px; text-align: center; min-height: 14px; }

#login-screen .login-error { min-height: 0; margin: 12px 0 0; padding: 11px 13px; border-radius: 13px; background: var(--v-r-soft); color: var(--v-r-text); font: 600 13px/1.45 var(--v-font); text-align: left; }
#login-screen .login-error:empty { display: none; }

#login-screen .lg-err-slot .login-error { margin: 0 0 12px; }
#login-screen .ls-cells + input + .lg-err-slot .login-error { margin-top: 12px; }
#login-screen .login-error.is-wait { background: var(--v-a-soft); color: var(--v-a-text); }
.login-register-hint { text-align: center; font: 500 13px var(--v-font); color: var(--v-muted); margin-top: 16px; }
.login-register-hint a { color: var(--v-strong); text-decoration: none; font-weight: 700; }
.login-register-hint a:hover { text-decoration: underline; }
#login-screen .token-hint { font-size: 13px; line-height: 1.5; color: var(--v-muted); }


.lg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lg-head-t { font: 800 18px var(--v-display); color: var(--v-strong); }
.lg-head-s { font-size: 13px; color: var(--v-muted); margin-top: 1px; }
.lg-tile { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 14px; }
.lg-tile svg { width: 26px; height: 26px; }
.lg-tile-vk { background: var(--v-b-soft); color: #0077FF; }
.lg-tile-ok { background: var(--v-g-soft); color: var(--v-g-text); }
.lg-tile-warn { background: var(--v-a-soft); color: var(--v-a-text); }
.lg-tile-err { background: var(--v-r-soft); color: var(--v-r-text); }
.lg-tile-o { background: var(--v-o-soft); color: var(--v-accent); }
.lg-h3 { font: 800 20px/1.2 var(--v-display); letter-spacing: -.01em; color: var(--v-strong); margin: 0 0 8px; }
.lg-hint { font-size: 13.5px; line-height: 1.5; color: var(--v-muted); margin: 0 0 16px; }
.lg-hint b { color: var(--v-strong); }
.lg-block { margin: 6px 0 16px; padding-top: 16px; border-top: 1px solid var(--v-ring); }
.lg-note { margin: 0 0 14px; padding: 11px 13px; border-radius: 13px; font: 600 13px/1.45 var(--v-font); }
.lg-note.is-ok { background: var(--v-g-soft); color: var(--v-g-text); }

#login-screen .lg-switch { display: flex; align-items: center; gap: 12px; padding: 13px 14px; margin: 2px 0 14px; border-radius: 15px; background: var(--v-soft); font: 600 13.5px var(--v-font); color: var(--v-strong); cursor: pointer; }
#login-screen .lg-switch > span { flex: 1; min-width: 0; }
#login-screen .lg-switch small { display: block; font-size: 12px; font-weight: 500; color: var(--v-muted); margin-top: 1px; }
.lg-switch input { position: absolute; opacity: 0; pointer-events: none; }
.lg-switch i { margin-left: auto; width: 42px; height: 24px; border-radius: 12px; background: var(--v-bar2); position: relative; flex: none; transition: background-color .2s; }
.lg-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--v-spring); }
.lg-switch input:checked + i { background: var(--v-accent); }
.lg-switch input:checked + i::after { transform: translateX(18px); }
.lg-switch input:focus-visible + i { box-shadow: 0 0 0 2px var(--v-card), 0 0 0 4px var(--v-accent); }

#login-screen .vk-link { align-items: stretch; margin: 0 0 12px; }
#login-screen .vk-link .btn { height: auto; min-height: 52px; padding: 10px 16px; line-height: 1.25; text-align: center; }
#login-screen .vk-link-wait { display: block; position: relative; margin-left: 0; padding-left: 16px; overflow-wrap: anywhere; }
#login-screen .vk-link-wait .vk-link-dot { position: absolute; left: 0; top: .5em; margin: 0; }
#login-screen .vk-required-out { min-height: 40px; }
@media (max-width: 480px) {

  #login-screen .vk-link [data-vk-link-start] svg { display: none; }
}
#login-screen .vk-link .vk-link-open { margin-left: 0; background: #0077FF; color: #fff; }
#login-screen .vk-link-code { margin-left: 0; width: 100%; justify-content: center; }
#login-screen .vk-link-alt { margin: 4px 0 10px; }



.sidebar-footer .who { flex: 1; min-width: 0; }
.sidebar-footer .who-name, .sidebar-footer .who-sub {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


.bell-btn {
  margin-left: auto;
  background: var(--panel-2);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  position: relative;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.bell-btn:hover { background: var(--border); }


.theme-btn + .bell-btn { margin-left: 0; }
.theme-btn { color: var(--text-dim); }
.theme-btn:hover { color: var(--text); }
.theme-btn svg { width: 16px; height: 16px; }




.bell-btn.bell-ring { animation: bellPulse .6s ease; }
.bell-btn.bell-ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(220, 38, 38, .35);
  animation: bellRingWave .6s ease-out;
  pointer-events: none;
  z-index: 0;
}
.bell-icon, .notif-badge { position: relative; z-index: 1; }
@keyframes bellPulse {
  0%, 100% { transform: scale(1) rotate(0); }
  20% { transform: scale(1.18) rotate(-10deg); }
  40% { transform: scale(1.08) rotate(8deg); }
  60% { transform: scale(1.14) rotate(-6deg); }
  80% { transform: scale(1.04) rotate(3deg); }
}
@keyframes bellRingWave {
  0% { opacity: .55; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}
@media (prefers-reduced-motion: reduce) {
  .bell-btn.bell-ring { animation: none; }
  .bell-btn.bell-ring::before { animation: none; display: none; }
}
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 20px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  z-index: 2;
}

.nav-badge {
  position: static;
  margin-left: auto;
  flex-shrink: 0;
}
.notif-panel {
  position: fixed;
  top: 78px;
  left: 34px;
  width: 340px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16,17,20,0.2);
  z-index: 60;
  padding: 0;
  animation: notifPanelIn .18s cubic-bezier(.22, 1, .36, 1);
}
@keyframes notifPanelIn {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.notif-panel-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px 8px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}
.notif-panel-title { font-size: 12.5px; font-weight: 700; color: var(--text); }
.notif-mark-all-btn {
  border: none; background: none; color: var(--accent-ink); font-size: 12px; font-weight: 600;
  cursor: pointer; padding: 2px 0; white-space: nowrap;
  transition: opacity .25s ease, transform .25s ease, max-width .25s ease;
  opacity: 1; transform: scale(1);
}
.notif-mark-all-btn:hover { text-decoration: underline; }
.notif-mark-all-btn:disabled { cursor: default; opacity: .6; text-decoration: none; }
.notif-mark-all-btn.is-hidden { opacity: 0; transform: scale(.85); pointer-events: none; max-width: 0; }
.notif-list { padding: 8px 10px 10px; }
.notif-item {
  padding: 10px;
  border-radius: 10px;
  font-size: 12.5px;
  margin-bottom: 4px;



  cursor: default;
  transition: background .35s ease;
}
.notif-item:hover { background: var(--panel-2); }
.notif-item.unread { background: var(--orange-soft); }
.notif-item .notif-time { color: var(--text-dim); font-size: 10.5px; margin-top: 3px; }


.badge.new { background: var(--gray-soft); color: var(--gray); }
.badge.pool-badge { background: var(--accent-soft); color: var(--accent-ink); font-size: 10.5px; vertical-align: middle; }
.badge.in_progress { background: var(--accent-soft); color: var(--text); }
.badge.review { background: var(--yellow-soft); color: var(--yellow); }
.badge.revision { background: var(--red-soft); color: var(--red); }
.badge.closed { background: var(--green-soft); color: var(--green); }
.badge.cancelled, .badge.client_refusal { background: var(--red-soft); color: var(--red); }

.tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-right: 4px;
  background: var(--orange-soft);
  color: var(--orange);
}
.tag.priority_client { background: var(--tint-vip-bg); color: var(--tint-vip-text); }
.tag.repeat_client { background: var(--tint-repeat-bg); color: var(--tint-repeat-text); }

.deadline-flag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  margin-left: 6px;
}



.deadline-flag.soon {
  background: var(--yellow-soft);
  color: var(--yellow);
}


.order-cards-grid { display: flex; flex-direction: column; gap: 14px; }
.order-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  cursor: pointer;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.order-card:hover { border-color: var(--text-dim); box-shadow: 0 4px 16px rgba(0,0,0,0.05); }
.order-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.order-pill { font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 20px; }
.order-card-date { color: var(--text-dim); font-size: 13px; }
.order-card-number { margin-left: auto; color: var(--text-dim); font-size: 13px; font-weight: 600; }
.order-card-title-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.order-card-title { font-weight: 700; font-size: 16px; line-height: 1.4; }
.order-card-price { font-weight: 700; font-size: 16px; white-space: nowrap; flex-shrink: 0; }



.order-card-price-none { font-size: 12.5px; font-weight: 500; color: var(--text-dim); }
.order-card-sub { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.order-card-meta { display: flex; align-items: center; gap: 16px; margin-top: 14px; font-size: 13px; color: var(--text-dim); }
.order-card-due.danger { color: var(--red); font-weight: 700; }
.order-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.order-card-person { display: flex; align-items: center; gap: 10px; }
.avatar-sm {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: var(--panel-2); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: var(--text); flex-shrink: 0;
}
.avatar-sm-dot {
  position: absolute; bottom: -1px; right: -1px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--green); border: 2px solid var(--panel);
}
.order-card-person-name { font-weight: 600; font-size: 13.5px; }
.order-card-tags { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }


.badge.payout-status.pending_manager { background: var(--gray-soft); color: var(--gray); }
.badge.payout-status.pending_admin { background: var(--yellow-soft); color: var(--yellow); }
.badge.payout-status.rejected { background: var(--red-soft); color: var(--red); }
.badge.payout-status.paid { background: var(--green-soft); color: var(--green); }

.payout-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.payout-row:last-child { border-bottom: none; }
.payout-checkbox { margin-top: 6px; width: 16px; height: 16px; flex-shrink: 0; }
.payout-row-main { flex: 1; min-width: 0; }
.payout-row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.payout-order-link { font-weight: 600; color: var(--text); cursor: pointer; text-decoration: none; }
.payout-order-link:hover { text-decoration: underline; }

.payout-file-link {
  width: auto; background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent-ink); font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.payout-file-link:hover { text-decoration: underline; }
.payout-row-sub { margin-top: 4px; font-size: 13.5px; color: var(--text-dim); }
.payout-row-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
@media (max-width: 640px) {
  .payout-row { flex-wrap: wrap; }
  .payout-row-actions { flex-direction: row; width: 100%; }
}


.kb-root-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.kb-root-tab {
  padding: 7px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
  background: var(--panel-2); color: var(--text-dim); cursor: pointer;
}
.kb-root-tab.active { background: var(--accent); color: #fff; }
.kb-breadcrumbs { font-size: 12.5px; color: var(--text-dim); }
.kb-breadcrumbs a { color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; }
.kb-breadcrumbs a:hover { text-decoration: underline; }
.kb-breadcrumbs .sep { margin: 0 6px; color: var(--border); }

.kb-file-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 10px;
  border-bottom: 1px solid var(--border); border-radius: 10px; cursor: pointer;
}
.kb-file-row:last-child { border-bottom: none; }
.kb-file-row:hover { background: var(--panel-2); }
.kb-file-icon { font-size: 20px; flex-shrink: 0; }
.kb-file-main { flex: 1; min-width: 0; }
.kb-file-name { font-weight: 600; font-size: 14px; word-break: break-word; }
.kb-file-meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.kb-file-actions { display: flex; gap: 6px; flex-shrink: 0; }








.kb-file-new {
  margin-left: 8px;
  background: var(--orange); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: .02em;
  border-radius: 999px; padding: 2px 7px; vertical-align: 1px;
  white-space: nowrap;
}
.kb-file-author { display: inline-flex; align-items: center; gap: 5px; }

.kb-author-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--panel-2); color: var(--text-dim);
  font-size: 8.5px; font-weight: 700; letter-spacing: 0;
}
.kb-to-shared {
  width: auto; padding: 0 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  transition: transform .12s ease, opacity .15s ease;
}
.kb-to-shared:active { transform: scale(.94); }
.kb-to-shared:disabled { opacity: .5; cursor: default; }
.kb-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700;
}


.kb-root-tab.active .kb-tab-count { background: rgba(255, 255, 255, .28); }
.kb-file-actions button, .kb-file-actions .kb-file-download {
  border: none; background: var(--panel-2); border-radius: 8px; width: 30px; height: 30px;
  cursor: pointer; font-size: 14px;
}

.kb-file-actions .kb-file-download { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; color: inherit; }


@media (max-width: 600px) {
  .kb-file-row { flex-wrap: wrap; row-gap: 8px; }
  .kb-file-main { flex: 1 1 calc(100% - 44px); }
  .kb-file-actions { width: 100%; padding-left: 32px; flex-wrap: wrap; }
}
.kb-file-actions button:hover, .kb-file-actions .kb-file-download:hover { background: var(--border); }

#kb-file-list.kb-drop-active {
  outline: 2px dashed var(--accent-ink);
  outline-offset: -4px;
  background: var(--accent-soft);
  border-radius: 12px;
  transition: background 0.15s ease;
}






.kb-file-row-pending { opacity: .85; }
.kb-file-row-pending .kb-file-name { color: var(--text); text-decoration: none; cursor: pointer; }

.kb-pending-spinner {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--border); border-top-color: var(--accent-ink);
  vertical-align: -1px; margin-right: 2px; animation: kbPendingSpin .7s linear infinite;
}
@keyframes kbPendingSpin { to { transform: rotate(360deg); } }
.kb-pending-failed { color: var(--red); }
@media (prefers-reduced-motion: reduce) {
  .kb-pending-spinner { animation: none; }
}


.review-card {
  padding: 12px 14px; border-left: 3px solid var(--green); background: var(--panel-2);
  border-radius: 10px; margin-bottom: 10px;
}
.review-card.negative { border-left-color: var(--red); }
.review-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-thumb { font-size: 15px; }
.review-card-text { margin-top: 6px; font-size: 13.5px; line-height: 1.5; }


.order-breadcrumbs { font-size: 12.5px; color: var(--text-dim); margin-bottom: 18px; }
.order-breadcrumbs a { color: var(--text); text-decoration: none; font-weight: 600; cursor: pointer; }
.order-breadcrumbs a:hover { text-decoration: underline; }
.order-breadcrumbs .sep { margin: 0 6px; color: var(--border); }

.order-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.order-header-row h2 { margin: 0; font-size: 24px; font-weight: 800; }
.badge-lg { font-size: 13px; padding: 8px 16px; font-weight: 700; }

.order-profile-row { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.order-profile-row .avatar-lg-wrap { margin: 0; }
.order-profile-name { font-weight: 700; font-size: 14.5px; }
.order-profile-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 2px; }
.order-profile-sub.online { color: var(--green); font-weight: 600; }

.order-info-section { padding-top: 16px; padding-bottom: 16px; }
.order-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.order-info-col { display: flex; flex-direction: column; }
.order-info-cell {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  font-size: 13.5px;
}
.order-info-cell:nth-child(odd) { background: var(--panel-2); border-radius: 12px; }
.order-info-icon { font-size: 15px; width: 20px; text-align: center; flex-shrink: 0; color: var(--text-dim); }
.order-info-label { color: var(--text-dim); width: 130px; flex-shrink: 0; }
.order-info-value { font-weight: 700; }
.order-info-value.danger { color: var(--red); }
.order-info-value.muted { font-weight: 500; color: var(--text-dim); }
.order-info-value button { width: auto; background: none; border: none; padding: 0; margin-left: 6px; cursor: pointer; color: var(--text-dim); font-size: 12px; }



.order-actions-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.order-actions-row .btn { flex: 0 0 auto; }
.btn-success { background: var(--green); color: #fff; }
.btn-success:hover { opacity: 0.88; }
.btn-info { background: #2f80ed; color: #fff; }
.btn-info:hover { opacity: 0.88; }
.btn-warn { background: var(--yellow); color: #fff; }
.btn-warn:hover { opacity: 0.88; }
.more-actions-toggle { position: relative; flex: 0 0 auto; }
.more-actions-panel {
  display: none;
  position: absolute; top: calc(100% + 6px); left: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.18);
  padding: 8px; min-width: 220px; max-width: calc(100vw - 24px); z-index: 20;
  animation: more-actions-in 0.14s ease;
}
.more-actions-panel.open { display: flex; flex-direction: column; gap: 4px; }
.more-actions-panel button { text-align: left; justify-content: flex-start; width: 100%; }
@keyframes more-actions-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}




.order-header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }




.file-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.file-columns .section { margin-bottom: 0; min-width: 0; }
.file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--panel-2); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px;
}
.file-row.deliverable { background: var(--green-soft); }
.file-row-main { display: flex; align-items: flex-start; gap: 10px; min-width: 0; flex: 1; }
.file-row-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }


.file-row-info { min-width: 0; flex: 1; overflow: hidden; }
.file-row-name {
  font-weight: 700; font-size: 13px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; overflow-wrap: break-word; word-break: break-word;
}
.file-row-meta { color: var(--text-dim); font-size: 11px; margin-top: 4px; }
.file-row-actions { display: flex; gap: 4px; flex-shrink: 0; }
.file-row-actions button { width: 26px; height: 26px; background: none; border: none; cursor: pointer; color: var(--text-dim); font-size: 13px; border-radius: 7px; }
.file-row-actions button:hover { background: var(--border); color: var(--text); }
.file-row-actions button:disabled { opacity: .5; cursor: default; }

.file-row-actions button[data-download] { color: var(--text); }
.file-row-actions button[data-download]:hover { background: var(--accent-soft); }
@media (max-width: 640px) {

  .file-row-actions { gap: 6px; }
  .file-row-actions button { width: 34px; height: 34px; font-size: 15px; }
}


.order-chat-box { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.order-chat-messages {
  max-height: 380px; min-height: 160px; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; background: var(--panel);
}
.order-chat-composer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--border); position: relative;
}
.order-chat-composer textarea {
  resize: none; max-height: 120px; min-height: 38px; flex: 1 1 0%; min-width: 0;
  overflow-y: auto; line-height: 1.4;
}
@media (max-width: 480px) {
  .order-chat-composer { padding: 10px 8px; gap: 4px; }
}





[data-tooltip] { position: relative; }
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 8px; white-space: nowrap; max-width: 240px;
  opacity: 0; pointer-events: none; transition: opacity .15s ease, transform .15s ease;
  z-index: 40; box-shadow: var(--shadow);
}
[data-tooltip="Показывает, сколько токенов (единиц текста) потрачено на запросы и получено в ответах от нейросети сегодня. Обновляется после каждого сообщения."]::after {
  white-space: normal; width: 220px;
}
[data-tooltip]:hover::after, [data-tooltip]:focus-visible::after {
  opacity: 1; transform: translate(-50%, 0);
}







.ai-page-v2 {
  display: flex; gap: 18px; align-items: stretch;
  height: calc(100vh - 110px);
  height: calc(100dvh - 110px);
  min-height: 480px;
}
.ai-sidebar-toggle { display: none; }

.ai-sidebar {
  width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow); max-height: 78vh;
}
.ai-new-chat-btn {
  position: relative; overflow: hidden; border: none; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600;
  padding: 11px 14px; cursor: pointer; text-align: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.ai-new-chat-btn::before {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(115deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  transform: skewX(-20deg); transition: transform .5s ease;
}
.ai-new-chat-btn:hover { transform: translateY(-1px) scale(1.015); box-shadow: 0 8px 20px -6px rgba(22,24,29,.4); }
.ai-new-chat-btn:hover::before { transform: translateX(420%) skewX(-20deg); }
.ai-new-chat-btn:active { transform: scale(.97); }

.ai-sidebar-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.ai-sidebar-empty { color: var(--text-dim); font-size: 12.5px; padding: 14px 6px; text-align: center; }

.ai-chat-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px;
  cursor: pointer; border-left: 3px solid transparent; position: relative;
  animation: aiChatItemIn .3s ease both;
}
@keyframes aiChatItemIn {
  from { opacity: 0; transform: translateX(-6px); }
  to { opacity: 1; transform: translateX(0); }
}
.ai-chat-item:hover { background: var(--panel-2); }
.ai-chat-item.active { background: var(--accent-soft); border-left-color: var(--accent-ink); }
.ai-chat-item.active .ai-chat-item-main::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); margin-right: 6px; vertical-align: middle;
  animation: aiLivePulse 1.8s ease-in-out infinite;
}
.ai-chat-item-main { flex: 1; min-width: 0; }
.ai-chat-item-title { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-chat-item-time { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.ai-chat-item-del {
  flex-shrink: 0; border: none; background: transparent; cursor: pointer; font-size: 13px;
  padding: 4px 6px; border-radius: 6px; opacity: 0; transition: opacity .15s ease, background .15s ease;
}
.ai-chat-item:hover .ai-chat-item-del { opacity: 1; }
.ai-chat-item-del:hover { background: var(--red-soft); }
@keyframes aiLivePulse {
  0%, 100% { opacity: 1; } 50% { opacity: .35; }
}

.ai-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.ai-main-topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-shrink: 0; }






.ai-main-body { flex: 1; position: relative; display: flex; min-height: 0; min-width: 0; overflow: hidden; }


.ai-empty-state {
  position: relative; flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 16px; padding: 24px;
}
.ai-blobs { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ai-blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .3;
  animation: aiBlobFloat 20s ease-in-out infinite alternate;
}
.ai-blob-1 { width: 260px; height: 260px; background: var(--pastel-blue-bg); top: 4%; left: 8%; animation-duration: 18s; }
.ai-blob-2 { width: 220px; height: 220px; background: var(--pastel-purple-bg); bottom: 6%; right: 10%; animation-duration: 23s; animation-delay: -4s; }
.ai-blob-3 { width: 200px; height: 200px; background: var(--pastel-green-bg); bottom: 20%; left: 30%; animation-duration: 26s; animation-delay: -9s; }
@keyframes aiBlobFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(24px, -18px) scale(1.12); }
}
.ai-empty-inner { position: relative; z-index: 1; width: 100%; max-width: 560px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ai-empty-title { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); margin: 0; }
.ai-empty-inner .ai-input-card { width: 100%; }


.ai-conversation { flex: 1; display: flex; flex-direction: column; min-height: 0; min-width: 0; gap: 12px; }




.ai-chat-list {
  flex: 1; min-height: 0; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
}
.ai-bubble {
  max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.5;
  animation: aiBubbleIn .2s ease;
  overflow-wrap: anywhere; word-break: break-word;
}
@keyframes aiBubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-bubble-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-bubble-assistant { align-self: flex-start; background: var(--panel-2); color: var(--text); border-bottom-left-radius: 4px; }
.ai-bubble-error { align-self: flex-start; background: var(--red-soft); color: var(--red); }
.ai-typing { display: flex; align-items: center; gap: 4px; padding: 12px 16px; }
.ai-typing span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim);
  animation: aiTypingDot 1.2s ease-in-out infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiTypingDot {
  0%, 60%, 100% { opacity: .3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
.ai-input-pinned { width: 100%; flex-shrink: 0; }
.ai-help-loading { padding: 14px 0; color: var(--text-dim); font-size: 13px; }


.ai-input-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 12px 14px 10px;
}
.ai-input-textarea {
  width: 100%; border: none; background: transparent; resize: none; outline: none;
  font-family: inherit; font-size: 14px; line-height: 1.4; color: var(--text);
  min-height: 24px; max-height: 140px; overflow-y: auto; padding: 4px 4px 8px;
}
.ai-input-textarea::placeholder { color: var(--text-dim); }




.ai-input-row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; row-gap: 8px; }
.ai-input-cluster { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ai-icon-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--panel-2);
  color: var(--text); font-size: 14px; cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: background .15s ease, transform .15s ease;
}
.ai-icon-btn:hover:not(:disabled) { background: var(--accent-soft); transform: translateY(-1px); }
.ai-icon-btn-disabled, .ai-icon-btn:disabled { cursor: not-allowed; opacity: .45; }
.ai-model-badge {
  font-size: 11.5px; font-weight: 600; color: var(--text-dim); background: var(--panel-2);
  border-radius: 999px; padding: 6px 11px; white-space: nowrap; max-width: 160px;
  overflow: hidden; text-overflow: ellipsis;
}
.ai-send-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: var(--accent);
  color: #fff; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; flex-shrink: 0; position: relative;
  transition: transform .15s ease;
}


.ai-send-btn::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(22,24,29,.08);
  opacity: 0; pointer-events: none;
  animation: aiSendPulse 3.2s ease-in-out infinite;
}
.ai-send-btn.busy::before { animation: none; }
.ai-send-btn:hover:not(:disabled) { transform: scale(1.06); }
.ai-send-btn:disabled { cursor: default; }
.ai-send-icon { display: inline-block; transition: transform .25s cubic-bezier(.22,1,.36,1); }
.ai-send-btn.ai-send-launch .ai-send-icon { transform: rotate(-90deg) scale(1.25); }
.ai-send-btn.busy::after {
  content: ''; position: absolute; inset: 8px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: aiSpin .7s linear infinite;
}
@keyframes aiSendPulse {
  0%, 100% { opacity: 0; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes aiSpin { to { transform: rotate(360deg); } }


.ai-usage-row {
  display: flex; align-items: center; gap: 10px; justify-content: center; flex-wrap: wrap;
  font-size: 11.5px; color: var(--text-dim); padding: 4px 6px 0;
}
.ai-usage-val { white-space: nowrap; }
.ai-usage-val b { color: var(--text); font-weight: 700; }
.ai-usage-divider { flex: 1 1 60px; max-width: 90px; border-top: 1px dashed var(--border); }
.ai-usage-info {
  width: 15px; height: 15px; border-radius: 50%; background: var(--panel-2); color: var(--text-dim);
  font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  cursor: help; flex-shrink: 0;
}

@media (max-width: 900px) {






  .ai-page-v2 {
    flex-direction: column;
    height: calc(100vh - 130px);
    height: calc(100dvh - 130px);
    min-height: 420px;
  }
  .ai-sidebar-toggle {
    display: inline-flex; align-self: flex-start; border: 1px solid var(--border);
    background: var(--panel); border-radius: 10px; padding: 7px 12px; font-size: 12.5px;
    font-weight: 600; color: var(--text); cursor: pointer;
  }
  .ai-sidebar {
    width: 100%; max-height: 0; padding: 0 14px; border-width: 0; box-shadow: none;
    overflow: hidden; opacity: 0; transition: max-height .25s ease, padding .25s ease, opacity .2s ease;
  }
  .ai-sidebar.ai-sidebar-open { max-height: 320px; padding: 14px; border-width: 1px; box-shadow: var(--shadow); opacity: 1; }
}
@media (max-width: 480px) {
  .ai-bubble { max-width: 88%; }
  .ai-empty-title { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-chat-item, .ai-bubble, .ai-blob, .ai-send-btn, .ai-chat-item.active .ai-chat-item-main::before,
  .ai-new-chat-btn::before, .ai-send-icon, .ai-send-btn.busy::after, .ai-send-btn::before {
    animation: none !important;
  }
  [data-tooltip]::after { transition: none; }
}

.collapsible-toggle { color: #2f80ed; font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: none; }
.collapsible-toggle:hover { text-decoration: underline; }

.desc-view { font-size: 13.5px; line-height: 1.6; }
.desc-view h3 { font-size: 15px; }
.desc-view ul, .desc-view ol { padding-left: 20px; }



.desc-view h4, .richtext-body h4 { font-size: 13.5px; font-weight: 700; margin: 14px 0 6px; }
.desc-view h4:first-child, .richtext-body h4:first-child { margin-top: 0; }
.desc-view p, .richtext-body p { margin: 0 0 8px; }
.richtext-body ul, .richtext-body ol { padding-left: 20px; margin: 0 0 8px; }
.desc-view li, .richtext-body li { margin-bottom: 3px; }






.ai-format-preview {
  margin-top: 10px;
  border-radius: 10px;
  max-height: 360px;
}
.ai-format-warning { color: var(--red); font-weight: 600; }
.ai-format-ok { color: var(--green); font-weight: 600; }

.history-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.history-item:last-child { border-bottom: none; }
.history-item .history-time { color: var(--text-dim); font-size: 11px; }










.checklist-item {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 3px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 8px;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: var(--panel-2); }
.checklist-item input[type="checkbox"] {
  width: 19px; height: 19px; margin-top: 1px;
  cursor: pointer; accent-color: var(--accent-ink); flex-shrink: 0;
}
.checklist-item input[type="checkbox"]:disabled { cursor: default; }
.checklist-title { line-height: 1.45; overflow-wrap: anywhere; word-break: break-word; }
.checklist-due {
  font-size: 11.5px; color: var(--text-dim); white-space: nowrap;
  padding-top: 2px; text-align: right;
}
.checklist-due.danger { color: var(--red); font-weight: 700; }
.checklist-item.done { color: var(--text-dim); }
.checklist-item.done .checklist-title { text-decoration: line-through; }
.checklist-item.done .checklist-due { text-decoration: line-through; }


@media (max-width: 560px) {
  .checklist-item { grid-template-columns: 20px 1fr; }
  .checklist-due { grid-column: 2; text-align: left; white-space: normal; }
}



.checklist-add-row { justify-content: flex-start; margin-top: 12px; gap: 8px; }
.checklist-add-row input { flex: 1 1 200px; max-width: 320px; }






.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 60;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;



  background: var(--text);
  color: var(--panel);
  padding: 0;
  display: none;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(16,17,20,0.25);
}
.mobile-menu-btn svg { width: 19px; height: 19px; }




.sidebar-backdrop {
  display: block;
  position: fixed; inset: 0;
  background: rgba(16,17,20,0.4);
  z-index: 45;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur-in) ease, visibility 0s linear var(--dur-in);
}
.sidebar-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--dur-in) ease;
}


@media (max-width: 1150px) {
  .side-panel { display: none; }
}


@media (max-width: 980px) {
  .grid-two,
  .order-info-grid,
  .file-columns {
    grid-template-columns: 1fr;
  }
  .order-form-row {
    grid-template-columns: 1fr;
  }
  .order-form-row.cols-3 {
    grid-template-columns: 1fr;
  }
}














@media (min-width: 861px) {
  html, body { height: 100%; overflow: hidden; }
  body { box-sizing: border-box; }
  #app { height: 100%; min-height: 0; }
  main { height: 100%; max-height: none; min-height: 0; }
  .side-panel { height: 100%; max-height: none; }






  .sidebar { height: 100%; min-height: 0; overflow-y: auto; }




}


@media (max-width: 860px) {
  body { padding: 0; }
  #app, #login-screen {
    border-radius: 0;
    min-height: 100vh;
    min-height: 100dvh; /* см. комментарий у #login-screen выше — без этой строки на телефоне
      при открытии клавиатуры (поле E-mail) высота блока не учитывала клавиатуру, страница
      прокручивалась, и снизу карточки входа вылезал серый фон body из-под неё. */
  }
  #app {
    flex-direction: column;
  }
  .mobile-menu-btn { display: flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(16,17,20,0.2);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar .brand { padding-left: 44px; } /* не наезжать на кнопку меню */
  main {
    padding: 70px 16px 24px;
    max-height: none;
  }
  .side-panel {
    display: none;
  }
  .topbar { gap: 10px; }
  .topbar h2 { font-size: 20px; }
}


@media (max-width: 600px) {
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-card { padding: 16px 16px 50px; }
  .stat-card .num { font-size: 24px; }
  .section { padding: 16px; }
  main { padding: 64px 12px 20px; }
  .modal { padding: 18px; }
  .order-header-row { flex-direction: column; align-items: flex-start; }
  .order-header-actions { width: 100%; justify-content: space-between; }


  .order-actions-row { flex-direction: column; align-items: stretch; width: 100%; gap: 8px; }
  .order-actions-row .btn, .order-actions-row .more-actions-toggle { flex: none; width: 100%; }
  .order-actions-row .btn { text-align: center; }
  .more-actions-toggle .btn { display: flex; align-items: center; justify-content: center; }


  .more-actions-panel {
    position: static; width: 100%; min-width: 0; max-width: none;
    box-shadow: none; margin-top: 6px;
  }
  .more-actions-panel button { padding: 10px 14px; }
  .calendar { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cal-cell { padding: 4px; min-height: 60px; }
  .cal-day-head { font-size: 9px; padding: 2px; }
  .cal-post { font-size: 9.5px; }
  table { font-size: 12px; }
  .filters { flex-direction: column; }
  .filters select, .filters input { width: 100%; min-width: 0; }







  #order-search-input, #payouts-search-input, #ocal-search-input {
    flex: 0 1 auto !important;
  }
  .order-info-label { width: 100px; }
}


table { min-width: 480px; }




.chat-layout {
  display: flex;
  height: calc(100vh - 110px);
  height: calc(100dvh - 110px); /* фолбэк на 100vh выше для браузеров без dvh */
  min-height: 420px;
  background: var(--chat-canvas);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;








  --chat-pane-inner-radius: 19px;
}
.chat-list {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;



  background: var(--chat-canvas-side);
}
.chat-list-head {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.chat-list-head h3 { margin: 0; font-size: 15px; font-weight: 800; }


.chat-list-head-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.chat-new-btn {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 16px; flex-shrink: 0;
}
.chat-search { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-search input { padding: 8px 12px; font-size: 12.5px; }




.chat-search-suggest {
  position: absolute;
  left: 14px; right: 14px; top: calc(100% - 4px);
  z-index: 30;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--canvas-shadow);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}
.chat-search-suggest-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--text-dim); padding: 6px 10px 4px;
}
.chat-search-suggest .contact-pick-row { border-radius: 10px; border-bottom: none; }
.chat-search-suggest .contact-pick-row:hover { background: var(--panel-2); }

.chat-type-filter { display: flex; gap: 6px; padding: 0 14px 10px; border-bottom: 1px solid var(--border); }
.chat-type-filter-btn {
  flex: 1; padding: 6px 4px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--panel-2); color: var(--text-dim); font-size: 11.5px; font-weight: 600;
}
.chat-type-filter-btn.active { background: var(--accent); color: #fff; }
.chat-items { flex: 1; overflow-y: auto; }





.chat-item-actions { display: none; }




.chat-head-glyph { display: none; }



.chat-item-pin-mark { display: none; }
.chat-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.chat-item:hover { background: var(--panel-2); }
.chat-item.active { background: var(--panel-2); }
.chat-item-avatar { position: relative; flex-shrink: 0; margin-top: 1px; }
.chat-item-name { font-weight: 700; font-size: 13px; }
.chat-item-preview { color: var(--text-dim); font-size: calc(12px * var(--chat-text-scale)); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }


.chat-item-typing { color: var(--accent-ink); font-weight: 600; font-style: italic; }
.chat-item-meta { margin-left: auto; text-align: right; flex-shrink: 0; }
.chat-item-time { color: var(--text-dim); font-size: 10.5px; }








.chat-item-menu-btn {
  flex-shrink: 0; align-self: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--panel-2); cursor: pointer;
  font-size: 17px; font-weight: 700; line-height: 1; color: var(--text);
  opacity: 0.85;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.chat-item:hover .chat-item-menu-btn { opacity: 1; }
.chat-item-menu-btn:hover { opacity: 1 !important; background: var(--accent); color: #fff; }



.chat-ctx-menu {
  position: fixed;
  z-index: 500;
  width: 240px;
  max-width: calc(100vw - 24px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(16,17,20,0.16);
  padding: 6px;
  opacity: 0;
  transform: translateY(-4px) scale(0.97);
  transition: opacity 0.14s ease, transform 0.14s ease;
}
.chat-ctx-menu.visible { opacity: 1; transform: translateY(0) scale(1); }
.chat-ctx-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: none; background: none; border-radius: 9px;
  font-size: 13px; color: var(--text); text-align: left; cursor: pointer;
  transition: background 0.1s ease;
}
.chat-ctx-menu-item:hover { background: var(--panel-2); }


.chat-ctx-menu-item.danger { color: var(--red); }
.chat-ctx-menu-item.danger:hover { background: var(--red-soft); }
.chat-ctx-menu-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 13px; }
.chat-ctx-menu-arrow { margin-left: auto; color: var(--text-dim); }
.chat-ctx-menu-sub {
  margin-top: 2px; padding-top: 4px; border-top: 1px solid var(--border);
  max-height: 220px; overflow-y: auto;
}
.chat-ctx-menu-item-sub { padding-left: 14px; }






.look-menu { width: 304px; padding: 13px; }
.look-head { margin-bottom: 11px; }
.look-head b { display: block; font-size: 13.5px; font-weight: 700; color: var(--text); }
.look-head span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.look-sub { margin: 0 0 7px; font-size: 12.5px; font-weight: 600; color: var(--text); }
.look-segments + .look-sep { margin-top: 12px; }
.look-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }


.look-segments { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border-radius: 9px; }
.look-segment {
  flex: 1; min-width: 0; padding: 5px 4px; border: none; border-radius: 7px; background: none;
  font: inherit; font-size: 11.5px; color: var(--text-dim); cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.look-segment.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 17, 20, 0.12); }
.look-theme {
  padding: 5px; border: 1.5px solid var(--border); border-radius: 11px;
  background: var(--panel); font: inherit; cursor: pointer;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.look-theme:hover { border-color: var(--text-dim); }
.look-theme.active { border-color: var(--chat-bubble-mine); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.14); }
.look-swatch {
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  height: 42px; padding: 0 6px; border-radius: 7px; border: 1px solid transparent;
}
.look-swatch i { display: block; height: 8px; border-radius: 4px; width: 62%; }
.look-swatch i.mine { width: 46%; align-self: flex-end; background: var(--chat-bubble-mine); }
.look-theme em { display: block; margin-top: 5px; font-style: normal; font-size: 10.5px; color: var(--text-dim); text-align: center; }
.look-theme.active em { color: var(--text); font-weight: 600; }
.look-sep { height: 1px; background: var(--border); margin: 12px 0 10px; }
.look-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.look-row b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.look-sizes { display: flex; align-items: center; gap: 2px; padding: 2px; background: var(--panel-2); border-radius: 9px; }
.look-size {


  width: 32px; height: 26px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 7px; background: none;
  font-family: inherit; line-height: 1; color: var(--text-dim); cursor: pointer;
}
.look-size.active { background: var(--panel); color: var(--text); font-weight: 700; box-shadow: 0 1px 2px rgba(16, 17, 20, 0.12); }

.chat-ctx-menu-empty { padding: 8px 12px; font-size: 12px; color: var(--text-dim); }
.chat-ctx-menu-new-folder { display: flex; gap: 6px; padding: 6px 8px 2px; }
.chat-ctx-menu-new-folder input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; font-size: 12.5px; background: var(--panel-2);
}
.chat-ctx-menu-new-folder button {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; line-height: 1;
}
.chat-ctx-menu-new-folder button:hover { filter: brightness(1.08); }





.dlg-tag-menu { width: 260px; max-height: 340px; overflow-y: auto; }
.dlg-tag-menu-row { display: flex; align-items: center; gap: 2px; }
.dlg-tag-menu-check-btn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  border: none; background: none; cursor: pointer; text-align: left;
  padding: 8px 6px 8px 12px; font-size: 13px; color: var(--text); border-radius: 8px;
}
.dlg-tag-menu-check-btn:hover { background: var(--panel-2); }
.dlg-tag-menu-check { width: 16px; text-align: center; flex-shrink: 0; font-size: 12px; }
.dlg-tag-menu-swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dlg-tag-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.dlg-tag-menu-row-actions { display: flex; gap: 2px; flex-shrink: 0; padding-right: 6px; }
.dlg-tag-menu-icon-btn {
  width: 24px; height: 24px; border-radius: 6px; border: none; background: none;
  cursor: pointer; font-size: 12px; opacity: 0.7;
}
.dlg-tag-menu-icon-btn:hover { opacity: 1; background: var(--panel-2); }
.dlg-tag-menu-new { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 8px 4px; border-top: 1px solid var(--border); margin-top: 2px; }
.dlg-tag-menu-new input {
  flex: 1 1 100%; min-width: 0; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; font-size: 12.5px; background: var(--panel-2);
}
.dlg-tag-color-swatches { display: flex; gap: 5px; flex: 1 1 auto; align-items: center; flex-wrap: wrap; }
.dlg-tag-swatch {
  width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
}
.dlg-tag-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 1px var(--panel); }
.dlg-tag-menu-new button#dlg-tag-new-btn {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; border: none;
  background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; line-height: 1;
}
.dlg-tag-menu-new button#dlg-tag-new-btn:hover { filter: brightness(1.08); }







.dlg-contact-card { width: 340px; max-width: calc(100vw - 24px); padding: 0; background: var(--panel-2); }
.dlg-contact-head { display: flex; align-items: center; gap: 11px; padding: 14px 14px 12px; }
.dlg-contact-avatar {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px; font-weight: 700;

  position: relative; overflow: hidden;
}
.dlg-contact-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.dlg-contact-head-text { flex: 1; min-width: 0; }
.dlg-contact-name {
  font-size: 15px; font-weight: 650; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlg-contact-chan-pill {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 3px;
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px;
}
.dlg-contact-close {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: none; background: var(--panel); color: var(--text-dim); font-size: 12px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.dlg-contact-close:hover { background: var(--border); }

.dlg-contact-section { padding: 0 12px 14px; }
.dlg-contact-section-label {
  font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.02em; margin: 0 0 6px 6px;
}
.dlg-contact-group { background: var(--panel); border-radius: 11px; overflow: hidden; }
.dlg-contact-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; position: relative; }
.dlg-contact-row + .dlg-contact-row::before {
  content: ''; position: absolute; left: 12px; right: 0; top: 0; height: 1px; background: var(--border);
}
.dlg-contact-row.actionable { cursor: pointer; }
.dlg-contact-row.actionable:hover { background: var(--panel-2); }
.dlg-contact-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dlg-contact-row-label { font-size: 13.5px; color: var(--text); flex-shrink: 0; }
.dlg-contact-row-fill { flex: 1; min-width: 0; }
.dlg-contact-row-value {
  font-size: 13.5px; color: var(--text-dim); text-align: right; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px;
}
.dlg-contact-row-value.link { color: var(--dlg-accent); font-weight: 600; }
.dlg-contact-chev { font-size: 13px; color: var(--text-dim); flex-shrink: 0; }
.dlg-contact-tag {
  font-size: 10.5px; font-weight: 600; color: var(--text-dim); background: var(--panel-2);
  padding: 3px 8px; border-radius: 6px; flex-shrink: 0;
}
.dlg-contact-tag.muted { opacity: 0.75; }
.dlg-contact-row-icon {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.dlg-contact-row-icon.muted { background: var(--gray-soft); color: var(--gray); }
.dlg-contact-row-sub { font-size: 11px; color: var(--text-dim); margin-top: 2px; }




.dlg-contact-listing-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; text-decoration: none; }
.dlg-contact-listing-row:hover { background: var(--panel-2); }
.dlg-contact-listing-thumb {
  width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0; overflow: hidden;
  background: var(--green-soft); color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.dlg-contact-listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dlg-contact-listing-info { flex: 1; min-width: 0; }
.dlg-contact-listing-title {
  font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dlg-contact-listing-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }

.dlg-contact-footer-btn {
  display: block; width: calc(100% - 24px); margin: 2px 12px 12px; padding: 11px; text-align: center;
  background: var(--panel); border-radius: 11px; border: none;
  font-size: 13.5px; font-weight: 600; color: var(--dlg-accent); cursor: pointer;
}
.dlg-contact-footer-btn:hover { background: var(--border); }



.chat-folder-chips {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.chat-folder-chip {
  border: none; border-radius: 20px; padding: 5px 11px;
  background: var(--panel-2); color: var(--text-dim);
  font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.chat-folder-chip:hover { background: var(--border); }
.chat-folder-chip.active { background: var(--accent); color: #fff; }
.chat-folder-chip-archive.active { background: var(--text-dim); color: #fff; }




.content-tabs, .content-subtabs {
  padding: 0 0 16px; border-bottom: none;
}
.content-tab-btn { font-size: 13.5px; padding: 8px 16px; }
.content-subtab-btn { font-size: 12.5px; padding: 6px 13px; }
.content-subtabs { padding-bottom: 14px; }



.chat-item.has-unread {
  background: var(--orange-soft);
  border-left-color: var(--orange);
}
.chat-item.has-unread:hover,
.chat-item.has-unread.active {
  background: var(--orange-soft);
  filter: brightness(0.97);
}
.chat-item-preview.unread { color: var(--text); font-weight: 600; }





.chat-item-preview.has-draft { color: var(--text-dim); }
.chat-item-draft { color: var(--accent-ink); font-weight: 600; }
.chat-item-unread-pill {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 6px;
  background: var(--orange); color: #fff;
  font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 3px 9px;
  white-space: nowrap;
}
.chat-item-unread-count {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 6px; margin-left: auto;
  background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 2px 7px; min-width: 20px; height: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }




.chat-to-bottom-btn {
  position: absolute; right: 16px; bottom: 88px; z-index: 5;
  width: 38px; height: 38px; border-radius: 50%; padding: 0;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-dim);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(16, 17, 20, 0.16);



  opacity: 0; visibility: hidden; transform: translateY(6px) scale(.92);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.chat-to-bottom-btn.is-visible {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .16s ease, transform .16s ease, visibility 0s;
}
.chat-to-bottom-btn:hover { color: var(--text); border-color: var(--text-dim); }
.chat-to-bottom-btn:active { transform: scale(.9); }


.chat-to-bottom-host { position: relative; }
@media (prefers-reduced-motion: reduce) {
  .chat-to-bottom-btn,
  .chat-to-bottom-btn.is-visible { transition: none; }
}
.chat-thread-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.chat-thread-name { font-weight: 700; font-size: 14px; }
.chat-thread-sub { font-size: 12px; color: var(--text-dim); }
.chat-thread-sub.online { color: var(--green); font-weight: 600; }




.chat-thread-title-clickable {
  cursor: pointer;
  border-radius: 8px;
  margin: -4px -6px;
  padding: 4px 6px;
  transition: background .15s ease;
}
.chat-thread-title-clickable:hover { background: var(--panel-2); }



.chat-head-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }



.chat-thread-title { display: flex; align-items: center; gap: 12px; }
.chat-thread-title-text { flex: 1; min-width: 0; }



.peer-card-top {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-align: center; padding: 4px 0 14px;
}
.peer-card-name { font-size: 17px; font-weight: 700; }
.peer-card-sub { font-size: 13px; color: var(--text-dim); }
.peer-card-mail { font-size: 12.5px; color: var(--text-dim); word-break: break-all; }
.peer-card-stats {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.peer-card-stat {
  flex: 1; min-width: 76px; text-align: center;
  background: var(--panel-2); border-radius: 10px; padding: 8px 6px;
}
.peer-card-stat b { display: block; font-size: 17px; }
.peer-card-stat span { font-size: 11px; color: var(--text-dim); }
.peer-card-stats-wait { font-size: 12.5px; color: var(--text-dim); }


.peer-card-actions { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }
.peer-card-actions .btn { width: 100%; justify-content: center; }





.chat-messages { flex: 1; min-width: 0; overflow-y: auto; overflow-x: hidden; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble-row { display: flex; min-width: 0; gap: 8px; }
.chat-bubble-row.mine { justify-content: flex-end; }






.chat-bubble-avatar {
  flex-shrink: 0;
  align-self: flex-end;
  width: 28px; height: 28px;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 12px; font-weight: 700;
  margin-bottom: 2px;
}















.chat-bubble-col {
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0;
  max-width: min(68%, 480px);
}
.chat-bubble-row.mine .chat-bubble-col { align-items: flex-end; }
.chat-bubble {











  max-width: 100%;
  padding: 9px 13px;
  border-radius: 16px;




  font-size: calc(13.5px * var(--chat-text-scale));
  line-height: 1.4;
  background: var(--chat-bubble-in);
  box-shadow: var(--chat-bubble-in-shadow);
  color: var(--text);



  overflow-wrap: anywhere;
  word-break: break-word;
}




.chat-bubble-row.mine .chat-bubble { background: var(--chat-bubble-mine); color: #fff; border-bottom-right-radius: 4px; }
.chat-bubble-row:not(.mine) .chat-bubble { border-bottom-left-radius: 4px; }











.chat-bubble.video-circle-only {
  padding: 0 !important;
  background: none !important;
}


.chat-bubble-sender { font-size: 12px; font-weight: 700; color: var(--accent-ink); margin-bottom: 3px; }
.chat-bubble-time { font-size: 10px; opacity: 0.65; margin-top: 4px; text-align: right; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }






.chat-read-ticks { font-size: 12px; letter-spacing: -4px; padding-right: 2px; opacity: 0.85; font-weight: 700; }
.chat-read-ticks.read { color: #00e0ff; opacity: 1; text-shadow: 0 0 6px rgba(0, 224, 255, 0.55); }


.chat-bubble-reply-btn {
  opacity: 0; transition: opacity 0.12s;
  background: none; border: none; cursor: pointer;
  font-size: 10.5px; color: inherit; opacity: 0; padding: 0;
}
.chat-bubble-row:hover .chat-bubble-reply-btn { opacity: 0.75; }
.chat-bubble-reply-btn:hover { opacity: 1 !important; text-decoration: underline; }


.chat-bubble-pin-btn {
  opacity: 0; transition: opacity 0.12s;
  background: none; border: none; cursor: pointer;
  font-size: 10.5px; color: inherit; padding: 0;
}
.chat-bubble-row:hover .chat-bubble-pin-btn { opacity: 0.75; }
.chat-bubble-pin-btn:hover { opacity: 1 !important; text-decoration: underline; }
.chat-bubble-pin-btn.pinned { opacity: 0.85; }



.chat-bubble-menu-btn {
  opacity: 0; transition: opacity 0.12s;
  background: none; border: none; cursor: pointer;
  font-size: 13px; line-height: 1; color: inherit; padding: 0;
}
.chat-bubble-row:hover .chat-bubble-menu-btn { opacity: 0.75; }
.chat-bubble-menu-btn:hover { opacity: 1 !important; }

.chat-bubble-edited { font-style: italic; opacity: 0.75; }

.chat-bubble-failed-note { font-size: 11px; color: var(--red); margin-top: 2px; }

.chat-bubble-sending-note { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; opacity: .75; margin-top: 2px; }
.chat-bubble-sending-note svg { animation: chat-sending-spin 2.4s linear infinite; }
@keyframes chat-sending-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .chat-bubble-sending-note svg { animation: none; } }
.chat-bubble-retry {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px; margin-left: 6px;
  border: 0; border-radius: 999px; background: var(--red); color: #fff;
  font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; vertical-align: middle;
}
.chat-bubble-retry:disabled { opacity: .6; cursor: default; }

.chat-bubble-row.mine .chat-bubble-failed-note { color: #FFB3AD; }



.chat-bubble-deleted-note { font-style: italic; opacity: 0.6; }



.chat-bubble.pinned, .chat-bubble { position: relative; }
.chat-bubble-badges {
  position: absolute; top: -9px; right: -6px;
  display: flex; gap: 3px; align-items: center;
}
.chat-bubble-row.mine .chat-bubble-badges { right: auto; left: -6px; }
.chat-bubble-pin-badge, .chat-bubble-important-badge {
  font-size: 13px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}




.chat-bubble-reactions {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.chat-bubble-row.mine .chat-bubble-reactions { justify-content: flex-end; }
.chat-reaction-pill {
  display: inline-flex; align-items: center; gap: 3px;
  border: 1px solid var(--border); background: var(--panel);
  border-radius: 999px; padding: 1px 7px; font-size: 12px; line-height: 1.6;
  cursor: pointer; transition: transform 0.12s ease, background 0.12s ease;
}
.chat-reaction-pill span { font-size: 11px; font-weight: 600; color: var(--text-dim); }
.chat-reaction-pill:hover { background: var(--panel-2); }
.chat-reaction-pill.mine { border-color: var(--accent-ink); background: rgba(90,110,255,0.12); }
.chat-reaction-pill.mine span { color: var(--accent-ink); }
.chat-reaction-pop { animation: chat-reaction-pop-anim 0.26s ease; }
@keyframes chat-reaction-pop-anim {
  0% { transform: scale(0.4); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}



.msg-ctx-menu .msg-reactions-bar {
  display: flex; justify-content: space-between; gap: 2px;
  padding: 4px 4px 8px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.msg-reaction-opt {
  flex: 1; border: none; background: none; cursor: pointer;
  font-size: 20px; line-height: 1; padding: 4px 0; border-radius: 8px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.msg-reaction-opt:hover { background: var(--panel-2); transform: scale(1.25); }
.msg-reaction-opt:active { transform: scale(1.05); }




.chat-bubble-forwarded {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; opacity: 0.85; margin-bottom: 4px; font-style: italic;
}
.chat-bubble-forwarded-icon { flex-shrink: 0; }




.chat-edit-preview { cursor: default; }
.chat-edit-preview .chat-reply-preview-body { cursor: pointer; }
.chat-edit-preview .chat-reply-preview-author { display: flex; align-items: center; gap: 5px; }
.is-editing-msg #chat-reply-preview,
.is-editing-msg .chat-attach-preview,
.is-editing-msg #chat-attach-btn { display: none !important; }
.is-editing-msg .chat-composer textarea { max-height: 40vh; max-height: 40dvh; }
.chat-send-btn.is-save { width: auto; min-width: 40px; padding: 0 16px; gap: 6px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.chat-send-btn.is-save #chat-action-btn-icon { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; }
.chat-send-btn.is-save .chat-save-label { white-space: nowrap; }
@media (max-width: 420px) { .chat-send-btn.is-save { padding: 0 12px; } .chat-send-btn.is-save .chat-save-label { display: none; } }
.chat-bubble-row.is-editing .chat-bubble { box-shadow: 0 0 0 2px var(--accent-ink, #3b82f6); }
.chat-bubble-row.is-editing .chat-bubble::after {
  content: 'редактируется'; display: block; margin-top: 3px;
  font-size: 11px; font-style: italic; opacity: 0.85;
}



.chat-pinned-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 12.5px;
}
.chat-pinned-icon { flex-shrink: 0; }
.chat-pinned-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; max-height: 54px; overflow-y: auto; }
.chat-pinned-row { cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-pinned-author { font-weight: 700; }
.chat-pinned-count { flex-shrink: 0; color: var(--text-dim); font-size: 11px; }
.chat-pinned-unpin-all {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  border: none; background: none; cursor: pointer; font-size: 15px; color: var(--text-dim);
}
.chat-pinned-unpin-all:hover { background: var(--border); }



.chat-search-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-search-bar input { flex: 1; padding: 7px 10px; font-size: 12.5px; }
.chat-search-bar-count { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.chat-search-bar-nav {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer; font-size: 12px;
}
.chat-search-bar-nav:hover { background: var(--panel-2); }

.chat-bubble-row.chat-search-match .chat-bubble { box-shadow: 0 0 0 2px var(--yellow); }
.chat-bubble-row.chat-search-current .chat-bubble { box-shadow: 0 0 0 2px var(--orange); }


.chat-bubble-quote {
  border-left: 3px solid rgba(255,255,255,0.6);
  padding: 3px 8px; margin-bottom: 6px;
  border-radius: 4px; background: rgba(255,255,255,0.12);
  cursor: pointer;
}
.chat-bubble-row:not(.mine) .chat-bubble-quote { border-left-color: var(--accent-ink); background: rgba(0,0,0,0.05); }



.chat-bubble-quote-orphan { cursor: default; }
.chat-bubble-quote-author { font-size: 11px; font-weight: 700; opacity: 0.9; }




.chat-bubble-quote-text { font-size: 12px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }






.chat-bubble.menu-open {
  box-shadow: 0 0 0 2px var(--accent-ink);
  transition: box-shadow .12s ease;
}
.chat-bubble-flash .chat-bubble { animation: chat-bubble-flash-anim 1.2s ease; }
@keyframes chat-bubble-flash-anim {
  0% { box-shadow: 0 0 0 2px var(--accent-ink); }
  100% { box-shadow: none; }
}
.chat-bubble-attachment {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 10px; padding: 6px 10px; margin-top: 6px; font-size: 12px;
}
.chat-bubble-row:not(.mine) .chat-bubble-attachment { background: var(--panel); }

.chat-bubble-attachment.chat-bubble-image { padding: 0; background: none; display: block; }









.chat-bubble-image-sizeless img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}




.chat-bubble-attachment.chat-bubble-video { padding: 0; background: none; display: block; }
.chat-bubble-attachment.chat-bubble-video video {
  max-width: 260px; width: 100%; max-height: 320px; border-radius: 12px; display: block;
  margin-top: 6px; background: #000;
}





.voice-player {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  min-width: 210px; max-width: 260px;
  padding: 2px 2px 2px 0;
}
.voice-play-btn {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.25); color: inherit;
  transition: background .15s ease, transform .1s ease;
}
.chat-bubble-row:not(.mine) .voice-play-btn { background: rgba(0,0,0,0.08); }
.voice-play-btn:hover { background: rgba(255,255,255,0.38); }
.chat-bubble-row:not(.mine) .voice-play-btn:hover { background: rgba(0,0,0,0.14); }
.voice-play-btn:active { transform: scale(0.92); }
.voice-play-icon { font-size: 13px; margin-left: 1px; }



.voice-play-btn.playing { position: relative; }
.voice-play-btn.playing::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.35);
  pointer-events: none;
  animation: voicePulse 1.6s ease-out infinite;
}
@keyframes voicePulse {
  0% { opacity: 1; transform: scale(1); }
  60%, 100% { opacity: 0; transform: scale(1.35); }
}
.chat-bubble-row:not(.mine) .voice-play-btn.playing::after { border-color: rgba(22,24,29,0.18); }
@media (prefers-reduced-motion: reduce) {
  .voice-play-btn.playing::after { animation: none; opacity: 1; transform: none; }
}
.voice-waveform { flex: 1; min-width: 0; height: 28px; display: block; cursor: pointer; }
.voice-duration { flex-shrink: 0; font-size: 11px; opacity: 0.8; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) {
  .voice-play-btn.playing { animation: none; }
}





.voice-player-meta { flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.voice-speed-btn, .voice-transcribe-btn {
  flex-shrink: 0; border: none; cursor: pointer;
  border-radius: 999px; padding: 3px 7px;
  font-size: 10.5px; font-weight: 700; line-height: 1.3;
  background: rgba(255,255,255,0.22); color: inherit;
  transition: background .15s ease, opacity .15s ease;
}
.chat-bubble-row:not(.mine) .voice-speed-btn,
.chat-bubble-row:not(.mine) .voice-transcribe-btn { background: rgba(0,0,0,0.08); }
.voice-speed-btn:hover, .voice-transcribe-btn:hover { background: rgba(255,255,255,0.36); }
.chat-bubble-row:not(.mine) .voice-speed-btn:hover,
.chat-bubble-row:not(.mine) .voice-transcribe-btn:hover { background: rgba(0,0,0,0.14); }
.voice-transcribe-btn.loading { opacity: 0.5; pointer-events: none; }



.voice-speed-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px); right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.2);
  padding: 6px;
  min-width: 130px;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
  color: var(--text);
}
.voice-speed-menu.open { display: flex; }
.voice-speed-opt {
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.voice-speed-opt:hover { background: var(--panel-2); }
.voice-speed-opt.active { background: var(--panel-2); font-weight: 700; }
.voice-speed-menu-sep { height: 1px; background: var(--border); margin: 4px 2px; }
.voice-mute-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.voice-mute-toggle:hover { background: var(--panel-2); }
.voice-mute-toggle.active { color: var(--red); }




.voice-transcript-result {
  margin-top: 4px;
  font-size: 12.5px; line-height: 1.4;
  padding: 8px 10px; border-radius: 10px;
  background: rgba(0,0,0,0.06); color: inherit;
  max-width: 260px;
}
.chat-bubble-row.mine .voice-transcript-result { background: rgba(255,255,255,0.16); }




.video-circle-player {
  position: relative;
  width: clamp(150px, 45vw, 190px);
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: #000;
  margin-top: 4px;
}
.video-circle-el { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.video-circle-ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); pointer-events: none;
}
.video-circle-ring-bg { fill: none; stroke: rgba(255,255,255,0.28); stroke-width: 3; }
.video-circle-ring-progress {
  fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round;
  transition: stroke-dashoffset 0.1s linear;
}
.video-circle-play-btn {
  position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.42); color: #fff; font-size: 17px;
  transition: opacity .15s ease, transform .1s ease;
}
.video-circle-play-btn:hover { background: rgba(0,0,0,0.55); }
.video-circle-play-btn:active { transform: scale(0.92); }
.video-circle-play-icon { margin-left: 2px; }

.video-circle-player.playing .video-circle-play-btn { opacity: 0; pointer-events: none; }
.video-circle-duration {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; padding: 2px 7px;
  border-radius: 999px; font-variant-numeric: tabular-nums; pointer-events: none;
}




.video-record-preview-wrap {
  position: relative; width: 40px; height: 40px; border-radius: 50%;
  overflow: hidden; flex-shrink: 0; background: #000;
}
.video-record-preview {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transform: scaleX(-1); /* зеркалим фронтальную камеру, как в большинстве приложений */
}
.video-record-preview-wrap .recording-dot {
  position: absolute; top: 1px; right: 1px; width: 9px; height: 9px;
  box-shadow: 0 0 0 2px var(--panel);
}






.chat-bubble-attachment.chat-bubble-file {
  display: flex; align-items: center; gap: 10px;
  min-width: 200px; max-width: 264px; min-height: 56px;
  border-radius: 13px; padding: 8px 12px 8px 8px;
  text-decoration: none; color: inherit;
  cursor: pointer;
}
.chat-file-doc { flex-shrink: 0; width: 40px; height: 40px; display: block; }
.chat-file-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow: hidden; }
.chat-file-name {
  font-weight: 600; font-size: 15px; line-height: 19px; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-file-meta { font-size: 13px; line-height: 16px; opacity: 0.72; }
.media-file-size { opacity: 0.65; font-size: 11px; }


.voice-transcript { font-style: italic; opacity: 0.9; margin-bottom: 2px; }


.typing-indicator {
  display: flex; align-items: center; gap: 6px;
  padding: 0 20px 8px; font-size: 12px; color: var(--text-dim);
}
.typing-mic { font-size: 13px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-dim);
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.chat-composer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  position: relative;
}
.chat-composer-normal { display: flex; align-items: flex-end; gap: 8px; }

.chat-recording-ui { display: flex; align-items: center; gap: 10px; }
.recording-dot {
  width: 12px; height: 12px; border-radius: 50%; background: #e5484d; flex-shrink: 0;
  animation: recording-pulse 1.2s ease-in-out infinite;
}
@keyframes recording-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}
.recording-timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.recording-hint { font-size: 12.5px; color: var(--text-dim); flex: 1; }
.chat-composer textarea {
  resize: none;
  max-height: 140px;
  min-height: 40px;
  flex: 1 1 0%;
  min-width: 0;


  overflow-y: auto;
  line-height: 1.4;
}
.chat-composer-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--panel-2); border: none; cursor: pointer;
  font-size: 16px; flex-shrink: 0;
}
.chat-composer-btn:hover { background: var(--border); }




.chat-composer-btn-off {
  opacity: .42; cursor: not-allowed; color: var(--text-dim);
}
.chat-composer-btn-off:hover { background: var(--panel-2); }
.chat-send-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
  font-size: 15px; flex-shrink: 0;
}









@media (max-width: 420px) {
  .chat-composer { padding: 10px 8px; }
  .chat-composer-normal, .chat-recording-ui { gap: 4px; }
  .chat-composer-btn, .chat-send-btn { width: 32px; height: 32px; font-size: 14px; }
  .chat-emoji-inline-btn { width: 24px; height: 24px; font-size: 14px; }
  .chat-textarea-wrap textarea { padding-right: 32px; }
  .recording-hint { display: none; } /* на совсем узком экране прячем подпись, оставляем таймер и кнопки */
}





.chat-action-wrap { position: relative; flex-shrink: 0; }






.chat-action-wrap .chat-send-btn {
  user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
.chat-record-mode-menu {
  display: none;
  position: absolute;
  bottom: 56px; right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.2);
  padding: 6px;
  min-width: 200px;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}
.chat-record-mode-menu.open { display: flex; }
.chat-attach-preview {
  display: flex; gap: 6px; flex-wrap: wrap;
  padding: 0 16px 8px;
}





.chat-drop-active { position: relative; }
.chat-drop-active::after {
  content: 'Отпустите файл — отправим сразу';
  position: absolute; inset: 8px; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--accent-ink);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px; font-weight: 600; text-align: center; padding: 0 16px;
  pointer-events: none;
}





.dlg-length {
  padding: 0 16px 4px;
  text-align: right;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.dlg-length.near { color: var(--orange, #e8912a); }
.dlg-length.over { color: var(--red); font-weight: 600; }

.dlg-length.split { color: var(--blue, #2f6fed); font-weight: 600; }





.chat-drop-attaches.chat-drop-active::after { content: 'Отпустите файл — прикрепим к сообщению'; }
.chat-drop-attaches.chat-drop-sending::after { content: 'Готовлю файл…'; }



.chat-drop-sending::after {
  content: 'Отправляю файл…';
  position: absolute; inset: 8px; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--accent-ink);
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px; font-weight: 600; text-align: center; padding: 0 16px;
  pointer-events: none;
}
.chat-drop-sending { position: relative; }




.chat-link {



  color: var(--chat-bubble-mine);
  text-decoration: none;


  overflow-wrap: anywhere;
}
.chat-link:hover { text-decoration: underline; text-underline-offset: 2px; }

.chat-bubble-row.mine .chat-link { color: inherit; }





.link-preview-card {
  position: fixed; z-index: 3000;
  width: 320px; max-width: calc(100vw - 16px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(16, 24, 40, 0.18);
  overflow: hidden;
  pointer-events: none;
  animation: linkPreviewIn 0.12s ease-out;
}
@keyframes linkPreviewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.link-preview-shot { background: var(--panel-2); line-height: 0; }
.link-preview-shot img { width: 100%; height: 150px; object-fit: cover; display: block; }
.link-preview-body { padding: 10px 12px 12px; }
.link-preview-host {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-dim);
}
.link-preview-title {
  margin-top: 3px; font-size: 14px; font-weight: 700; color: var(--text);
  overflow-wrap: anywhere;
}
.link-preview-text {
  margin-top: 4px; font-size: 12.5px; line-height: 1.4; color: var(--text-dim);


  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
@media (prefers-reduced-motion: reduce) { .link-preview-card { animation: none; } }




.dra-list { display: flex; flex-direction: column; gap: 2px; margin: 4px 0 2px; }
.dra-row {
  margin: 0; padding: 7px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent;
}
.dra-row:hover { background: var(--bg-soft, rgba(0,0,0,0.03)); }
.dra-label { flex: 1; }
.dra-count {
  flex: none; font-weight: 700; font-size: 12.5px; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}




.chat-msg-results {
  border-bottom: 1px solid var(--border);
  max-height: 45%;
  overflow-y: auto;
  flex-shrink: 0;
}
.chat-msg-results-head {
  padding: 8px 14px 6px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--text-dim);
}
.chat-msg-result { padding: 8px 14px; cursor: pointer; border-left: 3px solid transparent; }
.chat-msg-result:hover { background: var(--panel-2); border-left-color: var(--accent-ink); }
.chat-msg-result-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-msg-result-conv {
  font-size: 12px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-msg-result-date { font-size: 10.5px; color: var(--text-dim); flex-shrink: 0; }


.chat-msg-result-text {
  font-size: 12px; color: var(--text-dim); line-height: 1.35; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.chat-msg-result-text mark { background: var(--accent-soft); color: var(--text); font-weight: 700; padding: 0 1px; border-radius: 3px; }



.chat-length-counter { padding: 0 16px 6px; font-size: 11px; color: var(--text-dim); text-align: right; }
.chat-length-counter.over { color: var(--red); font-weight: 700; }
.chat-attach-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--panel-2); border-radius: 10px; padding: 5px 10px; font-size: 11.5px;
}
.chat-attach-chip button { width: auto; background: none; border: none; cursor: pointer; color: var(--text-dim); padding: 0; }



.chat-reply-preview {
  align-items: center; gap: 10px;
  margin: 0 16px 8px; padding: 6px 10px;
  background: var(--panel-2); border-radius: 10px;
  border-left: 3px solid var(--accent-ink);
}
.chat-reply-preview-body { flex: 1; min-width: 0; }
.chat-reply-preview-author { font-size: 11.5px; font-weight: 700; color: var(--accent-ink); }
.chat-reply-preview-text { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-reply-preview button {
  width: auto; background: none; border: none; cursor: pointer; color: var(--text-dim); padding: 0; font-size: 14px;
}



.chat-select-bar {
  align-items: center; gap: 8px;
  margin: 0 16px 8px; padding: 6px 10px;
  background: var(--panel-2); border-radius: 10px;
  border-left: 3px solid var(--accent-ink);
}
.chat-select-count { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text); }
.chat-select-act {
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 8px; font-size: 12.5px; color: var(--text); white-space: nowrap;
}
.chat-select-act:hover { background: var(--border); }


.chat-select-act:disabled { opacity: 0.45; cursor: default; }
.chat-select-act:disabled:hover { background: none; }
.chat-select-act.cancel { color: var(--text-dim); }




.chat-messages.selecting .chat-bubble-row { cursor: pointer; user-select: none; position: relative; }



.chat-messages.selecting .chat-bubble-row.selected .chat-bubble {
  box-shadow: 0 0 0 2px var(--accent-ink);
}




.chat-messages.selecting { padding-left: 34px; }
.chat-messages.selecting .chat-bubble-row::before {
  content: '';
  position: absolute; left: -26px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); background: var(--panel);
}
.chat-messages.selecting .chat-bubble-row.selected::before {
  border-color: var(--accent); background: var(--accent);
  box-shadow: inset 0 0 0 2px var(--panel);
}



.chat-messages.selecting .chat-bubble-actions { display: none; }



@media (max-width: 640px) {
  .chat-select-bar { margin: 0 8px 6px; padding: 6px 8px; gap: 4px; }
  .chat-select-act { padding: 6px 8px; font-size: 12px; }
  .chat-select-count { font-size: 12px; }
  .chat-messages.selecting { padding-left: 26px; }
  .chat-messages.selecting .chat-bubble-row::before { left: -22px; }
}



















.ios-chat .chat-thread-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 12;
  background: color-mix(in srgb, var(--chat-canvas-bar) 74%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-bottom: 1px solid rgba(231, 232, 236, 0.7);
}
.ios-chat .chat-thread-top .chat-thread-head { border-bottom: none; }



.ios-chat .chat-thread-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 12;
  background: color-mix(in srgb, var(--chat-canvas-bar) 74%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-top: 1px solid rgba(231, 232, 236, 0.7);
}

.ios-chat .chat-thread-bottom .chat-composer { border-top: none; background: none; }






.ios-chat .chat-thread-top { border-top-right-radius: var(--chat-pane-inner-radius, 0px); }
.ios-chat .chat-thread-bottom { border-bottom-right-radius: var(--chat-pane-inner-radius, 0px); }


.chat-ios-backdrop {
  border-top-right-radius: var(--chat-pane-inner-radius, 0px);
  border-bottom-right-radius: var(--chat-pane-inner-radius, 0px);
}



@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-chat .chat-thread-top,
  .ios-chat .chat-thread-bottom { background: var(--chat-canvas-bar); }
}
.ios-chat .chat-messages {
  padding-top: calc(var(--chat-top-h, 64px) + 12px);
  padding-bottom: calc(var(--chat-bottom-h, 64px) + 12px);
}














@media (max-width: 1040px) {
  .ios-chat .chat-thread-bottom { position: static; }
  .ios-chat .chat-messages { padding-bottom: 12px; }



  .ios-chat .chat-thread-top { border-top-left-radius: var(--chat-pane-inner-radius, 0px); }
  .chat-ios-backdrop {
    border-top-left-radius: var(--chat-pane-inner-radius, 0px);
    border-bottom-left-radius: var(--chat-pane-inner-radius, 0px);
  }
}















.ios-chat .chat-day-group {
  display: flex;
  flex-direction: column;




  gap: 0;
}
.ios-chat .chat-day-group > * + * { margin-top: 10px; }
.ios-chat .chat-day-divider {
  position: sticky;
  top: 8px;
  z-index: 6;









  opacity: 0;
  transition: opacity .25s ease;
  pointer-events: none;
}
.ios-chat.dates-live .chat-day-divider.day-current { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .ios-chat .chat-day-divider { transition: none; }
}









.ios-chat .chat-day-divider span {
  background: var(--border);
  color: var(--text-dim);
  border: none;
  box-shadow: none;
}










.ios-chat .chat-bubble-row.same-series { margin-top: 3px; }
.ios-chat .chat-bubble-row.same-series .chat-bubble-sender { display: none; }
.ios-chat .chat-bubble-row:not(.series-last) .chat-bubble-avatar { visibility: hidden; }





.ios-chat .chat-bubble-row:not(.mine):not(.series-last) .chat-bubble { border-bottom-left-radius: 7px; }
.ios-chat .chat-bubble-row.mine:not(.series-last) .chat-bubble { border-bottom-right-radius: 7px; }
.ios-chat .chat-bubble-row.same-series:not(.mine) .chat-bubble { border-top-left-radius: 7px; }
.ios-chat .chat-bubble-row.same-series.mine .chat-bubble { border-top-right-radius: 7px; }





.ios-chat .chat-bubble-row.bubble-fresh .chat-bubble {
  animation: iosBubbleIn .42s cubic-bezier(.22, 1.4, .36, 1) both;
  transform-origin: 0% 100%;
}
.ios-chat .chat-bubble-row.bubble-fresh.mine .chat-bubble { transform-origin: 100% 100%; }
@keyframes iosBubbleIn {
  from { opacity: 0; transform: translateY(14px) scale(.84); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ios-chat .chat-bubble-row.bubble-fresh .chat-bubble { animation: none; }
}





.ios-chat .chat-composer textarea { border-radius: 20px; }
.ios-chat .chat-send-btn { border-radius: 50%; }




.ios-chat .chat-messages.selecting { padding-left: 34px; padding-right: 30px; }





.chat-ios-backdrop {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(20, 22, 26, 0.26);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  transition: opacity .2s ease;
}
.chat-ios-backdrop.visible { opacity: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .chat-ios-backdrop { background: rgba(20, 22, 26, 0.5); }
}


.ios-chat .chat-bubble-row.menu-lifted {
  position: relative; z-index: 25;
  animation: iosLift .26s cubic-bezier(.22, 1.3, .36, 1) both;
}
@keyframes iosLift {
  from { transform: scale(.97); }
  to { transform: none; }
}
.ios-chat .chat-bubble-row.menu-lifted .chat-bubble { box-shadow: 0 10px 34px rgba(16, 17, 20, 0.22); }

.ios-chat .chat-bubble-row.menu-lifted .chat-bubble-actions { display: none; }




.chat-ctx-menu.ios-menu {
  width: 248px;
  padding: 0;
  overflow: hidden auto;
  border: none;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 12px 40px rgba(16, 17, 20, 0.26);
  transform: translateY(-6px) scale(.92);
  transform-origin: 50% 0%;
  transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1.35, .36, 1);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .chat-ctx-menu.ios-menu { background: var(--panel); }
}
.chat-ctx-menu.ios-menu.visible { transform: none; }

.chat-ctx-menu.ios-menu .chat-ctx-menu-item {
  border-radius: 0;
  padding: 12px 15px;
  font-size: 15px;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}
.chat-ctx-menu.ios-menu .chat-ctx-menu-item:last-child { border-bottom: none; }
.chat-ctx-menu.ios-menu .chat-ctx-menu-item:active { background: rgba(120, 120, 128, 0.18); }

.chat-ctx-menu.ios-menu .msg-reactions-bar {
  gap: 2px;
  padding: 6px 8px;
  margin: 0;
  border-bottom: 1px solid var(--border);


  background: color-mix(in srgb, var(--panel) 50%, transparent);
}
.chat-ctx-menu.ios-menu .msg-reaction-opt { width: 34px; height: 34px; font-size: 19px; border-radius: 50%; }
.chat-ctx-menu.ios-menu .msg-reaction-opt:active { background: rgba(120, 120, 128, 0.2); }




.ios-chat .chat-unread-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 2px;
  color: var(--chat-bubble-mine);
  font-size: 11.5px; font-weight: 700;
}
.ios-chat .chat-unread-divider::before,
.ios-chat .chat-unread-divider::after {
  content: ''; flex-grow: 1; height: 1px;
  background: rgba(10, 132, 255, 0.35);
}




.ios-chat .typing-indicator { padding: 0 20px 6px; }
.ios-chat .typing-dots span { background: var(--text-dim); }





.ios-chat .chat-bubble-row.swiping { transition: none; will-change: transform; }
.ios-chat .chat-bubble-row.swiping::after {
  content: '';
  position: absolute; left: -26px; top: 50%; margin-top: -9px;
  width: 18px; height: 18px;
  opacity: var(--swipe-hint, 0);
  background: currentColor;
  color: var(--text-dim);
  -webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14L4 9l5-5'/%3E%3Cpath d='M4 9h11a5 5 0 0 1 5 5v3'/%3E%3C/svg%3E");
  mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 14L4 9l5-5'/%3E%3Cpath d='M4 9h11a5 5 0 0 1 5 5v3'/%3E%3C/svg%3E");
}








.ios-chat .chat-composer-btn,
.ios-chat .chat-send-btn,
.ios-chat .chat-select-act,
.ios-chat .chat-attach-menu-item,
.ios-chat .chat-bubble-reply-btn,
.ios-chat .chat-bubble-pin-btn,
.ios-chat .chat-reaction-pill,
.chat-ctx-menu.ios-menu .chat-ctx-menu-item,
.chat-ctx-menu.ios-menu .msg-reaction-opt {
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease;
  touch-action: manipulation;
}
.ios-chat .chat-composer-btn:active,
.ios-chat .chat-send-btn:active,
.ios-chat .chat-select-act:not(:disabled):active,
.ios-chat .chat-bubble-reply-btn:active,
.ios-chat .chat-bubble-pin-btn:active,
.ios-chat .chat-reaction-pill:active,
.chat-ctx-menu.ios-menu .msg-reaction-opt:active { transform: scale(.88); }
.ios-chat .chat-attach-menu-item:active { transform: scale(.97); }




.ios-chat .chat-attach-menu,
.ios-chat .emoji-picker,
.ios-chat .record-mode-menu {
  border: none;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 12px 40px rgba(16, 17, 20, 0.22);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-chat .chat-attach-menu,
  .ios-chat .emoji-picker,
  .ios-chat .record-mode-menu { background: var(--panel); }
}
.ios-chat .chat-attach-menu.open,
.ios-chat .emoji-picker.open,
.ios-chat .record-mode-menu.open { animation: iosMenuIn .26s cubic-bezier(.22, 1.35, .36, 1) both; }
@keyframes iosMenuIn {
  from { opacity: 0; transform: translateY(8px) scale(.94); }
  to { opacity: 1; transform: none; }
}




.ios-chat .chat-reply-preview,
.ios-chat .chat-select-bar,
.ios-chat .chat-attach-preview:not(:empty) { animation: iosBarIn .2s cubic-bezier(.22, 1.2, .36, 1) both; }
@keyframes iosBarIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}



@media (prefers-reduced-motion: reduce) {
  .chat-ctx-menu.ios-menu,
  .ios-chat .chat-bubble-row.menu-lifted,
  .ios-chat .chat-attach-menu.open,
  .ios-chat .emoji-picker.open,
  .ios-chat .record-mode-menu.open,
  .ios-chat .chat-reply-preview,
  .ios-chat .chat-select-bar,
  .ios-chat .chat-attach-preview:not(:empty) { animation: none; }
  .chat-ctx-menu.ios-menu { transition: opacity .12s ease; transform: none; }
}






.modal-backdrop.ios-backdrop {
  background: rgba(20, 22, 26, 0.28);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: iosBackdropIn .2s ease both;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal-backdrop.ios-backdrop { background: rgba(20, 22, 26, 0.5); }
}
@keyframes iosBackdropIn { from { opacity: 0; } to { opacity: 1; } }
.modal.ios-modal {
  border: none;
  border-radius: 22px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 24px 70px rgba(16, 17, 20, 0.28);


  animation: iosModalIn .34s cubic-bezier(.22, 1.3, .36, 1) both;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .modal.ios-modal { background: var(--panel); }
}
@keyframes iosModalIn {
  from { opacity: 0; transform: translateY(14px) scale(.94); }
  to { opacity: 1; transform: none; }
}


.modal.ios-modal.modal-sheet {
  border-radius: 22px 22px 0 0;
  animation: iosSheetIn .32s cubic-bezier(.22, 1.2, .36, 1) both;
}
@keyframes iosSheetIn {
  from { transform: translateY(100%); }
  to { transform: none; }
}

.modal.ios-modal .btn,
.modal.ios-modal .group-contact-row,
.modal.ios-modal .attach-order-list > * {
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease, filter .12s ease;
  touch-action: manipulation;
}
.modal.ios-modal .btn:not(:disabled):active { transform: scale(.96); }
.modal.ios-modal .group-contact-row:active { background: var(--panel-2); }





.ios-chat-layout .chat-item {
  border-bottom: none;
  border-left: none;
  padding: 10px 12px;
  transition: background-color .14s ease, transform .12s cubic-bezier(.22, 1.2, .36, 1);
  touch-action: manipulation;
}
.ios-chat-layout .chat-item:active { transform: scale(.985); }
.ios-chat-layout .chat-item.active { background: var(--accent-soft); }


.ios-chat-layout .chat-item.has-unread { position: relative; }
.ios-chat-layout .chat-item.has-unread::before {
  content: '';
  position: absolute; left: 3px; top: 50%; margin-top: -3px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--chat-bubble-mine);
}







.ios-chat-layout .chat-item-swipe {
  border-radius: 14px;
  overflow: hidden;
  margin: 2px 8px;
}
.ios-chat-layout .chat-item-swipe .chat-item { margin: 0; border-radius: 0; }




.ios-chat-layout .chat-items .chat-item-swipe + .chat-item-swipe .chat-item { border-top: none; }

.ios-chat-layout .chat-type-filter-btn,
.ios-chat-layout .chat-folder-chip {
  border-radius: 999px;
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease;
  touch-action: manipulation;
}
.ios-chat-layout .chat-type-filter-btn:active,
.ios-chat-layout .chat-folder-chip:active { transform: scale(.94); }
.ios-chat-layout .chat-search input { border-radius: 999px; padding-left: 14px; padding-right: 14px; }
.ios-chat-layout .chat-head-icon-btn,
.ios-chat-layout .chat-new-btn {
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease;
  touch-action: manipulation;
}
.ios-chat-layout .chat-head-icon-btn:active,
.ios-chat-layout .chat-new-btn:active { transform: scale(.9); }






.ios-chat .chat-pinned-bar,
.ios-chat .chat-search-bar {
  background: none;
  border-bottom: 1px solid rgba(60, 60, 67, 0.12);
}
.ios-chat .chat-search-bar input {
  border-radius: 999px;
  padding: 7px 14px;
}
.ios-chat .chat-search-bar-nav {
  border: none;
  background: rgba(120, 120, 128, 0.12);
  border-radius: 50%;
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease;
  touch-action: manipulation;
}
.ios-chat .chat-search-bar-nav:active { transform: scale(.88); }
.ios-chat .chat-pinned-unpin-all {
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .12s ease;
  touch-action: manipulation;
}
.ios-chat .chat-pinned-unpin-all:active { transform: scale(.88); }




.ios-chat .chat-order-card,
.ios-chat .chat-task-card,
.ios-chat .chat-assign-card {
  border-radius: 15px;
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), background-color .15s ease;
  touch-action: manipulation;
}
.ios-chat .chat-order-card:active { transform: scale(.98); }
.ios-chat .chat-file-link,
.ios-chat [data-chat-file] {
  transition: transform .12s cubic-bezier(.22, 1.2, .36, 1), opacity .12s ease;
  touch-action: manipulation;
}
.ios-chat [data-chat-file]:active { transform: scale(.98); }


.ios-chat .chat-bubble img { border-radius: 15px; }
.ios-chat .chat-bubble.image-only img { border-radius: 19px; }






.ios-chat-layout .chat-item-actions {
  border-radius: 14px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .1s ease;
}
.ios-chat-layout .chat-item-swipe.swipe-live .chat-item-actions { opacity: 1; }
.ios-chat-layout .chat-item-action {
  transition: filter .12s ease;
  touch-action: manipulation;
}
.ios-chat-layout .chat-item-action:active { filter: brightness(.9); }


.ios-chat-layout .chat-search-suggest,
.ios-chat-layout .chat-msg-results {
  border-radius: 16px;
  border: none;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  box-shadow: 0 12px 40px rgba(16, 17, 20, 0.18);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-chat-layout .chat-search-suggest,
  .ios-chat-layout .chat-msg-results { background: var(--panel); }
}




.ios-chat .empty-state { padding: 60px 24px; }




















.ios-chat .voice-player { padding: 3px 2px 3px 0; gap: 11px; }


.ios-chat .voice-play-btn { width: 38px; height: 38px; }
.ios-chat .voice-play-btn:active { transform: scale(.9); }
.ios-chat .voice-waveform { height: 30px; }

.ios-chat .voice-speed-btn,
.ios-chat .voice-transcribe-btn {
  border-radius: 999px;
  padding: 3.5px 8px;
  transition: transform .12s ease, background .15s ease;
}
.ios-chat .voice-speed-btn:active,
.ios-chat .voice-transcribe-btn:active { transform: scale(.92); }

.ios-chat .voice-speed-menu {
  border-radius: 16px;
  animation: iosMenuIn .18s cubic-bezier(.22, 1, .36, 1) both;
  transform-origin: bottom right;
}
.ios-chat .voice-speed-opt { border-radius: 10px; transition: transform .12s ease; }
.ios-chat .voice-speed-opt:active { transform: scale(.95); }
.ios-chat .voice-transcript-result {
  border-radius: 14px;
  animation: iosBarIn .2s cubic-bezier(.22, 1, .36, 1) both;
}




.ios-chat .video-circle-ring-bg { stroke-width: 4; }
.ios-chat .video-circle-ring-progress { stroke-width: 4; }


.ios-chat .video-circle-play-btn {
  background: rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.ios-chat .video-circle-play-btn:active { transform: scale(.9); }





.ios-chat .video-circle-duration {
  background: rgba(0, 0, 0, 0.36);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 2.5px 8px;
  right: auto;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
}


.ios-chat .mention-dropdown {
  border-radius: 18px;
  padding: 7px;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(22px);
  backdrop-filter: saturate(180%) blur(22px);
  border-color: rgba(231, 232, 236, 0.8);
  box-shadow: 0 18px 44px rgba(16, 17, 20, 0.16);
  animation: iosMenuIn .18s cubic-bezier(.22, 1, .36, 1) both;
  transform-origin: bottom left;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ios-chat .mention-dropdown { background: var(--panel); }
}
.ios-chat .mention-dropdown-item { border-radius: 12px; transition: transform .12s ease, background .15s ease; }
.ios-chat .mention-dropdown-item:active { transform: scale(.98); }


.ios-chat .chat-attach-chip {
  border-radius: 999px;
  padding: 5px 6px 5px 11px;
  gap: 7px;
  animation: iosBarIn .2s cubic-bezier(.22, 1, .36, 1) both;
}


.ios-chat .chat-attach-chip button {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(22, 24, 29, 0.08);
  font-size: 10px; line-height: 1;
  transition: transform .12s ease, background .15s ease;
}
.ios-chat .chat-attach-chip button:hover { background: rgba(22, 24, 29, 0.16); }
.ios-chat .chat-attach-chip button:active { transform: scale(.88); }


.ios-chat-layout .chat-item-unread-pill { border-radius: 999px; padding: 3px 10px; }
.ios-chat-layout .chat-item-unread-count { border-radius: 999px; }




.ios-chat .chat-recording-ui {
  border-radius: 16px;
  animation: iosBarIn .2s cubic-bezier(.22, 1, .36, 1) both;
}
.ios-chat .chat-recording-ui .chat-send-btn { transition: transform .12s ease; }
.ios-chat .chat-recording-ui .chat-send-btn:active { transform: scale(.9); }
.ios-chat .chat-recording-ui .btn.secondary { border-radius: 999px; transition: transform .12s ease; }
.ios-chat .chat-recording-ui .btn.secondary:active { transform: scale(.94); }


.ios-chat .chat-video-record { animation: iosSheetIn .26s cubic-bezier(.22, 1, .36, 1) both; }
.ios-chat .cvr-hint { opacity: .9; }
.ios-chat .cvr-cancel { border-radius: 999px; transition: transform .12s ease; }
.ios-chat .cvr-cancel:active { transform: scale(.94); }
.ios-chat .cvr-send { transition: transform .12s ease; }
.ios-chat .cvr-send:active { transform: scale(.92); }





@media (prefers-reduced-motion: reduce) {
  .modal.ios-modal,
  .modal.ios-modal.modal-sheet,
  .modal-backdrop.ios-backdrop,
  .ios-chat .voice-speed-menu,
  .ios-chat .voice-transcript-result,
  .ios-chat .mention-dropdown,
  .ios-chat .chat-attach-chip,
  .ios-chat .chat-recording-ui,
  .ios-chat .chat-video-record { animation: none; }
}


.chat-attach-image-chip { position: relative; padding: 4px; }
.chat-attach-image-chip img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; display: block; }
.chat-attach-image-chip button {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  background: var(--panel); border-radius: 50%; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


.chat-order-card {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.18);
  border-radius: 12px; padding: 8px 12px; margin-top: 8px;
  cursor: pointer; transition: background 0.15s;
}
.chat-order-card:hover { background: rgba(255,255,255,0.3); }
.chat-bubble-row:not(.mine) .chat-order-card { background: var(--panel-2); }
.chat-bubble-row:not(.mine) .chat-order-card:hover { background: var(--border); }
.chat-order-card-icon { font-size: 18px; flex-shrink: 0; }
.chat-order-card-title { font-size: 12.5px; font-weight: 600; }
.chat-order-card-sub { font-size: 11px; opacity: 0.8; }





.chat-task-card {
  background: rgba(255,255,255,0.18);
  border-radius: 12px; padding: 10px 12px; margin-top: 8px;
  border-left: 3px solid var(--gray);
}
.chat-bubble-row:not(.mine) .chat-task-card { background: var(--panel-2); }
.chat-task-card-head { display: flex; align-items: flex-start; gap: 8px; }
.chat-task-card-icon { font-size: 17px; flex-shrink: 0; line-height: 1.3; }
.chat-task-card-main { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.chat-task-card-title { font-size: 12.5px; font-weight: 600; }
.chat-task-card-price { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.chat-task-card-desc { font-size: 12px; opacity: 0.85; margin-top: 4px; white-space: pre-wrap; }
.chat-task-card-sub { font-size: 11px; opacity: 0.75; margin-top: 6px; font-weight: 600; }
.chat-task-card-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-task-card-actions .btn.small { padding: 5px 10px; font-size: 11.5px; }


.chat-task-status-open { border-left-color: var(--accent-ink); }
.chat-task-status-taken { border-left-color: var(--yellow); }
.chat-task-status-taken .chat-task-card-sub { color: var(--yellow); }
.chat-task-status-done { border-left-color: var(--yellow); }
.chat-task-status-done .chat-task-card-sub { color: var(--yellow); }
.chat-task-status-paid { border-left-color: var(--green); }
.chat-task-status-paid .chat-task-card-sub { color: var(--green); }
.chat-task-status-cancelled { border-left-color: var(--red); opacity: 0.75; }
.chat-task-status-cancelled .chat-task-card-sub { color: var(--red); }








.tasks-filter { display: inline-flex; background: var(--panel-2); padding: 3px; border-radius: 10px; gap: 2px; margin-bottom: 14px; }
.tasks-filter button {
  border: none; background: transparent; padding: 6px 12px; border-radius: 8px;
  font-weight: 600; font-size: 12.5px; color: var(--text-dim); cursor: pointer; font-family: inherit;
}
.tasks-filter button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }


.tasks-head-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tasks-hist-link {
  margin-left: auto; align-self: center; margin-bottom: 14px;
  border: 0; background: transparent; font: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--text-dim); cursor: pointer; text-decoration: none;
}


.tasks-hist-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }




.task-row-del {
  flex: none; align-self: center; margin-left: auto;
  border: 0; background: transparent; padding: 6px; border-radius: 8px; cursor: pointer;
  color: var(--text-dim); line-height: 0; opacity: 0; transition: opacity .12s;
}
.task-row:hover .task-row-del, .task-row-del:focus-visible { opacity: 1; }
.task-row-del:hover { background: rgba(220, 38, 38, 0.1); color: var(--red); }
.task-row-del svg { width: 16px; height: 16px; }

@media (hover: none) { .task-row-del { opacity: 1; } }


.btn.task-del-danger { background: #dc2626; border-color: #dc2626; }
.btn.task-del-danger:hover { background: #b91c1c; border-color: #b91c1c; }



.task-hist {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 12px; margin-bottom: 5px;
  background: var(--panel-2); border-radius: 12px; border-left: 3px solid var(--green);
}
.task-hist.removed { border-left-color: #c2410c; }
.task-hist-main { min-width: 0; flex: 1; }
.task-hist-text { font-weight: 600; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.task-hist.removed .task-hist-text { text-decoration: line-through; color: var(--text-dim); }
.task-hist-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; font-size: 11.5px; color: var(--text-dim); }
.task-hist-mark {
  flex: none; align-self: center; font-size: 11px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.task-hist-mark.ok { background: var(--green-soft); color: var(--green-ink); }
.task-hist-mark.rm { background: var(--orange-soft); color: var(--orange-ink); }
.task-hist-back {
  flex: none; align-self: center; border: 0; background: transparent; font: inherit;
  font-size: 12px; font-weight: 700; color: var(--text-dim); cursor: pointer;
  text-decoration: none; padding: 4px 6px; white-space: nowrap;
}
.task-hist-back:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }
.task-hist-back:disabled { opacity: 0.5; cursor: progress; }
@media (max-width: 640px) {

  .task-hist { flex-wrap: wrap; }
  .task-hist-main { flex: 1 1 100%; }
}






.tasks-filter-kind { display: inline-flex; flex-wrap: wrap; margin-bottom: 8px; }
.tasks-filter-kind button { font-size: 13px; padding: 7px 14px; }


.tasks-filter-count {
  margin-left: 6px; padding: 1px 6px; border-radius: 999px;
  background: var(--panel); color: var(--text-dim);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.tasks-filter-kind button.active .tasks-filter-count { background: var(--panel-2); color: var(--text); }
@media (max-width: 640px) {

  .tasks-filter-kind { width: 100%; }
  .tasks-filter-kind button { flex: 1 1 auto; }
}



.cal-task-order-goto { margin-top: 8px; }
.task-group { margin-bottom: 18px; }
.task-group:last-child { margin-bottom: 0; }
.task-group-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 8px; font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-dim);
  cursor: default;
}
.task-group-done summary.task-group-head { cursor: pointer; }
.task-group-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  border-radius: 9px; background: var(--panel-2); color: var(--text-dim);
  font-size: 11px; font-weight: 700;
}
.task-group-overdue .task-group-head { color: var(--red); }
.task-group-overdue .task-group-count { background: var(--red-soft); color: var(--red); }




.task-group-day { margin-bottom: 14px; }
.task-group-day .task-group-head {
  text-transform: none; letter-spacing: 0;
  font-size: 12.5px; color: var(--text);
}
.task-group-day .task-group-head::after {
  content: ''; flex: 1 1 auto; height: 1px; background: var(--border); margin-left: 2px;
}
.task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; margin-bottom: 6px;
  background: var(--panel-2); border-radius: 12px;
  border-left: 3px solid var(--gray);
}
.task-row.cal-priority-low { border-left-color: var(--gray); }
.task-row.cal-priority-medium { border-left-color: var(--accent-ink); }
.task-row.cal-priority-high { border-left-color: #c2410c; }
.task-row.done { opacity: 0.6; border-left-color: var(--green); }




.task-row-check { width: auto; height: auto; margin-top: 3px; flex: none; }
.task-row-main { flex: 1; min-width: 0; }
.task-row-text {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere;
}





.task-row { transition: background 0.12s ease; }
.task-row:hover { background: var(--border); }
.task-row.done:hover { background: var(--panel-2); }
.task-row-text:hover { text-decoration: none; }
.task-row.done .task-row-text { text-decoration: line-through; }
.task-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: 11.5px; color: var(--text-dim); }
.task-row.overdue .task-row-date { color: var(--red); font-weight: 700; }
.task-row-pill { padding: 1px 7px; border-radius: 8px; background: var(--panel); }

.task-row-pill-out { background: var(--dir-out-bg); color: var(--dir-out-ink); }

.task-files { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.task-file-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.task-file-row.pending { color: var(--text-dim); }



.task-file-row a { color: var(--text); text-decoration: none; font-weight: 600; }
.task-file-row a:hover { text-decoration: underline; text-underline-offset: 2px; }
.task-file-note { font-size: 11px; }
.task-file-empty { font-size: 12px; color: var(--text-dim); }
.task-file-remove { border: none; background: none; cursor: pointer; color: var(--text-dim); font-size: 13px; padding: 2px 4px; }
.task-file-remove:hover { color: var(--red); }







.chat-assign-card {
  background: rgba(255,255,255,0.18);
  border-radius: 12px; padding: 10px 12px; margin-top: 8px;
  border-left: 3px solid var(--gray);
}



.chat-bubble-row:not(.mine) .chat-assign-card {
  background: var(--panel-2);
  box-shadow: inset 0 0 0 1px var(--border);
}
.chat-assign-card.cal-priority-low { border-left-color: var(--gray); }
.chat-assign-card.cal-priority-medium { border-left-color: var(--accent-ink); }
.chat-assign-card.cal-priority-high { border-left-color: #c2410c; }
.chat-assign-head { display: flex; align-items: center; gap: 8px; }
.chat-assign-icon { font-size: 15px; line-height: 1.2; }
.chat-assign-who { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; opacity: 0.8; }
.chat-assign-text { font-size: 13px; font-weight: 600; margin-top: 5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-assign-meta { font-size: 11px; opacity: 0.75; margin-top: 4px; }
.chat-assign-sub { font-size: 11px; opacity: 0.75; margin-top: 6px; font-weight: 600; }
.chat-assign-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chat-assign-actions .btn.small { padding: 5px 10px; font-size: 11.5px; }


.chat-assign-card.done { opacity: 0.65; border-left-color: var(--green); }
.chat-assign-card.done .chat-assign-text { text-decoration: line-through; }

.emoji-picker {
  display: none;
  position: absolute;


  bottom: calc(100% + 8px); right: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.2);
  padding: 10px;
  width: 260px;
  max-height: 200px;
  overflow-y: auto;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  z-index: 30;
}
.emoji-picker.open { display: grid; }
.emoji-picker button {
  background: none; border: none; cursor: pointer;
  font-size: 18px; padding: 4px; border-radius: 6px;
}
.emoji-picker button:hover { background: var(--panel-2); }














.chat-textarea-wrap { position: relative; flex: 1 1 0%; min-width: 130px; }
.chat-textarea-wrap textarea { padding-right: 38px; }
.chat-emoji-inline-btn {
  position: absolute; right: 4px; bottom: 4px;
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-dim);
  transition: background .15s ease, transform .1s ease;
}
.chat-emoji-inline-btn:hover { background: var(--panel-2); }
.chat-emoji-inline-btn:active { transform: scale(0.92); }







.chat-attach-wrap { position: relative; flex-shrink: 0; }
.chat-attach-menu {
  display: none;
  position: absolute;
  bottom: 56px; left: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.2);
  padding: 6px;
  min-width: 190px;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}
.chat-attach-menu.open { display: flex; }
.chat-attach-menu-item {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 9px 10px; border-radius: 8px;
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text);
}
.chat-attach-menu-item:hover { background: var(--panel-2); }



.mention-dropdown {
  display: none;
  position: absolute;
  bottom: 56px; left: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(16,17,20,0.2);
  padding: 6px;
  width: 240px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 30;
}
.mention-dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.mention-dropdown-item:hover { background: var(--panel-2); }




.chat-mention { font-weight: 700; border-radius: 4px; padding: 0 3px; }
.chat-bubble-row:not(.mine) .chat-mention { color: var(--accent-ink); background: var(--accent-soft); }
.chat-bubble-row.mine .chat-mention { color: #fff; background: rgba(255,255,255,0.28); }



.chat-bubble-row.mentions-me .chat-bubble { box-shadow: 0 0 0 2px var(--yellow, #f5a623) inset; }













@media (max-width: 600px) {
  .chat-bubble-col { max-width: min(82%, 420px); }
  .chat-bubble { font-size: 14px; padding: 8px 12px; }
  .chat-messages { padding: 14px 10px; gap: 8px; }
}
@media (max-width: 380px) {
  .chat-bubble-col { max-width: min(88%, 320px); }
  .chat-bubble { font-size: 14.5px; }
}







@media (max-width: 1040px) {
  .chat-layout { height: calc(100vh - 130px); height: calc(100dvh - 130px); border-radius: 14px; --chat-pane-inner-radius: 13px; }
  .chat-list { width: 100%; }
  .chat-list.hide-on-mobile-thread { display: none; }
  .chat-thread { display: none; }
  .chat-thread.active-on-mobile { display: flex; }
  .chat-item-preview { max-width: 55vw; }





  .chat-item.active { background: transparent; }










  body.chat-pinned-mobile,
  body.chat-pinned-mobile main { overflow: hidden; }


















  body.chat-pinned-mobile .mobile-menu-btn { display: flex; }
  body.chat-pinned-mobile .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    max-width: 82vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(16,17,20,0.2);
  }
  body.chat-pinned-mobile .sidebar.open { transform: translateX(0); }
  body.chat-pinned-mobile .sidebar .brand { padding-left: 44px; } /* не наезжать на кнопку меню */
  body.chat-pinned-mobile .chat-layout {
    position: fixed;
    top: var(--vv-top, 0px);
    left: 0; right: 0;


    height: var(--vv-height, 100dvh);
    min-height: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    --chat-pane-inner-radius: 0px;

    z-index: 40;
  }





  body.chat-thread-open .mobile-menu-btn { display: none; }




  body.chat-pinned-mobile main .topbar { display: none; }







  body.chat-pinned-mobile:not(.chat-thread-open) .chat-list-head {
    position: relative;
    justify-content: flex-end;
    padding-left: 64px;














    min-height: 60px;
  }
  body.chat-pinned-mobile:not(.chat-thread-open) .chat-list-head h3 {
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    pointer-events: none;
  }





  body.chat-pinned-mobile .chat-head-icon-btn { display: inline-flex; }
  body.chat-pinned-mobile .chat-folder-chip-archive { display: none; }


  body.chat-pinned-mobile .chat-folder-chips:not(.has-folders) { display: none; }





  body.chat-pinned-mobile .chat-item {
    align-items: center;
    padding: 9px 14px 9px 0;
    margin-left: 14px;
    border-bottom: none;
    border-left: none;
    gap: 12px;
  }
  body.chat-pinned-mobile .chat-item-swipe + .chat-item-swipe .chat-item { border-top: 1px solid var(--border); }
  body.chat-pinned-mobile .chat-item-name { font-size: 15px; font-weight: 600; }




  body.chat-pinned-mobile .dlg-item-name { font-size: 15px; font-weight: 600; }
  body.chat-pinned-mobile .chat-item-preview { font-size: 13.5px; margin-top: 1px; max-width: none; }
  body.chat-pinned-mobile .chat-item-time { font-size: 12px; }


  body.chat-pinned-mobile .chat-item-pin-emoji,
  body.chat-pinned-mobile .chat-item-group-emoji { display: none; }
  body.chat-pinned-mobile .chat-item-pin-mark { display: inline; color: var(--text-dim); margin-right: 4px; vertical-align: -1px; }


  body.chat-pinned-mobile .chat-item-unread-pill { display: none; }
  body.chat-pinned-mobile .chat-item-menu-btn { display: none; }


  .chat-item-swipe { position: relative; overflow: hidden; background: var(--panel); }
  .chat-item-swipe .chat-item {
    position: relative; z-index: 1;
    background: var(--panel);



    touch-action: pan-y;
    transition: transform .22s cubic-bezier(.22,.61,.36,1);
  }


  .chat-item-actions {
    position: absolute; top: 0; right: 0; bottom: 0;
    display: flex; z-index: 0;
  }
  .chat-item-action {
    width: 74px; border: none; cursor: pointer;
    background: var(--panel-2); color: var(--text);
    font-size: 12.5px; font-weight: 600;
  }
  .chat-item-action.more { background: var(--text); color: var(--panel); }





  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe {
    animation: chat-row-in .28s cubic-bezier(.22,.61,.36,1) both;
  }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(1) { animation-delay: .01s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(2) { animation-delay: .04s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(3) { animation-delay: .07s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(4) { animation-delay: .10s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(5) { animation-delay: .13s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(6) { animation-delay: .16s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(7) { animation-delay: .19s; }
  body.chat-pinned-mobile .chat-items-appear .chat-item-swipe:nth-child(8) { animation-delay: .22s; }
  body.chat-pinned-mobile .chat-item:active { background: var(--panel-2); }





  body.chat-pinned-mobile .chat-thread.active-on-mobile {
    animation: chat-thread-in .2s cubic-bezier(.22, .61, .36, 1);
  }







  body.chat-pinned-mobile .chat-thread-head {
    padding: 7px 8px 7px 6px; gap: 8px;
    background: color-mix(in srgb, var(--panel) 82%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: none;



    position: relative;
  }
  body.chat-pinned-mobile .chat-thread-head::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0;
    height: 1px; background: var(--border);
    transform: scaleY(.5); transform-origin: bottom;
  }


  body.chat-pinned-mobile .chat-back-btn {
    width: 32px; height: 32px; padding: 0; border-radius: 50%;
    display: inline-flex !important; align-items: center; justify-content: center;
    font-size: 17px; flex-shrink: 0;
  }
  body.chat-pinned-mobile .chat-thread-group-emoji { display: none; }



















  body.chat-pinned-mobile .chat-thread-title { gap: 9px; }
  body.chat-pinned-mobile .chat-head-actions { gap: 4px; }


  body.chat-pinned-mobile .chat-thread-name {
    font-size: 15.5px; font-weight: 700; letter-spacing: -.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }



  body.chat-pinned-mobile .dlg-thread-name {
    font-size: 15.5px; font-weight: 700; letter-spacing: -.2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.chat-pinned-mobile .chat-thread-sub {
    font-size: 11.5px; margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  body.chat-pinned-mobile .chat-head-emoji { display: none; }
  body.chat-pinned-mobile .chat-head-glyph { display: inline-flex; }
  body.chat-pinned-mobile .chat-thread-head .chat-composer-btn {
    width: 34px; height: 34px; padding: 0;
    background: none; border: none; color: var(--text);
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  body.chat-pinned-mobile .chat-thread-head .chat-composer-btn:active { opacity: .45; }








  body.chat-pinned-mobile .chat-pinned-bar {
    padding: 8px 12px; gap: 10px; align-items: stretch;
    background: var(--panel);
  }


  body.chat-pinned-mobile .chat-pinned-bar.is-loading { background: var(--panel-2); }
  body.chat-pinned-mobile .chat-pinned-strips {
    display: flex; flex-direction: column; gap: 2px; justify-content: center;
    flex-shrink: 0; padding: 1px 0;
  }



  body.chat-pinned-mobile .chat-pinned-strips span {
    width: 3px; height: 12px; border-radius: 2px;
    background: var(--border);
  }
  body.chat-pinned-mobile .chat-pinned-strips span.on { background: var(--chat-bubble-mine); }
  body.chat-pinned-mobile .chat-pinned-body { flex: 1; min-width: 0; cursor: pointer; }
  body.chat-pinned-mobile .chat-pinned-label {
    font-size: 11px; color: var(--chat-bubble-mine); font-weight: 700;
    letter-spacing: .1px;
  }
  body.chat-pinned-mobile .chat-pinned-body .chat-pinned-snippet {
    display: block; font-size: 13px; color: var(--text); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.chat-pinned-mobile .chat-pinned-open-list {
    flex-shrink: 0; align-self: center;
    width: 28px; height: 28px; border: none; border-radius: 8px;
    background: none; color: var(--text-dim); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
  }



  .modal.modal-sheet h3 { text-align: center; font-size: 15px; margin: 0 0 12px; }


  .modal.modal-sheet .modal-actions { flex-direction: column; gap: 8px; margin-top: 14px; }
  .modal.modal-sheet .modal-actions .btn { width: 100%; padding: 12px; border-radius: 14px; }


  .pinned-sheet-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; }
  .pinned-sheet-row + .pinned-sheet-row { border-top: 1px solid var(--border); }
  .pinned-sheet-bar { width: 2px; align-self: stretch; border-radius: 1px; background: var(--chat-bubble-mine); flex-shrink: 0; }
  .pinned-sheet-body { flex: 1; min-width: 0; }
  .pinned-sheet-author { font-size: 12.5px; font-weight: 600; }
  .pinned-sheet-text {
    font-size: 12px; color: var(--text-dim); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .pinned-sheet-unpin {
    flex-shrink: 0; width: 28px; height: 28px; border: none; border-radius: 50%;
    background: none; color: var(--text-dim); font-size: 15px; cursor: pointer;
  }




  .modal.modal-sheet .media-tabs { gap: 6px; border-bottom: none; margin-bottom: 12px; }
  .modal.modal-sheet .media-tab {
    border: none; border-radius: 20px; padding: 6px 12px;
    background: var(--panel-2); color: var(--text-dim); font-size: 12px;
  }
  .modal.modal-sheet .media-tab.active { background: var(--text); color: var(--panel); }

  .modal.modal-sheet .media-photo-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  }
  .modal.modal-sheet .media-photo-thumb {
    width: 100%; aspect-ratio: 1; height: auto;
    object-fit: cover; border-radius: 10px;
  }









  body.chat-pinned-mobile .chat-bubble-actions { display: none; }



  body.chat-pinned-mobile .chat-bubble {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }





  .chat-ctx-menu.chat-ctx-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto; max-width: none;
    max-height: 78vh; overflow-y: auto;
    border-radius: 20px 20px 0 0;
    border-left: none; border-right: none; border-bottom: none;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    transform: translate3d(0, 100%, 0);
    transition: transform .26s cubic-bezier(.22, .61, .36, 1);
    z-index: 61;
  }
  .chat-ctx-menu.chat-ctx-sheet.visible { transform: none; }

  .chat-ctx-menu.chat-ctx-sheet::before {
    content: ''; display: block;
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border); margin: 8px auto 6px;
  }
  .chat-ctx-menu.chat-ctx-sheet .chat-ctx-menu-item { padding: 13px 18px; font-size: 14.5px; }
  .chat-ctx-menu.chat-ctx-sheet .msg-reactions-bar { padding: 4px 10px 10px; justify-content: space-around; }
  .chat-ctx-menu.chat-ctx-sheet .msg-reaction-opt { font-size: 24px; }




  .modal.modal-sheet {
    width: 100%; max-width: none;
    margin-top: auto;              /* прижимаем к низу подложки-флексбокса */
    max-height: 88vh;
    border-radius: 22px 22px 0 0;
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: chat-sheet-up .26s cubic-bezier(.22, .61, .36, 1);
  }
  .modal.modal-sheet::before {
    content: ''; display: block;
    width: 36px; height: 4px; border-radius: 2px;
    background: var(--border); margin: 0 auto 12px;
  }










  input, textarea, select { font-size: 16px; }








  .chat-search input,
  .chat-search-bar input,
  .chat-ctx-menu-new-folder input { font-size: 16px; }










  body.chat-pinned-mobile .chat-composer {
    border-top: none;
    background: transparent;








    padding: 8px 10px calc(18px + env(safe-area-inset-bottom, 0px));
  }
  body.chat-pinned-mobile .chat-composer-normal {



    align-items: center;
    gap: 6px;
    padding: 5px;
    background: var(--panel);
    border: 1px solid var(--border);


    border-radius: 26px;
    box-shadow: 0 6px 22px rgba(16, 17, 20, 0.12);
  }


  body.chat-pinned-mobile .chat-composer textarea {
    background: transparent;
    border: none;
    box-shadow: none;
    min-height: 36px;
    padding: 8px 34px 8px 10px;
    border-radius: 18px;
  }



  body.chat-pinned-mobile .chat-composer-btn,
  body.chat-pinned-mobile .chat-send-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
  }
  body.chat-pinned-mobile .chat-composer-btn {
    background: transparent;
    color: var(--text-dim);
    font-size: 20px;
  }
  body.chat-pinned-mobile .chat-composer-btn:active { background: var(--panel-2); }
  body.chat-pinned-mobile .chat-emoji-inline-btn { right: 6px; bottom: 7px; }


  body.chat-pinned-mobile .chat-recording-ui {
    padding: 5px 8px 5px 14px;
    gap: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 26px;
    box-shadow: 0 6px 22px rgba(16, 17, 20, 0.12);
  }



  body.chat-pinned-mobile .recording-hint { display: none; }






  body.chat-pinned-mobile #chat-recording-cancel {
    background: none; border: none; padding: 0 4px;
    color: var(--text-dim); font-size: 13px; width: auto; min-width: 0;
    margin-left: auto;
  }


  body.chat-pinned-mobile .chat-attach-preview,
  body.chat-pinned-mobile .chat-length-counter { padding-left: 18px; padding-right: 18px; }
  body.chat-pinned-mobile .chat-reply-preview { margin-left: 14px; margin-right: 14px; }
}

@keyframes chat-row-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to { opacity: 1; transform: none; }
}




@keyframes chat-thread-in {
  from { transform: translate3d(16px, 0, 0); }
  to { transform: none; }
}
@keyframes chat-sheet-up {
  from { transform: translate3d(0, 100%, 0); }
  to { transform: none; }
}




.chat-sheet-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(16, 17, 20, 0.35);
  opacity: 0;
  transition: opacity .22s ease;
}
.chat-sheet-backdrop.visible { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .chat-items-appear .chat-item-swipe { animation: none !important; }
  .chat-thread.active-on-mobile { animation: none !important; }
  .chat-item-swipe .chat-item { transition: none; }
}



.chat-head-icon-btn {
  display: none;
  width: 30px; height: 30px; border-radius: 50%;
  border: none; background: var(--panel-2); color: var(--text-dim);
  cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-head-icon-btn.active { background: var(--text); color: var(--panel); }


@media (max-width: 380px) {
  body.chat-pinned-mobile .chat-composer-btn,
  body.chat-pinned-mobile .chat-send-btn { width: 32px; height: 32px; }
  body.chat-pinned-mobile .chat-composer textarea { min-height: 32px; padding: 6px 30px 6px 8px; }
}












:root { --toast-shadow: 0 18px 44px -12px rgba(22, 26, 38, .24), 0 3px 10px rgba(22, 26, 38, .07); }
:root[data-theme="dark"] { --toast-shadow: 0 22px 50px -12px rgba(0, 0, 0, .7), 0 3px 10px rgba(0, 0, 0, .4); }
#toast-root {
  position: fixed;
  top: 14px; right: 14px;
  z-index: 3000;
  width: min(380px, calc(100vw - 28px));
  height: 0;
}


.toast-slot {
  position: absolute;
  left: 0; right: 0; top: 0;
  transform-origin: 50% 100%;
  transition: transform .34s var(--ease-spring), opacity .2s ease;
}
.toast-card {
  --tone: var(--dlg-accent); --tone-soft: var(--pastel-blue-bg);
  position: relative;
  overflow: hidden;
  padding: 13px 14px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--toast-shadow);
  color: var(--text);
  cursor: pointer;
  animation: toast-in 0.38s var(--ease-spring);
}
.toast-card.toast-ok { --tone: var(--green); --tone-soft: var(--green-soft); }
.toast-card.toast-err { --tone: var(--red); --tone-soft: var(--red-soft); }
.toast-card.toast-warn { --tone: var(--yellow); --tone-soft: var(--yellow-soft); }
.toast-card.toast-ai { --tone: var(--tint-vip-text); --tone-soft: var(--tint-vip-bg); }
.toast-card.toast-muted { --tone: var(--text-dim); --tone-soft: var(--panel-2); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-22px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .toast-card { animation: none; }
}
.toast-top { display: flex; align-items: flex-start; gap: 11px; }


.toast-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; line-height: 1;
  background: var(--tone-soft);
  color: var(--tone);
}

.toast-icon.toast-ava { position: relative; background: none; border-radius: 50%; }
.toast-ava-letter, .toast-ava .avatar-img-fill {
  width: 100%; height: 100%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700; object-fit: cover;
}
.toast-ava-badge {
  position: absolute; right: -3px; bottom: -3px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--panel);
  background: var(--tone); color: #fff;
  display: flex; align-items: center; justify-content: center;
}

.toast-ava .dlg-avatar { width: 38px; height: 38px; position: relative; }
.toast-ava .dlg-avatar-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}
.toast-ava .dlg-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.toast-ava .dlg-avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--panel); background-color: var(--panel);
  object-fit: cover; display: block;
}
.toast-body { flex: 1; min-width: 0; }
.toast-head { display: flex; align-items: baseline; gap: 8px; }
.toast-title {
  flex: 1; min-width: 0;
  font-weight: 700; font-size: 13.5px; line-height: 1.3;


  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}
.toast-time { flex-shrink: 0; font-size: 11.5px; color: var(--text-dim); }
.toast-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; min-width: 0; }
.toast-meta::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); flex-shrink: 0; }
.toast-chip {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--tone-soft); color: var(--tone);
}
.toast-text {
  margin-top: 2px;
  font-size: 13px; line-height: 1.4; color: var(--text-dim);
  overflow-wrap: anywhere;


  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

.toast-text.toast-bubble {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--panel-2);
  border-radius: 14px 14px 14px 4px;
  color: var(--text);
  line-height: 1.45;



  display: block; -webkit-line-clamp: unset;
}
.toast-bubble-text {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
  overflow: hidden; overflow-wrap: anywhere;
}
.toast-acts { display: flex; gap: 8px; margin-top: 11px; }
.toast-acts button {
  border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px;
  background: var(--panel-2); color: var(--text);
  transition: background .12s, filter .12s, transform .12s;
}
.toast-acts button:active { transform: scale(.97); }
.toast-acts .toast-open { flex: 1; background: var(--accent); color: #fff; }
.toast-acts .toast-open:hover { filter: brightness(1.15); }
.toast-acts .toast-later:hover { background: var(--accent-soft); }

.toast-card.toast-mini { padding: 10px 12px; border-radius: 16px; }
.toast-mini .toast-top { align-items: center; }
.toast-mini .toast-icon { width: 32px; height: 32px; border-radius: 10px; }
.toast-mini .toast-time { display: none; }


.toast-timer { position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; pointer-events: none; }
.toast-timer i { display: block; height: 100%; background: var(--tone); opacity: .55; transform-origin: left; animation: toastTimer var(--toast-life, 8s) linear forwards; }
.toast-card.toast-paused .toast-timer i { animation-play-state: paused; }
@keyframes toastTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.toast-close {
  position: relative;
  width: 26px; height: 26px; padding: 0; margin: -3px -4px 0 0;
  border: none; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .12s, color .12s;
}
.toast-close:hover { background: var(--panel-2); color: var(--text); }
.toast-mini .toast-close { margin: 0 -2px 0 0; }
@media (pointer: coarse) {



  .toast-close {
    width: 30px; height: 30px;
    background: var(--panel-2);
    color: var(--text);
  }
  .toast-close::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
  }
}


.toast-slot.toast-behind .toast-card { cursor: default; }
.toast-card > * { transition: opacity .18s ease; }
.toast-slot.toast-behind .toast-card > * { opacity: 0; }
.toast-slot.toast-behind .toast-card { transition: height .26s var(--ease-out), transform .22s ease, opacity .22s ease; }
.toast-more {
  position: absolute; right: 0;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); color: var(--text-dim);
  box-shadow: var(--toast-shadow);
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 12px; cursor: pointer;
  transition: top .34s var(--ease-spring), color .12s;
  animation: toast-more-in .22s var(--ease-out);
}
.toast-more:hover { color: var(--text); }
.toast-more[hidden] { display: none; }
@keyframes toast-more-in { from { opacity: 0; transform: translateY(-6px); } }



.toast-card { touch-action: none; }
.toast-card.toast-gone {
  transform: translateY(-130%);
  opacity: 0;
  transition: transform .22s cubic-bezier(.3, 0, .8, .15), opacity .22s ease;
}

.toast-slot.toast-behind .toast-card.toast-gone { transform: none; }


.toast-card { transition: transform .22s cubic-bezier(.22, 1.2, .36, 1), opacity .22s ease; }
@media (prefers-reduced-motion: reduce) {
  .toast-card, .toast-card.toast-gone, .toast-slot, .toast-more { transition: none; }
}

@media (max-width: 600px) {

  #toast-root { top: 10px; right: 10px; left: 10px; width: auto; }
}


.nav-orders-toggle { position: relative; }
.nav-caret {
  width: 14px; flex-shrink: 0; text-align: center;
  font-size: 10px; color: var(--text-dim);
  transition: transform 0.15s ease;
}
.nav-orders-toggle.active .nav-caret { color: rgba(255,255,255,0.7); }
.nav-orders-toggle.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-count-badge {
  margin-left: auto;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11px; font-weight: 700;
  border-radius: 20px; padding: 2px 8px;
  flex-shrink: 0;
}
.nav-orders-toggle.active .nav-count-badge { background: rgba(255,255,255,0.18); color: #fff; }

.nav-substatus-list {
  display: flex; flex-direction: column; gap: 2px;
  margin: 2px 0 4px 0;
}
.nav-substatus {
  display: flex; align-items: center;
  padding: 7px 12px 7px 34px; /* отступ вправо от иконки родителя, как вложенный пункт */
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 12.5px;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav-substatus:hover { background: var(--panel-2); color: var(--text); }
.nav-substatus.active { background: var(--panel-2); color: var(--text); font-weight: 700; }
.nav-substatus-count { margin-left: auto; font-weight: 700; font-size: 11.5px; }
.new-pill {
  display: inline-block; background: var(--red); color: #fff; font-size: 9.5px;
  font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; border-radius: 20px;
  padding: 1px 6px; margin-left: 4px; vertical-align: middle; animation: new-pill-pulse 1.8s ease-in-out infinite;
}
@keyframes new-pill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }












.cl-page .page-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:20px; }
.cl-page .page-title { font-size:20px; font-weight:800; letter-spacing:-0.01em; margin:0 0 4px; color:var(--text); }
.cl-page .page-sub { font-size:13px; color:var(--text-dim); margin:0; }

.ms-page .segmented {
  display:inline-flex; background:var(--panel-2); padding:3px; border-radius:10px; gap:2px;
}
.ms-page .segmented button {
  border:none; background:transparent; padding:7px 14px; border-radius:8px;
  font-weight:600; font-size:13px; color:var(--text-dim); cursor:pointer; font-family:inherit;
}
.ms-page .segmented button.active { background:var(--panel); color:var(--text); box-shadow:var(--shadow); }

.ms-page .custom-range { display:none; align-items:center; gap:8px; margin-top:10px; font-size:13px; }
.ms-page .custom-range.visible { display:flex; flex-wrap:wrap; }
.ms-page .custom-range input[type=date] { width:auto; height:auto; border:1px solid var(--border); border-radius:8px; padding:7px 10px; background:var(--panel); }
.ms-page .custom-range span { color:var(--text-dim); }

.ms-page .filters-bar, .cl-page .filters-bar { display:flex; align-items:flex-start; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.ms-page .filters-left, .cl-page .filters-left { display:flex; flex-direction:column; gap:4px; }
.ms-page .chip-group, .cl-page .chip-group { display:flex; gap:6px; flex-wrap:wrap; }
.ms-page .chip, .cl-page .chip {
  border:1px solid var(--border); background:var(--panel); padding:6px 13px; border-radius:999px;
  font-size:12.5px; font-weight:600; cursor:pointer; color:var(--text-dim);
}
.ms-page .chip.active, .cl-page .chip.active { background:var(--accent); border-color:var(--accent); color:#fff; }

.ms-page .icon-btn, .cl-page .icon-btn {
  width:28px; height:28px; display:inline-flex; align-items:center; justify-content:center;
  border-radius:8px; border:1px solid var(--border); background:var(--panel); color:var(--text-dim); cursor:pointer;
}
.ms-page .icon-btn:hover, .cl-page .icon-btn:hover { background:var(--panel-2); color:var(--text); }
.ms-page .icon-btn.danger:hover, .cl-page .icon-btn.danger:hover { background:var(--red-soft); color:var(--red); border-color:var(--red); }

@media (max-width:640px) {
  .cl-page .page-header { flex-direction:column; align-items:stretch; }
}


.broadcast-recipients-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 6px;
}
.broadcast-recipient-search {
  margin-bottom: 8px;
}
.broadcast-recipients-list {
  max-height: 260px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 12px;
  padding: 4px 12px;
}
.broadcast-recipient-row { border-bottom: 1px solid var(--border); gap: 10px; }
.broadcast-recipient-row:last-child { border-bottom: none; }
.broadcast-recipient-row .avatar-sm { flex-shrink: 0; }
.broadcast-recipient-row .contact-pick-info { flex: 1; min-width: 0; }
.broadcast-no-match { padding: 16px 0; }


.response-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px;
  cursor: pointer; transition: background 0.12s;
}
.response-card:hover { background: var(--panel-2); }
.response-card:last-child { margin-bottom: 0; }
.response-card-info { flex: 1; min-width: 0; }
.response-card-name { font-weight: 600; font-size: 14px; }
.response-card-presence { font-size: 12px; color: var(--text-dim); margin-top: 1px; }
.response-card-presence.online { color: var(--green); font-weight: 600; }
.response-card-message { font-size: 13px; color: var(--text); margin-top: 3px; }


.nav-badge-pill {
  margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 11px;
  font-weight: 600; background: var(--orange-soft); color: var(--orange);
}




.nav-badge-new {
  margin-left: 8px; padding: 2px 7px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.04em;
  background: #0a84ff; color: #fff; line-height: 1.5;







  animation: navBadgeNewBlink 1.5s ease-in-out infinite;
}
@keyframes navBadgeNewBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}


@media (prefers-reduced-motion: reduce) {
  .nav-badge-new { animation: none; }
}
.dlg-layout { display: grid; grid-template-columns: 340px 1fr; gap: 16px; height: calc(100vh - 220px); height: calc(100dvh - 220px); min-height: 480px; }
.dlg-list-pane { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.dlg-list-filters { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.dlg-list { flex: 1; overflow-y: auto; }
.dlg-list-item { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.dlg-list-item:hover { background: var(--panel-2); }
.dlg-list-item.active { background: var(--accent-soft); }
.dlg-item-icon { font-size: 18px; flex-shrink: 0; }
.dlg-item-info { flex: 1; min-width: 0; }
.dlg-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dlg-item-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }



.dlg-item-time { color: var(--text-dim); font-size: 10.5px; flex-shrink: 0; white-space: nowrap; }






.dlg-item-name-row { display: flex; align-items: center; gap: 5px; min-width: 0; flex: 1 1 auto; overflow: hidden; }






.dlg-item-name-row .dlg-item-name { flex: 0 1 auto; min-width: 7ch; }
.dlg-item-top-trail { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }







.dlg-item-top-trail .notif-badge { position: static; }
.dlg-tag-pill {


  flex-shrink: 1; min-width: 3.4em; display: inline-block; max-width: 92px;
  font-size: 10.5px; font-weight: 600; line-height: 1.4;
  padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}






.dlg-item-new {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  height: 15px; padding: 0 5px;
  border-radius: 5px;
  background: var(--dlg-accent, #0a84ff); color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 1;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}





.dlg-item-later {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 3px;
  height: 15px; padding: 0 5px 0 4px;
  border-radius: 5px;
  background: #e8912a; color: #fff;
  font-size: 9.5px; font-weight: 700; line-height: 1;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.dlg-item-later svg { width: 9px; height: 9px; display: block; }



.dlg-item-await {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  height: 15px; padding: 0 5px;
  border-radius: 5px;
  background: var(--red-soft); color: var(--red);
  font-size: 9.5px; font-weight: 700; line-height: 1;
  letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.dlg-mac-view .dlg-list-item.active .dlg-item-await { background: var(--panel); color: var(--red); }

.dlg-mac-view .dlg-list-item.active .dlg-item-later { background: var(--panel); color: #c2761b; }


.dlg-mac-view .dlg-tags-btn.dlg-later-btn.active { background: #e8912a; border-color: #e8912a; color: #fff; }
.dlg-mac-view .dlg-tags-btn.dlg-later-btn .dlg-tags-btn-count { background: #e8912a; }
.dlg-mac-view .dlg-tags-btn.dlg-later-btn.active .dlg-tags-btn-count { background: var(--panel); color: #c2761b; }


.dlg-later-head-btn svg { display: block; }
.dlg-later-head-btn.on { background: var(--later-bg); border-color: #e8912a; color: var(--later-ink); }

.dlg-ctx-later-icon { color: #c2761b; }
.dlg-ctx-later-icon svg { width: 13px; height: 13px; display: block; }

.dlg-tag-more {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-dim); background: var(--panel-2);
  padding: 1px 6px; border-radius: 999px; line-height: 1.4;
}




.ms-kind {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
}
.ms-kind-new { background: var(--green-soft); color: var(--green); }
.ms-kind-extra { background: var(--orange-soft); color: var(--orange); }






.ms-kind-picker {
  display: flex; width: 100%; gap: 2px; margin-bottom: 4px;
  background: var(--panel-2); padding: 3px; border-radius: 10px;
}
.ms-kind-picker button {
  flex: 1; border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--text-dim); cursor: pointer; font-family: inherit;
}
.ms-kind-picker button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }




.ms-method-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ms-method-picker button {
  border: 1px solid var(--border); background: var(--panel); border-radius: 999px;
  padding: 7px 13px; font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--text-dim); cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.ms-method-picker button:hover { border-color: var(--text-dim); color: var(--text); }
.ms-method-picker button.active { background: var(--text); border-color: var(--text); color: var(--panel); }




.ms-method-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; margin-left: 5px;
  background: var(--panel-2); color: var(--text-dim);
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}



.ms-work-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}


.ms-work-new { background: var(--accent-soft); color: var(--accent-ink); }
.ms-work-old { background: transparent; color: var(--text-dim); font-weight: 600; }


.ms-split { margin-top: 6px; font-size: 12.5px; color: var(--text-dim); display: flex; flex-wrap: wrap; gap: 7px; align-items: baseline; }
.ms-split b { font-size: 13.5px; }
.ms-split-new { color: var(--text); font-weight: 600; }
.ms-split-sep { color: var(--border); }

.ms-order-link { font-size: 11.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: bottom; }



.order-payments-section h3 { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.order-pay-sum { font-size: 13px; font-weight: 600; color: var(--text-dim); }
.order-pay-got { color: var(--text); font-weight: 700; }
.order-pay-left { color: var(--orange); font-weight: 700; }
.order-pay-over { color: var(--text-dim); font-weight: 700; }
.order-pay-full { color: var(--green); font-weight: 700; }


.order-pay-noprice { color: var(--text-dim); font-style: italic; font-weight: 500; }
.order-pay-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.order-pay-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.order-pay-row:last-child { border-bottom: none; }
.order-pay-date { font-size: 12.5px; color: var(--text-dim); min-width: 78px; }
.order-pay-who { font-size: 12px; color: var(--text-dim); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.order-pay-amount { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dlg-item-preview { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }







.dlg-list-item.unread .dlg-item-name { font-weight: 800; }
.dlg-list-item.unread .dlg-item-preview { color: var(--text); font-weight: 600; }
.dlg-item-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dlg-item-account { font-size: 11.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }






.dlg-item-menu-btn {
  flex-shrink: 0; align-self: center;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--panel-2); cursor: pointer;
  font-size: 17px; font-weight: 700; line-height: 1; color: var(--text);
  opacity: 0.85;
  transition: opacity 0.12s ease, background 0.12s ease, color 0.12s ease;
}
.dlg-list-item:hover .dlg-item-menu-btn { opacity: 1; }
.dlg-item-menu-btn:hover { opacity: 1 !important; background: var(--accent); color: #fff; }
.dlg-status-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.dlg-status-open { background: var(--green-soft); color: var(--green); }
.dlg-status-in_progress { background: var(--pastel-yellow-bg); color: var(--pastel-yellow-text); }
.dlg-status-closed { background: var(--gray-soft); color: var(--gray); }
.dlg-thread-pane { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.dlg-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.dlg-thread-title { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dlg-thread-controls { display: flex; align-items: center; gap: 8px; }




.dlg-pill, .dlg-chip {
  display: flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px 0 8px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dlg-pill:hover, .dlg-chip:hover { background: var(--panel); border-color: var(--dlg-accent); }





.dlg-more-btn { font-size: 17px; line-height: 1; letter-spacing: .08em; }
.dlg-head-menu { width: 268px; }



.dlg-menu-value {
  margin-left: auto; padding-left: 10px;
  font-size: 12px; color: var(--text-dim);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlg-menu-value.dim { font-style: italic; }


.dlg-head-menu .chat-ctx-menu-icon { display: inline-flex; align-items: center; justify-content: center; }
.dlg-head-menu .dlg-chip-avatar { width: 20px; height: 20px; font-size: 9px; }
.dlg-head-menu .dlg-btn-icon { width: 16px; height: 16px; }
.dlg-pill-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.dlg-pill-label, .dlg-chip-label {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px;
}
.dlg-chip-label.dim { color: var(--text-dim); font-weight: 500; }
.dlg-pill-chev { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }
.dlg-chip { padding-left: 4px; }
.dlg-chip-avatar {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; font-weight: 700; color: #fff;
}
.dlg-chip-avatar.empty { background: var(--gray-soft); color: var(--text-dim); }
.dlg-icon-btn {
  position: relative; width: 30px; height: 30px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 50%;
  font-size: 14px; line-height: 1; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dlg-icon-btn:hover { background: var(--panel); border-color: var(--dlg-accent); }
.dlg-icon-btn.linked { background: var(--green-soft); border-color: var(--green-soft); }
.dlg-icon-badge {
  position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--green); color: #fff; font-size: 8px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--panel);
}


.dlg-menu-avatar {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
}
.dlg-menu-avatar.empty { background: var(--gray-soft); color: var(--text-dim); }




.dlg-menu-manager-info {
  display: flex; flex-direction: column; gap: 1px; min-width: 0; text-align: left;
}
.dlg-menu-manager-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-menu-manager-email { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) {
  .dlg-pill-label, .dlg-chip-label, .dlg-pill-chev { display: none; }
  .dlg-pill, .dlg-chip { padding: 0 8px; width: 30px; justify-content: center; }
  .dlg-chip { padding-left: 8px; }
}
.dlg-thread-messages { flex: 1; overflow-y: auto; overflow-x: hidden; min-width: 0; padding: 16px; display: flex; flex-direction: column; gap: 10px; }






#chat-thread-pane .dlg-thread-messages { animation: dlgThreadFadeIn .18s ease; }
@keyframes dlgThreadFadeIn { from { opacity: 0; } to { opacity: 1; } }





#chat-thread-pane.dlg-thread-pane-loading { opacity: .55; pointer-events: none; transition: opacity .12s ease; }






.dlg-mac-view .chat-items { transition: opacity 0.16s ease; }
.dlg-mac-view .chat-items.dlg-list-refreshing { opacity: 0.5; }




.dlg-item-skeleton {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--border-soft, var(--border));
}
.dlg-skeleton-avatar { width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0; }
.dlg-skeleton-lines { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.dlg-skeleton-line { height: 10px; border-radius: 5px; display: block; }
.dlg-skeleton-line.short { width: 42%; }
.dlg-skeleton-avatar, .dlg-skeleton-line {



  background-color: var(--panel-2);
  position: relative;
  overflow: hidden;
}




.dlg-skeleton-avatar::after, .dlg-skeleton-line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--panel) 55%, transparent) 50%,
    transparent 100%);
  transform: translateX(-100%);
  animation: dlgSkeletonShimmer 1.4s ease-in-out infinite;
}
@keyframes dlgSkeletonShimmer {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}




.dlg-mac-view .chat-items .dlg-list-item { animation: dlgRowIn 0.18s ease-out; }
@keyframes dlgRowIn { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dlg-mac-view .chat-items,
  .dlg-mac-view .chat-items .dlg-list-item { transition: none; animation: none; }
  .dlg-skeleton-avatar::after, .dlg-skeleton-line::after { animation: none; display: none; }
}
.dlg-msg { max-width: 70%; display: flex; flex-direction: column; }
.dlg-msg-in { align-self: flex-start; align-items: flex-start; }
.dlg-msg-out { align-self: flex-end; align-items: flex-end; }
.dlg-msg-bubble { padding: 8px 12px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.dlg-msg-in .dlg-msg-bubble { background: var(--panel-2); color: var(--text); }
.dlg-msg-out .dlg-msg-bubble { background: var(--accent); color: #fff; }
.dlg-msg-failed .dlg-msg-bubble { background: var(--red-soft); color: var(--red); }
.dlg-msg-meta { font-size: 11px; color: var(--text-dim); margin-top: 3px; padding: 0 2px; }
.dlg-thread-input { display: flex; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.dlg-thread-input textarea { flex: 1; resize: none; }
.dlg-thread-input-disabled { color: var(--text-dim); font-size: 13px; background: var(--panel-2); }
.dlg-accounts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dlg-accounts-hint { color: var(--text-dim); font-size: 13.5px; }
.dlg-accounts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.dlg-account-card { background: var(--panel); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.dlg-account-card-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dlg-account-name { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-account-meta { font-size: 12.5px; color: var(--text-dim); }
.dlg-account-note { font-size: 12px; color: var(--yellow-text, var(--pastel-yellow-text)); background: var(--pastel-yellow-bg); border-radius: 8px; padding: 6px 9px; }
.dlg-account-note-error { color: var(--red); background: var(--red-soft); word-break: break-word; }
.dlg-account-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }











.dlg-manager-checklist {
  max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px;
  padding: 2px 8px; background: var(--panel-2);
}
.dlg-manager-checklist label {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px; margin: 0;
  font-size: 13.5px; font-weight: 400; color: var(--text);
  border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 6px;
}
.dlg-manager-checklist label:last-child { border-bottom: none; }
.dlg-manager-checklist label:hover { background: var(--panel); }
.dlg-manager-checklist input[type="checkbox"] {
  width: 19px; height: 19px; margin: 0; padding: 0; background: none; border: none; border-radius: 0;
  cursor: pointer; accent-color: var(--accent-ink); flex-shrink: 0;
}



.dlg-manager-checklist-avatar {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.dlg-manager-checklist-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dlg-manager-checklist-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlg-manager-checklist-email {
  font-size: 11.5px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}


















:root {
  --dlg-accent: #0a84ff;         /* тот же синий, что уже используется у "своих" пузырьков (--chat-bubble-mine) */
  --dlg-accent-wash: rgba(10, 132, 255, 0.10);




  --dlg-accent-wash-strong: rgba(10, 132, 255, 0.18);
  --dlg-unread: var(--red);
  --dlg-sidebar-bg: var(--chat-canvas-side);





  --dlg-thread-bg: var(--chat-canvas);
}

.dlg-mac-view .chat-list { background: var(--dlg-sidebar-bg); }
.dlg-mac-view .chat-thread { background: var(--dlg-thread-bg); }




.dlg-mac-view .chat-bubble-row:not(.mine) .chat-bubble { background: var(--chat-bubble-in-dlg); box-shadow: var(--chat-bubble-in-shadow); }
.dlg-mac-view .chat-list-head h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }


.dlg-mac-view .chat-search { position: relative; }
.dlg-mac-view .chat-search::before {
  content: '';
  position: absolute;
  left: 24px; top: 50%; transform: translateY(-50%);
  width: 13px; height: 13px;
  opacity: 0.55;
  background: currentColor;
  color: var(--text-dim);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.dlg-mac-view .chat-search input {
  padding-left: 30px;
  background: var(--panel);
  border-radius: 8px;
}











.dlg-mac-view .chat-list-head { border-bottom: none; padding-bottom: 10px; }
.dlg-mac-view .dlg-search-row { display: flex; align-items: center; gap: 8px; padding-right: 12px; border-bottom: none; }
.dlg-mac-view .dlg-sources { padding-top: 4px; }
.dlg-mac-view .dlg-search-row .chat-search { flex: 1; min-width: 0; border-bottom: none; }
.dlg-mac-view .dlg-tags-btn {
  position: relative; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 14px; cursor: pointer; color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.dlg-mac-view .dlg-tags-btn:hover { background: var(--panel-2); color: var(--text); }



.dlg-mac-view .dlg-btn-icon { width: 17px; height: 17px; display: block; flex-shrink: 0; }
.dlg-mac-view .dlg-tags-btn.active .dlg-btn-icon { color: #fff; }
.dlg-mac-view .dlg-tags-btn.active { background: var(--dlg-accent); border-color: var(--dlg-accent); color: #fff; }
.dlg-mac-view .dlg-tags-btn-count {
  position: absolute; top: -5px; right: -5px;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}


















.dlg-view-tabs {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.dlg-view-tabs::-webkit-scrollbar { display: none; }
.dlg-view-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .12s ease, background-color .15s ease;
}
.dlg-view-tab:hover { background: var(--panel-2); }
.dlg-view-tab:active { transform: scale(.96); }
.dlg-view-tab.active { background: var(--dlg-accent); border-color: var(--dlg-accent); color: #fff; }
.dlg-view-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}


.dlg-view-count-later { background: #e8912a; }


.dlg-view-tab.active .dlg-view-count { background: rgba(255, 255, 255, 0.3); }

.dlg-sources { padding: 9px 12px 11px; border-bottom: 1px solid var(--border); }
.dlg-sources-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 7px;
}


.dlg-src-all {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 8px 10px; margin-bottom: 7px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dlg-src-all:hover { background: var(--panel-2); }
.dlg-src-all.active { background: var(--dlg-accent); border-color: var(--dlg-accent); color: #fff; }






.dlg-src-tiles { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.dlg-src-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;



  padding: 8px 1px 7px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); cursor: pointer;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dlg-src-tile:hover { background: var(--panel-2); }
.dlg-src-tile.active { background: var(--dlg-accent); border-color: var(--dlg-accent); }
.dlg-src-tile .dlg-channel-icon { width: 22px; height: 22px; }
.dlg-src-tile-label {







  font-size: 8.5px; font-weight: 600; line-height: 1.1; text-align: center;
  letter-spacing: -0.01em;
  color: var(--text-dim);
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dlg-src-tile.active .dlg-src-tile-label { color: #fff; }


.dlg-src-tile.active .dlg-channel-icon { box-shadow: 0 0 0 1.5px #fff; }



.dlg-src-count {
  position: absolute; top: 3px; right: 4px;
  min-width: 15px; height: 15px; padding: 0 3px;
  border-radius: 999px; border: 1.5px solid var(--panel);
  background: var(--red, #ff3b30); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.dlg-src-tile.active .dlg-src-count { background: var(--panel); color: var(--dlg-accent); border-color: var(--dlg-accent); }
.dlg-src-all .dlg-src-count {
  position: static; border: none; margin-left: 6px;
  background: var(--panel-2); color: var(--text-dim); height: 17px; font-size: 10.5px;
}
.dlg-src-all.active .dlg-src-count { background: rgba(255, 255, 255, 0.25); color: #fff; }









@media (max-width: 1040px) {
  .dlg-sources { padding: 10px 14px 12px; }
  .dlg-src-tile { padding: 10px 2px 8px; border-radius: 12px; gap: 5px; }




  .dlg-src-tile .dlg-channel-icon { width: 26px !important; height: 26px !important; }
  .dlg-src-tile-label { font-size: 9.5px; }
  .dlg-src-all { padding: 10px; font-size: 14px; }
  .dlg-src-count { min-width: 16px; height: 16px; font-size: 9.5px; }
}




@media (max-width: 374px) {
  .dlg-sources { padding: 10px 10px 12px; }
  .dlg-src-tiles { gap: 4px; }
  .dlg-src-tile { padding: 9px 1px 7px; }
  .dlg-src-tile-label { font-size: 8.5px; letter-spacing: -0.02em; }
}









.dlg-mac-view .dlg-avatar {
  width: 36px; height: 36px;
  flex-shrink: 0;
  position: relative;
}
.dlg-mac-view .dlg-avatar-inner {
  width: 100%; height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}
.dlg-mac-view .dlg-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }




.dlg-mac-view .dlg-avatar-badge {
  position: absolute;
  right: -2px; bottom: -2px;


  width: 17px; height: 17px;
  border-radius: 50%;
  border: 2px solid var(--dlg-sidebar-bg);


  box-sizing: border-box;
  background-color: var(--dlg-sidebar-bg);
  object-fit: cover;
  display: block;
}
.dlg-mac-view .dlg-thread-title .dlg-avatar { width: 32px; height: 32px; }
.dlg-mac-view .dlg-thread-title .dlg-avatar-inner { font-size: 12px; }
.dlg-mac-view .dlg-thread-title .dlg-avatar-badge { border-color: var(--panel); background-color: var(--panel); }



.dlg-mac-view .dlg-list-item { padding: 9px 10px; border-radius: 10px; border-bottom: none; margin: 0 4px 1px; gap: 10px; }













.dlg-mac-view .dlg-list-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 49px;
}
.dlg-mac-view .chat-items { padding: 2px 4px 10px; }
.dlg-mac-view .dlg-list-item:hover { background: var(--dlg-accent-wash); }
.dlg-mac-view .dlg-list-item.active { background: var(--dlg-accent); }







.dlg-mac-view .dlg-list-item.active .dlg-item-name { color: #fff; }
.dlg-mac-view .dlg-list-item.active .dlg-item-preview { color: rgba(255,255,255,0.88); opacity: 1; }
.dlg-mac-view .dlg-list-item.active .dlg-item-time,
.dlg-mac-view .dlg-list-item.active .dlg-item-account,
.dlg-mac-view .dlg-list-item.active .dlg-item-channel { color: rgba(255,255,255,0.72); }
.dlg-mac-view .dlg-list-item.active .dlg-avatar-badge { border-color: var(--dlg-accent); background-color: var(--dlg-accent); }
.dlg-mac-view .dlg-list-item.active .dlg-status-chip { background: rgba(255,255,255,0.22); color: #fff; }


.dlg-mac-view .dlg-list-item.active .dlg-item-menu-btn { background: rgba(255,255,255,0.22); color: #fff; }
.dlg-mac-view .dlg-list-item.active .dlg-item-menu-btn:hover { background: rgba(255,255,255,0.34); }


.dlg-mac-view .dlg-list-item.active .dlg-item-channel .dlg-channel-icon { box-shadow: 0 0 0 1.5px #fff; }



.dlg-mac-view .dlg-list-item.active .dlg-tag-pill { background: rgba(255,255,255,0.22) !important; color: #fff !important; }
.dlg-mac-view .dlg-list-item.active .dlg-tag-more { color: rgba(255,255,255,0.72); }

.dlg-mac-view .dlg-item-name { font-size: calc(13.5px * var(--chat-text-scale)); }
.dlg-mac-view .dlg-item-preview { font-size: 12px; }
.dlg-mac-view .dlg-item-account { font-size: 11px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }







.dlg-mac-view .dlg-item-meta { flex-wrap: wrap; row-gap: 3px; }
.dlg-mac-view .dlg-item-channel {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}





.dlg-mac-view .notif-badge {
  position: static;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  padding: 0 5px;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.dlg-mac-view .dlg-list-item.active .notif-badge { background: var(--panel); color: var(--dlg-accent); }


.dlg-mac-view .dlg-list-item.active .dlg-item-new { background: var(--panel); color: var(--dlg-accent); }



.dlg-mac-view .dlg-thread-title { gap: 10px; }
.dlg-mac-view .dlg-thread-title-text { min-width: 0; }





.dlg-mac-view button.dlg-thread-title {
  border: none; background: none; font: inherit; color: inherit;
  text-align: left; cursor: pointer;
  border-radius: 10px;






  flex: 1 1 0; min-width: 0;


  margin: -5px -8px; padding: 5px 8px;
  transition: background .15s ease;
}



.dlg-mac-view button.dlg-thread-title:hover { background: var(--panel-2); }

.dlg-mac-view button.dlg-thread-title:focus-visible { outline: 2px solid var(--dlg-accent); outline-offset: 1px; }
.dlg-mac-view .dlg-thread-name {
  display: inline-flex; align-items: center; gap: 3px; max-width: 100%; min-width: 0;
  font-size: 13.5px; font-weight: 600; overflow: hidden; white-space: nowrap;
}



.dlg-mac-view .dlg-thread-name-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }




.dlg-mac-view .dlg-thread-name-chevron { font-size: 10px; color: var(--text-dim); flex-shrink: 0; }






.dlg-mac-view .dlg-thread-sub { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11px; color: var(--text-dim); }
.dlg-mac-view .dlg-thread-source {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  height: 18px; padding: 0 8px 0 5px; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.dlg-mac-view .dlg-thread-account {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; font-weight: 600; color: var(--text-dim);
}





.dlg-mac-view .dlg-thread-tags {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 7px 16px; border-bottom: 1px solid var(--border); background: var(--panel);
}
.dlg-mac-view .dlg-thread-tag {
  display: inline-flex; align-items: center; gap: 1px; max-width: 190px;
  height: 22px; padding: 0 3px 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; line-height: 1;
}
.dlg-mac-view .dlg-thread-tag-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }



.dlg-mac-view .dlg-thread-tag-x {
  border: none; background: none; color: inherit; cursor: pointer;
  font: inherit; font-size: 14px; line-height: 1; padding: 0 4px; opacity: 0.45;
  transition: opacity 0.12s ease;
}
.dlg-mac-view .dlg-thread-tag:hover .dlg-thread-tag-x { opacity: 0.8; }
.dlg-mac-view .dlg-thread-tag-x:hover { opacity: 1; }
.dlg-mac-view .dlg-thread-tag-add {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border: 1px dashed var(--border); border-radius: 999px; background: none;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--text-dim); cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}
.dlg-mac-view .dlg-thread-tag-add:hover { border-style: solid; border-color: var(--dlg-accent); color: var(--dlg-accent); }
.dlg-mac-view .dlg-thread-tag-add .dlg-btn-icon { width: 13px; height: 13px; }
.dlg-tag-picker { min-width: 190px; }










.dlg-mac-view .chat-composer-btn.active { background: var(--dlg-accent); color: #fff; }





.dlg-mac-view .chat-composer textarea { max-height: min(200px, 35vh); }

.dlg-ctx-bar {
  overflow: hidden;
  border-top: 1px solid var(--border);
  transition: max-height 0.18s ease;
  max-height: 96px;
}
.dlg-ctx-bar:empty, .dlg-ctx-bar.empty { max-height: 0; border-top: none; }
.dlg-ctx-bar.tall { max-height: min(420px, 48vh); overflow-y: auto; }

.dlg-assist-loading, .dlg-assist-empty { color: var(--text-dim); font-size: 12.5px; padding: 10px 2px; text-align: center; }
.dlg-assist-error { color: var(--red); font-size: 12.5px; padding: 10px 14px; }



.dlg-suggest-prompt-row { padding: 10px 14px; }
.dlg-suggest-prompt-btn {
  display: flex; align-items: center; gap: 7px;
  background: none; border: 1px dashed var(--border); color: var(--dlg-accent);
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 500; cursor: pointer;
  font-family: inherit;
}
.dlg-suggest-prompt-btn:hover { background: var(--dlg-accent-wash); border-color: var(--dlg-accent); }
.dlg-suggest-prompt-btn .spark { font-size: 11px; }

.dlg-suggest-loading { display: flex; align-items: center; gap: 9px; padding: 12px 14px; font-size: 12.5px; color: var(--text-dim); }
.dlg-suggest-spinner {
  width: 13px; height: 13px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--dlg-accent);
  animation: dlgSuggestSpin 0.7s linear infinite;
}
@keyframes dlgSuggestSpin { to { transform: rotate(360deg); } }



.ai-test-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.ai-test-result { font-size: 12.5px; margin-top: 8px; color: var(--text-dim); }
.ai-test-result.ok { color: var(--green); }
.ai-test-result.fail { color: var(--red); }
.ai-test-models { margin-top: 6px; color: var(--text-dim); line-height: 1.8; }
.ai-test-models code {
  background: var(--panel-2); border-radius: 6px; padding: 2px 6px; font-size: 11.5px;
  white-space: nowrap;
}



.ai-profile-block {
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-top: 16px; background: var(--panel-2);
}






.dlg-assist-actions { display: flex; gap: 8px; align-items: center; padding: 10px 14px; flex-wrap: wrap; }
.dlg-assist-mini-btn {
  background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: 999px; padding: 6px 12px; font-size: 12px; cursor: pointer; font-family: inherit;
}
.dlg-assist-mini-btn:hover:not(:disabled) { color: var(--text); border-color: var(--text-dim); }
.dlg-assist-mini-btn:disabled, .dlg-suggest-prompt-btn:disabled { opacity: 0.55; cursor: default; }

.dlg-assist-card { padding: 0 14px 12px; }
.dlg-assist-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dlg-assist-stage {
  flex-shrink: 0; background: var(--dlg-accent-wash); color: var(--dlg-accent);
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700;
}
.dlg-assist-reading { font-size: 12.5px; color: var(--text-dim); }
.dlg-assist-option { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }


.dlg-assist-option-title { display: flex; align-items: center; gap: 8px; min-height: 22px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--text-dim); }
.dlg-assist-option-text { font-size: 13px; margin: 5px 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }

.dlg-assist-option-notes { font-size: 12px; line-height: 1.4; color: var(--orange-ink); background: var(--orange-soft); border-radius: 8px; padding: 6px 9px; margin: -2px 0 8px; display: grid; gap: 2px; }
.dlg-assist-insert {
  background: var(--dlg-accent); color: #fff; border: none; border-radius: 999px;
  padding: 6px 13px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.dlg-assist-insert:hover { filter: brightness(1.05); }
.dlg-assist-warning { font-size: 12.5px; color: var(--red); background: var(--red-soft); border-radius: 10px; padding: 8px 11px; }

.dlg-assist-ask { padding: 0 14px 12px; }
.dlg-assist-ask-row { display: flex; gap: 8px; align-items: center; }
.dlg-assist-ask-row input { flex: 1; min-width: 0; }
.dlg-assist-answer {
  font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--panel-2); border-radius: 12px; padding: 10px 12px; margin-top: 8px;
}
.dlg-assist-answer .dlg-assist-insert { margin-top: 8px; display: inline-block; }



.dlg-assist-close {
  margin-left: auto; flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: var(--panel-2); color: var(--text-dim);
  cursor: pointer; font-size: 12px; line-height: 1;
}
.dlg-assist-close:hover { color: var(--text); }



.dlg-assist-doc {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; margin-bottom: 4px;
  background: var(--panel-2); border: none; border-radius: 10px;
  padding: 8px 11px; cursor: pointer; font-family: inherit; color: var(--text);
}
.dlg-assist-doc:hover { background: var(--dlg-accent-wash); }
.dlg-assist-doc-name { font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.dlg-assist-doc-date { font-size: 11px; color: var(--text-dim); white-space: nowrap; }




.dlg-assist-answer p { margin: 0 0 8px; }
.dlg-assist-answer p:last-child { margin-bottom: 0; }
.dlg-assist-answer .md-h { font-weight: 700; margin: 12px 0 6px; }
.dlg-assist-answer .md-h:first-child { margin-top: 0; }
.dlg-assist-answer .md-h1 { font-size: 14px; }
.dlg-assist-answer .md-h2 { font-size: 13px; }
.dlg-assist-answer .md-h3 { font-size: 12.5px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.02em; }
.dlg-assist-answer .md-list { margin: 0 0 8px; padding-left: 18px; }
.dlg-assist-answer .md-list li { margin-bottom: 3px; }

.dlg-assist-file { padding: 0 14px 12px; }
.dlg-assist-file-head { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.dlg-assist-cached { font-weight: 500; opacity: 0.8; }

.dlg-assist-file-note {
  font-size: 12px; line-height: 1.4; margin-bottom: 8px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--yellow-soft); color: var(--yellow-ink);
}



.dlg-assist-style { padding: 0 14px 12px; }
.dlg-assist-style-head { font-size: 12px; font-weight: 700; color: var(--red); margin-bottom: 4px; }
.dlg-assist-style-item { font-size: 12.5px; color: var(--text-dim); }



@keyframes dlgInputFlash {
  0%   { box-shadow: 0 0 0 3px var(--dlg-accent-wash); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.dlg-input-flash { animation: dlgInputFlash 0.55s ease-out; }




.chat-bubble-link {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
  background: rgba(127, 127, 127, 0.08); border-radius: 13px; padding: 8px 12px 8px 8px;
  min-height: 56px; max-width: 320px;
}
.chat-bubble-link:hover { background: rgba(127, 127, 127, 0.14); }
.chat-bubble-link-icon {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 10px;
  background: #0077FF; color: #fff; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.chat-bubble-link-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-bubble-link-name {
  font-size: 15px; line-height: 19px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-bubble-link-host { font-size: 13px; color: var(--text-dim); }
.chat-bubble-row.mine .chat-bubble-link { background: rgba(255, 255, 255, 0.16); }
.chat-bubble-row.mine .chat-bubble-link:hover { background: rgba(255, 255, 255, 0.24); }
.chat-bubble-row.mine .chat-bubble-link-name { color: #fff; }
.chat-bubble-row.mine .chat-bubble-link-host { color: rgba(255, 255, 255, 0.78); }

@media (prefers-reduced-motion: reduce) {
  .dlg-input-flash { animation: none; }
}



.dlg-ctx-templates-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px 8px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dlg-ctx-templates-title { font-size: 12.5px; font-weight: 600; color: var(--text); }
.dlg-ctx-close-btn {
  width: 24px; height: 24px; border-radius: 7px; border: none; background: none;
  cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.dlg-ctx-close-btn:hover { background: var(--panel-2); }
.dlg-ctx-templates-body { padding: 10px 12px; overflow-y: auto; max-height: 220px; }





.dlg-ctx-templates-panel { display: flex; flex-direction: column; min-height: 0; }
.dlg-tmpl-filters {
  display: flex; flex-direction: column; gap: 8px;
  padding: 9px 12px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dlg-tmpl-search { position: relative; display: flex; }
.dlg-tmpl-search .input { width: 100%; padding-left: 30px; font-size: 12.5px; height: 32px; }
.dlg-tmpl-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-dim); pointer-events: none;
}
.dlg-tmpl-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.dlg-tmpl-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--panel); cursor: pointer;
  font: 600 11.5px/1 inherit; color: var(--text-dim);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}


.dlg-tmpl-chip.all { padding-left: 10px; }
.dlg-tmpl-chip:hover { background: var(--panel-2); }
.dlg-tmpl-chip.active { background: var(--dlg-accent); border-color: var(--dlg-accent); color: #fff; }
.dlg-tmpl-chip .dlg-channel-icon { width: 16px; height: 16px; }
.dlg-tmpl-chip-count { font-size: 10px; font-weight: 600; opacity: 0.65; }
.dlg-tmpl-chip.active .dlg-tmpl-chip-count { opacity: 0.85; }


.dlg-tmpl-item-title { display: flex; align-items: center; gap: 6px; }
.dlg-tmpl-item-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }




.dlg-tmpl-item-chans {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
  border: 1px solid transparent; border-radius: 6px; padding: 1px 3px 1px 4px;
  background: none; font: inherit; color: var(--text-dim); cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.dlg-tmpl-item-chans:hover { background: var(--panel-2); border-color: var(--border); }
.dlg-tmpl-item-chans .dlg-channel-icon { width: 14px; height: 14px; }
.dlg-tmpl-chans-chev { font-size: 9px; line-height: 1; color: var(--text-dim); }
.dlg-tmpl-everywhere-text {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  color: var(--text-dim);
}
.dlg-tmpl-item-chans.everywhere { background: var(--panel-2); border-color: var(--panel-2); }
.dlg-tmpl-item-chans.everywhere:hover { border-color: var(--border); }


.dlg-tmpl-chans-menu { min-width: 236px; }
.dlg-tmpl-chans-menu-head {
  padding: 8px 12px 6px; font-size: 11.5px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dlg-tmpl-chans-menu-note {
  padding: 6px 12px 8px; font-size: 10.5px; color: var(--text-dim);
  border-top: 1px solid var(--border);
}
.dlg-tmpl-chans-menu .dlg-channel-icon { width: 16px; height: 16px; margin-right: 2px; }

.dlg-tmpl-mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 1px; }
.dlg-tmpl-nothing {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; text-align: center; font-size: 12px; color: var(--text-dim);
}
.dlg-tmpl-nothing .btn { width: auto; }
.dlg-tmpl-form-chans { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dlg-tmpl-form-chans-label { font-size: 11.5px; color: var(--text-dim); margin-right: 2px; }


.dlg-tmpl-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.dlg-tmpl-item {
  display: flex; align-items: flex-start; gap: 4px;
  border-radius: 9px;
  transition: background 0.1s ease;
}
.dlg-tmpl-item:hover { background: var(--panel-2); }
.dlg-tmpl-item-main { flex: 1 1 0%; min-width: 0; padding: 7px 8px; cursor: pointer; }
.dlg-tmpl-item-title { font-size: 12.5px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.dlg-tmpl-item-text {
  font-size: 11.5px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.dlg-tmpl-item-actions { display: flex; gap: 2px; padding: 6px 6px 0 0; flex-shrink: 0; }
.dlg-tmpl-icon-btn {
  width: 24px; height: 24px; border-radius: 7px; border: none; background: none;
  cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.dlg-tmpl-icon-btn:hover { background: var(--border); }
.dlg-tmpl-add-btn { width: 100%; }
.dlg-tmpl-form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.dlg-tmpl-form textarea { resize: vertical; min-height: 60px; }
.dlg-tmpl-form-actions { display: flex; justify-content: flex-end; gap: 6px; }


@media (max-width: 640px) {
  .dlg-mac-view .dlg-avatar { width: 30px; height: 30px; }

  .dlg-mac-view .dlg-avatar-badge { width: 15px; height: 15px; }
  .dlg-mac-view .dlg-avatar-inner { font-size: 11.5px; }
  .dlg-mac-view .dlg-thread-title .dlg-avatar { width: 26px; height: 26px; }
  .dlg-mac-view .dlg-thread-title .dlg-avatar-inner { font-size: 10.5px; }
}

@media (max-width: 900px) {
  .dlg-layout { grid-template-columns: 1fr; height: auto; }
  .dlg-thread-pane { min-height: 420px; }
}


.air-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
.air-info-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.air-chat-col { min-width: 0; }
.air-chat-col .section { display: flex; flex-direction: column; height: calc(100vh - 220px); height: calc(100dvh - 220px); min-height: 480px; padding: 0; overflow: hidden; }
.air-chat-col .section h3 { padding: 14px 16px 0; margin-bottom: 0; }
.air-file-row { font-size: 13.5px; margin: 6px 0; word-break: break-word; }
.badge.done { background: var(--green-soft); color: var(--green); }
@media (max-width: 900px) {
  .air-layout { grid-template-columns: 1fr; }
  .air-chat-col .section { height: auto; min-height: 420px; }
}






.iv-overlay {
  position: fixed; inset: 0; z-index: 5000;
  background: rgba(0, 0, 0, 0.92);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
  animation: ivOverlayIn .15s ease;
}
@keyframes ivOverlayIn { from { opacity: 0; } to { opacity: 1; } }
.iv-content { cursor: default; max-width: 100%; max-height: 100%; display: flex; }
.iv-content img {
  max-width: 92vw; max-height: 92vh; object-fit: contain;
  border-radius: 6px; box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}
.iv-content iframe {
  width: 92vw; height: 92vh; border: none; border-radius: 8px;
  background: #fff; box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}
.iv-content video {
  max-width: 92vw; max-height: 92vh; border-radius: 8px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6); background: #000;
}
.iv-audio-card {
  width: min(420px, 86vw); background: var(--panel); border-radius: 16px; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}
.iv-audio-card audio { width: 100%; }
.iv-loading {
  color: #fff; display: flex; align-items: center; gap: 10px; font-size: 14px;
}
.iv-loading .spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff;
  animation: ivSpin .7s linear infinite;
}
@keyframes ivSpin { to { transform: rotate(360deg); } }


.iv-text-panel {
  width: min(860px, 92vw); max-height: 90vh; overflow: auto;
  background: var(--panel); border-radius: 12px; padding: 24px 28px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6); text-align: left;
}
.iv-text-panel pre {
  margin: 0; white-space: pre-wrap; word-break: break-word;
  font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.iv-text-truncated { margin-top: 14px; color: var(--text-dim); font-size: 12.5px; }
.iv-csv-panel table, .iv-docx-panel table { border-collapse: collapse; width: 100%; }
.iv-csv-panel th, .iv-csv-panel td, .iv-docx-panel th, .iv-docx-panel td {
  border: 1px solid var(--border); padding: 6px 10px; font-size: 13px; text-align: left;
}
.iv-csv-panel th { background: var(--panel-2); font-weight: 600; }
.iv-docx-panel img { max-width: 100%; }
.iv-nopreview {
  width: min(360px, 86vw);
  background: var(--panel); border-radius: 16px; padding: 32px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center; box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
}
.iv-nopreview-icon { font-size: 40px; }
.iv-nopreview-name { font-weight: 600; word-break: break-word; }
.iv-nopreview-hint { color: var(--text-dim); font-size: 13px; }
.iv-nopreview-download {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.iv-overlay .iv-btn {
  position: fixed; top: 16px; width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, 0.14); color: #fff;
  font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .15s ease;
}
.iv-overlay .iv-btn:hover { background: rgba(255, 255, 255, 0.26); }
.iv-overlay .iv-close { right: 16px; font-size: 20px; }
.iv-overlay .iv-download { right: 68px; font-size: 17px; }






.iv-overlay.iv-sheet {
  background: rgba(0, 0, 0, 0.45);
  align-items: flex-end;
  cursor: default;
}
.iv-sheet .iv-sheet-panel {
  width: 100%;


  height: calc(var(--vv-height, 100dvh) - 44px);
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: chat-sheet-up .26s cubic-bezier(.22, .61, .36, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.35);
}
.iv-sheet-grabber {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border);
  margin: 7px auto 3px;
  flex-shrink: 0;
}
.iv-sheet-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.iv-sheet-actions { display: flex; align-items: center; gap: 8px; }






.iv-sheet-title {
  position: absolute; left: 92px; right: 92px; top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}


.iv-sheet .iv-btn {
  position: static;
  width: auto; height: auto;
  padding: 4px 2px;
  background: none; border: none;
  color: var(--accent-ink);
  font-size: 15px; font-weight: 600;
  flex-shrink: 0;
}
.iv-sheet .iv-btn:hover { background: none; }





.iv-sheet .iv-share, .iv-sheet .iv-download {
  width: 32px; height: 32px; padding: 0;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.iv-sheet .iv-share:hover, .iv-sheet .iv-download:hover { background: var(--panel-2); }
.iv-sheet .iv-share:active, .iv-sheet .iv-download:active { background: var(--accent-soft); }
.iv-sheet .iv-share svg, .iv-sheet .iv-download svg { display: block; width: 18px; height: 18px; }


.iv-btn.is-busy { opacity: .4; }
.iv-overlay .iv-btn svg { display: block; }
.iv-overlay .iv-share { right: 120px; }
.iv-sheet .iv-content {
  flex: 1; min-height: 0;
  display: block; overflow: auto;

  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.iv-sheet .iv-content img { max-width: 100%; max-height: none; border-radius: 0; box-shadow: none; display: block; margin: 0 auto; }
.iv-sheet .iv-content iframe { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
.iv-sheet .iv-content video { max-width: 100%; max-height: 100%; border-radius: 0; box-shadow: none; }
.iv-sheet .iv-text-panel {
  width: 100%; max-height: none;
  border-radius: 0; box-shadow: none;
  padding: 16px 18px;
}
.iv-sheet .iv-audio-card, .iv-sheet .iv-nopreview { box-shadow: none; margin: 24px auto; }
.iv-sheet .iv-loading { color: var(--text); justify-content: center; padding: 28px; }
.iv-sheet .iv-loading .spinner { border-color: var(--border); border-top-color: var(--accent-ink); }
@media (max-width: 480px) {








  .iv-overlay:not(.iv-sheet) .iv-btn { width: 48px; height: 48px; }
  .iv-overlay:not(.iv-sheet) .iv-download { right: 72px; }
  .iv-overlay:not(.iv-sheet) .iv-share { right: 128px; }
  .iv-content iframe { width: 96vw; height: 88vh; }
}






.corr-doc { border-radius: 18px; padding: 26px 30px 8px; border: 1px solid var(--border); }
.corr-doc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.corr-doc-foot { text-align: right; margin: 10px 4px 0; }
.corr-edit-hint {
  background: var(--yellow-soft); color: var(--yellow); border-radius: 12px;
  padding: 12px 16px; font-size: 13px; margin-bottom: 14px; line-height: 1.5;
}


.corr-doc.editing .corr-editable { cursor: text; border-radius: 6px; transition: background .12s, box-shadow .12s; }
.corr-doc.editing .corr-editable:hover { background: #FFF8E1; box-shadow: 0 0 0 2px #F0D48A; }
.corr-doc.editing .corr-editable:hover::after {
  content: '✏️'; font-size: 11px; margin-left: 6px; opacity: .7;
}


.corr-doc .corr-editing-now { box-shadow: 0 0 0 2px var(--accent-ink); }


.corr-doc { --ink:#0E1116; --ink-2:#3D4855; --ink-3:#6B7887; --paper:#EFF2F6; --card:#FFFFFF; --line:#D8E0E9; --line-2:#EDF1F5; --blue:#1F4E8C; --blue-soft:#E7EEF8; --say:#0A6A4A; --say-soft:#E3F3EC; --dont:#A82818; --dont-soft:#FBE9E6; --warn:#9A5B00; --warn-soft:#FBF0DE; --mono:ui-monospace,"SF Mono",Menlo,Consolas,"Liberation Mono",monospace; --sans:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif; }
.corr-doc * { box-sizing:border-box }
.corr-doc { margin:0;background:var(--paper);color:var(--ink); font-family:var(--sans);font-size:16px;line-height:1.55; -webkit-font-smoothing:antialiased; }
.corr-doc section { margin-bottom:52px }
.corr-doc .sec-head { display:flex;align-items:baseline;gap:14px;margin:0 0 20px;padding-bottom:12px;border-bottom:2px solid var(--ink) }
.corr-doc .sec-num { font-family:var(--mono);font-size:13px;color:var(--ink-3);letter-spacing:.1em }
.corr-doc h2 { font-size:27px;letter-spacing:-.015em;margin:0;font-weight:800 }
.corr-doc h3 { font-size:19px;margin:32px 0 12px;font-weight:700;letter-spacing:-.01em }
.corr-doc p { margin:0 0 14px }
.corr-doc .lead { color:var(--ink-2);font-size:16.5px }
.corr-doc .card { background:var(--card);border:1px solid var(--line);border-radius:10px;padding:24px 26px;margin-bottom:16px }
.corr-doc .block { background:var(--card);border:1px solid var(--line);border-radius:12px;margin-bottom:22px;overflow:hidden }
.corr-doc .block-head { display:flex;align-items:center;gap:14px;padding:18px 24px;border-bottom:1px solid var(--line-2);background:#FAFCFE }
.corr-doc .letter { width:38px;height:38px;flex:0 0 38px;border-radius:8px;background:var(--ink);color:#fff; display:flex;align-items:center;justify-content:center; font-family:var(--mono);font-size:17px;font-weight:700; }
.corr-doc .letter.stop { background:var(--dont) }
.corr-doc .letter.go { background:var(--say) }
.corr-doc .block-title { font-size:19px;font-weight:700;letter-spacing:-.01em }
.corr-doc .block-task { font-size:13.5px;color:var(--ink-3);margin-top:2px }
.corr-doc .block-body { padding:22px 24px 24px }
.corr-doc .msg { position:relative;background:var(--blue-soft);border-left:3px solid var(--blue); border-radius:0 8px 8px 0;padding:16px 96px 16px 18px;margin:0 0 14px; font-size:15.5px;line-height:1.6;white-space:pre-wrap; }
.corr-doc .msg.plain { background:#F4F7FA;border-left-color:var(--ink-3) }
.corr-doc .msg strong { font-weight:700 }
.corr-doc .copy { position:absolute;top:12px;right:12px; font-family:var(--mono);font-size:11px;letter-spacing:.05em;text-transform:uppercase; background:#fff;border:1px solid var(--line);color:var(--ink-2); padding:5px 10px;border-radius:5px;cursor:pointer;transition:.15s; }
.corr-doc .copy:hover { background:var(--ink);color:#fff;border-color:var(--ink) }
.corr-doc .copy.done { background:var(--say);color:#fff;border-color:var(--say) }
.corr-doc .label { font-family:var(--mono);font-size:11.5px;letter-spacing:.1em;text-transform:uppercase; color:var(--ink-3);margin:22px 0 8px;font-weight:600; }
.corr-doc .label:first-child { margin-top:0 }
.corr-doc .note { border-radius:8px;padding:14px 18px;margin:16px 0;font-size:15px;border-left:3px solid }
.corr-doc .note.warn { background:var(--warn-soft);border-color:var(--warn) }
.corr-doc .note.dont { background:var(--dont-soft);border-color:var(--dont) }
.corr-doc .note.say { background:var(--say-soft);border-color:var(--say) }
.corr-doc .note b { display:block;margin-bottom:4px;font-size:13px;letter-spacing:.04em;text-transform:uppercase;font-family:var(--mono) }
.corr-doc .note.warn b { color:var(--warn) }
.corr-doc .note.dont b { color:var(--dont) }
.corr-doc .note.say b { color:var(--say) }
.corr-doc .rules { counter-reset:r;display:grid;gap:10px }
.corr-doc .rule { display:flex;gap:16px;align-items:flex-start;background:var(--card); border:1px solid var(--line);border-left:4px solid var(--dont);border-radius:8px;padding:16px 20px; }
.corr-doc .rule::before { counter-increment:r;content:counter(r); font-family:var(--mono);font-size:14px;font-weight:700;color:var(--dont); flex:0 0 auto;padding-top:1px; }
.corr-doc .rule div { font-size:15.5px }
.corr-doc .rule b { display:block;margin-bottom:2px }
.corr-doc .rule span { color:var(--ink-3);font-size:14.5px }
.corr-doc table { width:100%;border-collapse:collapse;font-size:15px;background:var(--card); border:1px solid var(--line);border-radius:10px;overflow:hidden }
.corr-doc th { text-align:left;background:#F5F8FB;font-family:var(--mono);font-size:11.5px; letter-spacing:.09em;text-transform:uppercase;color:var(--ink-3); padding:12px 16px;border-bottom:1px solid var(--line);font-weight:600; }
.corr-doc td { padding:13px 16px;border-bottom:1px solid var(--line-2);vertical-align:top }
.corr-doc tr:last-child td { border-bottom:none }
.corr-doc td.k { font-weight:600;width:38% }
.corr-doc td code { font-family:var(--mono);font-size:13px;background:var(--blue-soft);color:var(--blue); padding:2px 7px;border-radius:4px;white-space:nowrap }
.corr-doc .check { background:var(--ink);color:#E8EEF6;border-radius:12px;padding:28px 30px }
.corr-doc .check h3 { color:#fff;margin:0 0 16px;font-size:20px }
.corr-doc .check ol { margin:0;padding-left:22px }
.corr-doc .check li { margin-bottom:9px;font-size:15.5px }
.corr-doc .check li::marker { color:#7B90AB;font-family:var(--mono);font-size:13px }
.corr-doc .flow { background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px;overflow-x:auto }
.corr-doc .flow svg { display:block;min-width:640px;width:100%;height:auto }
@media (max-width:640px){
  .corr-doc h2 { font-size:22px }
  .corr-doc .msg { padding-right:18px }
  .corr-doc .copy { position:static;display:inline-block;margin-top:10px }
  .corr-doc td.k { width:auto }
}
@media print{
  .corr-doc { background:#fff }
  .corr-doc .copy { display:none }
  .corr-doc .block, .corr-doc .card, .corr-doc table { break-inside:avoid }
}

@media (max-width: 700px) {
  .corr-doc { padding: 18px 16px 4px; }
}


.post-photo {
  display: block; max-width: 100%; max-height: 260px; border-radius: 10px;
  border: 1px solid var(--border); object-fit: cover;
}
.post-photo-empty {
  padding: 18px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--text-dim); font-size: 13px; text-align: center;
}
.post-photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.post-thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; display: block; }
.post-thumb-empty { color: var(--text-dim); font-size: 12px; }

.import-summary { margin-top: 16px; font-size: 13.5px; }
.import-list { margin-top: 12px; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.import-row {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 96px; gap: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: start;
}
.import-row:last-child { border-bottom: none; }
.import-date { font-weight: 700; }
.import-date span { display: block; font-weight: 400; color: var(--text-dim); font-size: 11.5px; }
.import-text { min-width: 0; line-height: 1.5; }
.import-photo { color: var(--text-dim); font-size: 12px; text-align: right; }
.import-warn { color: var(--yellow); font-size: 11.5px; margin-top: 4px; }

@media (max-width: 700px) {
  .import-row { grid-template-columns: 1fr; gap: 4px; }
  .import-photo { text-align: left; }
}


.cal-more { font-size: 11px; color: var(--text-dim); margin-top: 3px; }
.day-groups { margin-top: 14px; max-height: 60vh; overflow-y: auto; }
.day-group { margin-bottom: 16px; }
.day-group:last-child { margin-bottom: 0; }
.day-group-head {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 13.5px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.day-post {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 9px 8px; border-radius: 10px; cursor: pointer; transition: background .12s;
}
.day-post:hover { background: var(--panel-2); }
.day-post-main { flex: 1; min-width: 0; }
.day-post-top { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.day-post-text { font-size: 13px; line-height: 1.5; margin-top: 3px; }


.post-photo-empty { line-height: 1.55; }
#m-photo-box.photo-drop, .post-photo-empty.photo-drop {
  outline: 2px dashed var(--accent-ink); outline-offset: 2px; border-radius: 10px;
}


tr.post-row { cursor: pointer; }
tr.post-row:hover td { background: var(--panel-2); }


.emoji-bar { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.emoji-panel {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; background: var(--panel); max-height: 240px; overflow-y: auto;
}
.emoji-group + .emoji-group { margin-top: 12px; }
.emoji-group-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-dim); margin-bottom: 6px;
}
.emoji-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.emoji-btn {
  width: 34px; height: 34px; border: none; background: transparent;
  border-radius: 8px; font-size: 19px; line-height: 1; cursor: pointer; transition: background .12s;
}
.emoji-btn:hover { background: var(--panel-2); }






.topbar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }





.filters .client-search-input { flex: 1 1 320px; min-width: 240px; max-width: 520px; }








@media (max-width: 600px) {
  .filters > input, .filters > select, .filters > textarea {
    flex: 0 0 auto !important;
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}






#cl-tabs { flex-wrap: wrap; }



.client-list { display: flex; flex-direction: column; gap: 14px; }


.order-pill.client-pill-active { background: var(--green-soft); color: var(--green); }
.order-pill.client-pill-done { background: var(--gray-soft); color: var(--gray); }

.client-overdue-flag { color: var(--red) !important; font-weight: 700 !important; }



.avatar-sm.client-avatar-sm { color: #fff; font-weight: 800; }

.client-avatar {
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800;
  flex: none;
}

.client-status-badge { font-size: 10.5px; padding: 3px 9px; }
.client-status-badge.done { background: var(--gray-soft); color: var(--gray); }



.client-row.is-done { background: var(--panel-2); }
.client-row.is-done .order-card-title { color: var(--text-dim); }
.client-row.is-done .client-avatar-sm { filter: grayscale(0.75); opacity: .75; }
.client-row.is-done:hover .client-avatar-sm { filter: none; opacity: 1; }







.client-contact-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.client-contact-chip {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%;
  padding: 4px 10px 4px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  font-size: 12.5px; color: var(--text);
  text-decoration: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.client-contact-chip-icon { font-size: 12px; line-height: 1; flex: none; }


a.client-contact-chip:hover { border-color: var(--text-dim); background: var(--accent-soft); }

.client-row .order-card-sub { word-break: break-word; }
.client-row-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 3px; word-break: break-word; }
.client-row-name { font-weight: 700; font-size: 14.5px; }
.client-chip {
  background: var(--accent-soft); border-radius: 999px; padding: 4px 10px;
  font-size: 12px; font-weight: 700; white-space: nowrap;
}





.client-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
}

.client-panel-title { font-weight: 700; font-size: 16px; line-height: 1.4; margin-bottom: 14px; }

.client-panel-foot { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }

.client-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 20px; align-items: start; }


.client-info-col, .client-orders-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.client-field { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.client-field:last-child { border-bottom: none; }
.client-field-label { color: var(--text-dim); flex: none; }
.client-field span:last-child { text-align: right; word-break: break-word; min-width: 0; }
.client-notes-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }


.client-panel-foot .client-task-form { margin-top: 0; }




.client-dialog-row {
  padding: 10px 4px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  border-radius: 8px; margin: 0 -4px;
}
.client-dialog-row:hover { background: var(--panel-2); }
.client-dialog-row:last-child { border-bottom: none; }
.client-dialog-icon { font-size: 16px; flex-shrink: 0; }
.client-dialog-row-main { flex: 1; min-width: 0; }
.client-dialog-open-arrow { color: var(--text-dim); font-size: 16px; flex-shrink: 0; }
.client-dialog-name { font-weight: 600; font-size: 13.5px; }





.client-dialog-listing {
  display: block; margin-top: 3px; font-size: 12px; color: var(--dlg-accent, var(--accent-ink));
  text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.client-dialog-listing:hover { text-decoration: underline; }




.client-orders-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.client-orders-head h3 { margin: 0; }
.client-orders-total { color: var(--text-dim); font-size: 13px; font-weight: 600; }





.client-chip-banner {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: 10px; padding: 10px 14px;
  margin-bottom: 14px; font-size: 13.5px;
}


.client-task-list { display: flex; flex-direction: column; margin-bottom: 12px; }
.client-task-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.client-task-row:last-child { border-bottom: none; }
.client-task-row input[type="checkbox"] { width: auto; margin-top: 2px; flex: none; }
.client-task-main { flex: 1 1 auto; min-width: 0; }
.client-task-row .client-task-text { font-size: 13.5px; font-weight: 600; word-break: break-word; }

.client-task-row.done .client-task-text { text-decoration: line-through; color: var(--text-dim); font-weight: 500; }
.client-task-row.overdue .client-task-text { color: var(--red); }
.client-task-row .cl-task-del { flex: none; }














.client-task-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.client-task-form .client-task-text,
.client-task-form .client-task-actions { grid-column: 1 / -1; }


.client-task-form > * { min-width: 0; }
.client-task-form .client-task-cat,
.client-task-form .client-task-date,
.client-task-form .client-task-text { width: 100%; }







.client-task-form .client-task-date {
  -webkit-appearance: none;
  appearance: none;
  text-align: left;
  min-width: 0;
  max-width: 100%;
}
.client-task-actions { display: flex; justify-content: flex-end; }

@media (max-width: 560px) {



  .client-task-form { grid-template-columns: minmax(0, 1fr); }
  .client-task-actions { justify-content: center; }
}




.order-client-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
}
.order-client-person {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 6px 10px 6px 6px; margin: -6px 0 -6px -6px;
  border-radius: 999px; cursor: pointer;
  transition: background .12s;
}
.order-client-person:hover { background: var(--panel-2); }
.order-client-avatar { width: 38px; height: 38px; font-size: 15px; }
.order-client-name {
  font-weight: 700; font-size: 14.5px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}


.order-client-stats { display: flex; gap: 12px; margin-top: 3px; font-size: 12.5px; color: var(--text-dim); }
.order-client-stats b { color: var(--text); font-weight: 800; }
.order-client-money { color: var(--green); font-weight: 800; }
.order-client-actions { display: flex; gap: 8px; flex: none; flex-wrap: wrap; }
@media (max-width: 640px) {
  .order-client-row { flex-direction: column; align-items: flex-start; }
  .order-client-actions { width: 100%; }
  .order-client-actions .btn { flex: 1 1 auto; }
}





.attach-client-results { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.attach-client-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .12s;
}
.attach-client-row:hover { background: var(--panel-2); }
.attach-client-row.current { background: var(--accent-soft); }









.client-picker-modal { width: 460px; max-width: calc(100vw - 32px); }
.cp-head { margin-bottom: 2px; }
.cp-head h3 { margin-bottom: 3px; }
.cp-hint { color: var(--text-dim); font-size: 12.5px; line-height: 1.45; }

.cp-search { position: relative; margin: 14px 0 8px; }
.cp-search::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px;
  background: currentColor;
  color: var(--text-dim);
  opacity: 0.6;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
  pointer-events: none;
}
.cp-search input {
  width: 100%;
  padding: 9px 34px 9px 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  font-size: 13.5px;
  transition: background 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.cp-search input:focus {
  background: var(--panel);
  border-color: var(--accent-ink);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.cp-search-clear {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: var(--border); color: var(--text-dim);
  font-size: 10.5px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.12s ease, color 0.12s ease;
}
.cp-search-clear:hover { background: var(--accent); color: #fff; }
.cp-search-tip { color: var(--text-dim); font-size: 11.5px; padding: 0 2px; margin-bottom: 4px; }

.cp-results { max-height: 320px; overflow-y: auto; margin: 4px -6px 0; padding: 2px 6px; }
.cp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 6px; border-radius: 10px; cursor: pointer;
  transition: background 0.1s ease;
}
.cp-row:hover, .cp-row.cp-row-hl { background: var(--panel-2); }
.cp-row.current { background: var(--accent-soft); }
.cp-avatar {
  flex: none; width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12.5px; font-weight: 700; letter-spacing: 0.2px;
}
.cp-row-body { min-width: 0; flex: 1; }
.cp-row-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-row-contact { display: inline-flex; align-items: center; gap: 3px; }
.cp-row-contact-icon { font-size: 11px; }
.cp-row-contact-sep { margin: 0 5px; opacity: 0.6; }
.cp-row-contact-empty { font-style: italic; opacity: 0.75; }
.cp-row-trail { flex: none; display: flex; align-items: center; gap: 8px; }
.cp-row-check { color: var(--accent-ink); font-size: 15px; font-weight: 700; }
.cp-empty, .cp-more-hint { color: var(--text-dim); font-size: 12.5px; padding: 12px 6px; text-align: center; }





@media (max-width: 900px) {
  .client-layout { grid-template-columns: 1fr; }
  .client-new-order-top { display: none; }
}


@media (max-width: 640px) {


  .client-row .cl-status-toggle {
    width: auto; margin-left: auto;
    padding: 5px 10px; font-size: 11.5px;
  }
  .client-field { flex-direction: column; gap: 2px; }
  .client-field span:last-child { text-align: left; }
  .topbar-actions { width: 100%; }
  .topbar-actions .btn { flex: 1 1 auto; }
}









main.sheet-view {
  display: flex;
  flex-direction: column;
  overflow: hidden;

  height: calc(100vh - 36px);
  height: calc(100dvh - 36px);
}
main.sheet-view .topbar { flex: 0 0 auto; }
main.sheet-view .sheet-frame-wrap {
  flex: 1 1 auto;
  height: auto;   /* высоту теперь задаёт flex, готовый calc() ниже не нужен */
  min-height: 0;  /* без этого flex-элемент не сжимается ниже содержимого и вылезает за экран */
}



.sheet-frame-wrap {
  position: relative;
  height: calc(100vh - 150px);
  height: calc(100dvh - 150px); /* фолбэк на 100vh выше — для браузеров без dvh */
  min-height: 420px;

  overscroll-behavior: contain;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sheet-frame-wrap iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;



  background: #fff;
}




.sheet-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.55;
}

.sheet-frame-wrap iframe { position: relative; z-index: 1; }


.sheet-mobile-card {
  text-align: center;
  padding: 30px 20px 26px;
}
.sheet-mobile-icon { font-size: 38px; line-height: 1; margin-bottom: 10px; }
.sheet-mobile-card h3 { margin: 0 0 8px; }
.sheet-mobile-card p {
  margin: 0 auto 20px;
  max-width: 340px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-dim);
}


.sheet-mobile-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  padding: 13px 18px;
}





@media (max-width: 860px) {
  main.sheet-view {
    height: 100vh;
    height: 100dvh;
  }
  main.sheet-view .sheet-frame-wrap { min-height: 0; }
}

@media (max-width: 640px) {
  .sheet-frame-wrap {
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    border-radius: 14px;
  }
}







.health-section.bad { border-left: 3px solid var(--red); }
.health-section.warn { border-left: 3px solid var(--yellow); }

.health-ok { font-size: 13.5px; color: var(--text-dim); }

.health-count {
  display: inline-block;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 12px;
  text-align: center;
  vertical-align: middle;
}
.health-count.bad { background: var(--red-soft); color: var(--red); }
.health-count.warn { background: var(--yellow-soft); color: var(--yellow); }

.health-problem {
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.health-problem:first-of-type { border-top: none; }

.health-problem-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.health-problem-title { font-weight: 600; font-size: 14px; }

.health-problem-head .health-fix-btn { margin-left: auto; }

.health-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.health-dot.bad { background: var(--red); }
.health-dot.warn { background: var(--yellow); }

.health-problem-sum {
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

.health-details {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.health-details li { word-break: break-word; }
.health-note { opacity: 0.75; }

@media (max-width: 640px) {


  .health-problem-head .health-fix-btn { margin-left: 0; width: 100%; }
}





.same-contact-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--yellow-soft);
}
.same-contact-head {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 8px;
}
.same-contact-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 12.5px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.same-contact-num { font-weight: 700; flex: none; }


.same-contact-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.same-contact-date { flex: none; color: var(--text-dim); font-size: 11.5px; }

@media (max-width: 600px) {

  .same-contact-row { flex-wrap: wrap; }
  .same-contact-title { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
}





.decision-section { border-left: 3px solid var(--accent-ink); }

.decision-list { display: flex; flex-direction: column; gap: 8px; }



.decision-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color .15s, transform .15s;
}
.decision-row:hover { border-color: var(--accent-ink); transform: translateX(2px); }

.decision-icon { font-size: 18px; flex: none; }
.decision-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.decision-label { font-weight: 600; font-size: 14px; }
.decision-note { font-size: 12px; color: var(--text-dim); }
.decision-extra { font-size: 13px; font-weight: 700; color: var(--green); flex: none; }

.decision-count {
  flex: none;
  min-width: 26px;
  padding: 3px 9px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 600px) {


  .decision-note { display: none; }
  .decision-row { padding: 11px 12px; gap: 10px; }
}




.request-row.clickable { cursor: pointer; }

.request-sub.soon { color: var(--yellow); font-weight: 600; }
.request-sub.overdue { color: var(--red); font-weight: 600; }























.avito-alert {
  background: var(--yellow-soft); color: var(--text);
  border: 1px solid var(--border); border-left: 3px solid var(--yellow);
  border-radius: 14px; padding: 12px 16px; margin-bottom: 16px; font-size: 14px;
}

.avito-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px; margin-bottom: 20px;
}
.avito-kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.avito-kpi-label { color: var(--text-dim); font-size: 12px; margin-bottom: 6px; }
.avito-kpi-value { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }


.avito-kpi-muted { color: var(--text-dim); font-weight: 500; }

.avito-h3 { font-size: 15px; font-weight: 700; margin: 24px 0 8px; }
.avito-hint { color: var(--text-dim); font-size: 13px; margin-bottom: 12px; line-height: 1.5; }

.avito-hours {
  display: flex; align-items: flex-end; gap: 4px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 16px 10px; box-shadow: var(--shadow); overflow-x: auto;
}
.avito-hour { flex: 1 1 0; min-width: 18px; text-align: center; }
.avito-hour-bar { height: 110px; display: flex; align-items: flex-end; }
.avito-hour-fill {
  width: 100%; min-height: 2px; border-radius: 4px 4px 0 0;
  background: var(--green); opacity: 0.85;
}
.avito-hour-label { color: var(--text-dim); font-size: 10px; margin-top: 6px; }

.avito-table-wrap {
  overflow-x: auto; background: var(--panel);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow);


  overflow-y: hidden;
}
.avito-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.avito-table th, .avito-table td {
  padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}


.avito-table th {
  color: var(--text-dim); font-weight: 600; font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.avito-table tr:last-child td { border-bottom: none; }


.avito-table tbody tr:hover { background: var(--panel-2); }
.avito-table td.num, .avito-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.avito-table a { color: inherit; text-decoration: none; }
.avito-table a:hover { text-decoration: underline; text-underline-offset: 2px; }

.avito-chip {
  display: inline-block; margin-left: 8px; padding: 3px 9px; border-radius: 999px;
  background: var(--green-soft); color: var(--green); font-size: 11px; font-weight: 700;
  vertical-align: middle;
}


.avito-rules {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px; margin: 16px 0 4px;
}
.avito-rule {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px; box-shadow: var(--shadow);
}
.avito-rule-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.avito-rule-title { font-weight: 700; font-size: 15px; }
.avito-rule-desc { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.avito-rule-action { margin-top: 10px; font-size: 13px; color: var(--text); }



.avito-table td.avito-reason { white-space: normal; max-width: 380px; }
.avito-table td.avito-raw {
  white-space: normal; max-width: 460px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--text-dim); word-break: break-all;
}

.avito-chip-warn { background: var(--yellow-soft); color: var(--yellow); }
.avito-chip-err { background: var(--red-soft); color: var(--red); }



.avito-chip-ok { background: var(--green-soft); color: var(--green); }


.avito-sync-steps { margin: 12px 0 4px; }
.avito-sync-step {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 14px;
}
.avito-sync-step:last-child { border-bottom: none; }
.avito-sync-error {
  color: var(--red); font-size: 12px; padding: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-word;
}


.avito-listings-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}

.avito-group { margin-bottom: 26px; }
.avito-group-head { display: flex; align-items: center; gap: 8px; }
.avito-group-title { font-size: 15px; font-weight: 700; }
.avito-group-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.avito-group-hint { color: var(--text-dim); font-size: 13px; margin: 4px 0 12px; line-height: 1.5; }

.avito-tone-bad { background: var(--red); }
.avito-tone-warn { background: var(--yellow); }
.avito-tone-good { background: var(--green); }
.avito-tone-muted { background: var(--gray); }

.avito-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px;


  margin-bottom: 20px;
}


.avito-cards-wide {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
}




.avito-cards-wide .avito-card { flex-direction: column; gap: 4px; }
.avito-cards-wide .avito-media-actions { padding: 8px 0 0; }





.avito-cards-wide .avito-card-body { flex: 0 0 auto; }
.avito-card {
  display: flex; gap: 14px; padding: 18px 20px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;

  border-left-width: 3px;




  flex-wrap: wrap;
}
.avito-tone-border-bad { border-left-color: var(--red); }
.avito-tone-border-warn { border-left-color: var(--yellow); }
.avito-tone-border-good { border-left-color: var(--green); }
.avito-tone-border-muted { border-left-color: var(--border); }




.avito-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }





.avito-card-body { min-width: 0; flex: 1 1 240px; }
.avito-card-title { font-size: 16px; font-weight: 700; line-height: 1.4; margin-bottom: 6px; }
.avito-card-title a { color: inherit; text-decoration: none; }



.avito-card-title a:hover { opacity: 0.65; }
.avito-card-meta { color: var(--text-dim); font-size: 13px; margin-bottom: 8px; line-height: 1.5; }
.avito-card-metrics {
  display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--text-dim);
}
.avito-card-metrics b { color: var(--text); font-variant-numeric: tabular-nums; }

.avito-card-key { color: var(--text); }





.avito-listing-states { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.avito-listing-state-chip {
  border: 1px solid var(--border); background: var(--panel); border-radius: 14px;
  padding: 9px 13px; cursor: pointer; text-align: left; font-family: inherit; min-width: 104px;
}
.avito-listing-state-chip:hover { border-color: var(--text-dim); }

.avito-listing-state-chip.is-on { border-color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-ink); }
.avito-listing-state-chip .n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.avito-listing-state-chip .n.is-warn { color: var(--yellow); }
.avito-listing-state-chip .l { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.avito-listing-city { font-weight: 600; }
.avito-listing-sub { color: var(--text-dim); font-size: 12px; margin-top: 2px; line-height: 1.45; }
.avito-listing-sub a { color: inherit; }


.avito-listing-badge {
  display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600;
  border-radius: 20px; padding: 3px 9px; white-space: nowrap;
}
.avito-listing-badge.is-live { background: var(--green-soft); color: var(--green); }
.avito-listing-badge.is-bad { background: var(--red-soft); color: var(--red); }
.avito-listing-badge.is-warn { background: var(--yellow-soft); color: var(--yellow); }
.avito-listing-badge.is-dim { background: var(--panel-2); color: var(--text-dim); }



.avito-listing-stage {
  font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.45;
  max-width: 44ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}




.avito-listing-open {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--text); cursor: pointer; text-align: left;
}
.avito-listing-open:hover { text-decoration: underline; }
.avito-listing-city a { color: var(--text-dim); text-decoration: none; margin-left: 6px; }
.avito-listing-city a:hover { color: var(--text); }




.avito-bar { height: 8px; border-radius: 20px; background: var(--accent-soft); overflow: hidden; min-width: 60px; }
.avito-bar i { display: block; height: 8px; background: var(--accent); }
.avito-table tr.is-best td { background: var(--green-soft); }
.avito-table tr.is-best td b { color: var(--green); }


.bid-card-who {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 12px; color: var(--text-dim); margin-top: 8px;
}
.bid-card-seen { display: block; color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
.bid-card-spent { color: var(--text-dim); font-size: 12px; margin-top: 6px; line-height: 1.45; }



.bid-hist { display: flex; gap: 4px; align-items: flex-end; height: 76px; margin-top: 14px; }
.bid-hist-day { flex: 1 1 0; border-radius: 4px 4px 0 0; background: var(--accent); min-height: 4px; }
.bid-hist-day.is-noisy { background: var(--border); }




.avito-inbox {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden; margin-top: 12px;







  container-type: inline-size;
}

.avito-inbox-head,
.avito-inbox-row {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 132px 156px 136px; gap: 12px;
  padding: 11px 16px; align-items: start;
}
.avito-inbox-head {
  background: var(--panel-2); color: var(--text-dim); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700;
}
.avito-inbox-row { border-top: 1px solid var(--border); font-size: 13px; cursor: pointer; }
.avito-inbox-row:hover { background: var(--bg); }
.avito-inbox-row.is-open { background: var(--panel-2); }
.avito-inbox-when { color: var(--text-dim); font-size: 12.5px; white-space: nowrap; }
.avito-inbox-when b { display: block; color: var(--text); font-weight: 600; font-size: 13px; }
.avito-inbox-main { min-width: 0; }
.avito-inbox-text { line-height: 1.5; overflow-wrap: anywhere; }
.avito-inbox-src { color: var(--text-dim); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.avito-inbox-src a { color: inherit; }
.avito-inbox-note { color: var(--text-dim); font-size: 11.5px; margin-top: 4px; line-height: 1.4; }
.avito-inbox-order { font-size: 12.5px; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
.avito-inbox-order .avito-listing-badge { margin-top: 4px; }
.avito-inbox-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.avito-inbox-acts button {
  border: 1px solid var(--border); background: var(--panel); border-radius: 10px;
  padding: 5px 9px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; color: var(--text);
}
.avito-inbox-acts button:hover { border-color: var(--text-dim); }
.avito-inbox-more {
  grid-column: 1 / -1; border-top: 1px dashed var(--border); padding-top: 10px; margin-top: 2px;
}
.avito-inbox-full { font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.avito-inbox-meta { color: var(--text-dim); font-size: 12px; margin-top: 8px; line-height: 1.5; }


.avito-inbox-hours { display: flex; gap: 3px; align-items: flex-end; height: 74px; }
.avito-inbox-hour { flex: 1 1 0; background: var(--accent-soft); border-radius: 4px 4px 0 0; min-height: 2px; }
.avito-inbox-hour.is-peak { background: var(--accent); }
.avito-inbox-hour.is-zero { background: var(--border); }
.avito-inbox-hours-legend {
  display: flex; justify-content: space-between; color: var(--text-dim); font-size: 11px; margin-top: 5px;
}



@container (max-width: 820px) {
  .avito-inbox-head { display: none; }
  .avito-inbox-row { grid-template-columns: 1fr; gap: 8px; }
  .avito-inbox-acts { flex-direction: row; flex-wrap: wrap; }
}


@media (max-width: 860px) {
  .avito-inbox-head { display: none; }
  .avito-inbox-row { grid-template-columns: 1fr; gap: 8px; }
  .avito-inbox-acts { flex-direction: row; flex-wrap: wrap; }
}




.avito-res-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 10px; }
.avito-res-head .avito-dash-h { margin: 0; flex: 1 1 auto; }

.avito-card-rows { margin-top: 14px; }
.avito-card-row {
  display: flex; gap: 12px; align-items: baseline;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.avito-card-row:first-child { border-top: none; }
.avito-card-row .k { color: var(--text-dim); flex: 0 0 168px; }
.avito-card-row .v { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
@media (max-width: 720px) {
  .avito-card-row { flex-wrap: wrap; gap: 2px; }
  .avito-card-row .k { flex: 1 1 100%; }
}



.avito-pack-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px;
}
.avito-pack {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 12px 13px; min-width: 0;
}
.avito-pack.is-best { border-color: var(--green); }
.avito-pack.is-worst { border-color: var(--yellow); }
.avito-pack-cover {
  width: 100%; height: 96px; border-radius: 12px; object-fit: cover; background: var(--panel-2); display: block;
}
.avito-pack-cover.is-empty {
  display: grid; place-items: center; color: var(--text-dim); font-size: 12px;
}
.avito-pack-name { font-size: 13.5px; font-weight: 600; margin-top: 9px; overflow-wrap: anywhere; }
.avito-pack-sub { color: var(--text-dim); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.avito-pack-res {
  font-size: 12.5px; margin-top: 7px; padding-top: 7px;
  border-top: 1px solid var(--border); line-height: 1.5;
}



.avito-mx td, .avito-mx th { text-align: center; }
.avito-mx td:first-child, .avito-mx th:first-child { text-align: left; }
.avito-mx td.is-best { background: var(--green-soft); color: var(--green); font-weight: 600; }
.avito-mx td.is-worst { background: var(--yellow-soft); color: var(--pastel-yellow-text); }
.avito-mx td.is-none { color: var(--text-dim); }


.avito-set-row-res {
  margin-left: auto; flex: 0 0 auto; text-align: right;
  font-size: 11.5px; color: var(--text-dim); line-height: 1.35;
}
.avito-set-row-res.is-good { color: var(--green); }
.avito-set-row-res.is-warn { color: var(--yellow); }





.avito-ad-back { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.avito-ad-who { color: var(--text-dim); font-size: 12.5px; }

.avito-ad-top {
  display: flex; gap: 18px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px;
}
.avito-ad-photo {
  width: 132px; height: 99px; border-radius: 14px; object-fit: cover;
  background: var(--panel-2); flex: 0 0 auto;
}
.avito-ad-photo.is-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 12px;
}
.avito-ad-head { min-width: 0; flex: 1 1 auto; }
.avito-ad-title { font-size: 16px; font-weight: 600; line-height: 1.35; }
.avito-ad-meta { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }
.avito-ad-meta a { color: inherit; }
.avito-ad-price { font-size: 18px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }
.avito-ad-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }



.avito-ad-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px;
}
.avito-ad-why { font-size: 14px; line-height: 1.6; }
.avito-ad-facts { color: var(--text-dim); font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
.avito-ad-box .avito-hint { margin: 12px 0 0; }
.avito-ad-acts {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border);
}


.avito-ad-vs { font-size: 13px; margin-top: 14px; line-height: 1.5; }
.avito-ad-vs.is-good { color: var(--green); }
.avito-ad-vs.is-warn { color: var(--yellow); }
.avito-ad-vs.is-off { color: var(--text-dim); }


.avito-table tr.is-here td { background: var(--accent-soft); }


.avito-dim { color: var(--text-dim); }


.avito-ad-leads {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 6px 20px;
}
.avito-ad-lead {
  display: flex; gap: 14px; align-items: baseline;
  padding: 11px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.avito-ad-lead:first-child { border-top: none; }
.avito-ad-lead .w { color: var(--text-dim); font-size: 12.5px; flex: 0 0 auto; }
.avito-ad-lead .t { flex: 1 1 auto; min-width: 0; line-height: 1.5; }
.avito-ad-lead .a { color: var(--text-dim); font-size: 12.5px; flex: 0 0 auto; }

@media (max-width: 720px) {
  .avito-ad-top { flex-wrap: wrap; }
  .avito-ad-photo { width: 100%; height: 160px; }
  .avito-ad-lead { flex-wrap: wrap; gap: 6px; }
}


.avito-listing-bulk {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--accent-soft); border-radius: 14px; padding: 11px 14px;
  font-size: 13px; margin-bottom: 12px;
}





.avito-rule {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 12px;
}
.avito-rule-top { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.avito-rule-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.avito-rule-kind {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim);
  background: var(--panel-2); border-radius: 20px; padding: 3px 9px; font-weight: 700;
}
.avito-rule-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.avito-rule-sub { color: var(--text-dim); font-size: 12.5px; margin-top: 4px; line-height: 1.5; }


.avito-rule-sw {
  margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-dim); white-space: nowrap;
}
.avito-rule-track {
  width: 38px; height: 22px; border-radius: 20px; background: var(--green);
  position: relative; flex: 0 0 auto;
}
.avito-rule-track.is-off { background: var(--border); }
.avito-rule-knob {
  position: absolute; top: 3px; left: 19px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--panel);
}
.avito-rule-track.is-off .avito-rule-knob { left: 3px; }

.avito-rule-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 12px; margin-top: 16px;
}
.avito-rule-cell { background: var(--panel-2); border-radius: 14px; padding: 11px 13px; min-width: 0; }
.avito-rule-cap { color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.03em; }
.avito-rule-big { font-size: 16px; font-weight: 600; margin-top: 4px; overflow-wrap: anywhere; }
.avito-rule-small { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.45; }

.avito-rule-warn {
  display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap;
  font-size: 12.5px; color: var(--yellow); background: var(--yellow-soft);
  border-radius: 12px; padding: 10px 12px; margin-top: 12px; line-height: 1.5;
}


.avito-rule-warn .avito-cab-link { color: var(--pastel-yellow-text); }
.avito-rule-note { font-size: 12.5px; color: var(--text-dim); margin-top: 12px; line-height: 1.5; }
.avito-rule-note.is-warn { color: var(--yellow); }
.avito-rule-foot {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border);
}
.avito-rule-last { font-size: 12.5px; color: var(--text-dim); }


.avito-rule-empty {
  border: 1px dashed var(--border); border-radius: 18px; padding: 16px 18px;
  color: var(--text-dim); font-size: 12.5px; line-height: 1.55;
}



.avito-rule-editor { margin-bottom: 20px; }
.avito-rule-block {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 16px 18px; margin-top: 12px;
}
.avito-rule-block-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.avito-rule-block-num {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; flex: 0 0 auto;
}
.avito-rule-block-title { font-size: 15px; font-weight: 600; }
.avito-rule-block-why {
  color: var(--text-dim); font-size: 12.5px; margin: 8px 0 12px; line-height: 1.55; max-width: 78ch;
}
.avito-rule-editor .avito-rule-top { padding-bottom: 4px; }







.avito-res-early td { background: var(--panel-2); color: var(--text-dim); }
.avito-res-early td b { font-weight: 600; color: var(--text-dim); }
.avito-res-verdict {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  font-weight: 600; white-space: nowrap; color: var(--text-dim);
}
.avito-res-verdict.is-good { color: var(--green); }
.avito-res-verdict.is-warn { color: var(--yellow); }
.avito-res-verdict.is-off { font-weight: 400; }





.avito-crumbs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.avito-crumb-back {
  background: none; border: none; padding: 0; font: inherit; font-size: 13px;
  color: var(--text-dim); cursor: pointer;
}
.avito-crumb-back:hover { color: var(--text); }
.avito-crumb-sep { color: var(--text-dim); }
.avito-who { position: relative; }
.avito-who-btn {
  display: inline-flex; align-items: center; gap: 9px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px 5px 6px;
  cursor: pointer; font: inherit;
}
.avito-who-btn:hover { border-color: var(--text-dim); }
.avito-who-ava {
  width: 26px; height: 26px; border-radius: 12px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text-dim);
  flex: 0 0 auto;
}
.avito-who-name { font-size: 13.5px; font-weight: 600; }
.avito-who-chev { color: var(--text-dim); font-size: 12px; }


.avito-who-menu, .avito-more-menu {
  position: absolute; z-index: 40; top: calc(100% + 6px); left: 0;
  min-width: 280px; max-width: min(92vw, 380px);
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 8px;
}
.avito-who-row, .avito-more-row {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  background: none; border: none; border-radius: 12px; padding: 8px 10px;
  font: inherit; font-size: 13px; cursor: pointer; color: var(--text);
}
.avito-who-row:hover, .avito-more-row:hover { background: var(--panel-2); }
.avito-who-row.is-on, .avito-more-row.is-on { background: var(--accent-soft); font-weight: 600; }





.avito-who-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.avito-who-row-name { overflow-wrap: break-word; }
.avito-who-row-state { font-size: 11.5px; color: var(--text-dim); }
.avito-who-row-state.is-bad { color: var(--red); }
.avito-who-row-state.is-warn { color: var(--yellow); }
.avito-who-menu-sep { height: 1px; background: var(--border); margin: 6px 10px; }
.avito-crumb-state {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--text-dim); margin-left: auto; white-space: nowrap;
}
.avito-crumb-state.is-bad { color: var(--red); font-weight: 600; }
.avito-crumb-state.is-warn { color: var(--yellow); font-weight: 600; }


.avito-more { position: relative; display: inline-flex; }
.avito-more-menu { right: 0; left: auto; }



.content-tabs + .content-subtabs { margin-top: -8px; }





.avito-dash-sec + .avito-dash-sec { margin-top: 24px; }
.avito-dash-h {
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-dim); margin: 0 0 10px; font-weight: 700;
}
.avito-dash-sec .avito-cab-issue { margin-top: 0; }
.avito-dash-sec .avito-cab-issue + .avito-cab-issue { margin-top: 8px; }

.avito-now {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 18px 20px;
}
.avito-now-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.avito-now-title { font-size: 15px; font-weight: 600; }
.avito-now-when { color: var(--text-dim); font-size: 12.5px; }
.avito-now-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 14px; margin-top: 14px;
}
.avito-now-cell { background: var(--panel-2); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.avito-now-cap { color: var(--text-dim); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.03em; }
.avito-now-big { font-size: 17px; font-weight: 600; margin-top: 4px; }
.avito-now-lst { font-size: 12.5px; color: var(--text); margin-top: 4px; line-height: 1.5; overflow-wrap: anywhere; }
.avito-now-note {
  font-size: 12.5px; color: var(--yellow); background: var(--yellow-soft);
  border-radius: 12px; padding: 9px 12px; margin-top: 12px; line-height: 1.5;
}
.avito-now-foot {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border);
}



.avito-dash-two {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px;


  align-items: start;
}
.avito-dash-box {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.avito-dash-box h4 { font-size: 14px; margin: 0 0 10px; }
.avito-dash-row {
  display: flex; gap: 12px; align-items: baseline; padding: 8px 0;
  border-top: 1px solid var(--border); font-size: 13px;
}
.avito-dash-rows .avito-dash-row:first-child { border-top: none; }
.avito-dash-row .k { color: var(--text-dim); flex: 1 1 auto; min-width: 0; }
.avito-dash-row .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.avito-dash-row .v.dim { color: var(--text-dim); font-weight: 400; }
.avito-dash-row .v.is-warn { color: var(--yellow); }
.avito-dash-note { color: var(--text-dim); font-size: 11.5px; line-height: 1.5; margin: 12px 0 0; }

@media (max-width: 640px) {
  .avito-crumb-state { margin-left: 0; width: 100%; }
  .avito-now { padding: 16px; }



  .avito-who-menu { left: auto; right: 0; min-width: 240px; max-width: calc(100vw - 32px); }
}






.avito-cab {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 12px;
}
.avito-cab-top { display: flex; gap: 14px; align-items: flex-start; }



.avito-cab-ava {
  width: 52px; height: 52px; border-radius: 14px; flex: 0 0 auto; overflow: hidden;
  background: var(--accent-soft); border: none; padding: 0; cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
  color: var(--text-dim); font-size: 17px; font-weight: 600;
}
.avito-cab-ava:hover { opacity: 0.8; }
.avito-cab-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }

.avito-cab-who { flex: 1 1 200px; min-width: 0; }
.avito-cab-name { font-size: 17px; font-weight: 600; }
.avito-cab-meta {
  color: var(--text-dim); font-size: 12.5px; margin-top: 3px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.avito-cab-meta b { color: var(--text); font-weight: 600; }
.avito-cab-star { color: var(--yellow); }

.avito-cab-gapless {
  display: inline-flex; align-items: center; border: 1px dashed var(--border);
  border-radius: 20px; padding: 2px 9px; font-size: 11.5px; color: var(--text-dim);
}

.avito-cab-state {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--text-dim); margin-left: auto; padding-top: 2px; text-align: right;
}
.avito-cab-state.is-bad { color: var(--red); font-weight: 600; }
.avito-cab-state.is-warn { color: var(--yellow); font-weight: 600; }
.avito-cab-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; background: var(--gray); }
.avito-cab-dot.is-good { background: var(--green); }
.avito-cab-dot.is-warn { background: var(--yellow); }
.avito-cab-dot.is-bad { background: var(--red); }
.avito-cab-dot.is-off { background: var(--border); }


.avito-cab-stats { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 18px; }
.avito-cab-stat { min-width: 84px; }
.avito-cab-v { font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.avito-cab-l { color: var(--text-dim); font-size: 12px; margin-top: 3px; }
.avito-cab-s { color: var(--text-dim); font-size: 11.5px; margin-top: 1px; }
.avito-cab-s.is-warn { color: var(--yellow); }



.avito-cab-issue {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 18px;
  background: var(--red-soft); border-radius: 14px; padding: 13px 15px;
}
.avito-cab-issue.is-warn { background: var(--yellow-soft); }



.bid-orphans {
  display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin: 12px 0 16px;
  background: var(--yellow-soft); border-radius: 14px; padding: 13px 15px;
}
.bid-orphans-text { flex: 1 1 320px; min-width: 0; line-height: 1.5; }
.bid-orphans-list { margin: 6px 0 0; padding-left: 18px; }
.bid-orphans-list li { margin: 2px 0; }
.bid-orphans .btn { flex: 0 1 auto; max-width: 100%; white-space: normal; text-align: center; }







.avito-cab-issue[hidden] { display: none; }
.avito-cab-issue-text { flex: 1 1 auto; min-width: 0; font-size: 13px; line-height: 1.5; }
.avito-cab-issue-text b { font-weight: 600; }
.avito-cab-issue-text span { color: var(--text-dim); }
.avito-cab-link {
  background: none; border: none; padding: 0; font: inherit; font-size: 13px; font-weight: 600;
  color: var(--red); cursor: pointer; white-space: nowrap;
}
.avito-cab-issue.is-warn .avito-cab-link { color: var(--pastel-yellow-text); }

.avito-cab-foot {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border);
}
.avito-cab-rule { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-dim); }
.avito-cab-rule b { color: var(--text); font-weight: 600; }
.avito-cab-spacer { flex: 1 1 auto; }


.avito-cab-quiet {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 7px 13px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  color: var(--text); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.avito-cab-quiet:hover { border-color: var(--text-dim); }
.avito-cab-open {
  background: none; border: none; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--text); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.avito-cab-chev { color: var(--text-dim); font-weight: 400; }

@media (max-width: 640px) {
  .avito-cab { padding: 16px 16px; }
  .avito-cab-stats { gap: 18px; }

  .avito-cab-state { margin-left: 0; width: 100%; text-align: left; }
  .avito-cab-top { flex-wrap: wrap; }
}


.avito-card-nolink { color: var(--text-dim); }
.avito-seg-btn {
  background: none; border: none; padding: 0 0 0 8px; cursor: pointer;
  color: var(--text-dim); font-size: 12px; text-decoration: none; font-family: inherit;
}
.avito-seg-btn:hover { color: var(--text); text-decoration: underline; }

.avito-order-list { max-height: 320px; overflow-y: auto; margin: 8px 0; }
.avito-order-row {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 9px 12px; background: none; border: none; border-bottom: 1px solid var(--border);
  cursor: pointer; font-family: inherit; font-size: 14px;
}
.avito-order-row:hover { background: var(--panel-2); }
.avito-order-num { color: var(--text-dim); font-variant-numeric: tabular-nums; flex: none; }



.avito-order-title { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.avito-order-price { color: var(--text-dim); flex: none; font-variant-numeric: tabular-nums; }

.avito-target-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.avito-target-form .input { flex: 1 1 150px; min-width: 0; }

.avito-alert-error { background: var(--red-soft); border-left-color: var(--red); }

.modal-wide { max-width: 900px; width: 92vw; }
.avito-table code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

.avito-mine-list { margin-top: 8px; }
.avito-mine-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px;
}
.avito-mine-row .avito-reason { white-space: normal; }

.avito-sample-list { margin: 6px 0 0 18px; padding: 0; }
.avito-sample-list li { margin: 2px 0; }

.avito-raw-json {
  max-height: 55vh; overflow: auto; background: var(--panel-2); border-radius: 12px;
  padding: 12px; font-size: 12px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

.avito-field-note { color: var(--text-dim); font-size: 11px; margin-top: 2px; }




.avito-hint-warn { color: var(--yellow); }
.avito-media-item.is-small { border-color: var(--yellow); }
.avito-media-usage { margin-bottom: 12px; }






.media-usage {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 20px; box-shadow: var(--shadow); margin-bottom: 12px;
}
.media-usage-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.media-usage-total { font-size: 16px; font-weight: 700; }
.media-usage-free { font-size: 12px; color: var(--text-dim); }

.media-usage-bar { display: flex; gap: 2px; height: 10px; margin-bottom: 10px; }



.media-usage-seg { min-width: 6px; border-radius: 2px; }
.media-usage-seg:first-child { border-radius: 6px 2px 2px 6px; }
.media-usage-seg:last-child { border-radius: 2px 6px 6px 2px; }

.media-usage-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-dim); }
.media-usage-key { display: inline-flex; align-items: center; gap: 5px; }
.media-usage-dot { width: 8px; height: 8px; border-radius: 2px; flex: 0 0 auto; }

@media (max-width: 640px) {
  .media-usage { padding: 14px 16px; border-radius: 14px; }


  .media-usage-head { display: block; }
  .media-usage-free { margin-top: 2px; }
  .media-usage-bar { height: 12px; }
  .media-usage-legend { gap: 5px 12px; }
}
.avito-media-upload { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.avito-media-upload .input { flex: 1 1 220px; min-width: 180px; }




.avito-media-upload .file-picker { flex: 0 1 auto; }




.avito-media-grid {
  display: grid; gap: 10px; margin-top: 12px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
}
.avito-media-item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; background: var(--panel);
}
.avito-media-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--panel-2); }
.avito-media-meta { padding: 6px 8px 2px; }



.avito-media-name {
  font-size: 12px; line-height: 1.35; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.avito-media-meta .avito-card-meta { font-size: 11px; }
.avito-media-actions {
  display: flex; gap: 6px; padding: 4px 8px 8px; margin-top: auto;


  flex-wrap: wrap;
}


.avito-media-actions .btn { flex: 1 1 auto; }


.avito-issue-list { margin: 0 0 12px; padding-left: 18px; }
.avito-issue-list li { margin-bottom: 4px; font-size: 13px; }
.avito-issue-list li.is-bad { color: var(--red); }
.avito-issue-list li.is-warn { color: var(--yellow); }
.avito-template-desc { white-space: pre-wrap; margin-top: 6px; }
.avito-preview {
  border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; background: var(--panel);
}
.avito-preview-title { font-weight: 600; margin-bottom: 4px; }


.avito-field-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.avito-field-row { display: block; margin-bottom: 10px; }
.avito-field-row > span { display: block; font-size: 13px; margin-bottom: 4px; }
.avito-req { color: var(--red); font-weight: 600; font-size: 11px; }
.avito-details { margin: 10px 0; }
.avito-details > summary { cursor: pointer; font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.avito-pick-grid {
  display: grid; gap: 8px; margin-bottom: 10px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}
.avito-pick { position: relative; cursor: pointer; border: 2px solid transparent; border-radius: 12px; overflow: hidden; }
.avito-pick img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; opacity: 0.55; transition: opacity 0.12s; }
.avito-pick:hover img { opacity: 0.8; }
.avito-pick.is-picked { border-color: var(--accent-ink); }
.avito-pick.is-picked img { opacity: 1; }
.avito-pick-badge {
  position: absolute; top: 5px; left: 5px; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
}
.avito-pick:not(.is-picked) .avito-pick-badge { display: none; }





select[multiple] { height: auto; min-height: 92px; padding: 6px; }
select[multiple] option { padding: 3px 6px; border-radius: 4px; }

.avito-city-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.avito-city-toolbar .input { flex: 0 1 240px; }
.avito-city-toolbar .chat-folder-chips { margin: 0; }



.link-btn {
  background: none; border: 0; padding: 0; font: inherit; cursor: pointer;
  color: var(--text); font-weight: 600; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }


.modal-hint a { color: var(--text); font-weight: 600; text-decoration: none; }
.modal-hint a:hover { text-decoration: underline; }

.avito-pricelist td { padding: 4px 6px; }
.avito-pricelist input[type="text"], .avito-pricelist input[type="number"], .avito-pricelist select { padding: 6px 8px; }
.avito-pricelist td:nth-child(2) { width: 110px; }
.avito-pricelist td:nth-child(3) { width: 40px; text-align: center; }
.avito-pricelist td:nth-child(4) { width: 130px; }
.avito-pricelist td:last-child { width: 40px; }






.modal-form { display: flex; flex-direction: column; max-height: 88vh; padding: 0; width: min(760px, 94vw); }
.modal-form .avito-form-head { padding: 22px 24px 0; }
.modal-form .avito-form-head h3 { margin: 0 0 16px; font-size: 17px; }
.modal-form .avito-form-tabs { margin: 16px 0 0; gap: 6px; }
.modal-form .avito-form-body {
  flex: 1 1 auto; overflow-y: auto; padding: 18px 24px 22px;
  border-top: 1px solid var(--border);
}
.modal-form .avito-form-foot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--border); background: var(--panel);
}
.avito-form-summary { flex: 1 1 200px; font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.avito-form-summary .avito-hint-warn { color: var(--yellow); }






.avito-form-buttons { display: flex; gap: 8px; flex: 0 1 auto; margin-left: auto; flex-wrap: wrap; }
.fld-active { margin: 0; white-space: nowrap; flex: 0 0 auto; }





.fld { margin-bottom: 16px; }
.fld:last-child { margin-bottom: 0; }
.fld-label {
  display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
  font-size: 12px; font-weight: 600; color: var(--text-dim);
  margin-bottom: 6px; min-height: 16px; line-height: 16px;
}
.fld-note { font-size: 11.5px; color: var(--text-dim); margin-top: 5px; font-weight: 400; }
.fld-note.is-warn { color: var(--yellow); }
.fld-req {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em;
  color: var(--red); background: var(--red-soft); padding: 2px 6px; border-radius: 5px; margin-left: 6px;
}
.fld-section {
  display: flex; align-items: center; gap: 2px;
  font-size: 13px; font-weight: 600; color: var(--text); margin: 4px 0 12px;
}
.fld-warn {
  font-size: 12.5px; line-height: 1.5; color: var(--text);
  background: var(--yellow-soft); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
}
.fld-warn .btn { margin-top: 8px; }



.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }


.hint-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; flex: 0 0 auto; margin-left: 4px;
  border: 0; border-radius: 50%; background: var(--accent-soft); color: var(--text-dim);
  font-size: 10px; font-weight: 700; font-family: inherit; cursor: help; padding: 0;
}
.hint-dot:hover, .hint-dot:focus-visible { background: var(--accent); color: #fff; }




.hint-dot[data-tooltip]::after { content: none; }
.hint-bubble {
  position: fixed; z-index: 100; max-width: 280px;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 500; line-height: 1.45; text-align: left;
  padding: 8px 11px; border-radius: 9px; box-shadow: var(--shadow);
  pointer-events: none;
}
.hint-bubble[hidden] { display: none; }

@media (max-width: 640px) {


  .modal-form {
    width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh;
    border-radius: 0; border: 0;
  }
  .modal-form .avito-form-head { padding: 16px 16px 0; }
  .modal-form .avito-form-body { padding: 14px 16px 18px; }
  .modal-form .avito-form-foot { padding: 12px 16px; gap: 10px; }
  .avito-form-buttons { width: 100%; margin-left: 0; }
  .avito-form-buttons .btn { flex: 1; }
  .fld-row { grid-template-columns: 1fr; }
  .modal-form .avito-form-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .modal-form .avito-form-tabs .chat-folder-chip { white-space: nowrap; }
  .tip-wrap::after { width: min(260px, 70vw); }
}




.rt { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel); }
.rt-toolbar {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--panel-2);
}
.rt-btn {
  background: none; border: 1px solid transparent; border-radius: 6px;
  padding: 4px 9px; font-size: 13px; color: var(--text); cursor: pointer; font-family: inherit;
}
.rt-btn:hover:not(:disabled) { background: var(--panel); border-color: var(--border); }
.rt-btn:disabled { opacity: 0.4; cursor: default; }
.rt-btn.rt-right { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.rt-area {
  min-height: 170px; max-height: 36vh; overflow-y: auto;
  padding: 12px 14px; font-size: 13.5px; line-height: 1.55; outline: none;
}
.rt-area:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.rt-area p { margin: 0 0 10px; }
.rt-area p:last-child { margin-bottom: 0; }
.rt-area ul, .rt-area ol { margin: 0 0 10px; padding-left: 22px; }
.rt-area li { margin: 2px 0; }
.rt-area:empty::before { content: 'Текст объявления'; color: var(--text-dim); }
.rt-code {
  width: 100%; border: 0; border-radius: 0; min-height: 170px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
}
.rt-code:focus { box-shadow: none; }


.avito-pricelist th { white-space: nowrap; }
.avito-pricelist th .hint-dot { vertical-align: middle; }


.avito-pricelist input[type="checkbox"] { width: auto; height: auto; margin: 0; }


.avito-pricelist td { vertical-align: middle; }




.avito-sum {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 18px;
  background: var(--panel); border: 1px solid var(--border);
  border-left: 3px solid var(--gray); border-radius: 14px;
}
.avito-sum.is-good { border-left-color: var(--green); }
.avito-sum.is-bad { border-left-color: var(--red); }
.avito-sum-main { display: flex; align-items: baseline; gap: 8px; }
.avito-sum-count { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; }
.avito-sum-word { font-size: 13px; color: var(--text); }
.avito-sum-note { font-size: 12.5px; color: var(--text-dim); }




.avito-block-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; margin: 22px 0 12px;
}
.avito-block-head .avito-h3 { margin: 0; display: flex; align-items: center; gap: 2px; }









.avito-cities-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.avito-cities-bar-text { flex: 1 1 200px; min-width: 0; }
.avito-cities-bar-title {
  display: flex; align-items: center; gap: 2px;
  font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.avito-cities-bar-note { font-size: 13px; color: var(--text-dim); }
.avito-cities-bar-note .is-warn { color: var(--yellow); }

.city-found { font-size: 12.5px; color: var(--text-dim); margin: 10px 0 0; }



.modal-form .avito-form-body .city-list { padding-bottom: 4px; }








.city-list {
  display: grid; gap: 1px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}


.city-letter {
  grid-column: 1 / -1; position: sticky; top: -1px; z-index: 1;
  padding: 10px 10px 5px; margin-top: 4px;
  background: var(--panel);
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-dim); text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}
.city-letter:first-child { margin-top: 0; }
.city-row {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 6px 10px; border-radius: 8px; cursor: pointer; font-weight: 400;
  min-width: 0;
}
.city-row:hover { background: var(--panel-2); }



.city-row input[type="checkbox"] { flex: 0 0 auto; width: auto; height: auto; margin: 0; }
.city-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }




.city-row-name { font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.city-row-addr { font-size: 11.5px; color: var(--text-dim); overflow-wrap: anywhere; }
.city-row-addr.is-warn { color: var(--yellow); }
.city-row-edit {
  flex: 0 0 auto; width: 26px; height: 26px; border: 0; border-radius: 8px;
  background: none; color: var(--text-dim); cursor: pointer; font-size: 13px;
  opacity: 0; transition: opacity .12s; padding: 0;
}
.city-row:hover .city-row-edit, .city-row-edit:focus-visible { opacity: 1; }
.city-row-edit:hover { background: var(--accent-soft); color: var(--text); }


.avito-city-toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.avito-city-toolbar .input { flex: 0 1 260px; }
.avito-city-toolbar .chat-folder-chips { margin: 0; flex: 1 1 auto; }

@media (max-width: 640px) {

  .city-row-edit { opacity: 1; }
  .city-list { grid-template-columns: 1fr; }
  .avito-cities-bar { flex-direction: column; align-items: stretch; }
  .avito-cities-bar .btn { width: 100%; }
  .avito-city-toolbar { align-items: stretch; }
  .avito-city-toolbar .input { flex: 1 1 auto; }
  .avito-city-toolbar .chat-folder-chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .avito-city-toolbar .chat-folder-chip { white-space: nowrap; }
}

@media (max-width: 640px) {
  .avito-block-head { align-items: stretch; }
  .avito-block-head .btn { width: 100%; }
  .avito-sum { padding: 12px 14px; }
}





.modal-form input[type="checkbox"],
.avito-cards input[type="checkbox"],
.avito-pricelist input[type="checkbox"] { accent-color: var(--accent-ink); }





.modal-form :focus { outline: none; }
.modal-form button:focus-visible,
.modal-form [tabindex]:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); }





.pick-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.pick-head .fld-label { margin: 0; }
.pick-links { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; justify-content: flex-end; }
.pick-links .link-btn { white-space: nowrap; }
.pick-links .input { flex: 0 0 160px; height: 32px; padding: 6px 10px; font-size: 12.5px; }
.pick-sep { color: var(--border); }

.pick-grid {
  display: grid; gap: 2px;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.pick-item {
  display: flex; align-items: center; gap: 9px; margin: 0;
  padding: 7px 9px; border-radius: 8px; cursor: pointer;
  font-size: 13.5px; font-weight: 400; color: var(--text);
}
.pick-item:hover { background: var(--panel-2); }
.pick-item input[type="checkbox"] { flex: 0 0 auto; width: auto; height: auto; margin: 0; }
.pick-item span { min-width: 0; overflow-wrap: anywhere; }
.pick-count {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  background: var(--panel-2); color: var(--text-dim); font-size: 11px; font-weight: 600;
}

.pick-grid-tight { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }




.pick-addr { display: block; font-size: 11px; color: var(--text-dim); margin-top: 1px; line-height: 1.35; }
.pick-addr.is-bad { color: var(--red); }
.pick-item.is-noaddr { border-color: var(--red-soft); }





.pick-total { font-size: 12px; color: var(--text-dim); white-space: nowrap; }


.pick-total.is-fallback { color: var(--red); font-weight: 600; }
.pick-only { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 8px; }
.pick-chip {
  border: 1px solid var(--border); background: var(--panel); color: var(--text-dim);
  border-radius: 999px; padding: 3px 12px; font: inherit; font-size: 12.5px; cursor: pointer;
  width: auto; height: auto;
}
.pick-chip:hover { color: var(--text); }
.pick-chip.on { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }

.pick-grp { border-top: 1px solid var(--border); }
.pick-grp:first-child { border-top: 0; }
.pick-grp-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 9px 2px; cursor: pointer; list-style: none;
}
.pick-grp-head::-webkit-details-marker { display: none; }


.pick-grp-head::before {
  content: '▸'; color: var(--text-dim); font-size: 11px; line-height: 1;
}
.pick-grp[open] > .pick-grp-head::before { content: '▾'; }
.pick-grp-name { font-weight: 600; font-size: 13.5px; }
.pick-grp-n { font-size: 12px; color: var(--text-dim); }

.pick-grp-head .link-btn { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.pick-sp { flex: 1 1 auto; }
.pick-grp .pick-grid { padding: 0 0 10px; }



.pick-use { display: block; font-size: 11px; color: var(--accent-ink); margin-top: 1px; line-height: 1.35; }



.pick-ok { margin-left: 5px; font-size: 11px; font-weight: 700; color: var(--green); }
.pick-moved { display: block; font-size: 11px; color: var(--red); margin-top: 1px; line-height: 1.35; }
.pick-trust-btn { font-weight: 600; }
.pick-trust-note { margin: 6px 0 8px; line-height: 1.5; }
.pick-use.is-free { color: var(--text-dim); opacity: .65; }
.pick-item.is-busy { background: var(--accent-soft); }
.pick-item.is-busy:hover { background: var(--accent-soft); filter: brightness(.97); }

.pick-off {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px;
  background: var(--gray-soft); color: var(--text-dim); font-size: 10.5px; white-space: nowrap;
}



.t-addr-row {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 8px 0; border-top: 1px solid var(--border);
}
.t-addr-row:first-child { border-top: none; }
.t-addr-city { font-size: 13px; font-weight: 600; min-width: 120px; }
.t-addr-row .input { flex: 1 1 220px; min-width: 0; }
.t-addr-state { font-size: 12px; color: var(--text-dim); }



.t-upload {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 10px; margin-top: 10px; border: 1px dashed var(--border); border-radius: 14px;
  background: var(--panel-2);
}
.t-upload .input { flex: 1 1 220px; min-width: 0; }
.t-upload .file-picker { flex: 0 1 auto; }









.t-packs-find { margin-bottom: 10px; }
.t-packs-h {
  font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); margin: 12px 0 6px;
}
.t-packs-h[hidden] { display: none; }


.t-pack-in { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.t-pack-in.dim { opacity: .6; }

.t-packs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 168px), 1fr));
  gap: 10px; margin-bottom: 4px;


  align-items: stretch;
}
.t-pack {
  border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
  padding: 9px; cursor: pointer; min-width: 0; display: block; position: relative;




  margin: 0; color: var(--text);
}
.t-pack:hover { border-color: var(--text-dim); }







.t-pack[hidden] { display: none; }

.t-pack.is-on, .t-pack:has(input:checked) {
  border-color: var(--accent-ink); box-shadow: 0 0 0 1px var(--accent-ink) inset;
}
.t-pack input[type="checkbox"] {
  position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0;
}
.t-pack:focus-within { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.t-pack-shot {
  display: block; position: relative; aspect-ratio: 4 / 3; border-radius: 12px;
  background: var(--panel-2); overflow: hidden; margin-bottom: 7px;
}
.t-pack-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-pack-noshot {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-dim); font-size: 11.5px;
}
.t-pack-cnt {
  position: absolute; right: 6px; bottom: 6px; background: rgba(22, 24, 29, 0.72);
  color: #fff; border-radius: 20px; padding: 2px 7px; font-size: 11px; font-weight: 600;
}
.t-pack-name {
  display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; color: var(--text);
}
.t-pack-best {
  font-size: 10.5px; font-weight: 700; color: var(--green-ink); background: var(--green-soft);
  border-radius: 20px; padding: 1px 7px; margin-left: 6px; white-space: nowrap;
}
.t-pack-res { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.4; }
.t-pack-res.is-good { color: var(--green-ink); }
.t-pack-res.is-warn { color: var(--yellow-ink); }
.t-pack-own { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.avito-card-meta .is-warn { color: var(--yellow); }

@media (max-width: 640px) {
  .pick-grid { grid-template-columns: 1fr; }
  .pick-head { flex-direction: column; align-items: stretch; }
  .pick-links .input { flex: 1 1 100%; }
  .pick-links { justify-content: flex-start; }
}


.feed-card { margin-bottom: 14px; }
.feed-url { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.feed-url input {
  flex: 1 1 auto; min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  background: var(--panel-2);
}
.feed-lost { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.feed-lost code { font-size: 11px; background: var(--panel); padding: 2px 6px; border-radius: 5px; }

@media (max-width: 640px) {
  .feed-url { flex-direction: column; align-items: stretch; }
  .feed-url .btn { width: 100%; }
}





.adv-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 26px; }
.adv-item {
  display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 18px 20px;
}
.adv-main { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adv-title { font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.adv-title a { color: var(--text); text-decoration: none; }
.adv-title a:hover { text-decoration: underline; }
.adv-why { font-size: 13px; color: var(--text); }
.adv-meta { font-size: 12px; color: var(--text-dim); }
.adv-action { font-weight: 600; color: var(--text); }
.adv-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.adv-status { font-size: 12px; color: var(--text-dim); flex: 0 0 auto; }
.adv-status.is-done { color: var(--green); }



.ai-notes { display: flex; flex-direction: column; gap: 12px; }
.ai-note {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 18px; padding: 18px 20px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.ai-note-title { font-size: 15px; font-weight: 700; }
.ai-note-body {
  font-size: 13.5px; line-height: 1.6; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
  border-top: 1px solid var(--border); padding-top: 12px;
}

@media (max-width: 640px) {
  .adv-item { flex-direction: column; }
  .adv-actions { width: 100%; }
  .adv-actions .btn { flex: 1; }
}




.adv-item.is-good { border-left: 3px solid var(--green); }
.adv-action.is-good { color: var(--green); }
.avito-sum-note .is-good { color: var(--green); }



#t-vars { margin: 0 0 14px; }
#t-vars[hidden] { display: none; }







.bid-hours {
  display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px;
  height: 64px; align-items: end; margin-top: 12px;
}
.bid-hour { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; position: relative; }
.bid-hour-bar { background: var(--accent-soft); border-radius: 3px 3px 0 0; min-height: 2px; }
.bid-hour.is-peak .bid-hour-bar { background: var(--green); }
.bid-hour.is-off .bid-hour-bar { background: var(--border); }
.bid-hour-label {
  font-size: 9px; color: var(--text-dim); text-align: center;
  font-variant-numeric: tabular-nums; margin-top: 3px; height: 12px;
}



.bid-hours.is-editable { height: 128px; gap: 3px; }
.bid-hours.is-editable input {
  width: 100%; height: 24px; padding: 0 2px; font-size: 10px; text-align: center;
  border-radius: 4px; margin-top: 3px;



  appearance: textfield; -moz-appearance: textfield;
}
.bid-hours.is-editable input::-webkit-outer-spin-button,
.bid-hours.is-editable input::-webkit-inner-spin-button { appearance: none; margin: 0; }




.lead-hours .bid-hour-bar { background: var(--accent); }
.lead-hours .bid-hour.is-peak .bid-hour-bar { background: var(--green); }
.lead-hours .bid-hour.is-off .bid-hour-bar { background: var(--border); }

.bid-profile { margin-bottom: 14px; }






@media (max-width: 640px) {
  .bid-profile { flex-direction: column; gap: 10px; }
  .bid-profile .avito-media-actions { padding: 0; }





  .bid-profile .avito-card-body { flex: 0 0 auto; }
}
.bid-mode {
  margin-left: 8px; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; padding: 2px 7px; border-radius: 5px;
  background: var(--panel-2); color: var(--text-dim);
}
.bid-mode.is-live { background: var(--red-soft); color: var(--red); }
.bid-sent { color: var(--green); font-size: 12px; }
.avito-sum .btn { flex: 0 0 auto; }



.dlg-account-contacts {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
}
.dlg-account-contacts .fld-row { display: flex; gap: 8px; margin-bottom: 8px; }
.dlg-account-contacts .fld-row:last-of-type { margin-bottom: 0; }
.dlg-account-contacts input { flex: 1; min-width: 0; }
.dlg-account-contacts .btn { flex: 0 0 auto; }



.pl-bulk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel-2);
}
.pl-bulk-row input[type="number"] { width: 140px; }
.pl-bulk-row select { width: auto; min-width: 140px; }
.pl-bulk-row .checkbox-row { margin: 0; }

.pl-pick {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.pl-pick .pick-grid { max-height: 280px; overflow-y: auto; }

.pl-pick .pick-item.is-used { opacity: 0.5; }





.fld-multi-toggle {
  margin-left: auto;
  font-size: 12px;
  white-space: nowrap;
}




.fld-manual-values {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
}
.fld-manual-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-dim);
  background: var(--bg-soft, var(--panel)); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
}
.fld-manual-chip .link-btn { font-size: 11.5px; }



.avito-details.is-paid {
  border-left: 3px solid var(--orange);
  padding-left: 12px;
  margin-top: 14px;
}
.avito-details.is-paid > summary { color: var(--orange); font-weight: 600; }



.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 11, 13, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 64px 72px;
  cursor: zoom-out;
}
.photo-viewer img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  cursor: default;
}
.photo-viewer-close,
.photo-viewer-nav {
  position: absolute;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  line-height: 1;
  transition: background 0.15s;
}
.photo-viewer-close:hover,
.photo-viewer-nav:hover { background: rgba(255, 255, 255, 0.24); }
.photo-viewer-close { top: 16px; right: 20px; width: 40px; height: 40px; font-size: 26px; }
.photo-viewer-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; font-size: 32px; }
.photo-viewer-nav.is-prev { left: 12px; }
.photo-viewer-nav.is-next { right: 12px; }
.photo-viewer-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.photo-viewer-count { white-space: nowrap; }

@media (max-width: 640px) {
  .photo-viewer { padding: 44px 12px 60px; }
  .photo-viewer-nav { width: 40px; height: 40px; font-size: 26px; }
}


.avito-media-item img, .avito-queue-item img { cursor: zoom-in; }



[data-drag-idx] { cursor: grab; }
[data-drag-idx]:active { cursor: grabbing; }
[data-drag-idx].is-dragging { opacity: 0.4; }


[data-drag-idx].drop-before { box-shadow: inset 4px 0 0 var(--orange); }
[data-drag-idx].drop-after  { box-shadow: inset -4px 0 0 var(--orange); }

[data-drag-idx] img { -webkit-user-drag: none; user-select: none; }



.avito-queue-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--panel-2);
}
.avito-queue-acts { margin-left: auto; }
.avito-queue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.avito-queue-item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel);
}
.avito-queue-item.is-cover { outline: 2px solid var(--orange); outline-offset: -2px; }
.avito-queue-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--panel-2); }
.avito-queue-name {
  padding: 6px 8px 0;
  font-size: 12px;
  color: var(--text-dim);

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.avito-queue-btns { display: flex; gap: 4px; padding: 6px 8px 8px; }
.avito-queue-btns .btn { flex: 1; padding: 4px 0; }



.avito-media-item { position: relative; }
.avito-media-item.is-cover { outline: 2px solid var(--orange); outline-offset: -2px; }
.avito-media-cover {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 1;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--orange);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}



.tpl-draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 12px;


  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  font-size: 13px;
  color: var(--text);
}
.tpl-draft-acts { display: flex; align-items: center; gap: 8px; white-space: nowrap; }





.avito-acc-label {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pick-owner {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
}



.chat-folder-chip.is-warn { color: var(--red); }
.chat-folder-chip.is-warn.active { background: var(--red-soft); color: var(--red); }

@media (max-width: 640px) {





  .bid-hours {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    height: auto; grid-auto-rows: 44px; row-gap: 10px;
  }
  .bid-hours.is-editable { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 62px; }
}


.avito-table tr.is-dim { opacity: 0.5; }


.feed-adopt {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px;
}
.feed-adopt .file-picker { flex: 1 1 220px; min-width: 0; }



.feed-audit td.is-bad, .feed-audit .is-bad { color: var(--red); font-weight: 600; }
.feed-audit tr.feed-row-bad { background: color-mix(in srgb, var(--red) 7%, transparent); }
.feed-audit code { font-size: 11.5px; }
.feed-raw { margin-top: 12px; }
.feed-raw summary { cursor: pointer; font-size: 13px; color: var(--text-dim); }
.feed-raw pre { margin-top: 8px; }
.feed-src { color: var(--text-dim); font-weight: 400; }
.fld-note .avito-issue-list { margin: 8px 0 0; }
.feed-audit .is-warn { color: var(--yellow); }
.avito-card-meta.is-warn { color: var(--yellow); }






.file-picker { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; max-width: 100%; }
.file-picker input[type="file"] {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}


.file-picker .btn { display: inline-block; flex: 0 0 auto; pointer-events: none; }
.file-picker input[type="file"]:focus-visible + .btn { outline: 2px solid var(--accent-ink); outline-offset: 2px; }
.file-picker-name { font-size: 13px; color: var(--text-dim); min-width: 0; overflow-wrap: anywhere; }




.avito-set-group {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
}
.avito-set-group > summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; cursor: pointer; list-style: none;
}
.avito-set-group > summary::-webkit-details-marker { display: none; }

.avito-set-group > summary::before {
  content: '▸'; color: var(--text-dim); font-size: 12px; flex: none;
  transition: transform 0.12s ease;
}
.avito-set-group[open] > summary::before { transform: rotate(90deg); }
.avito-set-group > summary:hover { background: var(--panel-2); }
.avito-set-name { font-size: 15px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.avito-set-count, .avito-set-acc { font-size: 13px; color: var(--text-dim); }
.avito-set-open { margin-left: auto; font-size: 13px; }
.avito-set-group .avito-media-grid { margin: 0; padding: 0 20px 20px; }






.clone-banner {
  margin: 12px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--yellow-soft);
  font-size: 13px;
  line-height: 1.5;
}




.prefilled { border-color: var(--yellow) !important; }
.prefilled-mark {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--yellow-soft);
  color: var(--yellow);
  margin-left: 6px;
}

.order-chain { margin-top: 14px; }
.order-chain-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  cursor: pointer;
  font-size: 12.5px;
}

.order-chain-label { color: var(--text-dim); flex: none; }
.order-chain-num { font-weight: 700; flex: none; }

.order-chain-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .order-chain-row { flex-wrap: wrap; }
  .order-chain-title { flex: 1 1 100%; white-space: normal; overflow-wrap: anywhere; }
}
.feed-report { margin: 10px 0 4px; }
.feed-report .avito-issue-list { margin-top: 6px; }






.order-card-clone {
  margin-left: 8px;
  width: 28px; height: 28px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;

  background: var(--orange-soft);
  color: var(--orange);
  font-size: 14px; line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, transform .12s;
}
.order-card-clone:hover {
  background: var(--orange);
  color: #fff;
  transform: translateY(-1px);
}
.order-card-clone:active { transform: none; }
.order-card-clone:disabled { cursor: default; }



.order-card-clone[data-tooltip]::after {
  left: auto; right: 0; transform: translate(0, 4px);
}
.order-card-clone[data-tooltip]:hover::after,
.order-card-clone[data-tooltip]:focus-visible::after {
  transform: translate(0, 0);
}






.client-detail-topbar { margin-bottom: 16px; }

.client-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;   /* тот же радиус, что у карточки заказа */
  box-shadow: var(--shadow);
}

.client-hero.is-done { background: var(--panel-2); }

.client-hero-avatar {
  width: 56px; height: 56px;
  font-size: 22px;
}




.client-hero-main { flex: 1 1 auto; min-width: 0; }

.client-hero-name {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  overflow-wrap: anywhere;   /* длинные имена вроде «Ульяна, МГУ, ВКР» переносим, а не режем */
}

.client-hero-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 7px;
  font-size: 13px;
  color: var(--text-dim);
}

.client-hero-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--text-dim);
  opacity: .6;
  flex: none;
}

@media (max-width: 600px) {


  .client-hero { gap: 12px; padding: 14px; border-radius: 14px; margin-bottom: 16px; }
  .client-hero-avatar { width: 44px; height: 44px; font-size: 18px; }
  .client-hero-name { font-size: 19px; }
}


















.order-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;



}

.order-status-icon {
  display: inline-block;
  flex: none;

  transform-origin: 50% 50%;
  will-change: transform;
}




@keyframes order-status-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.14); }
}
.order-status.new .order-status-icon {
  animation: order-status-breathe 2.6s ease-in-out infinite;
}




@keyframes order-status-spin {
  to { transform: rotate(360deg); }
}
.order-status.in_progress .order-status-icon {
  animation: order-status-spin 6s linear infinite;
}





@keyframes order-status-sway {
  0%, 60%, 100% { transform: rotate(0deg); }
  20%           { transform: rotate(-11deg); }
  40%           { transform: rotate(9deg); }
}
.order-status.review .order-status-icon {
  animation: order-status-sway 3.4s ease-in-out infinite;
}



@keyframes order-status-write {
  0%, 70%, 100% { transform: translate(0, 0) rotate(0deg); }
  15%           { transform: translate(1.5px, -1px) rotate(-9deg); }
  30%           { transform: translate(-1.5px, 1px) rotate(7deg); }
  45%           { transform: translate(1.5px, -1px) rotate(-6deg); }
}
.order-status.revision .order-status-icon {
  animation: order-status-write 2.8s ease-in-out infinite;
}




@keyframes order-status-pop {
  0%   { transform: scale(0.4) rotate(-18deg); opacity: 0; }
  60%  { transform: scale(1.18) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.order-status.closed .order-status-icon {
  animation: order-status-pop .55s cubic-bezier(.2, .9, .3, 1.4) both;
}



@keyframes order-status-dismiss {
  0%   { transform: translateX(-4px) rotate(-90deg); opacity: 0; }
  70%  { transform: translateX(1px) rotate(6deg); opacity: 1; }
  100% { transform: translateX(0) rotate(0deg); opacity: 1; }
}
.order-status.cancelled .order-status-icon,
.order-status.client_refusal .order-status-icon {
  animation: order-status-dismiss .5s ease-out both;
}



.order-status.badge-lg { gap: 8px; }
.order-status.badge-lg .order-status-icon { font-size: 15px; }

@media (prefers-reduced-motion: reduce) {


  .order-status-icon { animation: none !important; }
}





.order-card-clone-bottom { display: none; }

@media (max-width: 600px) {
  .order-card-clone-top { display: none; }
  .order-card-clone-bottom {
    display: inline-flex;
    margin-left: auto;   /* прижимаем вправо, к краю карточки */
  }


  .order-card-bottom .order-card-tags { flex: 0 1 auto; }


  .order-card-clone[data-tooltip]::after { content: none; }
}




.same-contact-value {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}




.order-info-cell.order-info-note { align-items: flex-start; }
.order-info-note .order-info-icon,
.order-info-note .order-info-label { padding-top: 1px; }
.order-info-note .order-info-value {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.45;
}






















.order-breadcrumbs a:hover,
.kb-breadcrumbs a:hover,
.payout-order-link:hover,
.payout-file-link:hover,
.link-btn:hover,
.modal-hint a:hover,
.login-register-hint a:hover,
.collapsible-toggle:hover,
.notif-mark-all-btn:hover,
.agenda-clear-date:hover,
.avito-seg-btn:hover,
.adv-title a:hover,
.avito-card-title a:hover,
.chat-bubble-reply-btn:hover,
.chat-bubble-pin-btn:hover {
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}


.same-contact-row,
.order-chain-row,
.request-row.clickable,
.chat-pinned-row,
.expert-money-main,
.kb-file-row-pending .kb-file-name,
.client-orders-grid .order-card-person {
  border-radius: 8px;
  transition: background-color .13s ease;
}
.same-contact-row:hover,
.order-chain-row:hover,
.request-row.clickable:hover,
.chat-pinned-row:hover,
.expert-money-main:hover,
.kb-file-row-pending .kb-file-name:hover,
.client-orders-grid .order-card-person:hover {
  background: var(--accent-soft);
}


.same-contact-box .same-contact-row:hover {
  background: rgba(0, 0, 0, 0.05);
}


.same-contact-row, .order-chain-row, .chat-pinned-row {
  padding-left: 6px;
  padding-right: 6px;
  margin-left: -6px;
  margin-right: -6px;
}


.pl-price-empty { border-color: var(--yellow) !important; background: var(--yellow-soft); }



.avito-feed-withheld { margin-bottom: 16px; }
.avito-feed-withheld > div { margin-top: 6px; }




.avito-card-thumb {
  width: 100%; height: 132px; object-fit: cover; display: block;
  border-radius: 12px 12px 0 0; background: var(--panel-2);
}



.bid-cell { width: 84px; text-align: right; }
.bid-cell.is-bad { border-color: var(--red); }





.chat-widget-btn {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 60;   /* выше содержимого, но ниже модальных окон и уведомлений */
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  border: none;
  border-radius: 50%;


  --chat-btn-bg: var(--accent);
  background: var(--chat-btn-bg);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 17, 20, 0.24);

  transition: transform .4s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s ease, background-color .3s ease;



  animation: chat-btn-in .6s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
.chat-widget-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(16, 17, 20, 0.28); }
.chat-widget-btn:active:not(.dragging) { transform: scale(.9); transition-duration: .12s; }
.chat-widget-btn.active { transform: none; }
.chat-widget-btn-icon { position: relative; width: 26px; height: 24px; display: grid; }
.chat-widget-btn-icon svg {
  grid-area: 1 / 1;
  width: 100%; height: 100%;
  overflow: visible;
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;
}
.chat-widget-btn-bubble { transform-origin: 30% 90%; }
.chat-widget-btn-dot { fill: var(--chat-btn-bg); transition: fill .3s ease; }
.chat-widget-btn-icon .chat-widget-btn-close { width: 20px; height: 20px; margin: auto; opacity: 0; transform: rotate(-90deg) scale(.4); }
.chat-widget-btn:hover .chat-widget-btn-bubble { transform: rotate(-8deg) scale(1.08); }



.chat-widget-btn-dot:nth-of-type(2) { animation-delay: .12s; }
.chat-widget-btn-dot:nth-of-type(3) { animation-delay: .24s; }
.chat-widget-btn:hover .chat-widget-btn-dot { animation-name: chat-btn-typing; animation-duration: .9s; animation-timing-function: ease-in-out; }



.chat-widget-btn.active .chat-widget-btn-bubble { opacity: 0; transform: rotate(90deg) scale(.4); }
.chat-widget-btn.active .chat-widget-btn-icon .chat-widget-btn-close { opacity: 1; transform: none; }

@keyframes chat-btn-in {
  0%   { transform: translateY(40px) scale(.3) rotate(-60deg); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes chat-btn-typing {
  0%, 55%, 100% { transform: translateY(0); opacity: .55; }
  25%           { transform: translateY(-5px); opacity: 1; }
}




.chat-widget-btn { touch-action: none; user-select: none; -webkit-user-select: none; }
.chat-widget-btn.dragging {
  cursor: grabbing;
  transform: scale(1.06);
  transition: none;   /* во время перетаскивания плавность мешает: кнопка отстаёт от курсора */
  box-shadow: 0 16px 34px rgba(16, 17, 20, 0.32);
}






.chat-widget-btn.has-unread { --chat-btn-bg: var(--orange); }


.chat-widget-btn.has-unread::before,
.chat-widget-btn.has-unread::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--orange);
  animation: chat-btn-ring 2.2s ease-out infinite;
  pointer-events: none;
}
.chat-widget-btn.has-unread::after { animation-delay: 1.1s; }

.chat-widget-btn.has-unread .chat-widget-btn-dot { animation: chat-btn-typing 1.3s ease-in-out infinite; }
.chat-widget-btn.has-unread .chat-widget-btn-dot:nth-of-type(2) { animation-delay: .15s; }
.chat-widget-btn.has-unread .chat-widget-btn-dot:nth-of-type(3) { animation-delay: .3s; }
@keyframes chat-btn-ring {
  0%   { transform: scale(1); opacity: .55; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}



@keyframes chat-btn-nudge {
  0%, 70%, 100% { transform: rotate(0deg); }
  78%           { transform: rotate(-12deg); }
  86%           { transform: rotate(10deg); }
  93%           { transform: rotate(-5deg); }
}
.chat-widget-btn.has-unread .chat-widget-btn-icon {
  animation: chat-btn-nudge 3.2s ease-in-out infinite;
}


.chat-widget-btn.active::before,
.chat-widget-btn.active::after,
.chat-widget-btn.active .chat-widget-btn-icon,
.chat-widget-btn.active .chat-widget-btn-dot { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .chat-widget-btn,
  .chat-widget-btn.has-unread::before,
  .chat-widget-btn.has-unread::after,
  .chat-widget-btn.has-unread .chat-widget-btn-icon,
  .chat-widget-btn .chat-widget-btn-dot,
  .chat-widget-badge,
  .chat-widget,
  .chat-widget-head,
  .chat-widget-tabs,
  .chat-widget.intro .chat-items > *,
  .chat-widget.thread-open .chat-widget-thread,
  .chat-widget.from-thread .chat-widget-list { animation: none !important; }
  .chat-widget-btn-icon svg,
  .chat-widget-tab-pill { transition: none; }
}


.chat-widget-badge {
  position: absolute;
  top: -2px; right: -2px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  display: flex; align-items: center; justify-content: center;



  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px; font-weight: 800;
  border: 2px solid var(--bg);


  animation: chat-badge-pop .5s cubic-bezier(.34, 1.56, .64, 1) backwards;
}
@keyframes chat-badge-pop {
  0%   { transform: scale(0); }
  100% { transform: scale(1); }
}

.chat-widget {
  position: fixed;
  right: 24px; bottom: 92px;   /* над самой кнопкой */
  z-index: 60;
  width: 380px;
  height: min(560px, calc(100vh - 140px));
  height: min(560px, calc(100dvh - 140px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(16, 17, 20, 0.22);
  overflow: hidden;


  animation: chat-widget-in .42s cubic-bezier(.2, 1.1, .3, 1) backwards;
}
@keyframes chat-widget-in {
  0%   { opacity: 0; transform: scale(.4); border-radius: 40px; }
  45%  { opacity: 1; }
  100% { opacity: 1; transform: none; }
}




.chat-widget.chat-widget-ghost {
  pointer-events: none;
  animation: chat-widget-out .22s cubic-bezier(.4, 0, .9, .4) forwards;
}
@keyframes chat-widget-out {
  0%   { opacity: 1; transform: none; }
  100% { opacity: 0; transform: scale(.4); border-radius: 40px; }
}




.chat-widget-head,
.chat-widget-tabs { animation: chat-widget-part-in .4s .08s cubic-bezier(.2, .9, .3, 1) backwards; }
.chat-widget-tabs { animation-delay: .14s; }
.chat-widget.intro .chat-items > * { animation: chat-widget-part-in .38s cubic-bezier(.2, .9, .3, 1) backwards; }
.chat-widget.intro .chat-items > :nth-child(2) { animation-delay: .04s; }
.chat-widget.intro .chat-items > :nth-child(3) { animation-delay: .08s; }
.chat-widget.intro .chat-items > :nth-child(4) { animation-delay: .12s; }
.chat-widget.intro .chat-items > :nth-child(5) { animation-delay: .16s; }
.chat-widget.intro .chat-items > :nth-child(6) { animation-delay: .2s; }
.chat-widget.intro .chat-items > :nth-child(7) { animation-delay: .24s; }
.chat-widget.intro .chat-items > :nth-child(n+8) { animation-delay: .28s; }
@keyframes chat-widget-part-in {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: none; }
}



@keyframes chat-widget-thread-in {
  0%   { opacity: 0; transform: translateX(28px); }
  100% { opacity: 1; transform: none; }
}
@keyframes chat-widget-list-back {
  0%   { opacity: 0; transform: translateX(-28px); }
  100% { opacity: 1; transform: none; }
}
.chat-widget.from-thread .chat-widget-list { animation: chat-widget-list-back .3s cubic-bezier(.2, .9, .3, 1); }
#chat-widget-back { animation: chat-badge-pop .35s cubic-bezier(.34, 1.56, .64, 1) backwards; }

.chat-widget-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.chat-widget-title {
  font-weight: 700;
  font-size: 14px;
  flex: 1;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-widget-head-btn {
  width: 28px; height: 28px;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.chat-widget-head-btn:hover { background: var(--border); color: var(--text); }

.chat-widget-body { flex: 1; min-height: 0; display: flex; }





.chat-widget-list {
  width: auto;
  border-right: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.chat-widget-thread { display: none; flex: 1; min-height: 0; }
.chat-widget.thread-open .chat-widget-list { display: none; }
.chat-widget.thread-open .chat-widget-thread { display: flex; animation: chat-widget-thread-in .32s cubic-bezier(.2, .9, .3, 1); }



.chat-widget-list .chat-item { padding: 10px 12px; }
.chat-widget-list .chat-item-menu-btn { display: none; }

@media (max-width: 640px) {


  .chat-widget-btn { right: 16px; bottom: 18px; width: 52px; height: 52px; }
  .chat-widget {
    right: 0; left: 0; bottom: 0; top: 0;
    width: auto;
    height: auto;
    border-radius: 0;
    border: none;

    animation-name: chat-widget-sheet-in;
  }
  .chat-widget.chat-widget-ghost { animation-name: chat-widget-sheet-out; }
}
@keyframes chat-widget-sheet-in {
  0%   { transform: translateY(100%); }
  100% { transform: none; }
}
@keyframes chat-widget-sheet-out {
  0%   { transform: none; }
  100% { transform: translateY(100%); }
}






.chat-widget #chat-back-btn { display: none !important; }






.chat-widget-tabs {
  position: relative;
  display: flex;
  gap: 4px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.chat-widget-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .13s, color .13s;
}
.chat-widget-tab:hover { background: var(--panel-2); color: var(--text); }



.chat-widget-tab { position: relative; z-index: 1; }
.chat-widget-tab.active,
.chat-widget-tab.active:hover { background: transparent; color: #fff; }
.chat-widget-tab-pill {
  position: absolute;
  left: 10px; top: 8px; bottom: 8px;
  width: calc((100% - 20px - 4px) / 2);   /* две вкладки поровну, минус поля и зазор */
  border-radius: 9px;
  background: var(--accent);
  transition: transform .45s cubic-bezier(.34, 1.3, .64, 1);
}
.chat-widget-tabs[data-active="orders"] .chat-widget-tab-pill { transform: translateX(calc(100% + 4px)); }

.chat-widget-tab-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
}

.chat-widget-tab.active .chat-widget-tab-count { background: rgba(255, 255, 255, 0.22); }


.chat-item-sub {
  font-size: 11.5px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}





.post-photos-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.post-photos-grid .post-photo-empty { flex: 1 1 100%; }

.post-photo-tile {
  position: relative;
  width: 104px;
  height: 104px;
  flex: none;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel-2);
  cursor: grab;
}



.post-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.post-photo-tile-broken {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--text-dim); text-align: center; padding: 6px;
}



.post-photo-tile.dragging { opacity: .45; cursor: grabbing; }
.post-photo-tile.drop-target { border-color: var(--accent-ink); box-shadow: 0 0 0 2px var(--accent-soft); }



.post-photo-num {
  position: absolute;
  left: 6px; top: 6px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.post-photo-tile-actions {
  position: absolute;
  right: 5px; bottom: 5px;
  display: flex;
  gap: 3px;
}
.post-photo-tile-actions button {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.post-photo-tile-actions button:hover { background: rgba(0, 0, 0, 0.82); }
.post-photo-tile-actions button:disabled { opacity: .35; cursor: default; }
.post-photo-tile-actions [data-remove-photo]:hover { background: var(--red); }

@media (max-width: 600px) {


  .post-photo-tile { width: calc(50% - 5px); height: 130px; }
  .post-photo-tile-actions button { width: 30px; height: 30px; font-size: 15px; }
}









.chat-bubble .chat-bubble-time {
  margin-top: 3px;
  font-size: 10.5px;
  opacity: .6;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;

  line-height: 1;
}
.chat-bubble-row.mine .chat-bubble .chat-bubble-time { opacity: .8; }




.chat-bubble-col { position: relative; }
.chat-bubble-actions {
  position: absolute;
  top: 2px;
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease;
}
.chat-bubble-row:not(.mine) .chat-bubble-actions { left: 100%; margin-left: 6px; }
.chat-bubble-row.mine .chat-bubble-actions { right: 100%; margin-right: 6px; }
.chat-bubble-row:hover .chat-bubble-actions,
.chat-bubble-actions:focus-within { opacity: 1; pointer-events: auto; }

.chat-bubble-actions button {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.chat-bubble-actions button:hover { color: var(--text); border-color: var(--text-dim); }
.chat-bubble-actions .chat-bubble-pin-btn.pinned { color: var(--yellow); }

@media (hover: none) {
  .chat-bubble-actions { opacity: 1; pointer-events: auto; }
}


.chat-day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 10px;
}
.chat-day-divider span {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 600;
}




.chat-bubble-attachment.chat-bubble-image { padding: 0; background: none; display: block; }
.chat-bubble-attachment.chat-bubble-image img {


  width: calc(100% + 26px);







  height: auto;
  max-height: 380px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
  cursor: pointer;
  margin: 6px -13px 0;
}


.chat-bubble.image-only {
  padding: 0;
  background: none !important;
  overflow: visible;
}
.chat-bubble.image-only .chat-bubble-attachment.chat-bubble-image img {
  margin: 0;
  width: 320px;
  max-width: 100%;
  height: auto;                 /* та же пара к атрибутам width/height, см. правило выше */
}
.chat-bubble.image-only .chat-bubble-time {
  position: absolute;
  right: 8px; bottom: 8px;
  margin: 0;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  opacity: 1;
}
.chat-bubble.image-only { position: relative; }

@media (max-width: 600px) {
  .chat-bubble-attachment.chat-bubble-image img,
  .chat-bubble.image-only .chat-bubble-attachment.chat-bubble-image img { width: 100%; }
}




.chat-bubble.images-album { width: min(340px, 100%); }
.chat-bubble-album { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 6px; }
.chat-bubble.image-only .chat-bubble-album { margin-top: 0; }
.chat-bubble-album > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.chat-bubble-album .chat-bubble-attachment.chat-bubble-image { margin: 0; min-width: 0; }
.chat-bubble-album .chat-bubble-attachment.chat-bubble-image img,
.chat-bubble.image-only .chat-bubble-album .chat-bubble-attachment.chat-bubble-image img {
  width: 100%; height: 150px; max-height: none; margin: 0; object-fit: cover; border-radius: 10px;
}
@media (max-width: 600px) {
  .chat-bubble-album .chat-bubble-attachment.chat-bubble-image img,
  .chat-bubble.image-only .chat-bubble-album .chat-bubble-attachment.chat-bubble-image img { height: 120px; }
}






.chat-bubble.voice-only,
.chat-bubble.video-circle-only {
  border-radius: 18px !important;
  padding: 6px 10px 5px;
}
.chat-bubble.voice-only .chat-bubble-time,
.chat-bubble.video-circle-only .chat-bubble-time { margin-top: 2px; }





.chat-bubble .chat-bubble-time { white-space: nowrap; }





.bid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.bid-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 16px 18px; display: flex; flex-direction: column;
  transition: border-color 0.12s ease;
}
.bid-card:hover { border-color: var(--border-strong, var(--border)); }
.bid-card.is-dim { opacity: 0.55; }

.bid-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bid-card-city { font-size: 15px; font-weight: 700; }
.bid-card-range { font-size: 11px; color: var(--text-dim); white-space: nowrap; }




.bid-card-title {
  font-size: 12px; color: var(--text-dim); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bid-card-now { display: flex; align-items: baseline; gap: 6px; margin: 8px 0 14px; }
.bid-card-now b { font-size: 26px; font-weight: 800; line-height: 1; }
.bid-card-now span { font-size: 13px; color: var(--text-dim); }






.bid-card-fields {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 6px; row-gap: 5px; margin-top: auto;
}
.bid-card-label { font-size: 11px; color: var(--text-dim); line-height: 1; }
.bid-card-fields input {
  width: 100%; min-width: 0; text-align: right;


  appearance: textfield; -moz-appearance: textfield;
}
.bid-card-fields input::-webkit-outer-spin-button,
.bid-card-fields input::-webkit-inner-spin-button { appearance: none; margin: 0; }

.bid-card-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
}

.bid-card-foot .checkbox-row { margin: 0; margin-right: auto; white-space: nowrap; }
.bid-card-open { font-size: 13px; color: var(--text-dim); text-decoration: none; }
.bid-card-open:hover { color: var(--text); }




.bid-card { position: relative; }




.bid-day {
  position: absolute; z-index: 60;
  width: 268px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); font-size: 12.5px;
}
.bid-day-head { font-size: 11px; color: var(--text-dim); margin-bottom: 6px; }





.bid-day-row {
  display: grid; grid-template-columns: 86px 84px 1fr;
  align-items: baseline; gap: 10px; padding: 3px 0; white-space: nowrap;
}
.bid-day-time { color: var(--text-dim); font-variant-numeric: tabular-nums; }
.bid-day-row b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.bid-day-why { color: var(--text-dim); }








.order-card .order-status-icon,
.client-orders-grid .order-status-icon,
.request-row .order-status-icon,
.attach-client-row .order-status-icon,
.order-chain-row .order-status-icon {
  animation: none !important;
}



.orders-more-btn {
  display: block;
  width: 100%;
  margin-top: 14px;
}





.tr-drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--panel-2);
  transition: border-color .15s ease, background .15s ease;
}
.tr-drop:hover { border-color: var(--accent-ink); }


.tr-drop.over { border-color: var(--accent-ink); background: var(--accent-soft); }


.tr-drop.busy { opacity: .55; pointer-events: none; }
.tr-drop-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.tr-drop-title { font-weight: 700; font-size: 15px; }
.tr-drop-note { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }

.tr-result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.tr-result-actions { display: flex; gap: 8px; flex-shrink: 0; }




.tr-summary {
  border-left: 3px solid var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin-bottom: 14px;
  max-width: 68ch;
}
.tr-summary-title { font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px; }
.tr-summary-list { margin: 0; padding-left: 18px; }
.tr-summary-list li { font-size: 14px; line-height: 1.5; margin-bottom: 5px; }
.tr-summary-list li:last-child { margin-bottom: 0; }



.tr-result-text p { margin: 0 0 12px; }
.tr-result-text p:last-child { margin-bottom: 0; }
.tr-result-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }



.tr-result-text {
  line-height: 1.65;
  font-size: 14px;
  max-width: 68ch;
  max-height: 60vh;
  overflow-y: auto;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  user-select: text;
}






.avito-sets-layout {
  display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 16px; align-items: start;
}
.avito-sets-list {
  display: flex; flex-direction: column; gap: 2px;
  border-right: 0.5px solid var(--line); padding-right: 12px;
}
.avito-sets-list .input { margin-bottom: 8px; }

.avito-set-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 7px 8px; border: 0; border-radius: 10px;
  background: transparent; cursor: pointer; text-align: left; font: inherit;
}
.avito-set-row:hover { background: var(--bg); }
.avito-set-row.is-active { background: var(--accent-soft); }
.avito-set-row[disabled] { cursor: default; opacity: .75; }
.avito-set-row img,
.avito-set-cover-empty {
  width: 34px; height: 34px; border-radius: 7px; flex: 0 0 auto;
  object-fit: cover; background: var(--bg);
}
.avito-set-row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.avito-set-row-name {
  font-size: 13px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.avito-set-row-sub {
  font-size: 12px; color: var(--text-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}




.avito-sets-pane { animation: avito-pane-in 160ms ease-out; }
@keyframes avito-pane-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .avito-sets-pane { animation: none; }
}

.avito-set-row { transition: background 120ms ease-out; }

.avito-pane-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.avito-pane-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.avito-pane-tools select { height: 30px; padding: 0 8px; font-size: 12px; }
.avito-pane-title { font-size: 15px; font-weight: 700; }
.avito-pane-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }


@media (max-width: 720px) {
  .avito-sets-layout { grid-template-columns: minmax(0, 1fr); }
  .avito-sets-list { border-right: 0; padding-right: 0; border-bottom: 0.5px solid var(--line); padding-bottom: 12px; }
}











@media (max-width: 860px) {
  .cal-cell { min-height: 0; padding: 6px 4px 7px; border-radius: 12px; text-align: center; }
  .cal-cell .daynum { margin-bottom: 4px; font-weight: 500; font-size: 13px; }

  .cal-cell-items { display: flex; justify-content: center; align-items: center; gap: 3px; min-height: 6px; }


  .cal-cell-items > :nth-child(n+4) { display: none; }

  .cal-order-item,
  .cal-subtask-item,
  .cal-task-item {
    width: 6px; height: 6px; padding: 0; margin: 0; border: 0; border-radius: 50%;
    background: var(--dot); box-shadow: none;



    font-size: 0; line-height: 0; overflow: hidden; text-indent: -999px;


    pointer-events: none;
  }
  .cal-order-item.cancelled, .cal-order-item.client_refusal { text-decoration: none; }
  .cal-subtask-item.done, .cal-task-item.done { opacity: 0.45; text-decoration: none; }

  .cal-more { font-size: 9px; color: var(--text-dim); line-height: 1; }







  .cal-cell.today { box-shadow: none; }
  .cal-cell.selected {
    background: var(--accent); border-color: var(--accent); box-shadow: none;
  }
  .cal-cell.selected .daynum { color: var(--panel); }


  .cal-cell.selected .cal-order-item,
  .cal-cell.selected .cal-subtask-item,
  .cal-cell.selected .cal-task-item { background: var(--panel); }
  .cal-cell.selected .cal-more { color: var(--panel-2); }



  .cal-add-task-btn { display: none; }



  .cal-legend { font-size: 11px; gap: 4px 10px; }
}


.cal-more { display: none; }
@media (max-width: 860px) { .cal-more { display: inline-block; } }







.risk-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  vertical-align: middle; margin-left: 8px;
}
.risk-chip .risk-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.risk-chip.low { background: var(--green-soft); color: var(--green-ink); }
.risk-chip.low .risk-dot { background: var(--green); }
.risk-chip.medium { background: var(--yellow-soft); color: var(--yellow-ink); }
.risk-chip.medium .risk-dot { background: var(--yellow); }
.risk-chip.high { background: var(--red-soft); color: var(--red-ink); }
.risk-chip.high .risk-dot { background: var(--red); }

.stat-card.wl-alert { border-color: var(--red); background: var(--red-soft); }
.stat-card.wl-alert .num { color: var(--red-ink); }




.wl-load { margin-top: 18px; }
.wl-load-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.wl-load-head .token-hint { margin: 0; }
.wl-load-bar { height: 10px; border-radius: 999px; background: var(--gray-soft); overflow: hidden; }
.wl-load-fill { height: 100%; border-radius: 999px; transition: width .25s ease; }
.wl-load-fill.low { background: var(--green); }
.wl-load-fill.medium { background: var(--yellow); }
.wl-load-fill.high { background: var(--red); }

.wl-norm-edit { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.wl-norm-edit label { margin: 0; white-space: nowrap; }
.wl-norm-edit input { width: 90px; margin: 0; }

.wl-reasons { margin-top: 16px; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); }
.wl-reasons.medium { background: var(--yellow-soft); border-color: var(--yellow); }
.wl-reasons.high { background: var(--red-soft); border-color: var(--red); }
.wl-reasons ul { margin: 8px 0 0; padding-left: 20px; }
.wl-reasons li { margin: 3px 0; font-size: 13.5px; }

.wl-subhead { margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.wl-subhead:first-child { margin-top: 0; }

.wl-order-row {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 12px; border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 8px; cursor: pointer; background: var(--panel);
  transition: border-color .15s ease, background .15s ease;
}
.wl-order-row:hover { border-color: var(--accent-ink); background: var(--panel-2); }
.wl-order-main { flex: 1; min-width: 0; }
.wl-order-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-order-main .token-hint { margin: 3px 0 0; }
.wl-order-due { text-align: right; font-size: 13px; white-space: nowrap; flex-shrink: 0; }
.wl-order-due .token-hint { margin: 0; }




.cal-cell.wl-crowded { background: var(--yellow-soft); }
.wl-crowded-mark { position: absolute; top: 4px; right: 5px; font-size: 11px; }

.wl-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 860px) { .wl-columns { grid-template-columns: 1fr; gap: 18px; } }



.subject-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.subject-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel);
  font-size: 13px; color: var(--text); font-family: inherit;
  cursor: default; line-height: 1.3;
}
button.subject-chip { cursor: pointer; transition: border-color .12s ease, background .12s ease; }
button.subject-chip:hover { border-color: var(--accent-ink); }
.subject-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.subject-chip.hint { background: var(--orange-soft); border-color: var(--orange); color: var(--orange-ink); }
.subject-chip.fact { background: var(--panel-2); }
.subject-chip.fact b { color: var(--text-dim); font-size: 12px; }
.subject-chip.mini { padding: 2px 8px; font-size: 11.5px; }

.subject-picker .sp-selected-wrap { margin-bottom: 12px; }
.subject-picker .sp-selected-wrap .token-hint { margin: 0 0 7px; }
.subject-picker .sp-search { margin: 12px 0 10px; }


.subject-picker .sp-list {
  max-height: 260px; overflow-y: auto;
  padding: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); align-content: flex-start;
}
.sp-similar-box { padding: 12px; border-radius: 10px; background: var(--orange-soft); border: 1px solid var(--orange); }
.sp-similar-box .token-hint { color: var(--orange-ink); }



.subjects-setup-card { max-width: 620px; width: 100%; }
.subjects-setup-card .subject-picker .sp-list { max-height: 200px; }



.expert-pick-match {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: var(--green-soft); color: var(--green-ink); font-size: 11.5px; font-weight: 600;
}
.expert-pick-subjects { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.expert-pick-subjects .token-hint { margin: 0; font-size: 11.5px; }

.assign-warning { padding: 14px; border-radius: 10px; background: var(--red-soft); border: 1px solid var(--red); }
.assign-warning-head { margin-bottom: 10px; }
.assign-warning-head .risk-chip { margin-left: 0; font-size: 13px; padding: 5px 12px; }
.assign-warning p { margin: 8px 0; font-size: 14px; }
.assign-warning ul { margin: 6px 0; padding-left: 20px; }
.assign-warning li { margin: 3px 0; font-size: 13.5px; }
.assign-warning .token-hint { margin-bottom: 0; }

@media (max-width: 860px) {
  .wl-order-row { gap: 10px; padding: 10px; }
  .wl-order-title { font-size: 13.5px; }
  .wl-order-due { font-size: 12px; }
  .subject-picker .sp-list { max-height: 220px; }
}















.chat-read-eye-wrap { display: inline-flex; align-items: center; min-height: 14px; }
.chat-read-eye {
  display: inline-flex; align-items: center; gap: 3px;
  height: 14px; padding: 0 6px; border-radius: 999px;
  border: none; cursor: pointer; font-family: inherit;




  background: rgba(255, 255, 255, 0.3);
  color: #fff; line-height: 1;
  transition: background .12s ease;
}
.chat-read-eye:hover { background: rgba(255, 255, 255, 0.45); }
.chat-read-eye:active { background: rgba(255, 255, 255, 0.6); }
.chat-read-eye-icon { font-size: 9px; line-height: 1; }
.chat-read-eye-count { font-size: 10px; font-weight: 700; line-height: 1; }

.read-by-subhead { margin: 18px 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }

.read-by-list { display: flex; flex-direction: column; gap: 2px; }
.read-by-list.dim { opacity: .6; }
.read-by-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.read-by-row .avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.read-by-name { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.read-by-row .token-hint { margin: 0; white-space: nowrap; font-size: 12px; }

@media (max-width: 860px) {


  .chat-read-eye { padding: 0 9px; gap: 4px; }
  .chat-read-eye-icon { font-size: 10px; }
  .chat-read-eye-count { font-size: 11px; }
}



.chat-widget-group-head {
  padding: 14px 14px 6px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim);
}


.chat-item.chat-item-quiet .chat-item-preview { font-style: italic; opacity: .75; }
.chat-item.chat-item-quiet .chat-item-time { opacity: .75; }










.chat-video-record {
  position: fixed; inset: 0; z-index: 4000;

  flex-direction: column; align-items: center; justify-content: center;
  gap: 30px;
  padding: 24px 20px calc(30px + env(safe-area-inset-bottom, 0px));
  background: rgba(16, 17, 20, 0.42);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  animation: cvrIn .18s ease-out;
}
@keyframes cvrIn { from { opacity: 0; } to { opacity: 1; } }

body.video-record-open { overflow: hidden; }

.cvr-stage { display: flex; flex-direction: column; align-items: center; gap: 18px; }




.chat-video-record .video-record-preview-wrap {
  width: clamp(200px, 64vw, 320px);
  height: clamp(200px, 64vw, 320px);
  box-shadow: 0 22px 64px rgba(0, 0, 0, .45);
}

.cvr-timer {
  display: flex; align-items: center; gap: 9px;
  color: #fff; font-size: 18px; font-weight: 700;

  font-variant-numeric: tabular-nums;
}
.cvr-hint {
  color: rgba(255, 255, 255, .7); font-size: 13px;
  text-align: center; max-width: 260px; line-height: 1.35;
}

.cvr-controls { display: flex; align-items: center; gap: 22px; }
.cvr-cancel {
  border: none; background: rgba(255, 255, 255, .16); color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 600;
  padding: 0 22px; height: 46px; border-radius: 23px; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .12s ease;
}
.cvr-cancel:hover { background: rgba(255, 255, 255, .26); }
.cvr-cancel:active { background: rgba(255, 255, 255, .34); }


.cvr-send {
  width: 62px; height: 62px; border-radius: 50%;
  border: none; background: #fff; color: var(--accent-ink);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  transition: transform .1s ease;
}
.cvr-send:active { transform: scale(.94); }
.cvr-send svg { display: block; margin-left: 2px; }

@media (max-width: 380px) {
  .chat-video-record { gap: 22px; }
  .cvr-controls { gap: 16px; }
  .cvr-send { width: 56px; height: 56px; }
  .cvr-cancel { height: 42px; padding: 0 18px; font-size: 14px; }
}




.notif-item.clickable { cursor: pointer; }
.notif-item.clickable:active { opacity: .6; }
















.cal-task-order { position: relative; }
.cal-task-order-box {
  display: flex; align-items: center; gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.cal-task-order-box.focused { border-color: var(--text); }
.cal-task-order-box.has-pick { padding-left: 10px; }
.cal-task-order-icon { flex: none; font-size: 12px; opacity: 0.5; line-height: 1; }


.cal-task-order-box input {
  flex: 1; min-width: 0; width: auto;
  border: none; background: none; box-shadow: none;
  padding: 0; height: 38px; border-radius: 0;
  font-size: 13px; font-family: inherit; color: var(--text);
}
.cal-task-order-box input:focus { outline: none; border: none; }
.cal-task-order-chev {
  flex: none; color: var(--text-dim); font-size: 13px; line-height: 1;
  display: flex; align-items: center;
}
.cal-task-order-picked {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px;
}
.cal-task-order-picked:empty { display: none; }
.cal-task-order-x {
  border: none; background: none; cursor: pointer; padding: 0 2px;
  color: var(--text-dim); font-size: 12px; line-height: 1; font-family: inherit;
}
.cal-task-order-x:hover { color: var(--text); }
.cal-task-order-num { font-weight: 800; flex: none; }
.cal-task-order-title { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cal-task-order-drop {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 5;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(16,17,20,0.14);
  overflow: hidden;
  max-height: 232px; overflow-y: auto;
}
.cal-task-order-row {
  display: flex; align-items: center; gap: 8px;
  width: 100%; text-align: left;
  padding: 8px 12px;
  border: none; border-bottom: 1px solid var(--border);
  background: var(--panel); color: var(--text);
  font-family: inherit; font-size: 12.5px; cursor: pointer;
}
.cal-task-order-row:last-child { border-bottom: none; }
.cal-task-order-row:hover { background: var(--panel-2); }
.cal-task-order-row .cal-task-order-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-task-order-who { margin-left: auto; color: var(--text-dim); font-size: 11.5px; flex: none; }




.picker-create {
  display: block; width: 100%; text-align: left;
  margin-top: 8px; padding: 0;
  border: none; background: none;
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--dlg-accent); cursor: pointer;
}
.picker-create:hover { text-decoration: underline; }
.picker-create:disabled { color: var(--text-dim); cursor: default; text-decoration: none; }




.cal-task-order-drop > .picker-create {
  margin-top: 0; padding: 11px 12px;
  border-top: 1px solid var(--border);
}
.cal-task-order-drop > .picker-create:hover { background: var(--panel-2); text-decoration: none; }
.cal-task-order-hint { padding: 9px 12px; font-size: 11.5px; color: var(--text-dim); background: var(--panel-2); }


.cal-task-order-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gray);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  display: flex; flex-direction: column; gap: 7px;
  box-shadow: 0 1px 2px rgba(16,17,20,0.05);
}

.cal-task-order-card.new { border-left-color: var(--gray); }
.cal-task-order-card.in_progress { border-left-color: var(--accent-ink); }
.cal-task-order-card.review { border-left-color: var(--yellow); }
.cal-task-order-card.revision { border-left-color: var(--red); }
.cal-task-order-card.closed { border-left-color: var(--green); }
.cal-task-order-card.cancelled, .cal-task-order-card.client_refusal { border-left-color: var(--red); opacity: 0.75; }
.cal-task-order-card-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.cal-task-order-status { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--text-dim); flex: none; }
.cal-task-order-rows { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.cal-task-order-row-pair { display: flex; }
.cal-task-order-rows > div { display: flex; gap: 8px; font-size: 11.5px; }
.cal-task-order-rows dt { flex: none; width: 74px; color: var(--text-dim); margin: 0; }
.cal-task-order-rows dd { margin: 0; }
.cal-task-order-foot { padding-top: 7px; border-top: 1px solid var(--border); }
.cal-task-order-open {
  border: none; background: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cal-task-order-open:hover { border-bottom-color: var(--text); }


.cal-day-tasks:empty { display: none; }
.cal-day-tasks { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.cal-day-tasks-head { margin: 0; font-size: 13px; font-weight: 800; }
.cal-day-task {
  border-radius: 12px;
  border-left: 3px solid var(--orange);
  background: var(--prio-med-bg);
  color: var(--prio-med-ink);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 9px;
}
.cal-day-task.cal-priority-low { background: var(--prio-low-bg); border-left-color: #ffb08a; color: var(--prio-low-ink); }
.cal-day-task.cal-priority-high { background: var(--prio-high-bg); border-left-color: #c2410c; color: var(--prio-high-ink); }
.cal-day-task.done { opacity: 0.6; }
.cal-day-task-main {
  border: none; background: none; padding: 0; cursor: pointer; text-align: left;
  font-family: inherit; color: inherit;
  display: flex; flex-direction: column; gap: 7px; width: 100%;
}
.cal-day-task-text { font-size: 13px; font-weight: 600; }
.cal-day-task.done .cal-day-task-text { text-decoration: line-through; }
.cal-day-task-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.cal-day-task-pill {
  background: var(--on-tint-wash);
  border-radius: 999px; padding: 2px 8px;
  font-size: 11px; font-weight: 600;
}


.cal-task-order-mark { font-weight: 800; }


.order-tasks-box {
  margin-top: 14px;
  background: var(--orange-soft);
  border: 1px solid #ffd9c6;
  border-radius: 12px;
  padding: 12px 14px;
}
.order-tasks-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700; color: var(--prio-med-ink);
}
.order-tasks-count {


  background: color-mix(in srgb, currentColor 12%, transparent); border-radius: 999px;
  padding: 1px 7px; font-size: 11px;
}
.order-tasks-list { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; }

.order-tasks-all {
  margin-left: auto; flex: none;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: 11.5px; font-weight: 700; color: var(--prio-med-ink);
  text-decoration: underline; text-underline-offset: 2px;
}
.order-tasks-all:hover { opacity: 0.75; }
.order-tasks-row { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--text); }


.order-tasks-row.done { opacity: 0.6; text-decoration: line-through; }
.order-tasks-row.done .order-tasks-check { text-decoration: none; opacity: 1; }
.order-tasks-check {
  flex: none; margin: 0; cursor: pointer;
  width: 15px; height: 15px; align-self: center;
  accent-color: var(--accent-ink);
}
.order-tasks-check:disabled { cursor: progress; }
.order-tasks-date { flex: none; font-weight: 700; font-size: 11.5px; color: var(--prio-med-ink); }


.order-tasks-text {
  overflow-wrap: anywhere; text-align: left;
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
}
.order-tasks-text:hover { text-decoration: underline; text-underline-offset: 2px; }
.order-tasks-cat { margin-left: auto; flex: none; font-size: 11px; color: var(--text-dim); }

@media (max-width: 640px) {
  .cal-task-order-rows dt { width: 62px; }
  .order-tasks-cat { margin-left: 0; }
  .order-tasks-row { flex-wrap: wrap; }
}










.cal-show-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cal-show-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 12px; height: 40px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--text-dim);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.cal-show-chip:hover { background: var(--panel-2); }
.cal-show-chip.active { color: var(--text); border-color: var(--text); }
.cal-show-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--gray);
}
.cal-show-dot.orders { background: var(--accent); }
.cal-show-dot.subtasks { background: var(--text-dim); }
.cal-show-dot.tasks { background: var(--orange); }
.cal-show-dot.colleagues { background: #2f6feb; }


.cal-show-chip:not(.active) .cal-show-dot { background: var(--border); }




.agenda-show { margin: 12px 0 10px; gap: 4px; }
.agenda-show .cal-show-chip { height: 26px; padding: 0 8px; gap: 5px; font-size: 11px; }

@media (max-width: 860px) {

  .cal-show-chips { width: 100%; }
  .cal-show-chip { flex: 1 1 0; justify-content: center; padding: 0 8px; }
}










.cal-title-eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 2px;
}
.topbar h2.cal-title-month {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

@media (max-width: 860px) {



  .topbar h2.cal-title-month { font-size: 23px; }
  .cal-title-eyebrow { font-size: 11px; }
  .cal-month-nav { width: 100%; }
  .cal-month-nav .btn { flex: 1 1 0; }
}





.daynum-month { font-size: 0.82em; font-weight: 600; opacity: 0.55; }

@media (max-width: 860px) {



  .daynum-month { display: none; }
}





.ms-week-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}











.chart-months {
  position: relative;
  height: calc(var(--chart-h) + var(--chart-labels));


  margin-top: 26px;
  padding-left: var(--chart-left);
}



.chart-gridline {
  position: absolute; left: var(--chart-left); right: 0;
  border-top: 1px solid var(--border);
  pointer-events: none;
}
.chart-gridvalue {
  position: absolute; right: 100%; top: -0.65em;
  padding-right: 8px;
  font-size: 10.5px; color: var(--text-dim); white-space: nowrap;
}

.chart-plot { position: relative; height: 100%; }
.chart-svg {
  position: absolute; left: 0; right: 0; top: 0;
  width: 100%; height: var(--chart-h);
  overflow: visible;
}
.chart-area { fill: var(--accent-ink); opacity: 0.08; }
.chart-line { fill: none; stroke: var(--accent-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }



.chart-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, 50%);
  background: var(--accent); box-shadow: 0 0 0 2px var(--panel);
  pointer-events: none;
}
.chart-dot.current { background: var(--orange); }


.chart-value {
  position: absolute; transform: translate(-50%, 50%);
  font-size: 11px; font-weight: 700; color: var(--text);
  white-space: nowrap; pointer-events: none;




  background: var(--panel); padding: 1px 4px; border-radius: 5px;
}


.chart-value.at-end { transform: translate(-100%, 50%); margin-left: -6px; }
.chart-value.at-start { transform: translate(0, 50%); margin-left: 6px; }


.chart-col {
  position: absolute; bottom: 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
  cursor: default;
}
.chart-col:focus { outline: none; }
.chart-col:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -2px; border-radius: 6px; }





.chart-col.hover .chart-month { color: var(--text); }
.chart-month {
  height: var(--chart-labels);
  display: flex; align-items: center;
  font-size: 10.5px; color: var(--text-dim); white-space: nowrap;
}
.chart-col.current .chart-month { color: var(--text); font-weight: 700; }





.chart-hover-dot { background: var(--text-dim); }
.chart-empty {
  display: flex; align-items: center; justify-content: center;
  height: 120px; margin-top: 10px;
  font-size: 12.5px; color: var(--text-dim);
  border: 1px dashed var(--border); border-radius: 12px;
}

@media (max-width: 860px) {







  .chart-col:nth-of-type(odd) .chart-month { display: none; }
  .chart-month { font-size: 9.5px; }
  .chart-value { font-size: 10px; }
  .chart-gridvalue { font-size: 9.5px; padding-right: 6px; }
}




.cl-feed { display: flex; flex-direction: column; gap: 22px; }
.cl-day-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.cl-day-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cl-day-count { font-size: 12px; color: var(--text-dim); }
.cl-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.cl-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.cl-title { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; }
.cl-body { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--text-dim); white-space: pre-wrap; }


.cl-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }

.cl-section {
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  background: var(--panel-2); border-radius: 6px; padding: 2px 7px; white-space: nowrap;
}

.cl-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  border-radius: 999px; padding: 2px 8px; white-space: nowrap; flex-shrink: 0;
}
.cl-tag-new { background: var(--green-soft); color: var(--green); }
.cl-tag-improve { background: var(--yellow-soft); color: var(--orange); }
.cl-tag-fix { background: var(--red-soft); color: var(--red); }


.cl-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cl-card-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.cl-card-badge {
  background: var(--red); color: #fff; border-radius: 999px; padding: 1px 8px;
  font-size: 11px; font-weight: 700;
}
.cl-card-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cl-card-item:last-child { border-bottom: none; padding-bottom: 0; }
.cl-card-text { min-width: 0; }
.cl-card-title { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.cl-card-sub { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }





.order-hidden-badge {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  padding: 2px 9px; border-radius: 999px; vertical-align: middle;
  background: var(--yellow-soft); color: #9a5b00;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap;
}


.order-hidden-hint { margin: 6px 0 0 28px; font-size: 12px; line-height: 1.45; color: var(--text-dim); }
.order-hidden-hint.on { color: var(--orange); }


.order-hidden-section {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border-left: 3px solid var(--orange);
}
.order-hidden-text { min-width: 0; }
.order-hidden-title { font-weight: 700; font-size: 14px; margin-bottom: 3px; }

@media (max-width: 640px) {


  .order-hidden-hint { margin-left: 0; }


  .order-hidden-section { flex-direction: column; align-items: stretch; }
  .order-hidden-section .btn { width: 100%; }

  .order-card-title { flex-wrap: wrap; }
}












.chat-bubble-row.chat-msg-pending { opacity: .55; }


.chat-bubble-row.chat-msg-pending .chat-bubble-actions,
.chat-bubble-row.chat-msg-pending .chat-read-ticks { visibility: hidden; }
.chat-bubble-row.chat-msg-pending .chat-bubble { transition: opacity .15s ease; }

.chat-bubble-row.chat-msg-failed .chat-bubble { box-shadow: inset 0 0 0 1.5px var(--red); }
.chat-msg-failed-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--red);
}
.chat-bubble-row.mine .chat-msg-failed-note { justify-content: flex-end; }
.chat-resend-btn {
  border: 0;
  background: var(--red);
  color: #fff;
  border-radius: 8px;
  padding: 3px 9px;
  font: 600 11.5px/1.2 inherit;
  cursor: pointer;
  transition: transform .12s ease;
}
.chat-resend-btn:active { transform: scale(.94); }







.avito-bf-have {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 720px) { .avito-bf-have { grid-template-columns: 1fr; } }

.avito-bf-acts { margin-top: 14px; }
.avito-bf-acts .fld-note { margin-top: 6px; }

.avito-bf-run { margin-top: 8px; }
.avito-bf-bar {
  height: 6px; border-radius: 4px; background: var(--border); overflow: hidden;
}
.avito-bf-bar span {
  display: block; height: 100%; background: var(--accent);
  border-radius: 4px; transition: width .4s ease;
}




.avito-bf-bar.is-wait span {
  width: 30%; transition: none;
  animation: avito-bf-wait 1.2s ease-in-out infinite;
}



@keyframes avito-bf-wait {
  0% { transform: translateX(0); }
  50% { transform: translateX(233.3%); }
  100% { transform: translateX(0); }
}
@media (prefers-reduced-motion: reduce) {
  .avito-bf-bar.is-wait span { animation: none; width: 100%; opacity: .45; }
}



.avito-cab-stat.is-off .avito-cab-v { color: var(--text-dim); }

.avito-map-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }





.avito-bf-acts .btn:disabled { opacity: .45; cursor: default; }







.feed-changes:empty { display: none; }
.feed-diff {
  margin-top: 10px; padding: 14px 16px;
  border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 18px; background: var(--panel);
}
.feed-diff.is-safe { border-left-color: var(--green); }
.feed-diff.is-danger { border-left-color: var(--red); }
.feed-diff-h { font-weight: 600; margin-bottom: 10px; }

.feed-diff-rows { display: grid; gap: 2px; }
.feed-diff-rows > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 0; border-bottom: 1px solid var(--border);
}
.feed-diff-rows > div:last-child { border-bottom: 0; }
.feed-diff-rows span { color: var(--text-dim); font-size: 13px; }
.feed-diff-rows b { font-variant-numeric: tabular-nums; }
.feed-diff-rows .is-warn b { color: var(--red-ink); }

.feed-diff-list { margin-top: 10px; font-size: 13px; line-height: 1.9; }
.feed-diff .fld-note { margin-top: 10px; }



.feed-diff-foot { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }


.conv-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 10px; }
@media (max-width: 720px) { .conv-pick { grid-template-columns: 1fr; } }
.conv-pick select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--panel-2); color: var(--text); font: inherit;
}

.conv-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.conv-bar > span:first-child { font-size: 13px; color: var(--text-dim); margin-right: 4px; }



.avito-table tr.conv-next > td { background: var(--accent-soft); }
.conv-tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim); white-space: nowrap;
}
.conv-acts { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; }
.avito-cab-stat.is-warn .avito-cab-v { color: var(--red-ink); }




.avito-table td.num.is-warn { color: var(--red-ink); font-weight: 600; }






.board-alarm {
  display: flex; align-items: center; gap: 14px;
  background: var(--yellow-soft); border: 1px solid color-mix(in srgb, var(--yellow) 30%, transparent);
  border-radius: 18px; padding: 13px 16px; margin-bottom: 16px;
}
.board-alarm-txt { flex: 1; min-width: 0; font-size: 13.5px; }
.board-alarm-sub { color: var(--yellow-ink); opacity: .85; margin-top: 2px; }

.board-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.board-sp { flex: 1; }








.board-card { margin-bottom: 22px; }
.board-card-head {
  display: flex; align-items: baseline; gap: 10px; width: 100%;
  border: 0; background: none; padding: 8px 0; font: inherit; cursor: pointer;
  border-bottom: 1px solid var(--border); text-align: left;
}
.board-card-caret { color: var(--text-dim); font-size: 12px; }
.board-card-name { font-size: 16px; font-weight: 600; color: var(--text); }
.board-card-n { font-size: 12.5px; color: var(--text-dim); }

.board-grp { margin-top: 14px; }
.board-grp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.board-grp-name { font-size: 13px; font-weight: 600; color: var(--text); }

.board-grp-n {
  font-size: 12px; color: var(--text-dim); white-space: nowrap;
  border: 1px solid var(--border); border-radius: 10px; padding: 0 7px;
}



.board-grp-lot { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

.board-grp.is-warn .board-grp-name { color: var(--red-ink); }
.board-grp.is-warn .board-grp-n { border-color: var(--red-ink); color: var(--red-ink); }
.board-grp .avito-table-wrap { margin: 0; }









.board-t { table-layout: fixed; min-width: 970px; }






.board-state { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }


.board-t td, .board-t th { overflow: hidden; text-overflow: ellipsis; }
.board-t .board-why { white-space: normal; }
.board-cols { margin: 6px 0 0; }
.board-cols table { margin: 0; }
.board-cols th { padding-top: 4px; padding-bottom: 4px; }



.board-t input[type="checkbox"] { width: 16px; height: 16px; }



.feed-diff-since { font-size: 11.5px; color: var(--text-dim); margin: -2px 0 6px; text-align: right; }

.board-tabs {
  display: flex; gap: 18px; flex-wrap: wrap; align-items: baseline;
  border-bottom: 1px solid var(--border); margin-bottom: 8px; padding-bottom: 6px;
}
.board-tab {
  border: 0; background: none; padding: 0 0 6px; margin-bottom: -7px;
  font: inherit; font-size: 15px; font-weight: 600; color: var(--text-dim);
  cursor: pointer; border-bottom: 2px solid transparent;
}
.board-tab sup { font-size: 11px; font-weight: 500; }
.board-tab:hover { color: var(--text); }
.board-tab.on { color: var(--text); border-bottom-color: var(--text); }

.board-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }




.board-sel {
  width: auto; height: auto; max-width: 260px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text);
  border-radius: 12px; padding: 7px 12px; font: inherit; font-size: 13px;
}
.board-search { flex: 1; min-width: 150px; max-width: none; }
.board-filters, .board-acts-row { align-items: center; }




.board-more { margin: 0 0 8px; }
.board-more b { color: var(--text); }

.board-quicks { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.board-quick {
  border: 0; background: none; padding: 0; font: inherit; font-size: 12.5px;
  color: var(--text-dim); cursor: pointer; border-bottom: 1px dashed var(--border);
}
.board-quick b { color: var(--text); }
.board-quick.on { color: var(--text); border-bottom-color: var(--text); }

.board-t td { vertical-align: top; }
.board-t .mid { text-align: center; }
.board-t .dim { color: var(--text-dim); }
.board-t .is-good { color: var(--green-ink); font-weight: 600; }
.board-why { font-size: 11.5px; color: var(--text-dim); margin-top: 2px; }
.board-open { font-size: 11.5px; }




.board-pill {
  display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  background: var(--gray-soft); color: var(--text-dim); white-space: nowrap;
}
.board-pill.s-live { background: var(--green-soft); color: var(--green-ink); }
.board-pill.s-dropped { background: var(--red-soft); color: var(--red-ink); }
.board-pill.s-waiting { background: var(--yellow-soft); color: var(--yellow-ink); }



.board-pill.s-adopted { background: var(--accent-soft); color: var(--accent-ink); }




.board-pill.s-converted {
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid var(--accent-line, rgba(0, 0, 0, .08));
}





.board-pill.s-dupe {
  background: var(--red-soft); color: var(--red-ink);
  border: 1px solid var(--red-ink); white-space: nowrap;
}


.board-alarm.is-bad { background: var(--red-soft); border-color: var(--red-ink); }
.board-alarm.is-bad .board-alarm-sub { color: var(--red-ink); }
.board-pill.s-moved {
  background: var(--red-soft); color: var(--red-ink);
  border: 1px solid var(--red-ink); white-space: nowrap;
}

.avito-table tr.is-sel > td { background: var(--accent-soft); }

.board-acts {
  margin-top: 14px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--panel-2); padding: 12px 16px;
}
.board-acts[hidden] { display: none; }
.board-acts-top { display: flex; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 10px; }
.board-acts-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


.board-noplace { margin: 0 0 10px; }
.board-noplace[hidden] { display: none; }


.cab-line {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.cab-line:last-of-type { border-bottom: 0; }
.cab-lab { width: 260px; flex: none; font-size: 13px; color: var(--text-dim); }
.cab-val { flex: 1; min-width: 200px; font-size: 13.5px; }
@media (max-width: 720px) { .cab-lab { width: 100%; } }

.cab-two { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 720px) { .cab-two { grid-template-columns: 1fr; } }

.old-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.old-card {
  display: block; text-align: left; border: 1px solid var(--border); background: var(--panel);
  border-radius: 18px; padding: 13px 15px; font: inherit; cursor: pointer;
  transition: border-color .12s ease;
}
.old-card:hover { border-color: var(--text-dim); }
.old-card b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.old-card span { display: block; font-size: 12px; color: var(--text-dim); line-height: 1.45; }





.ait-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.ait-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ait-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 16px; }
.ait-tile {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.ait-tile-n { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ait-tile-l { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.ait-tile.good .ait-tile-n { color: var(--green); }
.ait-tile.edited .ait-tile-n { color: var(--yellow); }
.ait-tile.dropped .ait-tile-n { color: var(--text-dim); }

.ait-layout { display: grid; grid-template-columns: 380px 1fr; gap: 16px; align-items: start; }
.ait-pane {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden;
}
.ait-list-filters { padding: 12px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; flex-wrap: wrap; }
.ait-list { max-height: calc(100vh - 360px); overflow-y: auto; }
.ait-row { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: pointer; }
.ait-row:hover { background: var(--panel-2); }
.ait-row.active { background: var(--accent-soft); }
.ait-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.ait-row-who { font-weight: 700; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ait-row-date { font-size: 11.5px; color: var(--text-dim); flex: none; font-variant-numeric: tabular-nums; }
.ait-row-text { font-size: 12.5px; color: var(--text-dim); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ait-row-bottom { display: flex; align-items: center; gap: 6px; margin-top: 7px; flex-wrap: wrap; }



.ait-outcome { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.ait-outcome.as_is { background: var(--green-soft); color: var(--green-ink); }
.ait-outcome.edited { background: var(--yellow-soft); color: var(--yellow); }
.ait-outcome.rewritten { background: var(--red-soft); color: var(--red-ink); }
.ait-outcome.dropped { background: var(--panel-2); color: var(--text-dim); }
.ait-outcome.inserted { background: var(--panel-2); color: var(--text-dim); }
.ait-verdict { font-size: 13px; }

.ait-detail { padding: 18px 20px; }
.ait-block { margin-bottom: 18px; }
.ait-block-h { font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.ait-quote { background: var(--panel-2); border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.5; margin-bottom: 6px; }
.ait-quote b { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 600; margin-bottom: 3px; }
.ait-opt { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.ait-opt.used { border-color: var(--green); background: var(--green-soft); }
.ait-opt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ait-opt-title { font-weight: 700; font-size: 13px; flex: 1; }
.ait-opt-used-mark { font-size: 11px; font-weight: 700; color: var(--green); }
.ait-opt-text { font-size: 13px; line-height: 1.55; }
.ait-sent { background: var(--panel-2); border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.55; }


.ait-added { background: var(--green-soft); border-radius: 4px; padding: 0 2px; }
.ait-kept { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

.ait-form { border-top: 1px solid var(--border); padding-top: 16px; }
.ait-verdict-row { display: flex; gap: 8px; margin-bottom: 12px; }
.ait-verdict-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel);
  font-weight: 700; font-size: 13px; cursor: pointer; color: var(--text);
}
.ait-verdict-btn:hover { border-color: var(--text-dim); }
.ait-verdict-btn.on.good { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.ait-verdict-btn.on.bad { border-color: var(--red); background: var(--red-soft); color: var(--red-ink); }
.ait-form label { display: block; font-size: 12.5px; color: var(--text-dim); margin: 0 0 6px; }
.ait-form textarea { width: 100%; margin-bottom: 12px; }
.ait-empty { padding: 60px 24px; text-align: center; color: var(--text-dim); font-size: 13.5px; }



.ait-lesson { border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.ait-lesson-text { font-size: 13.5px; line-height: 1.55; font-weight: 600; margin-bottom: 6px; }
.ait-lesson-why { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; }
.ait-lesson-actions { display: flex; gap: 8px; }



.ait-quick { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.ait-quick-btn {
  width: auto; background: none; border: none; cursor: pointer; font-size: 14px;
  padding: 4px 6px; border-radius: 8px; line-height: 1; opacity: 0.45;
}
.ait-quick-btn:hover { opacity: 1; background: var(--panel-2); }
.ait-quick-btn.on { opacity: 1; background: var(--accent-soft); }
@media (pointer: coarse) {
  .ait-quick-btn { position: relative; padding: 8px; }
  .ait-quick-btn::after { content: ''; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
}

@media (max-width: 1100px) {
  .ait-layout { grid-template-columns: 1fr; }
  .ait-list { max-height: 340px; }
  .ait-tiles { grid-template-columns: repeat(2, 1fr); }
}




.ait-after { font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 10px; margin-bottom: 6px; }
.ait-after.paid { background: var(--green-soft); color: var(--green-ink); }
.ait-after.reply { background: var(--panel-2); color: var(--text); }
.ait-after.silent { background: var(--panel-2); color: var(--text-dim); }
.ait-after-mark { font-size: 13px; cursor: default; }



.ait-prefilled { font-size: 11px; font-weight: 600; color: var(--green); text-transform: none; letter-spacing: 0; }
.ait-tone-row { display: flex; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.ait-tone-row:last-child { border-bottom: none; }
.ait-tone-n { font-weight: 800; color: var(--text-dim); font-variant-numeric: tabular-nums; min-width: 42px; }
.ait-tone-note { line-height: 1.5; }
.ait-example { margin-bottom: 18px; }
.ait-example:last-child { margin-bottom: 0; }
.ait-example-head { font-weight: 700; font-size: 13px; margin-bottom: 8px; }



.ait-auto { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; margin: -6px 0 16px; }
.ait-auto b { color: var(--green); }












.modal-backdrop { animation: modal-backdrop-in var(--dur-in) var(--ease-out) backwards; }
.modal { animation: modal-in .26s var(--ease-spring) backwards; }


.modal-backdrop.modal-backdrop-stay { animation: none; }
@keyframes modal-backdrop-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }



.modal-ghost-layer { pointer-events: none; }
.modal-ghost-layer .modal-backdrop { animation: modal-backdrop-out var(--dur-out) var(--ease-in) forwards; }
.modal-ghost-layer .modal-backdrop .modal { animation: modal-out var(--dur-out) var(--ease-in) forwards; }



.modal-ghost-layer .modal-backdrop .modal.modal-sheet { animation-name: modal-sheet-out; }
@keyframes modal-backdrop-out { to { opacity: 0; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(6px) scale(.97); } }
@keyframes modal-sheet-out { to { transform: translate3d(0, 100%, 0); } }



.notif-panel.is-leaving { animation: notifPanelOut var(--dur-out) var(--ease-in) forwards; pointer-events: none; }
@keyframes notifPanelOut { to { opacity: 0; transform: translateY(-6px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal, .notif-panel.is-leaving { animation: none; }
  .sidebar-backdrop, .sidebar-backdrop.open { transition: none; }
}








.popup-leaving { pointer-events: none; }




.side-panel { transition: transform var(--dur-in) var(--ease-out), opacity var(--dur-in) ease; }
#app.side-leaving .side-panel,
#app.side-entering .side-panel { transform: translateX(24px); opacity: 0; }
#app.side-leaving .side-panel { transition-duration: .18s; transition-timing-function: var(--ease-in), ease; }
#app.side-entering .side-panel { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .side-panel { transition: none; }
}




.tab-fly {
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
  transition: none !important;
  animation: none !important;
}




::view-transition-old(root),
::view-transition-new(root) { animation-duration: .2s; }
::view-transition-group(order-card),
::view-transition-group(order-title) { animation-duration: .36s; animation-timing-function: var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) { animation: none !important; }
}








.done-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: flex; align-items: center; gap: 10px;



  width: max-content;
  max-width: min(92vw, 460px);
  padding: 10px 16px 10px 10px;
  border-radius: 14px;
  background: var(--text);
  color: var(--panel);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 14px 34px -10px rgba(16, 17, 20, .45);
  transform: translateX(-50%);
  animation: done-toast-in .34s var(--ease-spring) backwards;
  pointer-events: none;
}
.done-toast.done-toast-leaving { animation: done-toast-out var(--dur-out) var(--ease-in) forwards; }
.done-toast-tick {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--green);
  animation: done-tick-pop .34s var(--ease-spring) .06s backwards;
}

.done-toast-tick svg {
  width: 13px; height: 13px;
  fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 14; stroke-dashoffset: 14;
  animation: done-tick-draw .3s var(--ease-out) .2s forwards;
}
.done-toast-text { overflow: hidden; text-overflow: ellipsis; }
@keyframes done-toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(.94); } }
@keyframes done-toast-out { to { opacity: 0; transform: translate(-50%, 8px) scale(.97); } }
@keyframes done-tick-pop { from { transform: scale(0); } }
@keyframes done-tick-draw { to { stroke-dashoffset: 0; } }




[aria-busy="true"].btn { pointer-events: none; }
.btn.btn-working { position: relative; color: transparent !important; }
.btn.btn-working::after {
  content: '';
  position: absolute; inset: 0; margin: auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--btn-ink, currentColor);
  border-right-color: transparent;
  animation: btn-busy-spin .7s linear infinite;
}
@keyframes btn-busy-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .done-toast, .done-toast.done-toast-leaving, .done-toast-tick { animation: none; }
  .done-toast-tick svg { animation: none; stroke-dashoffset: 0; }

  .btn.btn-working::after { animation-duration: 1.6s; }
}








.order-status.status-just-changed {
  position: relative;
  animation: status-just-changed .5s var(--ease-spring) backwards;
}
.order-status.status-just-changed::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid currentColor;
  opacity: 0;
  pointer-events: none;
  animation: status-ring .7s var(--ease-out) .05s;
}
@keyframes status-just-changed { from { transform: scale(.82); } }
@keyframes status-ring {
  0%   { opacity: .6; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.35); }
}




.checklist-item.check-just-done input[type="checkbox"] { animation: check-pop .38s var(--ease-spring); }
.checklist-item.check-just-done .checklist-title { animation: check-strike .45s var(--ease-out) backwards; }
@keyframes check-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes check-strike { from { text-decoration-color: transparent; } }

@media (prefers-reduced-motion: reduce) {
  .order-status.status-just-changed,
  .order-status.status-just-changed::after,
  .checklist-item.check-just-done input[type="checkbox"],
  .checklist-item.check-just-done .checklist-title { animation: none; }
}




.order-card.order-card-new {
  position: relative;
  isolation: isolate;
  animation: order-card-new-in .4s var(--ease-out) backwards;
}
.order-card.order-card-new::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--orange-soft);
  opacity: 0;
  pointer-events: none;
  animation: order-card-new-tint 1.8s ease-out;
}
@keyframes order-card-new-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes order-card-new-tint { 10% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .order-card.order-card-new, .order-card.order-card-new::after { animation: none; }
}





.loading-late { animation: loading-late .25s ease .3s backwards; }
@keyframes loading-late { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {

  .loading-late { animation: loading-late 1ms linear .3s backwards; }
}



.field-invalid,
.field-invalid:focus { border-color: var(--red) !important; }
.field-invalid { animation: field-shake .38s var(--ease-out); }
.field-error {
  margin-top: 6px;
  color: var(--red);
  font-size: 12.5px;
  font-weight: 600;
  animation: field-error-in var(--dur-in) var(--ease-out) backwards;
}
@keyframes field-shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
@keyframes field-error-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .field-invalid, .field-error { animation: none; }
}



.stat-card .num,
.avito-kpi-value { font-variant-numeric: tabular-nums; }




.chat-drop-active::after { animation: drop-hint-in .16s var(--ease-out); }
@keyframes drop-hint-in { from { opacity: 0; transform: scale(.985); } }
@media (prefers-reduced-motion: reduce) {
  .chat-drop-active::after { animation: none; }
}




html.lite-motion .brand-mark,
html.lite-motion .brand-mark::after,
html.lite-motion .ai-blob,
html.lite-motion .ai-send-btn::before,
html.lite-motion .unread-notify-card::after,
html.lite-motion .order-status-icon,
html.lite-motion .ls-mesh *,
html.lite-motion .login-orbit-desktop *,
html.lite-motion .login-orbit-mobile * { animation: none !important; }





.ss-panel.open { animation: dropdown-down .16s var(--ease-out); }
.mention-dropdown { animation: dropdown-up .16s var(--ease-out); }
@keyframes dropdown-down { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes dropdown-up { from { opacity: 0; transform: translateY(4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  .ss-panel.open, .mention-dropdown { animation: none; }
}




.done-toast.done-toast-error { pointer-events: auto; align-items: flex-start; padding-right: 8px; }


.done-toast-error .done-toast-text { white-space: pre-line; overflow: visible; line-height: 1.4; padding-top: 2px; min-width: 0; overflow-wrap: anywhere; }
.done-toast-bang {
  width: 24px; height: 24px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  font-size: 14px; font-weight: 800; line-height: 1;
  animation: done-tick-pop .34s var(--ease-spring) .06s backwards;
}
.done-toast-close {
  flex: none;
  width: 26px; height: 26px; margin-left: 2px;
  display: grid; place-items: center;
  border: none; border-radius: 8px;
  background: transparent; color: inherit;
  opacity: .6; cursor: pointer; font-size: 12px;
}
.done-toast-close:hover { opacity: 1; background: color-mix(in srgb, var(--panel) 18%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .done-toast-bang { animation: none; }
}






.dlg-bubble-new .chat-bubble {
  animation: dlg-bubble-in .32s var(--ease-spring) both;
  transform-origin: 0% 100%;
}
.dlg-bubble-new.mine .chat-bubble { transform-origin: 100% 100%; }
@keyframes dlg-bubble-in {
  from { opacity: 0; transform: translateY(10px) scale(.94); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dlg-bubble-new .chat-bubble { animation: none; }
}
html.lite-motion .dlg-bubble-new .chat-bubble { animation-duration: .16s; }





.dlg-older {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}
.dlg-older-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s ease, color .15s ease;
}
.dlg-older-btn:hover { color: var(--text); }
.dlg-older.is-loading .dlg-older-btn { opacity: .55; pointer-events: none; }






.page-skeleton { animation: loading-late .2s ease; }
.page-skeleton .sk {
  display: block;
  position: relative;
  overflow: hidden;
  background-color: var(--panel-2);
  border-radius: 6px;
}
.page-skeleton .sk::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--panel) 55%, transparent) 50%,
    transparent 100%);
  transform: translateX(-100%);
  animation: dlgSkeletonShimmer 1.4s ease-in-out infinite;
}
.page-skeleton .sk-line { height: 11px; margin-top: 10px; }
.page-skeleton .sk-title { width: min(220px, 60%); height: 24px; border-radius: 8px; }
.page-skeleton .sk-pill { width: 96px; height: 26px; border-radius: 20px; }
.page-skeleton .sk-input { flex: 1 1 280px; height: 38px; border-radius: 10px; }
.page-skeleton .sk-select { width: 170px; height: 38px; border-radius: 10px; }
.page-skeleton .sk-head { margin-bottom: 26px; }
.page-skeleton .sk-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-skeleton .sk-row .sk-line { margin-top: 0; }
.page-skeleton .sk-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.page-skeleton .sk-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 20px;
  margin-bottom: 14px;
}
.page-skeleton .order-cards-grid .sk-card { margin-bottom: 0; }
.page-skeleton .sk-card .sk-row + .sk-line { margin-top: 14px; }
@media (prefers-reduced-motion: reduce) {
  .page-skeleton { animation: none; }
  .page-skeleton .sk::after { animation: none; display: none; }
}
html.lite-motion .page-skeleton .sk::after { animation: none; display: none; }





.dlg-list-item.dlg-list-item-new { position: relative; isolation: isolate; }
.dlg-list-item.dlg-list-item-new::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: var(--orange-soft);
  opacity: 0;
  pointer-events: none;
  animation: order-card-new-tint 1.8s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .dlg-list-item.dlg-list-item-new::after { animation: none; }
}




.dlg-mac-view .chat-items.dlg-rows-still .dlg-list-item { animation: none; }







#call-root:empty { display: none; }
#call-root.call-card {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 4500;
  width: min(340px, calc(100vw - 32px));
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(16, 17, 20, .22);
  animation: call-card-in .26s var(--ease-spring) backwards;
}
@keyframes call-card-in { from { opacity: 0; transform: translateY(12px) scale(.96); } }


#call-root.call-card { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
#call-root.call-card.call-dragging { cursor: grabbing; box-shadow: 0 26px 64px rgba(16, 17, 20, .32); transition: none; }
#call-root .call-btn { cursor: pointer; }
.call-card-grip { position: absolute; top: 5px; left: 50%; z-index: 1; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: rgba(140, 140, 150, .55); pointer-events: none; }
.call-card-body { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; }
.call-card-who { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.call-card-avatar {
  position: relative;
  width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ff6a3d, #ff9466);
  color: #fff; font-size: 18px; font-weight: 800;
  overflow: hidden;
}
.call-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.call-card-text { min-width: 0; }
.call-card-name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call-card-status { color: var(--text-dim); font-size: 13px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.call-active .call-card-status { color: var(--green); }
.call-card-actions { display: flex; gap: 10px; flex-shrink: 0; }
.call-btn {
  width: 46px; height: 46px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: transform .12s ease, filter .12s ease, background-color .12s ease;
}
.call-btn:hover { filter: brightness(1.06); }
.call-btn:active { transform: scale(.92); }
.call-btn-accept { background: var(--green); }
.call-btn-decline { background: var(--red); }
.call-btn-decline svg { transform: rotate(135deg); }
.call-btn-mute { background: var(--panel-2); color: var(--text); }
.call-btn-mute.on { background: var(--text); color: var(--panel); }
.call-btn:disabled { opacity: .5; cursor: default; }



.call-ringing .call-card-avatar::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--green);
  animation: call-ring 1.4s ease-out infinite;
}
@keyframes call-ring {
  from { opacity: .9; transform: scale(1); }
  to { opacity: 0; transform: scale(1.35); }
}
.call-ringing .call-btn-accept { animation: call-accept-nudge 1.4s ease-in-out infinite; }
@keyframes call-accept-nudge {
  0%, 70%, 100% { transform: none; }
  78% { transform: rotate(-12deg); }
  86% { transform: rotate(12deg); }
}
@media (max-width: 640px) {
  #call-root.call-card {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    bottom: auto;
    left: 10px;
    right: 10px;
    width: auto;
  }


  #call-root.call-card:not(.call-ringing) {
    top: auto;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 92px);
  }
}
@media (prefers-reduced-motion: reduce) {
  #call-root.call-card,
  .call-ringing .call-card-avatar::after,
  .call-ringing .call-btn-accept { animation: none; }
}
html.lite-motion .call-ringing .call-card-avatar::after,
html.lite-motion .call-ringing .call-btn-accept { animation: none; }





.dlg-orders-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--panel);
  font: inherit; font-size: 12px; font-weight: 700; color: var(--text); cursor: pointer;
  white-space: nowrap; flex-shrink: 0; position: relative;
  transition: border-color .12s ease, background-color .12s ease;
}
.dlg-orders-btn[hidden] { display: none; }
.dlg-orders-btn:hover { border-color: var(--dlg-accent); }
.dlg-orders-btn.is-empty { color: var(--text-dim); font-weight: 600; }
.dlg-orders-icon { width: 14px; height: 14px; color: var(--text-dim); flex-shrink: 0; }
.dlg-orders-btn-num {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px;
  background: var(--dlg-accent); color: #fff; font-size: 11px; font-weight: 800; line-height: 1;
}
.dlg-orders-btn-num:empty { display: none; }
.dlg-orders-btn.has-late .dlg-orders-btn-num { background: var(--red); }

.dlg-orders-btn-num.is-done { background: var(--text-dim); color: var(--panel); }
.dlg-orders-btn-late {
  font-size: 10.5px; font-weight: 700; color: var(--red); background: var(--red-soft);
  padding: 2px 7px; border-radius: 999px;
}
.dlg-orders-btn-chev { color: var(--text-dim); font-size: 11px; }

.chat-ctx-menu.dlg-orders-menu { width: 340px; max-width: calc(100vw - 24px); padding: 8px; }
.dlg-orders-menu-head { font-size: 11.5px; font-weight: 700; color: var(--text-dim); padding: 4px 6px 8px; }
.dlg-orders-menu-list { max-height: 50vh; overflow-y: auto; }
.dlg-orders-menu-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 4px 2px; margin-top: 6px; border-top: 1px solid var(--border);
}
.dlg-orders-empty { font-size: 12.5px; color: var(--text-dim); padding: 6px 6px 10px; }
.dlg-order-row {
  display: block; width: 100%; text-align: left; padding: 8px; border: none; border-radius: 10px;
  background: none; font: inherit; color: var(--text); cursor: pointer;
}
.dlg-order-row:hover { background: var(--panel-2); }
.dlg-order-row + .dlg-order-row { margin-top: 2px; }
.dlg-order-row-top { display: flex; gap: 6px; font-size: 12.5px; font-weight: 600; min-width: 0; }
.dlg-order-num { color: var(--text-dim); font-weight: 700; flex-shrink: 0; }
.dlg-order-row-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dlg-order-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 5px; }
.dlg-order-row .badge.order-status { padding: 2px 8px; font-size: 10.5px; }
.dlg-order-due { font-size: 11px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.dlg-order-due.late { color: var(--red); }
.dlg-order-row.is-foreign { opacity: .6; cursor: default; }
.dlg-order-row.is-foreign:hover { background: none; }
.dlg-order-row-who { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--text-dim); }
.dlg-order-add {
  display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 11px;
  border: 1px dashed var(--border); border-radius: 999px; background: none;
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text-dim); cursor: pointer;
}
.dlg-order-add:hover { border-style: solid; border-color: var(--dlg-accent); color: var(--dlg-accent); }
.dlg-orders-more {
  border: none; background: none; font: inherit; font-size: 12px; font-weight: 600;
  color: var(--dlg-accent); cursor: pointer; padding: 0 4px;
}


@media (max-width: 1040px) {
  body.chat-pinned-mobile .dlg-orders-btn { height: 32px; padding: 0 10px; gap: 4px; font-size: 13px; }
  body.chat-pinned-mobile .dlg-orders-btn-label,
  body.chat-pinned-mobile .dlg-orders-btn-late,
  body.chat-pinned-mobile .dlg-orders-btn-chev { display: none; }
  body.chat-pinned-mobile .dlg-orders-icon { width: 15px; height: 15px; }


  .chat-ctx-menu.chat-ctx-sheet.dlg-orders-menu { width: auto; max-width: none; padding: 0 10px calc(14px + env(safe-area-inset-bottom, 0px)); }
  .chat-ctx-sheet.dlg-orders-menu .dlg-orders-menu-head { font-size: 15px; color: var(--text); padding: 4px 8px 10px; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-orders-menu-list { max-height: none; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-order-row { padding: 12px 8px; border-radius: 12px; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-order-row-top { font-size: 14px; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-order-row .badge.order-status { padding: 3px 9px; font-size: 11px; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-orders-menu-foot { flex-direction: column-reverse; align-items: stretch; border-top: none; gap: 6px; }
  .chat-ctx-sheet.dlg-orders-menu .dlg-order-add {
    justify-content: center; height: 44px; border-radius: 12px; border: none;
    background: var(--text); color: var(--panel); font-size: 14.5px; font-weight: 700;
  }
  .chat-ctx-sheet.dlg-orders-menu .dlg-orders-more { padding: 8px 4px; font-size: 13.5px; text-align: left; }
}








.fin-page { container-type: inline-size; container-name: fin; }

.fin-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.fin-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--text); }
.fin-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.fin-add { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; }
.fin-add-plus { font-size: 17px; line-height: 1; font-weight: 700; }

.fin-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.fin-scroll-x { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.fin-scroll-x::-webkit-scrollbar { display: none; }
.fin-page .segmented { white-space: nowrap; }

.fin-kpis { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.fin-kpi {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 15px 18px; box-shadow: var(--shadow); min-width: 0;
}
.fin-kpi-label { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fin-kpi-value { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); margin-top: 6px; white-space: nowrap; }
.fin-kpi-main .fin-kpi-value { font-size: 30px; }
.fin-kpi-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.fin-trend-up { color: var(--green); font-weight: 700; }
.fin-trend-down { color: var(--red); font-weight: 700; }

.fin-chart-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 14px 18px 8px; box-shadow: var(--shadow); margin-bottom: 16px;
}
.fin-card-title { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.fin-card-hint { font-weight: 600; color: var(--text-dim); font-size: 12px; }

.fin-filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.fin-page .fin-filters .chip-group { flex-wrap: nowrap; }
.fin-page .fin-filters .chip { white-space: nowrap; }
.fin-filter-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }

.fin-list { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.fin-day {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 18px 7px;
  font-size: 12px; font-weight: 700; color: var(--text-dim); background: var(--panel-2);
  border-top: 1px solid var(--border);
}
.fin-day:first-child { border-top: none; }
.fin-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 110px 100px 64px; gap: 12px; align-items: center;
  padding: 11px 12px 11px 18px; border-top: 1px solid var(--border); cursor: pointer;
  transition: background-color .12s ease;
}
.fin-day + .fin-row, .fin-list > .fin-row:first-child { border-top: none; }
.fin-row:hover { background: var(--panel-2); }
.fin-row-main { min-width: 0; }
.fin-row-title { font-weight: 700; font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-row-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-order-link { color: var(--accent-ink); font-weight: 600; }
.fin-mgr-inline { display: none; }
.fin-row-tags { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.fin-row-manager { font-size: 12.5px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-row-amount { font-weight: 800; font-size: 15px; white-space: nowrap; text-align: right; color: var(--text); }
.fin-row-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: 0; transition: opacity .12s ease; }
.fin-row:hover .fin-row-actions, .fin-row:focus-within .fin-row-actions { opacity: 1; }

@media (hover: none) { .fin-row-actions { opacity: 1; } }
.fin-row-title-link { font: inherit; font-weight: 700; color: inherit; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fin-empty { padding: 34px 18px; text-align: center; color: var(--text-dim); font-size: 13.5px; }
.fin-period { display: flex; flex-direction: column; align-items: flex-end; gap: 0; max-width: 100%; }
.fin-page .custom-range { margin-top: 8px; }


.fin-select-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0; }
.fin-select-chip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
.fin-total {
  display: flex; justify-content: space-between; gap: 10px; padding: 13px 18px;
  background: var(--panel-2); border-top: 1px solid var(--border); font-size: 13.5px; font-weight: 700; color: var(--text);
}
.fin-total b { font-size: 16px; font-weight: 800; }


@container fin (max-width: 859px) {


  .fin-kpis { display: flex; flex-wrap: wrap; }
  .fin-kpi { flex: 1 1 150px; }
  .fin-kpi-main { flex-basis: 100%; }
  .fin-row { grid-template-columns: minmax(0, 1fr) auto 100px 64px; }
  .fin-row-manager { display: none; }
  .fin-mgr-inline { display: inline; }
}


@container fin (max-width: 599px) {
  .fin-head { align-items: center; }
  .fin-title { font-size: 20px; }
  .fin-sub { display: none; }
  .fin-add-text { display: none; }
  .fin-add { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 50%; }
  .fin-add-plus { font-size: 22px; }
  .fin-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .fin-tabs .segmented { display: flex; }
  .fin-tabs .segmented button { flex: 1; }
  .fin-kpis { gap: 10px; }
  .fin-kpi { flex-basis: 130px; }
  .fin-kpi-main { flex-basis: 100%; }
  .fin-kpi { padding: 13px 14px; border-radius: 16px; }
  .fin-kpi-value { font-size: 19px; }
  .fin-kpi-main .fin-kpi-value { font-size: 28px; }
  .fin-chart-card { padding: 12px 12px 6px; border-radius: 16px; }
  .fin-list { border-radius: 16px; }
  .fin-day { padding: 9px 14px 7px; }


  .fin-row {
    grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "tags tags";
    row-gap: 7px; column-gap: 10px; padding: 12px 14px;
  }
  .fin-row-main { grid-area: main; }
  .fin-row-amount { grid-area: amount; align-self: start; font-size: 15.5px; }
  .fin-row-tags { grid-area: tags; justify-content: flex-start; }
  .fin-row-tags:empty { display: none; }
  .fin-row-actions { display: none; }
  .fin-period { align-items: stretch; }
  .fin-row-contact { display: none; }
  .fin-total { padding: 12px 14px; }
}


.modal-actions .fin-form-delete { margin-right: auto; }


.fin-note { font-size: 13px; color: var(--text-dim); margin: 0 0 12px; line-height: 1.5; }
.fin-row.fin-access-row { grid-template-columns: 36px minmax(0, 1fr) auto 44px; cursor: default; }
.fin-row.fin-access-row:hover { background: transparent; }
.fin-avatar {
  width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--text); font-weight: 800; font-size: 14px; overflow: hidden; flex-shrink: 0;
}
.fin-access-state { font-size: 12.5px; font-weight: 600; color: var(--text-dim); white-space: nowrap; }
.fin-access-state.on { color: var(--green); }
.fin-switch { position: relative; width: 44px; height: 26px; display: inline-block; cursor: pointer; }
.fin-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.fin-switch input:disabled { cursor: progress; }
.fin-switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border); transition: background-color .15s ease; pointer-events: none; }
.fin-switch span::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s ease;
}
.fin-switch input:checked + span { background: var(--green); }
.fin-switch input:checked + span::after { transform: translateX(18px); }
.fin-switch input:disabled + span { opacity: .6; }
.fin-switch input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #4C6FFF) 35%, transparent); }
@container fin (max-width: 599px) {
  .fin-row.fin-access-row { grid-template-columns: 36px minmax(0, 1fr) 44px; grid-template-areas: none; }
  .fin-access-row .fin-row-main { grid-area: auto; }
  .fin-access-state { display: none; }
}




.modal.fin-form-modal {
  width: min(640px, 94vw); max-height: 88vh; padding: 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.fin-form-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; flex-shrink: 0; }
.modal .fin-form-title { margin: 0; font-size: 18px; font-weight: 800; color: var(--text); }
.fin-form-close {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer;
  background: var(--panel-2); color: var(--text-dim); font-size: 14px;
}
.fin-form-close:hover { color: var(--text); }
.fin-form-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px;
  padding: 10px 24px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; overscroll-behavior: contain;
}
.fin-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fin-field > label { margin: 0; }
.fin-span2 { grid-column: 1 / -1; }
.fin-field .ms-week-hint { margin-top: 0; }
.modal-actions.fin-form-foot { margin-top: 0; padding: 14px 24px 18px; border-top: 1px solid var(--border); flex-shrink: 0; }
@media (max-width: 640px) {
  .modal-backdrop:has(> .fin-form-modal) { align-items: stretch; }
  .modal.fin-form-modal { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: none; }
  .fin-form-head { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 6px; }
  .fin-form-body { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 8px 16px 16px; }
  .modal-actions.fin-form-foot { flex-wrap: nowrap; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .fin-form-foot .btn { flex: 1 1 0; height: 46px; padding: 0 10px; }
  .fin-form-foot .fin-form-delete { flex: 0 1 auto; margin-right: 0; }
}








.dlg-peek {
  position: fixed;
  left: 0; top: 0;
  z-index: 40;
  width: 318px;
  box-sizing: border-box;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--canvas-shadow);
  padding: 14px 14px 12px;
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-10px, -50%) scale(.96);
  transform-origin: left center;
  transition: opacity var(--dur-out) var(--ease-in), transform var(--dur-out) var(--ease-in), visibility 0s linear var(--dur-out);
}
.dlg-peek.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(0, -50%) scale(1);
  transition: opacity var(--dur-in) var(--ease-out), transform .38s var(--ease-spring), visibility 0s;
}


.dlg-peek::before {
  content: "";
  position: absolute;
  left: -7px; top: var(--dlg-peek-tail, 50%);
  width: 12px; height: 12px;
  background: var(--panel);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-bottom-left-radius: 3px;
  transform: translateY(-50%) rotate(45deg);
}
.dlg-peek-head { display: flex; align-items: center; gap: 10px; }


.dlg-peek .dlg-avatar { width: 38px; height: 38px; flex-shrink: 0; position: relative; }
.dlg-peek .dlg-avatar-inner {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px; font-weight: 600;
}
.dlg-peek .dlg-avatar-inner img { width: 100%; height: 100%; object-fit: cover; }
.dlg-peek .dlg-avatar-badge {
  position: absolute; right: -2px; bottom: -2px;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid var(--panel); background-color: var(--panel);
  box-sizing: border-box; object-fit: cover; display: block;
}
.dlg-peek-who { flex: 1; min-width: 0; }
.dlg-peek-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dlg-peek-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; display: flex; align-items: center; gap: 5px; }
.dlg-peek-live { width: 6px; height: 6px; border-radius: 50%; background: var(--dlg-accent); flex-shrink: 0; }
.dlg-peek-close {
  width: 26px; height: 26px; padding: 0; border-radius: 50%; border: none;
  background: transparent; color: var(--text-dim); cursor: pointer;
  font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dlg-peek-close:hover { background: var(--panel-2); color: var(--text); }

.dlg-peek-text {
  margin: 10px 0 12px;
  background: var(--panel-2);
  border-radius: 14px 14px 14px 4px;
  padding: 9px 12px;
  font-size: 13px; line-height: 1.45;
}



.dlg-peek-text-in {


  white-space: normal;
  overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dlg-peek-actions { display: flex; gap: 8px; }
.dlg-peek-actions button {
  border: none; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 600; padding: 8px 14px;
  transition: background .12s, filter .12s, transform .12s;
}
.dlg-peek-actions button:active { transform: scale(.97); }
.dlg-peek-reply { flex: 1; background: var(--accent); color: #fff; }
.dlg-peek-reply:hover { filter: brightness(1.15); }
.dlg-peek-later { background: var(--panel-2); color: var(--text); }
.dlg-peek-later:hover { background: var(--accent-soft); }
.dlg-peek-more { font-size: 11.5px; color: var(--text-dim); margin-top: 9px; text-align: center; }
.dlg-peek-more[hidden] { display: none; }
.dlg-peek-more b { color: var(--dlg-accent); font-weight: 700; }


.dlg-peek-timer { position: absolute; left: 18px; right: 18px; bottom: 0; height: 2px; border-radius: 2px; overflow: hidden; }
.dlg-peek-timer i { display: block; height: 100%; background: var(--dlg-accent); opacity: .5; transform-origin: left; transform: scaleX(0); }
.dlg-peek.show .dlg-peek-timer i { animation: dlgPeekTimer 8s linear forwards; }
.dlg-peek:hover .dlg-peek-timer i { animation-play-state: paused; }
@keyframes dlgPeekTimer { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media not all and (min-width: 861px) and (hover: hover) and (pointer: fine) {
  .dlg-peek { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .dlg-peek, .dlg-peek.show { transition: none; }
}










body.order-create-open { overflow: hidden; }


body.order-create-open .mobile-menu-btn { display: none !important; }
.order-create-layer {
  position: fixed; inset: 0; z-index: 45;
  background: rgba(16, 17, 20, 0.35);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: modal-backdrop-in var(--dur-in) var(--ease-out) backwards;
}
.order-create-dialog {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  width: min(780px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 20px 60px rgba(16, 17, 20, 0.25);
  animation: modal-in .26s var(--ease-spring) backwards;
}
.order-create-body { padding: 0 26px; }
.order-create-loading { padding: 48px 0; text-align: center; color: var(--text-dim); font-size: 14px; }

.order-create-dialog .topbar {
  position: sticky; top: 0; z-index: 3;
  background: var(--panel);
  margin: 0 -26px 6px;
  padding: 20px 26px 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: nowrap;
  align-items: flex-start;
}
.order-create-dialog .topbar h2 { font-size: 20px; }
.order-create-x {
  flex-shrink: 0;
  width: 34px; height: 34px; padding: 0;
  border: none; border-radius: 50%;
  background: var(--panel-2); color: var(--text);
  font-size: 15px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.order-create-x:hover { background: var(--accent-soft); }


.order-create-dialog .section {
  background: none; border: none; box-shadow: none;
  padding: 0; margin: 0;
  max-width: none !important;
  overflow: visible;
}

.order-create-dialog .section > .modal-actions:last-child {
  position: sticky; bottom: 0; z-index: 3;
  background: var(--panel);
  margin: 18px -26px 0 !important;
  padding: 14px 26px 18px;
  border-top: 1px solid var(--border);
}

@media (max-width: 640px) {
  .order-create-layer { padding: 0; }
  .order-create-dialog {
    width: 100%;
    height: 100vh; height: 100dvh;
    max-height: none;
    border: none; border-radius: 0;
  }
  .order-create-body { padding: 0 16px; }
  .order-create-dialog .topbar { margin: 0 -16px 6px; padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px; }
  .order-create-dialog .section > .modal-actions:last-child {
    margin: 18px -16px 0 !important;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }
}
@media (prefers-reduced-motion: reduce) {
  .order-create-layer, .order-create-dialog { animation: none; }
}








:root { --story-ink: #ffffff; }
:root[data-theme="dark"] { --story-ink: #ffffff; }
.modal.story-modal { width: min(860px, 94vw); }
.story-editor { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 24px; align-items: start; }
.story-form > label:first-child { margin-top: 0; }
.story-no-channel {
  font-size: 12.5px; line-height: 1.45; padding: 10px 12px; border-radius: 10px;
  background: var(--yellow-soft); color: var(--yellow-ink);
}
.story-warning {
  font-size: 12.5px; padding: 8px 10px; border-radius: 8px; margin-bottom: 10px;
  background: var(--yellow-soft); color: var(--yellow-ink);
}
.story-counter { font-size: 11.5px; color: var(--text-dim); text-align: right; margin-top: 4px; }
.story-counter.over { color: var(--red-ink); font-weight: 700; }
.story-photo-box { min-height: 64px; border-radius: 12px; }
.story-photo-box.photo-drop { outline: 2px dashed var(--dlg-accent); outline-offset: 2px; }
.story-photo-tile { position: relative; width: 84px; height: 150px; border-radius: 10px; overflow: hidden; background: #000; }
.story-photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-photo-tile button {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%;
  border: none; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; cursor: pointer; padding: 0;
}
.story-badge {
  display: inline-block; margin-right: 6px; padding: 1px 7px; border-radius: 999px;
  font-size: 11px; font-weight: 700; background: var(--pastel-blue-bg); color: var(--pastel-blue-text);
  vertical-align: 1px;
}

.story-preview-col { position: sticky; top: 0; }
.story-phone {
  position: relative; width: 270px; aspect-ratio: 9 / 16; margin: 0 auto;
  border-radius: 26px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 6px #1c1c1e, 0 18px 40px rgba(0, 0, 0, .28);
  color: #fff; font-size: 12px;
}

.story-bg { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px) brightness(.55); }
.story-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.story-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; color: rgba(255, 255, 255, .55); font-size: 12.5px; line-height: 1.5; padding: 20px;
}

.story-empty[hidden], .story-img[hidden], .story-caption[hidden] { display: none; }
.story-top { position: absolute; top: 0; left: 0; right: 0; padding: 8px 10px 18px; background: linear-gradient(rgba(0,0,0,.45), transparent); }


.story-progress { height: 2.5px; border-radius: 2px; background: #6e6e73; overflow: hidden; }
.story-progress i { display: block; width: 38%; height: 100%; background: var(--story-ink); }
.story-head { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.story-ava {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.9);
}
.story-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.story-who b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-who span { font-size: 10.5px; opacity: .75; }
.story-head-icons { margin-left: auto; opacity: .9; font-size: 13px; letter-spacing: 1px; }
.story-caption {
  position: absolute; left: 0; right: 0; bottom: 48px; padding: 30px 14px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  font-size: 12.5px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere;
}
.story-bottom { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.story-reply { flex: 1; border: 1px solid rgba(255,255,255,.45); border-radius: 999px; padding: 7px 12px; font-size: 11.5px; opacity: .85; }
.story-notes { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.story-note { font-size: 11.5px; line-height: 1.4; padding: 6px 9px; border-radius: 8px; }
.story-note.ok { background: var(--panel-2); color: var(--text-dim); }
.story-note.warn { background: var(--yellow-soft); color: var(--yellow-ink); }
.story-note.bad { background: var(--red-soft); color: var(--red-ink); }
@media (max-width: 760px) {
  .story-editor { grid-template-columns: minmax(0, 1fr); }
  .story-preview-col { position: static; order: -1; }
  .story-phone { width: 220px; }
}




.modal.story-queue-modal { width: min(980px, 94vw); }
.story-queue-modal #sq-channel { margin-bottom: 4px; }
.sq-folder { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); }
.sq-folder-head { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.sq-folder-path { font-weight: 700; overflow-wrap: anywhere; }
.sq-folder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sq-times { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0; }
.sq-times-label { font-size: 13px; font-weight: 700; }
.sq-time {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px;
  background: var(--accent-soft); font-size: 13px; font-weight: 700;
}
.sq-time button { border: none; background: transparent; color: var(--text-dim); cursor: pointer; padding: 0 4px; font-size: 11px; }
.sq-time button:disabled { visibility: hidden; }
.sq-times input[type="time"] { width: auto; margin: 0; padding: 5px 8px; }
.sq-also { margin-top: -4px; }
.sq-also-item {
  display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); font-size: 13px; font-weight: 600; cursor: pointer;
}
.sq-also-item.on { background: var(--accent-soft); border-color: var(--accent-soft); }
.sq-also-item input { width: auto; margin: 0; }
.sq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; }
.sq-card { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sq-phone {
  position: relative; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #111;
  box-shadow: 0 0 0 3px #1c1c1e; cursor: pointer;
}
.sq-phone-bg { position: absolute; inset: -12px; background-size: cover; background-position: center; filter: blur(10px) brightness(.55); }
.sq-phone img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sq-phone-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--text-dim); }
.sq-phone-caption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 6px; font-size: 9.5px; line-height: 1.3;
  color: var(--story-ink); background: linear-gradient(transparent, rgba(0,0,0,.7));
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sq-when { font-size: 12.5px; margin-top: 4px; }
.sq-file { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 14px; }
.sq-state { font-size: 11px; font-weight: 700; color: var(--text-dim); }
.sq-state.failed { color: var(--red-ink); }
.sq-state.scheduled { color: var(--green-ink); }
.sq-actions { display: flex; gap: 4px; }
.sq-actions button {
  flex: 1; min-width: 0; border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 4px 0; cursor: pointer; font-size: 12px;
}
.sq-actions button:disabled { opacity: .35; cursor: default; }
.sq-card.failed .sq-phone { box-shadow: 0 0 0 3px var(--red); }
.sq-empty { padding: 28px 16px; text-align: center; color: var(--text-dim); font-size: 13px; border: 1px dashed var(--border); border-radius: 14px; }








.cnt-page { container-type: inline-size; container-name: cnt; }


.cnt-view { container-type: inline-size; container-name: cnt; }
.cnt-scroll-x { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.cnt-scroll-x::-webkit-scrollbar { display: none; }
.cnt-page .segmented { display: inline-flex; background: var(--panel-2); padding: 3px; border-radius: 10px; gap: 2px; white-space: nowrap; }
.cnt-page .segmented button {
  border: none; background: transparent; padding: 7px 14px; border-radius: 8px;
  font-weight: 600; font-size: 13px; color: var(--text-dim); cursor: pointer; font-family: inherit;
}
.cnt-page .segmented button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.cnt-tabs { margin-bottom: 14px; }
.cnt-subtabs { margin-bottom: 16px; }
.cnt-subtabs .segmented button { padding: 6px 12px; font-size: 12.5px; }

.cnt-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cnt-title { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin: 0; color: var(--text); }
.cnt-sub { font-size: 13px; color: var(--text-dim); margin-top: 3px; }
.cnt-head-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.cnt-head-actions .btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.cnt-add-plus { font-size: 17px; line-height: 1; font-weight: 700; }
.cnt-icon-btn { width: 38px; justify-content: center; padding-left: 0; padding-right: 0; font-size: 17px; letter-spacing: 1px; }

.cnt-view .chip-group { display: flex; gap: 6px; flex-wrap: nowrap; }
.cnt-view .chip {
  border: 1px solid var(--border); background: var(--panel); padding: 6px 13px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; color: var(--text-dim); white-space: nowrap; font-family: inherit;
}
.cnt-view .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cnt-filters { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.cnt-filter-sep { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }
.cnt-select-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; max-width: 240px; }

.cnt-view label.chip { margin: 0; line-height: normal; }
.cnt-select-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.cnt-select-chip select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 16px; }


.cnt-list { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.cnt-day {
  display: flex; justify-content: space-between; gap: 10px; padding: 9px 18px 7px;
  font-size: 12px; font-weight: 700; color: var(--text-dim); background: var(--panel-2); border-top: 1px solid var(--border);
}
.cnt-list > .cnt-day:first-child { border-top: none; border-radius: 18px 18px 0 0; }
.cnt-section {
  padding: 14px 18px 6px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  color: var(--text-dim); border-top: 1px solid var(--border);
}
.cnt-post {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 11px 12px 11px 18px; border-top: 1px solid var(--border); cursor: pointer; transition: background-color .12s ease;
}
.cnt-day + .cnt-post { border-top: none; }
.cnt-post:hover { background: var(--panel-2); }
.cnt-post-thumb {
  width: 56px; height: 56px; border-radius: 12px; overflow: hidden; background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; color: var(--text-dim); font-size: 13px;
}
.cnt-post-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cnt-post-main { min-width: 0; }
.cnt-post-text {
  font-size: 13.5px; line-height: 1.4; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cnt-post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 5px; font-size: 12px; color: var(--text-dim); min-width: 0; }
.cnt-project { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt-project i { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cnt-meta-sep { opacity: .6; }
.cnt-meta-dim { color: var(--text-dim); }
.cnt-meta-warn { color: var(--yellow-ink); }
.cnt-post-meta .quick-groups-dd > summary { font-size: 12px; padding: 2px 8px; border-radius: 999px; max-width: 240px; color: var(--text); }
.cnt-post-meta .mock-tag { margin-left: 0; }
.cnt-post-warn { margin-top: 5px; font-size: 12px; color: var(--red-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt-post-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cnt-post-time { font-size: 13px; font-weight: 700; color: var(--text); min-height: 16px; }
.cnt-post-actions { display: flex; gap: 6px; opacity: 0; transition: opacity .12s ease; }
.cnt-post:hover .cnt-post-actions, .cnt-post:focus-within .cnt-post-actions { opacity: 1; }

@media (hover: none) { .cnt-post-actions { opacity: 1; } }
.cnt-act {
  width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--panel);
  cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; color: var(--text);
}
.cnt-act:hover { background: var(--panel-2); }
.cnt-act.ok { color: var(--green-ink); font-weight: 800; }
.cnt-empty { padding: 34px 18px; text-align: center; color: var(--text-dim); font-size: 13.5px; }


.cnt-menu { min-width: 250px; }
.cnt-menu-label { display: flex; flex-direction: column; text-align: left; line-height: 1.25; }
.cnt-menu-label small { font-size: 11.5px; color: var(--text-dim); font-weight: 500; }


.cnt-cal-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.cnt-cal-nav { display: flex; align-items: center; gap: 6px; }
.cnt-cal-nav .cnt-act { font-size: 18px; }
.cnt-cal {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 10px;
}
.cnt-cal-head { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0 2px; }
.cnt-cal-head.weekend { color: var(--red-ink); opacity: .75; }
.cnt-cal-cell {
  min-height: 104px; min-width: 0; border-radius: 12px; background: var(--panel-2); padding: 6px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background-color .12s ease, box-shadow .12s ease;
}
.cnt-cal-cell:hover { box-shadow: inset 0 0 0 1px var(--border); }
.cnt-cal-cell.empty { background: transparent; cursor: default; box-shadow: none; }
.cnt-cal-cell.past { opacity: .72; }
.cnt-cal-cell.today { background: var(--panel); box-shadow: inset 0 0 0 2px var(--accent-ink); }
.cnt-cal-num { font-size: 12.5px; font-weight: 700; color: var(--text-dim); }
.cnt-cal-cell.today .cnt-cal-num { color: var(--text); }
.cnt-cal-posts { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cnt-cal-post {
  font-size: 11.5px; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: var(--panel);
  border-left: 3px solid var(--project, var(--gray)); color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.cnt-cal-post b { font-weight: 700; }
.cnt-cal-post:hover { box-shadow: var(--shadow); }
.cnt-cal-post.published { color: var(--text-dim); }
.cnt-cal-post.draft { background: transparent; border-style: dashed; border-width: 1px 1px 1px 3px; border-color: var(--border); border-left-color: var(--project, var(--gray)); }
.cnt-cal-post.failed { background: var(--red-soft); color: var(--red-ink); }
.cnt-cal-more { font-size: 11px; color: var(--text-dim); padding-left: 4px; }
.cnt-cal-dots { display: none; gap: 3px; flex-wrap: wrap; }
.cnt-cal-dots i { width: 6px; height: 6px; border-radius: 50%; }
.cnt-cal-agenda { display: none; margin-top: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.cnt-cal-agenda > .cnt-day:first-child { border-top: none; }
.cnt-agenda-row {
  display: grid; grid-template-columns: 42px 8px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 10px 14px; border-top: 1px solid var(--border); cursor: pointer; font-size: 13px;
}
.cnt-day + .cnt-agenda-row { border-top: none; }
.cnt-agenda-row i { width: 8px; height: 8px; border-radius: 50%; }
.cnt-agenda-time { font-weight: 700; }
.cnt-agenda-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


.cnt-projects { display: flex; flex-direction: column; gap: 14px; }
.cnt-project-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.cnt-project-head { display: flex; align-items: flex-start; gap: 10px; }
.cnt-project-dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.cnt-project-name { flex: 1; min-width: 0; }
.cnt-project-name h3 { margin: 0; font-size: 16px; font-weight: 800; overflow-wrap: anywhere; }
.cnt-project-desc { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; }
.cnt-project-actions { display: flex; gap: 6px; flex-shrink: 0; }
.cnt-project-actions .cnt-icon-btn { width: 32px; height: 32px; }
.cnt-project-photos { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin: 10px 0 12px 22px; font-size: 12.5px; color: var(--text-dim); }
.cnt-project-photos .link-btn { font-size: 12.5px; font-weight: 700; }
.cnt-channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cnt-channel { background: var(--panel-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cnt-channel-head { display: flex; align-items: center; gap: 9px; min-width: 0; }
.cnt-channel-icon { position: relative; width: 30px; height: 30px; flex-shrink: 0; }
.cnt-channel-icon img { width: 30px; height: 30px; border-radius: 50%; display: block; }
.cnt-channel-story { position: absolute; right: -5px; bottom: -4px; font-size: 12px; }
.cnt-channel-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cnt-channel-name b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnt-channel-name span { font-size: 11.5px; color: var(--text-dim); }
.cnt-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0; }
.cnt-status.ok { background: var(--green-soft); color: var(--green-ink); }
.cnt-status.bad { background: var(--red-soft); color: var(--red-ink); }
.cnt-status.dim { background: var(--gray-soft); color: var(--text-dim); }
.cnt-channel-addr { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cnt-channel-err { font-size: 12px; color: var(--red-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cnt-channel-note { font-size: 11.5px; color: var(--yellow-ink); }
.cnt-channel-actions { display: flex; gap: 6px; margin-top: auto; padding-top: 4px; }
.cnt-channel-actions .btn { flex: 1; }
.cnt-channel-add {
  border: 1.5px dashed var(--border); background: transparent; border-radius: 14px; min-height: 96px;
  color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.cnt-channel-add:hover { color: var(--text); border-color: var(--text-dim); }
.cnt-section-title { margin: 26px 0 10px; font-size: 11px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--text-dim); }
.cnt-service { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.cnt-service .section { margin: 0; }


@container cnt (max-width: 760px) {
  .cnt-sub { display: none; }
  .cnt-btn-text { display: none; }
  .cnt-head-actions .btn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; }
  .cnt-add-plus { font-size: 22px; }
  .cnt-post { grid-template-columns: 52px minmax(0, 1fr) auto; }
  .cnt-post-thumb { width: 52px; height: 52px; }
  .cnt-post-actions { grid-column: 3; opacity: 1; }
  .cnt-post-side { grid-column: 2; grid-row: 2; flex-direction: row; align-items: center; gap: 8px; }
  .cnt-post-thumb { grid-row: span 2; align-self: start; }
  .cnt-post-main { grid-column: 2; grid-row: 1; }
  .cnt-post-actions { grid-row: 1 / span 2; align-self: center; }
}


@container cnt (max-width: 520px) {
  .cnt-title { font-size: 20px; }
  .cnt-tabs .segmented, .cnt-subtabs .segmented { display: flex; }
  .cnt-tabs .segmented button, .cnt-subtabs .segmented button { flex: 1; }
  .cnt-list { border-radius: 16px; }
  .cnt-day { padding: 9px 14px 7px; }
  .cnt-post { padding: 12px 12px 12px 14px; gap: 10px; column-gap: 12px; }
  .cnt-post-text { -webkit-line-clamp: 3; }
  .cnt-post-actions { flex-direction: column; }
  .cnt-act { width: 30px; height: 30px; }
  .cnt-project { max-width: 150px; }
  .cnt-post-meta .quick-groups-dd > summary { max-width: 150px; }
  .cnt-project-card { padding: 14px; border-radius: 16px; }
  .cnt-project-photos { margin-left: 0; }
  .cnt-channels { grid-template-columns: minmax(0, 1fr); }
  .cnt-channel-add { min-height: 48px; }
}

@container cnt (max-width: 640px) {
  .cnt-cal { gap: 4px; padding: 8px; }
  .cnt-cal-cell { min-height: 54px; padding: 5px; align-items: center; }
  .cnt-cal-posts, .cnt-cal-more { display: none; }
  .cnt-cal-dots { display: flex; justify-content: center; }
  .cnt-cal-agenda { display: block; }
  .cnt-cal-title { gap: 8px; }
  .cnt-cal-nav .btn { padding: 6px 10px; }
}



.vkw-steps { margin: 6px 0 10px; padding-left: 20px; display: flex; flex-direction: column; gap: 14px; font-size: 13.5px; line-height: 1.45; }
.vkw-steps textarea { width: 100%; font-size: 12.5px; }
.vkw-page { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--panel-2); margin: 8px 0 12px; }
.vkw-page img, .vkw-page-ava { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; object-fit: cover; }
.vkw-page-ava { display: flex; align-items: center; justify-content: center; background: var(--accent-soft); font-weight: 800; font-size: 18px; }






.plan-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 14px; }
.plan-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.plan-label { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.plan-hint { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
.plan-sum { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.plan-sum small { font-size: 16px; font-weight: 700; color: var(--text-dim); }
.plan-state { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.plan-state.go { background: var(--yellow-soft); color: var(--yellow-ink); }
.plan-state.done { background: var(--green-soft); color: var(--green-ink); }
.plan-bar { height: 12px; border-radius: 999px; background: var(--panel-2); margin: 14px 0 8px; overflow: hidden; }
.plan-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.plan-bar.done i { background: var(--green); }
.plan-bar-thin { height: 6px; margin: 5px 0 3px; }
.plan-formula { margin-top: 10px; font-size: 13px; }
.plan-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-dim); margin-top: 14px; }
.plan-meta b { color: var(--text); }
.plan-rule, .plan-me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 12px; }
.plan-rule-item { background: var(--panel-2); border-radius: 14px; padding: 12px 14px; }
.plan-rule-item .plan-label { margin-bottom: 4px; }
.plan-rule-item b { font-size: 18px; }
.plan-me-grid .plan-rule-item b { font-size: 20px; }
.plan-plus { color: var(--green-ink); }
.plan-dim { color: var(--text-dim); font-weight: 600; }
.plan-week-nav button[data-plan-week="0"] { min-width: 150px; }

.plan-list { padding: 0; overflow: hidden; }
.plan-head, .plan-row { display: grid; gap: 10px; align-items: center; padding: 10px 18px; }
.plan-list-admin .plan-head, .plan-list-admin .plan-row { grid-template-columns: minmax(170px, 2.2fr) repeat(6, minmax(0, 1fr)); gap: 8px; }
.plan-list-team .plan-head, .plan-list-team .plan-row { grid-template-columns: 28px minmax(0, 1fr) minmax(90px, auto) minmax(80px, auto); }
.plan-head { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; background: var(--panel-2); }
.plan-head .num { text-align: right; }
.plan-row { border-top: 1px solid var(--border); font-size: 13.5px; }
.plan-list-admin .plan-row { cursor: pointer; }
.plan-list-admin .plan-row:hover { background: var(--panel-2); }
.plan-row .num { text-align: right; font-weight: 700; white-space: nowrap; }
.plan-row.me { background: var(--accent-soft); }
.plan-place { font-weight: 800; color: var(--text-dim); text-align: center; }
.plan-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plan-name .fin-avatar { width: 30px; height: 30px; font-size: 12px; }
.plan-name-text { min-width: 0; flex: 1; }
.plan-name-text b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-note { display: block; font-size: 11.5px; color: var(--text-dim); font-weight: 500; }
.plan-left.owe { color: var(--orange-ink); }
.plan-left.over { color: var(--red-ink); }
.plan-left.ok { color: var(--green-ink); }
.plan-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--panel-2); font-size: 13.5px; }
.plan-foot b { font-size: 15px; }


.plan-fill-body { display: block; }
.plan-fill-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 120px; gap: 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--border); }
.plan-fill-sum { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--text-dim); }
.plan-fill-sum input { width: 100%; }
.plan-fill-total { text-align: right; padding-top: 12px; font-size: 14px; }
.plan-fill-total b { font-size: 17px; }


.plan-salary-hint { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel-2); font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.plan-salary-hint[hidden] { display: none; }
.plan-salary-hint b { color: var(--text); }

@container fin (max-width: 760px) {
  .plan-head { display: none; }
  .plan-list-admin .plan-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }

  .plan-list-admin .plan-row > :nth-child(n+2):not(:nth-child(7)) { display: none; }
  .plan-list-team .plan-row { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .plan-list-team .plan-row > :nth-child(4) { display: none; }
  .plan-sum { font-size: 24px; }
  .plan-card { padding: 14px 16px; }
  .plan-week-nav button[data-plan-week="0"] { min-width: 0; }

  .plan-rule { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .plan-rule-item { padding: 10px; }
  .plan-rule-item b { font-size: 15px; white-space: nowrap; }
  .plan-rule-item .plan-label { font-size: 10px; }
  .plan-rule-item .plan-hint { display: none; }
  .plan-me-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .plan-me-grid .plan-rule-item b { font-size: 17px; }
}
@media (max-width: 560px) {
  .plan-fill-row { grid-template-columns: 1fr 1fr; }
  .plan-fill-who { grid-column: 1 / -1; }
}





.wk-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.wk-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 20px 22px; min-width: 0; }
.wk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.wk-label { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; }
.wk-hint { font-size: 12px; color: var(--text-dim); }
.wk-sum { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.1; }
.wk-sum small { font-size: 16px; font-weight: 700; color: var(--text-dim); letter-spacing: 0; }
.wk-pill { font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; white-space: nowrap; background: var(--yellow-soft); color: var(--yellow-ink); }
.wk-pill.done { background: var(--green-soft); color: var(--green-ink); }
.wk-bar { position: relative; height: 14px; border-radius: 999px; background: var(--panel-2); margin: 16px 0 26px; }
.wk-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); transition: width .5s ease; }
.wk-bar.done i { background: var(--green); }
.wk-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; border-radius: 2px; background: var(--text-dim); }
.wk-tick span { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; color: var(--text-dim); white-space: nowrap; }
.wk-tick-end { left: calc(100% - 2px); }
.wk-tick-end span { left: auto; right: 0; transform: none; }
.wk-goal { font-size: 14px; color: var(--text-dim); line-height: 1.45; }
.wk-goal b { color: var(--text); }
.wk-goal .plus, .wk-stat .plus { color: var(--green-ink); }
.wk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.wk-stat { background: var(--panel-2); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.wk-stat b { display: block; font-size: 20px; margin-top: 4px; white-space: nowrap; }
.wk-stat b.dim { color: var(--text-dim); }
.wk-stat small { display: block; font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.lb-list { margin-top: 10px; }
.lb-row { display: grid; grid-template-columns: 22px 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; }
.lb-row.me { background: var(--accent-soft); }
.lb-place { font-weight: 800; color: var(--text-dim); text-align: center; font-size: 13px; }
.fin-avatar.lb-ava { width: 30px; height: 30px; font-size: 12px; }
.lb-name { min-width: 0; }
.lb-name b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-name b em { font-style: normal; font-size: 12px; margin-left: 5px; }
.lb-mini { display: block; height: 5px; border-radius: 999px; background: var(--panel-2); margin-top: 5px; overflow: hidden; }
.lb-row.me .lb-mini { background: var(--panel); }
.lb-mini i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.lb-mini i.done { background: var(--green); }
.lb-sum { font-weight: 800; font-size: 13.5px; white-space: nowrap; text-align: right; }
.lb-sum small { display: block; font-size: 11px; font-weight: 600; color: var(--green-ink); }
.lb-last { margin-top: 10px; font-size: 13px; color: var(--text-dim); background: var(--panel-2); border-radius: 12px; padding: 9px 12px; }
.lb-last b { color: var(--text); }
.team-goal { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.team-goal-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--text-dim); }
.team-goal-line b { color: var(--text); }
.team-goal .wk-bar { height: 8px; margin: 8px 0 0; }

.bd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bd-head h3 { margin: 0; }
.bd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.bd { position: relative; background: var(--panel-2); border-radius: 16px; padding: 14px; text-align: center; min-width: 0; }
.bd-ico { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; background: var(--panel); box-shadow: var(--shadow); }
.bd b { display: block; font-size: 13.5px; }
.bd small { display: block; font-size: 11.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.bd-count { position: absolute; top: 10px; right: 10px; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--panel); color: var(--text); }
.bd.locked .bd-ico { filter: grayscale(1); opacity: .45; box-shadow: none; }
.bd.locked b { color: var(--text-dim); }
.bd.new { box-shadow: 0 0 0 2px var(--green) inset; }
.bd.new .bd-count { background: var(--green); color: var(--panel); }
.bd-next { margin-top: 12px; font-size: 13px; color: var(--text-dim); background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.bd-next b { color: var(--text); }


.modal.cheer-modal { width: min(380px, 92vw); }
.cheer-card { text-align: center; padding: 10px 4px 2px; }
.cheer-ico { font-size: 56px; line-height: 1; }
.cheer-card h3 { margin: 12px 0 6px; font-size: 20px; }
.cheer-card p { margin: 0; color: var(--text-dim); font-size: 14px; line-height: 1.45; }
.cheer-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.cheer-badges span { font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--green-soft); color: var(--green-ink); }
.cheer-card .btn { margin-top: 18px; width: 100%; }

@media (max-width: 1100px) { .wk-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .wk-card { padding: 16px; }
  .wk-sum { font-size: 28px; }
  .wk-stats { grid-template-columns: 1fr 1fr; }
  .wk-stats .wk-stat:last-child { grid-column: 1 / -1; }
  .bd-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}




.fin-head-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.imp-hint { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.45; }
.imp-result:empty, .imp-history:empty { display: none; }
.imp-sub { font-size: 11.5px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.imp-line { font-size: 13.5px; padding: 9px 12px; border-radius: 12px; background: var(--panel-2); margin-top: 6px; line-height: 1.45; }
.imp-line.ok { background: var(--green-soft); color: var(--green-ink); }
.imp-line.warn { background: var(--yellow-soft); color: var(--yellow-ink); }
.imp-line details { margin-top: 4px; }
.imp-line summary { cursor: pointer; font-size: 12.5px; }
.imp-list { max-height: 180px; overflow-y: auto; font-size: 12px; margin-top: 4px; color: var(--text); }
.imp-err { font-size: 13.5px; padding: 9px 12px; border-radius: 12px; background: var(--red-soft, var(--panel-2)); color: var(--red-ink); }
.imp-history { border-top: 1px solid var(--border); padding-top: 12px; }
.imp-batch { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; font-size: 13px; }
.imp-batch + .imp-batch { border-top: 1px solid var(--border); }
.imp-batch small { display: block; color: var(--text-dim); font-size: 11.5px; margin-top: 2px; }
@media (max-width: 560px) { .fin-import { padding-left: 12px; padding-right: 12px; } }










.login-stage {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: minmax(500px, 600px) minmax(0, 1fr); gap: 16px;
  padding: 16px;
  overflow-x: hidden; overflow-y: auto;
}
.login-stage .ls-left { display: flex; flex-direction: column; min-height: 0; padding: 20px 44px 0 52px; }


.login-stage .lg-top { display: contents; }
.login-stage .lg-brand { display: flex; align-items: center; gap: 10px; font: 800 19px var(--v-display); letter-spacing: -.01em; color: var(--v-strong); margin-bottom: clamp(20px, 9vh, 104px); }
.login-stage .login-pill { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 13px; border-radius: 999px; background: var(--v-g-soft); color: var(--v-g-text); font: 700 13px var(--v-font); }
.login-stage .login-pill span { width: 7px; height: 7px; border-radius: 50%; background: var(--v-g-dot); position: relative; }
.login-stage .login-pill span::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; background: var(--v-g-dot); opacity: .25; animation: ls-ping 2.4s ease-out infinite; }
@keyframes ls-ping { from { transform: scale(.6); opacity: .45; } to { transform: scale(1.9); opacity: 0; } }
.login-stage .ls-title { font: 800 44px/1.08 var(--v-display); letter-spacing: -.025em; color: var(--v-strong); margin: 18px 0 0; }
.login-stage .ls-title-end { display: block; }


.login-stage .ls-rot { display: grid; color: var(--v-accent); overflow: hidden; }
.login-stage .ls-rot b { grid-area: 1 / 1; font-weight: 800; opacity: 0; transform: translateY(70%); transition: transform .6s var(--v-ease), opacity .45s ease; }
.login-stage .ls-rot b.on { opacity: 1; transform: none; }
.login-stage .ls-rot b.off { opacity: 0; transform: translateY(-70%); }
.login-stage .ls-live { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.login-stage .ls-live > span { height: 40px; padding: 0 14px; border-radius: 13px; background: var(--v-card); box-shadow: var(--v-card-shadow); display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--v-font); color: var(--v-muted); }
.login-stage .ls-live b { font: 800 15px var(--v-display); color: var(--v-strong); display: inline-block; }
.login-stage .ls-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--v-g-dot); }
.login-stage .ls-card-wrap { margin-top: 24px; animation: ls-card-in .7s var(--v-ease) both; }
.login-stage .login-card { width: min(480px, 100%); }
@keyframes ls-card-in { from { opacity: 0; transform: translateY(18px); } }
.login-stage .lg-legal { margin-top: auto; padding: 20px 0 10px; font-size: 12px; color: var(--v-muted); }


.login-stage .lg-steps { margin-bottom: 18px; }
.login-stage .lg-steps[hidden] { display: none; }
.login-stage .lg-steps-bar { display: flex; gap: 6px; }
.login-stage .lg-steps-bar i { flex: 1; height: 4px; border-radius: 2px; background: var(--v-soft); transition: background-color .35s ease; }
.login-stage .lg-steps[data-step="1"] i:nth-child(1), .login-stage .lg-steps[data-step="2"] i:nth-child(2), .login-stage .lg-steps[data-step="3"] i:nth-child(3) { background: var(--v-accent); }
.login-stage .lg-steps[data-step="2"] i:nth-child(1), .login-stage .lg-steps[data-step="3"] i:nth-child(1), .login-stage .lg-steps[data-step="3"] i:nth-child(2) { background: var(--v-ink); }
.login-stage .lg-steps-lbl { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font: 700 11.5px var(--v-font); letter-spacing: .02em; color: var(--v-muted); }
.login-stage .lg-steps-lbl b { color: var(--v-strong); font-weight: 700; }
.login-stage .ls-step-in { animation: ls-step-in .4s var(--v-ease) both; }
@keyframes ls-step-in { from { opacity: 0; transform: translateX(14px); } }
.login-stage .lg-step-title { font: 800 18px var(--v-display); color: var(--v-strong); margin: 0 0 16px; }
.login-stage .lg-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.login-stage .ls-field { position: relative; }
#login-screen .login-stage .ls-field input { padding-left: 46px; }
.login-stage .ls-field svg { position: absolute; left: 16px; top: 17px; width: 18px; height: 18px; color: var(--v-muted); pointer-events: none; transition: color .2s; }
.login-stage .ls-field input:focus + svg { color: var(--v-accent); }
.login-stage .ls-label { display: inline-flex; align-items: center; gap: 9px; }
.login-stage .ls-arrow { display: inline-block; transition: transform .2s var(--v-ease); }
.login-stage .btn:hover .ls-arrow { transform: translateX(4px); }
.login-stage .ls-loading { position: relative; pointer-events: none; }
.login-stage .ls-loading .ls-label { opacity: 0; }
.login-stage .ls-loading::before { content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: ls-spin .7s linear infinite; }
@keyframes ls-spin { to { transform: rotate(360deg); } }
.login-stage .ls-ya { width: 22px; height: 22px; border-radius: 50%; background: #FC3F1D; color: #fff; display: inline-grid; place-items: center; font: 800 12px var(--v-display); flex: none; }
.login-stage .ls-code-hint { font-size: 13.5px; line-height: 1.5; color: var(--v-muted); margin: 0 0 16px; overflow-wrap: anywhere; }
.login-stage .ls-code-hint b { color: var(--v-strong); }
.login-stage .ls-cells { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
#login-screen .login-stage .ls-cells input[inputmode] { height: 60px; padding: 0; margin: 0; text-align: center; font: 800 24px var(--v-display); box-shadow: inset 0 0 0 1px var(--v-chip-ring); }
#login-screen .login-stage .ls-cells input.filled { background: var(--v-card); box-shadow: inset 0 0 0 1.5px var(--v-bar2); }
#login-screen .login-stage .ls-cells input[inputmode]:focus { background: var(--v-card); box-shadow: inset 0 0 0 2px var(--v-accent); }
#login-screen .login-stage .ls-cells.is-err input[inputmode] { background: var(--v-r-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--v-r-text) 35%, transparent); }
#login-screen .login-stage .ls-cells.is-err input[inputmode]:focus { box-shadow: inset 0 0 0 2px var(--v-accent); }
.login-stage .ls-shake { animation: ls-shake .4s ease; }
@keyframes ls-shake { 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.login-stage .ls-resend { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; font: 600 13px var(--v-font); color: var(--v-muted); }
.login-stage .ls-link { display: inline-flex; align-items: center; min-height: 40px; padding: 4px 0; border: 0; background: none; cursor: pointer; font: 700 13px var(--v-font); color: var(--v-text2); }
.login-stage .ls-link:hover { color: var(--v-strong); }

.login-stage .ls-2fa-vk { margin: 0 0 12px; min-height: 40px; }
.login-stage .ls-2fa-vk > * { width: 100% !important; }
.login-stage .ls-2fa-wait { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 10px 14px; border-radius: 14px; background: var(--v-soft); font: 600 13.5px var(--v-font); color: var(--v-text2); }
.login-stage .ls-2fa .ls-resend { margin-bottom: 0; }
.login-stage .ls-typing { display: inline-flex; gap: 4px; flex: none; }
.login-stage .ls-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--v-accent); animation: ls-tdot 1.2s ease-in-out infinite; }
.login-stage .ls-typing i:nth-child(2) { animation-delay: .15s; }
.login-stage .ls-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ls-tdot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

.login-stage .ls-check { width: 56px; height: 56px; border-radius: 18px; background: var(--v-g-soft); color: var(--v-g-text); display: grid; place-items: center; margin-bottom: 14px; animation: ls-pop .5s var(--v-spring) both; }
.login-stage .ls-check svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.login-stage .ls-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: ls-draw .4s ease .25s forwards; }
@keyframes ls-pop { from { transform: scale(.4); opacity: 0; } }
@keyframes ls-draw { to { stroke-dashoffset: 0; } }
.login-stage .ls-success .lg-hint { margin-bottom: 0; }
.login-stage .ls-bar { height: 6px; border-radius: 3px; background: var(--v-soft); overflow: hidden; margin-top: 18px; }
.login-stage .ls-bar i { display: block; height: 100%; border-radius: 3px; background: var(--v-accent); transform-origin: left; animation: ls-load 1.1s var(--v-ease) both; }
@keyframes ls-load { from { transform: scaleX(0); } }
.login-stage .ls-confetti { position: absolute; left: 50%; top: 38%; width: 0; height: 0; pointer-events: none; }
.login-stage .ls-confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; opacity: 0; animation: ls-burst 1s var(--v-ease) forwards; }
@keyframes ls-burst { 0% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); } }


.login-stage .ls-right { position: relative; min-height: 0; border-radius: 36px; background: #151515; color: #fff; overflow: hidden; container-type: size; container-name: lsposter; }
.login-stage .ls-mesh { position: absolute; inset: 0; pointer-events: none; }
.login-stage .ls-blob { position: absolute; border-radius: 50%; }
.login-stage .ls-b1 { width: 70%; aspect-ratio: 1; left: 42%; top: -22%; background: radial-gradient(closest-side, rgba(242, 92, 5, .36), transparent); animation: ls-drift1 16s ease-in-out infinite; }
.login-stage .ls-b2 { width: 60%; aspect-ratio: 1; left: -20%; top: 52%; background: radial-gradient(closest-side, rgba(242, 92, 5, .17), transparent); animation: ls-drift2 20s ease-in-out infinite; }
@keyframes ls-drift1 { 50% { transform: translate(-6%, 8%) scale(1.08); } }
@keyframes ls-drift2 { 50% { transform: translate(8%, -6%) scale(1.1); } }
.login-stage .ls-dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px); background-size: 26px 26px; pointer-events: none; }
.login-stage .ls-phead { position: absolute; left: 40px; right: 40px; top: 36px; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; z-index: 2; }
.login-stage .ls-pk { font: 800 12px var(--v-font); letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.login-stage .ls-pt { font: 800 30px/1.14 var(--v-display); letter-spacing: -.02em; margin-top: 8px; }
.login-stage .ls-pt em { font-style: normal; color: #F25C05; }
.login-stage .ls-plive { flex: none; height: 34px; padding: 0 13px; border-radius: 999px; background: rgba(255, 255, 255, .08); display: inline-flex; align-items: center; gap: 8px; font: 700 12.5px var(--v-font); white-space: nowrap; }
.login-stage .ls-plive i { width: 7px; height: 7px; border-radius: 50%; background: #34D27B; }
.login-stage .ls-plive b { display: inline-block; font-weight: 800; }
.login-stage .ls-scene { position: absolute; left: 28px; right: 28px; top: 150px; bottom: 28px; }
.login-stage .ls-path-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.login-stage .ls-path-bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 14; stroke-linecap: round; }
.login-stage .ls-path-fg { fill: none; stroke: url(#ls-grad); stroke-width: 3.2; stroke-linecap: round; }
.login-stage .ls-token { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: #F25C05; box-shadow: 0 0 0 6px rgba(242, 92, 5, .22), 0 0 22px 6px rgba(242, 92, 5, .55); pointer-events: none; z-index: 1; }
.login-stage .ls-node { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.login-stage .ls-node.ls-up { flex-direction: column-reverse; }
.login-stage .ls-dotn { width: 18px; height: 18px; border-radius: 50%; background: #151515; border: 4px solid rgba(255, 255, 255, .25); transition: border-color .4s, box-shadow .4s; }
.login-stage .ls-node.lit .ls-dotn { border-color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); }
.login-stage .ls-tag { height: 36px; padding: 0 14px 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .75); font: 700 13px var(--v-font); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; transition: background-color .4s, color .4s, box-shadow .4s; }
.login-stage .ls-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.login-stage .ls-node.lit .ls-tag { background: #fff; color: #141414; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }


.login-stage .ls-node.ls-up .ls-tag { translate: -40% 0; }
.login-stage .ls-node:not(.ls-up) .ls-tag { translate: 40% 0; }
.login-stage .ls-node:first-child .ls-tag { translate: 12% 0; }
.login-stage .ls-pop { position: absolute; transform: translate(-50%, -50%) scale(.92); opacity: 0; transition: opacity .45s ease, transform .5s var(--v-spring); pointer-events: none; }
.login-stage .ls-pop.show { opacity: 1; transform: translate(-50%, -50%); }
.login-stage .ls-pcard { min-width: 190px; padding: 14px 16px; border-radius: 20px; background: #1F1F1F; box-shadow: inset 0 0 0 1px #2A2A2D, 0 18px 40px rgba(0, 0, 0, .4); }
.login-stage .ls-k { font: 800 11px var(--v-font); letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.login-stage .ls-v { display: flex; align-items: center; gap: 10px; margin-top: 6px; font: 700 14px var(--v-font); white-space: nowrap; }
.login-stage .ls-v:first-child { margin-top: 0; }
.login-stage .ls-ok { color: #34D27B; font: 800 17px var(--v-display); }
.login-stage .ls-sum { font-size: 22px; letter-spacing: -.01em; }
.login-stage .ls-ava { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; flex: none; }
.login-stage .ls-ava img, .login-stage .ls-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-stage .ls-meter { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); overflow: hidden; margin-top: 10px; }
.login-stage .ls-meter i { display: block; height: 100%; width: var(--w); border-radius: 3px; background: #F25C05; transform: scaleX(0); transform-origin: left; }
.login-stage .ls-pop.show .ls-meter i { animation: ls-fill 1s var(--v-ease) .2s forwards; }
@keyframes ls-fill { to { transform: scaleX(1); } }
.login-stage .ls-ringp { width: 44px; height: 44px; flex: none; transform: rotate(-90deg); }
.login-stage .ls-ringp circle { fill: none; stroke-width: 5; }
.login-stage .ls-bgc { stroke: #2A2A2D; }
.login-stage .ls-fgc { stroke: #F25C05; stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; }
.login-stage .ls-pop.show .ls-fgc { animation: ls-ringp 1.1s var(--v-ease) .2s forwards; }
@keyframes ls-ringp { to { stroke-dashoffset: 15; } }
.login-stage .ls-av { position: absolute; transform: translate(-50%, -50%); }
.login-stage .ls-ph { width: calc(var(--s) * 1px); height: calc(var(--s) * 1px); border-radius: 50%; overflow: hidden; background: #2A2A2D; box-shadow: 0 0 0 4px #151515, 0 0 0 5px rgba(255, 255, 255, .14), 0 20px 40px rgba(0, 0, 0, .5); animation: ls-bob 5s ease-in-out infinite; animation-delay: var(--d); }
@keyframes ls-bob { 50% { transform: translateY(-8px); } }
.login-stage .ls-bubble { position: absolute; left: calc(100% + 8px); top: 4%; min-height: 36px; padding: 8px 13px; border-radius: 14px 14px 14px 4px; background: rgba(255, 255, 255, .13); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font: 600 13px var(--v-font); white-space: nowrap; display: inline-flex; align-items: center; opacity: 0; transform: translateY(6px); transition: opacity .35s ease, transform .4s var(--v-ease); }
.login-stage .ls-bubble.show { opacity: 1; transform: none; }
.login-stage .ls-bubble.ls-bl { left: auto; right: calc(100% + 8px); top: auto; bottom: -8%; border-radius: 14px 14px 4px 14px; }
.login-stage .ls-bubble .ls-typing i { background: #fff; }



@container lsposter (min-width: 1000px) and (min-height: 820px) {
  .login-stage .ls-phead { left: 56px; right: 56px; top: 52px; }
  .login-stage .ls-pt { font-size: 38px; }
  .login-stage .ls-scene { top: 190px; left: 44px; right: 44px; bottom: 44px; }
  .login-stage .ls-ph { width: calc(var(--s) * 1.25px); height: calc(var(--s) * 1.25px); }
  .login-stage .ls-tag { height: 42px; font-size: 14.5px; padding: 0 17px 0 14px; }
  .login-stage .ls-pcard { min-width: 230px; padding: 18px 20px; }
  .login-stage .ls-bubble { font-size: 14.5px; min-height: 42px; padding: 9px 16px; }
}
@container lsposter (max-width: 760px) {
  .login-stage .ls-phead { left: 28px; right: 28px; top: 28px; }
  .login-stage .ls-pt { font-size: 24px; }
  .login-stage .ls-plive { display: none; }
  .login-stage .ls-scene { top: 118px; left: 20px; right: 20px; bottom: 20px; }
  .login-stage .ls-ph { width: calc(var(--s) * .78px); height: calc(var(--s) * .78px); }
  .login-stage .ls-pcard { min-width: 150px; padding: 11px 13px; border-radius: 17px; }
  .login-stage .ls-tag { height: 32px; font-size: 12px; padding: 0 12px 0 10px; }
  .login-stage .ls-bubble { font-size: 12px; min-height: 32px; padding: 6px 11px; }
}
@container lsposter (max-height: 620px) {
  .login-stage .ls-phead { top: 24px; }
  .login-stage .ls-pt { font-size: 22px; }
  .login-stage .ls-scene { top: 104px; }
  .login-stage .ls-ph { width: calc(var(--s) * .66px); height: calc(var(--s) * .66px); }
  .login-stage .ls-tag { height: 30px; font-size: 11.5px; }
}
@container lsposter (max-width: 520px) {
  .login-stage .ls-pops, .login-stage .ls-bubble { display: none; }
}


.login-stage .ls-ticker { display: none; }
.login-stage .ls-row { display: flex; gap: 8px; width: max-content; animation: ls-marquee 34s linear infinite; }
.login-stage .ls-chip { height: 32px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #fff; font: 700 12.5px var(--v-font); display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; flex: none; }
.login-stage .ls-chip i { width: 7px; height: 7px; border-radius: 50%; }
.login-stage .ls-chip img { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; margin-left: -4px; }
@keyframes ls-marquee { to { transform: translateX(calc(-50% - 4px)); } }


@media (min-width: 901px) and (min-height: 521px), (min-width: 1001px) {
  .login-stage.lg-tall .login-pill, .login-stage.lg-tall .ls-title, .login-stage.lg-tall .ls-live { display: none; }
  .login-stage.lg-tall .ls-card-wrap { margin-top: 0; }
}


@media (max-width: 1180px) {
  .login-stage { grid-template-columns: minmax(440px, 500px) minmax(0, 1fr); }
  .login-stage .ls-left { padding: 16px 28px 0 32px; }
  .login-stage .ls-title { font-size: 38px; }
}

@media (max-height: 820px) and (min-width: 901px) {
  .login-stage .ls-left { padding-top: 10px; }
  .login-stage .ls-title { font-size: 34px; margin-top: 12px; }
  .login-stage .ls-live { margin-top: 14px; }
  .login-stage .ls-live > span { height: 34px; }
  .login-stage .ls-card-wrap { margin-top: 16px; }
  .login-stage .login-card { padding: 20px 22px; }
  .login-stage .lg-legal { padding-top: 12px; }
  .login-stage .lg-brand { margin-bottom: clamp(12px, 4vh, 40px); }
  .login-stage.lg-tall .lg-legal { display: none; }
  .login-stage.lg-tall .lg-brand { margin-bottom: 12px; }
  .login-stage.lg-tall .lg-tile { width: 46px; height: 46px; border-radius: 15px; margin-bottom: 10px; }
  .login-stage.lg-tall .lg-hint { margin-bottom: 12px; }
}
@media (max-height: 760px) and (min-width: 901px) {
  .login-stage .login-pill { display: none; }
  .login-stage .ls-title { font-size: 30px; margin-top: 0; }
  .login-stage .login-divider { margin: 10px 0; }
  .login-stage .login-register-hint { margin-top: 12px; }
}
@media (max-height: 690px) and (min-width: 901px) {
  .login-stage .ls-live { display: none; }
  #login-screen .login-stage .btn, #login-screen .login-stage input:not([type="checkbox"]):not([type="radio"]) { height: 46px; }
  .login-stage .ls-field svg { top: 14px; }
  #login-screen .login-stage .ls-cells input[inputmode] { height: 52px; }
}




@media (max-width: 900px), (max-height: 520px) and (max-width: 1000px) {
  .login-stage { display: block; padding: 0; }
  .login-stage .ls-right { display: none; }
  .login-stage .ls-left { padding: 0; min-height: 100%; }
  .login-stage .lg-top { display: block; position: relative; overflow: hidden; padding: 26px 22px 68px; border-radius: 0 0 32px 32px; background: #151515; color: #fff; }
  .login-stage .lg-top::before { content: ''; position: absolute; width: 340px; height: 340px; right: -100px; top: -120px; border-radius: 50%; background: radial-gradient(closest-side, rgba(242, 92, 5, .42), transparent); pointer-events: none; }
  .login-stage .lg-top > * { position: relative; max-width: 492px; margin-left: auto; margin-right: auto; }
  .login-stage.lg-tall .ls-title, .login-stage.lg-tall .ls-ticker { display: none; }
  .login-stage .lg-brand { color: #fff; margin-top: 0; margin-bottom: 0; }
  .login-stage .lg-brand .brand-mark { background: #fff; color: #141414; }
  .login-stage .login-pill, .login-stage .ls-live { display: none; }
  .login-stage .ls-title { color: #fff; font-size: 34px; margin-top: 20px; }
  .login-stage .ls-ticker { display: block; max-width: none; margin: 18px -22px 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
  .login-stage .ls-row { padding-left: 22px; }
  .login-stage .ls-card-wrap { margin: -44px auto 0; padding: 0 14px; width: 100%; max-width: 520px; position: relative; }
  .login-stage .login-card { width: 100%; padding: 22px 20px 20px; border-radius: 26px; }
  .login-stage .lg-legal { margin-top: auto; padding: 18px 20px calc(18px + env(safe-area-inset-bottom, 0px)); text-align: center; }
}



@media (max-width: 860px) {
  #login-screen { max-height: none; }
}

@media (min-width: 641px) and (max-width: 900px) and (min-height: 900px) {
  .login-stage .lg-top { padding-top: 56px; padding-bottom: 84px; }
  .login-stage .ls-title { font-size: 42px; margin-top: 28px; }
  .login-stage .ls-ticker { margin-top: 26px; }
}
@media (max-width: 640px) {
  .login-stage .lg-top { padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  .login-stage .lg-two { grid-template-columns: 1fr; gap: 0; }
  .login-stage .ls-title { font-size: 29px; }
  #login-screen .login-stage .ls-cells input[inputmode] { height: 54px; font-size: 21px; }
  .login-card.lg-solo { padding: 22px 20px 20px; border-radius: 26px; }
  #login-screen:has(> .lg-solo) { padding: 14px 12px; }
}
@media (max-width: 380px) {
  .login-stage .lg-top { padding-left: 18px; padding-right: 18px; padding-bottom: 60px; }
  .login-stage .ls-title { font-size: 25px; margin-top: 16px; }
  .login-stage .ls-card-wrap { padding: 0 10px; margin-top: -40px; }
  .login-stage .login-card { padding: 18px 16px 16px; border-radius: 24px; }
  .login-stage .ls-cells { gap: 6px; }
  #login-screen .login-stage .ls-cells input[inputmode] { height: 48px; font-size: 19px; border-radius: 13px; }
}

@media (max-height: 520px) and (max-width: 1000px) and (orientation: landscape) {
  .login-stage .lg-top { padding: 14px 22px 56px; }
  .login-stage .ls-title, .login-stage .ls-ticker { display: none; }
  .login-stage .ls-card-wrap { margin-top: -40px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-stage *, .login-stage *::before, .login-stage *::after { animation: none !important; transition: none !important; }
  .login-stage .ls-check path { stroke-dashoffset: 0; }
  .login-stage .ls-fgc { stroke-dashoffset: 15; }
  .login-stage .ls-meter i { transform: none; }
}






.adm-page .segmented button { display: inline-flex; align-items: center; gap: 6px; }
.adm-tab-count { min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: var(--panel-2); color: var(--text-dim); font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.adm-tab-count.alarm { background: var(--red); color: var(--panel); }
.adm-pane[hidden] { display: none; }
.adm-hint { font-size: 13px; color: var(--text-dim); line-height: 1.5; margin: 0 0 12px; }
.adm-bad { color: var(--red); font-weight: 700; }

.adm-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 14px; }
.adm-stat { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.adm-stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.adm-stat span { font-size: 12.5px; color: var(--text-dim); }
.adm-stat.muted b { color: var(--text-dim); }
.adm-card .adm-stats { margin: 4px 0 12px; }
.adm-card .adm-stat { box-shadow: none; background: var(--panel-2); border-color: transparent; }

.adm-callout { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; text-align: left; margin: 0 0 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; box-shadow: var(--shadow); }
.adm-callout.alarm { background: var(--red-soft); border-color: transparent; }
.adm-callout-go { margin-left: auto; font-weight: 700; color: var(--accent-ink); white-space: nowrap; }
details.adm-callout { display: block; cursor: default; }
details.adm-callout summary { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer; list-style: none; }
details.adm-callout summary::-webkit-details-marker { display: none; }
details.adm-callout[open] summary .adm-callout-go { visibility: hidden; }
details.adm-callout[open] summary { margin-bottom: 10px; }

.adm-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.adm-search { flex: 1 1 240px; min-width: 0; height: 40px; }
.adm-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.adm-chips::-webkit-scrollbar { display: none; }
.adm-chips .chip { white-space: nowrap; }


.adm-users { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.adm-user { display: grid; grid-template-columns: minmax(200px, 1.6fr) 150px minmax(130px, .9fr) 210px 340px; gap: 12px; align-items: center; padding: 12px 16px; }
.adm-user + .adm-user { border-top: 1px solid var(--border); }
.adm-user[hidden] { display: none; }
.adm-user-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.adm-user-name { min-width: 0; }
.adm-user-name b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.adm-user-name small, .adm-user-status small { display: block; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-user-role select { width: 100%; height: 34px; padding: 0 8px; }
.adm-user-status { min-width: 0; }
.adm-user-status small { margin-top: 3px; }
.adm-user-access { display: flex; gap: 6px; flex-wrap: wrap; }
.adm-user-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.adm-pill { border: 1px solid var(--border); background: var(--panel); color: var(--text-dim); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.adm-pill:hover { border-color: var(--text-dim); }
.adm-pill.on { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }


.adm-list { display: flex; flex-direction: column; }
.adm-page .adm-pane > .adm-list { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 0 16px; }
.adm-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.adm-row + .adm-row { border-top: 1px solid var(--border); }
.adm-row-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.adm-row-main b { font-size: 14px; }
.adm-row-main small { font-size: 12px; color: var(--text-dim); }
.adm-text { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; }
.adm-row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex-shrink: 0; }
.adm-row-actions select { width: auto; height: 36px; padding: 0 30px 0 10px; line-height: 34px; }
.adm-page .registration-request-row { padding: 12px 0; border-bottom: none; }


.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.adm-two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.adm-card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.adm-card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.adm-card-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; font-size: 18px; flex: none; }
.adm-card h3 { margin: 0; font-size: 15px; }
.adm-card p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.adm-card textarea { width: 100%; margin-bottom: 10px; }
.adm-card .broadcast-recipients-list { max-height: 320px; }
.adm-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.adm-page .health-section { margin-bottom: 14px; }

@container fin (max-width: 1150px) {
  .adm-user { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'main role' 'status status' 'access actions'; row-gap: 8px; }
  .adm-user-main { grid-area: main; }
  .adm-user-role { grid-area: role; width: 150px; }
  .adm-user-status { grid-area: status; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-left: 46px; }
  .adm-user-status small { margin-top: 0; }
  .adm-user-access { grid-area: access; padding-left: 46px; }
  .adm-user-actions { grid-area: actions; }
  .adm-two { grid-template-columns: 1fr; }
}
@container fin (max-width: 560px) {
  .adm-user { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'main' 'role' 'status' 'access' 'actions'; padding: 12px 14px; }
  .adm-user-role { width: 100%; }
  .adm-user-status, .adm-user-access { padding-left: 0; }
  .adm-user-actions { justify-content: flex-start; }
  .adm-row { flex-direction: column; align-items: stretch; }
  .adm-row-actions { justify-content: flex-start; }
  .adm-row-actions select { flex: 1 1 100%; width: 100%; }
  .adm-grid { grid-template-columns: 1fr; }
  .adm-callout-go { margin-left: 0; }
  .adm-card { padding: 14px; }

  .adm-stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .adm-stat { padding: 9px 10px; border-radius: 13px; }
  .adm-stat b { font-size: 18px; }
  .adm-stat span { font-size: 11px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}


.dlg-sources-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-dim); opacity: .8; margin-left: 4px; }







.chat-action-wrap .chat-send-btn.is-mic { touch-action: none; }
.chat-send-btn #chat-action-btn-icon { display: inline-grid; place-items: center; line-height: 1; }
.chat-send-btn.is-mic #chat-action-btn-icon { animation: chatMicIn .25s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes chatMicIn { from { transform: scale(.4) rotate(40deg); opacity: 0; } to { transform: none; opacity: 1; } }



.chat-action-wrap .chat-send-btn.rec-hold {
  scale: 1.7; position: relative; z-index: 6;
  box-shadow: 0 0 0 calc(var(--lvl, 0) * 12px) color-mix(in srgb, var(--accent-ink) 22%, transparent);
  transition: scale .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .08s linear, background-color .15s;
}
.chat-action-wrap .chat-send-btn.rec-cancelling { background: var(--red); }


.chat-composer.rec-holding .chat-recording-ui {
  position: absolute; left: 16px; right: 66px; top: 50%; margin-top: -21px; height: 42px;
  padding: 0 14px; border-radius: 21px; background: var(--panel); border: 1px solid var(--border);
  z-index: 5; transition: transform .18s ease;
}
.chat-recording-ui .recording-wave { display: none; flex: 1; align-items: center; gap: 2px; height: 24px; overflow: hidden; min-width: 0; }
.chat-recording-ui .recording-wave i { width: 3px; border-radius: 2px; background: var(--accent-ink); flex: none; }
.chat-recording-ui.locked .recording-wave { display: flex; }
.chat-recording-ui.locked .recording-slide { display: none; }
.chat-recording-ui.hold #chat-recording-cancel,
.chat-recording-ui.hold #chat-recording-send { display: none; }
.chat-recording-ui .recording-slide { text-align: center; white-space: nowrap; overflow: hidden; }
.chat-recording-ui .recording-slide span { display: inline-block; animation: chatSlideNudge 1.4s ease-in-out infinite; }
@keyframes chatSlideNudge { 50% { transform: translateX(-8px); } }








.chat-rec-lock {


  position: absolute; left: 50%; bottom: calc(var(--composer-h, 38px) + 52px); width: 38px; margin-left: -19px;
  height: calc(82px - var(--p, 0) * 34px);
  border-radius: 999px; background: var(--panel); border: 1px solid var(--border); color: var(--text);
  box-shadow: 0 10px 26px rgba(16, 17, 20, .16);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; padding-top: 10px;
  opacity: 0; transform: translateY(24px) scale(.6); transform-origin: 50% 100%;
  pointer-events: none; z-index: 7; overflow: hidden;
  transition: opacity .18s ease, transform .32s cubic-bezier(.34, 1.56, .64, 1), height .08s linear,
    background-color .18s ease, color .18s ease, border-color .18s ease;
}
.chat-rec-lock.open { opacity: 1; transform: none; }
.chat-rec-lock-pad { display: grid; place-items: center; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1); }
.chat-rec-lock .lk-shackle { transform: translateY(calc((1 - var(--p, 0)) * -3.5px)); transition: transform .08s linear; }
.chat-rec-lock-chev {
  display: grid; place-items: center; color: var(--text-dim);
  opacity: calc(1 - var(--p, 0) * 1.6);
  animation: chatLockUp 1.2s ease-in-out infinite;
}
@keyframes chatLockUp { 50% { transform: translateY(-5px); } }
.chat-rec-lock.near .chat-rec-lock-pad { transform: scale(1.15); }
.chat-rec-lock.snap {
  background: var(--accent); color: #fff; border-color: transparent;
  animation: chatLockSnap .38s cubic-bezier(.34, 1.3, .64, 1) forwards;
}
.chat-rec-lock.snap .lk-shackle { transform: none; transition: transform .1s cubic-bezier(.5, 0, .75, 0); }
.chat-rec-lock.snap .chat-rec-lock-chev { opacity: 0; }
@keyframes chatLockSnap {
  0% { transform: none; }
  35% { transform: scale(1.22); }
  65% { transform: translateY(6px) scale(.95); opacity: 1; }
  100% { transform: translateY(26px) scale(.55); opacity: 0; }
}



.chat-composer .chat-recording-ui.lock-enter { animation: chatLockBarIn .42s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes chatLockBarIn {
  from { clip-path: inset(0 0 0 70% round 16px); opacity: .4; }
  to { clip-path: inset(0 0 0 0 round 16px); opacity: 1; }
}
.chat-recording-ui.lock-enter > * { animation: chatLockItemIn .32s cubic-bezier(.34, 1.4, .64, 1) both; }
.chat-recording-ui.lock-enter > :nth-child(3) { animation-delay: .08s; }
.chat-recording-ui.lock-enter > :nth-child(5) { animation-delay: .12s; }
.chat-recording-ui.lock-enter > :nth-child(6) { animation-delay: .16s; }
.chat-recording-ui.lock-enter > :nth-child(7) { animation-delay: .2s; }
@keyframes chatLockItemIn { from { opacity: 0; transform: translateX(10px) scale(.85); } to { opacity: 1; transform: none; } }

.recording-locked-badge {
  display: none; align-items: center; gap: 4px; flex-shrink: 0; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent-ink) 10%, transparent);
  padding: 3px 8px 3px 6px; border-radius: 999px;
}
.chat-recording-ui.locked .recording-locked-badge { display: inline-flex; }
@media (max-width: 420px) {
  .recording-locked-badge span { display: none; }
  .recording-locked-badge { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-rec-lock.snap, .chat-composer .chat-recording-ui.lock-enter, .chat-recording-ui.lock-enter > * { animation: none; }
}


.chat-rec-tip {
  position: absolute; right: 0; bottom: 52px; pointer-events: none; z-index: 8;

  width: max-content; max-width: min(300px, calc(100vw - 32px)); white-space: normal; line-height: 1.35;
  background: var(--text); color: var(--panel); font-size: 12.5px; font-weight: 600;
  padding: 8px 12px; border-radius: 12px; opacity: 0; transform: translateY(6px);
  transition: opacity .18s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.chat-rec-tip.open { opacity: 1; transform: none; }
.chat-rec-tip.alarm { background: var(--red); color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .chat-send-btn.is-mic #chat-action-btn-icon, .chat-rec-lock-chev, .chat-recording-ui .recording-slide span { animation: none; }
}
@media (max-width: 420px) {
  .chat-composer.rec-holding .chat-recording-ui { left: 8px; right: 50px; }
  .chat-recording-ui .recording-slide { display: inline-block; }
}














@media (min-width: 861px) {
  body:not(.chat-pinned-mobile) .ios-chat {
    --composer-h: 44px;
    --composer-r: 12px;
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer-normal { align-items: flex-end; gap: 10px; }
  body:not(.chat-pinned-mobile) .ios-chat .chat-textarea-wrap { display: flex; }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer textarea {
    display: block;
    min-height: var(--composer-h);
    padding: 12px 46px 12px 14px;
    line-height: 18px;
    font-size: 13.5px;
    border-radius: var(--composer-r);
    background: var(--panel);
    border: 1px solid var(--border);
    transition: border-color .15s ease, box-shadow .15s ease;
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer textarea:focus {
    border-color: var(--text-dim);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
  }

  body:not(.chat-pinned-mobile) .ios-chat .chat-emoji-inline-btn {
    right: 8px; bottom: calc((var(--composer-h) - 30px) / 2);
    width: 30px; height: 30px; border-radius: 8px; font-size: 17px;
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer-btn,
  body:not(.chat-pinned-mobile) .ios-chat .chat-send-btn {
    width: var(--composer-h); height: var(--composer-h);
    border-radius: var(--composer-r);
    display: inline-flex; align-items: center; justify-content: center;
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer-btn {
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
    font-size: 15px;
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-composer-btn:hover { background: var(--panel-2); }
  body:not(.chat-pinned-mobile) .ios-chat .chat-send-btn { font-size: 16px; }
  body:not(.chat-pinned-mobile) .ios-chat .chat-send-btn:hover { opacity: .88; }




  body:not(.chat-pinned-mobile) .ios-chat .chat-action-wrap .chat-send-btn.rec-hold { border-radius: 50%; transform-origin: 85% 85%; }



  body:not(.chat-pinned-mobile) .ios-chat .chat-composer.rec-holding .chat-recording-ui {
    right: calc(16px + var(--composer-h) + 10px);
    height: var(--composer-h); margin-top: calc(var(--composer-h) / -2);
    border-radius: var(--composer-r);
  }
  body:not(.chat-pinned-mobile) .ios-chat .chat-recording-ui:not(.hold) { min-height: var(--composer-h); }
  body:not(.chat-pinned-mobile) .ios-chat .chat-recording-ui .btn.secondary { border-radius: var(--composer-r); }
  body:not(.chat-pinned-mobile) .ios-chat .chat-rec-lock { width: var(--composer-h); margin-left: calc(var(--composer-h) / -2 - 11px); }
  body:not(.chat-pinned-mobile) .ios-chat .chat-rec-tip { bottom: calc(var(--composer-h) + 14px); }
}









body.chat-pinned-mobile .chat-recording-ui.hold .recording-slide { display: inline-block; flex: 1; min-width: 0; font-size: 12.5px; }
body.chat-pinned-mobile .chat-action-wrap .chat-send-btn.rec-hold { transform-origin: 85% 85%; }
body.chat-pinned-mobile .chat-rec-lock { margin-left: -27px; }






.avito-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 16px; }
.avito-tools-lab {
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-dim); margin-right: 2px;
}
.avito-tool {
  display: inline-flex; align-items: center; gap: 7px; flex: none; white-space: nowrap;
  padding: 7px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background-color .15s ease, transform .1s ease;
}
.avito-tool svg { color: var(--text-dim); flex: none; }
.avito-tool:hover { background: var(--panel-2); }
.avito-tool:active { transform: scale(.97); }
.avito-tool.active { background: var(--text); color: var(--panel); border-color: transparent; }
.avito-tool.active svg { color: var(--panel); }
.avito-back { margin: -6px 0 12px; }

.avito-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 14px; }
.avito-set {
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  border: 1px solid var(--border); background: var(--panel); border-radius: 18px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
  transition: background-color .15s ease, transform .1s ease;
}
.avito-set:hover { background: var(--panel-2); }
.avito-set:active { transform: scale(.985); }
.avito-set b { font-size: 14px; }
.avito-set-st { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-dim); }
.avito-set-sub { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

.avito-cabs-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.avito-cabs-head .avito-hint { flex: 1; min-width: 0; }





@media (max-width: 600px) {
  .avito-tabs-row, .avito-tools, .board-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .avito-tabs-row::-webkit-scrollbar, .avito-tools::-webkit-scrollbar, .board-tabs::-webkit-scrollbar { display: none; }
  .avito-tabs-row .content-tab-btn, .board-tab { flex: none; white-space: nowrap; }
  .avito-tools-lab { display: none; }
  .avito-cabs-head { flex-direction: column; gap: 10px; }

  .board-cols { display: none; }
  .board-t colgroup { display: none; }
  .board-t, .board-t tbody { display: block; width: 100%; min-width: 0; table-layout: auto; }
  .board-t tr {
    display: grid; grid-template-columns: 24px repeat(4, minmax(0, 1fr));
    grid-template-areas: "c city city st st" "c n1 n2 n3 n4";
    gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border);
  }
  .board-t tr:last-child { border-bottom: none; }
  .board-t td { border: none; padding: 0; text-align: left; overflow: visible; }
  .board-t td:nth-child(1) { grid-area: c; }
  .board-t td:nth-child(2) { grid-area: city; min-width: 0; }
  .board-t td:nth-child(10) { grid-area: st; justify-self: end; }
  .board-t td:nth-child(3), .board-t td:nth-child(4), .board-t td:nth-child(7) { display: none; }
  .board-t td:nth-child(5) { grid-area: n1; }
  .board-t td:nth-child(6) { grid-area: n2; }
  .board-t td:nth-child(8) { grid-area: n3; }
  .board-t td:nth-child(9) { grid-area: n4; }
  .board-t td:nth-child(5)::before { content: 'показы'; }
  .board-t td:nth-child(6)::before { content: 'просмотры'; }
  .board-t td:nth-child(8)::before { content: 'обращения'; }
  .board-t td:nth-child(9)::before { content: 'расход'; }
  .board-t td:nth-child(n+5):nth-child(-n+9)::before { display: block; font-size: 10.5px; font-weight: 600; color: var(--text-dim); }
  .board-t .board-state { justify-content: flex-end; flex-wrap: wrap; }




  .board-card-head, .board-acts-top, .avito-rule-head { flex-wrap: wrap; }
  .board-card-name { min-width: 0; overflow-wrap: anywhere; }
  .board-acts-row .board-sel { flex: 1 1 100%; }
  .avito-cab-stats { gap: 16px 22px; }
}






.chat-emoji { width: 1.3em; height: 1.3em; vertical-align: -0.28em; margin: 0 .04em; }

.chat-bubble.emoji-only, .chat-bubble.sticker-only {
  padding: 0; background: none !important; box-shadow: none !important; overflow: visible; position: relative;
}
.chat-bubble.emoji-only .chat-bubble-time, .chat-bubble.sticker-only .chat-bubble-time {
  position: absolute; right: 0; bottom: -2px; margin: 0; padding: 2px 7px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.45); color: #fff; opacity: 1;
}
.chat-big-emoji { display: flex; gap: 4px; padding: 2px 0 14px; }
.chat-live { position: relative; display: inline-grid; place-items: center; }
.chat-live > .chat-live-anim { position: absolute; inset: 0; pointer-events: none; }
.chat-live > .chat-live-anim svg { width: 100% !important; height: 100% !important; }
.chat-live.is-live > .chat-live-still { opacity: 0; }
.chat-big-emoji .chat-live { width: 96px; height: 96px; cursor: pointer; }
.chat-big-emoji-2 .chat-live { width: 80px; height: 80px; }
.chat-big-emoji-3 .chat-live { width: 64px; height: 64px; }
.chat-big-emoji .chat-live-still { width: 100%; height: 100%; }

.chat-sticker { width: 150px; height: 150px; display: grid; place-items: center; padding-bottom: 12px; }
.chat-sticker .chat-live-still { width: 100%; height: 100%; }
.chat-sticker-svg { width: 100%; height: 100%; overflow: visible; }
.chat-sticker.chat-live { cursor: pointer; }

.chat-bubble:not(.sticker-only) .chat-sticker { width: 110px; height: 110px; padding-bottom: 0; }



.chat-sticker-svg * { transform-box: fill-box; transform-origin: center; }
.chat-sticker.playing .st-jump { animation: stJump 1.1s ease-in-out infinite; }
.chat-sticker.playing .st-pop { animation: stPop 1s ease-in-out infinite; }
.chat-sticker.playing .st-shake { animation: stShake .5s ease-in-out infinite; }
.chat-sticker.playing .st-spin { animation: stSpin 2.4s linear infinite; }
.chat-sticker.playing .st-float { animation: stFloat 1.8s ease-out infinite; }
.chat-sticker.playing .st-drop { animation: stDrop 1.6s ease-out infinite; }
.chat-sticker.playing .st-toss { animation: stToss 1.4s ease-in-out infinite; }
.chat-sticker.playing .st-type { animation: stType .3s ease-in-out infinite; }
.chat-sticker.playing .st-flick { animation: stFlick .6s ease-in-out infinite; }
.chat-sticker.playing .st-blink { animation: stBlink 3s infinite; }
.chat-sticker.playing .st-needle { transform-origin: 50% 100%; animation: stNeedle 2.2s cubic-bezier(.3, 1.4, .6, 1) infinite; }
.chat-sticker.playing .st-d2 { animation-delay: .6s; }
.chat-sticker.playing .st-type.st-d2 { animation-delay: .15s; }
.chat-sticker.playing .st-d3 { animation-delay: 1.2s; }
@keyframes stJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px) scaleY(1.05); } 60% { transform: translateY(0) scaleY(.92); } }
@keyframes stPop { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes stShake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@keyframes stSpin { to { transform: rotate(360deg); } }
@keyframes stFloat { 0% { transform: translateY(4px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-14px); opacity: 0; } }
@keyframes stDrop { 0% { transform: translateY(-26px); opacity: 0; } 40% { transform: translateY(0); opacity: 1; } 55% { transform: translateY(-6px); } 70%, 100% { transform: translateY(0); } }
@keyframes stToss { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-22px) rotate(200deg); } }
@keyframes stType { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes stFlick { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(.9, 1.12); } }
@keyframes stBlink { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes stNeedle { 0% { transform: rotate(-70deg); } 70% { transform: rotate(38deg); } 85% { transform: rotate(28deg); } 100% { transform: rotate(33deg); } }
html.lite-motion .chat-sticker *, html.lite-motion .chat-live > .chat-live-anim { animation: none !important; }
html.lite-motion .chat-live > .chat-live-anim { display: none; }
html.lite-motion .chat-live.is-live > .chat-live-still { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .chat-sticker * { animation: none !important; } }


.emoji-picker.ep { width: 348px; max-width: calc(100vw - 24px); max-height: 380px; padding: 0; overflow: hidden; }
.emoji-picker.ep.open { display: flex; flex-direction: column; }
.ep-tabs { display: flex; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); }
.ep-tab { border: none; background: var(--panel-2); color: var(--text-dim); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.ep-tab.on { background: var(--text); color: var(--panel); }
.ep-body { overflow-y: auto; padding: 4px 8px 8px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.ep-h { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); margin: 10px 4px 4px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; }
.ep-e { border: none; background: none; height: 38px; border-radius: 10px; cursor: pointer; padding: 5px; display: grid; place-items: center; }
.ep-e:hover { background: var(--panel-2); }
.ep-e .chat-live-still, .ep-e { position: relative; }
.ep-e img { width: 26px; height: 26px; }
.ep-e > .chat-live-anim, .ep-st > .chat-live-anim { position: absolute; inset: 4px; pointer-events: none; }
.ep-e.is-live > .chat-live-still, .ep-st.is-live > .chat-live-still { opacity: 0; }
.ep-packs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 2px; }
.ep-pack { border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 10px; cursor: pointer; }
.ep-pack.on { border-color: var(--text); }
.ep-stgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ep-st { position: relative; border: none; background: var(--panel-2); border-radius: 14px; aspect-ratio: 1; cursor: pointer; display: grid; place-items: center; padding: 8px; width: auto; height: auto; }
.ep-st:hover { background: var(--border); }
.ep-st .chat-sticker-svg, .ep-st img { width: 100%; height: 100%; }
.ep-foot { font-size: 10.5px; color: var(--text-dim); padding: 6px 12px 8px; border-top: 1px solid var(--border); }


.chat-ust .chat-ust-img { width: 100%; height: 100%; object-fit: contain; }
.chat-ust-gone { font-size: 12px; color: var(--text-dim); padding: 10px 12px; border-radius: 12px; background: var(--panel-2); }
.ep-pack-new { border-style: dashed; color: var(--accent, var(--text)); }
.ep-own { font-size: 11.5px; color: var(--text-dim); margin: 8px 4px 2px; }
.ep-del { border: none; background: none; color: #d4452f; font: inherit; font-weight: 600; cursor: pointer; padding: 0; }
.ep-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(0, 0, 0, .5); display: grid; place-items: center; padding: 16px; }
.ep-modal-box { background: var(--panel); color: var(--text); border-radius: 18px; padding: 18px; width: min(420px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.ep-modal-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
.ep-modal-x { border: none; background: var(--panel-2); color: var(--text); width: 32px; height: 32px; border-radius: 10px; font-size: 18px; cursor: pointer; }
.ep-lbl { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); }
.ep-input { height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel-2); color: var(--text); padding: 0 12px; font: inherit; }
.ep-drop { border: 2px dashed var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; cursor: pointer; font-size: 13px; color: var(--text-dim); }
.ep-drop:hover { border-color: var(--text-dim); }
.ep-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ep-thumb { position: relative; aspect-ratio: 1; background: var(--panel-2); border-radius: 12px; display: grid; place-items: center; padding: 6px; }
.ep-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ep-thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: none; background: var(--text); color: var(--panel); font-size: 13px; line-height: 1; cursor: pointer; padding: 0; }
.ep-note { margin: 0; font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.ep-err { margin: 0; font-size: 13px; color: #d4452f; font-weight: 600; }
.ep-cta { height: 46px; border: none; border-radius: 14px; background: var(--accent, #f25c05); color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.ep-cta:disabled { opacity: .6; cursor: default; }





.kb-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 16px; }
.kb-toolbar-sp { flex: 1; }
.kb-sort select {
  width: auto; padding: 7px 30px 7px 12px; border-radius: 10px; font-size: 13px; font-weight: 600;
  background-color: var(--panel-2); border: 1px solid transparent; cursor: pointer;
}
.kb-view-toggle { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--panel-2); }
.kb-view-toggle button {
  border: none; background: none; color: var(--text-dim); width: 32px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
}
.kb-view-toggle button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(16, 17, 20, .12); }

.kb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 6px 10px; }
.kb-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px 8px 10px; border-radius: 14px; cursor: pointer; text-align: center; outline: none;
  transition: background-color .15s ease;
}
.kb-tile:hover, .kb-tile:focus-visible, .kb-tile.menu-open { background: var(--panel-2); }
.kb-tile-thumb { position: relative; width: 96px; height: 96px; display: grid; place-items: center; text-decoration: none; }
.kb-tile-thumb .kb-ico { width: 84px; height: 84px; }
.kb-tile[data-kb-type="file"] .kb-tile-thumb .kb-ico { width: 64px; height: 80px; }
.kb-tile-img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; background: var(--panel-2); }

.kb-tile-link {
  position: absolute; right: 2px; bottom: 2px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; background: var(--text); color: var(--panel);
  box-shadow: 0 0 0 2px var(--panel);
}
.kb-tile-state { position: absolute; right: 4px; bottom: 4px; }
.kb-tile-play {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; color: #fff; background: rgba(0, 0, 0, .45); pointer-events: none;
}
.kb-tile-name {
  font-size: 13px; line-height: 1.3; max-width: 100%; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.kb-tile-new { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--red); margin-right: 5px; vertical-align: 1px; }
.kb-tile-meta { font-size: 11.5px; color: var(--text-dim); margin-top: -4px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-tile-pending { opacity: .85; }
.kb-tile-pending.is-failed .kb-tile-name { color: var(--red-ink); }

.kb-tile-more {
  position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 8px; border: none;
  background: var(--panel); color: var(--text); font-size: 16px; line-height: 1; cursor: pointer;
  box-shadow: 0 1px 4px rgba(16, 17, 20, .14); opacity: 0; transition: opacity .15s ease;
}
.kb-tile:hover .kb-tile-more, .kb-tile.menu-open .kb-tile-more, .kb-tile:focus-within .kb-tile-more { opacity: 1; }

@media (hover: none) { .kb-tile-more { opacity: 1; } }

.kb-tile-menu {
  position: absolute; top: 38px; right: 6px; z-index: 20; min-width: 190px; padding: 6px;
  display: flex; flex-direction: column; gap: 1px; text-align: left;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 40px rgba(16, 17, 20, .18);
}
.kb-tile-menu[hidden] { display: none; }
.kb-tile-menu.up { top: auto; bottom: 38px; }
.kb-tile-menu button, .kb-tile-menu a {
  all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text); cursor: pointer; white-space: nowrap;
}
.kb-tile-menu button:hover, .kb-tile-menu a:hover { background: var(--panel-2); }
.kb-tile-menu .is-danger { color: var(--red-ink); }
.kb-empty { padding: 40px 12px; }

@media (max-width: 600px) {
  .kb-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 4px 6px; }
  .kb-tile-thumb { width: 80px; height: 80px; }
  .kb-tile-img { width: 80px; height: 80px; }
  .kb-tile-thumb .kb-ico { width: 70px; height: 70px; }
  .kb-tile[data-kb-type="file"] .kb-tile-thumb .kb-ico { width: 54px; height: 66px; }
  .kb-toolbar-sp { flex-basis: 100%; height: 0; }
  .kb-tile-menu { right: auto; left: 50%; transform: translateX(-50%); }
}



.kb-sk { display: block; background: var(--panel-2); border-radius: 8px; animation: kbSk 1.2s ease-in-out infinite; }
.kb-sk-thumb { width: 72px; height: 72px; border-radius: 14px; }
.kb-sk-line { width: 80%; height: 10px; margin: 2px auto 0; }
.kb-sk-line.short { width: 50%; }
.kb-sk-icon { width: 24px; height: 24px; flex-shrink: 0; }
.kb-sk-tab { display: inline-block; width: 110px; height: 38px; border-radius: 999px; margin-right: 8px; }
.kb-skeleton .kb-file-row .kb-sk-line { margin: 4px 0 0; }
.kb-skeleton .kb-tile { cursor: default; }
.kb-skeleton .kb-tile:hover { background: none; }
@keyframes kbSk { 50% { opacity: .5; } }
html.lite-motion .kb-sk { animation: none; }
@media (prefers-reduced-motion: reduce) { .kb-sk { animation: none; } }






.zap-ico { width: 12px; height: 12px; flex: none; }
.fin-auto {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green-ink);
}
.fin-auto-note {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--text); font-size: 13px; line-height: 1.45;
}
.fin-auto-note[hidden] { display: none; }
.fin-auto-note .zap-ico { width: 14px; height: 14px; margin-top: 2px; color: var(--green-ink); }
.fin-auto-note b { color: var(--green-ink); }


.ms-similar-box {
  display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; color: var(--text-dim);
}
.ms-similar-box:focus-within { border-color: var(--orange); }
.ms-similar-box input { flex: 1; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 0 !important; height: 40px; font: inherit; color: var(--text); outline: none; }
.ms-similar-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 236px; overflow-y: auto; }
.ms-similar-list[hidden], .ms-similar-done[hidden] { display: none; }
.ms-similar-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main go" "meta go";
  align-items: center; gap: 2px 10px; width: 100%; padding: 9px 12px; text-align: left;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel); color: var(--text);
  font: inherit; cursor: pointer; transition: border-color .15s, background .15s;
}
.ms-similar-item:hover, .ms-similar-item:focus-visible { border-color: var(--orange); background: color-mix(in srgb, var(--orange) 6%, var(--panel)); }
.ms-similar-main { grid-area: main; display: flex; gap: 6px; align-items: baseline; min-width: 0; font-size: 13.5px; }
.ms-similar-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-similar-main span { color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-similar-meta { grid-area: meta; font-size: 12px; color: var(--text-dim); min-width: 0; }
.ms-similar-go {
  grid-area: go; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--orange-soft); color: var(--orange-ink);
  font-size: 12px; font-weight: 700; white-space: nowrap;
}
.ms-similar-empty { font-size: 12.5px; color: var(--text-dim); padding: 6px 2px; }
.ms-similar-cap { font-size: 12.5px; color: var(--text-dim); padding: 0 2px 2px; }

.ms-similar-item.is-order .ms-similar-main b { flex: none; overflow: visible; }
.ms-similar-done {
  display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 9px 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--green) 10%, transparent); color: var(--text); font-size: 13px;
}
.ms-similar-done svg { color: var(--green-ink); flex: none; }

@keyframes ms-filled-flash { 0% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--orange) 45%, transparent); } 100% { box-shadow: 0 0 0 0 transparent; } }
input.ms-filled { animation: ms-filled-flash 1.6s ease-out; }
@media (prefers-reduced-motion: reduce) { input.ms-filled { animation: none; } }
@media (max-width: 520px) {
  .ms-similar-item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "meta" "go"; }
  .ms-similar-go { justify-self: start; margin-top: 4px; }

  .dl26-pay-btn { display: none !important; }
}
.plan-auto {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; margin: 0 0 14px;
  border-radius: 18px; border: 1px solid var(--border); background: var(--panel);
}
.plan-auto-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--panel-2); font-size: 20px; flex: none; }
.plan-auto-text { flex: 1; min-width: 0; }
.plan-auto-text b { font-size: 14px; }
.plan-auto-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; line-height: 1.45; }
.plan-auto-count { flex: none; text-align: right; white-space: nowrap; }
.plan-auto-count b { font-size: 20px; font-variant-numeric: tabular-nums; }
.plan-auto-left { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.plan-auto-note { display: flex; gap: 6px; align-items: center; font-size: 12px; color: var(--text-dim); padding: 0 16px 14px; }
.plan-auto-note .zap-ico { color: var(--green-ink); }
@media (max-width: 600px) {
  .plan-auto { flex-wrap: wrap; }
  .plan-auto-count { width: 100%; text-align: left; display: flex; gap: 8px; align-items: baseline; }
}







#cl-kpis:not(.fin-kpis) { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.cl-sk-kpi { height: 110px; border-radius: 20px; }
.cl-sk-row { height: 62px; margin-bottom: 8px; border-radius: 14px; }
.cl-seg { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.cl-seg button {
  border: 1px solid var(--border); background: var(--panel); color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; white-space: nowrap;
}
.cl-seg button.on { background: var(--text); color: var(--panel); border-color: transparent; }
.cl-seg sup { font-size: 11px; color: var(--text-dim); font-weight: 600; }
.cl-seg button.on sup { color: color-mix(in srgb, var(--panel) 70%, transparent); }
.cl-warn { color: var(--red-ink); }
.cl-seg button.on .cl-warn { color: inherit; }
.cl-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.cl-filters .client-search-input { flex: 1 1 260px; max-width: none; margin: 0; }
.cl-select { width: auto; flex: none; border-radius: 10px; font-weight: 600; font-size: 13px; }

.cl-table { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; }
.cl-tr {
  display: grid; grid-template-columns: minmax(220px, 2fr) minmax(110px, 1fr) 64px 104px 96px minmax(190px, 1.7fr) 36px;
  gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; cursor: pointer;
  transition: background-color .15s ease;
}
.cl-tr:last-child { border-bottom: none; }
.cl-tr:not(.cl-th):hover, .cl-tr:focus-visible { background: var(--panel-2); outline: none; }
.cl-tr.is-done { opacity: .72; }
.cl-th { cursor: default; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-dim); background: var(--panel-2); }
.cl-who { display: flex; gap: 10px; align-items: center; min-width: 0; }
.cl-who-main { min-width: 0; }
.cl-ava { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none; }
.cl-ava-big { width: 64px; height: 64px; font-size: 24px; }
.cl-name { font-weight: 700; font-size: 13.5px; overflow-wrap: anywhere; }
.cl-sub { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.cl-dim { color: var(--text-dim); }
.cl-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cl-debt { color: var(--red-ink); font-weight: 700; }
.cl-next { font-size: 12.5px; min-width: 0; }
.cl-next-task { font-size: 12px; color: var(--text-dim); margin-top: 2px; overflow-wrap: anywhere; }
.cl-next-task.is-over { color: var(--red-ink); font-weight: 700; }
.clx-tag { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.clx-tag-regular { background: color-mix(in srgb, var(--yellow) 22%, transparent); color: var(--yellow-ink); }
.clx-tag-new { background: color-mix(in srgb, var(--accent-ink) 12%, transparent); color: var(--accent-ink); }
.clx-tag-done { background: var(--panel-2); color: var(--text-dim); }
.clx-tag-sleep { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red-ink); }
.cl-src { display: inline-flex; gap: 5px; align-items: center; font-weight: 600; }
.cl-src-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cl-act { display: flex; justify-content: flex-end; }
.cl-status-toggle {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: var(--panel);
  color: var(--text-dim); cursor: pointer; font-size: 14px; transition: background-color .15s ease, color .15s ease;
}
.cl-status-toggle:hover { background: var(--panel-2); color: var(--text); }


.cl-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cl-top-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cl-hero { display: flex; gap: 16px; align-items: center; margin: 0 0 16px; }
.cl-hero-main { min-width: 0; flex: 1; }
.cl-hero-name { margin: 0; font-size: 24px; line-height: 1.25; overflow-wrap: anywhere; }
.cl-hero-sub { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--text-dim); margin-top: 6px; }
.cl-kpi-debt .fin-kpi-value { color: var(--red-ink); }


.cl-hero-sub > span + span::before { content: '·'; margin-right: 6px; color: var(--text-dim); }
.cl-hero-sub > .badge + span::before { content: none; }
.cl-export { text-decoration: none; }
.cl-tabs.segmented { display: flex; flex-wrap: nowrap; width: max-content; max-width: 100%; }
.cl-tabs { margin: 4px 0 14px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.cl-tabs::-webkit-scrollbar { display: none; }
.cl-tabs button { white-space: nowrap; }
.cl-pane[hidden] { display: none; }
.cl-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cl-side { display: grid; gap: 16px; min-width: 0; }
.cl-side .client-panel { margin: 0; }
.cl-tl { position: relative; padding-left: 30px; }
.cl-tl::before { content: ''; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.cl-ev { position: relative; padding: 0 76px 16px 0; }
.cl-ev[data-cl-open-order], .cl-ev[data-open-dialog] { cursor: pointer; }
.cl-ev[data-cl-open-order]:hover .cl-ev-title, .cl-ev[data-open-dialog]:hover .cl-ev-title { text-decoration: underline; }
.cl-ev-ico {
  position: absolute; left: -30px; top: -1px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; background: var(--panel-2); box-shadow: 0 0 0 3px var(--panel);
}
.cl-ev-payment .cl-ev-ico { background: color-mix(in srgb, var(--green) 18%, var(--panel)); color: var(--green-ink); font-weight: 800; }
.cl-ev-done .cl-ev-ico { background: color-mix(in srgb, var(--green) 18%, var(--panel)); color: var(--green-ink); }
.cl-ev-when { position: absolute; right: 0; top: 1px; font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }
.cl-ev-title { font-weight: 700; font-size: 13px; }
.cl-ev-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 2px; overflow-wrap: anywhere; }
.cl-pay-actions { margin: -4px 0 12px; }
.cl-pay-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.cl-pay-row:last-child { border-bottom: none; }
.cl-file-row { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.cl-file-row:last-child { border-bottom: none; }
.cl-file-row:hover { background: var(--panel-2); }
.cl-file-ico { font-size: 18px; flex: none; }
.cl-file-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.cl-file-main b { overflow-wrap: anywhere; }
.cl-file-main .cl-dim { font-size: 12px; }


@container fin (max-width: 900px) {
  .cl-tr { grid-template-columns: minmax(200px, 2fr) 56px 100px 92px minmax(170px, 1.6fr) 36px; }
  .cl-tr > .cl-mgr, .cl-th > :nth-child(2) { display: none; }
  .cl-cols { grid-template-columns: 1fr; }
}


@container fin (max-width: 700px) {
  #cl-kpis:not(.fin-kpis) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-export { display: none; }
  .cl-seg { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -16px; padding-right: 16px; }
  .cl-seg::-webkit-scrollbar { display: none; }
  .cl-th { display: none; }
  .cl-tr { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who paid" "next debt" "next act"; gap: 6px 10px; padding: 12px; }
  .cl-tr > .cl-who { grid-area: who; }
  .cl-tr > .cl-paid { grid-area: paid; }
  .cl-tr > .cl-debt-cell { grid-area: debt; }
  .cl-tr > .cl-next { grid-area: next; padding-left: 46px; }
  .cl-tr > .cl-act { grid-area: act; align-self: end; }
  .cl-tr > .cl-orders, .cl-tr > .cl-mgr { display: none; }
  .cl-hero { align-items: flex-start; }
  .cl-ava-big { width: 52px; height: 52px; font-size: 20px; }
  .cl-hero-name { font-size: 20px; }
  .cl-topline { align-items: flex-start; }
  .cl-top-actions { justify-content: flex-start; }
  .cl-ev { padding-right: 0; }


  .cl-hero-sub { flex-direction: column; align-items: flex-start; gap: 3px; }
  .cl-hero-sub > span + span::before { content: none; }
  .cl-ev-when { position: static; display: block; margin-bottom: 2px; }
}


.cl-ava, .clx26-mgr-ava, .order-client-avatar { position: relative; overflow: hidden; }

.ava-photo { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); max-width: none; object-fit: cover; border-radius: inherit; }






#toast-root { pointer-events: none; }
#toast-root .toast-slot, #toast-root .toast-more { pointer-events: auto; }
#toast-root .toast-slot.toast-leaving, #toast-root .toast-card.toast-gone { pointer-events: none; }

.order-tasks-add {
  margin-left: auto; flex: none; height: 26px; padding: 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  background: color-mix(in srgb, currentColor 12%, transparent); color: var(--prio-med-ink);
  font: inherit; font-size: 11.5px; font-weight: 800;
}
.order-tasks-add:hover { background: color-mix(in srgb, currentColor 20%, transparent); }
.order-tasks-add + .order-tasks-all { margin-left: 4px; }



.dlg-contact-footer-row { display: flex; gap: 8px; margin: 2px 12px 12px; }
.dlg-contact-footer-row .dlg-contact-footer-btn { flex: 1 1 0; width: auto; margin: 0; }
.dlg-contact-footer-btn.is-danger { color: var(--red); }



.badge-source { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }


.login-stage .ls-2fa-code { margin: 10px 0 4px; }
.login-stage .ls-2fa-code label { display: block; margin-bottom: 6px; }
.login-stage .ls-2fa-code-row { display: flex; gap: 8px; }
.login-stage .ls-2fa-code-row input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--v-line, rgba(0,0,0,.14)); background: var(--v-soft); color: var(--v-text); font: 700 20px var(--v-font); letter-spacing: .25em; text-align: center; }
.login-stage .ls-2fa-code-row .btn { height: 46px; padding: 0 18px; }
