
  :root {
    --bg:        #F6F9F8;
    --bg-2:      #EDF3F1;
    --surface:   #FFFFFF;
    --surface-2: #F2F6F5;
    --border:    #E1EAE7;
    --border-2:  #D0DDD9;

    --ink:       #0A1917;
    --ink-2:     #485B57;
    --ink-3:     #788C87;

    --brand:     #0B6B62;
    --brand-2:   #08544D;
    --brand-3:   #12A594;
    --brand-soft:#E4F2EF;

    --amber:     #B87514;
    --amber-soft:#FBF0DC;

    --msgr:      #0A7CFF;
    --msgr-soft: #E8F2FF;

    --good:      #1B7F4B;
    --good-soft: #E3F3EA;

    --shadow-s: 0 1px 2px rgba(10,25,23,.05), 0 2px 6px rgba(10,25,23,.04);
    --shadow-l: 0 2px 6px rgba(10,25,23,.05), 0 18px 44px -12px rgba(10,25,23,.16);

    --f: 'Golos Text', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --f-mono: 'IBM Plex Mono', Consolas, monospace;

    --r-s: 10px;
    --r-m: 16px;
    --r-l: 22px;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg:        #070D0C;
      --bg-2:      #0C1413;
      --surface:   #101A18;
      --surface-2: #172321;
      --border:    #22302D;
      --border-2:  #2D3E3A;

      --ink:       #E8EFED;
      --ink-2:     #AEBFBA;
      --ink-3:     #7B8D89;

      --brand:     #3FBCA9;
      --brand-2:   #6BD4C3;
      --brand-3:   #2AA391;
      --brand-soft:#0E2E2A;

      --amber:     #E0A24F;
      --amber-soft:#2A2113;

      --msgr:      #4DA3FF;
      --msgr-soft: #10233A;

      --good:      #4FBE83;
      --good-soft: #10291C;

      --shadow-s: 0 1px 2px rgba(0,0,0,.4);
      --shadow-l: 0 2px 8px rgba(0,0,0,.4), 0 20px 50px -14px rgba(0,0,0,.65);
    }
  }

  :root[data-theme="dark"] {
    --bg:        #070D0C;
    --bg-2:      #0C1413;
    --surface:   #101A18;
    --surface-2: #172321;
    --border:    #22302D;
    --border-2:  #2D3E3A;
    --ink:       #E8EFED;
    --ink-2:     #AEBFBA;
    --ink-3:     #7B8D89;
    --brand:     #3FBCA9;
    --brand-2:   #6BD4C3;
    --brand-3:   #2AA391;
    --brand-soft:#0E2E2A;
    --amber:     #E0A24F;
    --amber-soft:#2A2113;
    --msgr:      #4DA3FF;
    --msgr-soft: #10233A;
    --good:      #4FBE83;
    --good-soft: #10291C;
    --shadow-s: 0 1px 2px rgba(0,0,0,.4);
    --shadow-l: 0 2px 8px rgba(0,0,0,.4), 0 20px 50px -14px rgba(0,0,0,.65);
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; scroll-padding-top: 88px; }

  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--f);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  .wrap { width: min(1240px, 100% - 40px); margin-inline: auto; }

  a { color: inherit; text-decoration: none; }
  :focus-visible { outline: 2.5px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

  h1, h2, h3, h4 { margin: 0; letter-spacing: -.028em; text-wrap: balance; }
  p { margin: 0; }
  ul { margin: 0; padding: 0; list-style: none; }

  /* ---------------- header ---------------- */

  header.nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 82%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease;
  }
  header.nav.stuck { border-bottom-color: var(--border); }
  .nav-in { display: flex; align-items: center; gap: 30px; height: 66px; }

  .brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 19px; letter-spacing: -.03em; }
  .brand .mark {
    width: 27px; height: 27px; border-radius: 8px;
    background: linear-gradient(140deg, var(--brand-3), var(--brand));
    display: grid; place-items: center; flex: none;
  }
  .brand .mark svg { display: block; }

  .nav-links { display: flex; gap: 26px; font-size: 15.5px; font-weight: 500; color: var(--ink-2); }
  .nav-links a:hover { color: var(--ink); }
  .nav-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
  @media (max-width: 980px) { .nav-links { display: none; } }
  @media (max-width: 560px) { .nav-right .ghost-link { display: none; } }

  .ghost-link { font-size: 15.5px; font-weight: 500; color: var(--ink-2); }
  .ghost-link:hover { color: var(--ink); }

  /* ---------------- buttons ---------------- */

  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-family: var(--f); font-weight: 600; font-size: 15.5px;
    padding: 11px 20px; border-radius: var(--r-s);
    border: 1px solid transparent; cursor: pointer; white-space: nowrap;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
  }
  .btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-s); }
  :root[data-theme="dark"] .btn-primary { color: #04120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #04120F; } }
  .btn-primary:hover { background: var(--brand-2); transform: translateY(-1px); }
  .btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
  .btn-outline:hover { border-color: var(--ink-3); }
  .btn-lg { font-size: 16.5px; padding: 14px 26px; border-radius: 12px; }

  /* ---------------- hero ---------------- */

  .hero { position: relative; padding: 66px 0 0; overflow: hidden; }
  .hero::before {
    content: ""; position: absolute; inset: -220px 0 auto 0; height: 720px; z-index: -1;
    background:
      radial-gradient(680px 380px at 22% 30%, color-mix(in srgb, var(--brand-3) 17%, transparent), transparent 70%),
      radial-gradient(560px 340px at 82% 8%, color-mix(in srgb, var(--msgr) 12%, transparent), transparent 70%);
  }

  .pill {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--surface); border: 1px solid var(--border);
    padding: 6px 14px 6px 8px; border-radius: 999px;
    font-size: 13.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--shadow-s);
  }
  .pill b { color: var(--brand); font-weight: 600; }
  .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }

  h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; font-weight: 700; margin: 22px 0 0; max-width: 17ch; }
  .hero-sub { font-size: clamp(17px, 1.9vw, 20px); color: var(--ink-2); max-width: 54ch; margin: 20px 0 0; line-height: 1.5; }
  .hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
  .hero-fine { margin-top: 18px; font-size: 14.5px; color: var(--ink-3); }
  .hero-fine b { color: var(--ink-2); font-weight: 500; }

  /* ---------------- app mockup ---------------- */

  .mock {
    border: 1px solid var(--border);
    border-radius: var(--r-l);
    background: var(--surface);
    box-shadow: var(--shadow-l);
    overflow: hidden;
  }
  .mock-chrome {
    display: flex; align-items: center; gap: 8px;
    padding: 11px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  }
  .tl { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); flex: none; }
  .url {
    margin-left: 8px; font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3);
    background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
    padding: 3px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }

  .app { display: grid; grid-template-columns: 208px minmax(0, 1fr); min-height: 396px; }
  .app-side { border-right: 1px solid var(--border); padding: 16px 12px; background: var(--surface-2); }
  .app-side .grp { font-family: var(--f-mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 0 10px; margin: 14px 0 7px; }
  .app-side .grp:first-child { margin-top: 4px; }
  .side-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
  .side-item.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
  .side-item .badge { margin-left: auto; font-size: 11px; font-family: var(--f-mono); background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 7px; }
  :root[data-theme="dark"] .side-item .badge { color: #04120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side-item .badge { color: #04120F; } }

  .app-main { display: flex; flex-direction: column; min-width: 0; }
  .thread-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .av { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 13.5px; color: #fff; flex: none; background: linear-gradient(140deg, #7A8FC4, #4E63A0); }
  .av.b { background: linear-gradient(140deg, var(--brand-3), var(--brand)); }
  .av.c { background: linear-gradient(140deg, #C08A6A, #9A6244); }
  .who { font-weight: 600; font-size: 15px; line-height: 1.25; }
  .who small { display: block; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
  .chan { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--msgr); background: var(--msgr-soft); padding: 4px 11px; border-radius: 999px; }

  .thread { flex: 1; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
  .bub { max-width: 74%; padding: 10px 15px; border-radius: 15px; font-size: 14.5px; line-height: 1.45; }
  .bub.in { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 5px; align-self: flex-start; }
  .bub.out { background: var(--brand); color: #fff; border-bottom-right-radius: 5px; align-self: flex-end; }
  :root[data-theme="dark"] .bub.out { color: #04120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bub.out { color: #04120F; } }
  .bub-tag { font-family: var(--f-mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; opacity: .72; display: block; margin-bottom: 3px; }
  .quick { display: flex; gap: 8px; flex-wrap: wrap; align-self: flex-end; }
  .qbtn { font-size: 13px; font-weight: 500; border: 1px solid var(--border-2); border-radius: 999px; padding: 6px 14px; color: var(--ink-2); background: var(--surface); }
  .qbtn.hi { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 600; }

  @media (max-width: 720px) {
    .app { grid-template-columns: 1fr; }
    .app-side { display: none; }
  }

  .hero-mock { margin-top: 54px; padding-bottom: 12px; }

  /* ---------------- sections ---------------- */

  section { padding: 96px 0; }
  .sec-head { max-width: 60ch; }
  .eyebrow { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--brand); }
  h2 { font-size: clamp(27px, 3.6vw, 42px); line-height: 1.1; font-weight: 700; margin: 14px 0 0; }
  .sec-sub { font-size: 18px; color: var(--ink-2); margin: 16px 0 0; line-height: 1.55; }

  .band { background: var(--bg-2); border-block: 1px solid var(--border); }

  /* feature grid */
  .grid-6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
  @media (max-width: 950px) { .grid-6 { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 620px) { .grid-6 { grid-template-columns: 1fr; } }
  .fcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 24px 24px 26px; box-shadow: var(--shadow-s); }
  .ficon { width: 40px; height: 40px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 16px; }
  .fcard h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
  .fcard p { font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }

  /* split blocks */
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; }
  .split.rev { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .split.rev .copy { order: 2; }
  @media (max-width: 980px) {
    .split, .split.rev { grid-template-columns: 1fr; gap: 40px; }
    .split.rev .copy { order: 0; }
  }
  .copy h2 { font-size: clamp(25px, 3vw, 36px); }
  .copy .sec-sub { font-size: 17px; }
  .ticks { margin-top: 26px; display: grid; gap: 12px; }
  .ticks li { display: grid; grid-template-columns: 22px 1fr; gap: 11px; font-size: 16px; color: var(--ink-2); align-items: start; }
  .tk { color: var(--brand); font-weight: 700; line-height: 1.5; }

  /* flow builder */
  .flow-canvas {
    background:
      radial-gradient(circle at 1px 1px, var(--border-2) 1px, transparent 0) 0 0 / 20px 20px,
      var(--surface);
    border: 1px solid var(--border); border-radius: var(--r-l); padding: 26px;
    box-shadow: var(--shadow-l); overflow-x: auto;
  }
  .flow-canvas svg { display: block; width: 100%; height: auto; min-width: 460px; color: var(--ink-3); }

  /* inbox mock */
  .inbox { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 356px; }
  .ib-list { border-right: 1px solid var(--border); background: var(--surface-2); padding: 10px; display: flex; flex-direction: column; gap: 4px; }
  .ib-search { font-size: 13px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; margin-bottom: 6px; }
  .ib-row { display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 10px; padding: 9px 10px; border-radius: 9px; align-items: center; }
  .ib-row.on { background: var(--surface); box-shadow: var(--shadow-s); }
  .ib-row .av { width: 30px; height: 30px; font-size: 12px; }
  .ib-nm { font-size: 14px; font-weight: 600; line-height: 1.2; }
  .ib-nm small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .unread { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
  .ib-time { font-size: 11px; color: var(--ink-3); font-family: var(--f-mono); }
  .composer { border-top: 1px solid var(--border); padding: 12px 20px; display: flex; gap: 10px; align-items: center; }
  .composer .field { flex: 1; font-size: 14px; color: var(--ink-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 9px 14px; }
  @media (max-width: 720px) { .inbox { grid-template-columns: 1fr; } .ib-list { display: none; } }

  /* analytics */
  .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
  @media (max-width: 560px) { .stats { grid-template-columns: 1fr; } }
  .stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 13px; padding: 15px 17px 17px; }
  .stat .lb { font-size: 12.5px; color: var(--ink-3); }
  .stat .vl { font-size: 27px; font-weight: 700; letter-spacing: -.03em; margin-top: 5px; font-variant-numeric: tabular-nums; }
  .stat .dl { font-size: 12.5px; font-weight: 600; color: var(--good); margin-top: 3px; }
  .chart-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 24px; box-shadow: var(--shadow-l); }
  .chart-title { font-size: 15px; font-weight: 600; }
  .chart-note { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
  .chart-box svg { display: block; width: 100%; height: auto; margin-top: 18px; }

  /* use cases */
  .cases { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-top: 46px; }
  @media (max-width: 1080px) { .cases { grid-template-columns: repeat(3, 1fr); } }
  @media (max-width: 720px) { .cases { grid-template-columns: 1fr; } }
  .case { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 22px 20px 24px; }
  .case .em { font-size: 22px; }
  .case h3 { font-size: 16.5px; font-weight: 600; margin: 12px 0 7px; }
  .case p { font-size: 14.5px; color: var(--ink-2); line-height: 1.45; }

  /* connect steps */
  .steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 46px; }
  @media (max-width: 860px) { .steps3 { grid-template-columns: 1fr; } }
  .step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 26px 24px 28px; position: relative; }
  .step .no { font-family: var(--f-mono); font-size: 12px; color: var(--brand); letter-spacing: .1em; }
  .step h3 { font-size: 19px; font-weight: 600; margin: 12px 0 9px; }
  .step p { font-size: 15.5px; color: var(--ink-2); line-height: 1.5; }

  .meta-dialog { max-width: 400px; margin: 46px auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); box-shadow: var(--shadow-l); overflow: hidden; }
  .md-top { padding: 15px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; }
  .md-body { padding: 18px 20px 20px; }
  .md-body p { font-size: 14px; color: var(--ink-2); margin-bottom: 14px; }
  .md-opt { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; font-size: 14.5px; font-weight: 500; }
  .md-opt.sel { border-color: var(--brand); background: var(--brand-soft); }
  .rad { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--border-2); flex: none; }
  .md-opt.sel .rad { border-color: var(--brand); border-width: 5px; }
  .md-foot { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); display: flex; justify-content: flex-end; gap: 10px; }

  /* agency table */
  .table-mock { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
  thead th { text-align: left; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; padding: 0 16px 12px; }
  tbody td { padding: 13px 16px; border-top: 1px solid var(--border); }
  tbody tr:first-child td { border-top: 1px solid var(--border-2); }
  .cli { display: flex; align-items: center; gap: 11px; font-weight: 600; }
  .cli .av { width: 28px; height: 28px; font-size: 11.5px; }
  .pg { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-2); font-size: 14.5px; }
  .st { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--good); background: var(--good-soft); padding: 4px 11px; border-radius: 999px; }
  .st.wait { color: var(--amber); background: var(--amber-soft); }

  /* security */
  .sec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-top: 44px; }
  .sitem { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 22px; display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; }
  .sitem .si { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
  .sitem p { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
  .sitem b { color: var(--ink); font-weight: 600; display: block; margin-bottom: 4px; font-size: 15.5px; }

  /* pricing */
  .plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 48px; align-items: start; }
  @media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
  .plan { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l); padding: 30px 28px 32px; display: flex; flex-direction: column; box-shadow: var(--shadow-s); }
  .plan.best { border: 2px solid var(--brand); box-shadow: var(--shadow-l); position: relative; }
  .best-tag { position: absolute; top: -12px; left: 28px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; padding: 4px 13px; border-radius: 999px; }
  :root[data-theme="dark"] .best-tag { color: #04120F; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .best-tag { color: #04120F; } }
  .plan .pn { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--ink-3); }
  .plan .pv { font-size: 42px; font-weight: 700; letter-spacing: -.04em; margin: 14px 0 2px; font-variant-numeric: tabular-nums; }
  .plan .pu { font-size: 14px; color: var(--ink-3); }
  .plan ul { margin: 24px 0 28px; display: grid; gap: 11px; font-size: 15px; color: var(--ink-2); }
  .plan ul li { display: grid; grid-template-columns: 20px 1fr; gap: 9px; }
  .plan .btn { margin-top: auto; width: 100%; }

  /* faq */
  .faq { margin-top: 44px; max-width: 860px; }
  details { border-bottom: 1px solid var(--border); }
  details:first-child { border-top: 1px solid var(--border); }
  summary { cursor: pointer; list-style: none; padding: 21px 44px 21px 0; font-weight: 600; font-size: 17.5px; position: relative; }
  summary::-webkit-details-marker { display: none; }
  summary::after { content: ""; position: absolute; right: 10px; top: 50%; width: 11px; height: 11px; margin-top: -7px; border-right: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(45deg); transition: transform .18s ease; }
  details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
  details p { padding-bottom: 24px; color: var(--ink-2); font-size: 16px; max-width: 74ch; }
  details p + p { margin-top: -10px; }

  /* cta */
  .cta-band {
    background: linear-gradient(135deg, var(--brand), var(--brand-3));
    border-radius: var(--r-l); padding: clamp(40px, 6vw, 72px); text-align: center; color: #fff;
  }
  .cta-band h2 { color: #fff; max-width: 20ch; margin-inline: auto; }
  .cta-band p { color: rgba(255,255,255,.86); font-size: 18px; margin: 18px auto 30px; max-width: 48ch; }
  .cta-band .btn { background: #fff; color: var(--brand-2); border: none; }
  .cta-band .btn:hover { background: #EAF6F4; }

  /* footer */
  footer { border-top: 1px solid var(--border); padding: 58px 0 44px; margin-top: 96px; }
  .foot-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
  @media (max-width: 860px) { .foot-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
  .foot-col h4 { font-size: 13px; font-family: var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; margin-bottom: 14px; }
  .foot-col li { margin-bottom: 9px; }
  .foot-col a { font-size: 15px; color: var(--ink-2); }
  .foot-col a:hover { color: var(--ink); }
  .foot-about p { font-size: 14.5px; color: var(--ink-3); margin-top: 14px; max-width: 34ch; line-height: 1.5; }
  .legal { margin-top: 44px; padding-top: 26px; border-top: 1px solid var(--border); font-size: 13px; color: var(--ink-3); line-height: 1.55; display: flex; flex-wrap: wrap; gap: 12px 34px; justify-content: space-between; }
  .legal p { max-width: 70ch; }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
  }


/* ===================================================================
   Интерфейс приложения: формы входа, кабинет, конструктор, беседы.
   Токены и стили лендинга подключаются из этого же файла выше.
   =================================================================== */

:root {
  --violet:      #6A4FBF;
  --violet-soft: #EFEAFB;
  --sand:        #96701A;
  --sand-soft:   #F8F0DC;
  --blue:        #2A6FB8;
  --blue-soft:   #E5EFFA;
  --slate:       #55677A;
  --slate-soft:  #EDF1F5;
  --canvas-bg:   #F4F7F6;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --violet: #A992F0; --violet-soft: #221A38;
    --sand:   #DCB463; --sand-soft:   #2C2413;
    --blue:   #6FA8E4; --blue-soft:   #16273A;
    --slate:  #93A6B8; --slate-soft:  #18242E;
    --canvas-bg: #090F0E;
  }
}
:root[data-theme="dark"] {
  --violet: #A992F0; --violet-soft: #221A38;
  --sand:   #DCB463; --sand-soft:   #2C2413;
  --blue:   #6FA8E4; --blue-soft:   #16273A;
  --slate:  #93A6B8; --slate-soft:  #18242E;
  --canvas-bg: #090F0E;
}

/* -------------------------------------------------------- уведомления -- */

.alert {
  border-radius: 12px; padding: 13px 17px; font-size: 15px;
  line-height: 1.45; margin-bottom: 20px; border: 1px solid transparent;
}
.alert-ok    { background: var(--good-soft);  color: var(--good);  border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.alert-error { background: var(--amber-soft); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 34%, transparent); }
.alert-info  { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 26%, transparent); }

/* --------------------------------------------------------------- формы -- */

.form-field { display: block; margin-bottom: 16px; }
.form-field > span.lbl { display: block; font-size: 14px; font-weight: 500; color: var(--ink-2); margin-bottom: 7px; }
.input {
  width: 100%; font-family: var(--f); font-size: 16px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px;
  padding: 12px 14px; transition: border-color .14s ease, box-shadow .14s ease;
}
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.input::placeholder { color: var(--ink-3); }
textarea.input { min-height: 130px; resize: vertical; line-height: 1.5; }

.check-row { display: grid; grid-template-columns: 18px 1fr; gap: 11px; align-items: start; font-size: 14.5px; color: var(--ink-2); line-height: 1.45; margin: 4px 0 20px; }
.check-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand); }
.check-row a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.form-help { font-size: 13.5px; color: var(--ink-3); margin-top: 7px; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 14px; }

/* --------------------------------------------- страницы входа и т. п. -- */

.auth-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.auth-page::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 460px; z-index: 0; pointer-events: none;
  background:
    radial-gradient(620px 340px at 30% 0%, color-mix(in srgb, var(--brand-3) 15%, transparent), transparent 70%),
    radial-gradient(520px 300px at 78% 6%, color-mix(in srgb, var(--msgr) 10%, transparent), transparent 70%);
}
.auth-top { position: relative; z-index: 1; padding: 24px 0; }
.auth-main { position: relative; z-index: 1; flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px 0 70px; }
.auth-card {
  width: min(452px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-l); box-shadow: var(--shadow-l); padding: 34px 34px 32px;
}
.auth-card h1 { font-size: 27px; line-height: 1.2; margin-bottom: 8px; }
.auth-card .sub { font-size: 15.5px; color: var(--ink-2); margin-bottom: 26px; line-height: 1.5; }
.auth-alt { margin-top: 22px; text-align: center; font-size: 15px; color: var(--ink-2); }
.auth-alt a { color: var(--brand); font-weight: 600; }
.auth-minor { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: -4px 0 20px; font-size: 14.5px; }
.auth-minor a { color: var(--brand); font-weight: 500; }
@media (max-width: 520px) { .auth-card { padding: 26px 22px 24px; } }

/* ------------------------------------------------------------- кабинет -- */

.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.shell-side {
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 18px 12px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.shell-side .brand { padding: 0 8px 20px; }
.snav { display: flex; flex-direction: column; gap: 2px; }
.snav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  position: relative;
}
.snav a:hover { background: var(--surface-2); color: var(--ink); }
.snav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.snav a.active::before {
  content: ""; position: absolute; left: -12px; top: 50%; margin-top: -10px;
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--brand);
}
.snav a svg { flex: none; }
.shell-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }
.who-mini { padding: 4px 12px 12px; }
.who-mini .n { font-size: 14px; font-weight: 600; line-height: 1.25; }
.who-mini .m { font-size: 12.5px; color: var(--ink-3); word-break: break-all; }
.logout-btn {
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  font-family: var(--f); font-size: 14.5px; font-weight: 500; color: var(--ink-2);
  padding: 9px 12px; border-radius: 9px; display: flex; align-items: center; gap: 11px;
}
.logout-btn:hover { background: var(--surface-2); color: var(--ink); }

.shell-main { min-width: 0; background: var(--bg); display: flex; flex-direction: column; }
.shell-head {
  border-bottom: 1px solid var(--border); background: var(--surface);
  padding: 18px 28px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.shell-head h1 { font-size: 22px; line-height: 1.2; }
.shell-head p { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.shell-head .sp { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.shell-body { padding: 24px 28px 60px; max-width: 1440px; width: 100%; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .shell-side { position: static; height: auto; flex-direction: row; align-items: center; gap: 6px; padding: 10px 14px; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
  .shell-side .brand { padding: 0 10px 0 0; }
  .snav { flex-direction: row; }
  .snav a span.t { display: none; }
  .snav a.active::before { display: none; }
  .shell-foot { margin-top: 0; padding-top: 0; border-top: none; margin-left: auto; }
  .who-mini { display: none; }
  .logout-btn span.t { display: none; }
  .shell-head, .shell-body { padding-inline: 16px; }
}

/* -------------------------------------------------------------- блоки -- */

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 22px 24px; margin-bottom: 18px; }
.panel h2 { font-size: 18px; margin-bottom: 6px; }
.panel .pd { font-size: 14.5px; color: var(--ink-2); line-height: 1.5; }
.panel-danger { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); }

.empty { background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--r-l); padding: 46px 34px; text-align: center; }
.empty .ic { width: 54px; height: 54px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin: 0 auto 18px; }
.empty h2 { font-size: 20px; margin-bottom: 9px; }
.empty p { font-size: 15px; color: var(--ink-2); max-width: 46ch; margin: 0 auto 22px; line-height: 1.55; }

.conn { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 18px 20px; margin-bottom: 12px; flex-wrap: wrap; }
.conn .logo-sq { width: 44px; height: 44px; border-radius: 12px; background: var(--msgr-soft); display: grid; place-items: center; flex: none; }
.conn .meta { min-width: 0; flex: 1; }
.conn .meta b { display: block; font-size: 16px; font-weight: 600; }
.conn .meta small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 3px; font-family: var(--f-mono); }
.conn .act { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.kv { display: grid; grid-template-columns: 170px 1fr; gap: 10px 20px; font-size: 15px; margin-top: 16px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; }
@media (max-width: 560px) { .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 12px; } }

/* ---------------------------------------------- юридические документы -- */

.doc { max-width: 76ch; padding: 40px 0 80px; }
.doc h1 { font-size: clamp(28px, 4vw, 38px); margin-bottom: 10px; }
.doc .upd { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-3); margin-bottom: 32px; }
.doc h2 { font-size: 20px; margin: 32px 0 12px; }
.doc h3 { font-size: 17px; margin: 22px 0 8px; font-weight: 600; }
.doc p { font-size: 16px; color: var(--ink-2); line-height: 1.65; margin-bottom: 14px; }
.doc ul { list-style: disc; padding-left: 22px; margin-bottom: 16px; }
.doc ul li { font-size: 16px; color: var(--ink-2); line-height: 1.6; margin-bottom: 7px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
.doc-nav { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.doc-nav a { font-size: 14px; font-weight: 500; padding: 7px 15px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--ink-2); }
.doc-nav a.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.errpage { text-align: center; padding: 90px 0 110px; }
.errpage .code { font-family: var(--f-mono); font-size: 15px; color: var(--brand); letter-spacing: .16em; }
.errpage h1 { font-size: clamp(28px, 4vw, 40px); margin: 14px 0 12px; }
.errpage p { font-size: 17px; color: var(--ink-2); max-width: 44ch; margin: 0 auto 28px; }

.plain-head { border-bottom: 1px solid var(--border); background: var(--surface); }
.plain-head .in { display: flex; align-items: center; gap: 20px; height: 64px; }
.plain-head .in .sp { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.plain-foot { border-top: 1px solid var(--border); padding: 26px 0; font-size: 14px; color: var(--ink-3); }
.plain-foot .in { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; }
.plain-foot a { color: var(--ink-3); }
.plain-foot a:hover { color: var(--ink); }

/* ===================================================================
   Общие элементы рабочих экранов
   =================================================================== */

.shell-body.flush { padding: 0; max-width: none; height: calc(100vh - 0px); overflow: hidden; }
@media (max-width: 900px) { .shell-body.flush { height: auto; overflow: visible; } }

.demo-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--sand-soft); color: var(--sand);
  border: 1px solid color-mix(in srgb, var(--sand) 30%, transparent);
  border-radius: 8px; padding: 5px 11px; font-size: 12.5px; font-weight: 500; line-height: 1.3;
}

.badge { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 7px; white-space: nowrap; display: inline-block; }
.badge.pub   { background: var(--good-soft);  color: var(--good); }
.badge.draft { background: var(--slate-soft); color: var(--slate); }
.badge.ok    { background: var(--brand-soft); color: var(--brand); }
.badge.warn  { background: var(--amber-soft); color: var(--amber); }
.badge.info  { background: var(--blue-soft);  color: var(--blue); }
.badge.mute  { background: var(--slate-soft); color: var(--slate); }
.badge .dt { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 6px; vertical-align: middle; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink-2); display: grid; place-items: center;
  cursor: pointer; flex: none;
}
.icon-btn:hover { border-color: var(--ink-3); color: var(--ink); }
.icon-btn.flat { border-color: transparent; background: transparent; }
.icon-btn.flat:hover { background: var(--surface-2); }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg a { font-size: 13px; font-weight: 500; padding: 6px 12px; border-radius: 6px; color: var(--ink-2); white-space: nowrap; }
.seg a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); font-weight: 600; }

.search-box { position: relative; flex: 1; min-width: 160px; }
.search-box .input { padding-left: 36px; font-size: 14px; padding-block: 9px; }
.search-box svg { position: absolute; left: 12px; top: 50%; margin-top: -8px; color: var(--ink-3); }

/* ------------------------------------------------------ KPI обзора ---- */

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px)  { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m); padding: 16px 18px 18px; box-shadow: var(--shadow-s); min-width: 0; }
.tile .tl { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .tv { font-size: 28px; font-weight: 700; letter-spacing: -.035em; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1; }
.tile .tn { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.tile.alert .tv { color: var(--amber); }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===================================================================
   КОНСТРУКТОР
   =================================================================== */

.flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.flow-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-m);
  box-shadow: var(--shadow-s); overflow: hidden; display: flex; flex-direction: column;
}
.flow-card .fc-top { padding: 18px 20px 0; display: flex; align-items: flex-start; gap: 10px; }
.flow-card .fc-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.flow-card .fc-nm { font-size: 16.5px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; }
.flow-card .fc-d { font-size: 14px; color: var(--ink-2); line-height: 1.45; padding: 10px 20px 0; flex: 1; }
.flow-card .fc-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); padding: 14px 20px 0; }
.flow-card .fc-bar { display: flex; align-items: center; gap: 8px; padding: 14px 20px; margin-top: 14px; border-top: 1px solid var(--border); background: var(--surface-2); }
.flow-card .fc-bar .sp { margin-left: auto; display: flex; gap: 6px; }

/* ---- редактор ---- */

.bld { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0,1fr) 336px; height: 100%; }
.bld-top {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.bld-top .nm { font-size: 16px; font-weight: 600; letter-spacing: -.014em; line-height: 1.25; }
.bld-top .sv { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.bld-top .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 14px; font-weight: 500; }
.back-link:hover { color: var(--ink); }
.vsep { width: 1px; height: 26px; background: var(--border); }

.bld-bottom {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-top: 1px solid var(--border); background: var(--surface); flex-wrap: wrap;
}
.bld-bottom .zoom { display: flex; align-items: center; gap: 4px; }
.bld-bottom .zv { font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2); min-width: 42px; text-align: center; }
.bld-bottom .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bld-bottom .hint { font-size: 12.5px; color: var(--ink-3); }

.canvas {
  overflow: auto; position: relative; grid-column: 1; grid-row: 2;
  background:
    radial-gradient(circle at 1px 1px, var(--border-2) 1.2px, transparent 0) 0 0 / 20px 20px,
    var(--canvas-bg);
}
.canvas-in { position: relative; width: 1300px; height: 1010px; }
.wires { position: absolute; inset: 0; width: 1300px; height: 1010px; pointer-events: none; color: var(--slate); }

.node {
  position: absolute; background: var(--surface); border: 1.5px solid var(--border-2);
  border-radius: 12px; box-shadow: var(--shadow-s); cursor: pointer; box-sizing: border-box;
}
.node:hover { border-color: var(--ink-3); box-shadow: var(--shadow-l); }
.node.sel { border-color: var(--brand); border-width: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent), var(--shadow-l); }
.node .n-top { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0; }
.node .n-ic { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.node .n-k { font-size: 11.5px; font-weight: 600; letter-spacing: .01em; }
.node .n-body { padding: 10px 12px 12px; }
.node .n-t { font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.node .n-b { font-size: 12.5px; color: var(--ink-2); margin-top: 5px; line-height: 1.4; }
.node .n-btns { margin-top: 9px; display: grid; gap: 5px; }
.node .n-btn { font-size: 12px; padding: 6px 9px; border-radius: 6px; border: 1px solid var(--border-2); color: var(--ink-2); background: var(--surface-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.node .n-btn .ar { color: var(--ink-3); font-size: 11px; }
.node .n-foot { padding: 0 12px 10px; font-size: 11.5px; color: var(--ink-3); font-family: var(--f-mono); }

.port { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--slate); left: 50%; margin-left: -4.5px; }
.port.in  { top: -5px; }
.port.out { bottom: -5px; }

.node.t-msg   .n-top { background: var(--brand-soft); }
.node.t-msg   .n-ic  { background: var(--brand); color: #fff; }  .node.t-msg   .n-k { color: var(--brand-2); }
.node.t-logic .n-top { background: var(--violet-soft); }
.node.t-logic .n-ic  { background: var(--violet); color: #fff; } .node.t-logic .n-k { color: var(--violet); }
.node.t-data  .n-top { background: var(--sand-soft); }
.node.t-data  .n-ic  { background: var(--sand); color: #fff; }   .node.t-data  .n-k { color: var(--sand); }
.node.t-agent .n-top { background: var(--blue-soft); }
.node.t-agent .n-ic  { background: var(--blue); color: #fff; }   .node.t-agent .n-k { color: var(--blue); }
.node.t-int   .n-top { background: var(--slate-soft); }
.node.t-int   .n-ic  { background: var(--slate); color: #fff; }  .node.t-int   .n-k { color: var(--slate); }
.node.t-start { }
.node.t-start .n-top { background: var(--ink); border-radius: 10px 10px 0 0; }
.node.t-start .n-ic  { background: transparent; color: #fff; }
.node.t-start .n-k   { color: #fff; }
:root[data-theme="dark"] .node.t-start .n-k, :root[data-theme="dark"] .node.t-start .n-ic { color: #08100F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .node.t-start .n-k,
  :root:not([data-theme="light"]) .node.t-start .n-ic { color: #08100F; }
}

/* ---- правая панель конструктора ---- */

.bpanel { grid-column: 2; grid-row: 2; border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.bpanel .bp-tabs { display: flex; border-bottom: 1px solid var(--border); flex: none; }
.bpanel .bp-tabs a { flex: 1; text-align: center; padding: 12px 8px; font-size: 14px; font-weight: 500; color: var(--ink-3); border-bottom: 2px solid transparent; }
.bpanel .bp-tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.bpanel .bp-in { overflow-y: auto; padding: 16px 16px 34px; flex: 1; min-height: 0; }
.bpanel h3 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin: 18px 0 9px; }
.bpanel h3:first-child { margin-top: 0; }

.act-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.act {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 10px 12px;
  background: var(--surface); cursor: grab; display: flex; flex-direction: column; gap: 7px;
}
.act:hover { border-color: var(--brand); background: var(--brand-soft); }
.act .a-ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; }
.act .a-t { font-size: 13px; font-weight: 600; line-height: 1.25; }
.act .a-d { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }

.k-msg   { background: var(--brand-soft);  color: var(--brand); }
.k-logic { background: var(--violet-soft); color: var(--violet); }
.k-data  { background: var(--sand-soft);   color: var(--sand); }
.k-agent { background: var(--blue-soft);   color: var(--blue); }
.k-int   { background: var(--slate-soft);  color: var(--slate); }

.insp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.insp-head .n-ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--brand); color: #fff; }
.insp-head b { font-size: 15px; font-weight: 600; }
.insp-head small { display: block; font-size: 12px; color: var(--ink-3); }
.bpanel .form-field { margin-bottom: 13px; }
.bpanel .input { font-size: 14px; padding: 9px 11px; }
.bpanel textarea.input { min-height: 80px; }
.i-sect { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--border); }

.chip-list { display: grid; gap: 6px; }
.chip { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 8px; font-size: 13.5px; background: var(--surface-2); }
.chip .gr { color: var(--ink-3); cursor: grab; flex: none; }
.chip .ar { margin-left: auto; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.sw { width: 36px; height: 21px; border-radius: 999px; background: var(--border-2); position: relative; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%; background: var(--surface); }
.sw.on { background: var(--brand); }
.sw.on::after { left: 18px; }

@media (max-width: 1180px) { .bld { grid-template-columns: minmax(0,1fr) 292px; } }
@media (max-width: 900px) {
  .bld { grid-template-columns: 1fr; grid-template-rows: auto auto auto auto; height: auto; }
  .canvas { grid-column: 1; grid-row: 2; height: 60vh; }
  .bpanel { grid-column: 1; grid-row: 3; border-left: none; border-top: 1px solid var(--border); max-height: 60vh; }
}

/* ===================================================================
   БЕСЕДЫ — трёхколоночный инбокс
   =================================================================== */

.inbox3 { display: grid; grid-template-columns: 316px minmax(0, 1fr) 320px; height: 100%; }
@media (max-width: 1180px) { .inbox3 { grid-template-columns: 268px minmax(0,1fr) 288px; } }
@media (max-width: 1024px) { .inbox3 { grid-template-columns: 268px minmax(0,1fr); } .inbox3 .c-info { display: none; } }
@media (max-width: 900px)  { .inbox3 { grid-template-columns: 1fr; height: auto; } .inbox3 .c-side { display: none; } }

.c-side { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.cs-h { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; gap: 9px; flex: none; }
.cs-h .ttl { font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; }
.cs-h .ttl .cnt { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.cs-scroll { overflow-y: auto; flex: 1; min-height: 0; }

.c-row { display: grid; grid-template-columns: 38px minmax(0,1fr); gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: start; position: relative; }
.c-row:hover { background: var(--surface-2); }
.c-row.on { background: var(--brand-soft); }
.c-row.on::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.c-row .av { width: 38px; height: 38px; font-size: 13px; }
.c-row .r-n { font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.c-row .r-n .t { font-size: 11.5px; color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.c-row .r-p { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.c-row .r-m { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 4px; }
.c-row .r-b { margin-top: 7px; display: flex; align-items: center; gap: 7px; }
.c-row .unread { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; }

.c-main { display: flex; flex-direction: column; min-width: 0; background: var(--canvas-bg); }
.c-head { display: flex; align-items: center; gap: 11px; padding: 11px 18px; border-bottom: 1px solid var(--border); background: var(--surface); flex-wrap: wrap; flex: none; }
.c-head .av { width: 36px; height: 36px; font-size: 13px; }
.c-head .who { font-size: 15px; font-weight: 600; line-height: 1.2; }
.c-head .who small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.c-head .sp { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.c-feed { flex: 1; overflow-y: auto; padding: 20px 22px 8px; min-height: 0; }
@media (max-width: 900px) { .c-feed { max-height: 55vh; } }

.msg-row { display: flex; margin-bottom: 14px; }
.msg-row.right { justify-content: flex-end; }
.msg { max-width: 70%; min-width: 0; }
.msg .m-lab { font-size: 11px; color: var(--ink-3); margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.msg-row.right .m-lab { justify-content: flex-end; }
.m-bub { padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.m-in    { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.m-bot   { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.m-agent { background: var(--blue-soft); color: var(--ink); border: 1px solid color-mix(in srgb, var(--blue) 34%, transparent); border-bottom-right-radius: 4px; }
:root[data-theme="dark"] .m-bot { color: #04120F; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m-bot { color: #04120F; } }
.m-tag { font-size: 10px; font-weight: 600; letter-spacing: .03em; padding: 2px 7px; border-radius: 5px; background: var(--slate-soft); color: var(--slate); }
.m-tag.bot   { background: var(--brand-soft); color: var(--brand); }
.m-tag.agent { background: var(--blue-soft);  color: var(--blue); }

.sys-line { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.sys-line::before, .sys-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sys-line span { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; background: var(--slate-soft); padding: 3px 11px; border-radius: 999px; }

.composer2 { border-top: 1px solid var(--border); background: var(--surface); padding: 10px 16px 12px; flex: none; }
.composer2 .qr { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 9px; }
.composer2 .qr span { font-size: 12.5px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--border-2); color: var(--ink-2); background: var(--surface-2); cursor: pointer; }
.composer2 .qr span:hover { border-color: var(--brand); color: var(--brand); }
.composer2 .cbox { display: flex; align-items: flex-end; gap: 9px; }
.composer2 .field2 { flex: 1; min-height: 40px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 13px; font-size: 14px; color: var(--ink-3); }
.composer2 .tools { display: flex; gap: 4px; }
.composer2 .note { font-size: 11.5px; color: var(--ink-3); margin-top: 7px; }

.c-info { border-left: 1px solid var(--border); background: var(--surface); overflow-y: auto; padding: 16px 16px 34px; }
.c-info h3 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: 10px; }
.info-sect { padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.info-sect:last-child { border-bottom: none; margin-bottom: 0; }
.info-kv { display: grid; grid-template-columns: 88px 1fr; gap: 7px 10px; font-size: 13px; }
.info-kv dt { color: var(--ink-3); }
.info-kv dd { margin: 0; color: var(--ink); word-break: break-word; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag2 { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); }
.tag2.hot { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber); }
.mode-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.mode-box .mb-l { font-size: 12px; color: var(--ink-3); }
.mode-box .mb-v { font-size: 15px; font-weight: 600; margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.mode-box .mb-x { font-size: 12px; color: var(--ink-3); margin-top: 7px; line-height: 1.4; }
