/* ==========================================================
   CodeLux AI — интерфейс
   Светлая и тёмная темы, шрифт Inter (400/500/600)
   ========================================================== */

:root,
[data-theme="light"] {
  --bg: #ffffff;
  --sb: #f8f8f7;
  --soft: #f3f3f2;
  --soft-2: #ececea;
  --hover: rgba(15, 15, 20, .045);
  --active: rgba(15, 15, 20, .075);
  --input: #f4f4f3;
  --pop: #ffffff;
  --text: #1d1d21;
  --text-2: #55575f;
  --muted: #8b8d96;
  --line: rgba(15, 15, 20, .07);
  --acc: #6a55f0;
  --acc-h: #5a45e0;
  --acc-soft: rgba(106, 85, 240, .09);
  --acc-text: #5a45e0;
  --on-acc: #ffffff;
  --ok: #16a36a;
  --ok-soft: rgba(22, 163, 106, .1);
  --warn: #c27c0e;
  --warn-soft: rgba(194, 124, 14, .1);
  --err: #d9433f;
  --err-soft: rgba(217, 67, 63, .09);
  --code-bg: #f7f7f6;
  --code-text: #2b2d35;
  --stage: #efefed;
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, .05);
  --shadow: 0 2px 6px rgba(15, 15, 20, .04), 0 10px 30px rgba(15, 15, 20, .07);
  --shadow-pop: 0 4px 12px rgba(15, 15, 20, .06), 0 20px 50px rgba(15, 15, 20, .14);
  --backdrop: rgba(20, 20, 26, .32);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1b1b1e;
  --sb: #141416;
  --soft: #27272b;
  --soft-2: #303035;
  --hover: rgba(255, 255, 255, .045);
  --active: rgba(255, 255, 255, .08);
  --input: #26262a;
  --pop: #1f1f22;
  --text: #ececee;
  --text-2: #a9abb3;
  --muted: #74767f;
  --line: rgba(255, 255, 255, .07);
  --acc: #8a7aff;
  --acc-h: #9b8dff;
  --acc-soft: rgba(138, 122, 255, .13);
  --acc-text: #a99dff;
  --on-acc: #ffffff;
  --ok: #3ccf8e;
  --ok-soft: rgba(60, 207, 142, .12);
  --warn: #f0b440;
  --warn-soft: rgba(240, 180, 64, .12);
  --err: #f27470;
  --err-soft: rgba(242, 116, 112, .12);
  --code-bg: #161618;
  --code-text: #d7d9e0;
  --stage: #121214;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .3);
  --shadow-pop: 0 4px 12px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .5);
  --backdrop: rgba(0, 0, 0, .55);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #1b1b1e;
    --sb: #141416;
    --soft: #27272b;
    --soft-2: #303035;
    --hover: rgba(255, 255, 255, .045);
    --active: rgba(255, 255, 255, .08);
    --input: #26262a;
    --pop: #1f1f22;
    --text: #ececee;
    --text-2: #a9abb3;
    --muted: #74767f;
    --line: rgba(255, 255, 255, .07);
    --acc: #8a7aff;
    --acc-h: #9b8dff;
    --acc-soft: rgba(138, 122, 255, .13);
    --acc-text: #a99dff;
    --on-acc: #ffffff;
    --ok: #3ccf8e;
    --ok-soft: rgba(60, 207, 142, .12);
    --warn: #f0b440;
    --warn-soft: rgba(240, 180, 64, .12);
    --err: #f27470;
    --err-soft: rgba(242, 116, 112, .12);
    --code-bg: #161618;
    --code-text: #d7d9e0;
    --stage: #121214;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 6px rgba(0, 0, 0, .25), 0 10px 30px rgba(0, 0, 0, .3);
    --shadow-pop: 0 4px 12px rgba(0, 0, 0, .3), 0 24px 60px rgba(0, 0, 0, .5);
    --backdrop: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

:root {
  --r: 10px;
  --r-sm: 8px;
  --r-xs: 6px;
  --sb-w: 264px;
  --sb-rail: 60px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 14.5px/1.6 var(--font);
  font-feature-settings: 'cv11', 'ss01';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; }
p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--acc-soft); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

.ico { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.only-mobile { display: none !important; }

*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--active); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: background .15s, color .15s, opacity .15s, transform .1s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn-acc { background: var(--acc); color: var(--on-acc); }
.btn-acc:hover { background: var(--acc-h); }
.btn-soft { background: var(--soft); color: var(--text); }
.btn-soft:hover { background: var(--soft-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-xs); gap: 6px; }
.btn-xs .ico { width: 14px; height: 14px; }
.btn-lg { height: 44px; font-size: 14.5px; }
.btn-block { width: 100%; }

.ib {
  display: inline-grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.ib:hover { background: var(--hover); color: var(--text); }
.ib:disabled { opacity: .35; pointer-events: none; }
.ib-xs { width: 26px; height: 26px; border-radius: var(--r-xs); }
.ib-xs .ico { width: 15px; height: 15px; }
.ib.copied { color: var(--ok); }

.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  background: var(--soft); color: var(--text);
  font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums;
  transition: background .15s;
}
.chip:hover { background: var(--soft-2); }
.chip .ico { width: 15px; height: 15px; color: var(--acc-text); }

.pill {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 8px 0 10px; border-radius: var(--r-xs);
  background: var(--hover); color: var(--text-2);
  font-size: 13px; cursor: pointer; transition: background .15s, color .15s;
}
.pill:hover { background: var(--active); color: var(--text); }
.pill > .ico { width: 15px; height: 15px; }
.pill select {
  appearance: none; border: 0; outline: none; background: transparent;
  padding: 0 16px 0 0; margin-right: -14px; cursor: pointer; font-size: 13px; color: inherit;
  position: relative; z-index: 1;
}
.pill select option { background: var(--pop); color: var(--text); }
.pill .pill-chev { width: 13px; height: 13px; opacity: .6; pointer-events: none; }
.pill-ghost { background: transparent; }

.seg-group { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--soft); }
.seg-group button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px;
  border-radius: var(--r-xs); color: var(--muted); font-size: 13px; font-weight: 500;
  transition: background .15s, color .15s;
}
.seg-group button .ico { width: 15px; height: 15px; }
.seg-group button:hover { color: var(--text); }
.seg-group button.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------- Формы ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input {
  width: 100%; height: 40px; padding: 0 12px;
  background: var(--input); border: 0; border-radius: var(--r-sm);
  outline: none; transition: box-shadow .15s, background .15s;
}
.input:focus { box-shadow: 0 0 0 2px var(--acc); background: var(--bg); }
.input::placeholder, textarea::placeholder { color: var(--muted); }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
select.input { appearance: none; cursor: pointer; }
.modal .input { background: var(--soft); }
.modal .input:focus { background: var(--pop); }
.input-sm { height: 32px; font-size: 13px; padding: 0 10px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.hint-center { text-align: center; }
.form-error { padding: 10px 12px; border-radius: var(--r-sm); background: var(--err-soft); color: var(--err); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { accent-color: var(--acc); }

.switch { position: relative; display: inline-block; width: 36px; height: 20px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 20px; background: var(--soft-2); transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform .2s var(--ease); }
.switch input:checked + span { background: var(--acc); }
.switch input:checked + span::after { transform: translateX(16px); }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r-xs); font-size: 12px; font-weight: 500; background: var(--soft); color: var(--text-2); white-space: nowrap; }
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-err { background: var(--err-soft); color: var(--err); }
.b-acc { background: var(--acc-soft); color: var(--acc-text); }

.note { display: flex; align-items: flex-start; gap: 10px; padding: 11px 12px; border-radius: var(--r-sm); font-size: 13px; line-height: 1.5; background: var(--soft); color: var(--text-2); }
.note .ico { width: 16px; height: 16px; margin-top: 1px; }
.note-acc { background: var(--acc-soft); color: var(--acc-text); }

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; width: 100%; }
.flash { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: var(--r-sm); font-size: 13.5px; text-align: left; }
.flash .ico { width: 16px; height: 16px; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-err { background: var(--err-soft); color: var(--err); }

/* ---------- Аватары ---------- */
.ava { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-xs); background: var(--acc); color: var(--on-acc); font-size: 12.5px; font-weight: 600; }
.ava-lg { width: 36px; height: 36px; font-size: 14px; border-radius: var(--r-sm); }
.ava-xl { width: 48px; height: 48px; font-size: 18px; border-radius: var(--r); }

/* ==========================================================
   Оболочка
   ========================================================== */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.main { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }

/* ---------- Сайдбар ---------- */
.sb {
  position: relative; z-index: 30; flex: none;
  width: var(--sb-w); display: flex; flex-direction: column;
  background: var(--sb);
  transition: width .22s var(--ease);
}
.sb-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 56px; padding: 0 10px 0 14px; flex: none; }
.sb-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.sb-brand em { font-style: normal; color: var(--acc-text); }
.sb-logo { width: 24px; height: 24px; color: var(--acc); }

.sb-actions { display: flex; flex-direction: column; gap: 1px; padding: 0 8px 8px; flex: none; }
.sb-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 36px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text); font-size: 14px; text-align: left; white-space: nowrap;
  transition: background .15s;
}
.sb-item:hover { background: var(--hover); }
.sb-item .ico { width: 17px; height: 17px; color: var(--text-2); }
.sb-item > span { overflow: hidden; text-overflow: ellipsis; }
.sb-item-sm { height: 32px; font-size: 13.5px; color: var(--text-2); }
.sb-item-sm:hover { color: var(--text); }
.sb-item-sm .ico { width: 16px; height: 16px; color: var(--muted); }
.sb-search { cursor: text; }
.sb-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 14px; }
.sb-search input::-webkit-search-cancel-button { display: none; }
.sb-search:focus-within { background: var(--hover); }

.sb-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 8px 12px; }
.sb-group + .sb-group { margin-top: 18px; }
.sb-label { padding: 0 10px 6px; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.sb-empty, .sb-guest p { padding: 8px 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.sb-proj { position: relative; display: flex; align-items: center; border-radius: var(--r-sm); transition: background .15s; }
.sb-proj:hover, .sb-proj.menu-open { background: var(--hover); }
.sb-proj.active { background: var(--active); }
.sb-proj-link { flex: 1; min-width: 0; display: block; padding: 7px 10px; font-size: 14px; }
.sb-proj-title { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sb-proj:hover .sb-proj-link, .sb-proj.active .sb-proj-link { padding-right: 34px; }
.sb-proj-menu { position: absolute; right: 4px; opacity: 0; }
.sb-proj:hover .sb-proj-menu, .sb-proj.active .sb-proj-menu, .sb-proj.menu-open .sb-proj-menu { opacity: 1; }
.sb-proj-input { flex: 1; min-width: 0; height: 34px; margin: 0 2px; padding: 0 8px; border: 0; outline: none; border-radius: var(--r-xs); background: var(--bg); box-shadow: 0 0 0 2px var(--acc); font-size: 14px; }

.sb-foot { flex: none; padding: 8px; }
.sb-user { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: var(--r-sm); text-align: left; transition: background .15s; }
.sb-user:hover, .sb-user.open { background: var(--hover); }
.sb-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.sb-user-info b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-user-info small { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sb-user-chev { width: 15px; height: 15px; color: var(--muted); transform: rotate(180deg); }
.sb-auth { display: flex; flex-direction: column; gap: 6px; padding: 4px 4px 10px; }
.sb-guest-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 0 6px 4px; }
.sb-guest-foot .seg-group { margin-bottom: 6px; }
.sb-legal { color: var(--muted); font-size: 12px; }
.sb-legal:hover { color: var(--text); }
.sb-backdrop { display: none; }

/* Свёрнутый сайдбар */
.sb-collapsed .sb { width: var(--sb-rail); }
.sb-collapsed .sb-top { flex-direction: column; justify-content: center; height: auto; padding: 12px 0 8px; gap: 6px; }
.sb-collapsed .sb-brand span,
.sb-collapsed .sb-item > span,
.sb-collapsed .sb-search input,
.sb-collapsed .sb-scroll,
.sb-collapsed .sb-user-info,
.sb-collapsed .sb-user-chev,
.sb-collapsed .sb-auth,
.sb-collapsed .sb-guest-foot { display: none; }
.sb-collapsed .sb-actions { padding: 0 10px; align-items: center; }
.sb-collapsed .sb-item { width: 40px; justify-content: center; padding: 0; }
.sb-collapsed .sb-foot { margin-top: auto; display: flex; justify-content: center; }
.sb-collapsed .sb-user { width: auto; padding: 6px; }
.sb-collapsed .sb-toggle .ico { transform: scaleX(-1); }

/* ---------- Поповеры ---------- */
.popover {
  position: fixed; z-index: 80; min-width: 220px; padding: 6px;
  background: var(--pop); border-radius: var(--r); box-shadow: var(--shadow-pop);
  animation: popIn .14s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(4px) scale(.98); } }
.pop-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  height: 34px; padding: 0 10px; border-radius: var(--r-xs);
  font-size: 13.5px; text-align: left; white-space: nowrap; transition: background .12s;
}
.pop-item:hover { background: var(--hover); }
.pop-item .ico { width: 16px; height: 16px; color: var(--text-2); }
.pop-item-sm { height: 30px; font-size: 13px; color: var(--text-2); }
.pop-item-sm .ico { width: 15px; height: 15px; color: var(--muted); }
.pop-danger, .pop-danger .ico { color: var(--err); }
.pop-danger:hover { background: var(--err-soft); }
.pop-sep { height: 1px; margin: 6px 4px; background: var(--line); }
.pop-head { display: flex; align-items: center; gap: 10px; padding: 8px 8px 10px; }
.pop-head div { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pop-head b { font-weight: 500; font-size: 14px; }
.pop-head small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.pop-balance { display: flex; align-items: center; gap: 10px; margin: 0 2px; padding: 10px; border-radius: var(--r-sm); background: var(--soft); }
.pop-balance span { color: var(--muted); font-size: 12.5px; }
.pop-balance b { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.pop-theme { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 2px 10px; font-size: 13.5px; }

/* ---------- Верхняя панель ---------- */
.topbar { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; flex: none; }
.topbar-title { flex: 1; min-width: 0; font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

/* ==========================================================
   Главная
   ========================================================== */
.home { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.home-inner { width: 100%; max-width: 760px; margin: auto; padding: 32px 20px 24px; display: flex; flex-direction: column; align-items: center; }
.home-mark { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: var(--r); background: var(--acc-soft); color: var(--acc); }
.home-mark .ico { width: 26px; height: 26px; }
.home-title { font-size: 30px; font-weight: 500; letter-spacing: -.025em; text-align: center; }
.home-sub { max-width: 520px; margin: 10px 0 30px; color: var(--text-2); font-size: 15px; text-align: center; }

.cmp {
  width: 100%; padding: 12px 12px 10px 16px;
  background: var(--input); border-radius: var(--r);
  transition: box-shadow .2s, background .2s;
}
.cmp:focus-within { background: var(--bg); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.cmp-text {
  display: block; width: 100%; min-height: 52px; max-height: 260px;
  padding: 4px 0; border: 0; outline: none; resize: none; background: transparent;
  font-size: 15px; line-height: 1.6;
}
.cmp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.cmp-opts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.cmp-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12.5px; }
.cmp-meta .ico { width: 14px; height: 14px; }
.cmp-send {
  display: grid; place-items: center; flex: none;
  width: 34px; height: 34px; border-radius: var(--r-sm);
  background: var(--acc); color: var(--on-acc);
  transition: background .15s, opacity .15s, transform .1s;
}
.cmp-send:hover { background: var(--acc-h); }
.cmp-send:active { transform: scale(.94); }
.cmp-send:disabled { opacity: .35; pointer-events: none; }
.cmp-send .ico { width: 18px; height: 18px; stroke-width: 2; }

.examples { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; margin-top: 18px; }
.example {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  border-radius: var(--r); background: var(--soft); text-align: left;
  transition: background .15s, transform .15s;
}
.example:hover { background: var(--soft-2); }
.example-ico { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: var(--r-sm); background: var(--bg); color: var(--acc-text); }
.example-ico .ico { width: 16px; height: 16px; }
.example-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.example-txt b { font-weight: 500; font-size: 14px; }
.example-txt small { margin-top: 2px; color: var(--muted); font-size: 12.5px; }

.home-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 20px; color: var(--muted); font-size: 12px; }
.home-links { display: flex; gap: 16px; }
.home-links button { color: var(--muted); font-size: 12px; }
.home-links button:hover { color: var(--text); }

/* ==========================================================
   Модальные окна
   ========================================================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--backdrop); backdrop-filter: blur(3px); animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-box {
  position: relative; width: 100%; max-width: 560px; max-height: min(86vh, 900px);
  display: flex; flex-direction: column;
  background: var(--pop); border-radius: var(--r); box-shadow: var(--shadow-pop);
  animation: modalIn .22s var(--ease);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
.modal-box.size-sm { max-width: 420px; }
.modal-box.size-md { max-width: 540px; }
.modal-box.size-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 16px 6px 24px; flex: none; }
.modal-head h2 { font-size: 18px; font-weight: 600; }
.modal-body { overflow-y: auto; padding: 10px 24px 24px; }
.modal-loading { display: flex; justify-content: center; padding: 40px 0; color: var(--muted); }
.modal-loading .ico { width: 22px; height: 22px; }

/* Контент страниц */
.prose { color: var(--text); font-size: 14.5px; line-height: 1.7; }
.prose > * + * { margin-top: 14px; }
.prose h3 { margin-top: 26px; font-size: 15.5px; font-weight: 600; }
.prose h4 { font-size: 14.5px; font-weight: 600; }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: 0; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--muted); }
.prose b, .prose strong { font-weight: 600; }
.prose a { color: var(--acc-text); }
.prose a:hover { text-decoration: underline; text-underline-offset: 3px; }
.pg-lead { font-size: 15.5px; color: var(--text-2); }
.pg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pg-card { padding: 14px 16px; border-radius: var(--r); background: var(--soft); }
.pg-card h4 { margin-bottom: 4px; }
.pg-card p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.pg-steps { list-style: none; padding: 0 !important; counter-reset: st; }
.pg-steps li { position: relative; padding: 12px 14px 12px 52px; border-radius: var(--r); background: var(--soft); counter-increment: st; }
.pg-steps li + li { margin-top: 8px; }
.pg-steps li::before { content: counter(st); position: absolute; left: 14px; top: 12px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); font-size: 13px; font-weight: 600; }
.pg-price { border-radius: var(--r); background: var(--soft); padding: 4px 16px; }
.pg-price div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; }
.pg-price div + div { box-shadow: 0 -1px 0 var(--line); }
.pg-price span { color: var(--text-2); }
.pg-price b { font-weight: 600; font-variant-numeric: tabular-nums; }
.pg-quote { padding: 12px 16px; border-radius: var(--r); background: var(--acc-soft); color: var(--text); font-size: 14px; }
.pg-faq { border-radius: var(--r); background: var(--soft); }
.pg-faq + .pg-faq { margin-top: 8px; }
.pg-faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 16px; font-weight: 500; cursor: pointer; list-style: none; }
.pg-faq summary::-webkit-details-marker { display: none; }
.pg-faq summary::after { content: '+'; color: var(--muted); font-size: 20px; font-weight: 400; line-height: 1; transition: transform .2s; }
.pg-faq[open] summary::after { transform: rotate(45deg); }
.pg-faq p { padding: 0 16px 14px; color: var(--text-2); }
.pg-btn { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: var(--r-sm); background: var(--acc); color: var(--on-acc) !important; font-weight: 500; text-decoration: none !important; }
.pg-more { margin-top: 28px; padding-top: 18px; box-shadow: 0 -1px 0 var(--line); }
.pg-more > span { display: block; margin-bottom: 10px; color: var(--muted); font-size: 12.5px; }
.pg-more-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pg-chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-xs); background: var(--soft); color: var(--text-2); font-size: 13px; transition: background .15s, color .15s; }
.pg-chip:hover { background: var(--soft-2); color: var(--text); }
.pg-chip .ico { width: 14px; height: 14px; }

/* Авторизация */
.auth { display: flex; flex-direction: column; gap: 16px; }
.seg-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--soft); }
.seg-tabs button { height: 32px; border-radius: var(--r-xs); color: var(--muted); font-size: 13.5px; font-weight: 500; }
.seg-tabs button.active { background: var(--pop); color: var(--text); box-shadow: var(--shadow-sm); }
.auth-legal { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.auth-legal button { color: var(--text-2); font-size: 12px; text-decoration: underline; text-underline-offset: 2px; }

/* Пополнение */
.topup { display: flex; flex-direction: column; gap: 16px; }
.topup-bal { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: var(--r); background: var(--soft); }
.topup-bal span { color: var(--text-2); font-size: 13px; }
.topup-bal b { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.nets { display: flex; flex-direction: column; gap: 6px; }
.net { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--soft); cursor: pointer; transition: background .15s, box-shadow .15s; }
.net:hover { background: var(--soft-2); }
.net input { position: absolute; opacity: 0; pointer-events: none; }
.net:has(input:checked) { background: var(--acc-soft); box-shadow: inset 0 0 0 1.5px var(--acc); }
.net-name { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.net-name b { font-weight: 500; }
.net-name small { color: var(--muted); font-size: 12.5px; }
.net-addr { display: none; align-items: center; gap: 6px; padding: 6px 6px 6px 10px; border-radius: var(--r-xs); background: var(--pop); }
.net:has(input:checked) .net-addr { display: flex; }
.net-addr code { flex: 1; min-width: 0; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); color: var(--text); }

/* Аккаунт */
.acc { display: flex; flex-direction: column; gap: 14px; }
.acc-head { display: flex; align-items: center; gap: 14px; }
.acc-head div { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.acc-head b { font-weight: 600; font-size: 15px; }
.acc-head small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stats div { padding: 12px 14px; border-radius: var(--r); background: var(--soft); display: flex; flex-direction: column; }
.stats span { color: var(--muted); font-size: 12px; }
.stats b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.acc-h { margin-top: 10px; font-size: 14px; font-weight: 600; }
.list { display: flex; flex-direction: column; border-radius: var(--r); background: var(--soft); padding: 2px 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; }
.list-row + .list-row { box-shadow: 0 -1px 0 var(--line); }
.list-row > div { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.list-row b { font-weight: 500; font-size: 13.5px; }
.list-row small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.amount { font: 13px var(--mono); color: var(--text-2); white-space: nowrap; }
.amount.plus { color: var(--ok); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 10px; color: var(--muted); text-align: center; }
.empty-state .ico { width: 30px; height: 30px; }

/* Уведомления */
.toasts { position: fixed; z-index: 120; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px)); padding: 10px 16px; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-size: 13.5px; box-shadow: var(--shadow-pop); animation: toastIn .25s var(--ease); pointer-events: auto; }
.toast .ico { width: 16px; height: 16px; }
.toast-err .ico { color: var(--err); }
.toast-ok .ico { color: var(--ok); }
.toast.out { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } }

/* ==========================================================
   Конструктор
   ========================================================== */
.ws { flex: 1; min-height: 0; display: flex; }
.conv { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.conv-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 12px 0 16px; flex: none; }
.conv-title {
  flex: 1; min-width: 0; height: 34px; padding: 0 10px; margin-left: -10px;
  border: 0; outline: none; border-radius: var(--r-sm); background: transparent;
  font-size: 15px; font-weight: 500; text-overflow: ellipsis;
  transition: background .15s, box-shadow .15s;
}
.conv-title:hover { background: var(--hover); }
.conv-title:focus { background: var(--bg); box-shadow: 0 0 0 2px var(--acc); }
.conv-top-right { display: flex; align-items: center; gap: 4px; }
.ws.pv-open #btnPreview { background: var(--active); color: var(--text); }

.conv-log { flex: 1; overflow-y: auto; scroll-behavior: smooth; }
.conv-inner { max-width: 760px; margin: 0 auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 22px; }
.conv-input { flex: none; width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px 6px; }
.cmp-chat .cmp-text { min-height: 26px; font-size: 14.5px; }
.conv-hint { padding: 8px 0 10px; color: var(--muted); font-size: 11.5px; text-align: center; }
.is-busy .cmp-chat { opacity: .65; }

.msg { display: flex; gap: 12px; animation: msgIn .25s var(--ease) both; }
@keyframes msgIn { from { opacity: 0; transform: translateY(4px); } }
.msg-user { justify-content: flex-end; }
.msg-user .msg-body { max-width: 80%; padding: 10px 14px; border-radius: var(--r); background: var(--soft); white-space: pre-wrap; }
.msg-bot .msg-body { flex: 1; min-width: 0; padding-top: 3px; }
.msg-body { font-size: 14.5px; line-height: 1.65; overflow-wrap: anywhere; }
.msg-ava { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc); }
.msg-ava .ico { width: 16px; height: 16px; }
.msg-ava-err { background: var(--err-soft); color: var(--err); }
.msg-wait { display: flex; align-items: center; gap: 10px; color: var(--text-2); }
.msg-wait .ico { width: 16px; height: 16px; color: var(--acc); }
.shimmer { background: linear-gradient(90deg, var(--text-2) 0%, var(--text) 40%, var(--text-2) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.msg-error .msg-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.msg-error .msg-body p { color: var(--err); }
.msg-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.msg-actions:empty { display: none; }
.msg-meta { margin-top: -12px; padding-left: 40px; }
.msg-changed { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-changed span { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); background: var(--soft); font: 12px var(--mono); color: var(--text-2); }
.msg-changed .ico { width: 12px; height: 12px; }

.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Карточки плана и сборки */
.card-ai { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px !important; border-radius: var(--r); background: var(--soft); }
.plan-tag { display: inline-block; margin-bottom: 4px; color: var(--acc-text); font-size: 12px; font-weight: 500; }
.plan h4 { font-size: 15.5px; margin-bottom: 4px; }
.plan-head p { color: var(--text-2); font-size: 13.5px; line-height: 1.6; }
.plan-style { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }
.plan-style svg { width: 22px; height: 22px; }
.plan-style span { margin-left: 6px; }
.plan-files { list-style: none; margin: 0; padding: 4px 0; display: flex; flex-direction: column; border-radius: var(--r-sm); background: var(--bg); }
.plan-files li { display: grid; grid-template-columns: 16px 1fr; column-gap: 10px; padding: 8px 12px; }
.plan-files li + li { box-shadow: 0 -1px 0 var(--line); }
.plan-files .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
.plan-files b { font: 500 13px var(--mono); }
.plan-files small { grid-column: 2; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.plan-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-hint { color: var(--muted); font-size: 12.5px; }

.build-head { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.build-count { font: 12px var(--mono); color: var(--muted); }
.build progress { width: 100%; height: 4px; appearance: none; border: 0; border-radius: 4px; overflow: hidden; background: var(--soft-2); }
.build progress::-webkit-progress-bar { background: var(--soft-2); }
.build progress::-webkit-progress-value { background: var(--acc); border-radius: 4px; transition: width .4s var(--ease); }
.build progress::-moz-progress-bar { background: var(--acc); border-radius: 4px; }
.build-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.build-list li { display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: var(--r-xs); font: 13px var(--mono); color: var(--muted); transition: background .2s, color .2s; }
.build-list .bi { display: grid; place-items: center; width: 16px; height: 16px; }
.build-list .bi .ico { width: 15px; height: 15px; }
.build-list .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); opacity: .5; }
.build-list li.active { background: var(--bg); color: var(--text); }
.build-list li.active .bi { color: var(--acc); }
.build-list li.done { color: var(--text-2); }
.build-list li.done .bi { color: var(--ok); }
.build-list li.err, .build-list li.err .bi { color: var(--err); }

/* Панель превью */
.pv { display: none; flex: none; width: 58%; min-width: 0; flex-direction: column; background: var(--sb); }
.ws.pv-open .pv { display: flex; }
.ws.pv-open .conv { flex: 0 0 42%; max-width: 560px; }
.ws.pv-open .conv-inner, .ws.pv-open .conv-input { padding-left: 16px; padding-right: 16px; }
.ws.pv-open .pv { flex: 1; width: auto; }
.pv-top { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 10px; flex: none; }
.pv-devices { margin: 0 auto; }
.pv-tools { display: flex; align-items: center; gap: 2px; }
.pv-order { margin-left: 6px; }
.pv-pane { display: none; flex: 1; min-height: 0; }
.pv-pane.active { display: flex; }

.stage { position: relative; flex: 1; display: flex; justify-content: center; padding: 0 12px 12px; overflow: auto; }
.frame { width: 100%; height: 100%; border-radius: var(--r); overflow: hidden; background: #fff; box-shadow: var(--shadow); transition: max-width .35s var(--ease); }
.frame.device-tablet { max-width: 820px; }
.frame.device-mobile { max-width: 390px; }
.frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.frame.is-empty { visibility: hidden; }
.stage-empty { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 13.5px; }
.stage-empty.show { display: flex; }
.stage-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r); background: var(--soft); color: var(--acc); animation: breathe 2.4s ease-in-out infinite; }
.stage-mark .ico { width: 28px; height: 28px; }
@keyframes breathe { 50% { opacity: .55; } }

.code { flex: 1; display: grid; grid-template-columns: 190px 1fr; min-height: 0; padding: 0 12px 12px; gap: 8px; }
.code-files { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.code-files button { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border-radius: var(--r-xs); color: var(--text-2); font: 12.5px var(--mono); text-align: left; white-space: nowrap; transition: background .12s; }
.code-files button .ico { width: 14px; height: 14px; color: var(--muted); }
.code-files button:hover { background: var(--hover); }
.code-files button.active { background: var(--active); color: var(--text); }
.code-files button.dirty::after { content: ''; width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: var(--warn); }
.code-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-radius: var(--r); overflow: hidden; background: var(--code-bg); }
.code-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 14px; box-shadow: 0 1px 0 var(--line); }
.code-path { font: 12.5px var(--mono); color: var(--text-2); }
.code-editor textarea { flex: 1; width: 100%; padding: 14px 16px; border: 0; outline: none; resize: none; background: transparent; color: var(--code-text); font: 13px/1.7 var(--mono); tab-size: 2; white-space: pre; }

/* ==========================================================
   Админ-панель
   ========================================================== */
.adm { flex: 1; overflow-y: auto; }
.adm-inner { max-width: 1120px; margin: 0 auto; padding: 4px 24px 60px; display: flex; flex-direction: column; gap: 16px; }
.adm-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.adm-head h1 { font-size: 22px; font-weight: 600; }
.adm-tabs { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-sm); background: var(--soft); overflow-x: auto; max-width: 100%; }
.adm-tabs a { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-xs); color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.adm-tabs a .ico { width: 15px; height: 15px; }
.adm-tabs a:hover { color: var(--text); }
.adm-tabs a.active { background: var(--bg); color: var(--text); box-shadow: var(--shadow-sm); }
.count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--err); color: #fff; font-size: 11px; font-weight: 600; }
.box { padding: 20px; border-radius: var(--r); background: var(--soft); }
.box h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.box > .muted { margin: -6px 0 14px; }
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kpi { padding: 16px; border-radius: var(--r); background: var(--soft); display: flex; flex-direction: column; gap: 2px; }
.kpi span { color: var(--muted); font-size: 12.5px; }
.kpi b { font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--text-2); font-size: 12px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { padding: 8px 10px; text-align: left; color: var(--muted); font-size: 12px; font-weight: 500; white-space: nowrap; }
.table td { padding: 10px; vertical-align: middle; box-shadow: 0 -1px 0 var(--line); }
.table td b { font-weight: 500; }
.table .note { display: block; color: var(--muted); font-size: 12px; margin-top: 1px; }
.row-off td { opacity: .5; }
.pays { display: flex; flex-direction: column; gap: 8px; }
.pay { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: var(--r-sm); background: var(--bg); }
.pay-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; font-size: 13.5px; }
.pay-info b { font-size: 18px; font-weight: 600; }
.pay-tx { display: flex; align-items: center; gap: 6px; }
.pay-tx code { font: 12.5px var(--mono); color: var(--acc-text); overflow-wrap: anywhere; }
.pay-form, .inline-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.pay-form .input { flex: 1 1 140px; width: auto; background: var(--soft); }
.inline-form .input { width: 110px; background: var(--bg); }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search .input { background: var(--bg); }
.adm .input { background: var(--bg); }
.adm .input:focus { background: var(--bg); }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.provider { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r-sm); background: var(--bg); }
.provider .input { background: var(--soft); }
.provider-head { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.field em.ok { font-style: normal; color: var(--ok); font-size: 12px; margin-left: 6px; font-weight: 400; }
.save-bar { position: sticky; bottom: 12px; display: flex; justify-content: flex-end; }
.save-bar .btn { box-shadow: var(--shadow-pop); }
.pg-edit { display: grid; grid-template-columns: 1fr 1fr 140px 90px; gap: 12px; }
.pg-edit-content textarea { min-height: 360px; font: 13px/1.6 var(--mono); }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }

/* ==========================================================
   Адаптив
   ========================================================== */
@media (max-width: 1180px) {
  .ws.pv-open .conv { flex-basis: 380px; }
  .pv-order span { display: none; }
  .pv-order { padding: 0 9px; }
  .kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .only-mobile { display: inline-grid !important; }
  .sb {
    position: fixed; top: 0; bottom: 0; left: 0; width: 288px !important;
    transform: translateX(-100%); transition: transform .25s var(--ease);
    box-shadow: var(--shadow-pop);
  }
  .sb-open .sb { transform: none; }
  .sb-open .sb-backdrop { display: block; position: fixed; inset: 0; z-index: 25; background: var(--backdrop); animation: fadeIn .2s; }
  .sb-toggle { display: none; }
  .sb-collapsed .sb-top { flex-direction: row; justify-content: space-between; height: 56px; padding: 0 10px 0 14px; }
  .sb-collapsed .sb-brand span, .sb-collapsed .sb-item > span, .sb-collapsed .sb-search input,
  .sb-collapsed .sb-user-info, .sb-collapsed .sb-user-chev { display: revert; }
  .sb-collapsed .sb-scroll { display: block; }
  .sb-collapsed .sb-auth, .sb-collapsed .sb-guest-foot { display: flex; }
  .sb-collapsed .sb-actions { align-items: stretch; padding: 0 8px 8px; }
  .sb-collapsed .sb-item { width: 100%; justify-content: flex-start; padding: 0 10px; }
  .sb-collapsed .sb-foot { display: block; }
  .sb-collapsed .sb-user { width: 100%; padding: 8px; }
  .sb-proj-menu { opacity: 1; }
  .sb-proj .sb-proj-link { padding-right: 34px; }

  .ws.pv-open .conv { flex: 1; max-width: none; }
  .pv { position: fixed; inset: 0; z-index: 40; width: 100% !important; }
  .ws:not(.pv-mobile) .pv { display: none !important; }
  .ws.pv-mobile .pv { display: flex !important; }
  .pv-devices { display: none; }
  .pv-top { gap: 4px; }
  .pv-tools { margin-left: auto; }
  .code { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .code-files { flex-direction: row; overflow-x: auto; }
  .providers, .pg-edit { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .home-title { font-size: 24px; }
  .home-sub { font-size: 14px; margin-bottom: 22px; }
  .examples, .pg-grid, .grid-2, .kpis { grid-template-columns: 1fr; }
  .examples .example:nth-child(n+3) { display: none; }
  .home-foot { justify-content: center; text-align: center; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box, .modal-box.size-sm, .modal-box.size-md, .modal-box.size-lg { max-width: none; max-height: 92vh; border-radius: var(--r) var(--r) 0 0; animation: sheetIn .26s var(--ease); }
  @keyframes sheetIn { from { transform: translateY(30px); opacity: 0; } }
  .modal-head { padding: 16px 12px 4px 18px; }
  .modal-body { padding: 8px 18px 22px; }
  .conv-top .chip span { display: none; }
  .conv-inner, .conv-input { padding-left: 14px; padding-right: 14px; }
  .msg-user .msg-body { max-width: 90%; }
  .stage { padding: 0 6px 6px; }
  .adm-inner { padding: 4px 14px 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
}

/* Подтверждение */
.btn-danger { background: var(--err); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); }
.confirm-text { color: var(--text-2); line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.msg-body .plan-actions { margin-top: 12px; }
.msg-body > .btn { margin-top: 10px; }

@media (max-width: 640px) {
  #btnRefresh, #btnOpen { display: none; }
  .pv-top { padding: 0 6px; }
  .pv-order { margin-left: 0; }
}

/* ==========================================================
   Доработки
   ========================================================== */
.ava { position: relative; }
.ava-dot { position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--err); box-shadow: 0 0 0 2px var(--sb); }
.count-acc { margin-left: auto; background: var(--acc); }
.pop-item .count { margin-left: auto; }
.form-error-btn { margin-left: 10px; vertical-align: middle; }
.txt-err { color: var(--err) !important; }

.srv { display: flex; flex-direction: column; gap: 14px; }
.srv-intro { color: var(--text-2); font-size: 14px; }
.srv-list { display: flex; flex-direction: column; gap: 6px; }
.srv-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--r); background: var(--soft); text-align: left; transition: background .15s; }
.srv-item:hover { background: var(--soft-2); }
.srv-item.unread { box-shadow: inset 3px 0 0 var(--acc); }
.srv-item-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.srv-item-main b { font-weight: 500; font-size: 14px; }
.srv-item-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.srv-item-side small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.srv-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.srv-steps div { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: var(--r-sm); background: var(--soft); color: var(--text-2); font-size: 12px; line-height: 1.4; }
.srv-steps span { display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); font-weight: 600; font-size: 12px; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-cards label { position: relative; cursor: pointer; }
.radio-cards input { position: absolute; opacity: 0; pointer-events: none; }
.radio-cards span { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px 12px; border-radius: var(--r-sm); background: var(--soft); transition: background .15s, box-shadow .15s; }
.radio-cards b { font-weight: 500; font-size: 14px; }
.radio-cards small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.radio-cards input:checked + span { background: var(--acc-soft); box-shadow: inset 0 0 0 1.5px var(--acc); }

.srv-view { display: flex; flex-direction: column; gap: 14px; }
.srv-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); }
.timeline li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.timeline li::before { content: ''; position: absolute; top: 5px; left: -50%; width: 100%; height: 2px; background: var(--soft-2); z-index: 0; }
.timeline li:first-child::before { display: none; }
.timeline li.done::before, .timeline li.current::before { background: var(--acc); }
.timeline i { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--soft-2); }
.timeline li.done i { background: var(--acc); }
.timeline li.current i { background: var(--pop); box-shadow: inset 0 0 0 3px var(--acc); }
.timeline li.done, .timeline li.current { color: var(--text); }

.srv-state { display: flex; gap: 12px; padding: 14px; border-radius: var(--r); background: var(--soft); }
.srv-state > .ico { width: 20px; height: 20px; margin-top: 1px; color: var(--text-2); }
.srv-state b { font-weight: 600; }
.srv-state p { margin-top: 2px; color: var(--text-2); font-size: 13.5px; }
.srv-state-acc { background: var(--acc-soft); }
.srv-state-acc > .ico { color: var(--acc-text); }
.srv-state-ok { background: var(--ok-soft); }
.srv-state-ok > .ico { color: var(--ok); }
.srv-state-err { background: var(--err-soft); }
.srv-state-err > .ico { color: var(--err); }

.srv-quote { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: var(--r); background: var(--acc-soft); }
.srv-quote-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.srv-quote-nums div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: var(--r-sm); background: var(--pop); }
.srv-quote-nums span { color: var(--muted); font-size: 12px; }
.srv-quote-nums b { font-size: 15px; font-weight: 600; }
.srv-note { color: var(--text); font-size: 13.5px; }
.srv-accept { display: flex; flex-direction: column; gap: 8px; }
.srv-desc { padding: 12px 14px; border-radius: var(--r); background: var(--soft); }
.srv-desc span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; }
.srv-desc p { font-size: 13.5px; color: var(--text-2); }
.srv-back { align-self: center; color: var(--muted); font-size: 13px; }
.srv-back:hover { color: var(--text); }

.thread { display: flex; flex-direction: column; gap: 10px; }
.th-sys { align-self: center; max-width: 90%; padding: 5px 10px; border-radius: var(--r-xs); background: var(--soft); color: var(--muted); font-size: 12px; text-align: center; }
.th-sys span { opacity: .7; margin-left: 4px; }
.th-msg { max-width: 85%; display: flex; flex-direction: column; gap: 3px; }
.th-author { color: var(--muted); font-size: 11.5px; }
.th-body { padding: 9px 12px; border-radius: var(--r); font-size: 13.5px; line-height: 1.55; overflow-wrap: anywhere; }
.th-user { align-self: flex-end; align-items: flex-end; }
.th-user .th-body { background: var(--acc-soft); }
.th-admin .th-body { background: var(--soft); }
.th-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.th-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Баннер доработки в конструкторе */
.srv-banner { display: flex; align-items: center; gap: 10px; margin: 0 16px 6px; padding: 10px 14px; border-radius: var(--r); background: var(--soft); color: var(--text); font-size: 13.5px; text-align: left; transition: background .15s; flex: none; }
.srv-banner:hover { background: var(--soft-2); }
.srv-banner > .ico { width: 17px; height: 17px; color: var(--acc-text); }
.srv-banner span { flex: 1; min-width: 0; }
.srv-banner-quoted, .srv-banner-in_progress { background: var(--acc-soft); }
.srv-banner-chev { transform: rotate(-90deg); color: var(--muted); }
.is-locked .cmp-chat { opacity: .6; }

/* ==========================================================
   Админка: дополнительные блоки
   ========================================================== */
.box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.box-head h2 { margin: 0; }
.link { color: var(--acc-text); font-size: 13px; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.adm a:not(.btn):not(.ib):not(.row):not(.setup-item):not(.user-cell):not(.link-back):not([class*="adm-tabs"]) { color: var(--acc-text); }
.adm-tabs a { color: var(--muted) !important; }
.adm-tabs a.active, .adm-tabs a:hover { color: var(--text) !important; }
.link-back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; align-self: flex-start; }
.link-back .ico { width: 15px; height: 15px; transform: rotate(90deg); }
.link-back:hover { color: var(--text); }

.setup { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.setup-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--bg); transition: background .15s; }
.setup-item:hover { background: var(--hover); }
.setup-item b { display: block; font-weight: 500; font-size: 14px; }
.setup-item small { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.setup-ico { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-xs); background: var(--warn-soft); color: var(--warn); }
.setup-ico .ico { width: 15px; height: 15px; }
.setup-item.ok { opacity: .6; }
.setup-item.ok .setup-ico { background: var(--ok-soft); color: var(--ok); }

.charts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bars { width: 100%; height: 110px; display: block; }
.bars .bar { fill: var(--acc); }
.bars .bar:hover { fill: var(--acc-h); }
.bars .bar-empty { fill: var(--soft-2); }
.bars-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 11.5px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--r-sm); transition: background .12s; }
a.row:hover { background: var(--hover); }
.row + .row { box-shadow: 0 -1px 0 var(--line); }
.row.unread { box-shadow: inset 3px 0 0 var(--acc); }
.row-main { min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.row-main b { font-weight: 500; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-main small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; align-items: center; gap: 8px; flex: none; }
.row-side small { color: var(--muted); font-size: 12px; white-space: nowrap; }

.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { height: 30px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: var(--r-xs); background: var(--soft); color: var(--text-2) !important; font-size: 13px; }
.filters a:hover { background: var(--soft-2); }
.filters a.active { background: var(--text); color: var(--bg) !important; }

.srv-adm { display: grid; grid-template-columns: 1fr 340px; gap: 12px; align-items: start; }
.srv-adm-main, .srv-adm-side { display: flex; flex-direction: column; gap: 12px; }
.srv-adm-desc { font-size: 14px; line-height: 1.65; }
.srv-adm .th-admin .th-body { background: var(--bg); }
.srv-adm .th-sys { background: var(--bg); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; color: var(--text-2); font-size: 13px; }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta .ico { width: 15px; height: 15px; color: var(--muted); }
.meta-col { flex-direction: column; margin: 12px 0; }
.eta { display: flex; flex-wrap: wrap; gap: 6px; }
.eta label { cursor: pointer; }
.eta input { position: absolute; opacity: 0; pointer-events: none; }
.eta span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: var(--r-xs); background: var(--bg); font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.eta span:hover { background: var(--hover); }
.eta input:checked + span { background: var(--acc); color: var(--on-acc); }
.deadline { display: flex; flex-direction: column; padding: 14px; border-radius: var(--r-sm); background: var(--acc-soft); }
.deadline span { color: var(--muted); font-size: 12px; }
.deadline b { font-size: 18px; font-weight: 600; }
.deadline small { color: var(--acc-text); font-size: 13px; }
.deadline.over { background: var(--err-soft); }
.deadline.over small { color: var(--err); }

.user-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.user-card h2 { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-card .stats { grid-column: 1 / -1; }
.stats-4 { grid-template-columns: repeat(4, 1fr); }
.box .stats div { background: var(--bg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-3 .box h2, .grid-2 .box h2 { margin-bottom: 4px; }
.user-cell { display: flex; align-items: center; gap: 10px; color: var(--text) !important; }
.user-cell > span:last-child { display: flex; flex-direction: column; line-height: 1.35; }

.provider-note { margin-top: -6px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.provider-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.provider-test { padding: 9px 12px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.provider-test.is-ok { background: var(--ok-soft); color: var(--ok); }
.provider-test.is-err { background: var(--err-soft); color: var(--err); }

@media (max-width: 1100px) {
  .charts, .grid-3 { grid-template-columns: 1fr; }
  .srv-adm { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .setup, .srv-steps, .radio-cards, .stats-4 { grid-template-columns: 1fr 1fr; }
  .srv-quote-nums { grid-template-columns: 1fr; }
}
.box .btn-soft { background: var(--bg); }
.box .btn-soft:hover { background: var(--hover); box-shadow: inset 0 0 0 100px var(--hover); }

/* Режимы превью и публичная ссылка */
.is-hidden { display: none !important; }
.no-preview .pv-only { display: none !important; }
.stage-backend { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.stage-backend b { font-size: 16px; font-weight: 600; }
.stage-backend p { max-width: 440px; color: var(--text-2); font-size: 13.5px; }
.stage-actions { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.no-preview .stage-backend { display: flex; }
.no-preview #frameWrap, .no-preview #frameEmpty { display: none !important; }
.share { display: flex; flex-direction: column; gap: 14px; }
.share .muted { margin: 0; }
.share-url { display: flex; gap: 8px; }
.share-url .input { flex: 1; min-width: 0; }
.share-actions { display: flex; gap: 8px; }
optgroup { font-weight: 600; color: var(--muted); }
optgroup option { font-weight: 400; color: var(--text); }
.proxy-field { margin-top: 14px; }
.proxy-field .input { background: var(--bg); }

/* ==========================================================
   Тарифы, выбор стека, приветствие
   ========================================================== */
select option, select optgroup { background-color: var(--pop); color: var(--text); }
select optgroup { color: var(--muted); font-style: normal; }

.pick-menu { width: 300px; max-height: min(440px, 70vh); overflow-y: auto; padding: 6px; }
.pick-group { padding: 10px 10px 4px; color: var(--muted); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.pick-group:first-child { padding-top: 4px; }
.pick-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: var(--r-xs); text-align: left; transition: background .12s; }
.pick-item:hover { background: var(--hover); }
.pick-item.on { background: var(--acc-soft); }
.pick-item .ico { width: 16px; height: 16px; color: var(--acc-text); flex: none; }
.pick-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.pick-txt b { font-weight: 500; font-size: 13.5px; }
.pick-txt small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-item.locked .pick-txt { opacity: .6; }
.pick-lock { flex: none; padding: 2px 7px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); font-size: 11px; font-weight: 600; font-style: normal; }
.pick { position: relative; }
.pick .pill { max-width: 240px; }
.pick .pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.modal-box.size-xl { max-width: 1120px; }
.plans-sub { color: var(--text-2); font-size: 14px; margin-bottom: 18px; }
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 20px 18px; border-radius: var(--r); background: var(--soft); }
.plan.is-popular { background: var(--acc-soft); box-shadow: inset 0 0 0 1.5px var(--acc); }
.plan.is-current:not(.is-popular) { box-shadow: inset 0 0 0 1.5px var(--line); }
.plan-flag { position: absolute; top: -10px; left: 18px; padding: 3px 9px; border-radius: var(--r-xs); background: var(--acc); color: var(--on-acc); font-size: 11.5px; font-weight: 600; }
.plan-head h3 { font-size: 17px; font-weight: 600; }
.plan-head p { margin-top: 4px; color: var(--text-2); font-size: 13px; line-height: 1.45; min-height: 38px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price b { font-size: 30px; font-weight: 600; letter-spacing: -.03em; }
.plan-price span { color: var(--muted); font-size: 13px; }
.plan .btn { width: 100%; }
.plan .btn-soft { background: var(--bg); }
.plan .btn-soft:hover { background: var(--hover); box-shadow: inset 0 0 0 100px var(--hover); }
.plan form { display: flex; flex-direction: column; gap: 8px; }
.plan-cur { margin-top: -6px; color: var(--acc-text); font-size: 12px; text-align: center; }
.plan-list { list-style: none; margin: 4px 0 0; padding: 14px 0 0; display: flex; flex-direction: column; gap: 9px; box-shadow: 0 -1px 0 var(--line); }
.plan-list li { display: flex; gap: 9px; font-size: 13px; line-height: 1.45; }
.plan-list .ico { width: 15px; height: 15px; margin-top: 2px; color: var(--ok); }
.plan-list li.off { color: var(--muted); }
.plan-list li.off .ico { color: var(--muted); opacity: .6; }
.plans-foot { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; color: var(--muted); font-size: 12.5px; }
.plans-foot span { display: inline-flex; align-items: center; gap: 7px; }
.plans-foot .ico { width: 14px; height: 14px; }
.plans-bal { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--soft); font-size: 13.5px; }
.plans-bal b { font-weight: 600; margin-right: auto; }

.acc-plan { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--soft); }
.acc-plan.is-paid { background: var(--acc-soft); }
.acc-plan-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.acc-plan-label { color: var(--muted); font-size: 12px; }
.acc-plan b { font-size: 16px; font-weight: 600; }
.acc-plan small { color: var(--text-2); font-size: 12.5px; }
.acc-renew { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: var(--soft); }
.acc-renew span { display: flex; flex-direction: column; line-height: 1.4; }
.acc-renew b { font-weight: 500; font-size: 13.5px; }
.acc-renew small { color: var(--muted); font-size: 12px; }

.sb-plans .ico { color: var(--acc-text) !important; }
.sb-tag { margin-left: auto; padding: 1px 7px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); font-size: 11px; font-weight: 600; font-style: normal; }
.pop-plan { display: flex; align-items: center; gap: 10px; width: calc(100% - 4px); margin: 6px 2px 0; padding: 9px 10px; border-radius: var(--r-sm); background: var(--acc-soft); font-size: 13.5px; text-align: left; }
.pop-plan .ico { width: 16px; height: 16px; color: var(--acc-text); }
.pop-plan span { flex: 1; }
.pop-plan b { font-weight: 600; }
.pop-plan em { font-style: normal; color: var(--acc-text); font-size: 12.5px; font-weight: 500; }
.btn-upgrade .ico { color: var(--acc-text); }

.welcome { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center; }
.welcome-hero { display: flex; flex-direction: column; gap: 12px; padding: 22px; border-radius: var(--r); background: var(--acc-soft); height: 100%; }
.welcome-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); background: var(--pop); color: var(--acc); }
.welcome-mark .ico { width: 24px; height: 24px; }
.welcome-hero h3 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.welcome-hero p { color: var(--text-2); font-size: 14px; }
.welcome-hero ul { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.welcome-hero li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.welcome-hero li .ico { width: 16px; height: 16px; color: var(--acc-text); }
.welcome-bonus { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; margin-top: auto; padding: 7px 12px; border-radius: var(--r-sm); background: var(--pop); font-size: 13px; font-weight: 500; }
.welcome-bonus .ico { width: 15px; height: 15px; color: var(--warn); }
.welcome-switch { text-align: center; color: var(--muted); font-size: 13px; }
.welcome-switch button { color: var(--acc-text); font-weight: 500; font-size: 13px; }

.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.plan-edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.plan-edit { padding: 16px; border-radius: var(--r-sm); background: var(--bg); }
.plan-edit .input { background: var(--soft); }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.user-plan { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.user-plan h2 { margin: 0; }
.user-plan-form { display: flex; gap: 8px; flex-wrap: wrap; }
.user-plan-form .input { width: auto; }
.user-plan-form input.input { width: 90px; }

@media (max-width: 1100px) {
  .plans { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .plan-edit-grid { grid-template-columns: 1fr; }
  .btn-upgrade { display: none; }
}
@media (max-width: 640px) {
  .plans, .welcome, .checks { grid-template-columns: 1fr; }
  .welcome-hero ul, .welcome-bonus { display: none; }
}
.plans-bal .btn-soft, .acc-renew .btn-soft, .acc-plan .btn-soft { background: var(--bg); }

/* ==========================================================
   Вложения, подтверждения, настройки
   ========================================================== */
.ib-sm { width: 30px; height: 30px; border-radius: var(--r-xs); }
.ib-sm .ico { width: 17px; height: 17px; }
.cmp.is-drop { box-shadow: 0 0 0 2px var(--acc), var(--shadow); background: var(--acc-soft); }
.att-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.att { position: relative; display: flex; align-items: center; gap: 8px; max-width: 240px; padding: 5px 30px 5px 5px; border-radius: var(--r-sm); background: var(--bg); overflow: hidden; }
.cmp:focus-within .att { background: var(--soft); }
.att-thumb { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); overflow: hidden; }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-thumb .ico { width: 17px; height: 17px; }
.att-info { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.att-info b { font-weight: 500; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-info small { color: var(--muted); font-size: 11.5px; white-space: nowrap; }
.att-err .att-info small { color: var(--err); }
.att-err .att-thumb { background: var(--err-soft); color: var(--err); }
.att-x { position: absolute; top: 50%; right: 5px; transform: translateY(-50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-xs); color: var(--muted); }
.att-x:hover { background: var(--hover); color: var(--text); }
.att-x .ico { width: 13px; height: 13px; }
.att-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--soft-2); }
.att-bar i { display: block; height: 100%; background: var(--acc); transition: width .2s; }

.msg-user-col { max-width: 80%; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.msg-user-col .msg-body { max-width: 100%; }
.msg-files { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.msg-file { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; height: 34px; padding: 0 10px; border-radius: var(--r-sm); background: var(--soft); font-size: 12.5px; color: var(--text-2); }
.msg-file:hover { background: var(--soft-2); color: var(--text); }
.msg-file .ico { width: 15px; height: 15px; color: var(--acc-text); }
.msg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-file-img { width: 96px; height: 72px; padding: 0; overflow: hidden; }
.msg-file-img img { width: 100%; height: 100%; object-fit: cover; }

.confirm-layer { position: fixed; inset: 0; z-index: 140; display: flex; align-items: center; justify-content: center; padding: 20px; }
.confirm-backdrop { position: absolute; inset: 0; background: var(--backdrop); animation: fadeIn .15s ease; }
.confirm-box { position: relative; width: 100%; max-width: 420px; padding: 22px 22px 18px; border-radius: var(--r); background: var(--pop); box-shadow: var(--shadow-pop); animation: modalIn .18s var(--ease); }
.confirm-box h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.confirm-text { color: var(--text-2); font-size: 14px; line-height: 1.6; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

.settings { display: flex; flex-direction: column; gap: 22px; }
.set-sec h3 { font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.set-sec + .set-sec { padding-top: 20px; box-shadow: 0 -1px 0 var(--line); }
.set-actions { display: flex; justify-content: flex-end; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.set-row > span { display: flex; flex-direction: column; line-height: 1.4; }
.set-row b { font-weight: 500; font-size: 14px; }
.set-row small { color: var(--muted); font-size: 12.5px; }
.set-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.set-link { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--r-sm); background: var(--soft); text-align: left; transition: background .15s; }
.set-link:hover { background: var(--soft-2); }
.set-link .ico { width: 17px; height: 17px; margin-top: 1px; color: var(--acc-text); }
.set-link span { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.set-link b { font-weight: 500; font-size: 13.5px; }
.set-link small { color: var(--muted); font-size: 12px; }
.set-danger h3 { color: var(--err); }
.set-danger .muted { margin-bottom: 12px; }
.set-inline { display: flex; gap: 8px; }
.set-inline .input { flex: 1; }
.btn-danger-soft { color: var(--err) !important; }
.btn-danger-soft:hover { background: var(--err-soft) !important; }
.acc-head .acc-set { margin-left: auto; }
@media (max-width: 640px) {
  .set-links { grid-template-columns: 1fr; }
  .set-row .seg-group button span { display: none; }
}

/* Подсказка «как пользоваться» под полем ввода */
.howto { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; margin-top: 12px; }
.howto-step { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; }
.howto-step span { display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: var(--r-xs); background: var(--acc-soft); color: var(--acc-text); font-size: 12px; font-weight: 600; }
.howto-step p { display: flex; flex-direction: column; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.howto-step b { color: var(--text); font-weight: 500; font-size: 13px; }
@media (max-width: 640px) { .howto { grid-template-columns: 1fr; gap: 0; } .howto-step { padding: 6px 4px; } }