:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --surface-muted: #f6f8fa;
  --border: #d6e0eb;
  --border-strong: #bfcddd;
  --text: #142133;
  --text-secondary: #61738a;
  --muted: #71839a;
  --primary: #0fc7b8;
  --primary-dark: #05807a;
  --primary-soft: #e8f9f7;
  --success: #0aaa78;
  --success-soft: #e6f8f2;
  --warning: #c68718;
  --warning-soft: #fff9e9;
  --danger: #e0384d;
  --danger-soft: #fff0f2;
  --info: #168cb8;
  --info-soft: #eaf7fb;
  --radius-sm: 6px;
  --radius: 7px;
  --radius-lg: 8px;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 18px 55px rgba(9,19,33,.18);
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --transition: .16s ease;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background: var(--bg);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text); font-family: var(--font); letter-spacing: -.025em; }
h1 { font-size: 28px; line-height: 1.2; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 17px; }
.shell { width: 100%; max-width: none; min-height: 100vh; margin: 0; padding: 0; }
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: none; }
.muted { color: var(--muted); }

/* Shared brand mark */
.signal-brand { display: inline-flex; align-items: center; gap: 9px; }
.signal-brand img { width: 28px; height: 28px; padding: 3px; object-fit: contain; border-radius: 7px; background: #091321; }
.signal-brand > span { display: grid; line-height: 1; }
.signal-brand b { color: #091321; font-size: 14px; font-weight: 600; }
.signal-brand small { margin-top: 2px; color: var(--primary); font-size: 7px; font-weight: 700; letter-spacing: .08em; }
.signal-brand--light img { background: var(--primary); }
.signal-brand--light b { color: #fff; }

/* Application frame: mirrors the Figma 260px rail + 72px utility bar. */
.app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  grid-template-rows: 72px minmax(calc(100vh - 72px), auto);
  min-height: 100vh;
}
.grid { display: contents; }
.app-header {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  margin: 0;
  padding: 0 32px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #edf1f5;
  border-radius: 0;
  box-shadow: none;
}
.app-header__brand {
  position: fixed;
  z-index: 3;
  top: 20px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.app-logo {
  display: grid;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 3px;
  place-items: center;
  border-radius: 7px;
  color: #091321;
  background: var(--primary);
  box-shadow: none;
}
.app-logo img { width: 100%; height: 100%; object-fit: contain; }
.app-wordmark { display: flex; flex-direction: column; color: #fff; font-size: 14px; font-weight: 600; line-height: 1; }
.app-wordmark b { margin-top: 3px; color: var(--primary); font-size: 7px; letter-spacing: .08em; text-transform: uppercase; }
.user-line { display: none; }
.app-header__actions, .app-header__nav { display: flex; align-items: center; gap: 12px; }
.app-header__actions .btn, .app-header__nav .btn {
  min-height: 34px;
  padding: 7px 10px;
  color: #142133;
  background: transparent;
  border-color: transparent;
  border-radius: 5px;
  box-shadow: none;
  font-size: 12px;
  font-weight: 600;
}
.app-header__actions .btn:hover, .app-header__nav .btn:hover,
.app-header__nav .btn.is-active { color: var(--primary-dark); background: var(--primary-soft); border-color: transparent; }
.mobile-sites-toggle { display: none; }

/* Header icon buttons: Настройки / Оплата / Выйти — icon-only, tooltip via title. */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #61738a;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.icon-btn:hover { color: var(--primary-dark); background: var(--primary-soft); }
.icon-btn:focus-visible { outline: 3px solid rgba(15,199,184,.18); outline-offset: 1px; }
.icon-btn--logout { color: #b62639; background: #fff0f2; border-color: #f0c3ca; }
.icon-btn--logout:hover { color: #8f1c2b; background: #ffe3e7; border-color: #e39aa3; }

/* Cabinet-wide page and tab search. */
.global-search { position: relative; display: inline-flex; flex-direction: row-reverse; align-items: center; }
.global-search__box {
  position: relative;
  z-index: 60;
  width: min(300px, calc(100vw - 250px));
  margin-right: 6px;
  overflow: visible;
}
.global-search__box:not([hidden]) {
  animation: global-search-slide-in .18s ease-out both;
}
.global-search__input {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid #dce4ec;
  border-radius: 7px;
  outline: 0;
  color: #142133;
  background: #fff;
  font: 400 14px var(--font);
  box-shadow: 0 3px 10px rgba(9, 19, 33, .07);
}
.global-search__input:focus { box-shadow: inset 0 0 0 2px rgba(15, 199, 184, .22); }
.global-search__results {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid #dce4ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(9, 19, 33, .15);
}
@keyframes global-search-slide-in {
  from { width: 0; margin-right: 0; opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
.global-search__result {
  display: flex;
  width: 100%;
  padding: 9px 10px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 7px;
  color: #142133;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: 500 13px var(--font);
}
.global-search__result:hover, .global-search__result.is-active { color: var(--primary-dark); background: var(--primary-soft); }
.global-search__result svg { flex: 0 0 auto; color: #74869b; }
.global-search__empty { margin: 0; padding: 14px 10px; color: var(--muted); font-size: 13px; text-align: center; }

/* Custom language dropdown (Настройки → Язык интерфейса). */
.language-card__hint { margin: -4px 0 14px; color: var(--muted); font-size: 13px; }
.lang-select { position: relative; display: inline-block; }
.lang-select__trigger {
  display: grid;
  align-items: center;
  grid-template-columns: 28px 1fr 18px;
  gap: 10px;
  width: 230px;
  min-height: 44px;
  padding: 8px 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: 600 13px var(--font);
  cursor: pointer;
}
.lang-select__trigger:hover { border-color: #9cb0c5; box-shadow: 0 4px 14px rgba(9,19,33,.07); }
.lang-select__trigger:focus-visible { outline: 3px solid rgba(15,199,184,.18); outline-offset: 1px; }
.lang-select__flag { display: block; width: 28px; height: 20px; overflow: hidden; background: #fff; border: 1px solid #dbe4ee; border-radius: 5px; box-shadow: 0 1px 2px rgba(9,19,33,.08); }
.lang-select__flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lang-select__chevron { display: grid; place-items: center; color: var(--muted); transition: transform .16s ease; }
.lang-select__trigger[aria-expanded="true"] .lang-select__chevron { transform: rotate(180deg); }
.lang-select__menu {
  position: fixed;
  z-index: 1000;
  display: grid;
  width: 230px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  box-shadow: 0 12px 28px rgba(9,19,33,.14);
}
.lang-select__option {
  display: grid;
  align-items: center;
  grid-template-columns: 28px 1fr 18px;
  gap: 10px;
  min-height: 42px;
  padding: 7px 8px;
  color: var(--text);
  border-radius: 8px;
  font: 500 13px var(--font);
  cursor: pointer;
}
.lang-select__option:hover, .lang-select__option:focus { color: var(--primary-dark); background: var(--primary-soft); outline: none; }
.lang-select__option.is-selected { color: var(--primary-dark); background: var(--primary-soft); font-weight: 600; }
.lang-select__option.is-selected .lang-select__flag { border-color: #7bded6; box-shadow: 0 0 0 2px rgba(15,199,184,.12); }
.lang-select__check { display: grid; visibility: hidden; place-items: center; color: var(--primary); }
.lang-select__option.is-selected .lang-select__check { visibility: visible; }

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  grid-column: 1;
  grid-row: 1 / 3;
  width: 260px;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  padding: 112px 22px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #eaf1f8;
  background: #060e1a;
  border: 0;
  border-right: 1px solid #17293f;
  border-radius: 0;
}
#addSiteBtn,
#addSocialNetworksBtn {
  min-height: 40px;
  color: #091321;
  background: var(--primary);
  border-color: var(--primary);
  border-radius: 7px;
  box-shadow: none;
  font-size: 13px;
}
#addSiteBtn { margin-bottom: 26px; }
#addSocialNetworksBtn { margin-top: 14px; }
.sidebar-social-channels { display: grid; gap: 5px; margin-top: 8px; }
#addSiteBtn:hover,
#addSocialNetworksBtn:hover,
#addSocialNetworksBtn.is-active { color: #091321; background: #22d4c5; border-color: #22d4c5; }
.site-list { display: grid; gap: 6px; overflow: visible; }

/* Header breadcrumb ("Проекты"), left of the account/billing shortcuts. */
.app-header { justify-content: space-between; }
.breadcrumb-home {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font: 600 12px var(--font);
  cursor: pointer;
}
.breadcrumb-home:hover { color: var(--primary-dark); }

/* Logout — deliberately distinct from the neutral header actions (destructive-adjacent). */
.app-header__actions .btn--logout {
  color: #b62639;
  background: #fff0f2;
  border-color: #f0c3ca;
}
.app-header__actions .btn--logout:hover { color: #8f1c2b; background: #ffe3e7; border-color: #e39aa3; }

/* "Сайты" page — plain rows (Ваши сайты), lighter than the old dark sidebar cards. */
.site-rows { display: grid; gap: 2px; }
.site-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--border); }
.site-row:last-child { border-bottom: 0; }
.site-row__main { display: flex; flex: 1; min-width: 0; align-items: center; gap: 12px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.site-row__meta { display: grid; min-width: 0; gap: 2px; }
.site-row__meta strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.site-row__meta small { color: var(--muted); font-size: 11px; }
.site-row__status { margin-left: auto; }
.site-row.is-active { background: var(--primary-soft); border-radius: 6px; }
.site-row__delete { display: grid; flex: 0 0 30px; width: 30px; height: 30px; padding: 0; place-items: center; color: var(--muted); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.site-row__delete:hover { color: var(--danger); background: var(--danger-soft); }

/* "Настройки виджета" — form + live preview. */
.sidebar-overview {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  color: #c2d1e1;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  font: 500 13px var(--font);
  text-align: left;
  cursor: pointer;
}
.sidebar-overview__icon { display: grid; width: 18px; height: 18px; place-items: center; color: var(--primary); background: transparent; border-radius: 0; }
.sidebar-overview:hover, .sidebar-overview.is-active { color: #fff; background: #16273c; border-color: transparent; }
.channel-card { display: grid; gap: 16px; padding: 20px; }
.channel-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.channel-stats article { display: grid; gap: 2px; padding: 11px 13px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 9px; }
.channel-stats span { color: var(--muted); font-size: 11px; }.channel-stats b { font-size: 19px; line-height: 1.2; }
.channel-card__head { display: grid; grid-template-columns: 46px minmax(0,1fr) auto; align-items: center; gap: 12px; padding-bottom: 2px; }
.channel-card__icon { display: grid; width: 46px; height: 46px; place-items: center; color: #229ed9; background: #eaf7fd; border-radius: 12px; }
.channel-card__icon svg { width: 26px; height: 26px; }
.channel-card__head h2 { margin: 0 0 3px; font-size: 19px; }
.channel-card__head p, .channel-card__body p { margin: 0; color: var(--muted); font-size: 13px; }
.channel-card__body { padding: 22px; background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius); }
.channel-card__body h3 { margin: 0 0 6px; font-size: 16px; }
.channel-card__body .btn { margin-top: 18px; }
.channel-card__body--notice { background: #fff8e6; border-color: #f2d98a; }
.channel-card__body--notice p { color: #8a6d1a; }
.channel-card__error { margin-top: 10px !important; color: var(--danger) !important; }
.channel-bot { display: flex; align-items: center; gap: 11px; padding: 12px 14px; background: #f7f9fb; border: 1px solid var(--border); border-radius: 10px; }
.channel-bot__avatar { display: grid; flex: 0 0 36px; width: 36px; height: 36px; place-items: center; color: #fff; background: #229ed9; border-radius: 50%; font-size: 12px; font-weight: 700; }
.channel-bot div { display: grid; gap: 2px; }
.channel-bot a { color: #168cb8; text-decoration: none; }
.channel-bot small { color: var(--muted); }
.channel-card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 14px; border-top: 1px solid var(--border); }
.channel-error p { color: var(--danger); }
.social-wizard .setup-wizard__intro h1 { margin: 0 0 6px; font-size: 28px; }
.setup-progress.setup-progress--three { grid-template-columns: repeat(3,minmax(0,1fr)); }
.social-channel-grid, .social-site-options { display: grid; gap: 10px; }
.social-channel-grid { grid-template-columns: 1fr; }
.social-channel-option, .social-site-option { display: flex; align-items: center; gap: 13px; min-height: 78px; padding: 15px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 8px; text-align: left; cursor: pointer; transition: border-color var(--transition),background var(--transition); }
.social-channel-option:hover, .social-site-option:hover { background: var(--primary-soft); border-color: var(--primary); }
.social-channel-option > span:nth-child(2), .social-site-option > span:nth-child(2) { display: grid; min-width: 0; gap: 3px; }
.social-channel-option small, .social-site-option small, .social-selected-site small { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.social-channel-option > i, .social-site-option > i { margin-left: auto; color: var(--primary-dark); font-style: normal; font-size: 20px; }
.social-channel-option__icon { display: grid; flex: 0 0 46px; width: 46px; height: 46px; place-items: center; color: var(--muted); background: #eef3f6; border-radius: 10px; font-weight: 700; }
.social-channel-option__icon--telegram { color: #229ed9; background: #eaf7fd; }
.social-channel-option__icon--instagram, .channel-card__icon--instagram, .sidebar-channel__icon--instagram { color: #d6249f; background: #fdf1f8; }
.social-channel-option__icon--whatsapp, .channel-card__icon--whatsapp, .sidebar-channel__icon--whatsapp { color: #25d366; background: #eafaf1; }
.social-channel-option__icon--messenger { color: #168aff; background: #edf6ff; }
.social-channel-option.is-disabled { opacity: .55; cursor: not-allowed; }
.social-channel-option.is-disabled:hover { background: #fff; border-color: var(--border); }
.social-site-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.social-selected-site { display: flex; align-items: center; gap: 11px; padding: 13px; background: var(--primary-soft); border: 1px solid #b8e7e0; border-radius: 8px; }
.social-selected-site > div { display: grid; gap: 2px; }
.telegram-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding-top: 4px; }
.telegram-settings > .telegram-settings__grid,.telegram-settings > .telegram-settings__logo,.telegram-settings > .manager-settings,.telegram-settings > .channel-card__actions { grid-column: 1/-1; }
.telegram-settings__grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 14px; }
.telegram-settings__wide { grid-column: 1/-1; }
.telegram-settings label { padding: 0; }
.telegram-settings input,.telegram-settings select { min-height: 40px; }
.telegram-settings textarea { width: 100%; min-height: 72px; max-height: min(190px,36vh); overflow-y: auto; resize: vertical; }
.telegram-settings .field small { color: var(--muted); font-size: 10px; }
.telegram-settings__logo { display: grid; justify-items: start; gap: 7px; padding: 2px 0; background: transparent; border: 0; }
.telegram-settings__logo > span { font-size: 12px; font-weight: 600; }
.telegram-logo-upload { display: flex; width: auto; min-width: 220px; min-height: 54px; align-items: center; gap: 10px; padding: 8px 13px !important; background: #f8fafc; border: 1px dashed var(--border-strong); border-radius: 9px; cursor: pointer; transition: border-color .16s ease,background .16s ease; }
.telegram-logo-upload:hover { background: #f1f8fa; border-color: #71cfc6; }
.telegram-logo-upload > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.telegram-logo-upload b { color: var(--text); font-size: 13px; line-height: 1.25; white-space: nowrap; }
.telegram-logo-upload small { color: var(--muted); font-size: 10px; }
.telegram-logo-preview { display: grid; width: 34px; height: 34px; place-items: center; color: #168cb8; background: #eaf7fd; border-radius: 50%; font-size: 12px; font-weight: 700; }
.telegram-ai-toggle { display: flex; width: 100%; min-height: 44px; align-items: center; gap: 10px; padding: 10px 12px !important; color: var(--text); background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.telegram-ai-toggle:has(input:checked) { color: #075f5a; background: #effaf8; border-color: #a9e4dd; }
.telegram-ai-toggle input { flex: 0 0 auto; width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--primary-dark); }
.profile-sync-state { align-self: center; color: var(--warning); font-size: 11px; }
.telegram-logo-editor { width: min(92vw,560px); padding: 0; border: 0; border-radius: 10px; box-shadow: var(--shadow-lg); }
.telegram-logo-editor::backdrop { background: rgba(9,19,33,.55); }
.telegram-logo-editor canvas { display: block; width: min(100%,360px); aspect-ratio: 1; margin: 0 auto; background: #eef3f6; border-radius: 50%; }
.telegram-logo-editor__position { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 650px) { .channel-card__head { grid-template-columns: 46px 1fr; } .channel-card__head > .badge { grid-column: 2; justify-self: start; } }
@media (max-width: 760px) { .setup-progress.setup-progress--three, .social-channel-grid, .social-site-options, .telegram-settings,.telegram-settings__grid { grid-template-columns: 1fr; } .telegram-settings__wide { grid-column: auto; } }
.site-card {
  position: relative;
  width: 100%;
  padding: 9px 8px 9px 12px;
  color: #c8d6e6;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  box-shadow: none;
}
.site-card:hover { color: #fff; background: #142334; border-color: transparent; transform: none; box-shadow: none; }
.site-card.is-active { color: #fff; background: #17293f; border-color: transparent; box-shadow: inset 3px 0 var(--primary); }
.site-card__main { display: flex; width: 100%; min-width: 0; align-items: flex-start; gap: 9px; padding: 0; color: inherit; background: transparent; border: 0; text-align: left; cursor: pointer; }
.site-avatar { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; color: #091321; background: #dffaf7; border-radius: 6px; font-size: 11px; font-weight: 700; }
.site-card__meta { display: grid; min-width: 0; gap: 2px; justify-items: start; }
.site-card strong { max-width: 145px; margin: 0; overflow: hidden; color: inherit; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.site-card small { max-width: 145px; overflow: hidden; color: #93abc7; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.site-card__status { margin-top: 4px; padding: 3px 7px; font-size: 9px; }

.detail {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - 72px);
  padding: 38px 40px 56px;
  overflow: hidden;
  background: #f6f8fa;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.detail > * { max-width: 100%; }
.detail.detail--widget-builder, .detail:has(.widget-settings-layout) { overflow: visible; }

/* Core UI primitives */
.btn { min-height: 40px; padding: 9px 16px; border-radius: 7px; font: 600 12px var(--font); box-shadow: none; }
.btn--primary { color: #091321; background: var(--primary); border-color: var(--primary); box-shadow: none; }
.btn--primary:hover { color: #091321; background: #22d4c5; border-color: #22d4c5; box-shadow: none; transform: none; }
.btn--ghost { color: var(--text); background: #fff; border-color: var(--border); }
.btn--ghost:hover { color: var(--primary-dark); background: #fff; border-color: #9cb0c5; }
.btn--danger { color: #b62639; background: #fff0f2; border-color: #efb2ba; }
.btn--danger:hover { background: #ffe5e9; border-color: #e98c98; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(15,199,184,.18); outline-offset: 1px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.field { gap: 7px; }
.field > span, .field-label { color: var(--text); font-size: 12px; font-weight: 600; }
input, textarea, select { min-height: 42px; padding: 10px 13px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 6px; font: 13px var(--font); }
input:focus, textarea:focus, select:focus { border-color: var(--primary); box-shadow: none; }
/* Keep every multiline editor usable without letting it stretch a whole page. */
textarea { max-height: min(260px,42vh); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #b9c7d5 transparent; }
textarea::-webkit-scrollbar { width: 8px; }
textarea::-webkit-scrollbar-track { background: transparent; }
textarea::-webkit-scrollbar-thumb { background: #c2ced9; border: 2px solid #fff; border-radius: 999px; }
textarea::-webkit-scrollbar-thumb:hover { background: #9eafbf; }
.setup-field textarea { max-height: min(300px,46vh); }
.tabs { padding: 3px; background: #eef3f6; border-color: var(--border); border-radius: 6px; }
.tabs button { border-radius: 4px; font-size: 12px; }
.tabs .active { color: var(--primary-dark); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 0; border-radius: 999px; font-size: 9px; font-weight: 600; text-transform: none; }
.badge i, .badge::before { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.badge--success { color: #079669; background: #e6f8f2; }
.badge--warning { color: #a66b05; background: #fff5dc; }
.badge--danger { color: #c42f43; background: #ffecef; }
.badge--info { color: #087b9f; background: #e7f6fb; }
.badge--muted { color: #64748b; background: #edf1f5; }
.code { background: #091321; border-color: #172b44; border-radius: 6px; }

/* Screen patterns from the Figma frames */
.screen-heading { margin: 0 0 34px; }
.screen-heading h1 { margin: 0 0 4px; font-size: 28px; }
.screen-heading p { margin: 0; color: var(--muted); font-size: 13px; }
.figma-card, .card, .item, .stat, .work-section, .setup-step {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}
.figma-card { padding: 24px; }
.figma-card h2 { margin: 0 0 22px; }
.figma-kpis { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 28px; margin-bottom: 28px; }
.figma-kpis article { min-height: 135px; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.figma-kpis span, .figma-kpis small { display: block; color: var(--muted); font-size: 12px; }
.figma-kpis b { display: block; margin: 12px 0 5px; color: var(--text); font-size: 30px; line-height: 1; }
.figma-kpis small { color: var(--success); font-weight: 600; }
.figma-kpis__date { font-size: 26px !important; }

.breadcrumbs { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--muted); font-size: 10px; }
.breadcrumbs button { padding: 0; color: var(--primary-dark); background: transparent; border: 0; }
.site-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 12px 20px; margin-bottom: 24px; }
.site-head__main { display: flex; min-width: 0; align-items: center; gap: 12px; }
.project-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: #23468d; background: #e8eeff; border-radius: 7px; font-weight: 600; }
.project-avatar--large { width: 42px; height: 42px; }
.site-head h2 { margin: 0 0 4px; font-size: 25px; }
.site-head a { color: var(--muted); font-size: 11px; text-decoration: none; }
.site-head__actions { display: flex; gap: 9px; }
.site-head__meta { grid-column: 1/-1; display: flex; align-items: center; gap: 12px; padding-left: 0; color: var(--muted); font-size: 10px; }
.site-head__meta > span:not(.badge)::before { display: none; }
.status-hero { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; padding: 20px; border: 1px solid var(--border); border-left: 1px solid var(--border); border-radius: 8px; }
.status-hero__icon { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border-radius: 50%; }
.status-hero__body { flex: 1; }
.status-hero__top { font-size: 16px; }
.status-hero__sub { margin-top: 4px; font-size: 11px; }
.status-hero--success { color: var(--text); background: #e8f9f5; border-color: #9edfcf; }
.status-hero--success .status-hero__icon { color: #fff; background: var(--success); }
.status-hero--warning { background: var(--warning-soft); border-color: #f0ca69; }
.status-hero--info { background: var(--info-soft); border-color: #a8d8e7; }
.status-hero--danger { background: var(--danger-soft); border-color: #efb2ba; }
.hero-bar { height: 8px; margin-top: 16px; background: #dfe9ed; border-radius: 10px; }
.hero-bar i { background: var(--primary); }
.site-nav { display: flex; gap: 0; margin: 0 0 22px; padding: 0; overflow-x: auto; background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.nav-btn { flex: 0 0 auto; min-height: 48px; padding: 12px 16px; color: var(--text); background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: 16px; font-weight: 600; }
.nav-btn:hover { color: var(--primary-dark); background: transparent; }
.nav-btn.is-active { color: var(--primary-dark); background: transparent; border-color: var(--primary); box-shadow: none; font-weight: 700; }
#sub { margin: 0; padding: 0; border: 0; }
.work-section { padding: 22px; }
.item { border-radius: 7px; }

/* Installation, scan and widget screens */
.setup-wizard { max-width: 1100px; }
.setup-wizard__top { margin-bottom: 24px; }
.setup-progress { gap: 0; margin: 24px 0; }
.setup-progress__item { border-radius: 0; border-color: var(--border); background: #fff; }
.setup-progress__item.is-current { color: var(--primary-dark); background: var(--primary-soft); border-color: var(--primary); }
.setup-progress__item.is-current span, .setup-progress__item.is-done span { color: #091321; background: var(--primary); }
.setup-step { max-width: 780px; padding: 26px; }
.setup-step__head h3 { font-size: 20px; }
.setup-callout, .setup-pages, .setup-extras { border-radius: 7px; }
.plugin-sync-status { border-radius: 8px; }

/* Account and billing */
.add-site-page { width: min(780px,100%); margin-inline: auto; }
.add-site-page .setup-wizard__top { margin-bottom: 22px; }
.add-site-card form { gap: 20px; }
.add-site-card__actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 2px; }
.account-settings-page { width: min(700px,100%); margin-inline: auto; }
.account-card { width: min(700px,100%); }
.account-card form { max-width: 610px; }
.account-card .btn { width: 190px; }
.account-divider { margin: 8px 0 0; padding-top: 18px; border-top: 1px solid var(--border); }
.usage-bar { height: 12px; overflow: hidden; background: #e2ebef; border-radius: 20px; }
.usage-bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .25s ease; }

.billing-plans { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 20px; margin-bottom: 24px; }
.billing-plan-card { display: flex; flex-direction: column; gap: 6px; }
.billing-plan-card.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.billing-plan-card h2 { margin: 6px 0 2px; font-size: 24px; }
.billing-plan-card > b { font-size: 18px; }
.billing-plan-card > b small { color: var(--muted); font-size: 12px; font-weight: 400; }
.billing-plan-card__limit { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.billing-plan-card__features { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.billing-plan-card .btn { margin-top: auto; }

.billing-banner { padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; font-size: 14px; }
.billing-banner--warning { background: #fff7e6; border: 1px solid #f3d38a; color: #8a5a00; }
.billing-banner--danger { background: #fdeceb; border: 1px solid #f3b4ae; color: #a12a20; }
.billing-banner--action { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.billing-banner--action .btn { flex: none; }
.billing-banner__meta { margin-top: 4px; }

.billing-usage-card { margin-bottom: 24px; }
.billing-usage-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 18px; }
.billing-usage-card__meta { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); font-size: 12px; }
.billing-usage-row { margin-bottom: 18px; }
.billing-usage-row__head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.billing-usage-row__head b { font-weight: 600; }
.billing-bar--warning i { background: #e0a92b; }
.billing-bar--danger i { background: #d64545; }
.billing-channel-breakdown { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.billing-usage-row__head { gap: 12px; }
.billing-usage-row__head b { flex: none; white-space: nowrap; }
.billing-usage-row__head .badge { margin-left: 6px; vertical-align: 1px; white-space: normal; }
.billing-usage-row__note { font-size: 12px; margin: 6px 0 0; }

.billing-payments .analytics-table td, .billing-payments .analytics-table th { padding: 10px 14px; }
.billing-invoice-link { display: inline-block; min-height: 32px; min-width: 32px; padding: 6px 0; line-height: 20px; color: var(--text); font-weight: 600; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }

.billing-confirm-dialog { border: none; border-radius: 14px; padding: 0; max-width: 420px; width: min(420px,90vw); }
.billing-confirm-dialog::backdrop { background: rgba(15,23,32,.45); }
.billing-confirm-dialog .row { display: flex; gap: 10px; margin-top: 18px; }
.billing-confirm-dialog__reason { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; color: var(--muted); }
.billing-confirm-dialog__reason textarea { width: 100%; resize: vertical; font: inherit; color: var(--text, inherit); }

@media (max-width: 900px) {
  .billing-plans { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .billing-banner--action { flex-direction: column; align-items: stretch; }
}

@media (max-width: 760px) {
  .add-site-card__actions { flex-direction: column-reverse; }
  .add-site-card__actions .btn { width: 100%; }
}

/* Dialogs correspond to the add-site and plugin-data Figma states. */
dialog { width: min(720px,calc(100vw - 32px)); padding: 0; overflow: hidden; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(9,19,33,.58); backdrop-filter: blur(2px); }
.dialog-body { padding: 26px; }
.dialog-body h3 { font-size: 18px; }
.plugin-setup-dialog { width: min(700px,calc(100vw - 32px)); }
.plugin-setup-steps { border-radius: 7px; }
.empty-state { min-height: 340px; }
.empty-state__icon { background: #091321; border-radius: 8px; box-shadow: none; }
.empty-state__icon img { width: 44px; height: 44px; object-fit: contain; }

/* Auth screens */
body:has(.auth-wrap) { background: #f6f8fa; }
.auth-wrap { display: grid; grid-template-columns: minmax(320px,500px) 1fr; min-height: 100vh; padding: 0; }
.auth-locale {
  position: absolute;
  z-index: 5;
  top: 28px;
  right: 32px;
  width: 174px;
}
.auth-locale__trigger {
  display: grid;
  width: 100%;
  min-height: 44px;
  padding: 7px 11px;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 8px;
  color: #0f172a;
  font: 600 13px var(--font);
  text-align: left;
  background: rgba(255,255,255,.96);
  border: 1px solid #d5dfeb;
  border-radius: 11px;
  box-shadow: 0 3px 12px rgba(9,19,33,.06);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.auth-locale__trigger:hover { border-color: #a9baca; box-shadow: 0 6px 18px rgba(9,19,33,.09); transform: translateY(-1px); }
.auth-locale__trigger:focus-visible { outline: 3px solid rgba(15,199,184,.18); outline-offset: 2px; }
.auth-locale__flag { display: block; width: 28px; height: 20px; overflow: hidden; background: #fff; border: 1px solid #dbe4ee; border-radius: 5px; box-shadow: 0 1px 2px rgba(9,19,33,.08); }
.auth-locale__flag img { display: block; width: 100%; height: 100%; object-fit: cover; }
.auth-locale__chevron { width: 18px; height: 18px; fill: none; stroke: #61738a; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .16s ease; }
.auth-locale__trigger[aria-expanded="true"] .auth-locale__chevron { transform: rotate(180deg); }
.auth-locale__menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 100%;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border: 1px solid #dbe4ee;
  border-radius: 12px;
  box-shadow: 0 16px 38px rgba(9,19,33,.15);
}
.auth-locale__option { display: grid; min-height: 40px; padding: 6px 7px; grid-template-columns: 30px 1fr 18px; align-items: center; gap: 9px; color: #334155; font-size: 13px; border-radius: 8px; cursor: pointer; outline: none; }
.auth-locale__option:hover, .auth-locale__option:focus { color: #063f3b; background: #ecfdfb; }
.auth-locale__option.is-selected { color: #063f3b; font-weight: 600; background: #e1faf7; }
.auth-locale__option.is-selected .auth-locale__flag { border-color: #7bded6; box-shadow: 0 0 0 2px rgba(15,199,184,.12); }
.auth-locale__option svg { visibility: hidden; width: 18px; height: 18px; fill: none; stroke: #0aa89c; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-locale__option.is-selected svg { visibility: visible; }
.auth-story { position: relative; display: flex; min-height: 100vh; padding: 46px 58px; flex-direction: column; color: #fff; background: #091321; }
.auth-story__flow { margin-top: 125px; }
.auth-story__flow > p { margin: 0 0 30px; color: var(--primary); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.auth-story__flow ol { display: grid; gap: 25px; margin: 0; padding: 0; list-style: none; }
.auth-story__flow li { display: flex; align-items: center; gap: 13px; }
.auth-story__flow i { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; color: var(--primary); border: 1px solid #05807a; border-radius: 7px; background: #0e1c30; }
.auth-story__flow i svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.auth-story__flow span { display: grid; gap: 2px; }
.auth-story__flow b { font-size: 14px; }
.auth-story__flow small { color: #597394; font-size: 11px; }
.auth-story__copyright { position: absolute; bottom: 58px; left: 58px; color: #405973; font-size: 10px; }
.auth-card { align-self: center; justify-self: center; width: 420px; min-height: 590px; max-width: calc(100vw - 40px); padding: 34px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: none; }
.auth-brand { margin-bottom: 28px; text-align: left; }
.auth-brand .signal-brand { margin-bottom: 45px; }
.auth-brand h1 { margin: 0 0 6px; font-size: 25px; text-align: left; }
.auth-lead { margin: 0; color: var(--muted); font-size: 13px; text-align: left; }
#authTabs { display: none; }
.auth-body { min-height: 0; }
.auth-form { gap: 14px; }
.auth-form .field > label { color: var(--text); font-size: 12px; font-weight: 600; }
.auth-form .password-control { position: relative; display: block; color: var(--text); font-size: 15px; font-weight: 400; }
.password-control input { padding-right: 46px; }
.password-toggle { position: absolute; top: 50%; right: 7px; display: grid; width: 32px; height: 32px; padding: 0; place-items: center; color: #71839a; background: transparent; border-radius: 7px; transform: translateY(-50%); }
.password-toggle:hover { color: #087d75; background: #e9faf8; }
.password-toggle:active:not(:disabled) { transform: translateY(calc(-50% + 1px)); }
.password-toggle:focus-visible { color: #087d75; outline: 3px solid rgba(15,199,184,.18); outline-offset: 0; }
.password-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-toggle__hide { display: none; }
.password-toggle.is-visible .password-toggle__show { display: none; }
.password-toggle.is-visible .password-toggle__hide { display: block; }
.auth-form .btn--primary { margin-top: 4px; }
.auth-footer { margin: -7px 0 0; text-align: right; }
.linkbtn, .auth-switch button { padding: 0; color: var(--primary-dark); font: 600 11px var(--font); background: transparent; border: 0; cursor: pointer; }
.auth-switch { margin: 3px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.auth-terms { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.auth-terms input { width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--primary); }
.auth-oauth { margin: 4px 0 0; }
.btn--google { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--text); background: #fff; }
.btn--google svg { width: 18px; height: 18px; flex: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }


/* ── Project screen: header, status hero, section tabs ─────────────────────
   Everything on the project page uses the full available width, one 8px radius
   and the teal/navy palette; the old indigo avatar and the pill-shaped
   "last updated" chip were the last leftovers of the previous theme. */
.detail > *, .detail > #sub { max-width: 100%; }

.breadcrumbs { margin-bottom: 20px; font-size: 12px; }
.breadcrumbs button { color: var(--muted); font-weight: 500; }
.breadcrumbs button:hover { color: var(--primary-dark); }
.breadcrumbs > span[aria-hidden] { color: #b3c0d0; }
.breadcrumbs > span:last-child { color: var(--text); font-weight: 600; }

.site-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 26px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.project-avatar {
  flex: 0 0 34px;
  color: #05413d;
  background: #dffaf7;
  font-size: 13px;
  font-weight: 700;
}
.project-avatar--large { width: 44px; height: 44px; border-radius: 9px; font-size: 17px; }
.site-head__ident { min-width: 0; }
.site-head h2 { margin: 0 0 3px; font-size: 24px; line-height: 1.2; }
.site-head__ident a {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-head__ident a:hover { color: var(--primary-dark); }
.site-head__actions { display: flex; gap: 8px; align-items: center; }
.site-head__meta {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding-left: 0;
  color: var(--muted);
  font-size: 12px;
}
.site-head__meta > span:not(.badge) { position: relative; }
.site-head__meta > span:not(.badge)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -10px;
  width: 3px;
  height: 3px;
  display: block;
  border-radius: 50%;
  background: #c2cede;
  transform: translateY(-50%);
}

.status-hero { gap: 13px; margin-bottom: 24px; padding: 18px 20px; border-radius: 8px; }
.status-hero__icon { flex: 0 0 26px; width: 26px; height: 26px; margin-top: 1px; font-size: 13px; font-weight: 700; }
.status-hero__body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.status-hero__copy { min-width: 0; }
.status-hero__top { font-size: 15px; font-weight: 600; }
.status-hero__sub { margin-top: 5px; font-size: 12px; }
.status-hero__hint { margin-top: 7px; font-size: 12px; line-height: 1.5; }
.status-hero__meta { margin-top: 6px; color: var(--text-secondary); font-size: 12px; }
.status-hero__actions { margin-top: 0; gap: 8px; }

/* Steady states ("Ассистент готов") collapse to a single row: label + timestamp
   on the left, the one available action on the right. */
.status-hero--compact { align-items: center; padding: 15px 18px; }
.status-hero--compact .status-hero__icon { margin-top: 0; }
.status-hero--compact .status-hero__body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.status-hero--compact .status-hero__actions { flex: 0 0 auto; }
.status-hero--compact .status-hero__meta {
  width: auto;
  margin-top: 3px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: var(--muted);
  font-weight: 400;
}
.status-hero .btn--sm { min-height: 34px; padding: 7px 13px; font-size: 12px; }

.site-nav { gap: 2px; margin: 0 0 24px; }
.site-nav .nav-btn { padding: 12px 4px; margin-right: 28px; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--text); }
.site-nav .nav-btn:last-child { margin-right: 0; }
.site-nav .nav-btn.is-active { font-weight: 700; color: var(--primary-dark); border-bottom-width: 3px; }

/* Terminal "nothing left to do" panel (e.g. Установка → код уже стоит). */
.empty-panel {
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.empty-panel > span { width: 28px; height: 28px; color: #05413d; background: var(--primary-soft); font-size: 13px; font-weight: 700; }
.empty-panel h4 { margin: 0 0 3px; font-size: 14px; }
.empty-panel p { font-size: 12px; }
.empty-panel--done { border-color: #b8e7e0; background: var(--primary-soft); }
.empty-panel--done > span { color: #fff; background: var(--success); }

@media (max-width: 1000px) {
  .app { grid-template-columns: 230px minmax(0,1fr); }
  .sidebar { width: 230px; padding-inline: 18px; }
  .detail { padding: 32px 28px 48px; }
  .figma-kpis { gap: 14px; }
  .auth-wrap { grid-template-columns: minmax(300px,38%) 1fr; }
  .auth-story { padding-inline: 38px; }
}

@media (max-width: 760px) {
  .app { display: block; padding-bottom: 64px; }
  .app-header { position: fixed; z-index: 40; right: 0; bottom: 0; left: 0; display: flex; height: 64px; min-height: 64px; padding: 8px 14px; justify-content: space-between; border-top: 1px solid var(--border); border-bottom: 0; }
  .app-header__brand { position: static; }
  .app-logo { width: 36px; height: 36px; }
  .app-wordmark { color: #091321; }
  .app-header__nav { display: none; }
  .app-header__actions { width: 100%; justify-content: space-between; }
  .app-header__brand { display: none; }
  .mobile-sites-toggle { display: inline-flex; }
  .sidebar { position: fixed; z-index: 50; top: 0; bottom: 64px; left: 0; width: min(300px,86vw); height: auto; max-height: none; min-height: 0; padding: 40px 20px; transform: translateX(-105%); transition: transform .2s ease; }
  body.project-drawer-open .sidebar { transform: translateX(0); }
  .detail { min-height: calc(100vh - 64px); padding: 28px 18px 44px; }
  .screen-heading { margin-bottom: 24px; }
  .screen-heading h1 { font-size: 24px; }
  .figma-kpis { grid-template-columns: 1fr; gap: 10px; }
  .figma-kpis article { min-height: 108px; padding: 18px; }
  .site-head { grid-template-columns: auto minmax(0,1fr); }
  .site-head__actions { grid-column: 1 / -1; width: 100%; }
  .site-head__meta { grid-column: 1 / -1; }
  .status-hero--compact .status-hero__body { flex-direction: column; align-items: flex-start; gap: 12px; }
  .site-head__actions .btn { flex: 1; }
  .auth-wrap { display: block; padding: 76px 14px 24px; }
  .auth-locale { top: 20px; right: 20px; }
  .auth-story { display: none; }
  .auth-card { width: min(420px,100%); min-height: 0; margin: 0 auto; padding: 26px 22px; }
  .auth-brand .signal-brand { margin-bottom: 30px; }
}

.sidebar-channel-group{display:grid;gap:3px}
.sidebar-dialog__avatar{display:grid;width:27px;height:27px;place-items:center;border-radius:50%;background:#dff8f5;color:#087d77;font-size:11px;font-weight:700}
.omni-inbox{max-width:980px;margin:0 auto;display:grid;gap:18px}.omni-inbox__top{display:flex;align-items:center;justify-content:space-between}.omni-thread{padding:0;overflow:hidden}.omni-thread>header{display:flex;align-items:center;justify-content:space-between;padding:20px 24px;border-bottom:1px solid var(--border)}.omni-thread>header h2{margin:0 0 4px}.omni-thread>header p{margin:0;color:var(--muted);font-size:13px}.omni-thread__modes{display:flex;gap:8px;padding:12px 24px;border-bottom:1px solid var(--border)}.omni-thread__messages{height:min(58vh,620px);overflow:auto;display:flex;flex-direction:column;gap:10px;padding:22px;background:#f6f8fa}.omni-message{max-width:74%;padding:10px 13px;border:1px solid var(--border);border-radius:12px;background:#fff}.omni-message.is-outbound{align-self:flex-end;background:#dcf7f3;border-color:#aae4dc}.omni-message small{color:var(--muted);font-size:10px}.omni-message p{margin:4px 0 0;white-space:pre-wrap}.omni-reply{display:grid;grid-template-columns:1fr auto;gap:10px;padding:16px 24px}.omni-reply input{min-width:0;padding:11px 13px;border:1px solid var(--border);border-radius:8px}
.omni-thread__modes .btn[aria-pressed="true"]{color:#fff;background:var(--primary);border-color:var(--primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--primary) 18%,transparent)}
.omni-thread__modes .btn[aria-pressed="true"]::before{content:'✓';font-weight:800}
.omni-thread__modes .btn[data-omni-mode][aria-pressed="false"]{color:var(--muted);background:transparent;border-color:var(--border);box-shadow:none;opacity:.75}.omni-thread__modes .btn[data-omni-mode][aria-pressed="false"]:hover,.omni-thread__modes .btn[data-omni-mode][aria-pressed="false"]:focus-visible{opacity:1;color:var(--text,inherit)}
.telegram-public-link{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0;padding:12px 14px;border:1px solid #b8e7e0;border-radius:10px;background:linear-gradient(135deg,#effbf9,#f6fcfb)}.telegram-public-link>div{display:grid;gap:2px}.telegram-public-link>div:last-child{display:flex;flex-wrap:wrap;gap:6px}.telegram-public-link .btn{min-height:34px;padding:7px 11px}.telegram-public-link span,.telegram-public-link small{color:var(--muted);font-size:11px}.telegram-public-link b{font-size:13px;overflow-wrap:anywhere}.telegram-qr-dialog .dialog-body{display:grid;gap:14px;place-items:center;padding:24px}.telegram-qr-dialog img{width:280px;height:280px}.telegram-qr-dialog p{max-width:320px;overflow-wrap:anywhere;color:var(--muted)}
.social-management{max-width:1040px;margin:0 auto;display:grid;gap:14px}.social-management .screen-heading{margin:0}.social-management .screen-heading h1{font-size:26px;letter-spacing:-.025em}.social-management__tabs{display:flex;gap:4px;padding:4px;width:fit-content;border:1px solid var(--border);border-radius:10px;background:#eef2f6}.social-management__tabs .btn{min-height:34px;padding:7px 13px;border:0;box-shadow:none}.omni-list{padding:0;overflow:hidden}.omni-list__head{display:flex;align-items:center;justify-content:space-between;padding:20px 22px;border-bottom:1px solid var(--border)}.omni-list__head h2{margin:0}.omni-list__head span{color:var(--muted);font-size:13px}.omni-list__item{width:100%;display:grid;grid-template-columns:36px minmax(0,1fr) auto auto;gap:12px;align-items:center;padding:13px 22px;border:0;border-bottom:1px solid var(--border);background:#fff;text-align:left;cursor:pointer}.omni-list__item:hover{background:var(--surface-muted)}.omni-list__item>span:nth-child(2){min-width:0;display:grid;gap:4px}.omni-list__item b,.omni-list__item small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.omni-list__item small,.omni-list__item time{color:var(--muted);font-size:12px}.omni-list__item>i{min-width:20px;padding:3px 6px;border-radius:12px;background:var(--primary);color:#fff;font-size:11px;font-style:normal;text-align:center}
.manager-settings{display:grid;gap:12px;margin-top:0;padding:14px;border:1px solid var(--border);border-radius:10px;background:#f7f9fb}.manager-settings h3,.manager-settings p{margin:0}.manager-settings h3{font-size:15px}.manager-settings p{margin-top:3px;color:var(--muted);font-size:12px}.manager-settings .telegram-ai-toggle{background:#fff}.channel-card__actions #telegramDisconnect,.channel-card__actions #instagramDisconnect,.channel-card__actions #whatsappDisconnect{margin-left:auto}.omni-handoff{display:flex;align-items:center;gap:12px;padding:12px 24px;background:#fff1f2;border-bottom:1px solid #fecdd3;color:#9f1239}.omni-handoff span{margin-right:auto;font-size:12px}.omni-handoff .btn{background:#fff}
.manager-settings:not(.is-enabled) > .telegram-settings__grid,.manager-settings:not(.is-enabled) > .telegram-ai-toggle:last-child{display:none}.manager-settings:not(.is-enabled){gap:10px}.manager-settings.is-enabled > .telegram-settings__grid,.manager-settings.is-enabled > .telegram-ai-toggle:last-child{animation:managerSettingsReveal .18s ease-out}@keyframes managerSettingsReveal{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.social-remove-dialog{width:min(430px,calc(100vw - 28px));padding:0;border:0;border-radius:14px;box-shadow:0 24px 70px rgba(8,20,35,.28)}.social-remove-dialog::backdrop{background:rgba(4,12,22,.5);backdrop-filter:blur(2px)}.social-remove-dialog__body{display:grid;grid-template-columns:38px minmax(0,1fr);gap:14px;padding:22px;background:#fff}.social-remove-dialog__icon{display:grid;width:38px;height:38px;place-items:center;border-radius:50%;color:#b62639;background:#fff0f2;font-weight:800}.social-remove-dialog h3{margin:2px 0 7px;font-size:18px}.social-remove-dialog p{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.social-remove-dialog__actions{grid-column:1/-1;display:flex;justify-content:flex-end;gap:8px;margin-top:4px}
@media(max-width:700px){.telegram-public-link{align-items:stretch;flex-direction:column}.telegram-public-link>div:last-child .btn{flex:1}.channel-card{padding:15px}.channel-stats{grid-template-columns:1fr}.channel-card__actions .btn,.channel-card__actions a{flex:1}.channel-card__actions #telegramDisconnect,.channel-card__actions #instagramDisconnect,.channel-card__actions #whatsappDisconnect{flex-basis:100%;margin-left:0}.omni-thread__modes{flex-wrap:wrap}.omni-message{max-width:90%}.omni-reply{grid-template-columns:1fr}}

@media (max-width: 480px) {
  .detail { padding-inline: 14px; }
  .figma-card { padding: 18px; }
  .site-head__actions { flex-direction: column; }
  .site-head__actions .btn { width: 100%; }
  .account-card .btn { width: 100%; }
  .setup-step { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}


/* ── Guided setup wizard (Платформа → Код на сайт) ────────────────────────
   Keep the two-step wizard on the flat teal system. Site onboarding uses the
   regular application shell; the separate widget setup may stay focused. */

/* Widget setup remains focused; site onboarding stays inside the regular app shell. */
body.app--onboarding,
body.app--widget-setup { background: var(--bg); }

/* One centred column for the whole wizard. */
#detail > .setup-wizard { max-width: 780px; margin: 0 auto; gap: 22px; }
.setup-wizard__top {
  align-items: flex-start;
  margin: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.setup-back {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  font: 600 12px var(--font);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.setup-back:hover { color: var(--primary-dark); background: var(--primary-soft); border-color: var(--primary); }
.setup-wizard__project { gap: 11px; }
.setup-wizard__project h2 { font-size: 15px; font-weight: 600; }
.setup-wizard__project a { color: var(--muted); font-size: 12px; }
.setup-wizard__project a:hover { color: var(--primary-dark); }
.setup-wizard__intro { margin: 0; }
.setup-wizard__intro p { color: var(--text-secondary); font-size: 14px; line-height: 1.55; }

/* Progress — two steps, two columns. */
.setup-progress {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.setup-progress__item {
  min-height: 0;
  gap: 11px;
  padding: 13px 16px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: none;
}
.setup-progress__item span {
  width: 24px;
  height: 24px;
  color: var(--muted);
  background: #eef3f6;
  font-size: 12px;
  font-weight: 700;
}
.setup-progress__item b { font-size: 13px; font-weight: 600; }
.setup-progress__item.is-current {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: var(--primary);
  box-shadow: none;
}
.setup-progress__item.is-current span { color: #05413d; background: var(--primary); }
.setup-progress__item.is-done { color: var(--text); background: #fff; border-color: #b8e7e0; }
.setup-progress__item.is-done span { color: #fff; background: var(--success); }
.setup-progress__item.is-done:hover {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: var(--primary);
}

/* Step card. The primary action is ordered to the bottom of the card so the
   card reads instructions → code → "Я установил, проверить". */
.setup-step {
  max-width: none;
  gap: 20px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(9,19,33,.04);
}
.setup-step__back { order: -2; margin: 0; color: var(--muted); font: 600 12px var(--font); }
.setup-step__head { order: -1; display: grid; gap: 9px; }
.setup-step__eyebrow {
  justify-self: start;
  padding: 4px 10px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 11px;
  font-weight: 700;
}
.setup-step__head h3 { margin: 0; font-size: 21px; line-height: 1.25; }
.setup-step__head p {
  max-width: 60ch;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.setup-step__actions {
  order: 90;
  margin-top: 4px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.setup-step__actions .btn--primary,
.setup-step__actions--wp #checkInstallation,
.setup-step__actions--finish .btn--primary {
  min-height: 42px;
  padding-inline: 20px;
  font-size: 13px;
}
.setup-result { order: 91; }

/* Select — native chevron replaced so it matches the custom language picker. */
.setup-field { max-width: 420px; }
.setup-field > span { color: var(--text); font-size: 12px; font-weight: 600; }
#sub .setup-field select,
.detail .setup-field select,
.setup-field select,
.setup-extras__row select {
  min-height: 44px;
  padding: 11px 40px 11px 13px !important;
  border: 1px solid var(--border);
  border-radius: 7px;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2361738a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 16px;
  font: 500 13px var(--font);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
#sub .setup-field select:hover,
.detail .setup-field select:hover,
.setup-field select:hover { border-color: #9cb0c5; }
#sub .setup-field select:focus,
.detail .setup-field select:focus,
.setup-field select:focus { border-color: var(--primary); }

/* Numbered instructions. */
.setup-steps-list { gap: 12px; }
.setup-steps-list li {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 12px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}
.setup-steps-list li span {
  width: 26px;
  height: 26px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  font-size: 12px;
}
.setup-steps-list li div { padding-top: 3px; }

/* Snippet block. */
.setup-code { border: 1px solid #17293f; border-radius: 8px; background: #091321; box-shadow: none; }
.setup-code__bar { padding: 10px 14px; background: #0d1a2b; border-bottom: 1px solid #17293f; }
.setup-code__bar span { color: #7d93ad; font-size: 10px; font-weight: 600; letter-spacing: .06em; }
.setup-code__bar .btn {
  min-height: 30px;
  padding: 6px 12px;
  color: #cfe0f0;
  background: #17293f;
  border-color: #24384f;
  font-size: 11px;
}
.setup-code__bar .btn:hover { color: #091321; background: var(--primary); border-color: var(--primary); }
.setup-code .code {
  padding: 16px;
  color: #d7e6f5;
  font: 12.5px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.setup-manual-fallback { border-radius: 8px; background: var(--surface-muted); }
.setup-manual-fallback > summary { padding: 13px 16px; color: var(--text-secondary); font-size: 13px; font-weight: 600; }

/* Page list. */
.setup-pages { border-radius: 8px; }
.setup-pages > summary { padding: 13px 16px; font-size: 13px; font-weight: 600; }
.setup-pages > summary::before {
  content: "›";
  display: inline-grid;
  width: 18px;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  transition: transform var(--transition);
}
.setup-pages[open] > summary { border-bottom: 1px solid var(--border); }
.setup-pages[open] > summary::before { content: "›"; transform: rotate(90deg); }
.setup-pages__list {
  gap: 7px;
  padding: 12px 16px 12px 42px;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.setup-pages__hint { padding: 0 16px 14px 42px; font-size: 12px; }
.setup-pages--empty { border-radius: 8px; font-size: 13px; }

/* Callouts, Site ID, check result. */
.setup-callout { padding: 16px; background: var(--primary-soft); border-color: #b8e7e0; border-radius: 8px; }
.setup-callout b { font-size: 13px; }
.setup-callout p { color: var(--text-secondary); font-size: 12.5px; }
.setup-siteid__value {
  padding: 9px 13px;
  color: #d7e6f5;
  background: #091321;
  border-radius: 6px;
  font-size: 12.5px;
}
.setup-result { padding: 13px 16px; background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.setup-result:has(.setup-success) { background: var(--success-soft); border-color: #9ee0cd; }
.setup-result:has(.setup-error) { background: var(--danger-soft); border-color: #f0bcc3; }
.setup-error { color: #b3243a; font-size: 13px; }
.setup-success { color: #05715a; font-size: 13px; }
.installation-check-loading {
  background: var(--primary-soft);
  border-color: #b8e7e0;
  border-radius: 8px;
}
.installation-check-loading__spinner { border-color: #b8e7e0; border-top-color: var(--primary); }
.installation-check-loading b { font-size: 13px; }
.installation-check-loading p { font-size: 12px; }

/* "Дополнительно" drawer. */
.setup-extras__card { padding: 16px; border-radius: 8px; box-shadow: none; }
.setup-extras__card-head > span {
  width: 30px;
  height: 30px;
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-radius: 7px;
  font-size: 13px;
}
.setup-extras__card-head { grid-template-columns: 30px minmax(0, 1fr); }
.setup-extras__card-head b { font-size: 13px; }
.setup-extras__card-head p { font-size: 12px; }

@media (max-width: 760px) {
  body.app--onboarding .detail,
  body.app--widget-setup .detail { padding: 24px 16px 40px; }
  #detail > .setup-wizard { gap: 18px; }
  .setup-wizard__top { flex-direction: column; gap: 12px; }
  .setup-progress { grid-template-columns: 1fr; }
  .setup-step { padding: 20px; }
  .setup-field { max-width: none; }
  .setup-step__actions { flex-direction: column; align-items: stretch; }
  .setup-step__actions .btn { width: 100%; margin-left: 0; }
  .setup-pages__list, .setup-pages__hint { padding-left: 16px; }
}

/* General overview: compact, status-led Sitevo dashboard. */
.dashboard-screen-heading { display:flex; align-items:flex-end; justify-content:space-between; gap:24px; margin-bottom:24px; }
.screen-heading__eyebrow { display:block; margin-bottom:7px; color:var(--primary); font-size:10px; font-weight:750; letter-spacing:.12em; }
.dashboard-screen-heading h1 { letter-spacing:-.035em; }
.dashboard-health { display:inline-flex; flex:0 0 auto; align-items:center; gap:8px; min-height:34px; padding:7px 12px; border:1px solid #bce3d3; border-radius:999px; color:#087953; background:#effaf6; font-size:12px; font-weight:650; }
.dashboard-health i { width:7px; height:7px; border-radius:50%; background:#10a875; box-shadow:0 0 0 4px rgba(16,168,117,.12); }
.dashboard-health.has-attention { border-color:#f0d6a8; color:#986019; background:#fff9ec; }
.dashboard-health.has-attention i { background:#e49a2a; box-shadow:0 0 0 4px rgba(228,154,42,.13); }
.figma-kpis.dashboard-summary { gap:14px; margin-bottom:0; }
.figma-kpis.dashboard-summary article { display:flex; align-items:center; gap:16px; min-height:118px; padding:20px; border-color:#dfe6ee; border-radius:14px; box-shadow:0 1px 2px rgba(8,20,35,.025); transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.figma-kpis.dashboard-summary article:hover { border-color:#cbd7e5; box-shadow:0 10px 28px rgba(8,20,35,.07); transform:translateY(-2px); }
.dashboard-summary article>div { min-width:0; }
.dashboard-summary__icon { display:grid!important; flex:0 0 auto; width:44px; height:44px; place-items:center; border-radius:12px; color:#3568e8!important; background:#edf3ff; }
.dashboard-summary__icon svg { width:22px; height:22px; stroke-width:1.7; }
.dashboard-summary__icon--pages { color:#7554d6!important; background:#f2efff; }
.dashboard-summary__icon--status { color:#07956a!important; background:#eaf8f3; }
.dashboard-summary b { margin:8px 0 5px!important; font-size:28px!important; }
.dashboard-summary .figma-kpis__date { font-size:23px!important; }
.analytics-section { gap:14px; margin-top:14px; }
.analytics-toolbar { display:grid; grid-template-columns:minmax(160px,.75fr) minmax(360px,1.5fr) auto; align-items:end; gap:18px; padding:18px 20px; border-radius:14px; background:linear-gradient(135deg,#fff 0%,#fbfdff 100%); }
.analytics-toolbar__intro { display:flex; align-items:center; gap:11px; padding-bottom:2px; }
.analytics-toolbar__intro>div { display:grid; gap:2px; }
.analytics-toolbar__intro b { font-size:14px; }
.analytics-toolbar__intro small { color:var(--muted); font-size:11px; white-space:nowrap; }
.analytics-toolbar__icon { display:grid; width:36px; height:36px; place-items:center; border-radius:10px; color:#fff; background:linear-gradient(145deg,#3b6cf4,#274fc9); box-shadow:0 6px 16px rgba(49,95,244,.22); }
.analytics-toolbar__icon svg { width:19px; height:19px; }
.analytics-toolbar__filters { display:grid; grid-template-columns:repeat(2,minmax(140px,1fr)); gap:10px; }
.analytics-toolbar .field { min-width:0; padding:0; }
.analytics-toolbar .field span { margin-bottom:5px; font-size:11px; }
.analytics-toolbar .field select { min-height:38px; padding-block:7px; border-radius:9px; background-color:#fff; }
.analytics-toolbar .period-tabs { align-self:end; margin:0; padding:3px; border:1px solid var(--border); border-radius:10px; background:#f3f6f9; }
.analytics-toolbar .period-tabs button { min-height:32px; padding:6px 10px; border-radius:7px; font-size:12px; white-space:nowrap; }
.figma-kpis.analytics-kpis { grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin:0; }
.figma-kpis.analytics-kpis article { position:relative; min-height:124px; padding:20px; overflow:hidden; border-color:#dfe6ee; border-radius:14px; box-shadow:0 1px 2px rgba(8,20,35,.025); transition:border-color .18s ease,box-shadow .18s ease,transform .18s ease; }
.figma-kpis.analytics-kpis article:hover { border-color:#cbd7e5; box-shadow:0 9px 24px rgba(8,20,35,.06); transform:translateY(-2px); }
.analytics-kpi__icon { position:absolute; top:17px; right:17px; display:grid!important; width:34px; height:34px; place-items:center; border-radius:10px; color:#4b6ed1!important; background:#eef3ff; }
.analytics-kpi__icon svg { width:18px; height:18px; }
.analytics-kpis article>span:not(.analytics-kpi__icon) { padding-right:42px; font-size:12px; font-weight:550; }
.analytics-kpis article b { margin:18px 0 6px; font-size:27px; letter-spacing:-.04em; }
.analytics-kpis article small { color:var(--muted); font-weight:500; }
.analytics-kpis article.is-positive .analytics-kpi__icon { color:#07885f!important; background:#eaf8f3; }
.analytics-kpis article.is-positive small { color:#07885f; }
.analytics-kpis article.is-attention { border-color:#f1dcba; background:linear-gradient(145deg,#fff 55%,#fff9ed); }
.analytics-kpis article.is-attention .analytics-kpi__icon { color:#b87513!important; background:#fff3da; }
.analytics-kpis article.is-danger { border-color:#efcfd2; background:linear-gradient(145deg,#fff 55%,#fff5f5); }
.analytics-kpis article.is-danger .analytics-kpi__icon { color:#bd3940!important; background:#ffeaec; }
.analytics-card { border-radius:14px; }
.analytics-card__head h3 { font-size:14px; }
.analytics-chart { height:200px; }
.analytics-chart__line { stroke-width:2.3; }
.analytics-chart__area { opacity:.08; }
.analytics-table thead { background:#f7f9fb; }
.analytics-table th:first-child,.analytics-table td:first-child { padding-left:18px; }
.analytics-table tbody tr { transition:background .15s ease; }
.analytics-table tbody tr:hover { background:#f8faff; }
@media (max-width:1180px) { .analytics-toolbar { grid-template-columns:1fr auto; } .analytics-toolbar__intro { grid-column:1/-1; } }
@media (max-width:780px) {
  .dashboard-screen-heading { align-items:flex-start; flex-direction:column; gap:14px; }
  .dashboard-health { align-self:flex-start; }
  .figma-kpis.dashboard-summary,.figma-kpis.analytics-kpis { grid-template-columns:1fr; }
  .analytics-toolbar { display:flex; align-items:stretch; padding:16px; }
  .analytics-toolbar__filters { grid-template-columns:1fr; }
  .analytics-toolbar .period-tabs { display:grid; grid-template-columns:repeat(4,1fr); overflow-x:auto; }
  .analytics-toolbar .period-tabs button { padding-inline:6px; }
}
@media (max-width:480px) {
  .figma-kpis.dashboard-summary article { min-height:104px; padding:16px; }
  .analytics-toolbar__intro small { white-space:normal; }
  .figma-kpis.analytics-kpis article { min-height:112px; padding:17px; }
}

/* Analytics custom selects — same interaction language as the locale picker. */
.analytics-select { position:relative; width:100%; }
.analytics-select__native { position:absolute!important; width:1px!important; height:1px!important; margin:-1px!important; padding:0!important; overflow:hidden!important; clip:rect(0 0 0 0)!important; white-space:nowrap!important; border:0!important; }
.analytics-select__trigger {
  display:grid;
  grid-template-columns:minmax(0,1fr) 18px;
  align-items:center;
  gap:10px;
  width:100%;
  min-height:38px;
  padding:8px 10px 8px 12px;
  color:var(--text);
  background:#fff;
  border:1px solid var(--border);
  border-radius:9px;
  font:500 13px var(--font);
  text-align:left;
  cursor:pointer;
  transition:border-color .16s ease,box-shadow .16s ease;
}
.analytics-select__trigger>span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.analytics-select__trigger svg { width:18px; height:18px; fill:none; stroke:#61738a; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; transition:transform .16s ease; }
.analytics-select__trigger:hover { border-color:#9cb0c5; box-shadow:0 4px 14px rgba(9,19,33,.07); }
.analytics-select__trigger:focus-visible { border-color:#33cfc2; outline:3px solid rgba(15,199,184,.18); outline-offset:1px; }
.analytics-select__trigger[aria-expanded="true"] { border-color:#33cfc2; box-shadow:0 0 0 3px rgba(15,199,184,.12); }
.analytics-select__trigger[aria-expanded="true"] svg { transform:rotate(180deg); }
.analytics-select__menu {
  position:fixed;
  z-index:1100;
  display:grid;
  max-height:min(300px,calc(100vh - 16px));
  overflow-y:auto;
  margin:0;
  padding:6px;
  list-style:none;
  background:#fff;
  border:1px solid var(--border);
  border-radius:11px;
  box-shadow:0 14px 32px rgba(9,19,33,.16);
}
.analytics-select__menu[hidden] { display:none!important; }
.analytics-select__option {
  display:grid;
  grid-template-columns:minmax(0,1fr) 18px;
  align-items:center;
  gap:10px;
  min-height:39px;
  padding:7px 9px;
  color:var(--text);
  border-radius:8px;
  font:500 13px var(--font);
  cursor:pointer;
}
.analytics-select__option>span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.analytics-select__option svg { visibility:hidden; width:18px; height:18px; fill:none; stroke:#0aa89c; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.analytics-select__option:hover,.analytics-select__option:focus { color:var(--primary-dark); background:var(--primary-soft); outline:none; }
.analytics-select__option.is-selected { color:#063f3b; background:#e1faf7; font-weight:600; }
.analytics-select__option.is-selected svg { visibility:visible; }

/* Safe project deletion is also available before onboarding is complete. */
.setup-wizard__project-actions { display:flex; align-items:center; justify-content:flex-end; gap:14px; min-width:0; }
.setup-delete {
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  gap:7px;
  min-height:34px;
  padding:7px 10px;
  color:#b62639;
  background:#fff;
  border:1px solid #efc5cc;
  border-radius:8px;
  font:600 12px var(--font);
  cursor:pointer;
  transition:color .16s ease,background .16s ease,border-color .16s ease,box-shadow .16s ease;
}
.setup-delete svg { width:16px; height:16px; }
.setup-delete:hover { color:#941d2e; background:#fff0f2; border-color:#e69da7; box-shadow:0 4px 12px rgba(182,38,57,.09); }
.setup-delete:focus-visible { outline:3px solid rgba(182,38,57,.14); outline-offset:2px; }
@media (max-width:640px) {
  .setup-wizard__project-actions { width:100%; align-items:flex-start; justify-content:space-between; }
  .setup-wizard__project { min-width:0; }
  .setup-wizard__project>div { min-width:0; }
  .setup-wizard__project a { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .setup-delete span { display:none; }
  .setup-delete { width:34px; padding:7px; justify-content:center; }
}

/* ── Overview without projects ────────────────────────────────────────────────────────────
   Onboarding instead of an empty dashboard: one two-column block. The explanation (what Sitevo Chat
   does, how to connect, the Add site button) is on the left; the dark demo stage on the right loops an
   online shop and a company landing page. The widget on the stage is the regular preview markup
   (.wsp-*); only its motion is styled here, the scene state itself comes from startDashboardDemo(). */
.dash-empty { container:dash-empty / inline-size; min-width:0; }
/* One column, demo first, until the work area (sidebar excluded) can give the explanation 340px and the
   demo a useful width; then about 35/65 with the explanation on the left. */
.dash-empty__main { display:grid; grid-template-areas:"demo" "info"; gap:24px; align-items:start; }
@container dash-empty (min-width: 900px) {
  .dash-empty__main { grid-template-columns:minmax(340px, 35fr) minmax(0, 65fr); grid-template-areas:"info demo"; column-gap:28px; }
  /* The explanation is taller than the demo; on screens tall enough to hold the whole demo it stays in
     view while the text is read instead of leaving an empty column beside the button. */
  @media (min-height: 800px) { .dash-demo { position:sticky; top:24px; } }
}
/* .detail clips overflow, which would also turn off sticky positioning for the demo. */
.detail:has(> .dash-empty) { overflow:visible; }

.dash-info { grid-area:info; display:flex; flex-direction:column; min-width:0; padding:24px; background:#fff; border:1px solid var(--border); border-radius:10px; }
.dash-info .screen-heading__eyebrow { margin-bottom:10px; }
.dash-info h1 { margin:0 0 10px; font-size:28px; line-height:1.15; letter-spacing:-.03em; }
.dash-info__lead { margin:0; color:var(--text-secondary); font-size:15px; line-height:1.55; }
.dash-info__benefits, .dash-info__steps { display:grid; gap:16px; margin:0; padding:0; list-style:none; }
.dash-info__benefits { margin-top:22px; }
.dash-info__benefit, .dash-info__step { display:grid; grid-template-columns:32px minmax(0,1fr); gap:12px; align-items:start; }
.dash-info__icon { display:grid; width:32px; height:32px; place-items:center; color:var(--primary-dark); background:var(--primary-soft); border-radius:8px; }
.dash-info__icon svg { width:17px; height:17px; }
.dash-info strong { display:block; margin:0 0 3px; color:var(--text); font-size:14.5px; font-weight:600; line-height:1.35; }
.dash-info__benefit p, .dash-info__step p { margin:0; color:var(--text-secondary); font-size:14px; line-height:1.5; }
.dash-info__connect { margin-top:22px; padding-top:22px; border-top:1px solid var(--border); }
.dash-info__connect h2 { margin:0 0 14px; font-size:17px; line-height:1.3; letter-spacing:-.015em; }
.dash-info__num { display:grid; width:26px; height:26px; margin:1px 3px 0; place-items:center; color:#05413d; background:var(--primary-soft); border:1px solid #b8e7e0; border-radius:50%; font-size:12.5px; font-weight:700; font-variant-numeric:tabular-nums; }
.dash-info__cta.btn { display:flex; align-items:center; justify-content:center; gap:8px; width:100%; min-height:44px; margin-top:24px; font-size:14px; }
.dash-info__cta svg { flex:0 0 auto; width:17px; height:17px; }
.dash-info__hint { margin:10px 0 0; color:var(--muted); font-size:13px; line-height:1.45; text-align:center; }

.dash-demo { grid-area:demo; min-width:0; margin:0; overflow:hidden; background:#fff; border:1px solid var(--border); border-radius:10px; }
/* The stage height follows the viewport so the whole widget, launcher included, fits above the fold
   on a laptop. */
.dash-demo__stage { position:relative; height:clamp(620px, calc(100vh - 130px), 800px); overflow:hidden; background:#0c1722; cursor:default; container-type:inline-size; }
.dash-demo__scene { position:absolute; inset:0; pointer-events:none; }
.dash-demo__badge { position:absolute; z-index:3; top:8px; right:12px; padding:5px 10px; color:#062b28; background:var(--primary); border-radius:999px; font:700 10px/1.2 var(--font); letter-spacing:.14em; }

/* Demo sites: an online shop and the Atelier North landing page, cross-faded by the scene loop. The
   incoming site sits on top and fades in; the outgoing one stays underneath until it is covered.
   Photos are backgrounds over a neutral colour, so a missing file never shows a broken image. */
.dash-demo__sites { position:absolute; inset:0; z-index:0; }
.dash-site { position:absolute; inset:0; z-index:0; display:flex; flex-direction:column; overflow:hidden; visibility:hidden; opacity:0; transform:scale(1.02); transition:opacity 0s linear .9s,transform 0s linear .9s,visibility 0s linear .9s; font-family:var(--font); }
.dash-demo.is-shop .dash-site--shop, .dash-demo.is-studio .dash-site--studio { z-index:1; visibility:visible; opacity:1; transform:none; transition:opacity .9s ease,transform 1.4s cubic-bezier(.2,.7,.2,1),visibility 0s; }
.dash-site p { margin:0; }
.dash-site b, .dash-site em, .dash-site small, .dash-site strong { display:block; font-style:normal; }
.dash-photo { display:block; background-color:#d8d2c8; background-position:center; background-repeat:no-repeat; background-size:cover; }
.dash-site__chrome { display:flex; flex:0 0 auto; align-items:center; gap:6px; height:38px; padding:0 16px; background:#08111b; border-bottom:1px solid rgba(214,226,240,.08); }
.dash-site__chrome i { width:9px; height:9px; background:rgba(214,226,240,.2); border-radius:50%; }
.dash-site__chrome span { width:min(300px,40%); height:18px; margin-left:14px; background:rgba(214,226,240,.08); border-radius:5px; }

/* Scene 1: a light online shop. */
.dash-site--shop { color:#1d232b; background:#f6f4f0; }
.dash-shop__nav { display:flex; flex:0 0 auto; align-items:center; gap:22px; height:56px; padding:0 32px; color:#5b6470; background:#fff; border-bottom:1px solid #e7e2da; font-size:13px; }
.dash-shop__nav > span { white-space:nowrap; }
.dash-site .dash-shop__logo { display:flex; align-items:center; gap:9px; margin-right:10px; color:#141a21; font-size:15px; font-weight:700; letter-spacing:-.01em; white-space:nowrap; }
.dash-shop__logo i { display:block; width:22px; height:22px; background:#141a21; border-radius:50% 50% 50% 5px; }
.dash-shop__cart { position:relative; width:22px; height:22px; margin-left:auto; color:#141a21; }
.dash-shop__cart svg { display:block; width:22px; height:22px; }
.dash-shop__cart b { position:absolute; top:-5px; right:-8px; min-width:15px; height:15px; padding:0 4px; color:#fff; background:#0fb5a7; border-radius:999px; font-size:9.5px; font-weight:700; line-height:15px; text-align:center; }
.dash-shop__hero { display:grid; flex:1 1 0; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); gap:28px; min-height:0; padding:22px 32px 18px; }
.dash-shop__copy { display:flex; flex-direction:column; justify-content:center; gap:10px; min-width:0; }
.dash-shop__copy small { color:#0e8f84; font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; }
.dash-shop__copy strong { color:#141a21; font-size:clamp(22px, 2.9cqi, 32px); font-weight:700; line-height:1.1; letter-spacing:-.03em; }
.dash-shop__copy p { max-width:42ch; color:#5b6470; font-size:13.5px; line-height:1.5; }
.dash-shop__buy { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin-top:4px; }
.dash-shop__buy b { padding:10px 18px; color:#fff; background:#141a21; border-radius:999px; font-size:12.5px; font-weight:600; white-space:nowrap; }
.dash-shop__buy span { color:#3b434d; font-size:12.5px; font-weight:600; }
.dash-shop__visual { min-height:0; background-color:#e4ded5; border-radius:14px; }
.dash-shop__catalog { flex:0 0 auto; padding:0 32px 24px; }
.dash-shop__label { margin-bottom:10px; color:#141a21; font-size:14px; font-weight:700; letter-spacing:-.01em; }
.dash-shop__grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.dash-shop__card { display:grid; gap:3px; min-width:0; padding:8px 8px 11px; background:#fff; border:1px solid #e7e2da; border-radius:12px; }
.dash-shop__thumb { height:96px; margin-bottom:6px; background-color:#ebe7e0; border-radius:8px; }
.dash-shop__card b, .dash-shop__card span { overflow:hidden; padding:0 3px; font-size:12.5px; white-space:nowrap; text-overflow:ellipsis; }
.dash-shop__card b { color:#1d232b; font-weight:600; }
.dash-shop__card span { color:#0e8f84; font-weight:700; }

/* Scene 2: the Atelier North landing page, a warm interior and workspace design studio. */
.dash-site--studio { color:#1f1c18; background:#f2eee7; }
.dash-studio__hero { position:relative; display:flex; flex:1 1 0; flex-direction:column; min-height:0; overflow:hidden; color:#fff; background:#2b2823; }
.dash-studio__photo { position:absolute; inset:0; background-color:#3a352e; }
.dash-studio__hero::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(20,17,13,.8) 0%,rgba(20,17,13,.5) 45%,rgba(20,17,13,.1) 100%),linear-gradient(180deg,rgba(20,17,13,.45) 0%,rgba(20,17,13,0) 32%); }
.dash-studio__nav, .dash-studio__copy { position:relative; z-index:1; }
.dash-studio__nav { display:flex; flex:0 0 auto; align-items:center; gap:24px; height:58px; padding:0 34px; color:rgba(255,255,255,.82); font-size:12.5px; }
.dash-studio__nav span { white-space:nowrap; }
.dash-site .dash-studio__logo { margin-right:14px; color:#fff; font-size:13.5px; font-weight:600; letter-spacing:.22em; text-transform:uppercase; white-space:nowrap; }
.dash-studio__copy { display:flex; flex:1 1 auto; flex-direction:column; justify-content:center; gap:10px; min-height:0; max-width:540px; padding:4px 34px 26px; }
.dash-studio__copy small { color:#e6d5bd; font-size:11px; font-weight:600; letter-spacing:.16em; text-transform:uppercase; }
.dash-studio__copy strong { font-size:clamp(24px, 3.2cqi, 36px); font-weight:600; line-height:1.08; letter-spacing:-.03em; }
.dash-studio__copy p { max-width:44ch; color:rgba(255,255,255,.84); font-size:13.5px; line-height:1.5; }
.dash-site .dash-studio__cta { align-self:flex-start; margin-top:4px; padding:10px 18px; color:#1f1c18; background:#f2eee7; border-radius:4px; font-size:12.5px; font-weight:600; white-space:nowrap; }
.dash-studio__services { flex:0 0 auto; padding:16px 34px 22px; }
.dash-studio__label { margin-bottom:11px; font-size:14px; font-weight:600; letter-spacing:-.01em; }
.dash-studio__cards { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.dash-studio__card { display:grid; grid-template-columns:88px minmax(0,1fr); gap:12px; min-width:0; padding:8px; background:#fff; border:1px solid #e4ddd2; border-radius:10px; }
.dash-studio__thumb, .dash-studio__glyph { min-height:88px; border-radius:6px; }
.dash-studio__thumb { background-color:#dcd4c7; }
.dash-studio__glyph { display:grid; place-items:center; color:#e6d5bd; background:rgba(255,255,255,.08); }
.dash-studio__glyph svg { width:30px; height:30px; }
.dash-studio__body { display:flex; flex-direction:column; gap:3px; min-width:0; padding:4px 4px 4px 0; }
.dash-studio__body em { color:#a08462; font-size:11px; font-weight:700; letter-spacing:.1em; }
.dash-studio__body b { font-size:13px; font-weight:600; line-height:1.25; }
.dash-studio__body p { display:-webkit-box; overflow:hidden; color:#6b6358; font-size:12px; line-height:1.4; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.dash-studio__card--text { background:#1f1c18; border-color:#1f1c18; }
.dash-studio__card--text .dash-studio__body b { color:#fff; }
.dash-studio__card--text .dash-studio__body p { color:rgba(255,255,255,.7); }
.dash-demo.is-studio .dash-studio__photo { animation:dash-demo-drift 12s ease-out both; }
@keyframes dash-demo-drift { from { transform:scale(1.07); } to { transform:none; } }

@container (max-width: 860px) {
  .dash-shop__nav, .dash-studio__nav { gap:16px; padding:0 22px; }
  .dash-shop__nav > span:nth-of-type(n+3), .dash-studio__nav span:nth-of-type(n+3) { display:none; }
  .dash-shop__hero { grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr); gap:20px; padding:18px 22px 14px; }
  .dash-shop__catalog { padding:0 22px 18px; }
  .dash-shop__grid, .dash-studio__cards { gap:10px; }
  .dash-shop__thumb { height:80px; }
  .dash-studio__copy { padding:4px 22px 22px; }
  .dash-studio__services { padding:14px 22px 18px; }
  .dash-studio__card { grid-template-columns:1fr; gap:8px; }
  .dash-studio__thumb, .dash-studio__glyph { min-height:64px; }
  .dash-studio__body { padding:0 2px 2px; }
  .dash-studio__body p { display:none; }
}
@container (max-width: 540px) {
  .dash-site__chrome span { width:44%; }
  .dash-shop__nav, .dash-studio__nav { height:50px; padding:0 16px; }
  .dash-shop__nav > span, .dash-studio__nav span { display:none; }
  .dash-shop__hero { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; gap:12px; padding:14px 16px 12px; }
  .dash-shop__visual { order:-1; }
  .dash-shop__copy { gap:6px; }
  .dash-shop__copy strong { font-size:21px; }
  .dash-shop__copy p { display:none; }
  .dash-shop__catalog { padding:0 16px 14px; }
  .dash-shop__label { margin-bottom:8px; font-size:13px; }
  .dash-shop__grid, .dash-studio__cards { gap:8px; }
  .dash-shop__card { padding:5px 5px 8px; }
  .dash-shop__thumb { height:60px; }
  .dash-shop__card b, .dash-shop__card span { padding:0 2px; font-size:11px; }
  .dash-studio__copy { padding:4px 16px 18px; }
  .dash-studio__copy strong { font-size:23px; }
  .dash-studio__copy p { display:none; }
  .dash-studio__services { padding:12px 16px 14px; }
  .dash-studio__card { padding:5px; }
  .dash-studio__body b { font-size:11.5px; }
}

/* Demo widget motion. The preview panel is display-toggled and carries an inline opacity
   transition for the style editor; here it stays rendered and fades/lifts instead (!important
   is what outranks that inline transition). */
.dash-demo .wsp-panel { display:flex; visibility:hidden; opacity:0; transform:translateY(14px) scale(.97); transform-origin:100% 100%; transition:opacity .34s ease,transform .34s ease,visibility 0s linear .34s !important; }
.dash-demo.is-open .wsp-panel { visibility:visible; opacity:1; transform:none; transition:opacity .34s ease,transform .34s ease,visibility 0s !important; }
.dash-demo .wsp-messages { scrollbar-width:none; }
.dash-demo .wsp-messages::-webkit-scrollbar { display:none; }
/* The app's 44px mobile tap-target rule is for real controls; the decorative widget keeps its own sizes. */
.dash-demo .wsp-close, .dash-demo .wsp-send { min-height:0; }
.dash-demo.is-pulse .wsp-launcher { animation:dash-demo-pulse 1.2s ease-out; }
.dash-demo .wsp-messages > .wsp-msg { display:none; }
.dash-demo .wsp-messages > .wsp-msg.is-shown { display:block; animation:dash-demo-in .38s ease backwards; }
.dash-demo .wsp-messages > * { transition:opacity .45s ease,transform .45s ease; }
.dash-demo.is-clearing .wsp-messages > * { opacity:0; transform:translateY(-6px); }
/* Demo-only additions to the rendered preview: the widget carries each site's name, and the shop
   answer is followed by product tiles. */
/* The new-project size (680px tall, as in the style editor); a shorter stage takes the launcher's room off it. */
.dash-demo .wsp-panel { height:min(680px, calc(100% - 120px)) !important; }
.dash-demo .dash-demo__name { display:none; }
.dash-demo.is-shop .dash-demo__name--shop, .dash-demo.is-studio .dash-demo__name--studio { display:inline; }
.dash-demo .wsp-messages > .dash-demo__products { display:none; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; flex:0 0 auto; }
.dash-demo .wsp-messages > .dash-demo__products.is-shown { display:grid; }
/* A dialogue that does not fit a short panel drops its oldest bubbles instead of cutting them off. */
.dash-demo .wsp-messages > .is-shown.is-trimmed { display:none; }
.dash-demo .wsp-messages.is-fitted { justify-content:flex-end; }
.dash-demo__product { display:flex; flex-direction:column; gap:2px; min-width:0; padding:5px 5px 7px; background:#fff; border:1px solid rgba(11,18,32,.1); border-radius:10px; box-shadow:0 1px 2px rgba(11,18,32,.05); animation:dash-demo-in .38s ease backwards; }
.dash-demo__product:nth-child(2) { animation-delay:.12s; }
.dash-demo__product:nth-child(3) { animation-delay:.24s; }
.dash-demo__product-photo { height:62px; margin-bottom:4px; background-color:#ece8e1; border-radius:6px; }
.dash-demo__product b { display:-webkit-box; overflow:hidden; min-height:2.5em; padding:0 2px; color:#1d232b; font-size:11px; font-weight:600; line-height:1.25; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.dash-demo__product em { padding:0 2px; color:#0e8f84; font-size:11.5px; font-style:normal; font-weight:700; }
.dash-demo.is-still .dash-demo__scene, .dash-demo.is-still .dash-demo__scene * { animation:none !important; transition:none !important; }
@keyframes dash-demo-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes dash-demo-pulse { 0% { box-shadow:0 0 0 0 rgba(15,199,184,.5); transform:scale(1); } 40% { transform:scale(1.06); } 100% { box-shadow:0 0 0 14px rgba(15,199,184,0); transform:scale(1); } }

/* The demo widget is the real 400px one everywhere; a stage narrower than that (a phone) fits it to the
   stage width via the preview's own max-width. */

@media (max-width:760px) {
  .dash-empty__main { gap:20px; }
  .dash-info h1 { font-size:26px; }
  .dash-demo__stage { height:620px; }
}
@media (prefers-reduced-motion: reduce) {
  .dash-demo__scene, .dash-demo__scene * { animation:none !important; transition:none !important; }
}

/* ---------------------------------------------------------------- Sidebar cards (06.10)
   Sites and social channels are one component (sidebarItemMarkup in app.js), modelled on the
   former social-channel card: dark block with a border, 32×32 icon (8px radius), three lines. */
.sidebar #sites.site-list { display: grid; gap: 6px; }
.sidebar .sidebar-social-channels { gap: 6px; margin-top: 6px; }
.sidebar .sidebar-item,
.sidebar .sidebar-item.site-card {
  position: relative; width: 100%; margin: 0; padding: 0;
  color: #c8d6e6; background: #101e2e; border: 1px solid #1b3148; border-radius: 8px; box-shadow: none;
  transition: background .16s ease, border-color .16s ease;
}
.sidebar .sidebar-item:hover,
.sidebar .sidebar-item.site-card:hover { color: #fff; background: #17293f; border-color: #2b5377; transform: none; box-shadow: none; }
.sidebar .sidebar-item.is-active,
.sidebar .sidebar-item.site-card.is-active { color: #fff; background: #17293f; border-color: var(--primary); box-shadow: inset 3px 0 var(--primary); }
.sidebar .sidebar-item__main {
  display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 58px; padding: 8px 10px; color: inherit; background: transparent; border: 0; border-radius: 8px;
  text-align: left; cursor: pointer; font: inherit;
}
.sidebar .sidebar-item__main:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.sidebar .sidebar-item__icon {
  display: grid; width: 32px; height: 32px; place-items: center; overflow: hidden;
  border-radius: 8px; background: #1b3148; color: #fff;
}
.sidebar .sidebar-item__icon img { width: 32px; height: 32px; object-fit: contain; background: #fff; display: block; }
.sidebar .sidebar-item__letter { display: grid; width: 32px; height: 32px; place-items: center; font-size: 14px; font-weight: 700; line-height: 1; }
.sidebar .sidebar-item__icon svg { width: 18px; height: 18px; }
.sidebar .sidebar-item__icon--telegram { color: #fff; background: #229ed9; }
.sidebar .sidebar-item__icon--instagram { color: #fff; background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.sidebar .sidebar-item__icon--whatsapp { color: #fff; background: #25d366; }
.sidebar .sidebar-item__text { display: grid; min-width: 0; gap: 2px; }
.sidebar .sidebar-item__text b,
.sidebar .sidebar-item__text small,
.sidebar .sidebar-item__text em { display: block; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .sidebar-item__text b { color: inherit; font-size: 12px; font-weight: 700; line-height: 1.25; }
.sidebar .sidebar-item__text small { color: #93abc7; font-size: 10px; line-height: 1.25; }
.sidebar .sidebar-item__text em { color: #7f98b4; font-size: 9px; font-style: normal; line-height: 1.25; }
.sidebar .sidebar-item__status { display: inline-flex !important; align-items: center; gap: 5px; }
.sidebar .sidebar-item__status i { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: #7f98b4; }
.sidebar .sidebar-item__status--ok i { background: #22c55e; }
.sidebar .sidebar-item__status--busy i { background: #38bdf8; }
.sidebar .sidebar-item__status--error i { background: #ef4444; }
.sidebar .sidebar-item__badge { min-width: 18px; padding: 2px 5px; color: #06231f; background: var(--primary); border-radius: 10px; font-size: 9px; font-style: normal; text-align: center; }
/* "+ Новый сайт" and "+ Добавить соцсеть": one size, one style. */
.sidebar #addSiteBtn,
.sidebar #addSocialNetworksBtn { min-height: 40px; height: 40px; margin: 0; padding: 0 14px; gap: 8px; font-size: 13px; font-weight: 600; border-radius: 8px; }
.sidebar #addSiteBtn { margin-bottom: 14px; }
.sidebar #addSocialNetworksBtn { margin-top: 14px; }
/* On a phone the open menu sits above its dimmed backdrop (the backdrop is z-index 1000; the
   ≤760px rule above gave the menu 50, so the menu was dimmed and taps went to the backdrop). */
@media (max-width: 900px) { body.project-drawer-open .sidebar { z-index: 1001; } }
/* 06.10: the quoted message above a customer's reply in the Inbox (omniReplyPreview in app.js). */
.omni-message__reply { margin: 4px 0 6px; padding: 4px 8px; border-left: 3px solid var(--primary); background: rgba(24, 200, 193, .08); border-radius: 4px; display: grid; gap: 1px; font-size: 12px; }
.omni-message__reply b { font-size: 11px; color: var(--primary); }
.omni-message__reply span { color: inherit; opacity: .85; overflow-wrap: anywhere; }
/* 06.10: temporary access links that still work for the open conversation (omniAccessMarkup). */
.omni-access { margin: 8px 0; padding: 8px 12px; border: 1px solid var(--border, #e3eaf2); border-left: 3px solid var(--warning, #f59e0b); border-radius: 8px; display: grid; gap: 6px; font-size: 13px; }
.omni-access > b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.omni-access__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.omni-access__row span { overflow-wrap: anywhere; }
.omni-access__row .btn { min-height: 32px; padding: 4px 12px; }
